@chamn/render 0.0.44 → 0.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
data struct format is invalidate`);return o.message||r?console.warn(`${o.message||r}
|
|
4
4
|
originData: ${JSON.stringify(e)}`):console.warn(`${JSON.stringify(e)}
|
|
5
5
|
data struct format is invalidate`),o},Mr=t=>{const{data:e,message:r,throwError:n,dataStruct:o}=t;return Rf(({data:a})=>{try{return bo(a,o),{isValidate:!0}}catch(i){let s=i;return i instanceof yo&&(s=i.failures().map(c=>`【${c.path.join(".")}】: ${c.message}
|
|
6
|
-
`)),{isValidate:!1,message:s,error:i}}})({data:e,message:r,throwError:n})};var At=(t=>(t.ROOT_CONTAINER="RootContainer",t))(At||{});const Df=C({type:L(V.FUNCTION),value:v()}),If=$r(_o(Ot,["componentName"]),C({componentName:L("RootContainer")}));function Lf(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(o){o(r)}),(n=t.get("*"))&&n.slice().map(function(o){o(e,r)})}}}const ne=Lf(),Bf=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new dt([]);return e&&(o=e.materialsMode||new dt([])),n&&(R(n)?r.value=n.map(a=>new M(a,{parent:e,materials:o})):F(n)&&r.value.push(new M(n,{parent:e,materials:o}))),r};class Ct{constructor(e,r){_(this,"nodeType","SLOT"),_(this,"rawData"),_(this,"parent"),_(this,"emitter",ne),_(this,"data"),_(this,"id"),_(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new dt([]);this.materialsMode=n,this.id=Z(),this.data=Bf(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof M)return o.export(e);if(F(o)){const a={};return Object.keys(o||{}).forEach(i=>{a[i]=n(o[i])}),a}return R(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const Co=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===qe.SINGLE?e.push(n.content):n.type===qe.GROUP&&(e=[...e,...Co(n.content)]):e.push(r)}),e},Ye=(t,e,r)=>{if(t.type)return t.type===V.SLOT?new Ct(t,{parent:e,materials:r}):t;if(F(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=Ke(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>Ye(n,e,r)):t},Ke=(t,e,r)=>F(t)?Ye(t,e,r):R(t)?t.map(n=>Ye(n,e,r)):t;class at{constructor(e,r,n){_(this,"nodeType","PROP"),_(this,"rawData"),_(this,"parent"),_(this,"emitter",ne),_(this,"data"),_(this,"name"),_(this,"materialsMode");const o=(n==null?void 0:n.materials)||new dt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=Ke(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=Ke(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof Ct)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof M){const r=e.material;return Co((r==null?void 0:r.value.props)||[]).find(n=>n.name===this.name)}else return null}export(e){const r=this.data,n=o=>{if(o instanceof at||o instanceof Ct||o instanceof M)return o.export(e);if(R(o))return o.map(a=>n(a));if(F(o)){const a={};return Object.keys(o||{}).forEach(i=>{a[i]=n(o[i])}),a}return o};return n(r)}}const Ff=t=>{if(typeof t=="string")return!0;Mr({data:t,dataStruct:Ot,throwError:!1})},yn=(t,e,r=new dt([]))=>{if(typeof t=="string")return t;const n={...t,id:t.id??Z(),children:[],props:{},methods:t.methods||[],configure:vo(t.configure||{},{propsSetter:{},advanceSetter:{}})},o=Object.keys(t.props||{});return o.length&&o.forEach(a=>{var i;const s=(i=t.props)==null?void 0:i[a];if(s instanceof at){n.props[a]=s;return}n.props[a]=new at(a,s||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof M)return a;if(F(a)){const i=a;return new M(i,{parent:e,materials:r})}else return a}):(t.children instanceof M&&(n.children=[t.children]),n.children=[new M(t.children,{parent:e,materials:r})])),n};class M{constructor(e,r){_(this,"nodeType","NODE"),_(this,"rawData"),_(this,"data"),_(this,"emitter",ne),_(this,"parent"),_(this,"materialsModel"),_(this,"listenerHandle"),_(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Ff(e);const n=(r==null?void 0:r.materials)||new dt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=yn(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener()}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}destroy(){this.listenerHandle.forEach(e=>e())}get id(){return this.data.id}get value(){return this.data}clone(e){const r={...this.export("design"),id:e||Z()};return new M(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=yn(r,this),r}updateValue(e){const r=this.data,n=this.updateWithPlainObj(e);this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return Pr(this,e)}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e){var r;const n=this.data;if(typeof n=="string")return n;const o={};Object.keys(n.props||{}).forEach(l=>{o[l]=n.props[l].export(e)});const a=(r=n.children)==null?void 0:r.map(l=>l instanceof M?l.export(e):l),i=n.configure||{},s=i.propsSetter||{},c={};Object.keys(s).forEach(l=>{const p=Yn(s,l,!1);p&&(c[l]=p)}),i.propsSetter=c,this.material&&this.materialsModel.usedMaterials.push(this.material);let u={...n,configure:i,props:o,children:a,condition:n.condition};return e==="design"&&delete u.id,u=Ar(u),u}}const bn=(t,e,r)=>{const n={...t,id:Z(),props:{},componentName:At.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:vo(t.configure||{},{propsSetter:{},advanceSetter:{}})};let o=[];R(t.children)?o=t.children.map(i=>i instanceof M?i:F(i)?new M(i,{parent:e,materials:r}):i):t.children instanceof M?o.push(t.children):t.children&&F(t.children)&&o.push(new M(t.children,{parent:e,materials:r}));const a=Object.keys(t.props||{});return a.length&&a.forEach(i=>{var s;const c=(s=t.props)==null?void 0:s[i];c instanceof at?n.props[i]=c:n.props[i]=new at(i,c||"",{parent:e,materials:r})}),n.children=o,n};class Zt{constructor(e,{parent:r,materials:n}){_(this,"rawData"),_(this,"data"),_(this,"nodeType",At.ROOT_CONTAINER),_(this,"emitter",ne),_(this,"materialsModel"),_(this,"listenerHandle"),_(this,"onChangeCbQueue"),_(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=bn(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener(),this.parent=r}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}get id(){return this.data.id}get value(){return this.data}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}updateWithPlainObj(e){const r={...this.data,...e};return this.data=bn(r,this,this.materialsModel),r}updateValue(e){const r=this.data;this.updateWithPlainObj(e),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return Pr(this,e)}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e=xr.SAVE){var r;const n=this.data,o={};Object.keys(n.props||{}).forEach(c=>{o[c]=n.props[c].export(e)});const a=((r=n.children)==null?void 0:r.map(c=>{var u;return(u=c==null?void 0:c.export)==null?void 0:u.call(c,e)}))||[],i={...n,props:o,children:a.filter(c=>c),condition:n.condition};let s=go(i,["id"]);return s=Ar(s),s}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}destroy(){this.listenerHandle.forEach(e=>e())}clone(e){const r={...this.export("design"),id:e||Z()};return new Zt(r,{materials:this.materialsModel,parent:null})}}const ct=t=>(t==null?void 0:t.type)===V.EXPRESSION,Uf=t=>(t==null?void 0:t.type)===V.FUNCTION,Z=()=>Math.random().toString(32).slice(3,9),kf=t=>(t==null?void 0:t.nodeType)==="NODE",De=t=>(t==null?void 0:t.nodeType)==="PROP",Vf=t=>(t==null?void 0:t.nodeType)==="SLOT",Ar=t=>uf(t,e=>F(e)?!Object.keys(e).length:R(e)?!e.length:!e);function zf(t,e){const r=[t];for(;r.length;){const n=r.shift();if(n&&e(n))return n;const o=(n==null?void 0:n.props)||{},a=s=>{if(s instanceof M){r.push(s);return}if(s instanceof Ct&&a(s.value.value),s instanceof at){a(s.value);return}if(F(s)){const c=s;Object.keys(c).forEach(u=>{a(c[u])});return}if(R(s)){s.forEach(c=>{a(c)});return}};a(o);const i=(n==null?void 0:n.value.children.filter(s=>s instanceof M))||[];r.push(...i)}}function Pr(t,e){return zf(t,r=>r.id===e)}const Gf=t=>{const e=co(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${Z()}`,title:n.title||t.title,category:n.category||t.category,tags:[...n.tags||[],...t.tags||[]],groupName:n.groupName||t.groupName,snapshot:n.snapshot||t.icon,snapshotText:n.snapshotText,schema:{...n.schema,componentName:n.schema.componentName||t.componentName}})),e};class Hf{constructor(e){_(this,"rawData"),_(this,"data"),this.rawData=e,this.data=Gf(e)}get value(){return this.data}get rawValue(){return this.rawData}get componentName(){return this.data.componentName}get snippets(){return this.data.snippets}getSnippetById(e){return this.data.snippets.find(r=>r.id===e)}}const Ie=t=>{if(!R(t))throw new Error("Materials must be a array");return t.map(e=>new Hf(e))},Wf=t=>{t==null||t.forEach(e=>{Mr({data:e,dataStruct:Pf,throwError:!1})})};class dt{constructor(e){_(this,"rawData"),_(this,"data"),_(this,"usedMaterials",[]),this.rawData=e,Wf(e),this.data=Ie(e)}addMaterials(e){const r=Ie(e),n=[],o=this.data.map(i=>{const s=r.findIndex(c=>c.componentName===i.componentName);return s>=0?(n.push(s),r[s]):i}),a=r.filter((i,s)=>n.includes(s));this.data=[...o,...a]}replaceMaterials(e){const r=Ie(e);this.data=[...r]}removeMaterial(e){const r=this.data.filter(n=>!e.includes(n.componentName));this.data=r}findByComponentName(e){return this.data.find(r=>r.componentName===e)}findSnippetById(e){const r=[...this.data];let n=null;for(;!n&&r.length;){const o=r.pop();n=o==null?void 0:o.getSnippetById(e)}return n}getAllSnippets(){const e=this.data.reduce((a,i)=>(a.push(...i.snippets),a),[]),r=[],n={default:[]};e.forEach(a=>{const i=a.groupName||"default";r.includes(i)||(r.push(i),n[i]=[]),n[i].push(a)});let o=[];return r.forEach(a=>{const i=["default"],s={default:[]},c=n[a];if(c.length!==0){c.forEach(p=>{const f=p.category||"default";i.includes(f)||(i.push(f),s[f]=[]),s[f].push(p)});const u=[];i.forEach(p=>{s[p].length&&u.push({name:p,list:s[p]})});const l={name:a,list:u};o.push(l)}}),o=o.sort((a,i)=>(a.name||"")>(i.name||"")?1:-1),o}get value(){return this.data}get rawValue(){return this.rawData}}const Jf=C({version:v(),name:v(),css:m(v()),renderType:m(B([L("COMPONENT"),L("PAGE")])),loadType:m(T()),lifecycle:m(T()),props:m(T()),methods:m(P(Df)),componentsMeta:P($r(C({componentName:v()}),Nr)),thirdLibs:m(wf),componentsTree:If,assets:m(P(T()))}),wo=t=>(Mr({data:t,dataStruct:Jf,throwError:!1}),t),Le=(t,e,r)=>({...t,componentsTree:new Zt(t.componentsTree,{parent:e,materials:r})});class he{constructor(e,r){_(this,"nodeType","PAGE"),_(this,"rawData"),_(this,"emitter",ne),_(this,"data"),_(this,"parent"),_(this,"materialsModel"),_(this,"assetPackagesList"),wo(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new dt((r==null?void 0:r.materials)||[]),this.data=Le(e,this,this.materialsModel),this.assetPackagesList=[...(r==null?void 0:r.assetPackagesList)||[],...this.data.assets||[]]}updatePage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=Le(e,this,this.materialsModel),this.emitter.emit("onPageChange",{value:this.data,preValue:r,node:this})}reloadPage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=Le(e,this,this.materialsModel),this.emitter.emit("onReloadPage",{value:this.data,preValue:r,node:this})}get value(){return this.data}getNode(e){if(!e)return;const r=this.data.componentsTree;return Pr(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof Zt)return console.warn("Not found parent node"),!1;if(a instanceof at)return console.warn("CProp can not add node"),!1;if(a instanceof Ct){const s=a.value.value,c=s.findIndex(u=>u===r)??-1;return c>=0?(n==="BEFORE"?s.splice(c,0,e):s.splice(c+1,0,e),e.parent=a,(o=a.parent)==null||o.updateValue(),!0):!1}if(a instanceof he)return!1;const i=(a==null?void 0:a.value.children.findIndex(s=>s===r))??-1;return i>=0?(n==="BEFORE"?a==null||a.value.children.splice(i,0,e):a==null||a.value.children.splice(i+1,0,e),e.parent=a,a==null||a.updateValue(),!0):(console.warn("Not found target node"),!1)}if(n==="CHILD_START")return r.value.children.unshift(e),e.parent=r,r.updateValue(),!0;if(n==="CHILD_END")return r.value.children.push(e),e.parent=r,r.updateValue(),!0;if(F(n)){const a=n;if(a.type==="CHILD"){const i=a.pos,s=a.index||0;return i==="BEFORE"?r==null||r.value.children.splice(s,0,e):r==null||r.value.children.splice(s+1,0,e),e.parent=r,r.updateValue(),!0}else console.warn("Can not parse pos obj")}return!1}createNode(e){return delete e.id,new M(e,{parent:null,materials:this.materialsModel})}addNodeById(e,r,n="AFTER"){const o=this.getNode(r);return o?this.addNode(e,o,n):(console.warn(`Not find a node by ${r}, pls check it`),!1)}copyNode(e){const r=e.export("design");r.id=Z();const n=new M(r,{parent:e.parent,materials:this.materialsModel});return this.addNode(n,e,"AFTER"),n}copyNodeById(e){const r=this.getNode(e);return r&&r instanceof M?this.copyNode(r):!1}moveNode(e,r,n){this.deleteNode(e);let o=r;return["AFTER","BEFORE"].includes(n)&&(o=r.parent),e.parent=o,this.addNode(e,r,n)}moveNodeById(e,r,n){const o=this.getNode(e),a=this.getNode(r);return o&&a&&o instanceof M&&a instanceof M?this.moveNode(o,a,n):!1}deleteNode(e){var r;const n=e.parent;if(!n)throw new Error("parent node is null or undefined, pls check it");if(n instanceof Ct){const o=n.value.value,a=o.findIndex(s=>s===e),i=o[a];return o.splice(a,1),(r=n.parent)==null||r.updateValue(),i}if(n instanceof M||n instanceof Zt){const o=n.value.children,a=o.findIndex(s=>s===e),i=o[a];return o.splice(a,1),n.updateValue(),i}}deleteNodeById(e){const r=this.getNode(e);if(r)return this.deleteNode(r)}export(e=xr.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],i=this.materialsModel.usedMaterials.map(c=>{const u=o.find(l=>{var p;return l.package===((p=c.value.npm)==null?void 0:p.package)});return u&&a.push(u),{componentName:c.componentName,...co(c.value.npm||{})}}).filter(c=>c.componentName&&c.package&&c.version?!0:(console.warn(`${c} not a valid material info`),!1));this.materialsModel.usedMaterials=[];let s={...this.data,componentsTree:Ar(n),componentsMeta:i,thirdLibs:this.data.thirdLibs,assets:[]};return(r=this.data.thirdLibs)==null||r.forEach(c=>{const u=o.find(l=>c.package===l.package);u&&a.push(u)}),s.assets=vf(a,c=>c.package),s=go(s,["id"]),JSON.parse(JSON.stringify(s))}getRootNode(){return this.data.componentsTree}}At.ROOT_CONTAINER;var Qf=typeof global=="object"&&global&&global.Object===Object&&global;const Eo=Qf;var qf=typeof self=="object"&&self&&self.Object===Object&&self,Yf=Eo||qf||Function("return this")();const Pt=Yf;var Kf=Pt.Symbol;const wt=Kf;var $o=Object.prototype,Xf=$o.hasOwnProperty,Zf=$o.toString,Vt=wt?wt.toStringTag:void 0;function tp(t){var e=Xf.call(t,Vt),r=t[Vt];try{t[Vt]=void 0;var n=!0}catch{}var o=Zf.call(t);return n&&(e?t[Vt]=r:delete t[Vt]),o}var ep=Object.prototype,rp=ep.toString;function np(t){return rp.call(t)}var op="[object Null]",ap="[object Undefined]",_n=wt?wt.toStringTag:void 0;function oe(t){return t==null?t===void 0?ap:op:_n&&_n in Object(t)?tp(t):np(t)}function Rt(t){return t!=null&&typeof t=="object"}var sp="[object Symbol]";function ip(t){return typeof t=="symbol"||Rt(t)&&oe(t)==sp}function cp(t,e){for(var r=-1,n=t==null?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var up=Array.isArray;const Et=up;var lp=1/0,Sn=wt?wt.prototype:void 0,jn=Sn?Sn.toString:void 0;function No(t){if(typeof t=="string")return t;if(Et(t))return cp(t,No)+"";if(ip(t))return jn?jn.call(t):"";var e=t+"";return e=="0"&&1/t==-lp?"-0":e}function yt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function xo(t){return t}var fp="[object AsyncFunction]",pp="[object Function]",dp="[object GeneratorFunction]",hp="[object Proxy]";function Rr(t){if(!yt(t))return!1;var e=oe(t);return e==pp||e==dp||e==fp||e==hp}var mp=Pt["__core-js_shared__"];const Be=mp;var On=function(){var t=/[^.]+$/.exec(Be&&Be.keys&&Be.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function vp(t){return!!On&&On in t}var gp=Function.prototype,yp=gp.toString;function bp(t){if(t!=null){try{return yp.call(t)}catch{}try{return t+""}catch{}}return""}var _p=/[\\^$.*+?()[\]{}|]/g,Sp=/^\[object .+?Constructor\]$/,jp=Function.prototype,Op=Object.prototype,Cp=jp.toString,wp=Op.hasOwnProperty,Ep=RegExp("^"+Cp.call(wp).replace(_p,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $p(t){if(!yt(t)||vp(t))return!1;var e=Rr(t)?Ep:Sp;return e.test(bp(t))}function Np(t,e){return t==null?void 0:t[e]}function Dr(t,e){var r=Np(t,e);return $p(r)?r:void 0}var Cn=Object.create,xp=function(){function t(){}return function(e){if(!yt(e))return{};if(Cn)return Cn(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const Tp=xp;function Mp(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ap(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Pp=800,Rp=16,Dp=Date.now;function Ip(t){var e=0,r=0;return function(){var n=Dp(),o=Rp-(n-r);if(r=n,o>0){if(++e>=Pp)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Lp(t){return function(){return t}}var Bp=function(){try{var t=Dr(Object,"defineProperty");return t({},"",{}),t}catch{}}();const me=Bp;var Fp=me?function(t,e){return me(t,"toString",{configurable:!0,enumerable:!1,value:Lp(e),writable:!0})}:xo;const Up=Fp;var kp=Ip(Up);const Vp=kp;var zp=9007199254740991,Gp=/^(?:0|[1-9]\d*)$/;function To(t,e){var r=typeof t;return e=e??zp,!!e&&(r=="number"||r!="symbol"&&Gp.test(t))&&t>-1&&t%1==0&&t<e}function Ir(t,e,r){e=="__proto__"&&me?me(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Oe(t,e){return t===e||t!==t&&e!==e}var Hp=Object.prototype,Wp=Hp.hasOwnProperty;function Jp(t,e,r){var n=t[e];(!(Wp.call(t,e)&&Oe(n,r))||r===void 0&&!(e in t))&&Ir(t,e,r)}function Qp(t,e,r,n){var o=!r;r||(r={});for(var a=-1,i=e.length;++a<i;){var s=e[a],c=n?n(r[s],t[s],s,r,t):void 0;c===void 0&&(c=t[s]),o?Ir(r,s,c):Jp(r,s,c)}return r}var wn=Math.max;function qp(t,e,r){return e=wn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=wn(n.length-e,0),i=Array(a);++o<a;)i[o]=n[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=n[o];return s[e]=r(i),Mp(t,this,s)}}function Yp(t,e){return Vp(qp(t,e,xo),t+"")}var Kp=9007199254740991;function Mo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Kp}function Lr(t){return t!=null&&Mo(t.length)&&!Rr(t)}function Xp(t,e,r){if(!yt(r))return!1;var n=typeof e;return(n=="number"?Lr(r)&&To(e,r.length):n=="string"&&e in r)?Oe(r[e],t):!1}function Zp(t){return Yp(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,i&&Xp(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var s=r[n];s&&t(e,s,n,a)}return e})}var td=Object.prototype;function Ao(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||td;return t===r}function ed(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var rd="[object Arguments]";function En(t){return Rt(t)&&oe(t)==rd}var Po=Object.prototype,nd=Po.hasOwnProperty,od=Po.propertyIsEnumerable,ad=En(function(){return arguments}())?En:function(t){return Rt(t)&&nd.call(t,"callee")&&!od.call(t,"callee")};const Xe=ad;function sd(){return!1}var Ro=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$n=Ro&&typeof module=="object"&&module&&!module.nodeType&&module,id=$n&&$n.exports===Ro,Nn=id?Pt.Buffer:void 0,cd=Nn?Nn.isBuffer:void 0,ud=cd||sd;const Do=ud;var ld="[object Arguments]",fd="[object Array]",pd="[object Boolean]",dd="[object Date]",hd="[object Error]",md="[object Function]",vd="[object Map]",gd="[object Number]",yd="[object Object]",bd="[object RegExp]",_d="[object Set]",Sd="[object String]",jd="[object WeakMap]",Od="[object ArrayBuffer]",Cd="[object DataView]",wd="[object Float32Array]",Ed="[object Float64Array]",$d="[object Int8Array]",Nd="[object Int16Array]",xd="[object Int32Array]",Td="[object Uint8Array]",Md="[object Uint8ClampedArray]",Ad="[object Uint16Array]",Pd="[object Uint32Array]",N={};N[wd]=N[Ed]=N[$d]=N[Nd]=N[xd]=N[Td]=N[Md]=N[Ad]=N[Pd]=!0;N[ld]=N[fd]=N[Od]=N[pd]=N[Cd]=N[dd]=N[hd]=N[md]=N[vd]=N[gd]=N[yd]=N[bd]=N[_d]=N[Sd]=N[jd]=!1;function Rd(t){return Rt(t)&&Mo(t.length)&&!!N[oe(t)]}function Dd(t){return function(e){return t(e)}}var Io=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wt=Io&&typeof module=="object"&&module&&!module.nodeType&&module,Id=Wt&&Wt.exports===Io,Fe=Id&&Eo.process,Ld=function(){try{var t=Wt&&Wt.require&&Wt.require("util").types;return t||Fe&&Fe.binding&&Fe.binding("util")}catch{}}();const xn=Ld;var Tn=xn&&xn.isTypedArray,Bd=Tn?Dd(Tn):Rd;const Lo=Bd;var Fd=Object.prototype,Ud=Fd.hasOwnProperty;function kd(t,e){var r=Et(t),n=!r&&Xe(t),o=!r&&!n&&Do(t),a=!r&&!n&&!o&&Lo(t),i=r||n||o||a,s=i?ed(t.length,String):[],c=s.length;for(var u in t)(e||Ud.call(t,u))&&!(i&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||To(u,c)))&&s.push(u);return s}function Vd(t,e){return function(r){return t(e(r))}}function zd(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Gd=Object.prototype,Hd=Gd.hasOwnProperty;function Wd(t){if(!yt(t))return zd(t);var e=Ao(t),r=[];for(var n in t)n=="constructor"&&(e||!Hd.call(t,n))||r.push(n);return r}function Bo(t){return Lr(t)?kd(t,!0):Wd(t)}var Jd=Dr(Object,"create");const te=Jd;function Qd(){this.__data__=te?te(null):{},this.size=0}function qd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Yd="__lodash_hash_undefined__",Kd=Object.prototype,Xd=Kd.hasOwnProperty;function Zd(t){var e=this.__data__;if(te){var r=e[t];return r===Yd?void 0:r}return Xd.call(e,t)?e[t]:void 0}var th=Object.prototype,eh=th.hasOwnProperty;function rh(t){var e=this.__data__;return te?e[t]!==void 0:eh.call(e,t)}var nh="__lodash_hash_undefined__";function oh(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=te&&e===void 0?nh:e,this}function ht(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ht.prototype.clear=Qd;ht.prototype.delete=qd;ht.prototype.get=Zd;ht.prototype.has=rh;ht.prototype.set=oh;function ah(){this.__data__=[],this.size=0}function Ce(t,e){for(var r=t.length;r--;)if(Oe(t[r][0],e))return r;return-1}var sh=Array.prototype,ih=sh.splice;function ch(t){var e=this.__data__,r=Ce(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ih.call(e,r,1),--this.size,!0}function uh(t){var e=this.__data__,r=Ce(e,t);return r<0?void 0:e[r][1]}function lh(t){return Ce(this.__data__,t)>-1}function fh(t,e){var r=this.__data__,n=Ce(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function rt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}rt.prototype.clear=ah;rt.prototype.delete=ch;rt.prototype.get=uh;rt.prototype.has=lh;rt.prototype.set=fh;var ph=Dr(Pt,"Map");const Fo=ph;function dh(){this.size=0,this.__data__={hash:new ht,map:new(Fo||rt),string:new ht}}function hh(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function we(t,e){var r=t.__data__;return hh(e)?r[typeof e=="string"?"string":"hash"]:r.map}function mh(t){var e=we(this,t).delete(t);return this.size-=e?1:0,e}function vh(t){return we(this,t).get(t)}function gh(t){return we(this,t).has(t)}function yh(t,e){var r=we(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Dt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Dt.prototype.clear=dh;Dt.prototype.delete=mh;Dt.prototype.get=vh;Dt.prototype.has=gh;Dt.prototype.set=yh;function Uo(t){return t==null?"":No(t)}var bh=Vd(Object.getPrototypeOf,Object);const ko=bh;var _h="[object Object]",Sh=Function.prototype,jh=Object.prototype,Vo=Sh.toString,Oh=jh.hasOwnProperty,Ch=Vo.call(Object);function $t(t){if(!Rt(t)||oe(t)!=_h)return!1;var e=ko(t);if(e===null)return!0;var r=Oh.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Vo.call(r)==Ch}function wh(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(o);++n<o;)a[n]=t[n+e];return a}function Eh(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:wh(t,e,r)}var $h="\\ud800-\\udfff",Nh="\\u0300-\\u036f",xh="\\ufe20-\\ufe2f",Th="\\u20d0-\\u20ff",Mh=Nh+xh+Th,Ah="\\ufe0e\\ufe0f",Ph="\\u200d",Rh=RegExp("["+Ph+$h+Mh+Ah+"]");function zo(t){return Rh.test(t)}function Dh(t){return t.split("")}var Go="\\ud800-\\udfff",Ih="\\u0300-\\u036f",Lh="\\ufe20-\\ufe2f",Bh="\\u20d0-\\u20ff",Fh=Ih+Lh+Bh,Uh="\\ufe0e\\ufe0f",kh="["+Go+"]",Ze="["+Fh+"]",tr="\\ud83c[\\udffb-\\udfff]",Vh="(?:"+Ze+"|"+tr+")",Ho="[^"+Go+"]",Wo="(?:\\ud83c[\\udde6-\\uddff]){2}",Jo="[\\ud800-\\udbff][\\udc00-\\udfff]",zh="\\u200d",Qo=Vh+"?",qo="["+Uh+"]?",Gh="(?:"+zh+"(?:"+[Ho,Wo,Jo].join("|")+")"+qo+Qo+")*",Hh=qo+Qo+Gh,Wh="(?:"+[Ho+Ze+"?",Ze,Wo,Jo,kh].join("|")+")",Jh=RegExp(tr+"(?="+tr+")|"+Wh+Hh,"g");function Qh(t){return t.match(Jh)||[]}function qh(t){return zo(t)?Qh(t):Dh(t)}function Yh(t){return function(e){e=Uo(e);var r=zo(e)?qh(e):void 0,n=r?r[0]:e.charAt(0),o=r?Eh(r,1).join(""):e.slice(1);return n[t]()+o}}var Kh=Yh("toUpperCase");const Xh=Kh;function Zh(t){return Xh(Uo(t).toLowerCase())}function tm(){this.__data__=new rt,this.size=0}function em(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function rm(t){return this.__data__.get(t)}function nm(t){return this.__data__.has(t)}var om=200;function am(t,e){var r=this.__data__;if(r instanceof rt){var n=r.__data__;if(!Fo||n.length<om-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Dt(n)}return r.set(t,e),this.size=r.size,this}function It(t){var e=this.__data__=new rt(t);this.size=e.size}It.prototype.clear=tm;It.prototype.delete=em;It.prototype.get=rm;It.prototype.has=nm;It.prototype.set=am;var Yo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mn=Yo&&typeof module=="object"&&module&&!module.nodeType&&module,sm=Mn&&Mn.exports===Yo,An=sm?Pt.Buffer:void 0,Pn=An?An.allocUnsafe:void 0;function im(t,e){if(e)return t.slice();var r=t.length,n=Pn?Pn(r):new t.constructor(r);return t.copy(n),n}var cm=Pt.Uint8Array;const Rn=cm;function um(t){var e=new t.constructor(t.byteLength);return new Rn(e).set(new Rn(t)),e}function lm(t,e){var r=e?um(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function fm(t){return typeof t.constructor=="function"&&!Ao(t)?Tp(ko(t)):{}}function pm(t){return function(e,r,n){for(var o=-1,a=Object(e),i=n(e),s=i.length;s--;){var c=i[t?s:++o];if(r(a[c],c,a)===!1)break}return e}}var dm=pm();const hm=dm;function er(t,e,r){(r!==void 0&&!Oe(t[e],r)||r===void 0&&!(e in t))&&Ir(t,e,r)}function mm(t){return Rt(t)&&Lr(t)}function rr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function vm(t){return Qp(t,Bo(t))}function gm(t,e,r,n,o,a,i){var s=rr(t,r),c=rr(e,r),u=i.get(c);if(u){er(t,r,u);return}var l=a?a(s,c,r+"",t,e,i):void 0,p=l===void 0;if(p){var f=Et(c),d=!f&&Do(c),h=!f&&!d&&Lo(c);l=c,f||d||h?Et(s)?l=s:mm(s)?l=Ap(s):d?(p=!1,l=im(c,!0)):h?(p=!1,l=lm(c,!0)):l=[]:$t(c)||Xe(c)?(l=s,Xe(s)?l=vm(s):(!yt(s)||Rr(s))&&(l=fm(c))):p=!1}p&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),er(t,r,l)}function Ko(t,e,r,n,o){t!==e&&hm(e,function(a,i){if(o||(o=new It),yt(a))gm(t,e,i,r,Ko,n,o);else{var s=n?n(rr(t,i),a,i+"",t,e,o):void 0;s===void 0&&(s=a),er(t,i,s)}},Bo)}var ym=Zp(function(t,e,r){Ko(t,e,r)});const bm=ym,_m=function(t){return!(!t||typeof t!="function"||!t.prototype)};function Xo(t){const e=t==null?void 0:t.prototype;return!!(e&&e.isReactComponent)}function Zo(t){var n,o;const r=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.forward_ref"):60112;return(t==null?void 0:t.$$typeof)===r||((n=t==null?void 0:t.prototype)==null?void 0:n.isReactComponent)||((o=t==null?void 0:t.prototype)==null?void 0:o.setState)||t._forwardRef}function ta(t){class e extends S.Component{render(){return S.createElement(t,this.props)}}return e.displayName=t.displayName,e}const lt=(t,e)=>{const r=n=>{const a=`
|
|
6
|
+
`)),{isValidate:!1,message:s,error:i}}})({data:e,message:r,throwError:n})};var At=(t=>(t.ROOT_CONTAINER="RootContainer",t))(At||{});const Df=C({type:L(V.FUNCTION),value:v()}),If=$r(_o(Ot,["componentName"]),C({componentName:L("RootContainer")}));function Lf(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(o){o(r)}),(n=t.get("*"))&&n.slice().map(function(o){o(e,r)})}}}const ne=Lf(),Bf=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new dt([]);return e&&(o=e.materialsMode||new dt([])),n&&(R(n)?r.value=n.map(a=>new M(a,{parent:e,materials:o})):F(n)&&r.value.push(new M(n,{parent:e,materials:o}))),r};class Ct{constructor(e,r){_(this,"nodeType","SLOT"),_(this,"rawData"),_(this,"parent"),_(this,"emitter",ne),_(this,"data"),_(this,"id"),_(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new dt([]);this.materialsMode=n,this.id=Z(),this.data=Bf(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof M)return o.export(e);if(F(o)){const a={};return Object.keys(o||{}).forEach(i=>{a[i]=n(o[i])}),a}return R(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const Co=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===qe.SINGLE?e.push(n.content):n.type===qe.GROUP&&(e=[...e,...Co(n.content)]):e.push(r)}),e},Ye=(t,e,r)=>{if(t.type)return t.type===V.SLOT?new Ct(t,{parent:e,materials:r}):t;if(F(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=Ke(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>Ye(n,e,r)):t},Ke=(t,e,r)=>F(t)?Ye(t,e,r):R(t)?t.map(n=>Ye(n,e,r)):t;class at{constructor(e,r,n){_(this,"nodeType","PROP"),_(this,"rawData"),_(this,"parent"),_(this,"emitter",ne),_(this,"data"),_(this,"name"),_(this,"materialsMode");const o=(n==null?void 0:n.materials)||new dt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=Ke(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=Ke(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof Ct)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof M){const r=e.material;return Co((r==null?void 0:r.value.props)||[]).find(n=>n.name===this.name)}else return null}export(e){const r=this.data,n=o=>{if(o instanceof at||o instanceof Ct||o instanceof M)return o.export(e);if(R(o))return o.map(a=>n(a));if(F(o)){const a={};return Object.keys(o||{}).forEach(i=>{a[i]=n(o[i])}),a}return o};return n(r)}}const Ff=t=>{if(typeof t=="string")return!0;Mr({data:t,dataStruct:Ot,throwError:!1})},yn=(t,e,r=new dt([]))=>{if(typeof t=="string")return t;const n={...t,id:t.id??Z(),children:[],props:{},methods:t.methods||[],configure:vo(t.configure||{},{propsSetter:{},advanceSetter:{}})},o=Object.keys(t.props||{});return o.length&&o.forEach(a=>{var i;const s=(i=t.props)==null?void 0:i[a];if(s instanceof at){n.props[a]=s;return}n.props[a]=new at(a,s||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof M)return a;if(F(a)){const i=a;return new M(i,{parent:e,materials:r})}else return a}):(t.children instanceof M&&(n.children=[t.children]),n.children=[new M(t.children,{parent:e,materials:r})])),n};class M{constructor(e,r){_(this,"nodeType","NODE"),_(this,"rawData"),_(this,"data"),_(this,"emitter",ne),_(this,"parent"),_(this,"materialsModel"),_(this,"listenerHandle"),_(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Ff(e);const n=(r==null?void 0:r.materials)||new dt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=yn(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener()}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}destroy(){this.listenerHandle.forEach(e=>e())}get id(){return this.data.id}get value(){return this.data}clone(e){const r={...this.export("design"),id:e||Z()};return new M(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=yn(r,this),r}updateValue(e){const r=this.data,n=this.updateWithPlainObj(e);this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return Pr(this,e)}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e){var r;const n=this.data;if(typeof n=="string")return n;const o={};Object.keys(n.props||{}).forEach(l=>{o[l]=n.props[l].export(e)});const a=(r=n.children)==null?void 0:r.map(l=>l instanceof M?l.export(e):l),i=n.configure||{},s=i.propsSetter||{},c={};Object.keys(s).forEach(l=>{const p=Yn(s,l,!1);p&&(c[l]=p)}),i.propsSetter=c,this.material&&this.materialsModel.usedMaterials.push(this.material);let u={...n,configure:i,props:o,children:a,condition:n.condition};return e==="design"&&delete u.id,u=Ar(u),u}}const bn=(t,e,r)=>{const n={...t,id:Z(),props:{},componentName:At.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:vo(t.configure||{},{propsSetter:{},advanceSetter:{}})};let o=[];R(t.children)?o=t.children.map(i=>i instanceof M?i:F(i)?new M(i,{parent:e,materials:r}):i):t.children instanceof M?o.push(t.children):t.children&&F(t.children)&&o.push(new M(t.children,{parent:e,materials:r}));const a=Object.keys(t.props||{});return a.length&&a.forEach(i=>{var s;const c=(s=t.props)==null?void 0:s[i];c instanceof at?n.props[i]=c:n.props[i]=new at(i,c||"",{parent:e,materials:r})}),n.children=o,n};class Zt{constructor(e,{parent:r,materials:n}){_(this,"rawData"),_(this,"data"),_(this,"nodeType",At.ROOT_CONTAINER),_(this,"emitter",ne),_(this,"materialsModel"),_(this,"listenerHandle"),_(this,"onChangeCbQueue"),_(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=bn(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener(),this.parent=r}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}get id(){return this.data.id}get value(){return this.data}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}updateWithPlainObj(e){const r={...this.data,...e};return this.data=bn(r,this,this.materialsModel),r}updateValue(e){const r=this.data;this.updateWithPlainObj(e),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return Pr(this,e)}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e=xr.SAVE){var r;const n=this.data,o={};Object.keys(n.props||{}).forEach(c=>{o[c]=n.props[c].export(e)});const a=((r=n.children)==null?void 0:r.map(c=>{var u;return(u=c==null?void 0:c.export)==null?void 0:u.call(c,e)}))||[],i={...n,props:o,children:a.filter(c=>c),condition:n.condition};let s=go(i,["id"]);return s=Ar(s),s}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}destroy(){this.listenerHandle.forEach(e=>e())}clone(e){const r={...this.export("design"),id:e||Z()};return new Zt(r,{materials:this.materialsModel,parent:null})}}const ct=t=>(t==null?void 0:t.type)===V.EXPRESSION,Uf=t=>(t==null?void 0:t.type)===V.FUNCTION,Z=()=>Math.random().toString(32).slice(3,9),kf=t=>(t==null?void 0:t.nodeType)==="NODE",De=t=>(t==null?void 0:t.nodeType)==="PROP",Vf=t=>(t==null?void 0:t.nodeType)==="SLOT",Ar=t=>uf(t,e=>F(e)?!Object.keys(e).length:R(e)?!e.length:!e);function zf(t,e){const r=[t];for(;r.length;){const n=r.shift();if(n&&e(n))return n;const o=(n==null?void 0:n.props)||{},a=s=>{if(s instanceof M){r.push(s);return}if(s instanceof Ct&&a(s.value.value),s instanceof at){a(s.value);return}if(F(s)){const c=s;Object.keys(c).forEach(u=>{a(c[u])});return}if(R(s)){s.forEach(c=>{a(c)});return}};a(o);const i=(n==null?void 0:n.value.children.filter(s=>s instanceof M))||[];r.push(...i)}}function Pr(t,e){return zf(t,r=>r.id===e)}const Gf=t=>{const e=co(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${Z()}`,title:n.title||t.title,category:n.category||t.category,tags:[...n.tags||[],...t.tags||[]],groupName:n.groupName||t.groupName,snapshot:n.snapshot||t.icon,snapshotText:n.snapshotText,schema:{...n.schema,componentName:n.schema.componentName||t.componentName}})),e};class Hf{constructor(e){_(this,"rawData"),_(this,"data"),this.rawData=e,this.data=Gf(e)}get value(){return this.data}get rawValue(){return this.rawData}get componentName(){return this.data.componentName}get snippets(){return this.data.snippets}getSnippetById(e){return this.data.snippets.find(r=>r.id===e)}}const Ie=t=>{if(!R(t))throw new Error("Materials must be a array");return t.map(e=>new Hf(e))},Wf=t=>{t==null||t.forEach(e=>{Mr({data:e,dataStruct:Pf,throwError:!1})})};class dt{constructor(e){_(this,"rawData"),_(this,"data"),_(this,"usedMaterials",[]),this.rawData=e,Wf(e),this.data=Ie(e)}addMaterials(e){const r=Ie(e),n=[],o=this.data.map(i=>{const s=r.findIndex(c=>c.componentName===i.componentName);return s>=0?(n.push(s),r[s]):i}),a=r.filter((i,s)=>!n.includes(s));this.data=[...o,...a]}replaceMaterials(e){const r=Ie(e);this.data=[...r]}removeMaterial(e){const r=this.data.filter(n=>!e.includes(n.componentName));this.data=r}findByComponentName(e){return this.data.find(r=>r.componentName===e)}findSnippetById(e){const r=[...this.data];let n=null;for(;!n&&r.length;){const o=r.pop();n=o==null?void 0:o.getSnippetById(e)}return n}getAllSnippets(){const e=this.data.reduce((a,i)=>(a.push(...i.snippets),a),[]),r=[],n={default:[]};e.forEach(a=>{const i=a.groupName||"default";r.includes(i)||(r.push(i),n[i]=[]),n[i].push(a)});let o=[];return r.forEach(a=>{const i=["default"],s={default:[]},c=n[a];if(c.length!==0){c.forEach(p=>{const f=p.category||"default";i.includes(f)||(i.push(f),s[f]=[]),s[f].push(p)});const u=[];i.forEach(p=>{s[p].length&&u.push({name:p,list:s[p]})});const l={name:a,list:u};o.push(l)}}),o=o.sort((a,i)=>(a.name||"")>(i.name||"")?1:-1),o}get value(){return this.data}get rawValue(){return this.rawData}}const Jf=C({version:v(),name:v(),css:m(v()),renderType:m(B([L("COMPONENT"),L("PAGE")])),loadType:m(T()),lifecycle:m(T()),props:m(T()),methods:m(P(Df)),componentsMeta:P($r(C({componentName:v()}),Nr)),thirdLibs:m(wf),componentsTree:If,assets:m(P(T()))}),wo=t=>(Mr({data:t,dataStruct:Jf,throwError:!1}),t),Le=(t,e,r)=>({...t,componentsTree:new Zt(t.componentsTree,{parent:e,materials:r})});class he{constructor(e,r){_(this,"nodeType","PAGE"),_(this,"rawData"),_(this,"emitter",ne),_(this,"data"),_(this,"parent"),_(this,"materialsModel"),_(this,"assetPackagesList"),wo(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new dt((r==null?void 0:r.materials)||[]),this.data=Le(e,this,this.materialsModel),this.assetPackagesList=[...(r==null?void 0:r.assetPackagesList)||[],...this.data.assets||[]]}updatePage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=Le(e,this,this.materialsModel),this.emitter.emit("onPageChange",{value:this.data,preValue:r,node:this})}reloadPage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=Le(e,this,this.materialsModel),this.emitter.emit("onReloadPage",{value:this.data,preValue:r,node:this})}get value(){return this.data}getNode(e){if(!e)return;const r=this.data.componentsTree;return Pr(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof Zt)return console.warn("Not found parent node"),!1;if(a instanceof at)return console.warn("CProp can not add node"),!1;if(a instanceof Ct){const s=a.value.value,c=s.findIndex(u=>u===r)??-1;return c>=0?(n==="BEFORE"?s.splice(c,0,e):s.splice(c+1,0,e),e.parent=a,(o=a.parent)==null||o.updateValue(),!0):!1}if(a instanceof he)return!1;const i=(a==null?void 0:a.value.children.findIndex(s=>s===r))??-1;return i>=0?(n==="BEFORE"?a==null||a.value.children.splice(i,0,e):a==null||a.value.children.splice(i+1,0,e),e.parent=a,a==null||a.updateValue(),!0):(console.warn("Not found target node"),!1)}if(n==="CHILD_START")return r.value.children.unshift(e),e.parent=r,r.updateValue(),!0;if(n==="CHILD_END")return r.value.children.push(e),e.parent=r,r.updateValue(),!0;if(F(n)){const a=n;if(a.type==="CHILD"){const i=a.pos,s=a.index||0;return i==="BEFORE"?r==null||r.value.children.splice(s,0,e):r==null||r.value.children.splice(s+1,0,e),e.parent=r,r.updateValue(),!0}else console.warn("Can not parse pos obj")}return!1}createNode(e){return delete e.id,new M(e,{parent:null,materials:this.materialsModel})}addNodeById(e,r,n="AFTER"){const o=this.getNode(r);return o?this.addNode(e,o,n):(console.warn(`Not find a node by ${r}, pls check it`),!1)}copyNode(e){const r=e.export("design");r.id=Z();const n=new M(r,{parent:e.parent,materials:this.materialsModel});return this.addNode(n,e,"AFTER"),n}copyNodeById(e){const r=this.getNode(e);return r&&r instanceof M?this.copyNode(r):!1}moveNode(e,r,n){this.deleteNode(e);let o=r;return["AFTER","BEFORE"].includes(n)&&(o=r.parent),e.parent=o,this.addNode(e,r,n)}moveNodeById(e,r,n){const o=this.getNode(e),a=this.getNode(r);return o&&a&&o instanceof M&&a instanceof M?this.moveNode(o,a,n):!1}deleteNode(e){var r;const n=e.parent;if(!n)throw new Error("parent node is null or undefined, pls check it");if(n instanceof Ct){const o=n.value.value,a=o.findIndex(s=>s===e),i=o[a];return o.splice(a,1),(r=n.parent)==null||r.updateValue(),i}if(n instanceof M||n instanceof Zt){const o=n.value.children,a=o.findIndex(s=>s===e),i=o[a];return o.splice(a,1),n.updateValue(),i}}deleteNodeById(e){const r=this.getNode(e);if(r)return this.deleteNode(r)}export(e=xr.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],i=this.materialsModel.usedMaterials.map(c=>{const u=o.find(l=>{var p;return l.package===((p=c.value.npm)==null?void 0:p.package)});return u&&a.push(u),{componentName:c.componentName,...co(c.value.npm||{})}}).filter(c=>c.componentName&&c.package&&c.version?!0:(console.warn(`${c} not a valid material info`),!1));this.materialsModel.usedMaterials=[];let s={...this.data,componentsTree:Ar(n),componentsMeta:i,thirdLibs:this.data.thirdLibs,assets:[]};return(r=this.data.thirdLibs)==null||r.forEach(c=>{const u=o.find(l=>c.package===l.package);u&&a.push(u)}),s.assets=vf(a,c=>c.package),s=go(s,["id"]),JSON.parse(JSON.stringify(s))}getRootNode(){return this.data.componentsTree}}At.ROOT_CONTAINER;var Qf=typeof global=="object"&&global&&global.Object===Object&&global;const Eo=Qf;var qf=typeof self=="object"&&self&&self.Object===Object&&self,Yf=Eo||qf||Function("return this")();const Pt=Yf;var Kf=Pt.Symbol;const wt=Kf;var $o=Object.prototype,Xf=$o.hasOwnProperty,Zf=$o.toString,Vt=wt?wt.toStringTag:void 0;function tp(t){var e=Xf.call(t,Vt),r=t[Vt];try{t[Vt]=void 0;var n=!0}catch{}var o=Zf.call(t);return n&&(e?t[Vt]=r:delete t[Vt]),o}var ep=Object.prototype,rp=ep.toString;function np(t){return rp.call(t)}var op="[object Null]",ap="[object Undefined]",_n=wt?wt.toStringTag:void 0;function oe(t){return t==null?t===void 0?ap:op:_n&&_n in Object(t)?tp(t):np(t)}function Rt(t){return t!=null&&typeof t=="object"}var sp="[object Symbol]";function ip(t){return typeof t=="symbol"||Rt(t)&&oe(t)==sp}function cp(t,e){for(var r=-1,n=t==null?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var up=Array.isArray;const Et=up;var lp=1/0,Sn=wt?wt.prototype:void 0,jn=Sn?Sn.toString:void 0;function No(t){if(typeof t=="string")return t;if(Et(t))return cp(t,No)+"";if(ip(t))return jn?jn.call(t):"";var e=t+"";return e=="0"&&1/t==-lp?"-0":e}function yt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function xo(t){return t}var fp="[object AsyncFunction]",pp="[object Function]",dp="[object GeneratorFunction]",hp="[object Proxy]";function Rr(t){if(!yt(t))return!1;var e=oe(t);return e==pp||e==dp||e==fp||e==hp}var mp=Pt["__core-js_shared__"];const Be=mp;var On=function(){var t=/[^.]+$/.exec(Be&&Be.keys&&Be.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function vp(t){return!!On&&On in t}var gp=Function.prototype,yp=gp.toString;function bp(t){if(t!=null){try{return yp.call(t)}catch{}try{return t+""}catch{}}return""}var _p=/[\\^$.*+?()[\]{}|]/g,Sp=/^\[object .+?Constructor\]$/,jp=Function.prototype,Op=Object.prototype,Cp=jp.toString,wp=Op.hasOwnProperty,Ep=RegExp("^"+Cp.call(wp).replace(_p,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $p(t){if(!yt(t)||vp(t))return!1;var e=Rr(t)?Ep:Sp;return e.test(bp(t))}function Np(t,e){return t==null?void 0:t[e]}function Dr(t,e){var r=Np(t,e);return $p(r)?r:void 0}var Cn=Object.create,xp=function(){function t(){}return function(e){if(!yt(e))return{};if(Cn)return Cn(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const Tp=xp;function Mp(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ap(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Pp=800,Rp=16,Dp=Date.now;function Ip(t){var e=0,r=0;return function(){var n=Dp(),o=Rp-(n-r);if(r=n,o>0){if(++e>=Pp)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Lp(t){return function(){return t}}var Bp=function(){try{var t=Dr(Object,"defineProperty");return t({},"",{}),t}catch{}}();const me=Bp;var Fp=me?function(t,e){return me(t,"toString",{configurable:!0,enumerable:!1,value:Lp(e),writable:!0})}:xo;const Up=Fp;var kp=Ip(Up);const Vp=kp;var zp=9007199254740991,Gp=/^(?:0|[1-9]\d*)$/;function To(t,e){var r=typeof t;return e=e??zp,!!e&&(r=="number"||r!="symbol"&&Gp.test(t))&&t>-1&&t%1==0&&t<e}function Ir(t,e,r){e=="__proto__"&&me?me(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Oe(t,e){return t===e||t!==t&&e!==e}var Hp=Object.prototype,Wp=Hp.hasOwnProperty;function Jp(t,e,r){var n=t[e];(!(Wp.call(t,e)&&Oe(n,r))||r===void 0&&!(e in t))&&Ir(t,e,r)}function Qp(t,e,r,n){var o=!r;r||(r={});for(var a=-1,i=e.length;++a<i;){var s=e[a],c=n?n(r[s],t[s],s,r,t):void 0;c===void 0&&(c=t[s]),o?Ir(r,s,c):Jp(r,s,c)}return r}var wn=Math.max;function qp(t,e,r){return e=wn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=wn(n.length-e,0),i=Array(a);++o<a;)i[o]=n[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=n[o];return s[e]=r(i),Mp(t,this,s)}}function Yp(t,e){return Vp(qp(t,e,xo),t+"")}var Kp=9007199254740991;function Mo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Kp}function Lr(t){return t!=null&&Mo(t.length)&&!Rr(t)}function Xp(t,e,r){if(!yt(r))return!1;var n=typeof e;return(n=="number"?Lr(r)&&To(e,r.length):n=="string"&&e in r)?Oe(r[e],t):!1}function Zp(t){return Yp(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,i&&Xp(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var s=r[n];s&&t(e,s,n,a)}return e})}var td=Object.prototype;function Ao(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||td;return t===r}function ed(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var rd="[object Arguments]";function En(t){return Rt(t)&&oe(t)==rd}var Po=Object.prototype,nd=Po.hasOwnProperty,od=Po.propertyIsEnumerable,ad=En(function(){return arguments}())?En:function(t){return Rt(t)&&nd.call(t,"callee")&&!od.call(t,"callee")};const Xe=ad;function sd(){return!1}var Ro=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$n=Ro&&typeof module=="object"&&module&&!module.nodeType&&module,id=$n&&$n.exports===Ro,Nn=id?Pt.Buffer:void 0,cd=Nn?Nn.isBuffer:void 0,ud=cd||sd;const Do=ud;var ld="[object Arguments]",fd="[object Array]",pd="[object Boolean]",dd="[object Date]",hd="[object Error]",md="[object Function]",vd="[object Map]",gd="[object Number]",yd="[object Object]",bd="[object RegExp]",_d="[object Set]",Sd="[object String]",jd="[object WeakMap]",Od="[object ArrayBuffer]",Cd="[object DataView]",wd="[object Float32Array]",Ed="[object Float64Array]",$d="[object Int8Array]",Nd="[object Int16Array]",xd="[object Int32Array]",Td="[object Uint8Array]",Md="[object Uint8ClampedArray]",Ad="[object Uint16Array]",Pd="[object Uint32Array]",N={};N[wd]=N[Ed]=N[$d]=N[Nd]=N[xd]=N[Td]=N[Md]=N[Ad]=N[Pd]=!0;N[ld]=N[fd]=N[Od]=N[pd]=N[Cd]=N[dd]=N[hd]=N[md]=N[vd]=N[gd]=N[yd]=N[bd]=N[_d]=N[Sd]=N[jd]=!1;function Rd(t){return Rt(t)&&Mo(t.length)&&!!N[oe(t)]}function Dd(t){return function(e){return t(e)}}var Io=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wt=Io&&typeof module=="object"&&module&&!module.nodeType&&module,Id=Wt&&Wt.exports===Io,Fe=Id&&Eo.process,Ld=function(){try{var t=Wt&&Wt.require&&Wt.require("util").types;return t||Fe&&Fe.binding&&Fe.binding("util")}catch{}}();const xn=Ld;var Tn=xn&&xn.isTypedArray,Bd=Tn?Dd(Tn):Rd;const Lo=Bd;var Fd=Object.prototype,Ud=Fd.hasOwnProperty;function kd(t,e){var r=Et(t),n=!r&&Xe(t),o=!r&&!n&&Do(t),a=!r&&!n&&!o&&Lo(t),i=r||n||o||a,s=i?ed(t.length,String):[],c=s.length;for(var u in t)(e||Ud.call(t,u))&&!(i&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||To(u,c)))&&s.push(u);return s}function Vd(t,e){return function(r){return t(e(r))}}function zd(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Gd=Object.prototype,Hd=Gd.hasOwnProperty;function Wd(t){if(!yt(t))return zd(t);var e=Ao(t),r=[];for(var n in t)n=="constructor"&&(e||!Hd.call(t,n))||r.push(n);return r}function Bo(t){return Lr(t)?kd(t,!0):Wd(t)}var Jd=Dr(Object,"create");const te=Jd;function Qd(){this.__data__=te?te(null):{},this.size=0}function qd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Yd="__lodash_hash_undefined__",Kd=Object.prototype,Xd=Kd.hasOwnProperty;function Zd(t){var e=this.__data__;if(te){var r=e[t];return r===Yd?void 0:r}return Xd.call(e,t)?e[t]:void 0}var th=Object.prototype,eh=th.hasOwnProperty;function rh(t){var e=this.__data__;return te?e[t]!==void 0:eh.call(e,t)}var nh="__lodash_hash_undefined__";function oh(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=te&&e===void 0?nh:e,this}function ht(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ht.prototype.clear=Qd;ht.prototype.delete=qd;ht.prototype.get=Zd;ht.prototype.has=rh;ht.prototype.set=oh;function ah(){this.__data__=[],this.size=0}function Ce(t,e){for(var r=t.length;r--;)if(Oe(t[r][0],e))return r;return-1}var sh=Array.prototype,ih=sh.splice;function ch(t){var e=this.__data__,r=Ce(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ih.call(e,r,1),--this.size,!0}function uh(t){var e=this.__data__,r=Ce(e,t);return r<0?void 0:e[r][1]}function lh(t){return Ce(this.__data__,t)>-1}function fh(t,e){var r=this.__data__,n=Ce(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function rt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}rt.prototype.clear=ah;rt.prototype.delete=ch;rt.prototype.get=uh;rt.prototype.has=lh;rt.prototype.set=fh;var ph=Dr(Pt,"Map");const Fo=ph;function dh(){this.size=0,this.__data__={hash:new ht,map:new(Fo||rt),string:new ht}}function hh(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function we(t,e){var r=t.__data__;return hh(e)?r[typeof e=="string"?"string":"hash"]:r.map}function mh(t){var e=we(this,t).delete(t);return this.size-=e?1:0,e}function vh(t){return we(this,t).get(t)}function gh(t){return we(this,t).has(t)}function yh(t,e){var r=we(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Dt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Dt.prototype.clear=dh;Dt.prototype.delete=mh;Dt.prototype.get=vh;Dt.prototype.has=gh;Dt.prototype.set=yh;function Uo(t){return t==null?"":No(t)}var bh=Vd(Object.getPrototypeOf,Object);const ko=bh;var _h="[object Object]",Sh=Function.prototype,jh=Object.prototype,Vo=Sh.toString,Oh=jh.hasOwnProperty,Ch=Vo.call(Object);function $t(t){if(!Rt(t)||oe(t)!=_h)return!1;var e=ko(t);if(e===null)return!0;var r=Oh.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Vo.call(r)==Ch}function wh(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(o);++n<o;)a[n]=t[n+e];return a}function Eh(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:wh(t,e,r)}var $h="\\ud800-\\udfff",Nh="\\u0300-\\u036f",xh="\\ufe20-\\ufe2f",Th="\\u20d0-\\u20ff",Mh=Nh+xh+Th,Ah="\\ufe0e\\ufe0f",Ph="\\u200d",Rh=RegExp("["+Ph+$h+Mh+Ah+"]");function zo(t){return Rh.test(t)}function Dh(t){return t.split("")}var Go="\\ud800-\\udfff",Ih="\\u0300-\\u036f",Lh="\\ufe20-\\ufe2f",Bh="\\u20d0-\\u20ff",Fh=Ih+Lh+Bh,Uh="\\ufe0e\\ufe0f",kh="["+Go+"]",Ze="["+Fh+"]",tr="\\ud83c[\\udffb-\\udfff]",Vh="(?:"+Ze+"|"+tr+")",Ho="[^"+Go+"]",Wo="(?:\\ud83c[\\udde6-\\uddff]){2}",Jo="[\\ud800-\\udbff][\\udc00-\\udfff]",zh="\\u200d",Qo=Vh+"?",qo="["+Uh+"]?",Gh="(?:"+zh+"(?:"+[Ho,Wo,Jo].join("|")+")"+qo+Qo+")*",Hh=qo+Qo+Gh,Wh="(?:"+[Ho+Ze+"?",Ze,Wo,Jo,kh].join("|")+")",Jh=RegExp(tr+"(?="+tr+")|"+Wh+Hh,"g");function Qh(t){return t.match(Jh)||[]}function qh(t){return zo(t)?Qh(t):Dh(t)}function Yh(t){return function(e){e=Uo(e);var r=zo(e)?qh(e):void 0,n=r?r[0]:e.charAt(0),o=r?Eh(r,1).join(""):e.slice(1);return n[t]()+o}}var Kh=Yh("toUpperCase");const Xh=Kh;function Zh(t){return Xh(Uo(t).toLowerCase())}function tm(){this.__data__=new rt,this.size=0}function em(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function rm(t){return this.__data__.get(t)}function nm(t){return this.__data__.has(t)}var om=200;function am(t,e){var r=this.__data__;if(r instanceof rt){var n=r.__data__;if(!Fo||n.length<om-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Dt(n)}return r.set(t,e),this.size=r.size,this}function It(t){var e=this.__data__=new rt(t);this.size=e.size}It.prototype.clear=tm;It.prototype.delete=em;It.prototype.get=rm;It.prototype.has=nm;It.prototype.set=am;var Yo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mn=Yo&&typeof module=="object"&&module&&!module.nodeType&&module,sm=Mn&&Mn.exports===Yo,An=sm?Pt.Buffer:void 0,Pn=An?An.allocUnsafe:void 0;function im(t,e){if(e)return t.slice();var r=t.length,n=Pn?Pn(r):new t.constructor(r);return t.copy(n),n}var cm=Pt.Uint8Array;const Rn=cm;function um(t){var e=new t.constructor(t.byteLength);return new Rn(e).set(new Rn(t)),e}function lm(t,e){var r=e?um(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function fm(t){return typeof t.constructor=="function"&&!Ao(t)?Tp(ko(t)):{}}function pm(t){return function(e,r,n){for(var o=-1,a=Object(e),i=n(e),s=i.length;s--;){var c=i[t?s:++o];if(r(a[c],c,a)===!1)break}return e}}var dm=pm();const hm=dm;function er(t,e,r){(r!==void 0&&!Oe(t[e],r)||r===void 0&&!(e in t))&&Ir(t,e,r)}function mm(t){return Rt(t)&&Lr(t)}function rr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function vm(t){return Qp(t,Bo(t))}function gm(t,e,r,n,o,a,i){var s=rr(t,r),c=rr(e,r),u=i.get(c);if(u){er(t,r,u);return}var l=a?a(s,c,r+"",t,e,i):void 0,p=l===void 0;if(p){var f=Et(c),d=!f&&Do(c),h=!f&&!d&&Lo(c);l=c,f||d||h?Et(s)?l=s:mm(s)?l=Ap(s):d?(p=!1,l=im(c,!0)):h?(p=!1,l=lm(c,!0)):l=[]:$t(c)||Xe(c)?(l=s,Xe(s)?l=vm(s):(!yt(s)||Rr(s))&&(l=fm(c))):p=!1}p&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),er(t,r,l)}function Ko(t,e,r,n,o){t!==e&&hm(e,function(a,i){if(o||(o=new It),yt(a))gm(t,e,i,r,Ko,n,o);else{var s=n?n(rr(t,i),a,i+"",t,e,o):void 0;s===void 0&&(s=a),er(t,i,s)}},Bo)}var ym=Zp(function(t,e,r){Ko(t,e,r)});const bm=ym,_m=function(t){return!(!t||typeof t!="function"||!t.prototype)};function Xo(t){const e=t==null?void 0:t.prototype;return!!(e&&e.isReactComponent)}function Zo(t){var n,o;const r=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.forward_ref"):60112;return(t==null?void 0:t.$$typeof)===r||((n=t==null?void 0:t.prototype)==null?void 0:n.isReactComponent)||((o=t==null?void 0:t.prototype)==null?void 0:o.setState)||t._forwardRef}function ta(t){class e extends S.Component{render(){return S.createElement(t,this.props)}}return e.displayName=t.displayName,e}const lt=(t,e)=>{const r=n=>{const a=`
|
|
7
7
|
${Object.keys(e).map(i=>`const ${i} = $$context['${i}'];`).join(`
|
|
8
8
|
`)}
|
|
9
9
|
return ${n};
|