var Ce=Object.defineProperty;var St=t=>{throw TypeError(t)};var Ee=(t,r,e)=>r in t?Ce(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e;var p=(t,r,e)=>Ee(t,typeof r!="symbol"?r+"":r,e),Dt=(t,r,e)=>r.has(t)||St("Cannot "+e);var b=(t,r,e)=>(Dt(t,r,"read from private field"),e?e.call(t):r.get(t)),T=(t,r,e)=>r.has(t)?St("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(t):r.set(t,e),_=(t,r,e,n)=>(Dt(t,r,"write to private field"),n?n.call(t,e):r.set(t,e),e);import{E as Vt,e as Ie,s as xe,c as Pe}from"./index-kuiGTNrJ.js";var te=typeof global=="object"&&global&&global.Object===Object&&global,Me=typeof self=="object"&&self&&self.Object===Object&&self,S=te||Me||Function("return this")(),O=S.Symbol,ee=Object.prototype,Fe=ee.hasOwnProperty,Le=ee.toString,B=O?O.toStringTag:void 0;function Ne(t){var r=Fe.call(t,B),e=t[B];try{t[B]=void 0;var n=!0}catch(s){}var a=Le.call(t);return n&&(r?t[B]=e:delete t[B]),a}var Re=Object.prototype,Ue=Re.toString;function Be(t){return Ue.call(t)}var ke="[object Null]",qe="[object Undefined]",$t=O?O.toStringTag:void 0;function X(t){return t==null?t===void 0?qe:ke:$t&&$t in Object(t)?Ne(t):Be(t)}function R(t){return t!=null&&typeof t=="object"}var nt=Array.isArray;function at(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}function re(t){return t}var He="[object AsyncFunction]",ze="[object Function]",Ge="[object GeneratorFunction]",Ke="[object Proxy]";function ne(t){if(!at(t))return!1;var r=X(t);return r==ze||r==Ge||r==He||r==Ke}var ct=S["__core-js_shared__"],At=function(){var t=/[^.]+$/.exec(ct&&ct.keys&&ct.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function We(t){return!!At&&At in t}var Ye=Function.prototype,Je=Ye.toString;function I(t){if(t!=null){try{return Je.call(t)}catch(r){}try{return t+""}catch(r){}}return""}var Xe=/[\\^$.*+?()[\]{}|]/g,Ze=/^\[object .+?Constructor\]$/,Qe=Function.prototype,Ve=Object.prototype,tr=Qe.toString,er=Ve.hasOwnProperty,rr=RegExp("^"+tr.call(er).replace(Xe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nr(t){if(!at(t)||We(t))return!1;var r=ne(t)?rr:Ze;return r.test(I(t))}function ar(t,r){return t==null?void 0:t[r]}function x(t,r){var e=ar(t,r);return nr(e)?e:void 0}var ht=x(S,"WeakMap"),wt=Object.create,sr=function(){function t(){}return function(r){if(!at(r))return{};if(wt)return wt(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}}();function ir(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)}function or(){}var cr=800,ur=16,fr=Date.now;function hr(t){var r=0,e=0;return function(){var n=fr(),a=ur-(n-e);if(e=n,a>0){if(++r>=cr)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}function dr(t){return function(){return t}}var Q=function(){try{var t=x(Object,"defineProperty");return t({},"",{}),t}catch(r){}}(),lr=Q?function(t,r){return Q(t,"toString",{configurable:!0,enumerable:!1,value:dr(r),writable:!0})}:re,pr=hr(lr);function gr(t,r){for(var e=-1,n=t==null?0:t.length;++e-1}var jr=9007199254740991,Sr=/^(?:0|[1-9]\d*)$/;function Dr(t,r){var e=typeof t;return r=r==null?jr:r,!!r&&(e=="number"||e!="symbol"&&Sr.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=Er}function ie(t){return t!=null&&se(t.length)&&!ne(t)}var Ir=Object.prototype;function oe(t){var r=t&&t.constructor,e=typeof r=="function"&&r.prototype||Ir;return t===e}function xr(t,r){for(var e=-1,n=Array(t);++e-1}function Rn(t,r){var e=this.__data__,n=st(e,t);return n<0?(++this.size,e.push([t,r])):e[n][1]=r,this}function A(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r=vs){var f=Os(t);if(f)return Te(f);i=!1,a=$s,o=new V}else o=c;t:for(;++nu.useInEditor))==null?void 0:i.data)||this.getDefaultData(),n=ot(this.mockData);else if(typeof e.useMock=="boolean"&&e.useMock)this.mockData=(o=(c=e.schema.mocks)==null?void 0:c.find(u=>u.enable))==null?void 0:o.data,n=this.mockData||this.getDefaultData();else if(!e.initialData)n=this.getDefaultData();else{_(this,j,new a((f=e.initialData)!=null?f:{})),this.isInit=!0;return}_(this,j,new a(n!=null?n:{}))}get id(){return b(this,G)}get type(){return b(this,et)}get schema(){return b(this,K)}get fields(){return b(this,v)}get methods(){return b(this,W)}setFields(e){_(this,v,e)}setMethods(e){_(this,W,e)}get data(){return b(this,j).getData("")}setData(e,n){b(this,j).update(e,n);const a={updateData:e,path:n};this.emit("change",a)}setValue(e,n){return this.setData(n,e)}onDataChange(e,n){b(this,j).on(e,n)}offDataChange(e,n){b(this,j).off(e,n)}getDefaultData(){return we(b(this,v))}async init(){this.isInit=!0}destroy(){_(this,v,[]),this.removeAllListeners(),b(this,j).destroy()}}et=new WeakMap,G=new WeakMap,K=new WeakMap,j=new WeakMap,v=new WeakMap,W=new WeakMap;const Kt=t=>Object.entries(t).reduce((r,[e,n])=>{let a=n;return typeof n=="object"&&(a=JSON.stringify(n)),typeof n<"u"?"".concat(r).concat(r?"&":"").concat(globalThis.encodeURIComponent(e),"=").concat(globalThis.encodeURIComponent("".concat(a))):r},""),Is=async t=>{var u;const{url:r,method:e="GET",headers:n={},params:a={},data:s={},...i}=t,c=Kt(a);let o=JSON.stringify(s);return(u=n["Content-Type"])!=null&&u.includes("application/x-www-form-urlencoded")&&(o=Kt(s)),(await globalThis.fetch(c?"".concat(r,"?").concat(c):r,{method:e,headers:n,body:e==="GET"?void 0:o,...i})).json()};var L,Y,J,rt;class xs extends je{constructor(e){const{options:n}=e.schema;super(e);p(this,"isLoading",!1);p(this,"error");p(this,"httpOptions");T(this,L);T(this,Y,[]);T(this,J,[]);T(this,rt,"http");this.httpOptions=n,typeof e.request=="function"?_(this,L,e.request):typeof globalThis.fetch=="function"&&_(this,L,Is),this.methods.forEach(a=>{typeof a.content=="function"&&(a.timing==="beforeRequest"&&b(this,Y).push(a.content),a.timing==="afterRequest"&&b(this,J).push(a.content))})}get type(){return b(this,rt)}async init(){this.schema.autoFetch&&await this.request(),super.init()}async request(e={}){var f,u;this.isLoading=!0;const{url:n,params:a,data:s,headers:i,...c}=this.httpOptions;let o={url:typeof n=="function"?n({app:this.app,dataSource:this}):n,params:typeof a=="function"?a({app:this.app,dataSource:this}):a,data:typeof s=="function"?s({app:this.app,dataSource:this}):s,headers:typeof i=="function"?i({app:this.app,dataSource:this}):i,...c,...e};try{for(const h of b(this,Y))await h({options:o,params:{},dataSource:this,app:this.app});if(typeof this.schema.beforeRequest=="function"&&(o=await this.schema.beforeRequest(o,{app:this.app,dataSource:this})),this.mockData)this.setData(this.mockData);else{let h=await((f=b(this,L))==null?void 0:f.call(this,o));for(const y of b(this,J))await y({res:h,options:o,params:{},dataSource:this,app:this.app});if(typeof this.schema.afterResponse=="function"&&(h=await this.schema.afterResponse(h,{app:this.app,dataSource:this,options:o})),(u=this.schema.responseOptions)!=null&&u.dataPath){const y=E(this.schema.responseOptions.dataPath,h);this.setData(y)}else this.setData(h)}this.error=void 0}catch(h){this.error={msg:h.message},this.emit("error",h)}this.isLoading=!1}get(e){return this.request({...e,method:"GET"})}post(e){return this.request({...e,method:"POST"})}}L=new WeakMap,Y=new WeakMap,J=new WeakMap,rt=new WeakMap;const ft=new Map,Ps=(t,r,e)=>{let n;if(e){const o=[];r.forEach(f=>{ve(f,u=>{o.push(u.id)})}),n="".concat(t.id,":").concat(o.join(":"))}else n="".concat(t.id,":").concat(r.map(o=>o.id).join(":"));if(ft.has(n))return ft.get(n);const a=new zs;a.addTarget(new Zt({id:t.id,type:"data-source",isTarget:(o,f)=>"".concat(o).includes($e)?!1:qs(t,o,f,!0)})),a.addTarget(new Zt({id:t.id,type:"cond",isTarget:(o,f)=>Hs(t,o,f,!0)})),a.collect(r,{},!0);const{deps:s}=a.getTarget(t.id,"data-source"),{deps:i}=a.getTarget(t.id,"cond"),c={deps:s,condDeps:i};return ft.set(n,c),c},Ms=(t,r)=>{let e=!0;for(const{op:n,value:a,range:s,field:i}of t){const[c,...o]=i,f=r[c];if(!f||!o.length)break;try{const u=E(o.join("."),f);if(!Ns(n,u,a,s)){e=!1;break}}catch(u){console.warn(u)}}return e},pt=(t,r)=>{if(!t[M]||!Array.isArray(t[M])||!t[M].length)return!0;for(const{cond:e}of t[M])if(e&&Ms(e,r))return!0;return!1},Wt=(t,r,e=[],n={})=>{const a={...n,[r]:{}};let s=ot(n[r]),i=a[r];return e.forEach((c,o)=>{if(Object.assign(i,s),o===e.length-1){i[c]=t;return}Array.isArray(s[c])&&(s[c]={},i[c]={}),s=s[c],i=i[c]}),a},Fs=(t,r)=>{const[e,...n]=t,a=e.indexOf(tt);if(a>-1){const s=e.substring(a+tt.length),i=r[s];if(!i)return t;try{return E(n.join("."),i)}catch(c){return t}}return t},Yt=(t,r)=>t.replaceAll(Oe,(e,n)=>{try{return E(n,r)}catch(a){return e}}),Jt=(t,r)=>typeof t=="string"?Yt(t,r):t!=null&&t.isBindDataSource&&t.dataSourceId?r[t.dataSourceId]:t!=null&&t.isBindDataSourceField&&t.dataSourceId&&typeof t.template=="string"?Yt(t.template,r[t.dataSourceId]):Array.isArray(t)&&typeof t[0]=="string"?Fs(t,r):t,Se=({compile:t,dsId:r,item:e,deps:n,condDeps:a,inEditor:s,ctxData:i})=>{var u,h;const{items:c,...o}=e,f=ot(o);return(u=a[o.id])!=null&&u.keys.length&&!s&&(f.condResult=pt(o,i)),Array.isArray(c)&&c.length?f.items=c.map(y=>Se({compile:t,dsId:r,item:y,deps:n,condDeps:a,inEditor:s,ctxData:i})):c&&(f.items=c),(h=n[f.id])!=null&&h.keys.length?Ae(t,f,{[r]:n},r):f},D=class D extends Vt{constructor({app:e,useMock:n,initialData:a}){var i,c;super();p(this,"app");p(this,"dataSourceMap",new Map);p(this,"data",{});p(this,"useMock",!1);this.app=e,this.useMock=n,a&&(this.data=a),(c=(i=e.dsl)==null?void 0:i.dataSources)==null||c.forEach(o=>{this.addDataSource(o)});const s=Array.from(this.dataSourceMap);typeof Promise.allSettled=="function"?Promise.allSettled(s.map(([,o])=>this.init(o))).then(o=>{const f={},u={};o.forEach((h,y)=>{const d=s[y][0];h.status==="fulfilled"?this.data[d]?f[d]=this.data[d]:delete f[d]:h.status==="rejected"&&(delete f[d],u[d]=h.reason)}),this.emit("init",f,u)}):Promise.all(s.map(([,o])=>this.init(o))).then(()=>{this.emit("init",this.data)}).catch(()=>{this.emit("init",this.data)})}static register(e,n){D.dataSourceClassMap.set(e,n)}static getDataSourceClass(e){return D.dataSourceClassMap.get(e)}static registerObservedData(e){D.ObservedDataClass=e}async init(e){var n;if(!e.isInit&&!(this.app.jsEngine&&((n=e.schema.disabledInitInJsEngine)!=null&&n.includes(this.app.jsEngine)))){for(const a of e.methods){if(typeof a.content!="function")return;a.timing==="beforeInit"&&await a.content({params:{},dataSource:e,app:this.app})}await e.init();for(const a of e.methods){if(typeof a.content!="function")return;a.timing==="afterInit"&&await a.content({params:{},dataSource:e,app:this.app})}}}get(e){return this.dataSourceMap.get(e)}async addDataSource(e){if(!e)return;const n=D.dataSourceClassMap.get(e.type)||je,a=new n({app:this.app,schema:e,request:this.app.request,useMock:this.useMock,initialData:this.data[e.id],ObservedDataClass:D.ObservedDataClass});this.dataSourceMap.set(e.id,a),this.data[a.id]=a.data,a.on("change",s=>{this.setData(a,s)})}setData(e,n){this.data[e.id]=e.data,this.emit("change",e.id,n)}removeDataSource(e){var n;(n=this.get(e))==null||n.destroy(),delete this.data[e],this.dataSourceMap.delete(e)}updateSchema(e){e.forEach(n=>{if(!this.get(n.id))return;this.removeDataSource(n.id),this.addDataSource(n);const s=this.get(n.id);s&&this.init(s)})}compiledNode({items:e,...n},a,s=!1){var c;const i=ot(n);return e&&(i.items=Array.isArray(e)&&s?e.map(o=>this.compiledNode(o,a,s)):e),n.condResult===!1||n.visible===!1?i:Ae(o=>Jt(o,this.data),i,((c=this.app.dsl)==null?void 0:c.dataSourceDeps)||{},a)}compliedConds(e){return pt(e,this.data)}compliedIteratorItemConds(e,n,a=[]){const[s,...i]=a,c=this.get(s);if(!c)return!0;const o=Wt(e,c.id,i,this.data);return pt(n,o)}compliedIteratorItems(e,n,a=[]){const[s,...i]=a,c=this.get(s);if(!c)return n;const o=this.app.platform==="editor",f=Wt(e,c.id,i,this.data),{deps:u={},condDeps:h={}}=Ps(c.schema,n,o);return!Object.keys(u).length&&!Object.keys(h).length?n:n.map(y=>Se({compile:d=>Jt(d,f),dsId:c.id,item:y,deps:u,condDeps:h,inEditor:o,ctxData:f}))}destroy(){this.removeAllListeners(),this.data={},this.dataSourceMap.forEach(e=>{e.destroy()}),this.dataSourceMap.clear()}onDataChange(e,n,a){var s;return(s=this.get(e))==null?void 0:s.onDataChange(n,a)}offDataChange(e,n,a){var s;return(s=this.get(e))==null?void 0:s.offDataChange(n,a)}};p(D,"dataSourceClassMap",new Map),p(D,"ObservedDataClass",_e);let gt=D;gt.register("http",xs);const M="displayConds",De=(t="")=>t.replace(/\B([A-Z])/g,"-$1").toLowerCase(),z=t=>Object.prototype.toString.call(t)==="[object Object]",Tt=t=>"".concat(t).replaceAll(/\[(\d+)\]/g,".$1").split("."),E=(t="",r={})=>(Array.isArray(t)?t:Tt(t)).reduce((n,a)=>{if(z(n)||Array.isArray(n)&&/^\d*$/.test("".concat(a)))return n[a];throw new Error("".concat(r,"中不存在").concat(t))},r),yt=(t,r,e={})=>xe(e,t,r),Ls=(t={},r)=>Array.from(Object.values(t).reduce((e,n)=>{var a;return(((a=n[r])==null?void 0:a.keys)||[]).forEach(s=>e.add(s)),e},new Set)),$e="__tmagic__",Xt="__tmagic__dslNode",Ae=(t,r,e={},n)=>{let a=[];if(!n)a=Ls(e,r.id);else{const s=e[n];a=(s==null?void 0:s[r.id].keys)||[]}return a.forEach(s=>{const i=Tt(s),c=i.map((u,h)=>h"u")try{const u=E(s,r);yt(c.join("."),u,r),o=u}catch(u){console.warn(u);return}let f;try{f=t(o)}catch(u){console.error(u),f=""}yt(s,f,r)}),r},Ns=(t,r,e,n=[])=>{var a,s;switch(typeof r=="string"&&typeof e>"u"&&(e=""),t){case"is":return r===e;case"not":return r!==e;case"=":return r===e;case"!=":return r!==e;case">":return r>e;case">=":return r>=e;case"<":return r1&&r>=n[0]&&r<=n[1];case"not_between":return n.length<2||rn[1];case"include":return(a=r==null?void 0:r.includes)==null?void 0:a.call(r,e);case"not_include":return typeof r>"u"||!((s=r.includes)!=null&&s.call(r,e))}return!1},we=t=>{const r={},e={string:void 0,object:{},array:[],boolean:void 0,number:void 0,null:null,any:void 0};return t.forEach(n=>{if(typeof n.defaultValue<"u"){if(n.type==="array"&&!Array.isArray(n.defaultValue)){r[n.name]=e.array;return}if(n.type==="object"&&!z(n.defaultValue)){if(typeof n.defaultValue=="string"){try{r[n.name]=JSON.parse(n.defaultValue)}catch(a){r[n.name]=e.object}return}r[n.name]=e.object;return}r[n.name]=Pe(n.defaultValue);return}if(n.type==="object"){r[n.name]=n.fields?we(n.fields):e.object;return}if(n.type){r[n.name]=e[n.type];return}r[n.name]=void 0}),r},tt="ds-field::",Oe=/\$\{([\s\S]+?)\}/g,Rs=t=>typeof t[Xt]>"u"||t[Xt]===!0,ve=(t,r,e=[],n=!1)=>{n||r(t,e),Array.isArray(t.items)&&t.items.length&&(e.push(t),t.items.forEach(a=>{ve(a,r,[...e],n)})),n&&r(t,e)};var w=(t=>(t.DEFAULT="default",t.CODE_BLOCK="code-block",t.DATA_SOURCE="data-source",t.DATA_SOURCE_METHOD="data-source-method",t.DATA_SOURCE_COND="data-source-cond",t))(w||{});class Zt{constructor(r){p(this,"isTarget");p(this,"id");p(this,"name");p(this,"type",w.DEFAULT);p(this,"deps",{});p(this,"isCollectByDefault");var e;this.isTarget=r.isTarget,this.id=r.id,this.name=r.name,this.isCollectByDefault=(e=r.isCollectByDefault)!=null?e:!0,r.type&&(this.type=r.type),r.initialDeps&&(this.deps=r.initialDeps)}updateDep({id:r,name:e,key:n,data:a}){const s=this.deps[r]||{name:e,keys:[]};s.name=e,s.data=a,this.deps[r]=s,s.keys.indexOf(n)===-1&&s.keys.push(n)}removeDep(r,e){if(typeof r>"u"){Object.keys(this.deps).forEach(a=>{delete this.deps[a]});return}const n=this.deps[r];if(n)if(e){const a=n.keys.indexOf(e);n.keys.splice(a,1),n.keys.length===0&&delete this.deps[r]}else delete this.deps[r]}hasDep(r,e){const n=this.deps[r];return!!(n!=null&&n.keys.find(a=>a===e))}destroy(){this.deps={}}}const _t=(t,r)=>{let e=r;return t.some((n,a)=>{const s=e.find(({name:i})=>i===n);return e=(s==null?void 0:s.fields)||[],s&&s.type==="array"&&/^(?!\d+$).*$/.test("".concat(t[a+1]))&&a{const n=t.match(Oe)||[];if(n.length<=0)return!1;const a=[],s=[];return n.forEach(i=>{const c=i.substring(2,i.length-1),o=Tt(c),f=o.shift();!f||f!==r.id||(_t(o,r.fields)?a.push(i):s.push(i))}),e?a.length>0:s.length>0},Bs=(t,r)=>(t==null?void 0:t.isBindDataSourceField)&&t.dataSourceId&&t.dataSourceId===r&&typeof t.template=="string",ks=(t,r)=>{if(!Array.isArray(t)||typeof t[0]!="string")return!1;const[e]=t,n=e.indexOf(tt);return n===-1?!1:e.substring(n+tt.length)===r},qs=(t,r,e,n=!1)=>{if(!e||!["string","object"].includes(typeof e)||"".concat(r).startsWith(M))return!1;if(typeof e=="string")return Us(e,t,n);if(z(e)&&(e!=null&&e.isBindDataSource)&&e.dataSourceId&&e.dataSourceId===t.id||Bs(e,t.id))return!0;if(ks(e,t.id)){const[,...a]=e,s=_t(a,t.fields);return n?s:!s}return!1},Hs=(t,r,e,n=!1)=>{var i;if(!Array.isArray(e)||!t)return!1;const[a,...s]=e;if(a!==t.id||!"".concat(r).startsWith(M))return!1;if((i=t.fields)!=null&&i.find(c=>c.name===s[0])){const c=_t(s,t.fields);return n?c:!c}return!1},Qt=(t,r,e)=>{for(const n of Object.values(t))for(const a of Object.values(n))e&&a.type!==e||r(a)};class zs{constructor(r){p(this,"targetsList",{});p(this,"childrenProp","items");p(this,"idProp","id");p(this,"nameProp","name");r!=null&&r.initialTargets&&(this.targetsList=r.initialTargets),r!=null&&r.childrenProp&&(this.childrenProp=r.childrenProp)}getTargetsList(){return this.targetsList}getTargets(r=w.DEFAULT){return this.targetsList[r]||{}}addTarget(r){const e=this.getTargets(r.type)||{};this.targetsList[r.type]=e,e[r.id]=r}getTarget(r,e=w.DEFAULT){return this.getTargets(e)[r]}hasTarget(r,e=w.DEFAULT){return!!this.getTarget(r,e)}hasSpecifiedTypeTarget(r=w.DEFAULT){return Object.keys(this.getTargets(r)).length>0}removeTarget(r,e=w.DEFAULT){const n=this.getTargets(e);n[r]&&(n[r].destroy(),delete n[r])}removeTargets(r=w.DEFAULT){const e=this.targetsList[r];if(e){for(const n of Object.values(e))n.destroy();delete this.targetsList[r]}}clearTargets(){for(const r of Object.keys(this.targetsList))delete this.targetsList[r]}collect(r,e={},n=!1,a){this.collectByCallback(r,a,({node:s,target:i})=>{this.removeTargetDep(i,s),this.collectItem(s,i,e,n)})}collectByCallback(r,e,n){Qt(this.targetsList,a=>{if(!(!e&&!a.isCollectByDefault))for(const s of r)n({node:s,target:a})},e)}clear(r,e){let{targetsList:n}=this;e&&(n={[e]:this.getTargets(e)});const a=[];Qt(n,s=>{if(r)for(const i of r)s.removeDep(i[this.idProp]),Array.isArray(i[this.childrenProp])&&i[this.childrenProp].length&&!a.includes(i[this.idProp])&&(a.push(i[this.idProp]),this.clear(i[this.childrenProp]));else s.removeDep()})}clearByType(r,e){this.clear(e,r)}collectItem(r,e,n={},a=!1){const s=(i,c="")=>{const o=(f,u)=>{const h=f===this.childrenProp,y=c?"".concat(c,".").concat(f):f;if(e.isTarget(y,u))e.updateDep({id:r[this.idProp],name:"".concat(r[this.nameProp]||r[this.idProp]),data:n,key:y});else if(!h&&Array.isArray(u))for(let d=0,m=u.length;d"u"||u===""||f==="id"||f==="name"||o(f,u)};s(r)}removeTargetDep(r,e,n){if(r.removeDep(e[this.idProp],n),typeof n>"u"&&Array.isArray(e[this.childrenProp])&&e[this.childrenProp].length)for(const a of e[this.childrenProp])this.removeTargetDep(r,a,n)}}const Gs=(t,r=VueDemi.inject("app"))=>Rs(t.config)&&t.config.id?r==null?void 0:r.getNode(t.config.id,t.iteratorContainerId,t.iteratorIndex):void 0,Ks=(t,r={})=>{if(!t)return;const e={config:t.data,...r};t.emit("created",e),VueDemi.onMounted(()=>{t.emit("mounted",e)}),VueDemi.onBeforeUnmount(()=>{t.emit("destroy",e)})},Js=({methods:t={},config:r,iteratorContainerId:e,iteratorIndex:n})=>{const a=VueDemi.inject("app"),s=Gs({config:r,iteratorContainerId:e,iteratorIndex:n},a);return s&&Ks(s,t),{app:a,node:s}},Xs=t=>{const r=VueDemi.inject("app"),e=VueDemi.ref("default"),n=new Map,a=new Map,s=new Map,i=o=>{e.value=o},c=(o,{style:f,className:u,...h})=>{f&&n.set(o,f),u&&a.set(o,u),s.set(o,VueDemi.shallowReactive(h))};return VueDemi.watchEffect(()=>{c("default",{style:t.config.style,className:t.config.className})}),VueDemi.onScopeDispose(()=>{s.clear()}),{status:VueDemi.computed(()=>e.value),style:VueDemi.computed(()=>{const o=e.value||"default",f=n.get("default")||{},u=n.get(o);let h=(r==null?void 0:r.transformStyle(f))||{};return o!=="default"&&u&&(h=Object.keys(u).reduce((y,d)=>{const m=u[d];return m===null||typeof m>"u"||isNaN(m)||m===""?{...y,[d]:u[d]}:{...y}},h)),t.config.displayHidden&&(h.display="none"),typeof t.config.condResult<"u"&&t.config.displayRenderModel==="mount"&&t.config.condResult===!1&&(h.display="none"),h}),className:VueDemi.computed(()=>{var h;const o=e.value||"default",f=(h=a.get(o))!=null?h:"",u=[];return t.config.type&&u.push("magic-ui-".concat(De(t.config.type))),t.config.layout&&u.push("magic-layout-".concat(t.config.layout)),f&&u.push(f),u.join(" ")}),setStatus:i,registerStatus:c}};function Zs(t=""){let r,e,n;return typeof t=="string"?r=t:{componentType:r,app:e}=t,(!r||r==="")&&(r="container"),e||(e=VueDemi.inject("app")),n=e==null?void 0:e.resolveComponent(r),!n&&!r.startsWith("magic-ui-")&&(r="magic-ui-".concat(De(r)),n=e==null?void 0:e.resolveComponent(r)),n!=null?n:r}const Qs=(t,r)=>{const e=t.__vccOpts||t;for(const[n,a]of r)e[n]=a;return e};export{Qs as _,Xs as a,Gs as b,Js as c,Ks as r,Zs as u}; //# sourceMappingURL=plugin-vueexport-helper-CYignUIG.js.map