@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.umd.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 Tf(({data:a})=>{try{return Xn(a,o),{isValidate:!0}}catch(s){let i=s;return s instanceof Yn&&(i=s.failures().map(c=>`【${c.path.join(".")}】: ${c.message}
|
|
6
|
-
`)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var Tt=(t=>(t.ROOT_CONTAINER="RootContainer",t))(Tt||{});const Mf=w({type:F(G.FUNCTION),value:v()}),Af=sr(Zn(Nt,["componentName"]),w({componentName:F("RootContainer")}));function Pf(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 Kt=Pf(),xf=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new vt([]);return e&&(o=e.materialsMode||new vt([])),n&&(D(n)?r.value=n.map(a=>new A(a,{parent:e,materials:o})):B(n)&&r.value.push(new A(n,{parent:e,materials:o}))),r};class Mt{constructor(e,r){j(this,"nodeType","SLOT"),j(this,"rawData"),j(this,"parent"),j(this,"emitter",Kt),j(this,"data"),j(this,"id"),j(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new vt([]);this.materialsMode=n,this.id=Z(),this.data=xf(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof A)return o.export(e);if(B(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return D(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const oo=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===hr.SINGLE?e.push(n.content):n.type===hr.GROUP&&(e=[...e,...oo(n.content)]):e.push(r)}),e},vr=(t,e,r)=>{if(t.type)return t.type===G.SLOT?new Mt(t,{parent:e,materials:r}):t;if(B(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=gr(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>vr(n,e,r)):t},gr=(t,e,r)=>B(t)?vr(t,e,r):D(t)?t.map(n=>vr(n,e,r)):t;class it{constructor(e,r,n){j(this,"nodeType","PROP"),j(this,"rawData"),j(this,"parent"),j(this,"emitter",Kt),j(this,"data"),j(this,"name"),j(this,"materialsMode");const o=(n==null?void 0:n.materials)||new vt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=gr(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=gr(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof Mt)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof A){const r=e.material;return oo((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 it||o instanceof Mt||o instanceof A)return o.export(e);if(D(o))return o.map(a=>n(a));if(B(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return o};return n(r)}}const If=t=>{if(typeof t=="string")return!0;mr({data:t,dataStruct:Nt,throwError:!1})},ao=(t,e,r=new vt([]))=>{if(typeof t=="string")return t;const n={...t,id:t.id??Z(),children:[],props:{},methods:t.methods||[],configure:Qn(t.configure||{},{propsSetter:{},advanceSetter:{}})},o=Object.keys(t.props||{});return o.length&&o.forEach(a=>{var s;const i=(s=t.props)==null?void 0:s[a];if(i instanceof it){n.props[a]=i;return}n.props[a]=new it(a,i||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof A)return a;if(B(a)){const s=a;return new A(s,{parent:e,materials:r})}else return a}):(t.children instanceof A&&(n.children=[t.children]),n.children=[new A(t.children,{parent:e,materials:r})])),n};class A{constructor(e,r){j(this,"nodeType","NODE"),j(this,"rawData"),j(this,"data"),j(this,"emitter",Kt),j(this,"parent"),j(this,"materialsModel"),j(this,"listenerHandle"),j(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),If(e);const n=(r==null?void 0:r.materials)||new vt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=ao(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 A(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=ao(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 _r(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 A?l.export(e):l),s=n.configure||{},i=s.propsSetter||{},c={};Object.keys(i).forEach(l=>{const d=fn(i,l,!1);d&&(c[l]=d)}),s.propsSetter=c,this.material&&this.materialsModel.usedMaterials.push(this.material);let u={...n,configure:s,props:o,children:a,condition:n.condition};return e==="design"&&delete u.id,u=br(u),u}}const io=(t,e,r)=>{const n={...t,id:Z(),props:{},componentName:Tt.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:Qn(t.configure||{},{propsSetter:{},advanceSetter:{}})};let o=[];D(t.children)?o=t.children.map(s=>s instanceof A?s:B(s)?new A(s,{parent:e,materials:r}):s):t.children instanceof A?o.push(t.children):t.children&&B(t.children)&&o.push(new A(t.children,{parent:e,materials:r}));const a=Object.keys(t.props||{});return a.length&&a.forEach(s=>{var i;const c=(i=t.props)==null?void 0:i[s];c instanceof it?n.props[s]=c:n.props[s]=new it(s,c||"",{parent:e,materials:r})}),n.children=o,n};class Xt{constructor(e,{parent:r,materials:n}){j(this,"rawData"),j(this,"data"),j(this,"nodeType",Tt.ROOT_CONTAINER),j(this,"emitter",Kt),j(this,"materialsModel"),j(this,"listenerHandle"),j(this,"onChangeCbQueue"),j(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=io(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=io(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 _r(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=lr.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)}))||[],s={...n,props:o,children:a.filter(c=>c),condition:n.condition};let i=qn(s,["id"]);return i=br(i),i}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 Xt(r,{materials:this.materialsModel,parent:null})}}const mt=t=>(t==null?void 0:t.type)===G.EXPRESSION,Df=t=>(t==null?void 0:t.type)===G.FUNCTION,Z=()=>Math.random().toString(32).slice(3,9),Rf=t=>(t==null?void 0:t.nodeType)==="NODE",yr=t=>(t==null?void 0:t.nodeType)==="PROP",Lf=t=>(t==null?void 0:t.nodeType)==="SLOT",br=t=>nf(t,e=>B(e)?!Object.keys(e).length:D(e)?!e.length:!e);function Bf(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=i=>{if(i instanceof A){r.push(i);return}if(i instanceof Mt&&a(i.value.value),i instanceof it){a(i.value);return}if(B(i)){const c=i;Object.keys(c).forEach(u=>{a(c[u])});return}if(D(i)){i.forEach(c=>{a(c)});return}};a(o);const s=(n==null?void 0:n.value.children.filter(i=>i instanceof A))||[];r.push(...s)}}function _r(t,e){return Bf(t,r=>r.id===e)}const Ff=t=>{const e=Ln(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 Uf{constructor(e){j(this,"rawData"),j(this,"data"),this.rawData=e,this.data=Ff(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 Sr=t=>{if(!D(t))throw new Error("Materials must be a array");return t.map(e=>new Uf(e))},kf=t=>{t==null||t.forEach(e=>{mr({data:e,dataStruct:Nf,throwError:!1})})};class vt{constructor(e){j(this,"rawData"),j(this,"data"),j(this,"usedMaterials",[]),this.rawData=e,kf(e),this.data=Sr(e)}addMaterials(e){const r=Sr(e),n=[],o=this.data.map(s=>{const i=r.findIndex(c=>c.componentName===s.componentName);return i>=0?(n.push(i),r[i]):s}),a=r.filter((s,i)=>n.includes(i));this.data=[...o,...a]}replaceMaterials(e){const r=Sr(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,s)=>(a.push(...s.snippets),a),[]),r=[],n={default:[]};e.forEach(a=>{const s=a.groupName||"default";r.includes(s)||(r.push(s),n[s]=[]),n[s].push(a)});let o=[];return r.forEach(a=>{const s=["default"],i={default:[]},c=n[a];if(c.length!==0){c.forEach(d=>{const f=d.category||"default";s.includes(f)||(s.push(f),i[f]=[]),i[f].push(d)});const u=[];s.forEach(d=>{i[d].length&&u.push({name:d,list:i[d]})});const l={name:a,list:u};o.push(l)}}),o=o.sort((a,s)=>(a.name||"")>(s.name||"")?1:-1),o}get value(){return this.data}get rawValue(){return this.rawData}}const Vf=w({version:v(),name:v(),css:m(v()),renderType:m(U([F("COMPONENT"),F("PAGE")])),loadType:m(M()),lifecycle:m(M()),props:m(M()),methods:m(I(Mf)),componentsMeta:I(sr(w({componentName:v()}),ur)),thirdLibs:m(_f),componentsTree:Af,assets:m(I(M()))}),so=t=>(mr({data:t,dataStruct:Vf,throwError:!1}),t),jr=(t,e,r)=>({...t,componentsTree:new Xt(t.componentsTree,{parent:e,materials:r})});class ye{constructor(e,r){j(this,"nodeType","PAGE"),j(this,"rawData"),j(this,"emitter",Kt),j(this,"data"),j(this,"parent"),j(this,"materialsModel"),j(this,"assetPackagesList"),so(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new vt((r==null?void 0:r.materials)||[]),this.data=jr(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=jr(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=jr(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 _r(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof Xt)return console.warn("Not found parent node"),!1;if(a instanceof it)return console.warn("CProp can not add node"),!1;if(a instanceof Mt){const i=a.value.value,c=i.findIndex(u=>u===r)??-1;return c>=0?(n==="BEFORE"?i.splice(c,0,e):i.splice(c+1,0,e),e.parent=a,(o=a.parent)==null||o.updateValue(),!0):!1}if(a instanceof ye)return!1;const s=(a==null?void 0:a.value.children.findIndex(i=>i===r))??-1;return s>=0?(n==="BEFORE"?a==null||a.value.children.splice(s,0,e):a==null||a.value.children.splice(s+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(B(n)){const a=n;if(a.type==="CHILD"){const s=a.pos,i=a.index||0;return s==="BEFORE"?r==null||r.value.children.splice(i,0,e):r==null||r.value.children.splice(i+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 A(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 A(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 A?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 A&&a instanceof A?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 Mt){const o=n.value.value,a=o.findIndex(i=>i===e),s=o[a];return o.splice(a,1),(r=n.parent)==null||r.updateValue(),s}if(n instanceof A||n instanceof Xt){const o=n.value.children,a=o.findIndex(i=>i===e),s=o[a];return o.splice(a,1),n.updateValue(),s}}deleteNodeById(e){const r=this.getNode(e);if(r)return this.deleteNode(r)}export(e=lr.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],s=this.materialsModel.usedMaterials.map(c=>{const u=o.find(l=>{var d;return l.package===((d=c.value.npm)==null?void 0:d.package)});return u&&a.push(u),{componentName:c.componentName,...Ln(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 i={...this.data,componentsTree:br(n),componentsMeta:s,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)}),i.assets=ff(a,c=>c.package),i=qn(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}Tt.ROOT_CONTAINER;var Gf=typeof global=="object"&&global&&global.Object===Object&&global;const co=Gf;var zf=typeof self=="object"&&self&&self.Object===Object&&self,Hf=co||zf||Function("return this")();const At=Hf;var Jf=At.Symbol;const Pt=Jf;var uo=Object.prototype,Wf=uo.hasOwnProperty,Qf=uo.toString,Zt=Pt?Pt.toStringTag:void 0;function qf(t){var e=Wf.call(t,Zt),r=t[Zt];try{t[Zt]=void 0;var n=!0}catch{}var o=Qf.call(t);return n&&(e?t[Zt]=r:delete t[Zt]),o}var Yf=Object.prototype,Kf=Yf.toString;function Xf(t){return Kf.call(t)}var Zf="[object Null]",td="[object Undefined]",lo=Pt?Pt.toStringTag:void 0;function te(t){return t==null?t===void 0?td:Zf:lo&&lo in Object(t)?qf(t):Xf(t)}function xt(t){return t!=null&&typeof t=="object"}var ed="[object Symbol]";function rd(t){return typeof t=="symbol"||xt(t)&&te(t)==ed}function nd(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 od=Array.isArray;const It=od;var ad=1/0,fo=Pt?Pt.prototype:void 0,po=fo?fo.toString:void 0;function ho(t){if(typeof t=="string")return t;if(It(t))return nd(t,ho)+"";if(rd(t))return po?po.call(t):"";var e=t+"";return e=="0"&&1/t==-ad?"-0":e}function gt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function mo(t){return t}var id="[object AsyncFunction]",sd="[object Function]",cd="[object GeneratorFunction]",ud="[object Proxy]";function Cr(t){if(!gt(t))return!1;var e=te(t);return e==sd||e==cd||e==id||e==ud}var ld=At["__core-js_shared__"];const Or=ld;var vo=function(){var t=/[^.]+$/.exec(Or&&Or.keys&&Or.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function fd(t){return!!vo&&vo in t}var dd=Function.prototype,pd=dd.toString;function hd(t){if(t!=null){try{return pd.call(t)}catch{}try{return t+""}catch{}}return""}var md=/[\\^$.*+?()[\]{}|]/g,vd=/^\[object .+?Constructor\]$/,gd=Function.prototype,yd=Object.prototype,bd=gd.toString,_d=yd.hasOwnProperty,Sd=RegExp("^"+bd.call(_d).replace(md,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function jd(t){if(!gt(t)||fd(t))return!1;var e=Cr(t)?Sd:vd;return e.test(hd(t))}function Cd(t,e){return t==null?void 0:t[e]}function wr(t,e){var r=Cd(t,e);return jd(r)?r:void 0}var go=Object.create,Od=function(){function t(){}return function(e){if(!gt(e))return{};if(go)return go(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const wd=Od;function Ed(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 $d(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Nd=800,Td=16,Md=Date.now;function Ad(t){var e=0,r=0;return function(){var n=Md(),o=Td-(n-r);if(r=n,o>0){if(++e>=Nd)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Pd(t){return function(){return t}}var xd=function(){try{var t=wr(Object,"defineProperty");return t({},"",{}),t}catch{}}();const be=xd;var Id=be?function(t,e){return be(t,"toString",{configurable:!0,enumerable:!1,value:Pd(e),writable:!0})}:mo,Dd=Ad(Id);const Rd=Dd;var Ld=9007199254740991,Bd=/^(?:0|[1-9]\d*)$/;function yo(t,e){var r=typeof t;return e=e??Ld,!!e&&(r=="number"||r!="symbol"&&Bd.test(t))&&t>-1&&t%1==0&&t<e}function Er(t,e,r){e=="__proto__"&&be?be(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function _e(t,e){return t===e||t!==t&&e!==e}var Fd=Object.prototype,Ud=Fd.hasOwnProperty;function kd(t,e,r){var n=t[e];(!(Ud.call(t,e)&&_e(n,r))||r===void 0&&!(e in t))&&Er(t,e,r)}function Vd(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=n?n(r[i],t[i],i,r,t):void 0;c===void 0&&(c=t[i]),o?Er(r,i,c):kd(r,i,c)}return r}var bo=Math.max;function Gd(t,e,r){return e=bo(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=bo(n.length-e,0),s=Array(a);++o<a;)s[o]=n[e+o];o=-1;for(var i=Array(e+1);++o<e;)i[o]=n[o];return i[e]=r(s),Ed(t,this,i)}}function zd(t,e){return Rd(Gd(t,e,mo),t+"")}var Hd=9007199254740991;function _o(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Hd}function $r(t){return t!=null&&_o(t.length)&&!Cr(t)}function Jd(t,e,r){if(!gt(r))return!1;var n=typeof e;return(n=="number"?$r(r)&&yo(e,r.length):n=="string"&&e in r)?_e(r[e],t):!1}function Wd(t){return zd(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,s&&Jd(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var i=r[n];i&&t(e,i,n,a)}return e})}var Qd=Object.prototype;function So(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Qd;return t===r}function qd(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Yd="[object Arguments]";function jo(t){return xt(t)&&te(t)==Yd}var Co=Object.prototype,Kd=Co.hasOwnProperty,Xd=Co.propertyIsEnumerable,Zd=jo(function(){return arguments}())?jo:function(t){return xt(t)&&Kd.call(t,"callee")&&!Xd.call(t,"callee")};const Nr=Zd;function tp(){return!1}var Oo=typeof g=="object"&&g&&!g.nodeType&&g,wo=Oo&&typeof module=="object"&&module&&!module.nodeType&&module,ep=wo&&wo.exports===Oo,Eo=ep?At.Buffer:void 0,rp=Eo?Eo.isBuffer:void 0,np=rp||tp;const $o=np;var op="[object Arguments]",ap="[object Array]",ip="[object Boolean]",sp="[object Date]",cp="[object Error]",up="[object Function]",lp="[object Map]",fp="[object Number]",dp="[object Object]",pp="[object RegExp]",hp="[object Set]",mp="[object String]",vp="[object WeakMap]",gp="[object ArrayBuffer]",yp="[object DataView]",bp="[object Float32Array]",_p="[object Float64Array]",Sp="[object Int8Array]",jp="[object Int16Array]",Cp="[object Int32Array]",Op="[object Uint8Array]",wp="[object Uint8ClampedArray]",Ep="[object Uint16Array]",$p="[object Uint32Array]",T={};T[bp]=T[_p]=T[Sp]=T[jp]=T[Cp]=T[Op]=T[wp]=T[Ep]=T[$p]=!0,T[op]=T[ap]=T[gp]=T[ip]=T[yp]=T[sp]=T[cp]=T[up]=T[lp]=T[fp]=T[dp]=T[pp]=T[hp]=T[mp]=T[vp]=!1;function Np(t){return xt(t)&&_o(t.length)&&!!T[te(t)]}function Tp(t){return function(e){return t(e)}}var No=typeof g=="object"&&g&&!g.nodeType&&g,ee=No&&typeof module=="object"&&module&&!module.nodeType&&module,Mp=ee&&ee.exports===No,Tr=Mp&&co.process,Ap=function(){try{var t=ee&&ee.require&&ee.require("util").types;return t||Tr&&Tr.binding&&Tr.binding("util")}catch{}}();const To=Ap;var Mo=To&&To.isTypedArray,Pp=Mo?Tp(Mo):Np;const Ao=Pp;var xp=Object.prototype,Ip=xp.hasOwnProperty;function Dp(t,e){var r=It(t),n=!r&&Nr(t),o=!r&&!n&&$o(t),a=!r&&!n&&!o&&Ao(t),s=r||n||o||a,i=s?qd(t.length,String):[],c=i.length;for(var u in t)(e||Ip.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||yo(u,c)))&&i.push(u);return i}function Rp(t,e){return function(r){return t(e(r))}}function Lp(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Bp=Object.prototype,Fp=Bp.hasOwnProperty;function Up(t){if(!gt(t))return Lp(t);var e=So(t),r=[];for(var n in t)n=="constructor"&&(e||!Fp.call(t,n))||r.push(n);return r}function Po(t){return $r(t)?Dp(t,!0):Up(t)}var kp=wr(Object,"create");const re=kp;function Vp(){this.__data__=re?re(null):{},this.size=0}function Gp(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var zp="__lodash_hash_undefined__",Hp=Object.prototype,Jp=Hp.hasOwnProperty;function Wp(t){var e=this.__data__;if(re){var r=e[t];return r===zp?void 0:r}return Jp.call(e,t)?e[t]:void 0}var Qp=Object.prototype,qp=Qp.hasOwnProperty;function Yp(t){var e=this.__data__;return re?e[t]!==void 0:qp.call(e,t)}var Kp="__lodash_hash_undefined__";function Xp(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=re&&e===void 0?Kp:e,this}function yt(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])}}yt.prototype.clear=Vp,yt.prototype.delete=Gp,yt.prototype.get=Wp,yt.prototype.has=Yp,yt.prototype.set=Xp;function Zp(){this.__data__=[],this.size=0}function Se(t,e){for(var r=t.length;r--;)if(_e(t[r][0],e))return r;return-1}var th=Array.prototype,eh=th.splice;function rh(t){var e=this.__data__,r=Se(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():eh.call(e,r,1),--this.size,!0}function nh(t){var e=this.__data__,r=Se(e,t);return r<0?void 0:e[r][1]}function oh(t){return Se(this.__data__,t)>-1}function ah(t,e){var r=this.__data__,n=Se(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function nt(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])}}nt.prototype.clear=Zp,nt.prototype.delete=rh,nt.prototype.get=nh,nt.prototype.has=oh,nt.prototype.set=ah;var ih=wr(At,"Map");const xo=ih;function sh(){this.size=0,this.__data__={hash:new yt,map:new(xo||nt),string:new yt}}function ch(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function je(t,e){var r=t.__data__;return ch(e)?r[typeof e=="string"?"string":"hash"]:r.map}function uh(t){var e=je(this,t).delete(t);return this.size-=e?1:0,e}function lh(t){return je(this,t).get(t)}function fh(t){return je(this,t).has(t)}function dh(t,e){var r=je(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=sh,Dt.prototype.delete=uh,Dt.prototype.get=lh,Dt.prototype.has=fh,Dt.prototype.set=dh;function Io(t){return t==null?"":ho(t)}var ph=Rp(Object.getPrototypeOf,Object);const Do=ph;var hh="[object Object]",mh=Function.prototype,vh=Object.prototype,Ro=mh.toString,gh=vh.hasOwnProperty,yh=Ro.call(Object);function Rt(t){if(!xt(t)||te(t)!=hh)return!1;var e=Do(t);if(e===null)return!0;var r=gh.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Ro.call(r)==yh}function bh(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 _h(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:bh(t,e,r)}var Sh="\\ud800-\\udfff",jh="\\u0300-\\u036f",Ch="\\ufe20-\\ufe2f",Oh="\\u20d0-\\u20ff",wh=jh+Ch+Oh,Eh="\\ufe0e\\ufe0f",$h="\\u200d",Nh=RegExp("["+$h+Sh+wh+Eh+"]");function Lo(t){return Nh.test(t)}function Th(t){return t.split("")}var Bo="\\ud800-\\udfff",Mh="\\u0300-\\u036f",Ah="\\ufe20-\\ufe2f",Ph="\\u20d0-\\u20ff",xh=Mh+Ah+Ph,Ih="\\ufe0e\\ufe0f",Dh="["+Bo+"]",Mr="["+xh+"]",Ar="\\ud83c[\\udffb-\\udfff]",Rh="(?:"+Mr+"|"+Ar+")",Fo="[^"+Bo+"]",Uo="(?:\\ud83c[\\udde6-\\uddff]){2}",ko="[\\ud800-\\udbff][\\udc00-\\udfff]",Lh="\\u200d",Vo=Rh+"?",Go="["+Ih+"]?",Bh="(?:"+Lh+"(?:"+[Fo,Uo,ko].join("|")+")"+Go+Vo+")*",Fh=Go+Vo+Bh,Uh="(?:"+[Fo+Mr+"?",Mr,Uo,ko,Dh].join("|")+")",kh=RegExp(Ar+"(?="+Ar+")|"+Uh+Fh,"g");function Vh(t){return t.match(kh)||[]}function Gh(t){return Lo(t)?Vh(t):Th(t)}function zh(t){return function(e){e=Io(e);var r=Lo(e)?Gh(e):void 0,n=r?r[0]:e.charAt(0),o=r?_h(r,1).join(""):e.slice(1);return n[t]()+o}}var Hh=zh("toUpperCase");const Jh=Hh;function Wh(t){return Jh(Io(t).toLowerCase())}function Qh(){this.__data__=new nt,this.size=0}function qh(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Yh(t){return this.__data__.get(t)}function Kh(t){return this.__data__.has(t)}var Xh=200;function Zh(t,e){var r=this.__data__;if(r instanceof nt){var n=r.__data__;if(!xo||n.length<Xh-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 Lt(t){var e=this.__data__=new nt(t);this.size=e.size}Lt.prototype.clear=Qh,Lt.prototype.delete=qh,Lt.prototype.get=Yh,Lt.prototype.has=Kh,Lt.prototype.set=Zh;var zo=typeof g=="object"&&g&&!g.nodeType&&g,Ho=zo&&typeof module=="object"&&module&&!module.nodeType&&module,tm=Ho&&Ho.exports===zo,Jo=tm?At.Buffer:void 0,Wo=Jo?Jo.allocUnsafe:void 0;function em(t,e){if(e)return t.slice();var r=t.length,n=Wo?Wo(r):new t.constructor(r);return t.copy(n),n}var rm=At.Uint8Array;const Qo=rm;function nm(t){var e=new t.constructor(t.byteLength);return new Qo(e).set(new Qo(t)),e}function om(t,e){var r=e?nm(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function am(t){return typeof t.constructor=="function"&&!So(t)?wd(Do(t)):{}}function im(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[t?i:++o];if(r(a[c],c,a)===!1)break}return e}}var sm=im();const cm=sm;function Pr(t,e,r){(r!==void 0&&!_e(t[e],r)||r===void 0&&!(e in t))&&Er(t,e,r)}function um(t){return xt(t)&&$r(t)}function xr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function lm(t){return Vd(t,Po(t))}function fm(t,e,r,n,o,a,s){var i=xr(t,r),c=xr(e,r),u=s.get(c);if(u){Pr(t,r,u);return}var l=a?a(i,c,r+"",t,e,s):void 0,d=l===void 0;if(d){var f=It(c),p=!f&&$o(c),h=!f&&!p&&Ao(c);l=c,f||p||h?It(i)?l=i:um(i)?l=$d(i):p?(d=!1,l=em(c,!0)):h?(d=!1,l=om(c,!0)):l=[]:Rt(c)||Nr(c)?(l=i,Nr(i)?l=lm(i):(!gt(i)||Cr(i))&&(l=am(c))):d=!1}d&&(s.set(c,l),o(l,c,n,a,s),s.delete(c)),Pr(t,r,l)}function qo(t,e,r,n,o){t!==e&&cm(e,function(a,s){if(o||(o=new Lt),gt(a))fm(t,e,s,r,qo,n,o);else{var i=n?n(xr(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),Pr(t,s,i)}},Po)}var dm=Wd(function(t,e,r){qo(t,e,r)});const pm=dm,hm=function(t){return!(!t||typeof t!="function"||!t.prototype)};function Yo(t){const e=t==null?void 0:t.prototype;return!!(e&&e.isReactComponent)}function Ko(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 Xo(t){class e extends S.Component{render(){return S.createElement(t,this.props)}}return e.displayName=t.displayName,e}const bt=(t,e)=>{const r=n=>{const a=`
|
|
6
|
+
`)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var Tt=(t=>(t.ROOT_CONTAINER="RootContainer",t))(Tt||{});const Mf=w({type:F(G.FUNCTION),value:v()}),Af=sr(Zn(Nt,["componentName"]),w({componentName:F("RootContainer")}));function Pf(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 Kt=Pf(),xf=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new vt([]);return e&&(o=e.materialsMode||new vt([])),n&&(D(n)?r.value=n.map(a=>new A(a,{parent:e,materials:o})):B(n)&&r.value.push(new A(n,{parent:e,materials:o}))),r};class Mt{constructor(e,r){j(this,"nodeType","SLOT"),j(this,"rawData"),j(this,"parent"),j(this,"emitter",Kt),j(this,"data"),j(this,"id"),j(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new vt([]);this.materialsMode=n,this.id=Z(),this.data=xf(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof A)return o.export(e);if(B(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return D(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const oo=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===hr.SINGLE?e.push(n.content):n.type===hr.GROUP&&(e=[...e,...oo(n.content)]):e.push(r)}),e},vr=(t,e,r)=>{if(t.type)return t.type===G.SLOT?new Mt(t,{parent:e,materials:r}):t;if(B(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=gr(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>vr(n,e,r)):t},gr=(t,e,r)=>B(t)?vr(t,e,r):D(t)?t.map(n=>vr(n,e,r)):t;class it{constructor(e,r,n){j(this,"nodeType","PROP"),j(this,"rawData"),j(this,"parent"),j(this,"emitter",Kt),j(this,"data"),j(this,"name"),j(this,"materialsMode");const o=(n==null?void 0:n.materials)||new vt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=gr(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=gr(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof Mt)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof A){const r=e.material;return oo((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 it||o instanceof Mt||o instanceof A)return o.export(e);if(D(o))return o.map(a=>n(a));if(B(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return o};return n(r)}}const If=t=>{if(typeof t=="string")return!0;mr({data:t,dataStruct:Nt,throwError:!1})},ao=(t,e,r=new vt([]))=>{if(typeof t=="string")return t;const n={...t,id:t.id??Z(),children:[],props:{},methods:t.methods||[],configure:Qn(t.configure||{},{propsSetter:{},advanceSetter:{}})},o=Object.keys(t.props||{});return o.length&&o.forEach(a=>{var s;const i=(s=t.props)==null?void 0:s[a];if(i instanceof it){n.props[a]=i;return}n.props[a]=new it(a,i||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof A)return a;if(B(a)){const s=a;return new A(s,{parent:e,materials:r})}else return a}):(t.children instanceof A&&(n.children=[t.children]),n.children=[new A(t.children,{parent:e,materials:r})])),n};class A{constructor(e,r){j(this,"nodeType","NODE"),j(this,"rawData"),j(this,"data"),j(this,"emitter",Kt),j(this,"parent"),j(this,"materialsModel"),j(this,"listenerHandle"),j(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),If(e);const n=(r==null?void 0:r.materials)||new vt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=ao(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 A(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=ao(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 _r(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 A?l.export(e):l),s=n.configure||{},i=s.propsSetter||{},c={};Object.keys(i).forEach(l=>{const d=fn(i,l,!1);d&&(c[l]=d)}),s.propsSetter=c,this.material&&this.materialsModel.usedMaterials.push(this.material);let u={...n,configure:s,props:o,children:a,condition:n.condition};return e==="design"&&delete u.id,u=br(u),u}}const io=(t,e,r)=>{const n={...t,id:Z(),props:{},componentName:Tt.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:Qn(t.configure||{},{propsSetter:{},advanceSetter:{}})};let o=[];D(t.children)?o=t.children.map(s=>s instanceof A?s:B(s)?new A(s,{parent:e,materials:r}):s):t.children instanceof A?o.push(t.children):t.children&&B(t.children)&&o.push(new A(t.children,{parent:e,materials:r}));const a=Object.keys(t.props||{});return a.length&&a.forEach(s=>{var i;const c=(i=t.props)==null?void 0:i[s];c instanceof it?n.props[s]=c:n.props[s]=new it(s,c||"",{parent:e,materials:r})}),n.children=o,n};class Xt{constructor(e,{parent:r,materials:n}){j(this,"rawData"),j(this,"data"),j(this,"nodeType",Tt.ROOT_CONTAINER),j(this,"emitter",Kt),j(this,"materialsModel"),j(this,"listenerHandle"),j(this,"onChangeCbQueue"),j(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=io(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=io(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 _r(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=lr.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)}))||[],s={...n,props:o,children:a.filter(c=>c),condition:n.condition};let i=qn(s,["id"]);return i=br(i),i}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 Xt(r,{materials:this.materialsModel,parent:null})}}const mt=t=>(t==null?void 0:t.type)===G.EXPRESSION,Df=t=>(t==null?void 0:t.type)===G.FUNCTION,Z=()=>Math.random().toString(32).slice(3,9),Rf=t=>(t==null?void 0:t.nodeType)==="NODE",yr=t=>(t==null?void 0:t.nodeType)==="PROP",Lf=t=>(t==null?void 0:t.nodeType)==="SLOT",br=t=>nf(t,e=>B(e)?!Object.keys(e).length:D(e)?!e.length:!e);function Bf(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=i=>{if(i instanceof A){r.push(i);return}if(i instanceof Mt&&a(i.value.value),i instanceof it){a(i.value);return}if(B(i)){const c=i;Object.keys(c).forEach(u=>{a(c[u])});return}if(D(i)){i.forEach(c=>{a(c)});return}};a(o);const s=(n==null?void 0:n.value.children.filter(i=>i instanceof A))||[];r.push(...s)}}function _r(t,e){return Bf(t,r=>r.id===e)}const Ff=t=>{const e=Ln(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 Uf{constructor(e){j(this,"rawData"),j(this,"data"),this.rawData=e,this.data=Ff(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 Sr=t=>{if(!D(t))throw new Error("Materials must be a array");return t.map(e=>new Uf(e))},kf=t=>{t==null||t.forEach(e=>{mr({data:e,dataStruct:Nf,throwError:!1})})};class vt{constructor(e){j(this,"rawData"),j(this,"data"),j(this,"usedMaterials",[]),this.rawData=e,kf(e),this.data=Sr(e)}addMaterials(e){const r=Sr(e),n=[],o=this.data.map(s=>{const i=r.findIndex(c=>c.componentName===s.componentName);return i>=0?(n.push(i),r[i]):s}),a=r.filter((s,i)=>!n.includes(i));this.data=[...o,...a]}replaceMaterials(e){const r=Sr(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,s)=>(a.push(...s.snippets),a),[]),r=[],n={default:[]};e.forEach(a=>{const s=a.groupName||"default";r.includes(s)||(r.push(s),n[s]=[]),n[s].push(a)});let o=[];return r.forEach(a=>{const s=["default"],i={default:[]},c=n[a];if(c.length!==0){c.forEach(d=>{const f=d.category||"default";s.includes(f)||(s.push(f),i[f]=[]),i[f].push(d)});const u=[];s.forEach(d=>{i[d].length&&u.push({name:d,list:i[d]})});const l={name:a,list:u};o.push(l)}}),o=o.sort((a,s)=>(a.name||"")>(s.name||"")?1:-1),o}get value(){return this.data}get rawValue(){return this.rawData}}const Vf=w({version:v(),name:v(),css:m(v()),renderType:m(U([F("COMPONENT"),F("PAGE")])),loadType:m(M()),lifecycle:m(M()),props:m(M()),methods:m(I(Mf)),componentsMeta:I(sr(w({componentName:v()}),ur)),thirdLibs:m(_f),componentsTree:Af,assets:m(I(M()))}),so=t=>(mr({data:t,dataStruct:Vf,throwError:!1}),t),jr=(t,e,r)=>({...t,componentsTree:new Xt(t.componentsTree,{parent:e,materials:r})});class ye{constructor(e,r){j(this,"nodeType","PAGE"),j(this,"rawData"),j(this,"emitter",Kt),j(this,"data"),j(this,"parent"),j(this,"materialsModel"),j(this,"assetPackagesList"),so(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new vt((r==null?void 0:r.materials)||[]),this.data=jr(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=jr(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=jr(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 _r(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof Xt)return console.warn("Not found parent node"),!1;if(a instanceof it)return console.warn("CProp can not add node"),!1;if(a instanceof Mt){const i=a.value.value,c=i.findIndex(u=>u===r)??-1;return c>=0?(n==="BEFORE"?i.splice(c,0,e):i.splice(c+1,0,e),e.parent=a,(o=a.parent)==null||o.updateValue(),!0):!1}if(a instanceof ye)return!1;const s=(a==null?void 0:a.value.children.findIndex(i=>i===r))??-1;return s>=0?(n==="BEFORE"?a==null||a.value.children.splice(s,0,e):a==null||a.value.children.splice(s+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(B(n)){const a=n;if(a.type==="CHILD"){const s=a.pos,i=a.index||0;return s==="BEFORE"?r==null||r.value.children.splice(i,0,e):r==null||r.value.children.splice(i+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 A(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 A(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 A?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 A&&a instanceof A?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 Mt){const o=n.value.value,a=o.findIndex(i=>i===e),s=o[a];return o.splice(a,1),(r=n.parent)==null||r.updateValue(),s}if(n instanceof A||n instanceof Xt){const o=n.value.children,a=o.findIndex(i=>i===e),s=o[a];return o.splice(a,1),n.updateValue(),s}}deleteNodeById(e){const r=this.getNode(e);if(r)return this.deleteNode(r)}export(e=lr.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],s=this.materialsModel.usedMaterials.map(c=>{const u=o.find(l=>{var d;return l.package===((d=c.value.npm)==null?void 0:d.package)});return u&&a.push(u),{componentName:c.componentName,...Ln(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 i={...this.data,componentsTree:br(n),componentsMeta:s,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)}),i.assets=ff(a,c=>c.package),i=qn(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}Tt.ROOT_CONTAINER;var Gf=typeof global=="object"&&global&&global.Object===Object&&global;const co=Gf;var zf=typeof self=="object"&&self&&self.Object===Object&&self,Hf=co||zf||Function("return this")();const At=Hf;var Jf=At.Symbol;const Pt=Jf;var uo=Object.prototype,Wf=uo.hasOwnProperty,Qf=uo.toString,Zt=Pt?Pt.toStringTag:void 0;function qf(t){var e=Wf.call(t,Zt),r=t[Zt];try{t[Zt]=void 0;var n=!0}catch{}var o=Qf.call(t);return n&&(e?t[Zt]=r:delete t[Zt]),o}var Yf=Object.prototype,Kf=Yf.toString;function Xf(t){return Kf.call(t)}var Zf="[object Null]",td="[object Undefined]",lo=Pt?Pt.toStringTag:void 0;function te(t){return t==null?t===void 0?td:Zf:lo&&lo in Object(t)?qf(t):Xf(t)}function xt(t){return t!=null&&typeof t=="object"}var ed="[object Symbol]";function rd(t){return typeof t=="symbol"||xt(t)&&te(t)==ed}function nd(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 od=Array.isArray;const It=od;var ad=1/0,fo=Pt?Pt.prototype:void 0,po=fo?fo.toString:void 0;function ho(t){if(typeof t=="string")return t;if(It(t))return nd(t,ho)+"";if(rd(t))return po?po.call(t):"";var e=t+"";return e=="0"&&1/t==-ad?"-0":e}function gt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function mo(t){return t}var id="[object AsyncFunction]",sd="[object Function]",cd="[object GeneratorFunction]",ud="[object Proxy]";function Cr(t){if(!gt(t))return!1;var e=te(t);return e==sd||e==cd||e==id||e==ud}var ld=At["__core-js_shared__"];const Or=ld;var vo=function(){var t=/[^.]+$/.exec(Or&&Or.keys&&Or.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function fd(t){return!!vo&&vo in t}var dd=Function.prototype,pd=dd.toString;function hd(t){if(t!=null){try{return pd.call(t)}catch{}try{return t+""}catch{}}return""}var md=/[\\^$.*+?()[\]{}|]/g,vd=/^\[object .+?Constructor\]$/,gd=Function.prototype,yd=Object.prototype,bd=gd.toString,_d=yd.hasOwnProperty,Sd=RegExp("^"+bd.call(_d).replace(md,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function jd(t){if(!gt(t)||fd(t))return!1;var e=Cr(t)?Sd:vd;return e.test(hd(t))}function Cd(t,e){return t==null?void 0:t[e]}function wr(t,e){var r=Cd(t,e);return jd(r)?r:void 0}var go=Object.create,Od=function(){function t(){}return function(e){if(!gt(e))return{};if(go)return go(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const wd=Od;function Ed(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 $d(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Nd=800,Td=16,Md=Date.now;function Ad(t){var e=0,r=0;return function(){var n=Md(),o=Td-(n-r);if(r=n,o>0){if(++e>=Nd)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Pd(t){return function(){return t}}var xd=function(){try{var t=wr(Object,"defineProperty");return t({},"",{}),t}catch{}}();const be=xd;var Id=be?function(t,e){return be(t,"toString",{configurable:!0,enumerable:!1,value:Pd(e),writable:!0})}:mo,Dd=Ad(Id);const Rd=Dd;var Ld=9007199254740991,Bd=/^(?:0|[1-9]\d*)$/;function yo(t,e){var r=typeof t;return e=e??Ld,!!e&&(r=="number"||r!="symbol"&&Bd.test(t))&&t>-1&&t%1==0&&t<e}function Er(t,e,r){e=="__proto__"&&be?be(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function _e(t,e){return t===e||t!==t&&e!==e}var Fd=Object.prototype,Ud=Fd.hasOwnProperty;function kd(t,e,r){var n=t[e];(!(Ud.call(t,e)&&_e(n,r))||r===void 0&&!(e in t))&&Er(t,e,r)}function Vd(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=n?n(r[i],t[i],i,r,t):void 0;c===void 0&&(c=t[i]),o?Er(r,i,c):kd(r,i,c)}return r}var bo=Math.max;function Gd(t,e,r){return e=bo(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=bo(n.length-e,0),s=Array(a);++o<a;)s[o]=n[e+o];o=-1;for(var i=Array(e+1);++o<e;)i[o]=n[o];return i[e]=r(s),Ed(t,this,i)}}function zd(t,e){return Rd(Gd(t,e,mo),t+"")}var Hd=9007199254740991;function _o(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Hd}function $r(t){return t!=null&&_o(t.length)&&!Cr(t)}function Jd(t,e,r){if(!gt(r))return!1;var n=typeof e;return(n=="number"?$r(r)&&yo(e,r.length):n=="string"&&e in r)?_e(r[e],t):!1}function Wd(t){return zd(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,s&&Jd(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var i=r[n];i&&t(e,i,n,a)}return e})}var Qd=Object.prototype;function So(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Qd;return t===r}function qd(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Yd="[object Arguments]";function jo(t){return xt(t)&&te(t)==Yd}var Co=Object.prototype,Kd=Co.hasOwnProperty,Xd=Co.propertyIsEnumerable,Zd=jo(function(){return arguments}())?jo:function(t){return xt(t)&&Kd.call(t,"callee")&&!Xd.call(t,"callee")};const Nr=Zd;function tp(){return!1}var Oo=typeof g=="object"&&g&&!g.nodeType&&g,wo=Oo&&typeof module=="object"&&module&&!module.nodeType&&module,ep=wo&&wo.exports===Oo,Eo=ep?At.Buffer:void 0,rp=Eo?Eo.isBuffer:void 0,np=rp||tp;const $o=np;var op="[object Arguments]",ap="[object Array]",ip="[object Boolean]",sp="[object Date]",cp="[object Error]",up="[object Function]",lp="[object Map]",fp="[object Number]",dp="[object Object]",pp="[object RegExp]",hp="[object Set]",mp="[object String]",vp="[object WeakMap]",gp="[object ArrayBuffer]",yp="[object DataView]",bp="[object Float32Array]",_p="[object Float64Array]",Sp="[object Int8Array]",jp="[object Int16Array]",Cp="[object Int32Array]",Op="[object Uint8Array]",wp="[object Uint8ClampedArray]",Ep="[object Uint16Array]",$p="[object Uint32Array]",T={};T[bp]=T[_p]=T[Sp]=T[jp]=T[Cp]=T[Op]=T[wp]=T[Ep]=T[$p]=!0,T[op]=T[ap]=T[gp]=T[ip]=T[yp]=T[sp]=T[cp]=T[up]=T[lp]=T[fp]=T[dp]=T[pp]=T[hp]=T[mp]=T[vp]=!1;function Np(t){return xt(t)&&_o(t.length)&&!!T[te(t)]}function Tp(t){return function(e){return t(e)}}var No=typeof g=="object"&&g&&!g.nodeType&&g,ee=No&&typeof module=="object"&&module&&!module.nodeType&&module,Mp=ee&&ee.exports===No,Tr=Mp&&co.process,Ap=function(){try{var t=ee&&ee.require&&ee.require("util").types;return t||Tr&&Tr.binding&&Tr.binding("util")}catch{}}();const To=Ap;var Mo=To&&To.isTypedArray,Pp=Mo?Tp(Mo):Np;const Ao=Pp;var xp=Object.prototype,Ip=xp.hasOwnProperty;function Dp(t,e){var r=It(t),n=!r&&Nr(t),o=!r&&!n&&$o(t),a=!r&&!n&&!o&&Ao(t),s=r||n||o||a,i=s?qd(t.length,String):[],c=i.length;for(var u in t)(e||Ip.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||yo(u,c)))&&i.push(u);return i}function Rp(t,e){return function(r){return t(e(r))}}function Lp(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Bp=Object.prototype,Fp=Bp.hasOwnProperty;function Up(t){if(!gt(t))return Lp(t);var e=So(t),r=[];for(var n in t)n=="constructor"&&(e||!Fp.call(t,n))||r.push(n);return r}function Po(t){return $r(t)?Dp(t,!0):Up(t)}var kp=wr(Object,"create");const re=kp;function Vp(){this.__data__=re?re(null):{},this.size=0}function Gp(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var zp="__lodash_hash_undefined__",Hp=Object.prototype,Jp=Hp.hasOwnProperty;function Wp(t){var e=this.__data__;if(re){var r=e[t];return r===zp?void 0:r}return Jp.call(e,t)?e[t]:void 0}var Qp=Object.prototype,qp=Qp.hasOwnProperty;function Yp(t){var e=this.__data__;return re?e[t]!==void 0:qp.call(e,t)}var Kp="__lodash_hash_undefined__";function Xp(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=re&&e===void 0?Kp:e,this}function yt(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])}}yt.prototype.clear=Vp,yt.prototype.delete=Gp,yt.prototype.get=Wp,yt.prototype.has=Yp,yt.prototype.set=Xp;function Zp(){this.__data__=[],this.size=0}function Se(t,e){for(var r=t.length;r--;)if(_e(t[r][0],e))return r;return-1}var th=Array.prototype,eh=th.splice;function rh(t){var e=this.__data__,r=Se(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():eh.call(e,r,1),--this.size,!0}function nh(t){var e=this.__data__,r=Se(e,t);return r<0?void 0:e[r][1]}function oh(t){return Se(this.__data__,t)>-1}function ah(t,e){var r=this.__data__,n=Se(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function nt(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])}}nt.prototype.clear=Zp,nt.prototype.delete=rh,nt.prototype.get=nh,nt.prototype.has=oh,nt.prototype.set=ah;var ih=wr(At,"Map");const xo=ih;function sh(){this.size=0,this.__data__={hash:new yt,map:new(xo||nt),string:new yt}}function ch(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function je(t,e){var r=t.__data__;return ch(e)?r[typeof e=="string"?"string":"hash"]:r.map}function uh(t){var e=je(this,t).delete(t);return this.size-=e?1:0,e}function lh(t){return je(this,t).get(t)}function fh(t){return je(this,t).has(t)}function dh(t,e){var r=je(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=sh,Dt.prototype.delete=uh,Dt.prototype.get=lh,Dt.prototype.has=fh,Dt.prototype.set=dh;function Io(t){return t==null?"":ho(t)}var ph=Rp(Object.getPrototypeOf,Object);const Do=ph;var hh="[object Object]",mh=Function.prototype,vh=Object.prototype,Ro=mh.toString,gh=vh.hasOwnProperty,yh=Ro.call(Object);function Rt(t){if(!xt(t)||te(t)!=hh)return!1;var e=Do(t);if(e===null)return!0;var r=gh.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Ro.call(r)==yh}function bh(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 _h(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:bh(t,e,r)}var Sh="\\ud800-\\udfff",jh="\\u0300-\\u036f",Ch="\\ufe20-\\ufe2f",Oh="\\u20d0-\\u20ff",wh=jh+Ch+Oh,Eh="\\ufe0e\\ufe0f",$h="\\u200d",Nh=RegExp("["+$h+Sh+wh+Eh+"]");function Lo(t){return Nh.test(t)}function Th(t){return t.split("")}var Bo="\\ud800-\\udfff",Mh="\\u0300-\\u036f",Ah="\\ufe20-\\ufe2f",Ph="\\u20d0-\\u20ff",xh=Mh+Ah+Ph,Ih="\\ufe0e\\ufe0f",Dh="["+Bo+"]",Mr="["+xh+"]",Ar="\\ud83c[\\udffb-\\udfff]",Rh="(?:"+Mr+"|"+Ar+")",Fo="[^"+Bo+"]",Uo="(?:\\ud83c[\\udde6-\\uddff]){2}",ko="[\\ud800-\\udbff][\\udc00-\\udfff]",Lh="\\u200d",Vo=Rh+"?",Go="["+Ih+"]?",Bh="(?:"+Lh+"(?:"+[Fo,Uo,ko].join("|")+")"+Go+Vo+")*",Fh=Go+Vo+Bh,Uh="(?:"+[Fo+Mr+"?",Mr,Uo,ko,Dh].join("|")+")",kh=RegExp(Ar+"(?="+Ar+")|"+Uh+Fh,"g");function Vh(t){return t.match(kh)||[]}function Gh(t){return Lo(t)?Vh(t):Th(t)}function zh(t){return function(e){e=Io(e);var r=Lo(e)?Gh(e):void 0,n=r?r[0]:e.charAt(0),o=r?_h(r,1).join(""):e.slice(1);return n[t]()+o}}var Hh=zh("toUpperCase");const Jh=Hh;function Wh(t){return Jh(Io(t).toLowerCase())}function Qh(){this.__data__=new nt,this.size=0}function qh(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Yh(t){return this.__data__.get(t)}function Kh(t){return this.__data__.has(t)}var Xh=200;function Zh(t,e){var r=this.__data__;if(r instanceof nt){var n=r.__data__;if(!xo||n.length<Xh-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 Lt(t){var e=this.__data__=new nt(t);this.size=e.size}Lt.prototype.clear=Qh,Lt.prototype.delete=qh,Lt.prototype.get=Yh,Lt.prototype.has=Kh,Lt.prototype.set=Zh;var zo=typeof g=="object"&&g&&!g.nodeType&&g,Ho=zo&&typeof module=="object"&&module&&!module.nodeType&&module,tm=Ho&&Ho.exports===zo,Jo=tm?At.Buffer:void 0,Wo=Jo?Jo.allocUnsafe:void 0;function em(t,e){if(e)return t.slice();var r=t.length,n=Wo?Wo(r):new t.constructor(r);return t.copy(n),n}var rm=At.Uint8Array;const Qo=rm;function nm(t){var e=new t.constructor(t.byteLength);return new Qo(e).set(new Qo(t)),e}function om(t,e){var r=e?nm(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function am(t){return typeof t.constructor=="function"&&!So(t)?wd(Do(t)):{}}function im(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[t?i:++o];if(r(a[c],c,a)===!1)break}return e}}var sm=im();const cm=sm;function Pr(t,e,r){(r!==void 0&&!_e(t[e],r)||r===void 0&&!(e in t))&&Er(t,e,r)}function um(t){return xt(t)&&$r(t)}function xr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function lm(t){return Vd(t,Po(t))}function fm(t,e,r,n,o,a,s){var i=xr(t,r),c=xr(e,r),u=s.get(c);if(u){Pr(t,r,u);return}var l=a?a(i,c,r+"",t,e,s):void 0,d=l===void 0;if(d){var f=It(c),p=!f&&$o(c),h=!f&&!p&&Ao(c);l=c,f||p||h?It(i)?l=i:um(i)?l=$d(i):p?(d=!1,l=em(c,!0)):h?(d=!1,l=om(c,!0)):l=[]:Rt(c)||Nr(c)?(l=i,Nr(i)?l=lm(i):(!gt(i)||Cr(i))&&(l=am(c))):d=!1}d&&(s.set(c,l),o(l,c,n,a,s),s.delete(c)),Pr(t,r,l)}function qo(t,e,r,n,o){t!==e&&cm(e,function(a,s){if(o||(o=new Lt),gt(a))fm(t,e,s,r,qo,n,o);else{var i=n?n(xr(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),Pr(t,s,i)}},Po)}var dm=Wd(function(t,e,r){qo(t,e,r)});const pm=dm,hm=function(t){return!(!t||typeof t!="function"||!t.prototype)};function Yo(t){const e=t==null?void 0:t.prototype;return!!(e&&e.isReactComponent)}function Ko(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 Xo(t){class e extends S.Component{render(){return S.createElement(t,this.props)}}return e.displayName=t.displayName,e}const bt=(t,e)=>{const r=n=>{const a=`
|
|
7
7
|
${Object.keys(e).map(s=>`const ${s} = $$context['${s}'];`).join(`
|
|
8
8
|
`)}
|
|
9
9
|
return ${n};
|