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