@chamn/render 0.0.22 → 0.0.23
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/commonComponent/index.d.ts +1 -1
- package/dist/index.js +32 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2688 -2059
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +31 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +6 -6
package/dist/index.umd.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(function(g,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],S):(g=typeof globalThis<"u"?globalThis:g||self,S(g.CRender={},g.React,g.ReactDOM))})(this,function(g,S,ct){"use strict";var xm=Object.defineProperty;var Rm=(g,S,ct)=>S in g?xm(g,S,{enumerable:!0,configurable:!0,writable:!0,value:ct}):g[S]=ct;var b=(g,S,ct)=>(Rm(g,typeof S!="symbol"?S+"":S,ct),ct);function fa(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const da=fa(ct),pa=t=>()=>{console.warn(`${t} need to be implement getComponent`)},ha=["customPageRootRender"],Fr=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","getDataLink","createDataLink","transformProps","transformData","transformGlobalData","errorCatch","clear"],Br=t=>[...Fr,...ha].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):Fr.includes(n)&&(r[n]=pa),r},{});var ma=Object.defineProperty,va=(t,e,r)=>e in t?ma(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e,r)=>(va(t,typeof e!="symbol"?e+"":e,r),r),ga=typeof global=="object"&&global&&global.Object===Object&&global;const Ur=ga;var ya=typeof self=="object"&&self&&self.Object===Object&&self,ba=Ur||ya||Function("return this")();const q=ba;var _a=q.Symbol;const V=_a;var kr=Object.prototype,Sa=kr.hasOwnProperty,ja=kr.toString,Bt=V?V.toStringTag:void 0;function Oa(t){var e=Sa.call(t,Bt),r=t[Bt];try{t[Bt]=void 0;var n=!0}catch{}var o=ja.call(t);return n&&(e?t[Bt]=r:delete t[Bt]),o}var Ca=Object.prototype,wa=Ca.toString;function Ea(t){return wa.call(t)}var Na="[object Null]",Ta="[object Undefined]",Vr=V?V.toStringTag:void 0;function ut(t){return t==null?t===void 0?Ta:Na:Vr&&Vr in Object(t)?Oa(t):Ea(t)}function Y(t){return t!=null&&typeof t=="object"}var $a="[object Symbol]";function Ne(t){return typeof t=="symbol"||Y(t)&&ut(t)==$a}function Te(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 Aa=Array.isArray;const I=Aa;var Ma=1/0,Gr=V?V.prototype:void 0,zr=Gr?Gr.toString:void 0;function Hr(t){if(typeof t=="string")return t;if(I(t))return Te(t,Hr)+"";if(Ne(t))return zr?zr.call(t):"";var e=t+"";return e=="0"&&1/t==-Ma?"-0":e}function H(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function $e(t){return t}var Pa="[object AsyncFunction]",Da="[object Function]",Ia="[object GeneratorFunction]",xa="[object Proxy]";function Ae(t){if(!H(t))return!1;var e=ut(t);return e==Da||e==Ia||e==Pa||e==xa}var Ra=q["__core-js_shared__"];const Me=Ra;var Jr=function(){var t=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function La(t){return!!Jr&&Jr in t}var Fa=Function.prototype,Ba=Fa.toString;function lt(t){if(t!=null){try{return Ba.call(t)}catch{}try{return t+""}catch{}}return""}var Ua=/[\\^$.*+?()[\]{}|]/g,ka=/^\[object .+?Constructor\]$/,Va=Function.prototype,Ga=Object.prototype,za=Va.toString,Ha=Ga.hasOwnProperty,Ja=RegExp("^"+za.call(Ha).replace(Ua,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Wa(t){if(!H(t)||La(t))return!1;var e=Ae(t)?Ja:ka;return e.test(lt(t))}function Qa(t,e){return t==null?void 0:t[e]}function ft(t,e){var r=Qa(t,e);return Wa(r)?r:void 0}var qa=ft(q,"WeakMap");const Pe=qa;var Wr=Object.create,Ya=function(){function t(){}return function(e){if(!H(e))return{};if(Wr)return Wr(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const Ka=Ya;function Xa(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 Za(){}function Qr(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var ti=800,ei=16,ri=Date.now;function ni(t){var e=0,r=0;return function(){var n=ri(),o=ei-(n-r);if(r=n,o>0){if(++e>=ti)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function oi(t){return function(){return t}}var ai=function(){try{var t=ft(Object,"defineProperty");return t({},"",{}),t}catch{}}();const ie=ai;var ii=ie?function(t,e){return ie(t,"toString",{configurable:!0,enumerable:!1,value:oi(e),writable:!0})}:$e,si=ni(ii);const qr=si;function ci(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function ui(t,e,r,n){for(var o=t.length,a=r+(n?1:-1);n?a--:++a<o;)if(e(t[a],a,t))return a;return-1}function li(t){return t!==t}function fi(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function di(t,e,r){return e===e?fi(t,e,r):ui(t,li,r)}function pi(t,e){var r=t==null?0:t.length;return!!r&&di(t,e,0)>-1}var hi=9007199254740991,mi=/^(?:0|[1-9]\d*)$/;function se(t,e){var r=typeof t;return e=e??hi,!!e&&(r=="number"||r!="symbol"&&mi.test(t))&&t>-1&&t%1==0&&t<e}function De(t,e,r){e=="__proto__"&&ie?ie(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Ut(t,e){return t===e||t!==t&&e!==e}var vi=Object.prototype,gi=vi.hasOwnProperty;function Ie(t,e,r){var n=t[e];(!(gi.call(t,e)&&Ut(n,r))||r===void 0&&!(e in t))&&De(t,e,r)}function _t(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?De(r,i,c):Ie(r,i,c)}return r}var Yr=Math.max;function Kr(t,e,r){return e=Yr(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=Yr(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),Xa(t,this,i)}}function Xr(t,e){return qr(Kr(t,e,$e),t+"")}var yi=9007199254740991;function xe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=yi}function ce(t){return t!=null&&xe(t.length)&&!Ae(t)}function bi(t,e,r){if(!H(r))return!1;var n=typeof e;return(n=="number"?ce(r)&&se(e,r.length):n=="string"&&e in r)?Ut(r[e],t):!1}function _i(t){return Xr(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&&bi(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 Si=Object.prototype;function Re(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Si;return t===r}function ji(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Oi="[object Arguments]";function Zr(t){return Y(t)&&ut(t)==Oi}var tn=Object.prototype,Ci=tn.hasOwnProperty,wi=tn.propertyIsEnumerable,Ei=Zr(function(){return arguments}())?Zr:function(t){return Y(t)&&Ci.call(t,"callee")&&!wi.call(t,"callee")};const kt=Ei;function Ni(){return!1}var en=typeof g=="object"&&g&&!g.nodeType&&g,rn=en&&typeof module=="object"&&module&&!module.nodeType&&module,Ti=rn&&rn.exports===en,nn=Ti?q.Buffer:void 0,$i=nn?nn.isBuffer:void 0,Ai=$i||Ni;const Vt=Ai;var Mi="[object Arguments]",Pi="[object Array]",Di="[object Boolean]",Ii="[object Date]",xi="[object Error]",Ri="[object Function]",Li="[object Map]",Fi="[object Number]",Bi="[object Object]",Ui="[object RegExp]",ki="[object Set]",Vi="[object String]",Gi="[object WeakMap]",zi="[object ArrayBuffer]",Hi="[object DataView]",Ji="[object Float32Array]",Wi="[object Float64Array]",Qi="[object Int8Array]",qi="[object Int16Array]",Yi="[object Int32Array]",Ki="[object Uint8Array]",Xi="[object Uint8ClampedArray]",Zi="[object Uint16Array]",ts="[object Uint32Array]",T={};T[Ji]=T[Wi]=T[Qi]=T[qi]=T[Yi]=T[Ki]=T[Xi]=T[Zi]=T[ts]=!0,T[Mi]=T[Pi]=T[zi]=T[Di]=T[Hi]=T[Ii]=T[xi]=T[Ri]=T[Li]=T[Fi]=T[Bi]=T[Ui]=T[ki]=T[Vi]=T[Gi]=!1;function es(t){return Y(t)&&xe(t.length)&&!!T[ut(t)]}function Le(t){return function(e){return t(e)}}var on=typeof g=="object"&&g&&!g.nodeType&&g,Gt=on&&typeof module=="object"&&module&&!module.nodeType&&module,rs=Gt&&Gt.exports===on,Fe=rs&&Ur.process,ns=function(){try{var t=Gt&&Gt.require&&Gt.require("util").types;return t||Fe&&Fe.binding&&Fe.binding("util")}catch{}}();const St=ns;var an=St&&St.isTypedArray,os=an?Le(an):es;const Be=os;var as=Object.prototype,is=as.hasOwnProperty;function sn(t,e){var r=I(t),n=!r&&kt(t),o=!r&&!n&&Vt(t),a=!r&&!n&&!o&&Be(t),s=r||n||o||a,i=s?ji(t.length,String):[],c=i.length;for(var u in t)(e||is.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||se(u,c)))&&i.push(u);return i}function cn(t,e){return function(r){return t(e(r))}}var ss=cn(Object.keys,Object);const cs=ss;var us=Object.prototype,ls=us.hasOwnProperty;function fs(t){if(!Re(t))return cs(t);var e=[];for(var r in Object(t))ls.call(t,r)&&r!="constructor"&&e.push(r);return e}function ue(t){return ce(t)?sn(t):fs(t)}function ds(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var ps=Object.prototype,hs=ps.hasOwnProperty;function ms(t){if(!H(t))return ds(t);var e=Re(t),r=[];for(var n in t)n=="constructor"&&(e||!hs.call(t,n))||r.push(n);return r}function zt(t){return ce(t)?sn(t,!0):ms(t)}var vs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gs=/^\w*$/;function Ue(t,e){if(I(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Ne(t)?!0:gs.test(t)||!vs.test(t)||e!=null&&t in Object(e)}var ys=ft(Object,"create");const Ht=ys;function bs(){this.__data__=Ht?Ht(null):{},this.size=0}function _s(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Ss="__lodash_hash_undefined__",js=Object.prototype,Os=js.hasOwnProperty;function Cs(t){var e=this.__data__;if(Ht){var r=e[t];return r===Ss?void 0:r}return Os.call(e,t)?e[t]:void 0}var ws=Object.prototype,Es=ws.hasOwnProperty;function Ns(t){var e=this.__data__;return Ht?e[t]!==void 0:Es.call(e,t)}var Ts="__lodash_hash_undefined__";function $s(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ht&&e===void 0?Ts:e,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=bs,dt.prototype.delete=_s,dt.prototype.get=Cs,dt.prototype.has=Ns,dt.prototype.set=$s;function As(){this.__data__=[],this.size=0}function le(t,e){for(var r=t.length;r--;)if(Ut(t[r][0],e))return r;return-1}var Ms=Array.prototype,Ps=Ms.splice;function Ds(t){var e=this.__data__,r=le(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Ps.call(e,r,1),--this.size,!0}function Is(t){var e=this.__data__,r=le(e,t);return r<0?void 0:e[r][1]}function xs(t){return le(this.__data__,t)>-1}function Rs(t,e){var r=this.__data__,n=le(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function et(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])}}et.prototype.clear=As,et.prototype.delete=Ds,et.prototype.get=Is,et.prototype.has=xs,et.prototype.set=Rs;var Ls=ft(q,"Map");const Jt=Ls;function Fs(){this.size=0,this.__data__={hash:new dt,map:new(Jt||et),string:new dt}}function Bs(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function fe(t,e){var r=t.__data__;return Bs(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Us(t){var e=fe(this,t).delete(t);return this.size-=e?1:0,e}function ks(t){return fe(this,t).get(t)}function Vs(t){return fe(this,t).has(t)}function Gs(t,e){var r=fe(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function rt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}rt.prototype.clear=Fs,rt.prototype.delete=Us,rt.prototype.get=ks,rt.prototype.has=Vs,rt.prototype.set=Gs;var zs="Expected a function";function ke(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(zs);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=t.apply(this,n);return r.cache=a.set(o,s)||a,s};return r.cache=new(ke.Cache||rt),r}ke.Cache=rt;var Hs=500;function Js(t){var e=ke(t,function(n){return r.size===Hs&&r.clear(),n}),r=e.cache;return e}var Ws=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qs=/\\(\\)?/g,qs=Js(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Ws,function(r,n,o,a){e.push(o?a.replace(Qs,"$1"):n||r)}),e});const Ys=qs;function Ks(t){return t==null?"":Hr(t)}function jt(t,e){return I(t)?t:Ue(t,e)?[t]:Ys(Ks(t))}var Xs=1/0;function Ot(t){if(typeof t=="string"||Ne(t))return t;var e=t+"";return e=="0"&&1/t==-Xs?"-0":e}function de(t,e){e=jt(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Ot(e[r++])];return r&&r==n?t:void 0}function un(t,e,r){var n=t==null?void 0:de(t,e);return n===void 0?r:n}function Ve(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var ln=V?V.isConcatSpreadable:void 0;function Zs(t){return I(t)||kt(t)||!!(ln&&t&&t[ln])}function Ge(t,e,r,n,o){var a=-1,s=t.length;for(r||(r=Zs),o||(o=[]);++a<s;){var i=t[a];e>0&&r(i)?e>1?Ge(i,e-1,r,n,o):Ve(o,i):n||(o[o.length]=i)}return o}function tc(t){var e=t==null?0:t.length;return e?Ge(t,1):[]}function ec(t){return qr(Kr(t,void 0,tc),t+"")}var rc=cn(Object.getPrototypeOf,Object);const ze=rc;var nc="[object Object]",oc=Function.prototype,ac=Object.prototype,fn=oc.toString,ic=ac.hasOwnProperty,sc=fn.call(Object);function F(t){if(!Y(t)||ut(t)!=nc)return!1;var e=ze(t);if(e===null)return!0;var r=ic.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&fn.call(r)==sc}function cc(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 uc(){this.__data__=new et,this.size=0}function lc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function fc(t){return this.__data__.get(t)}function dc(t){return this.__data__.has(t)}var pc=200;function hc(t,e){var r=this.__data__;if(r instanceof et){var n=r.__data__;if(!Jt||n.length<pc-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new rt(n)}return r.set(t,e),this.size=r.size,this}function J(t){var e=this.__data__=new et(t);this.size=e.size}J.prototype.clear=uc,J.prototype.delete=lc,J.prototype.get=fc,J.prototype.has=dc,J.prototype.set=hc;function mc(t,e){return t&&_t(e,ue(e),t)}function vc(t,e){return t&&_t(e,zt(e),t)}var dn=typeof g=="object"&&g&&!g.nodeType&&g,pn=dn&&typeof module=="object"&&module&&!module.nodeType&&module,gc=pn&&pn.exports===dn,hn=gc?q.Buffer:void 0,mn=hn?hn.allocUnsafe:void 0;function vn(t,e){if(e)return t.slice();var r=t.length,n=mn?mn(r):new t.constructor(r);return t.copy(n),n}function yc(t,e){for(var r=-1,n=t==null?0:t.length,o=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[o++]=s)}return a}function gn(){return[]}var bc=Object.prototype,_c=bc.propertyIsEnumerable,yn=Object.getOwnPropertySymbols,Sc=yn?function(t){return t==null?[]:(t=Object(t),yc(yn(t),function(e){return _c.call(t,e)}))}:gn;const He=Sc;function jc(t,e){return _t(t,He(t),e)}var Oc=Object.getOwnPropertySymbols,Cc=Oc?function(t){for(var e=[];t;)Ve(e,He(t)),t=ze(t);return e}:gn;const bn=Cc;function wc(t,e){return _t(t,bn(t),e)}function _n(t,e,r){var n=e(t);return I(t)?n:Ve(n,r(t))}function Je(t){return _n(t,ue,He)}function We(t){return _n(t,zt,bn)}var Ec=ft(q,"DataView");const Qe=Ec;var Nc=ft(q,"Promise");const qe=Nc;var Tc=ft(q,"Set");const Ct=Tc;var Sn="[object Map]",$c="[object Object]",jn="[object Promise]",On="[object Set]",Cn="[object WeakMap]",wn="[object DataView]",Ac=lt(Qe),Mc=lt(Jt),Pc=lt(qe),Dc=lt(Ct),Ic=lt(Pe),pt=ut;(Qe&&pt(new Qe(new ArrayBuffer(1)))!=wn||Jt&&pt(new Jt)!=Sn||qe&&pt(qe.resolve())!=jn||Ct&&pt(new Ct)!=On||Pe&&pt(new Pe)!=Cn)&&(pt=function(t){var e=ut(t),r=e==$c?t.constructor:void 0,n=r?lt(r):"";if(n)switch(n){case Ac:return wn;case Mc:return Sn;case Pc:return jn;case Dc:return On;case Ic:return Cn}return e});const Wt=pt;var xc=Object.prototype,Rc=xc.hasOwnProperty;function Lc(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Rc.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Fc=q.Uint8Array;const pe=Fc;function Ye(t){var e=new t.constructor(t.byteLength);return new pe(e).set(new pe(t)),e}function Bc(t,e){var r=e?Ye(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Uc=/\w*$/;function kc(t){var e=new t.constructor(t.source,Uc.exec(t));return e.lastIndex=t.lastIndex,e}var En=V?V.prototype:void 0,Nn=En?En.valueOf:void 0;function Vc(t){return Nn?Object(Nn.call(t)):{}}function Tn(t,e){var r=e?Ye(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Gc="[object Boolean]",zc="[object Date]",Hc="[object Map]",Jc="[object Number]",Wc="[object RegExp]",Qc="[object Set]",qc="[object String]",Yc="[object Symbol]",Kc="[object ArrayBuffer]",Xc="[object DataView]",Zc="[object Float32Array]",tu="[object Float64Array]",eu="[object Int8Array]",ru="[object Int16Array]",nu="[object Int32Array]",ou="[object Uint8Array]",au="[object Uint8ClampedArray]",iu="[object Uint16Array]",su="[object Uint32Array]";function cu(t,e,r){var n=t.constructor;switch(e){case Kc:return Ye(t);case Gc:case zc:return new n(+t);case Xc:return Bc(t,r);case Zc:case tu:case eu:case ru:case nu:case ou:case au:case iu:case su:return Tn(t,r);case Hc:return new n;case Jc:case qc:return new n(t);case Wc:return kc(t);case Qc:return new n;case Yc:return Vc(t)}}function $n(t){return typeof t.constructor=="function"&&!Re(t)?Ka(ze(t)):{}}var uu="[object Map]";function lu(t){return Y(t)&&Wt(t)==uu}var An=St&&St.isMap,fu=An?Le(An):lu;const du=fu;var pu="[object Set]";function hu(t){return Y(t)&&Wt(t)==pu}var Mn=St&&St.isSet,mu=Mn?Le(Mn):hu;const vu=mu;var gu=1,yu=2,bu=4,Pn="[object Arguments]",_u="[object Array]",Su="[object Boolean]",ju="[object Date]",Ou="[object Error]",Dn="[object Function]",Cu="[object GeneratorFunction]",wu="[object Map]",Eu="[object Number]",In="[object Object]",Nu="[object RegExp]",Tu="[object Set]",$u="[object String]",Au="[object Symbol]",Mu="[object WeakMap]",Pu="[object ArrayBuffer]",Du="[object DataView]",Iu="[object Float32Array]",xu="[object Float64Array]",Ru="[object Int8Array]",Lu="[object Int16Array]",Fu="[object Int32Array]",Bu="[object Uint8Array]",Uu="[object Uint8ClampedArray]",ku="[object Uint16Array]",Vu="[object Uint32Array]",N={};N[Pn]=N[_u]=N[Pu]=N[Du]=N[Su]=N[ju]=N[Iu]=N[xu]=N[Ru]=N[Lu]=N[Fu]=N[wu]=N[Eu]=N[In]=N[Nu]=N[Tu]=N[$u]=N[Au]=N[Bu]=N[Uu]=N[ku]=N[Vu]=!0,N[Ou]=N[Dn]=N[Mu]=!1;function Qt(t,e,r,n,o,a){var s,i=e&gu,c=e&yu,u=e&bu;if(r&&(s=o?r(t,n,o,a):r(t)),s!==void 0)return s;if(!H(t))return t;var l=I(t);if(l){if(s=Lc(t),!i)return Qr(t,s)}else{var d=Wt(t),f=d==Dn||d==Cu;if(Vt(t))return vn(t,i);if(d==In||d==Pn||f&&!o){if(s=c||f?{}:$n(t),!i)return c?wc(t,vc(s,t)):jc(t,mc(s,t))}else{if(!N[d])return o?t:{};s=cu(t,d,i)}}a||(a=new J);var p=a.get(t);if(p)return p;a.set(t,s),vu(t)?t.forEach(function(_){s.add(Qt(_,e,r,_,t,a))}):du(t)&&t.forEach(function(_,O){s.set(O,Qt(_,e,r,O,t,a))});var v=u?c?We:Je:c?zt:ue,y=l?void 0:v(t);return ci(y||t,function(_,O){y&&(O=_,_=t[O]),Ie(s,O,Qt(_,e,r,O,t,a))}),s}var Gu=1,zu=4;function xn(t){return Qt(t,Gu|zu)}var Hu="__lodash_hash_undefined__";function Ju(t){return this.__data__.set(t,Hu),this}function Wu(t){return this.__data__.has(t)}function qt(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new rt;++e<r;)this.add(t[e])}qt.prototype.add=qt.prototype.push=Ju,qt.prototype.has=Wu;function Qu(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Rn(t,e){return t.has(e)}var qu=1,Yu=2;function Ln(t,e,r,n,o,a){var s=r&qu,i=t.length,c=e.length;if(i!=c&&!(s&&c>i))return!1;var u=a.get(t),l=a.get(e);if(u&&l)return u==e&&l==t;var d=-1,f=!0,p=r&Yu?new qt:void 0;for(a.set(t,e),a.set(e,t);++d<i;){var v=t[d],y=e[d];if(n)var _=s?n(y,v,d,e,t,a):n(v,y,d,t,e,a);if(_!==void 0){if(_)continue;f=!1;break}if(p){if(!Qu(e,function(O,C){if(!Rn(p,C)&&(v===O||o(v,O,r,n,a)))return p.push(C)})){f=!1;break}}else if(!(v===y||o(v,y,r,n,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function Ku(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function Ke(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Xu=1,Zu=2,tl="[object Boolean]",el="[object Date]",rl="[object Error]",nl="[object Map]",ol="[object Number]",al="[object RegExp]",il="[object Set]",sl="[object String]",cl="[object Symbol]",ul="[object ArrayBuffer]",ll="[object DataView]",Fn=V?V.prototype:void 0,Xe=Fn?Fn.valueOf:void 0;function fl(t,e,r,n,o,a,s){switch(r){case ll:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ul:return!(t.byteLength!=e.byteLength||!a(new pe(t),new pe(e)));case tl:case el:case ol:return Ut(+t,+e);case rl:return t.name==e.name&&t.message==e.message;case al:case sl:return t==e+"";case nl:var i=Ku;case il:var c=n&Xu;if(i||(i=Ke),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=Zu,s.set(t,e);var l=Ln(i(t),i(e),n,o,a,s);return s.delete(t),l;case cl:if(Xe)return Xe.call(t)==Xe.call(e)}return!1}var dl=1,pl=Object.prototype,hl=pl.hasOwnProperty;function ml(t,e,r,n,o,a){var s=r&dl,i=Je(t),c=i.length,u=Je(e),l=u.length;if(c!=l&&!s)return!1;for(var d=c;d--;){var f=i[d];if(!(s?f in e:hl.call(e,f)))return!1}var p=a.get(t),v=a.get(e);if(p&&v)return p==e&&v==t;var y=!0;a.set(t,e),a.set(e,t);for(var _=s;++d<c;){f=i[d];var O=t[f],C=e[f];if(n)var D=s?n(C,O,f,e,t,a):n(O,C,f,t,e,a);if(!(D===void 0?O===C||o(O,C,r,n,a):D)){y=!1;break}_||(_=f=="constructor")}if(y&&!_){var M=t.constructor,L=e.constructor;M!=L&&"constructor"in t&&"constructor"in e&&!(typeof M=="function"&&M instanceof M&&typeof L=="function"&&L instanceof L)&&(y=!1)}return a.delete(t),a.delete(e),y}var vl=1,Bn="[object Arguments]",Un="[object Array]",he="[object Object]",gl=Object.prototype,kn=gl.hasOwnProperty;function yl(t,e,r,n,o,a){var s=I(t),i=I(e),c=s?Un:Wt(t),u=i?Un:Wt(e);c=c==Bn?he:c,u=u==Bn?he:u;var l=c==he,d=u==he,f=c==u;if(f&&Vt(t)){if(!Vt(e))return!1;s=!0,l=!1}if(f&&!l)return a||(a=new J),s||Be(t)?Ln(t,e,r,n,o,a):fl(t,e,c,r,n,o,a);if(!(r&vl)){var p=l&&kn.call(t,"__wrapped__"),v=d&&kn.call(e,"__wrapped__");if(p||v){var y=p?t.value():t,_=v?e.value():e;return a||(a=new J),o(y,_,r,n,a)}}return f?(a||(a=new J),ml(t,e,r,n,o,a)):!1}function Ze(t,e,r,n,o){return t===e?!0:t==null||e==null||!Y(t)&&!Y(e)?t!==t&&e!==e:yl(t,e,r,n,Ze,o)}var bl=1,_l=2;function Sl(t,e,r,n){var o=r.length,a=o,s=!n;if(t==null)return!a;for(t=Object(t);o--;){var i=r[o];if(s&&i[2]?i[1]!==t[i[0]]:!(i[0]in t))return!1}for(;++o<a;){i=r[o];var c=i[0],u=t[c],l=i[1];if(s&&i[2]){if(u===void 0&&!(c in t))return!1}else{var d=new J;if(n)var f=n(u,l,c,t,e,d);if(!(f===void 0?Ze(l,u,bl|_l,n,d):f))return!1}}return!0}function Vn(t){return t===t&&!H(t)}function jl(t){for(var e=ue(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,Vn(o)]}return e}function Gn(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Ol(t){var e=jl(t);return e.length==1&&e[0][2]?Gn(e[0][0],e[0][1]):function(r){return r===t||Sl(r,t,e)}}function Cl(t,e){return t!=null&&e in Object(t)}function wl(t,e,r){e=jt(e,t);for(var n=-1,o=e.length,a=!1;++n<o;){var s=Ot(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=o?a:(o=t==null?0:t.length,!!o&&xe(o)&&se(s,o)&&(I(t)||kt(t)))}function El(t,e){return t!=null&&wl(t,e,Cl)}var Nl=1,Tl=2;function $l(t,e){return Ue(t)&&Vn(e)?Gn(Ot(t),e):function(r){var n=un(r,t);return n===void 0&&n===e?El(r,t):Ze(e,n,Nl|Tl)}}function Al(t){return function(e){return e==null?void 0:e[t]}}function Ml(t){return function(e){return de(e,t)}}function Pl(t){return Ue(t)?Al(Ot(t)):Ml(t)}function tr(t){return typeof t=="function"?t:t==null?$e:typeof t=="object"?I(t)?$l(t[0],t[1]):Ol(t):Pl(t)}function Dl(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 Il=Dl();const xl=Il;function er(t,e,r){(r!==void 0&&!Ut(t[e],r)||r===void 0&&!(e in t))&&De(t,e,r)}function rr(t){return Y(t)&&ce(t)}function nr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Rl(t){return _t(t,zt(t))}function Ll(t,e,r,n,o,a,s){var i=nr(t,r),c=nr(e,r),u=s.get(c);if(u){er(t,r,u);return}var l=a?a(i,c,r+"",t,e,s):void 0,d=l===void 0;if(d){var f=I(c),p=!f&&Vt(c),v=!f&&!p&&Be(c);l=c,f||p||v?I(i)?l=i:rr(i)?l=Qr(i):p?(d=!1,l=vn(c,!0)):v?(d=!1,l=Tn(c,!0)):l=[]:F(c)||kt(c)?(l=i,kt(i)?l=Rl(i):(!H(i)||Ae(i))&&(l=$n(c))):d=!1}d&&(s.set(c,l),o(l,c,n,a,s),s.delete(c)),er(t,r,l)}function zn(t,e,r,n,o){t!==e&&xl(e,function(a,s){if(o||(o=new J),H(a))Ll(t,e,s,r,zn,n,o);else{var i=n?n(nr(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),er(t,s,i)}},zt)}function Fl(t,e,r){for(var n=-1,o=t==null?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1}function Hn(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Bl(t,e){return e.length<2?t:de(t,cc(e,0,-1))}var Ul=_i(function(t,e,r){zn(t,e,r)});const Jn=Ul;var kl="Expected a function";function Vl(t){if(typeof t!="function")throw new TypeError(kl);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Gl(t,e){return e=jt(e,t),t=Bl(t,e),t==null||delete t[Ot(Hn(e))]}function zl(t){return F(t)?void 0:t}var Hl=1,Jl=2,Wl=4,Ql=ec(function(t,e){var r={};if(t==null)return r;var n=!1;e=Te(e,function(a){return a=jt(a,t),n||(n=a.length>1),a}),_t(t,We(t),r),n&&(r=Qt(r,Hl|Jl|Wl,zl));for(var o=e.length;o--;)Gl(r,e[o]);return r});const Wn=Ql;function ql(t,e,r,n){if(!H(t))return t;e=jt(e,t);for(var o=-1,a=e.length,s=a-1,i=t;i!=null&&++o<a;){var c=Ot(e[o]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(o!=s){var l=i[c];u=n?n(l,c,i):void 0,u===void 0&&(u=H(l)?l:se(e[o+1])?[]:{})}Ie(i,c,u),i=i[c]}return t}function Yl(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var s=e[n],i=de(t,s);r(i,s)&&ql(a,jt(s,t),i)}return a}function Kl(t,e){if(t==null)return{};var r=Te(We(t),function(n){return[n]});return e=tr(e),Yl(t,r,function(n,o){return e(n,o[0])})}function Xl(t,e){return Kl(t,Vl(tr(e)))}var Zl=1/0,tf=Ct&&1/Ke(new Ct([,-0]))[1]==Zl?function(t){return new Ct(t)}:Za;const ef=tf;var rf=200;function nf(t,e,r){var n=-1,o=pi,a=t.length,s=!0,i=[],c=i;if(r)s=!1,o=Fl;else if(a>=rf){var u=e?null:ef(t);if(u)return Ke(u);s=!1,o=Rn,c=new qt}else c=e?[]:i;t:for(;++n<a;){var l=t[n],d=e?e(l):l;if(l=r||l!==0?l:0,s&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue t;e&&c.push(d),i.push(l)}else o(c,d,r)||(c!==i&&c.push(d),i.push(l))}return i}var of=Xr(function(t){var e=Hn(t);return rr(e)&&(e=void 0),nf(Ge(t,1,rr,!0),tr(e))});const af=of;class Qn extends TypeError{constructor(e,r){let n;const{message:o,...a}=e,{path:s}=e,i=s.length===0?o:"At path: "+s.join(".")+" -- "+o;super(i),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>{var c;return(c=n)!=null?c:n=[e,...r()]}}}function sf(t){return W(t)&&typeof t[Symbol.iterator]=="function"}function W(t){return typeof t=="object"&&t!=null}function k(t){return typeof t=="string"?JSON.stringify(t):""+t}function cf(t){const{done:e,value:r}=t.next();return e?void 0:r}function uf(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:o,branch:a}=e,{type:s}=r,{refinement:i,message:c="Expected a value of type `"+s+"`"+(i?" with refinement `"+i+"`":"")+", but received: `"+k(n)+"`"}=t;return{value:n,type:s,refinement:i,key:o[o.length-1],path:o,branch:a,...t,message:c}}function*qn(t,e,r,n){sf(t)||(t=[t]);for(const o of t){const a=uf(o,e,r,n);a&&(yield a)}}function*or(t,e,r){r===void 0&&(r={});const{path:n=[],branch:o=[t],coerce:a=!1,mask:s=!1}=r,i={path:n,branch:o};if(a&&(t=e.coercer(t,i),s&&e.type!=="type"&&W(e.schema)&&W(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c="valid";for(const u of e.validator(t,i))c="not_valid",yield[u,void 0];for(let[u,l,d]of e.entries(t,i)){const f=or(l,d,{path:u===void 0?n:[...n,u],branch:u===void 0?o:[...o,l],coerce:a,mask:s});for(const p of f)p[0]?(c=p[0].refinement!=null?"not_refined":"not_valid",yield[p[0],void 0]):a&&(l=p[1],u===void 0?t=l:t instanceof Map?t.set(u,l):t instanceof Set?t.add(l):W(t)&&(t[u]=l))}if(c!=="not_valid")for(const u of e.refiner(t,i))c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,t])}class K{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:r,schema:n,validator:o,refiner:a,coercer:s=c=>c,entries:i=function*(){}}=e;this.type=r,this.schema=n,this.entries=i,this.coercer=s,o?this.validator=(c,u)=>{const l=o(c,u);return qn(l,u,this,c)}:this.validator=()=>[],a?this.refiner=(c,u)=>{const l=a(c,u);return qn(l,u,this,c)}:this.refiner=()=>[]}assert(e){return Yn(e,this)}create(e){return lf(e,this)}is(e){return df(e,this)}mask(e){return ff(e,this)}validate(e,r){return r===void 0&&(r={}),wt(e,this,r)}}function Yn(t,e){const r=wt(t,e);if(r[0])throw r[0]}function lf(t,e){const r=wt(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function ff(t,e){const r=wt(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function df(t,e){return!wt(t,e)[0]}function wt(t,e,r){r===void 0&&(r={});const n=or(t,e,r),o=cf(n);return o[0]?[new Qn(o[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,o[1]]}function ar(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=e[0].type==="type",o=e.map(s=>s.schema),a=Object.assign({},...o);return n?to(a):w(a)}function at(t,e){return new K({type:t,schema:null,validator:e})}function Et(t){return new K({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function Kn(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return to(n);default:return w(n)}}function x(){return at("any",()=>!0)}function P(t){return new K({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||"Expected an array value, but received: "+k(e)}})}function Nt(){return at("boolean",t=>typeof t=="boolean")}function ir(t){const e={},r=t.map(n=>k(n)).join();for(const n of t)e[n]=n;return new K({type:"enums",schema:e,validator(n){return t.includes(n)||"Expected one of `"+r+"`, but received: "+k(n)}})}function Xn(){return at("func",t=>typeof t=="function"||"Expected a function, but received: "+k(t))}function B(t){const e=k(t),r=typeof t;return new K({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||"Expected the literal `"+e+"`, but received: "+k(n)}})}function pf(){return at("never",()=>!1)}function Zn(){return at("number",t=>typeof t=="number"&&!isNaN(t)||"Expected a number, but received: "+k(t))}function w(t){const e=t?Object.keys(t):[],r=pf();return new K({type:"object",schema:t||null,*entries(n){if(t&&W(n)){const o=new Set(Object.keys(n));for(const a of e)o.delete(a),yield[a,n[a],t[a]];for(const a of o)yield[a,n[a],r]}},validator(n){return W(n)||"Expected an object, but received: "+k(n)},coercer(n){return W(n)?{...n}:n}})}function m(t){return new K({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Yt(t,e){return new K({type:"record",schema:null,*entries(r){if(W(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return W(r)||"Expected an object, but received: "+k(r)}})}function h(){return at("string",t=>typeof t=="string"||"Expected a string, but received: "+k(t))}function to(t){const e=Object.keys(t);return new K({type:"type",schema:t,*entries(r){if(W(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return W(r)||"Expected an object, but received: "+k(r)}})}function U(t){const e=t.map(r=>r.type).join(" | ");return new K({type:"union",schema:null,coercer(r,n){return(t.find(o=>{const[a]=o.validate(r,{coerce:!0});return!a})||hf()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...s]=or(r,a,n),[i]=s;if(i[0])for(const[c]of s)c&&o.push(c);else return[]}return["Expected the value to satisfy a union of `"+e+"`, but received: "+k(r),...o]}})}function hf(){return at("unknown",()=>!0)}const sr=w({package:h(),version:h(),name:h(),exportName:m(h()),destructuring:m(Nt()),subName:m(h()),main:m(h()),cssPaths:m(P(h()))}),mf=P(sr),vf=["CBlock","CContainer","CImage","CCanvas","CVideo","CAudio","CText","CNativeTag"];var G=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t))(G||{}),cr=(t=>(t.DESIGN="design",t.SAVE="save",t))(cr||{}),ur=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(ur||{});const gf=()=>at("normalObj",t=>!F(t)||[G.SLOT,G.EXPRESSION,G.FUNCTION].includes(t==null?void 0:t.type)?!1:(wt(t,Yt(h(),lr)),!0)),lr=U([h(),Zn(),Nt(),w({type:B(G.SLOT),renderType:ir([ur.FUNC,ur.COMP]),params:m(P(h())),value:Et(()=>U([Tt,P(Tt)]))}),w({type:B(G.EXPRESSION),value:h()}),w({type:B(G.FUNCTION),value:h()}),gf(),P(Et(()=>lr))]),eo=w({type:B(G.EXPRESSION),value:h()}),Tt=w({id:m(h()),title:m(h()),componentName:h(),props:m(Yt(h(),lr)),nodeName:m(h()),state:m(Yt(h(),x())),children:Et(()=>m(P(U([h(),Tt])))),configure:m(x()),css:m(x()),style:m(x()),classNames:m(P(x())),refId:m(h()),extra:m(Yt(x(),x())),condition:m(U([Nt(),eo])),loop:m(w({open:Nt(),data:U([P(x()),eo]),args:m(P(h())),forName:m(h()),forIndex:m(h()),key:m(x()),name:m(h())})),methods:m(P(x()))}),me=U([h(),w({label:h(),tip:m(h())})]),yf=w({type:B("shape"),value:P(w({name:h(),title:me,valueType:Et(()=>ve)}))}),bf=w({type:B("enums"),value:P(h())});w({type:B("array"),value:Et(()=>ve)});const _f=w({type:B("array"),value:Et(()=>P(ve))}),ve=U([ir(["array","boolean","number","object","string"]),ir(["component","expression","function"]),yf,bf,_f]),Sf=U([h(),w({componentName:h(),props:m(x()),initialValue:m(x()),component:m(x())})]),fr=w({name:h(),title:me,valueType:ve,description:m(h()),defaultValue:x(),setters:m(P(Sf)),condition:m(Xn())});U([h(),Xn()]);var dr=(t=>(t.SINGLE="single",t.GROUP="group",t))(dr||{});U([h(),w({name:h(),describe:m(h()),params:m(w({name:h(),description:h()})),template:h()})]);const jf=w({id:m(h()),title:h(),snapshot:U([h(),x()]),snapshotText:m(h()),description:m(h()),tags:m(P(h())),groupName:m(h()),category:m(h()),schema:ar(Kn(Tt,["id"]),w({componentName:m(h())}))}),Of=w({componentName:h(),title:h(),screenshot:m(h()),icon:m(h()),tags:m(P(h())),groupName:m(h()),category:m(h()),priority:m(Zn()),npm:m(sr),snippets:P(jf),props:P(U([fr,w({title:m(me),type:B("single"),content:fr}),w({title:m(me),type:B("group"),content:P(fr)})])),fixedProps:m(x()),isContainer:m(U([Nt(),w({placeholder:h(),width:h(),height:h()})])),disableEditorDragDom:m(x()),isLayout:m(Nt()),rootSelector:m(h()),advanceCustom:m(x()),extra:m(Yt(x(),x()))}),Cf=t=>({data:e,message:r,throwError:n})=>{const o=t({data:e,message:r,throwError:n});if(o.isValidate)return o;if(n)throw o.message||r?new Error(`${o.message||r}
|
|
1
|
+
(function(_,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],C):(_=typeof globalThis<"u"?globalThis:_||self,C(_.CRender={},_.React,_.ReactDOM))})(this,function(_,C,Tt){"use strict";var Km=Object.defineProperty;var Xm=(_,C,Tt)=>C in _?Km(_,C,{enumerable:!0,configurable:!0,writable:!0,value:Tt}):_[C]=Tt;var j=(_,C,Tt)=>(Xm(_,typeof C!="symbol"?C+"":C,Tt),Tt);function ni(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const oi=ni(Tt),ai=t=>()=>{console.warn(`${t} need to be implement getComponent`)},ii=["customPageRootRender"],gn=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","getDataLink","createDataLink","transformProps","transformData","transformGlobalData","errorCatch","clear"],yn=t=>[...gn,...ii].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):gn.includes(n)&&(r[n]=ai),r},{});var si=Object.defineProperty,ci=(t,e,r)=>e in t?si(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,T=(t,e,r)=>(ci(t,typeof e!="symbol"?e+"":e,r),r),ui=typeof global=="object"&&global&&global.Object===Object&&global;const bn=ui;var li=typeof self=="object"&&self&&self.Object===Object&&self,fi=bn||li||Function("return this")();const dt=fi;var di=dt.Symbol;const ot=di;var _n=Object.prototype,pi=_n.hasOwnProperty,hi=_n.toString,de=ot?ot.toStringTag:void 0;function vi(t){var e=pi.call(t,de),r=t[de];try{t[de]=void 0;var n=!0}catch{}var o=hi.call(t);return n&&(e?t[de]=r:delete t[de]),o}var mi=Object.prototype,gi=mi.toString;function yi(t){return gi.call(t)}var bi="[object Null]",_i="[object Undefined]",Sn=ot?ot.toStringTag:void 0;function Nt(t){return t==null?t===void 0?_i:bi:Sn&&Sn in Object(t)?vi(t):yi(t)}function pt(t){return t!=null&&typeof t=="object"}var Si="[object Symbol]";function nr(t){return typeof t=="symbol"||pt(t)&&Nt(t)==Si}function or(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 Oi=Array.isArray;const G=Oi;var ji=1/0,On=ot?ot.prototype:void 0,jn=On?On.toString:void 0;function Cn(t){if(typeof t=="string")return t;if(G(t))return or(t,Cn)+"";if(nr(t))return jn?jn.call(t):"";var e=t+"";return e=="0"&&1/t==-ji?"-0":e}function ct(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function ar(t){return t}var Ci="[object AsyncFunction]",wi="[object Function]",Ei="[object GeneratorFunction]",Ti="[object Proxy]";function ir(t){if(!ct(t))return!1;var e=Nt(t);return e==wi||e==Ei||e==Ci||e==Ti}var Ni=dt["__core-js_shared__"];const sr=Ni;var wn=function(){var t=/[^.]+$/.exec(sr&&sr.keys&&sr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function $i(t){return!!wn&&wn in t}var Pi=Function.prototype,Ai=Pi.toString;function $t(t){if(t!=null){try{return Ai.call(t)}catch{}try{return t+""}catch{}}return""}var Ri=/[\\^$.*+?()[\]{}|]/g,Mi=/^\[object .+?Constructor\]$/,xi=Function.prototype,Di=Object.prototype,Ii=xi.toString,Li=Di.hasOwnProperty,Fi=RegExp("^"+Ii.call(Li).replace(Ri,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ki(t){if(!ct(t)||$i(t))return!1;var e=ir(t)?Fi:Mi;return e.test($t(t))}function Ui(t,e){return t==null?void 0:t[e]}function Pt(t,e){var r=Ui(t,e);return ki(r)?r:void 0}var Bi=Pt(dt,"WeakMap");const cr=Bi;var En=Object.create,Vi=function(){function t(){}return function(e){if(!ct(e))return{};if(En)return En(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const Gi=Vi;function zi(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 Wi(){}function Tn(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Hi=800,Yi=16,Ji=Date.now;function qi(t){var e=0,r=0;return function(){var n=Ji(),o=Yi-(n-r);if(r=n,o>0){if(++e>=Hi)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Qi(t){return function(){return t}}var Ki=function(){try{var t=Pt(Object,"defineProperty");return t({},"",{}),t}catch{}}();const xe=Ki;var Xi=xe?function(t,e){return xe(t,"toString",{configurable:!0,enumerable:!1,value:Qi(e),writable:!0})}:ar,Zi=qi(Xi);const Nn=Zi;function ts(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function es(t,e,r,n){for(var o=t.length,a=r+(n?1:-1);n?a--:++a<o;)if(e(t[a],a,t))return a;return-1}function rs(t){return t!==t}function ns(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function os(t,e,r){return e===e?ns(t,e,r):es(t,rs,r)}function as(t,e){var r=t==null?0:t.length;return!!r&&os(t,e,0)>-1}var is=9007199254740991,ss=/^(?:0|[1-9]\d*)$/;function De(t,e){var r=typeof t;return e=e??is,!!e&&(r=="number"||r!="symbol"&&ss.test(t))&&t>-1&&t%1==0&&t<e}function ur(t,e,r){e=="__proto__"&&xe?xe(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function pe(t,e){return t===e||t!==t&&e!==e}var cs=Object.prototype,us=cs.hasOwnProperty;function lr(t,e,r){var n=t[e];(!(us.call(t,e)&&pe(n,r))||r===void 0&&!(e in t))&&ur(t,e,r)}function Bt(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?ur(r,i,c):lr(r,i,c)}return r}var $n=Math.max;function Pn(t,e,r){return e=$n(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=$n(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),zi(t,this,i)}}function An(t,e){return Nn(Pn(t,e,ar),t+"")}var ls=9007199254740991;function fr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ls}function Ie(t){return t!=null&&fr(t.length)&&!ir(t)}function fs(t,e,r){if(!ct(r))return!1;var n=typeof e;return(n=="number"?Ie(r)&&De(e,r.length):n=="string"&&e in r)?pe(r[e],t):!1}function ds(t){return An(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&&fs(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 ps=Object.prototype;function dr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||ps;return t===r}function hs(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var vs="[object Arguments]";function Rn(t){return pt(t)&&Nt(t)==vs}var Mn=Object.prototype,ms=Mn.hasOwnProperty,gs=Mn.propertyIsEnumerable,ys=Rn(function(){return arguments}())?Rn:function(t){return pt(t)&&ms.call(t,"callee")&&!gs.call(t,"callee")};const he=ys;function bs(){return!1}var xn=typeof _=="object"&&_&&!_.nodeType&&_,Dn=xn&&typeof module=="object"&&module&&!module.nodeType&&module,_s=Dn&&Dn.exports===xn,In=_s?dt.Buffer:void 0,Ss=In?In.isBuffer:void 0,Os=Ss||bs;const ve=Os;var js="[object Arguments]",Cs="[object Array]",ws="[object Boolean]",Es="[object Date]",Ts="[object Error]",Ns="[object Function]",$s="[object Map]",Ps="[object Number]",As="[object Object]",Rs="[object RegExp]",Ms="[object Set]",xs="[object String]",Ds="[object WeakMap]",Is="[object ArrayBuffer]",Ls="[object DataView]",Fs="[object Float32Array]",ks="[object Float64Array]",Us="[object Int8Array]",Bs="[object Int16Array]",Vs="[object Int32Array]",Gs="[object Uint8Array]",zs="[object Uint8ClampedArray]",Ws="[object Uint16Array]",Hs="[object Uint32Array]",I={};I[Fs]=I[ks]=I[Us]=I[Bs]=I[Vs]=I[Gs]=I[zs]=I[Ws]=I[Hs]=!0,I[js]=I[Cs]=I[Is]=I[ws]=I[Ls]=I[Es]=I[Ts]=I[Ns]=I[$s]=I[Ps]=I[As]=I[Rs]=I[Ms]=I[xs]=I[Ds]=!1;function Ys(t){return pt(t)&&fr(t.length)&&!!I[Nt(t)]}function pr(t){return function(e){return t(e)}}var Ln=typeof _=="object"&&_&&!_.nodeType&&_,me=Ln&&typeof module=="object"&&module&&!module.nodeType&&module,Js=me&&me.exports===Ln,hr=Js&&bn.process,qs=function(){try{var t=me&&me.require&&me.require("util").types;return t||hr&&hr.binding&&hr.binding("util")}catch{}}();const Vt=qs;var Fn=Vt&&Vt.isTypedArray,Qs=Fn?pr(Fn):Ys;const vr=Qs;var Ks=Object.prototype,Xs=Ks.hasOwnProperty;function kn(t,e){var r=G(t),n=!r&&he(t),o=!r&&!n&&ve(t),a=!r&&!n&&!o&&vr(t),s=r||n||o||a,i=s?hs(t.length,String):[],c=i.length;for(var l in t)(e||Xs.call(t,l))&&!(s&&(l=="length"||o&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||De(l,c)))&&i.push(l);return i}function Un(t,e){return function(r){return t(e(r))}}var Zs=Un(Object.keys,Object);const tc=Zs;var ec=Object.prototype,rc=ec.hasOwnProperty;function nc(t){if(!dr(t))return tc(t);var e=[];for(var r in Object(t))rc.call(t,r)&&r!="constructor"&&e.push(r);return e}function Le(t){return Ie(t)?kn(t):nc(t)}function oc(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var ac=Object.prototype,ic=ac.hasOwnProperty;function sc(t){if(!ct(t))return oc(t);var e=dr(t),r=[];for(var n in t)n=="constructor"&&(e||!ic.call(t,n))||r.push(n);return r}function ge(t){return Ie(t)?kn(t,!0):sc(t)}var cc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uc=/^\w*$/;function mr(t,e){if(G(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||nr(t)?!0:uc.test(t)||!cc.test(t)||e!=null&&t in Object(e)}var lc=Pt(Object,"create");const ye=lc;function fc(){this.__data__=ye?ye(null):{},this.size=0}function dc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var pc="__lodash_hash_undefined__",hc=Object.prototype,vc=hc.hasOwnProperty;function mc(t){var e=this.__data__;if(ye){var r=e[t];return r===pc?void 0:r}return vc.call(e,t)?e[t]:void 0}var gc=Object.prototype,yc=gc.hasOwnProperty;function bc(t){var e=this.__data__;return ye?e[t]!==void 0:yc.call(e,t)}var _c="__lodash_hash_undefined__";function Sc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ye&&e===void 0?_c:e,this}function At(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])}}At.prototype.clear=fc,At.prototype.delete=dc,At.prototype.get=mc,At.prototype.has=bc,At.prototype.set=Sc;function Oc(){this.__data__=[],this.size=0}function Fe(t,e){for(var r=t.length;r--;)if(pe(t[r][0],e))return r;return-1}var jc=Array.prototype,Cc=jc.splice;function wc(t){var e=this.__data__,r=Fe(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Cc.call(e,r,1),--this.size,!0}function Ec(t){var e=this.__data__,r=Fe(e,t);return r<0?void 0:e[r][1]}function Tc(t){return Fe(this.__data__,t)>-1}function Nc(t,e){var r=this.__data__,n=Fe(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function mt(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])}}mt.prototype.clear=Oc,mt.prototype.delete=wc,mt.prototype.get=Ec,mt.prototype.has=Tc,mt.prototype.set=Nc;var $c=Pt(dt,"Map");const be=$c;function Pc(){this.size=0,this.__data__={hash:new At,map:new(be||mt),string:new At}}function Ac(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ke(t,e){var r=t.__data__;return Ac(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Rc(t){var e=ke(this,t).delete(t);return this.size-=e?1:0,e}function Mc(t){return ke(this,t).get(t)}function xc(t){return ke(this,t).has(t)}function Dc(t,e){var r=ke(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function gt(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])}}gt.prototype.clear=Pc,gt.prototype.delete=Rc,gt.prototype.get=Mc,gt.prototype.has=xc,gt.prototype.set=Dc;var Ic="Expected a function";function gr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Ic);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=t.apply(this,n);return r.cache=a.set(o,s)||a,s};return r.cache=new(gr.Cache||gt),r}gr.Cache=gt;var Lc=500;function Fc(t){var e=gr(t,function(n){return r.size===Lc&&r.clear(),n}),r=e.cache;return e}var kc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Uc=/\\(\\)?/g,Bc=Fc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(kc,function(r,n,o,a){e.push(o?a.replace(Uc,"$1"):n||r)}),e});const Vc=Bc;function Gc(t){return t==null?"":Cn(t)}function Gt(t,e){return G(t)?t:mr(t,e)?[t]:Vc(Gc(t))}var zc=1/0;function zt(t){if(typeof t=="string"||nr(t))return t;var e=t+"";return e=="0"&&1/t==-zc?"-0":e}function Ue(t,e){e=Gt(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[zt(e[r++])];return r&&r==n?t:void 0}function Bn(t,e,r){var n=t==null?void 0:Ue(t,e);return n===void 0?r:n}function yr(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var Vn=ot?ot.isConcatSpreadable:void 0;function Wc(t){return G(t)||he(t)||!!(Vn&&t&&t[Vn])}function br(t,e,r,n,o){var a=-1,s=t.length;for(r||(r=Wc),o||(o=[]);++a<s;){var i=t[a];e>0&&r(i)?e>1?br(i,e-1,r,n,o):yr(o,i):n||(o[o.length]=i)}return o}function Hc(t){var e=t==null?0:t.length;return e?br(t,1):[]}function Yc(t){return Nn(Pn(t,void 0,Hc),t+"")}var Jc=Un(Object.getPrototypeOf,Object);const _r=Jc;var qc="[object Object]",Qc=Function.prototype,Kc=Object.prototype,Gn=Qc.toString,Xc=Kc.hasOwnProperty,Zc=Gn.call(Object);function K(t){if(!pt(t)||Nt(t)!=qc)return!1;var e=_r(t);if(e===null)return!0;var r=Xc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Gn.call(r)==Zc}function tu(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 eu(){this.__data__=new mt,this.size=0}function ru(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function nu(t){return this.__data__.get(t)}function ou(t){return this.__data__.has(t)}var au=200;function iu(t,e){var r=this.__data__;if(r instanceof mt){var n=r.__data__;if(!be||n.length<au-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new gt(n)}return r.set(t,e),this.size=r.size,this}function ut(t){var e=this.__data__=new mt(t);this.size=e.size}ut.prototype.clear=eu,ut.prototype.delete=ru,ut.prototype.get=nu,ut.prototype.has=ou,ut.prototype.set=iu;function su(t,e){return t&&Bt(e,Le(e),t)}function cu(t,e){return t&&Bt(e,ge(e),t)}var zn=typeof _=="object"&&_&&!_.nodeType&&_,Wn=zn&&typeof module=="object"&&module&&!module.nodeType&&module,uu=Wn&&Wn.exports===zn,Hn=uu?dt.Buffer:void 0,Yn=Hn?Hn.allocUnsafe:void 0;function Jn(t,e){if(e)return t.slice();var r=t.length,n=Yn?Yn(r):new t.constructor(r);return t.copy(n),n}function lu(t,e){for(var r=-1,n=t==null?0:t.length,o=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[o++]=s)}return a}function qn(){return[]}var fu=Object.prototype,du=fu.propertyIsEnumerable,Qn=Object.getOwnPropertySymbols,pu=Qn?function(t){return t==null?[]:(t=Object(t),lu(Qn(t),function(e){return du.call(t,e)}))}:qn;const Sr=pu;function hu(t,e){return Bt(t,Sr(t),e)}var vu=Object.getOwnPropertySymbols,mu=vu?function(t){for(var e=[];t;)yr(e,Sr(t)),t=_r(t);return e}:qn;const Kn=mu;function gu(t,e){return Bt(t,Kn(t),e)}function Xn(t,e,r){var n=e(t);return G(t)?n:yr(n,r(t))}function Or(t){return Xn(t,Le,Sr)}function jr(t){return Xn(t,ge,Kn)}var yu=Pt(dt,"DataView");const Cr=yu;var bu=Pt(dt,"Promise");const wr=bu;var _u=Pt(dt,"Set");const Wt=_u;var Zn="[object Map]",Su="[object Object]",to="[object Promise]",eo="[object Set]",ro="[object WeakMap]",no="[object DataView]",Ou=$t(Cr),ju=$t(be),Cu=$t(wr),wu=$t(Wt),Eu=$t(cr),Rt=Nt;(Cr&&Rt(new Cr(new ArrayBuffer(1)))!=no||be&&Rt(new be)!=Zn||wr&&Rt(wr.resolve())!=to||Wt&&Rt(new Wt)!=eo||cr&&Rt(new cr)!=ro)&&(Rt=function(t){var e=Nt(t),r=e==Su?t.constructor:void 0,n=r?$t(r):"";if(n)switch(n){case Ou:return no;case ju:return Zn;case Cu:return to;case wu:return eo;case Eu:return ro}return e});const _e=Rt;var Tu=Object.prototype,Nu=Tu.hasOwnProperty;function $u(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Nu.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Pu=dt.Uint8Array;const Be=Pu;function Er(t){var e=new t.constructor(t.byteLength);return new Be(e).set(new Be(t)),e}function Au(t,e){var r=e?Er(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Ru=/\w*$/;function Mu(t){var e=new t.constructor(t.source,Ru.exec(t));return e.lastIndex=t.lastIndex,e}var oo=ot?ot.prototype:void 0,ao=oo?oo.valueOf:void 0;function xu(t){return ao?Object(ao.call(t)):{}}function io(t,e){var r=e?Er(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Du="[object Boolean]",Iu="[object Date]",Lu="[object Map]",Fu="[object Number]",ku="[object RegExp]",Uu="[object Set]",Bu="[object String]",Vu="[object Symbol]",Gu="[object ArrayBuffer]",zu="[object DataView]",Wu="[object Float32Array]",Hu="[object Float64Array]",Yu="[object Int8Array]",Ju="[object Int16Array]",qu="[object Int32Array]",Qu="[object Uint8Array]",Ku="[object Uint8ClampedArray]",Xu="[object Uint16Array]",Zu="[object Uint32Array]";function tl(t,e,r){var n=t.constructor;switch(e){case Gu:return Er(t);case Du:case Iu:return new n(+t);case zu:return Au(t,r);case Wu:case Hu:case Yu:case Ju:case qu:case Qu:case Ku:case Xu:case Zu:return io(t,r);case Lu:return new n;case Fu:case Bu:return new n(t);case ku:return Mu(t);case Uu:return new n;case Vu:return xu(t)}}function so(t){return typeof t.constructor=="function"&&!dr(t)?Gi(_r(t)):{}}var el="[object Map]";function rl(t){return pt(t)&&_e(t)==el}var co=Vt&&Vt.isMap,nl=co?pr(co):rl;const ol=nl;var al="[object Set]";function il(t){return pt(t)&&_e(t)==al}var uo=Vt&&Vt.isSet,sl=uo?pr(uo):il;const cl=sl;var ul=1,ll=2,fl=4,lo="[object Arguments]",dl="[object Array]",pl="[object Boolean]",hl="[object Date]",vl="[object Error]",fo="[object Function]",ml="[object GeneratorFunction]",gl="[object Map]",yl="[object Number]",po="[object Object]",bl="[object RegExp]",_l="[object Set]",Sl="[object String]",Ol="[object Symbol]",jl="[object WeakMap]",Cl="[object ArrayBuffer]",wl="[object DataView]",El="[object Float32Array]",Tl="[object Float64Array]",Nl="[object Int8Array]",$l="[object Int16Array]",Pl="[object Int32Array]",Al="[object Uint8Array]",Rl="[object Uint8ClampedArray]",Ml="[object Uint16Array]",xl="[object Uint32Array]",D={};D[lo]=D[dl]=D[Cl]=D[wl]=D[pl]=D[hl]=D[El]=D[Tl]=D[Nl]=D[$l]=D[Pl]=D[gl]=D[yl]=D[po]=D[bl]=D[_l]=D[Sl]=D[Ol]=D[Al]=D[Rl]=D[Ml]=D[xl]=!0,D[vl]=D[fo]=D[jl]=!1;function Se(t,e,r,n,o,a){var s,i=e&ul,c=e&ll,l=e&fl;if(r&&(s=o?r(t,n,o,a):r(t)),s!==void 0)return s;if(!ct(t))return t;var f=G(t);if(f){if(s=$u(t),!i)return Tn(t,s)}else{var p=_e(t),d=p==fo||p==ml;if(ve(t))return Jn(t,i);if(p==po||p==lo||d&&!o){if(s=c||d?{}:so(t),!i)return c?gu(t,cu(s,t)):hu(t,su(s,t))}else{if(!D[p])return o?t:{};s=tl(t,p,i)}}a||(a=new ut);var v=a.get(t);if(v)return v;a.set(t,s),cl(t)?t.forEach(function(O){s.add(Se(O,e,r,O,t,a))}):ol(t)&&t.forEach(function(O,N){s.set(N,Se(O,e,r,N,t,a))});var y=l?c?jr:Or:c?ge:Le,S=f?void 0:y(t);return ts(S||t,function(O,N){S&&(N=O,O=t[N]),lr(s,N,Se(O,e,r,N,t,a))}),s}var Dl=1,Il=4;function ho(t){return Se(t,Dl|Il)}var Ll="__lodash_hash_undefined__";function Fl(t){return this.__data__.set(t,Ll),this}function kl(t){return this.__data__.has(t)}function Oe(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new gt;++e<r;)this.add(t[e])}Oe.prototype.add=Oe.prototype.push=Fl,Oe.prototype.has=kl;function Ul(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function vo(t,e){return t.has(e)}var Bl=1,Vl=2;function mo(t,e,r,n,o,a){var s=r&Bl,i=t.length,c=e.length;if(i!=c&&!(s&&c>i))return!1;var l=a.get(t),f=a.get(e);if(l&&f)return l==e&&f==t;var p=-1,d=!0,v=r&Vl?new Oe:void 0;for(a.set(t,e),a.set(e,t);++p<i;){var y=t[p],S=e[p];if(n)var O=s?n(S,y,p,e,t,a):n(y,S,p,t,e,a);if(O!==void 0){if(O)continue;d=!1;break}if(v){if(!Ul(e,function(N,w){if(!vo(v,w)&&(y===N||o(y,N,r,n,a)))return v.push(w)})){d=!1;break}}else if(!(y===S||o(y,S,r,n,a))){d=!1;break}}return a.delete(t),a.delete(e),d}function Gl(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function Tr(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var zl=1,Wl=2,Hl="[object Boolean]",Yl="[object Date]",Jl="[object Error]",ql="[object Map]",Ql="[object Number]",Kl="[object RegExp]",Xl="[object Set]",Zl="[object String]",tf="[object Symbol]",ef="[object ArrayBuffer]",rf="[object DataView]",go=ot?ot.prototype:void 0,Nr=go?go.valueOf:void 0;function nf(t,e,r,n,o,a,s){switch(r){case rf:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ef:return!(t.byteLength!=e.byteLength||!a(new Be(t),new Be(e)));case Hl:case Yl:case Ql:return pe(+t,+e);case Jl:return t.name==e.name&&t.message==e.message;case Kl:case Zl:return t==e+"";case ql:var i=Gl;case Xl:var c=n&zl;if(i||(i=Tr),t.size!=e.size&&!c)return!1;var l=s.get(t);if(l)return l==e;n|=Wl,s.set(t,e);var f=mo(i(t),i(e),n,o,a,s);return s.delete(t),f;case tf:if(Nr)return Nr.call(t)==Nr.call(e)}return!1}var of=1,af=Object.prototype,sf=af.hasOwnProperty;function cf(t,e,r,n,o,a){var s=r&of,i=Or(t),c=i.length,l=Or(e),f=l.length;if(c!=f&&!s)return!1;for(var p=c;p--;){var d=i[p];if(!(s?d in e:sf.call(e,d)))return!1}var v=a.get(t),y=a.get(e);if(v&&y)return v==e&&y==t;var S=!0;a.set(t,e),a.set(e,t);for(var O=s;++p<c;){d=i[p];var N=t[d],w=e[d];if(n)var U=s?n(w,N,d,e,t,a):n(N,w,d,t,e,a);if(!(U===void 0?N===w||o(N,w,r,n,a):U)){S=!1;break}O||(O=d=="constructor")}if(S&&!O){var F=t.constructor,J=e.constructor;F!=J&&"constructor"in t&&"constructor"in e&&!(typeof F=="function"&&F instanceof F&&typeof J=="function"&&J instanceof J)&&(S=!1)}return a.delete(t),a.delete(e),S}var uf=1,yo="[object Arguments]",bo="[object Array]",Ve="[object Object]",lf=Object.prototype,_o=lf.hasOwnProperty;function ff(t,e,r,n,o,a){var s=G(t),i=G(e),c=s?bo:_e(t),l=i?bo:_e(e);c=c==yo?Ve:c,l=l==yo?Ve:l;var f=c==Ve,p=l==Ve,d=c==l;if(d&&ve(t)){if(!ve(e))return!1;s=!0,f=!1}if(d&&!f)return a||(a=new ut),s||vr(t)?mo(t,e,r,n,o,a):nf(t,e,c,r,n,o,a);if(!(r&uf)){var v=f&&_o.call(t,"__wrapped__"),y=p&&_o.call(e,"__wrapped__");if(v||y){var S=v?t.value():t,O=y?e.value():e;return a||(a=new ut),o(S,O,r,n,a)}}return d?(a||(a=new ut),cf(t,e,r,n,o,a)):!1}function $r(t,e,r,n,o){return t===e?!0:t==null||e==null||!pt(t)&&!pt(e)?t!==t&&e!==e:ff(t,e,r,n,$r,o)}var df=1,pf=2;function hf(t,e,r,n){var o=r.length,a=o,s=!n;if(t==null)return!a;for(t=Object(t);o--;){var i=r[o];if(s&&i[2]?i[1]!==t[i[0]]:!(i[0]in t))return!1}for(;++o<a;){i=r[o];var c=i[0],l=t[c],f=i[1];if(s&&i[2]){if(l===void 0&&!(c in t))return!1}else{var p=new ut;if(n)var d=n(l,f,c,t,e,p);if(!(d===void 0?$r(f,l,df|pf,n,p):d))return!1}}return!0}function So(t){return t===t&&!ct(t)}function vf(t){for(var e=Le(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,So(o)]}return e}function Oo(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function mf(t){var e=vf(t);return e.length==1&&e[0][2]?Oo(e[0][0],e[0][1]):function(r){return r===t||hf(r,t,e)}}function gf(t,e){return t!=null&&e in Object(t)}function yf(t,e,r){e=Gt(e,t);for(var n=-1,o=e.length,a=!1;++n<o;){var s=zt(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=o?a:(o=t==null?0:t.length,!!o&&fr(o)&&De(s,o)&&(G(t)||he(t)))}function bf(t,e){return t!=null&&yf(t,e,gf)}var _f=1,Sf=2;function Of(t,e){return mr(t)&&So(e)?Oo(zt(t),e):function(r){var n=Bn(r,t);return n===void 0&&n===e?bf(r,t):$r(e,n,_f|Sf)}}function jf(t){return function(e){return e==null?void 0:e[t]}}function Cf(t){return function(e){return Ue(e,t)}}function wf(t){return mr(t)?jf(zt(t)):Cf(t)}function Pr(t){return typeof t=="function"?t:t==null?ar:typeof t=="object"?G(t)?Of(t[0],t[1]):mf(t):wf(t)}function Ef(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 Tf=Ef();const Nf=Tf;function Ar(t,e,r){(r!==void 0&&!pe(t[e],r)||r===void 0&&!(e in t))&&ur(t,e,r)}function Rr(t){return pt(t)&&Ie(t)}function Mr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function $f(t){return Bt(t,ge(t))}function Pf(t,e,r,n,o,a,s){var i=Mr(t,r),c=Mr(e,r),l=s.get(c);if(l){Ar(t,r,l);return}var f=a?a(i,c,r+"",t,e,s):void 0,p=f===void 0;if(p){var d=G(c),v=!d&&ve(c),y=!d&&!v&&vr(c);f=c,d||v||y?G(i)?f=i:Rr(i)?f=Tn(i):v?(p=!1,f=Jn(c,!0)):y?(p=!1,f=io(c,!0)):f=[]:K(c)||he(c)?(f=i,he(i)?f=$f(i):(!ct(i)||ir(i))&&(f=so(c))):p=!1}p&&(s.set(c,f),o(f,c,n,a,s),s.delete(c)),Ar(t,r,f)}function jo(t,e,r,n,o){t!==e&&Nf(e,function(a,s){if(o||(o=new ut),ct(a))Pf(t,e,s,r,jo,n,o);else{var i=n?n(Mr(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),Ar(t,s,i)}},ge)}function Af(t,e,r){for(var n=-1,o=t==null?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1}function Co(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Rf(t,e){return e.length<2?t:Ue(t,tu(e,0,-1))}var Mf=ds(function(t,e,r){jo(t,e,r)});const wo=Mf;var xf="Expected a function";function Df(t){if(typeof t!="function")throw new TypeError(xf);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function If(t,e){return e=Gt(e,t),t=Rf(t,e),t==null||delete t[zt(Co(e))]}function Lf(t){return K(t)?void 0:t}var Ff=1,kf=2,Uf=4,Bf=Yc(function(t,e){var r={};if(t==null)return r;var n=!1;e=or(e,function(a){return a=Gt(a,t),n||(n=a.length>1),a}),Bt(t,jr(t),r),n&&(r=Se(r,Ff|kf|Uf,Lf));for(var o=e.length;o--;)If(r,e[o]);return r});const Eo=Bf;function Vf(t,e,r,n){if(!ct(t))return t;e=Gt(e,t);for(var o=-1,a=e.length,s=a-1,i=t;i!=null&&++o<a;){var c=zt(e[o]),l=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(o!=s){var f=i[c];l=n?n(f,c,i):void 0,l===void 0&&(l=ct(f)?f:De(e[o+1])?[]:{})}lr(i,c,l),i=i[c]}return t}function Gf(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var s=e[n],i=Ue(t,s);r(i,s)&&Vf(a,Gt(s,t),i)}return a}function zf(t,e){if(t==null)return{};var r=or(jr(t),function(n){return[n]});return e=Pr(e),Gf(t,r,function(n,o){return e(n,o[0])})}function Wf(t,e){return zf(t,Df(Pr(e)))}var Hf=1/0,Yf=Wt&&1/Tr(new Wt([,-0]))[1]==Hf?function(t){return new Wt(t)}:Wi;const Jf=Yf;var qf=200;function Qf(t,e,r){var n=-1,o=as,a=t.length,s=!0,i=[],c=i;if(r)s=!1,o=Af;else if(a>=qf){var l=e?null:Jf(t);if(l)return Tr(l);s=!1,o=vo,c=new Oe}else c=e?[]:i;t:for(;++n<a;){var f=t[n],p=e?e(f):f;if(f=r||f!==0?f:0,s&&p===p){for(var d=c.length;d--;)if(c[d]===p)continue t;e&&c.push(p),i.push(f)}else o(c,p,r)||(c!==i&&c.push(p),i.push(f))}return i}var Kf=An(function(t){var e=Co(t);return Rr(e)&&(e=void 0),Qf(br(t,1,Rr,!0),Pr(e))});const Xf=Kf;class To extends TypeError{constructor(e,r){let n;const{message:o,...a}=e,{path:s}=e,i=s.length===0?o:"At path: "+s.join(".")+" -- "+o;super(i),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>{var c;return(c=n)!=null?c:n=[e,...r()]}}}function Zf(t){return lt(t)&&typeof t[Symbol.iterator]=="function"}function lt(t){return typeof t=="object"&&t!=null}function et(t){return typeof t=="string"?JSON.stringify(t):""+t}function td(t){const{done:e,value:r}=t.next();return e?void 0:r}function ed(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:o,branch:a}=e,{type:s}=r,{refinement:i,message:c="Expected a value of type `"+s+"`"+(i?" with refinement `"+i+"`":"")+", but received: `"+et(n)+"`"}=t;return{value:n,type:s,refinement:i,key:o[o.length-1],path:o,branch:a,...t,message:c}}function*No(t,e,r,n){Zf(t)||(t=[t]);for(const o of t){const a=ed(o,e,r,n);a&&(yield a)}}function*xr(t,e,r){r===void 0&&(r={});const{path:n=[],branch:o=[t],coerce:a=!1,mask:s=!1}=r,i={path:n,branch:o};if(a&&(t=e.coercer(t,i),s&&e.type!=="type"&<(e.schema)&<(t)&&!Array.isArray(t)))for(const l in t)e.schema[l]===void 0&&delete t[l];let c="valid";for(const l of e.validator(t,i))c="not_valid",yield[l,void 0];for(let[l,f,p]of e.entries(t,i)){const d=xr(f,p,{path:l===void 0?n:[...n,l],branch:l===void 0?o:[...o,f],coerce:a,mask:s});for(const v of d)v[0]?(c=v[0].refinement!=null?"not_refined":"not_valid",yield[v[0],void 0]):a&&(f=v[1],l===void 0?t=f:t instanceof Map?t.set(l,f):t instanceof Set?t.add(f):lt(t)&&(t[l]=f))}if(c!=="not_valid")for(const l of e.refiner(t,i))c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,t])}class ht{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:r,schema:n,validator:o,refiner:a,coercer:s=c=>c,entries:i=function*(){}}=e;this.type=r,this.schema=n,this.entries=i,this.coercer=s,o?this.validator=(c,l)=>{const f=o(c,l);return No(f,l,this,c)}:this.validator=()=>[],a?this.refiner=(c,l)=>{const f=a(c,l);return No(f,l,this,c)}:this.refiner=()=>[]}assert(e){return $o(e,this)}create(e){return rd(e,this)}is(e){return od(e,this)}mask(e){return nd(e,this)}validate(e,r){return r===void 0&&(r={}),Ht(e,this,r)}}function $o(t,e){const r=Ht(t,e);if(r[0])throw r[0]}function rd(t,e){const r=Ht(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function nd(t,e){const r=Ht(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function od(t,e){return!Ht(t,e)[0]}function Ht(t,e,r){r===void 0&&(r={});const n=xr(t,e,r),o=td(n);return o[0]?[new To(o[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,o[1]]}function Dr(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=e[0].type==="type",o=e.map(s=>s.schema),a=Object.assign({},...o);return n?Mo(a):M(a)}function Ot(t,e){return new ht({type:t,schema:null,validator:e})}function Yt(t){return new ht({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function Po(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return Mo(n);default:return M(n)}}function z(){return Ot("any",()=>!0)}function V(t){return new ht({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||"Expected an array value, but received: "+et(e)}})}function Jt(){return Ot("boolean",t=>typeof t=="boolean")}function Ir(t){const e={},r=t.map(n=>et(n)).join();for(const n of t)e[n]=n;return new ht({type:"enums",schema:e,validator(n){return t.includes(n)||"Expected one of `"+r+"`, but received: "+et(n)}})}function Ao(){return Ot("func",t=>typeof t=="function"||"Expected a function, but received: "+et(t))}function X(t){const e=et(t),r=typeof t;return new ht({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||"Expected the literal `"+e+"`, but received: "+et(n)}})}function ad(){return Ot("never",()=>!1)}function Ro(){return Ot("number",t=>typeof t=="number"&&!isNaN(t)||"Expected a number, but received: "+et(t))}function M(t){const e=t?Object.keys(t):[],r=ad();return new ht({type:"object",schema:t||null,*entries(n){if(t&<(n)){const o=new Set(Object.keys(n));for(const a of e)o.delete(a),yield[a,n[a],t[a]];for(const a of o)yield[a,n[a],r]}},validator(n){return lt(n)||"Expected an object, but received: "+et(n)},coercer(n){return lt(n)?{...n}:n}})}function b(t){return new ht({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function je(t,e){return new ht({type:"record",schema:null,*entries(r){if(lt(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return lt(r)||"Expected an object, but received: "+et(r)}})}function g(){return Ot("string",t=>typeof t=="string"||"Expected a string, but received: "+et(t))}function Mo(t){const e=Object.keys(t);return new ht({type:"type",schema:t,*entries(r){if(lt(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return lt(r)||"Expected an object, but received: "+et(r)}})}function Z(t){const e=t.map(r=>r.type).join(" | ");return new ht({type:"union",schema:null,coercer(r,n){return(t.find(o=>{const[a]=o.validate(r,{coerce:!0});return!a})||id()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...s]=xr(r,a,n),[i]=s;if(i[0])for(const[c]of s)c&&o.push(c);else return[]}return["Expected the value to satisfy a union of `"+e+"`, but received: "+et(r),...o]}})}function id(){return Ot("unknown",()=>!0)}const Lr=M({package:g(),version:g(),name:g(),exportName:b(g()),destructuring:b(Jt()),subName:b(g()),main:b(g()),cssPaths:b(V(g()))}),sd=V(Lr),cd=["CBlock","CContainer","CImage","CCanvas","CVideo","CAudio","CText","CNativeTag"];var at=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t))(at||{}),Fr=(t=>(t.DESIGN="design",t.SAVE="save",t))(Fr||{}),kr=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(kr||{});const ud=()=>Ot("normalObj",t=>!K(t)||[at.SLOT,at.EXPRESSION,at.FUNCTION].includes(t==null?void 0:t.type)?!1:(Ht(t,je(g(),Ur)),!0)),Ur=Z([g(),Ro(),Jt(),M({type:X(at.SLOT),renderType:Ir([kr.FUNC,kr.COMP]),params:b(V(g())),value:Yt(()=>Z([qt,V(qt)]))}),M({type:X(at.EXPRESSION),value:g()}),M({type:X(at.FUNCTION),value:g()}),ud(),V(Yt(()=>Ur))]),xo=M({type:X(at.EXPRESSION),value:g()}),qt=M({id:b(g()),title:b(g()),componentName:g(),props:b(je(g(),Ur)),nodeName:b(g()),state:b(je(g(),z())),children:Yt(()=>b(V(Z([g(),qt])))),configure:b(z()),css:b(z()),style:b(z()),classNames:b(V(z())),refId:b(g()),extra:b(je(z(),z())),condition:b(Z([Jt(),xo])),loop:b(M({open:Jt(),data:Z([V(z()),xo]),args:b(V(g())),forName:b(g()),forIndex:b(g()),key:b(z()),name:b(g())})),methods:b(V(z()))}),Ge=Z([g(),M({label:g(),tip:b(g())})]),ld=M({type:X("shape"),value:V(M({name:g(),title:Ge,valueType:Yt(()=>ze)}))}),fd=M({type:X("enums"),value:V(g())});M({type:X("array"),value:Yt(()=>ze)});const dd=M({type:X("array"),value:Yt(()=>V(ze))}),ze=Z([Ir(["array","boolean","number","object","string"]),Ir(["component","expression","function"]),ld,fd,dd]),pd=Z([g(),M({componentName:g(),props:b(z()),initialValue:b(z()),component:b(z())})]),Br=M({name:g(),title:Ge,valueType:ze,description:b(g()),defaultValue:z(),setters:b(V(pd)),condition:b(Ao())});Z([g(),Ao()]);var Vr=(t=>(t.SINGLE="single",t.GROUP="group",t))(Vr||{});Z([g(),M({name:g(),describe:b(g()),params:b(M({name:g(),description:g()})),template:g()})]);const hd=M({id:b(g()),title:g(),snapshot:Z([g(),z()]),snapshotText:b(g()),description:b(g()),tags:b(V(g())),groupName:b(g()),category:b(g()),schema:Dr(Po(qt,["id"]),M({componentName:b(g())}))}),vd=M({componentName:g(),title:g(),screenshot:b(g()),icon:b(g()),tags:b(V(g())),groupName:b(g()),category:b(g()),priority:b(Ro()),npm:b(Lr),snippets:V(hd),props:V(Z([Br,M({title:b(Ge),type:X("single"),content:Br}),M({title:b(Ge),type:X("group"),content:V(Br)})])),fixedProps:b(z()),isContainer:b(Z([Jt(),M({placeholder:g(),width:g(),height:g()})])),disableEditorDragDom:b(z()),isLayout:b(Jt()),rootSelector:b(g()),advanceCustom:b(z()),extra:b(je(z(),z()))}),md=t=>({data:e,message:r,throwError:n})=>{const o=t({data:e,message:r,throwError:n});if(o.isValidate)return o;if(n)throw o.message||r?new Error(`${o.message||r}
|
|
2
2
|
originData: ${JSON.stringify(e)}`):new Error(`${JSON.stringify(e)}
|
|
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
|
-
data struct format is invalidate`),o},
|
|
6
|
-
`)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var $t=(t=>(t.ROOT_CONTAINER="RootContainer",t))($t||{});const wf=w({type:B(G.FUNCTION),value:h()}),Ef=ar(Kn(Tt,["componentName"]),w({componentName:B("RootContainer")}));function Nf(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=Nf(),Tf=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new mt([]);return e&&(o=e.materialsMode||new mt([])),n&&(I(n)?r.value=n.map(a=>new A(a,{parent:e,materials:o})):F(n)&&r.value.push(new A(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 mt([]);this.materialsMode=n,this.id=X(),this.data=Tf(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof A)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 ro=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===dr.SINGLE?e.push(n.content):n.type===dr.GROUP&&(e=[...e,...ro(n.content)]):e.push(r)}),e},hr=(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]=mr(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>hr(n,e,r)):t},mr=(t,e,r)=>F(t)?hr(t,e,r):I(t)?t.map(n=>hr(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 mt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=mr(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=mr(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 A){const r=e.material;return ro((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 A)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 $f=t=>{if(typeof t=="string")return!0;pr({data:t,dataStruct:Tt,throwError:!1})},no=(t,e,r=new mt([]))=>{if(typeof t=="string")return t;const n={...t,id:t.id??X(),children:[],props:{},methods:t.methods||[],configure:Jn(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(F(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)),$f(e);const n=(r==null?void 0:r.materials)||new mt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=no(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||X()};return new A(r,{materials:this.materialsModel})}updateValue(e){const r=this.data,n={...this.data,...e};this.data=no(n,this),this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return yr(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=un(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};return e==="design"&&delete u.id,u=gr(u),u}}const oo=(t,e,r)=>{const n={...t,id:X(),props:{},componentName:$t.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:Jn(t.configure||{},{propsSetter:{},advanceSetter:{}})};let o=[];I(t.children)?o=t.children.map(s=>s instanceof A?s:F(s)?new A(s,{parent:e,materials:r}):s):t.children instanceof A?o.push(t.children):t.children&&F(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",$t.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=oo(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)}updateValue(e){const r=this.data,n={...this.data,...e};this.data=oo(n,this,this.materialsModel),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return yr(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=cr.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)};let i=Wn(s,["id"]);return i=gr(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||X()};return new Xt(r,{materials:this.materialsModel,parent:null})}}const ht=t=>(t==null?void 0:t.type)===G.EXPRESSION,Af=t=>(t==null?void 0:t.type)===G.FUNCTION,X=()=>Math.random().toString(32).slice(3,9),Mf=t=>(t==null?void 0:t.nodeType)==="NODE",vr=t=>(t==null?void 0:t.nodeType)==="PROP",Pf=t=>(t==null?void 0:t.nodeType)==="SLOT",gr=t=>Xl(t,e=>F(e)?!Object.keys(e).length:I(e)?!e.length:!e);function Df(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 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 A))||[];r.push(...s)}}function yr(t,e){return Df(t,r=>r.id===e)}const If=t=>{const e=xn(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${X()}`,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 xf{constructor(e){j(this,"rawData"),j(this,"data"),this.rawData=e,this.data=If(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 Rf=t=>{if(!I(t))throw new Error("Materials must be a array");return t.map(e=>new xf(e))},Lf=t=>{t==null||t.forEach(e=>{pr({data:e,dataStruct:Of,throwError:!1})})};class mt{constructor(e){j(this,"rawData"),j(this,"data"),j(this,"usedMaterials",[]),this.rawData=e,Lf(e),this.data=Rf(e)}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(){let e=this.data.reduce((a,s)=>(a.push(...s.snippets),a),[]);const r=[],n={default:[]};e=e.sort((a,s)=>(a.category||"")>(s.category||"")?1:-1),e.forEach(a=>{const s=a.groupName||"default";r.includes(s)||(r.push(s),n[s]=[]),n[s].push(a)});const 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}get value(){return this.data}get rawValue(){return this.rawData}}const Ff=w({version:h(),name:h(),css:m(h()),renderType:m(U([B("COMPONENT"),B("PAGE")])),methods:m(P(wf)),componentsMeta:P(ar(w({componentName:h()}),sr)),thirdLibs:m(mf),componentsTree:Ef,assets:m(P(x()))}),ao=t=>(pr({data:t,dataStruct:Ff,throwError:!1}),t),br=(t,e,r)=>({...t,componentsTree:new Xt(t.componentsTree,{parent:e,materials:r})});class ge{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"),ao(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new mt((r==null?void 0:r.materials)||[]),this.data=br(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=br(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=br(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 yr(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 ge)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 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=X();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 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 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=cr.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,...xn(c.value.npm||{})}}).filter(c=>!!(c.componentName&&c.package&&c.version));this.materialsModel.usedMaterials=[];let i={...this.data,componentsTree:gr(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=af(a,c=>c.package),i=Wn(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}$t.ROOT_CONTAINER;var Bf=typeof global=="object"&&global&&global.Object===Object&&global;const io=Bf;var Uf=typeof self=="object"&&self&&self.Object===Object&&self,kf=io||Uf||Function("return this")();const Mt=kf;var Vf=Mt.Symbol;const Pt=Vf;var so=Object.prototype,Gf=so.hasOwnProperty,zf=so.toString,Zt=Pt?Pt.toStringTag:void 0;function Hf(t){var e=Gf.call(t,Zt),r=t[Zt];try{t[Zt]=void 0;var n=!0}catch{}var o=zf.call(t);return n&&(e?t[Zt]=r:delete t[Zt]),o}var Jf=Object.prototype,Wf=Jf.toString;function Qf(t){return Wf.call(t)}var qf="[object Null]",Yf="[object Undefined]",co=Pt?Pt.toStringTag:void 0;function te(t){return t==null?t===void 0?Yf:qf:co&&co in Object(t)?Hf(t):Qf(t)}function Dt(t){return t!=null&&typeof t=="object"}var Kf="[object Symbol]";function Xf(t){return typeof t=="symbol"||Dt(t)&&te(t)==Kf}function Zf(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 td=Array.isArray;const It=td;var ed=1/0,uo=Pt?Pt.prototype:void 0,lo=uo?uo.toString:void 0;function fo(t){if(typeof t=="string")return t;if(It(t))return Zf(t,fo)+"";if(Xf(t))return lo?lo.call(t):"";var e=t+"";return e=="0"&&1/t==-ed?"-0":e}function vt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function po(t){return t}var rd="[object AsyncFunction]",nd="[object Function]",od="[object GeneratorFunction]",ad="[object Proxy]";function _r(t){if(!vt(t))return!1;var e=te(t);return e==nd||e==od||e==rd||e==ad}var id=Mt["__core-js_shared__"];const Sr=id;var ho=function(){var t=/[^.]+$/.exec(Sr&&Sr.keys&&Sr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function sd(t){return!!ho&&ho in t}var cd=Function.prototype,ud=cd.toString;function ld(t){if(t!=null){try{return ud.call(t)}catch{}try{return t+""}catch{}}return""}var fd=/[\\^$.*+?()[\]{}|]/g,dd=/^\[object .+?Constructor\]$/,pd=Function.prototype,hd=Object.prototype,md=pd.toString,vd=hd.hasOwnProperty,gd=RegExp("^"+md.call(vd).replace(fd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yd(t){if(!vt(t)||sd(t))return!1;var e=_r(t)?gd:dd;return e.test(ld(t))}function bd(t,e){return t==null?void 0:t[e]}function jr(t,e){var r=bd(t,e);return yd(r)?r:void 0}var mo=Object.create,_d=function(){function t(){}return function(e){if(!vt(e))return{};if(mo)return mo(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const Sd=_d;function jd(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 Od(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Cd=800,wd=16,Ed=Date.now;function Nd(t){var e=0,r=0;return function(){var n=Ed(),o=wd-(n-r);if(r=n,o>0){if(++e>=Cd)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Td(t){return function(){return t}}var $d=function(){try{var t=jr(Object,"defineProperty");return t({},"",{}),t}catch{}}();const ye=$d;var Ad=ye?function(t,e){return ye(t,"toString",{configurable:!0,enumerable:!1,value:Td(e),writable:!0})}:po,Md=Nd(Ad);const Pd=Md;var Dd=9007199254740991,Id=/^(?:0|[1-9]\d*)$/;function vo(t,e){var r=typeof t;return e=e??Dd,!!e&&(r=="number"||r!="symbol"&&Id.test(t))&&t>-1&&t%1==0&&t<e}function Or(t,e,r){e=="__proto__"&&ye?ye(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function be(t,e){return t===e||t!==t&&e!==e}var xd=Object.prototype,Rd=xd.hasOwnProperty;function Ld(t,e,r){var n=t[e];(!(Rd.call(t,e)&&be(n,r))||r===void 0&&!(e in t))&&Or(t,e,r)}function Fd(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?Or(r,i,c):Ld(r,i,c)}return r}var go=Math.max;function Bd(t,e,r){return e=go(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=go(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),jd(t,this,i)}}function Ud(t,e){return Pd(Bd(t,e,po),t+"")}var kd=9007199254740991;function yo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=kd}function Cr(t){return t!=null&&yo(t.length)&&!_r(t)}function Vd(t,e,r){if(!vt(r))return!1;var n=typeof e;return(n=="number"?Cr(r)&&vo(e,r.length):n=="string"&&e in r)?be(r[e],t):!1}function Gd(t){return Ud(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&&Vd(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 zd=Object.prototype;function bo(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||zd;return t===r}function Hd(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Jd="[object Arguments]";function _o(t){return Dt(t)&&te(t)==Jd}var So=Object.prototype,Wd=So.hasOwnProperty,Qd=So.propertyIsEnumerable,qd=_o(function(){return arguments}())?_o:function(t){return Dt(t)&&Wd.call(t,"callee")&&!Qd.call(t,"callee")};const wr=qd;function Yd(){return!1}var jo=typeof g=="object"&&g&&!g.nodeType&&g,Oo=jo&&typeof module=="object"&&module&&!module.nodeType&&module,Kd=Oo&&Oo.exports===jo,Co=Kd?Mt.Buffer:void 0,Xd=Co?Co.isBuffer:void 0,Zd=Xd||Yd;const wo=Zd;var tp="[object Arguments]",ep="[object Array]",rp="[object Boolean]",np="[object Date]",op="[object Error]",ap="[object Function]",ip="[object Map]",sp="[object Number]",cp="[object Object]",up="[object RegExp]",lp="[object Set]",fp="[object String]",dp="[object WeakMap]",pp="[object ArrayBuffer]",hp="[object DataView]",mp="[object Float32Array]",vp="[object Float64Array]",gp="[object Int8Array]",yp="[object Int16Array]",bp="[object Int32Array]",_p="[object Uint8Array]",Sp="[object Uint8ClampedArray]",jp="[object Uint16Array]",Op="[object Uint32Array]",$={};$[mp]=$[vp]=$[gp]=$[yp]=$[bp]=$[_p]=$[Sp]=$[jp]=$[Op]=!0,$[tp]=$[ep]=$[pp]=$[rp]=$[hp]=$[np]=$[op]=$[ap]=$[ip]=$[sp]=$[cp]=$[up]=$[lp]=$[fp]=$[dp]=!1;function Cp(t){return Dt(t)&&yo(t.length)&&!!$[te(t)]}function wp(t){return function(e){return t(e)}}var Eo=typeof g=="object"&&g&&!g.nodeType&&g,ee=Eo&&typeof module=="object"&&module&&!module.nodeType&&module,Ep=ee&&ee.exports===Eo,Er=Ep&&io.process,Np=function(){try{var t=ee&&ee.require&&ee.require("util").types;return t||Er&&Er.binding&&Er.binding("util")}catch{}}();const No=Np;var To=No&&No.isTypedArray,Tp=To?wp(To):Cp;const $o=Tp;var $p=Object.prototype,Ap=$p.hasOwnProperty;function Mp(t,e){var r=It(t),n=!r&&wr(t),o=!r&&!n&&wo(t),a=!r&&!n&&!o&&$o(t),s=r||n||o||a,i=s?Hd(t.length,String):[],c=i.length;for(var u in t)(e||Ap.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||vo(u,c)))&&i.push(u);return i}function Pp(t,e){return function(r){return t(e(r))}}function Dp(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Ip=Object.prototype,xp=Ip.hasOwnProperty;function Rp(t){if(!vt(t))return Dp(t);var e=bo(t),r=[];for(var n in t)n=="constructor"&&(e||!xp.call(t,n))||r.push(n);return r}function Ao(t){return Cr(t)?Mp(t,!0):Rp(t)}var Lp=jr(Object,"create");const re=Lp;function Fp(){this.__data__=re?re(null):{},this.size=0}function Bp(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Up="__lodash_hash_undefined__",kp=Object.prototype,Vp=kp.hasOwnProperty;function Gp(t){var e=this.__data__;if(re){var r=e[t];return r===Up?void 0:r}return Vp.call(e,t)?e[t]:void 0}var zp=Object.prototype,Hp=zp.hasOwnProperty;function Jp(t){var e=this.__data__;return re?e[t]!==void 0:Hp.call(e,t)}var Wp="__lodash_hash_undefined__";function Qp(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=re&&e===void 0?Wp:e,this}function gt(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])}}gt.prototype.clear=Fp,gt.prototype.delete=Bp,gt.prototype.get=Gp,gt.prototype.has=Jp,gt.prototype.set=Qp;function qp(){this.__data__=[],this.size=0}function _e(t,e){for(var r=t.length;r--;)if(be(t[r][0],e))return r;return-1}var Yp=Array.prototype,Kp=Yp.splice;function Xp(t){var e=this.__data__,r=_e(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Kp.call(e,r,1),--this.size,!0}function Zp(t){var e=this.__data__,r=_e(e,t);return r<0?void 0:e[r][1]}function th(t){return _e(this.__data__,t)>-1}function eh(t,e){var r=this.__data__,n=_e(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=qp,nt.prototype.delete=Xp,nt.prototype.get=Zp,nt.prototype.has=th,nt.prototype.set=eh;var rh=jr(Mt,"Map");const Mo=rh;function nh(){this.size=0,this.__data__={hash:new gt,map:new(Mo||nt),string:new gt}}function oh(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Se(t,e){var r=t.__data__;return oh(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ah(t){var e=Se(this,t).delete(t);return this.size-=e?1:0,e}function ih(t){return Se(this,t).get(t)}function sh(t){return Se(this,t).has(t)}function ch(t,e){var r=Se(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function xt(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])}}xt.prototype.clear=nh,xt.prototype.delete=ah,xt.prototype.get=ih,xt.prototype.has=sh,xt.prototype.set=ch;function Po(t){return t==null?"":fo(t)}var uh=Pp(Object.getPrototypeOf,Object);const Do=uh;var lh="[object Object]",fh=Function.prototype,dh=Object.prototype,Io=fh.toString,ph=dh.hasOwnProperty,hh=Io.call(Object);function Rt(t){if(!Dt(t)||te(t)!=lh)return!1;var e=Do(t);if(e===null)return!0;var r=ph.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Io.call(r)==hh}function mh(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 vh(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:mh(t,e,r)}var gh="\\ud800-\\udfff",yh="\\u0300-\\u036f",bh="\\ufe20-\\ufe2f",_h="\\u20d0-\\u20ff",Sh=yh+bh+_h,jh="\\ufe0e\\ufe0f",Oh="\\u200d",Ch=RegExp("["+Oh+gh+Sh+jh+"]");function xo(t){return Ch.test(t)}function wh(t){return t.split("")}var Ro="\\ud800-\\udfff",Eh="\\u0300-\\u036f",Nh="\\ufe20-\\ufe2f",Th="\\u20d0-\\u20ff",$h=Eh+Nh+Th,Ah="\\ufe0e\\ufe0f",Mh="["+Ro+"]",Nr="["+$h+"]",Tr="\\ud83c[\\udffb-\\udfff]",Ph="(?:"+Nr+"|"+Tr+")",Lo="[^"+Ro+"]",Fo="(?:\\ud83c[\\udde6-\\uddff]){2}",Bo="[\\ud800-\\udbff][\\udc00-\\udfff]",Dh="\\u200d",Uo=Ph+"?",ko="["+Ah+"]?",Ih="(?:"+Dh+"(?:"+[Lo,Fo,Bo].join("|")+")"+ko+Uo+")*",xh=ko+Uo+Ih,Rh="(?:"+[Lo+Nr+"?",Nr,Fo,Bo,Mh].join("|")+")",Lh=RegExp(Tr+"(?="+Tr+")|"+Rh+xh,"g");function Fh(t){return t.match(Lh)||[]}function Bh(t){return xo(t)?Fh(t):wh(t)}function Uh(t){return function(e){e=Po(e);var r=xo(e)?Bh(e):void 0,n=r?r[0]:e.charAt(0),o=r?vh(r,1).join(""):e.slice(1);return n[t]()+o}}var kh=Uh("toUpperCase");const Vh=kh;function Gh(t){return Vh(Po(t).toLowerCase())}function zh(){this.__data__=new nt,this.size=0}function Hh(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Jh(t){return this.__data__.get(t)}function Wh(t){return this.__data__.has(t)}var Qh=200;function qh(t,e){var r=this.__data__;if(r instanceof nt){var n=r.__data__;if(!Mo||n.length<Qh-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new xt(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=zh,Lt.prototype.delete=Hh,Lt.prototype.get=Jh,Lt.prototype.has=Wh,Lt.prototype.set=qh;var Vo=typeof g=="object"&&g&&!g.nodeType&&g,Go=Vo&&typeof module=="object"&&module&&!module.nodeType&&module,Yh=Go&&Go.exports===Vo,zo=Yh?Mt.Buffer:void 0,Ho=zo?zo.allocUnsafe:void 0;function Kh(t,e){if(e)return t.slice();var r=t.length,n=Ho?Ho(r):new t.constructor(r);return t.copy(n),n}var Xh=Mt.Uint8Array;const Jo=Xh;function Zh(t){var e=new t.constructor(t.byteLength);return new Jo(e).set(new Jo(t)),e}function tm(t,e){var r=e?Zh(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function em(t){return typeof t.constructor=="function"&&!bo(t)?Sd(Do(t)):{}}function rm(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 nm=rm();const om=nm;function $r(t,e,r){(r!==void 0&&!be(t[e],r)||r===void 0&&!(e in t))&&Or(t,e,r)}function am(t){return Dt(t)&&Cr(t)}function Ar(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function im(t){return Fd(t,Ao(t))}function sm(t,e,r,n,o,a,s){var i=Ar(t,r),c=Ar(e,r),u=s.get(c);if(u){$r(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&&wo(c),v=!f&&!p&&$o(c);l=c,f||p||v?It(i)?l=i:am(i)?l=Od(i):p?(d=!1,l=Kh(c,!0)):v?(d=!1,l=tm(c,!0)):l=[]:Rt(c)||wr(c)?(l=i,wr(i)?l=im(i):(!vt(i)||_r(i))&&(l=em(c))):d=!1}d&&(s.set(c,l),o(l,c,n,a,s),s.delete(c)),$r(t,r,l)}function Wo(t,e,r,n,o){t!==e&&om(e,function(a,s){if(o||(o=new Lt),vt(a))sm(t,e,s,r,Wo,n,o);else{var i=n?n(Ar(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),$r(t,s,i)}},Ao)}var cm=Gd(function(t,e,r){Wo(t,e,r)});const um=cm,lm=function(t){return!(!t||typeof t!="function"||!t.prototype)};function Qo(t){const e=t.prototype;return!!(e&&e.isReactComponent)}function qo(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 Yo(t){class e extends S.Component{render(){return S.createElement(t,this.props)}}return e.displayName=t.displayName,e}const yt=(t,e)=>{const r=n=>{const a=`
|
|
5
|
+
data struct format is invalidate`),o},Gr=t=>{const{data:e,message:r,throwError:n,dataStruct:o}=t;return md(({data:a})=>{try{return $o(a,o),{isValidate:!0}}catch(s){let i=s;return s instanceof To&&(i=s.failures().map(c=>`【${c.path.join(".")}】: ${c.message}
|
|
6
|
+
`)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var Qt=(t=>(t.ROOT_CONTAINER="RootContainer",t))(Qt||{});const gd=M({type:X(at.FUNCTION),value:g()}),yd=Dr(Po(qt,["componentName"]),M({componentName:X("RootContainer")}));function bd(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 Ce=bd(),_d=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new xt([]);return e&&(o=e.materialsMode||new xt([])),n&&(G(n)?r.value=n.map(a=>new k(a,{parent:e,materials:o})):K(n)&&r.value.push(new k(n,{parent:e,materials:o}))),r};class Kt{constructor(e,r){T(this,"nodeType","SLOT"),T(this,"rawData"),T(this,"parent"),T(this,"emitter",Ce),T(this,"data"),T(this,"id"),T(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new xt([]);this.materialsMode=n,this.id=vt(),this.data=_d(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof k)return o.export(e);if(K(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return G(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const Do=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===Vr.SINGLE?e.push(n.content):n.type===Vr.GROUP&&(e=[...e,...Do(n.content)]):e.push(r)}),e},zr=(t,e,r)=>{if(t.type)return t.type===at.SLOT?new Kt(t,{parent:e,materials:r}):t;if(K(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=Wr(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>zr(n,e,r)):t},Wr=(t,e,r)=>K(t)?zr(t,e,r):G(t)?t.map(n=>zr(n,e,r)):t;class jt{constructor(e,r,n){T(this,"nodeType","PROP"),T(this,"rawData"),T(this,"parent"),T(this,"emitter",Ce),T(this,"data"),T(this,"name"),T(this,"materialsMode");const o=(n==null?void 0:n.materials)||new xt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=Wr(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=Wr(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof Kt)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof k){const r=e.material;return Do((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 jt||o instanceof Kt||o instanceof k)return o.export(e);if(G(o))return o.map(a=>n(a));if(K(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return o};return n(r)}}const Sd=t=>{if(typeof t=="string")return!0;Gr({data:t,dataStruct:qt,throwError:!1})},Io=(t,e,r=new xt([]))=>{if(typeof t=="string")return t;const n={...t,id:t.id??vt(),children:[],props:{},methods:t.methods||[],configure:wo(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 jt){n.props[a]=i;return}n.props[a]=new jt(a,i||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof k)return a;if(K(a)){const s=a;return new k(s,{parent:e,materials:r})}else return a}):(t.children instanceof k&&(n.children=[t.children]),n.children=[new k(t.children,{parent:e,materials:r})])),n};class k{constructor(e,r){T(this,"nodeType","NODE"),T(this,"rawData"),T(this,"data"),T(this,"emitter",Ce),T(this,"parent"),T(this,"materialsModel"),T(this,"listenerHandle"),T(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Sd(e);const n=(r==null?void 0:r.materials)||new xt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=Io(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||vt()};return new k(r,{materials:this.materialsModel})}updateValue(e){const r=this.data,n={...this.data,...e};this.data=Io(n,this),this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return Jr(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(f=>{o[f]=n.props[f].export(e)});const a=(r=n.children)==null?void 0:r.map(f=>f instanceof k?f.export(e):f),s=n.configure||{},i=s.propsSetter||{},c={};Object.keys(i).forEach(f=>{const p=Bn(i,f,!1);p&&(c[f]=p)}),s.propsSetter=c,this.material&&this.materialsModel.usedMaterials.push(this.material);let l={...n,configure:s,props:o,children:a};return e==="design"&&delete l.id,l=Yr(l),l}}const Lo=(t,e,r)=>{const n={...t,id:vt(),props:{},componentName:Qt.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:wo(t.configure||{},{propsSetter:{},advanceSetter:{}})};let o=[];G(t.children)?o=t.children.map(s=>s instanceof k?s:K(s)?new k(s,{parent:e,materials:r}):s):t.children instanceof k?o.push(t.children):t.children&&K(t.children)&&o.push(new k(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 jt?n.props[s]=c:n.props[s]=new jt(s,c||"",{parent:e,materials:r})}),n.children=o,n};class we{constructor(e,{parent:r,materials:n}){T(this,"rawData"),T(this,"data"),T(this,"nodeType",Qt.ROOT_CONTAINER),T(this,"emitter",Ce),T(this,"materialsModel"),T(this,"listenerHandle"),T(this,"onChangeCbQueue"),T(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=Lo(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)}updateValue(e){const r=this.data,n={...this.data,...e};this.data=Lo(n,this,this.materialsModel),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return Jr(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=Fr.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 l;return(l=c==null?void 0:c.export)==null?void 0:l.call(c,e)}))||[],s={...n,props:o,children:a.filter(c=>c)};let i=Eo(s,["id"]);return i=Yr(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||vt()};return new we(r,{materials:this.materialsModel,parent:null})}}const Mt=t=>(t==null?void 0:t.type)===at.EXPRESSION,Od=t=>(t==null?void 0:t.type)===at.FUNCTION,vt=()=>Math.random().toString(32).slice(3,9),jd=t=>(t==null?void 0:t.nodeType)==="NODE",Hr=t=>(t==null?void 0:t.nodeType)==="PROP",Cd=t=>(t==null?void 0:t.nodeType)==="SLOT",Yr=t=>Wf(t,e=>K(e)?!Object.keys(e).length:G(e)?!e.length:!e);function wd(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 k){r.push(i);return}if(i instanceof Kt&&a(i.value.value),i instanceof jt){a(i.value);return}if(K(i)){const c=i;Object.keys(c).forEach(l=>{a(c[l])});return}if(G(i)){i.forEach(c=>{a(c)});return}};a(o);const s=(n==null?void 0:n.value.children.filter(i=>i instanceof k))||[];r.push(...s)}}function Jr(t,e){return wd(t,r=>r.id===e)}const Ed=t=>{const e=ho(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${vt()}`,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 Td{constructor(e){T(this,"rawData"),T(this,"data"),this.rawData=e,this.data=Ed(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 Nd=t=>{if(!G(t))throw new Error("Materials must be a array");return t.map(e=>new Td(e))},$d=t=>{t==null||t.forEach(e=>{Gr({data:e,dataStruct:vd,throwError:!1})})};class xt{constructor(e){T(this,"rawData"),T(this,"data"),T(this,"usedMaterials",[]),this.rawData=e,$d(e),this.data=Nd(e)}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(){let e=this.data.reduce((a,s)=>(a.push(...s.snippets),a),[]);const r=[],n={default:[]};e=e.sort((a,s)=>(a.category||"")>(s.category||"")?1:-1),e.forEach(a=>{const s=a.groupName||"default";r.includes(s)||(r.push(s),n[s]=[]),n[s].push(a)});const o=[];return r.forEach(a=>{const s=["default"],i={default:[]},c=n[a];if(c.length!==0){c.forEach(p=>{const d=p.category||"default";s.includes(d)||(s.push(d),i[d]=[]),i[d].push(p)});const l=[];s.forEach(p=>{i[p].length&&l.push({name:p,list:i[p]})});const f={name:a,list:l};o.push(f)}}),o}get value(){return this.data}get rawValue(){return this.rawData}}const Pd=M({version:g(),name:g(),css:b(g()),renderType:b(Z([X("COMPONENT"),X("PAGE")])),methods:b(V(gd)),componentsMeta:V(Dr(M({componentName:g()}),Lr)),thirdLibs:b(sd),componentsTree:yd,assets:b(V(z()))}),Fo=t=>(Gr({data:t,dataStruct:Pd,throwError:!1}),t),qr=(t,e,r)=>({...t,componentsTree:new we(t.componentsTree,{parent:e,materials:r})});class We{constructor(e,r){T(this,"nodeType","PAGE"),T(this,"rawData"),T(this,"emitter",Ce),T(this,"data"),T(this,"parent"),T(this,"materialsModel"),T(this,"assetPackagesList"),Fo(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new xt((r==null?void 0:r.materials)||[]),this.data=qr(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=qr(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=qr(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 Jr(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof we)return console.warn("Not found parent node"),!1;if(a instanceof jt)return console.warn("CProp can not add node"),!1;if(a instanceof Kt){const i=a.value.value,c=i.findIndex(l=>l===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 We)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(K(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 k(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=vt();const n=new k(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 k?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 k&&a instanceof k?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 Kt){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 k||n instanceof we){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=Fr.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],s=this.materialsModel.usedMaterials.map(c=>{const l=o.find(f=>{var p;return f.package===((p=c.value.npm)==null?void 0:p.package)});return l&&a.push(l),{componentName:c.componentName,...ho(c.value.npm||{})}}).filter(c=>!!(c.componentName&&c.package&&c.version));this.materialsModel.usedMaterials=[];let i={...this.data,componentsTree:Yr(n),componentsMeta:s,thirdLibs:this.data.thirdLibs,assets:[]};return(r=this.data.thirdLibs)==null||r.forEach(c=>{const l=o.find(f=>c.package===f.package);l&&a.push(l)}),i.assets=Xf(a,c=>c.package),i=Eo(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}Qt.ROOT_CONTAINER;var Ad=typeof global=="object"&&global&&global.Object===Object&&global;const ko=Ad;var Rd=typeof self=="object"&&self&&self.Object===Object&&self,Md=ko||Rd||Function("return this")();const Xt=Md;var xd=Xt.Symbol;const Zt=xd;var Uo=Object.prototype,Dd=Uo.hasOwnProperty,Id=Uo.toString,Ee=Zt?Zt.toStringTag:void 0;function Ld(t){var e=Dd.call(t,Ee),r=t[Ee];try{t[Ee]=void 0;var n=!0}catch{}var o=Id.call(t);return n&&(e?t[Ee]=r:delete t[Ee]),o}var Fd=Object.prototype,kd=Fd.toString;function Ud(t){return kd.call(t)}var Bd="[object Null]",Vd="[object Undefined]",Bo=Zt?Zt.toStringTag:void 0;function Te(t){return t==null?t===void 0?Vd:Bd:Bo&&Bo in Object(t)?Ld(t):Ud(t)}function te(t){return t!=null&&typeof t=="object"}var Gd="[object Symbol]";function zd(t){return typeof t=="symbol"||te(t)&&Te(t)==Gd}function Wd(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 Hd=Array.isArray;const ee=Hd;var Yd=1/0,Vo=Zt?Zt.prototype:void 0,Go=Vo?Vo.toString:void 0;function zo(t){if(typeof t=="string")return t;if(ee(t))return Wd(t,zo)+"";if(zd(t))return Go?Go.call(t):"";var e=t+"";return e=="0"&&1/t==-Yd?"-0":e}function Dt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Wo(t){return t}var Jd="[object AsyncFunction]",qd="[object Function]",Qd="[object GeneratorFunction]",Kd="[object Proxy]";function Qr(t){if(!Dt(t))return!1;var e=Te(t);return e==qd||e==Qd||e==Jd||e==Kd}var Xd=Xt["__core-js_shared__"];const Kr=Xd;var Ho=function(){var t=/[^.]+$/.exec(Kr&&Kr.keys&&Kr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Zd(t){return!!Ho&&Ho in t}var tp=Function.prototype,ep=tp.toString;function rp(t){if(t!=null){try{return ep.call(t)}catch{}try{return t+""}catch{}}return""}var np=/[\\^$.*+?()[\]{}|]/g,op=/^\[object .+?Constructor\]$/,ap=Function.prototype,ip=Object.prototype,sp=ap.toString,cp=ip.hasOwnProperty,up=RegExp("^"+sp.call(cp).replace(np,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function lp(t){if(!Dt(t)||Zd(t))return!1;var e=Qr(t)?up:op;return e.test(rp(t))}function fp(t,e){return t==null?void 0:t[e]}function Xr(t,e){var r=fp(t,e);return lp(r)?r:void 0}var Yo=Object.create,dp=function(){function t(){}return function(e){if(!Dt(e))return{};if(Yo)return Yo(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const pp=dp;function hp(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 vp(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var mp=800,gp=16,yp=Date.now;function bp(t){var e=0,r=0;return function(){var n=yp(),o=gp-(n-r);if(r=n,o>0){if(++e>=mp)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function _p(t){return function(){return t}}var Sp=function(){try{var t=Xr(Object,"defineProperty");return t({},"",{}),t}catch{}}();const He=Sp;var Op=He?function(t,e){return He(t,"toString",{configurable:!0,enumerable:!1,value:_p(e),writable:!0})}:Wo,jp=bp(Op);const Cp=jp;var wp=9007199254740991,Ep=/^(?:0|[1-9]\d*)$/;function Jo(t,e){var r=typeof t;return e=e??wp,!!e&&(r=="number"||r!="symbol"&&Ep.test(t))&&t>-1&&t%1==0&&t<e}function Zr(t,e,r){e=="__proto__"&&He?He(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Ye(t,e){return t===e||t!==t&&e!==e}var Tp=Object.prototype,Np=Tp.hasOwnProperty;function $p(t,e,r){var n=t[e];(!(Np.call(t,e)&&Ye(n,r))||r===void 0&&!(e in t))&&Zr(t,e,r)}function Pp(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?Zr(r,i,c):$p(r,i,c)}return r}var qo=Math.max;function Ap(t,e,r){return e=qo(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=qo(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),hp(t,this,i)}}function Rp(t,e){return Cp(Ap(t,e,Wo),t+"")}var Mp=9007199254740991;function Qo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Mp}function tn(t){return t!=null&&Qo(t.length)&&!Qr(t)}function xp(t,e,r){if(!Dt(r))return!1;var n=typeof e;return(n=="number"?tn(r)&&Jo(e,r.length):n=="string"&&e in r)?Ye(r[e],t):!1}function Dp(t){return Rp(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&&xp(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 Ip=Object.prototype;function Ko(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ip;return t===r}function Lp(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Fp="[object Arguments]";function Xo(t){return te(t)&&Te(t)==Fp}var Zo=Object.prototype,kp=Zo.hasOwnProperty,Up=Zo.propertyIsEnumerable,Bp=Xo(function(){return arguments}())?Xo:function(t){return te(t)&&kp.call(t,"callee")&&!Up.call(t,"callee")};const en=Bp;function Vp(){return!1}var ta=typeof _=="object"&&_&&!_.nodeType&&_,ea=ta&&typeof module=="object"&&module&&!module.nodeType&&module,Gp=ea&&ea.exports===ta,ra=Gp?Xt.Buffer:void 0,zp=ra?ra.isBuffer:void 0,Wp=zp||Vp;const na=Wp;var Hp="[object Arguments]",Yp="[object Array]",Jp="[object Boolean]",qp="[object Date]",Qp="[object Error]",Kp="[object Function]",Xp="[object Map]",Zp="[object Number]",th="[object Object]",eh="[object RegExp]",rh="[object Set]",nh="[object String]",oh="[object WeakMap]",ah="[object ArrayBuffer]",ih="[object DataView]",sh="[object Float32Array]",ch="[object Float64Array]",uh="[object Int8Array]",lh="[object Int16Array]",fh="[object Int32Array]",dh="[object Uint8Array]",ph="[object Uint8ClampedArray]",hh="[object Uint16Array]",vh="[object Uint32Array]",L={};L[sh]=L[ch]=L[uh]=L[lh]=L[fh]=L[dh]=L[ph]=L[hh]=L[vh]=!0,L[Hp]=L[Yp]=L[ah]=L[Jp]=L[ih]=L[qp]=L[Qp]=L[Kp]=L[Xp]=L[Zp]=L[th]=L[eh]=L[rh]=L[nh]=L[oh]=!1;function mh(t){return te(t)&&Qo(t.length)&&!!L[Te(t)]}function gh(t){return function(e){return t(e)}}var oa=typeof _=="object"&&_&&!_.nodeType&&_,Ne=oa&&typeof module=="object"&&module&&!module.nodeType&&module,yh=Ne&&Ne.exports===oa,rn=yh&&ko.process,bh=function(){try{var t=Ne&&Ne.require&&Ne.require("util").types;return t||rn&&rn.binding&&rn.binding("util")}catch{}}();const aa=bh;var ia=aa&&aa.isTypedArray,_h=ia?gh(ia):mh;const sa=_h;var Sh=Object.prototype,Oh=Sh.hasOwnProperty;function jh(t,e){var r=ee(t),n=!r&&en(t),o=!r&&!n&&na(t),a=!r&&!n&&!o&&sa(t),s=r||n||o||a,i=s?Lp(t.length,String):[],c=i.length;for(var l in t)(e||Oh.call(t,l))&&!(s&&(l=="length"||o&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Jo(l,c)))&&i.push(l);return i}function Ch(t,e){return function(r){return t(e(r))}}function wh(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Eh=Object.prototype,Th=Eh.hasOwnProperty;function Nh(t){if(!Dt(t))return wh(t);var e=Ko(t),r=[];for(var n in t)n=="constructor"&&(e||!Th.call(t,n))||r.push(n);return r}function ca(t){return tn(t)?jh(t,!0):Nh(t)}var $h=Xr(Object,"create");const $e=$h;function Ph(){this.__data__=$e?$e(null):{},this.size=0}function Ah(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Rh="__lodash_hash_undefined__",Mh=Object.prototype,xh=Mh.hasOwnProperty;function Dh(t){var e=this.__data__;if($e){var r=e[t];return r===Rh?void 0:r}return xh.call(e,t)?e[t]:void 0}var Ih=Object.prototype,Lh=Ih.hasOwnProperty;function Fh(t){var e=this.__data__;return $e?e[t]!==void 0:Lh.call(e,t)}var kh="__lodash_hash_undefined__";function Uh(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=$e&&e===void 0?kh:e,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=Ph,It.prototype.delete=Ah,It.prototype.get=Dh,It.prototype.has=Fh,It.prototype.set=Uh;function Bh(){this.__data__=[],this.size=0}function Je(t,e){for(var r=t.length;r--;)if(Ye(t[r][0],e))return r;return-1}var Vh=Array.prototype,Gh=Vh.splice;function zh(t){var e=this.__data__,r=Je(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Gh.call(e,r,1),--this.size,!0}function Wh(t){var e=this.__data__,r=Je(e,t);return r<0?void 0:e[r][1]}function Hh(t){return Je(this.__data__,t)>-1}function Yh(t,e){var r=this.__data__,n=Je(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=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=Bh,yt.prototype.delete=zh,yt.prototype.get=Wh,yt.prototype.has=Hh,yt.prototype.set=Yh;var Jh=Xr(Xt,"Map");const ua=Jh;function qh(){this.size=0,this.__data__={hash:new It,map:new(ua||yt),string:new It}}function Qh(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function qe(t,e){var r=t.__data__;return Qh(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Kh(t){var e=qe(this,t).delete(t);return this.size-=e?1:0,e}function Xh(t){return qe(this,t).get(t)}function Zh(t){return qe(this,t).has(t)}function tv(t,e){var r=qe(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function re(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])}}re.prototype.clear=qh,re.prototype.delete=Kh,re.prototype.get=Xh,re.prototype.has=Zh,re.prototype.set=tv;function la(t){return t==null?"":zo(t)}var ev=Ch(Object.getPrototypeOf,Object);const fa=ev;var rv="[object Object]",nv=Function.prototype,ov=Object.prototype,da=nv.toString,av=ov.hasOwnProperty,iv=da.call(Object);function ne(t){if(!te(t)||Te(t)!=rv)return!1;var e=fa(t);if(e===null)return!0;var r=av.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&da.call(r)==iv}function sv(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 cv(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:sv(t,e,r)}var uv="\\ud800-\\udfff",lv="\\u0300-\\u036f",fv="\\ufe20-\\ufe2f",dv="\\u20d0-\\u20ff",pv=lv+fv+dv,hv="\\ufe0e\\ufe0f",vv="\\u200d",mv=RegExp("["+vv+uv+pv+hv+"]");function pa(t){return mv.test(t)}function gv(t){return t.split("")}var ha="\\ud800-\\udfff",yv="\\u0300-\\u036f",bv="\\ufe20-\\ufe2f",_v="\\u20d0-\\u20ff",Sv=yv+bv+_v,Ov="\\ufe0e\\ufe0f",jv="["+ha+"]",nn="["+Sv+"]",on="\\ud83c[\\udffb-\\udfff]",Cv="(?:"+nn+"|"+on+")",va="[^"+ha+"]",ma="(?:\\ud83c[\\udde6-\\uddff]){2}",ga="[\\ud800-\\udbff][\\udc00-\\udfff]",wv="\\u200d",ya=Cv+"?",ba="["+Ov+"]?",Ev="(?:"+wv+"(?:"+[va,ma,ga].join("|")+")"+ba+ya+")*",Tv=ba+ya+Ev,Nv="(?:"+[va+nn+"?",nn,ma,ga,jv].join("|")+")",$v=RegExp(on+"(?="+on+")|"+Nv+Tv,"g");function Pv(t){return t.match($v)||[]}function Av(t){return pa(t)?Pv(t):gv(t)}function Rv(t){return function(e){e=la(e);var r=pa(e)?Av(e):void 0,n=r?r[0]:e.charAt(0),o=r?cv(r,1).join(""):e.slice(1);return n[t]()+o}}var Mv=Rv("toUpperCase");const xv=Mv;function Dv(t){return xv(la(t).toLowerCase())}function Iv(){this.__data__=new yt,this.size=0}function Lv(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Fv(t){return this.__data__.get(t)}function kv(t){return this.__data__.has(t)}var Uv=200;function Bv(t,e){var r=this.__data__;if(r instanceof yt){var n=r.__data__;if(!ua||n.length<Uv-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new re(n)}return r.set(t,e),this.size=r.size,this}function oe(t){var e=this.__data__=new yt(t);this.size=e.size}oe.prototype.clear=Iv,oe.prototype.delete=Lv,oe.prototype.get=Fv,oe.prototype.has=kv,oe.prototype.set=Bv;var _a=typeof _=="object"&&_&&!_.nodeType&&_,Sa=_a&&typeof module=="object"&&module&&!module.nodeType&&module,Vv=Sa&&Sa.exports===_a,Oa=Vv?Xt.Buffer:void 0,ja=Oa?Oa.allocUnsafe:void 0;function Gv(t,e){if(e)return t.slice();var r=t.length,n=ja?ja(r):new t.constructor(r);return t.copy(n),n}var zv=Xt.Uint8Array;const Ca=zv;function Wv(t){var e=new t.constructor(t.byteLength);return new Ca(e).set(new Ca(t)),e}function Hv(t,e){var r=e?Wv(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Yv(t){return typeof t.constructor=="function"&&!Ko(t)?pp(fa(t)):{}}function Jv(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 qv=Jv();const Qv=qv;function an(t,e,r){(r!==void 0&&!Ye(t[e],r)||r===void 0&&!(e in t))&&Zr(t,e,r)}function Kv(t){return te(t)&&tn(t)}function sn(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Xv(t){return Pp(t,ca(t))}function Zv(t,e,r,n,o,a,s){var i=sn(t,r),c=sn(e,r),l=s.get(c);if(l){an(t,r,l);return}var f=a?a(i,c,r+"",t,e,s):void 0,p=f===void 0;if(p){var d=ee(c),v=!d&&na(c),y=!d&&!v&&sa(c);f=c,d||v||y?ee(i)?f=i:Kv(i)?f=vp(i):v?(p=!1,f=Gv(c,!0)):y?(p=!1,f=Hv(c,!0)):f=[]:ne(c)||en(c)?(f=i,en(i)?f=Xv(i):(!Dt(i)||Qr(i))&&(f=Yv(c))):p=!1}p&&(s.set(c,f),o(f,c,n,a,s),s.delete(c)),an(t,r,f)}function wa(t,e,r,n,o){t!==e&&Qv(e,function(a,s){if(o||(o=new oe),Dt(a))Zv(t,e,s,r,wa,n,o);else{var i=n?n(sn(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),an(t,s,i)}},ca)}var tm=Dp(function(t,e,r){wa(t,e,r)});const em=tm,rm=function(t){return!(!t||typeof t!="function"||!t.prototype)};function Ea(t){const e=t.prototype;return!!(e&&e.isReactComponent)}function Ta(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 Na(t){class e extends C.Component{render(){return C.createElement(t,this.props)}}return e.displayName=t.displayName,e}const Lt=(t,e)=>{const r=n=>{const a=`
|
|
7
7
|
${Object.keys(e).map(s=>`const ${s} = $$context['${s}'];`).join(`
|
|
8
8
|
`)}
|
|
9
9
|
return ${n};
|
|
10
|
-
`;return new Function("$$context",a)(e)};try{return r(t)}catch(n){console.warn(n);const o=`[${t}] expression run failed`;return console.warn(o),null}}
|
|
10
|
+
`;return new Function("$$context",a)(e)};try{return r(t)}catch(n){console.warn(n);const o=`[${t}] expression run failed`;return console.warn(o),null}},$a=(t,e,r)=>function(...o){try{const a=`
|
|
11
11
|
var args = Array.from(arguments);
|
|
12
12
|
function runTimeFunc() {
|
|
13
13
|
var f = ${t};
|
|
@@ -17,5 +17,31 @@
|
|
|
17
17
|
return f.apply(f, args)
|
|
18
18
|
}
|
|
19
19
|
return runTimeFunc();
|
|
20
|
-
`;new Function(a)(...o,e,r)}catch(a){console.warn(a)}},Mr=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},Pr=t=>{const e={};return Object.keys(t).forEach(r=>{let n=r.replace("-webkit","Webkit");n=n.replace("-ms","ms"),n=n.replace("-moz","Moz"),n=n.replace("-o","O");let o=n.split("-");o.length>=2&&(o=o.map((a,s)=>s!==0?Gh(a):a)),e[o.join("")]=t[r]}),e},Dr=t=>{let e="";return Object.keys(t).forEach(r=>{e+=`${r}:${t[r]};`}),e},fm=(t,e)=>{const r={};return t.forEach(n=>{if(n.globalName){const o=e[n.globalName];o&&(r[n.globalName]=o)}}),r},dm=(t,e=1)=>{let r=0,n=t,o={},a={};for(;r<e;)Object.keys(n).forEach(s=>{o={...o,...n[s]}}),a=o,n=o,o={},r+=1;return a},Xo=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},Zo=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},pm=(t,e)=>Zo(t,e),hm=(t,e)=>Zo(t,e),je="DYNAMIC",mm=["$$context","$$nodeModel"],ta=t=>{let e;const r=new Set,n=(c,u)=>{const l=typeof c=="function"?c(e):c;if(!Object.is(l,e)){const d=e;e=u??typeof l!="object"?l:Object.assign({},e,l),r.forEach(f=>f(e,d))}},o=()=>e,i={setState:n,getState:o,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,o,i),i},vm=t=>t?ta(t):ta;class gm{constructor(){b(this,"storeMap",new Map)}addStore(e,r){const n=vm(r);return this.storeMap.set(e,n),n.name=e,n}setStore(e,r){this.storeMap.set(e,r)}removeStore(e){this.storeMap.delete(e)}getStore(e){return this.storeMap.get(e)}getState(e){var r;return(r=this.storeMap.get(e))==null?void 0:r.getState()}getStateObj(e){return{state:this.getState(e),updateState:r=>{this.setState(e,r)}}}setState(e,r){var n;return(n=this.storeMap.get(e))==null?void 0:n.setState(r)}connect(e,r){const n=this.storeMap.get(e);return n?n.subscribe(r):(console.warn("store not exits"),()=>{})}getStateSnapshot(){const e={};return this.storeMap.forEach((r,n)=>{e[n]=this.getStateObj(n)}),e}destroy(){this.storeMap=new Map}}class ym{constructor(){b(this,"varSpace",new Map)}get(e){return this.varSpace.get(e)}add(e,r){this.varSpace.set(e,r)}remove(e){this.varSpace.delete(e)}destroy(){this.varSpace.clear()}getStateSnapshot(){const e={};return this.varSpace.forEach((r,n)=>{e[n]=r}),e}}class ea{constructor(){b(this,"renderMode","normal");b(this,"components",{});b(this,"storeManager",new gm);b(this,"variableManager",new ym);b(this,"runtimeComponentCache",new Map);b(this,"onGetRef");b(this,"onGetComponent");b(this,"onComponentMount");b(this,"onComponentDestroy");b(this,"processNodeConfigHook")}getComponent(e){var o;const r=e.value.componentName;let n=this.components[r]||(()=>`Component [${r}] not found`);return qo(n)||(n=Yo(n),this.components[r]=n),this.onGetComponent&&(n=(o=this.onGetComponent)==null?void 0:o.call(this,n,e)),n}getContext(e={},r){let n=e;return r&&(n={...e},n.__proto__=r||null),n}pageRender(e,{components:r,onGetRef:n,$$context:o={},onGetComponent:a,onComponentMount:s,onComponentDestroy:i,renderMode:c,processNodeConfigHook:u}){this.renderMode=c,this.components=r,this.onGetRef=n,this.onGetComponent=a,this.onComponentMount=s,this.onComponentDestroy=i,this.processNodeConfigHook=u;const l=e.value.componentsTree,d=this.getComponent(l),f=this.convertModelToComponent(d,e.value.componentsTree),p={},v=l.props;return Object.keys(v).forEach(y=>{p[y]=v[y].value}),p.$$context=o,this.render(f,p)}transformProps(e={},{$$context:r}){const n=e,o=s=>{if(Array.isArray(s))return s.map(i=>o(i));if(vr(s))return o(s.value);if(Pf(s)){const i=s.value,c=i.value;if(!c)return console.warn("slot value is null, this maybe cause some error, pls check it",e),()=>{};const u=l=>{const d=`${l.id}-${je}`;if(this.runtimeComponentCache.get(l.id))return{key:d,component:this.runtimeComponentCache.get(l.id)};const f=this.getComponent(l),p=this.convertModelToComponent(f,l),v=i.params||[];return{component:(...O)=>{const C=Mr(O,v),D=this.getContext({params:C},r);return this.render(p,{$$context:D,key:d})},key:d}};if(Array.isArray(c)){const l=c==null?void 0:c.map(d=>u(d));return(...d)=>l.map(f=>Qo(f.component)?S.createElement(f.component,{$$context:r,key:f.key}):f.component(...d))}else return u(c).component}else{if(ht(s))return yt(s.value,r||{});if(Af(s))return Ko(s.value,r,this.storeManager);if(Rt(s)){let i=s;vr(s)&&(i=s.value);const c=i,u={};return Object.keys(i).forEach(l=>{u[l]=o(c[l])}),u}else return s}},a={};return Object.keys(n).forEach(s=>{const i=n[s];a[s]=o(i)}),a}collectSpecialProps(e={},r){const n=[],o=(a,s)=>{let i=s;vr(s)&&(i=s.value),r(i)?n.push({keyPath:a,val:i}):It(i)?i.forEach((c,u)=>{o([...a,String(u)],c)}):Rt(i)&&Object.keys(i).forEach(c=>{o([...a,c],i[c])})};return o(["$root"],e),n}convertModelToComponent(e,r){const n=this;class o extends S.Component{constructor(i){super(i);b(this,"_CONDITION",!0);b(this,"_DESIGN_BOX",!1);b(this,"_NODE_MODEL",r);b(this,"_NODE_ID",r.id);b(this,"UNIQUE_ID",`${r.id}_${X()}`);b(this,"targetComponentRef");b(this,"listenerHandle",[]);b(this,"storeState");b(this,"storeListenDisposeList",[]);b(this,"domHeader");b(this,"mediaStyleDomMap",{});b(this,"variableSpace");b(this,"nodeName");b(this,"updateState",i=>{this.storeState.setState(i),this.forceUpdate()});b(this,"getStyleDomById",i=>{const c=this.mediaStyleDomMap;let u=c[i];return u||(u=document.createElement("style"),c[i]=u),u.id=i,u});b(this,"addMediaCSS",()=>{var u;let i=this.domHeader;if(i||(i=(u=document.getElementsByTagName("head"))==null?void 0:u[0],this.domHeader=i),!this.domHeader)return;const c=this._NODE_MODEL.value.css;c&&c.value.forEach(l=>{var p;const d=`${this.UNIQUE_ID}_${l.state}`;let f=`.${c.class}`;if(l.state!=="normal"&&(f=`${f}:${l.state}`),Object.keys(l.style).length!==0){const v=this.getStyleDomById(d);v.innerText=`${f} { ${Dr(l.style)} }`,i==null||i.appendChild(v)}(p=l.media)!=null&&p.length&&l.media.forEach(v=>{const y=`${d}_${v.type}_${v.value}`,_=this.getStyleDomById(y);_.media=`screen and (${v.type}:${v.value}px)`,_.innerHTML=`${f} { ${Dr(v.style)} }`,i==null||i.appendChild(_)})})});b(this,"removeMediaCSS",()=>{const i=this.mediaStyleDomMap;Object.keys(i).forEach(c=>{var u;(u=this.domHeader)==null||u.removeChild(i[c])}),this.mediaStyleDomMap={}});b(this,"rebuildNode",()=>{this.storeListenDisposeList.forEach(i=>i()),this.removeMediaCSS(),this.connectStore(),this.addMediaCSS(),this.forceUpdate()});this.targetComponentRef=S.createRef(),this.state=r.value.state||{};const c=r.value.nodeName||r.id;this.nodeName=c;const u=n.storeManager.getStore(c);u?(this.storeState=u,u.setState({...r.value.state||{}})):this.storeState=n.storeManager.addStore(c,()=>({...r.value.state||{}})),this.storeState.subscribe(d=>{this.setState({...d})}),this.connectStore();const l=n.variableManager.get(c);l?this.variableSpace=l:(this.variableSpace={staticVar:{},methods:{}},n.variableManager.add(c,this.variableSpace))}connectStore(){const i=n.collectSpecialProps(r.props,f=>!!ht(f)),c=n.collectSpecialProps({css:r.value.css,class:r.value.classNames},f=>!!ht(f));let u=[];[...i,...c].map(f=>{const p=f.val,v=[/\$\$context.stateManager\.(.+?)\./gim,/\$\$context.stateManager\["(.+?)"\]/gim,/\$\$context.stateManager\['(.+?)'\]/gim,/getStateObj\('(.+?)'\)/gim,/getStateObj\("(.+?)"\)/gim,/getStateById\('(.+?)'\)/gim,/getStateById\("(.+?)"\)/gim],y=Xo(p.value,v);u=[...u,...y]}).filter(Boolean);const l=Array.from(new Set(u)),d=[];l.length&&l.forEach(f=>{n.storeManager.getStore(f)||(n.storeManager.addStore(f,()=>({})),console.warn(n.storeManager,f,"not exits"));const v=n.storeManager.connect(f,()=>{this.forceUpdate()});d.push(v)}),this.storeListenDisposeList=d}componentDidMount(){var c;this.addMediaCSS(),n.onGetRef&&n.onGetRef(this.targetComponentRef,r,this),(c=n.onComponentMount)==null||c.call(n,this,r);const i=()=>{n.storeManager.setStore(r.value.nodeName||r.id,this.storeState),this.storeState.setState({...this.state,...r.value.state||{}}),this.rebuildNode()};r.onChange(i)}componentWillUnmount(){var i;this.storeListenDisposeList.forEach(c=>c()),this.removeMediaCSS(),(i=n.onComponentDestroy)==null||i.call(n,this,r)}render(){var Oe;const{$$context:i,...c}=this.props,u=r.value.nodeName||r.id,l={key:r.id,...r.props,...c},d={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:n.storeManager,getState:()=>n.storeManager.getStateObj(u),getStateObj:()=>n.storeManager.getStateObj(u),getStateObjById:R=>n.storeManager.getStateObj(R),stateManager:n.storeManager.getStateSnapshot(),getMethods:()=>n.variableManager.get(u).methods,getMethodsById:R=>n.variableManager.get(R).methods,getStaticVar:()=>n.variableManager.get(u).staticVar,getStaticVarById:R=>n.variableManager.get(R).staticVar};r.value.componentName===$t.ROOT_CONTAINER&&(d.globalState=this.state,d.updateGlobalState=this.updateState);const f=n.getContext(d,i),y=n.transformProps({methods:r.value.methods},{$$context:f}).methods.reduce((R,Z)=>(R[Z.name]=Z.define,R),{});f.methods=y,this.variableSpace.methods=Object.assign(this.variableSpace.methods,y);const _=r.value.loop;let O=[];if(_&&_.open){this.targetComponentRef.current=[];let R=_.data||[];if(ht(_.data)){const Z=_.data;R=yt(Z.value,f||{})}return O=R.map((...Z)=>{var ua;const oe=Z[1],Ft=[_.forName||"item",_.forIndex||"index"],Ir=Mr(Z,Ft);let xr="loopData";_.name&&(xr=`${xr}${_.name}`);const ae=n.getContext({[xr]:Ir},f),tt=n.transformProps(l,{$$context:ae}),Pm=((ua=r.value.classNames)==null?void 0:ua.map(Q=>{var Ee;const we=Q.name;return(ht(Q.status)?yt(String(((Ee=Q.status)==null?void 0:Ee.value)||""),ae):!1)?we:""}))||[];let Rr=`${tt.className??""} ${Pm.join(" ")}`.trim();r.value.css&&(Rr=`${r.value.css.class} ${Rr}`.trim()),tt.className=Rr;const Dm=n.transformProps(r.value.style,{$$context:ae});r.value.style&&(tt.style=Pr(Dm||{}));const{children:Ce}=tt;let Lr=[];if(Ce!==void 0)delete tt.children,Lr=Array.isArray(Ce)?Ce:[Ce];else{const Q=[];r.value.children.forEach((la,Ee)=>{const Im=n.buildComponent(la,{$$context:ae,idx:Ee});Q.push(Im)}),Lr=Q}if(tt.key=`${tt.key}-${oe}`,ht(_.key)){const Q=_.key,we=yt(Q.value,ae||{});tt.key+=`-${we}`}return tt.ref=Q=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[oe]=Q},n.render(e,tt,...Lr)}),O}const C=n.transformProps(l,{$$context:f}),{children:D}=C;let M=[];if(D!==void 0)delete C.children,M=Array.isArray(D)?D:[D];else{const R=[];r.value.children.forEach((oe,Ft)=>{const Ir=n.buildComponent(oe,{$$context:f,idx:Ft});R.push(Ir)}),M=R}C.ref=this.targetComponentRef;const L=((Oe=r.value.classNames)==null?void 0:Oe.map(R=>{var Ft;const Z=R.name;return(ht(R.status)?yt(((Ft=R.status)==null?void 0:Ft.value)||"",f):!1)?Z:""}))||[];let z=`${C.className??""} ${L.join(" ")}`.trim();r.value.css&&(z=`${r.value.css.class} ${z}`.trim()),C.className=z;const ne=n.transformProps(r.value.style,{$$context:f});r.value.style&&(C.style=Pr(ne||{}));let E=r.value.condition??!0;typeof E!="boolean"&&(E=yt(E.value,f||{}));let st={condition:E,props:C};n.processNodeConfigHook&&(st=n.processNodeConfigHook(st,r));const bt=n.render(e,st.props,...M);return this._CONDITION=st.condition,st.condition?bt:S.createElement("div",{style:{display:"none"}},bt)}}return b(o,"__CP_TYPE__",je),o.displayName=`${r.value.componentName}Dynamic`,o}buildComponent(e,{$$context:r={}}){const n=this.runtimeComponentCache;return typeof e=="string"?this.render(e):Mf(e)?(({currentNode:a})=>{const s=a.value.id;let i=null;if(n.get(s))i=n.get(s);else{const l=this.getComponent(a);i=this.convertModelToComponent(l,a)}!n.get(s)&&this.renderMode!=="design"&&n.set(s,i);const c=`${s}-${je}`,u={$$context:r,$$nodeModel:e,key:c};return this.render(i,u)})({currentNode:e}):void 0}render(e,r={},...n){return typeof e=="string"||typeof e=="number"?String(e):(mm.forEach(a=>{a in r&&e.__CP_TYPE__!==je&&delete r[a]}),S.createElement(e,r,...n))}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const bm=Br(new ea),_m=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"],ot=t=>{const e={};return t.forEach(r=>{e[r.key]=r.value}),e},Sm=[..._m,...vf].reduce((t,e)=>(t[e]=({children:r,$$attributes:n=[],...o})=>{let a=r;return Array.isArray(r)||(a=[r]),S.createElement(e,{...o,...ot(n)},...a)},t),{}),jm={RootContainer:({children:t})=>t,...Sm,CContainer:({children:t,$$attributes:e=[],afterMount:r,beforeDestroy:n,...o})=>{let a=t;return Array.isArray(t)||(a=[t]),S.useEffect(()=>(r==null||r(o),()=>{n==null||n(o)}),[]),S.createElement("div",{...o,...ot(e)},...a)},CVideo:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.createElement("video",{...r,...ot(e)},...n)},CAudio:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.createElement("audio",{...r,...ot(e)},...n)},CBlock:({children:t,width:e,height:r,$$attributes:n=[],...o})=>{let a=t;Array.isArray(t)||(a=[t]),a=a.filter(u=>u!==void 0);const{style:s={},...i}=ot(n),c={height:r,width:e,...s,...o.style||{}};return S.createElement("div",{...o,...i,style:c},...a)},CImage:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.createElement("img",{...r,...ot(e)},...n)},CText:({$$attributes:t=[],content:e,...r})=>S.createElement("span",{...r,...ot(t)},e),CCanvas:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.createElement("canvas",{...r,...ot(e)},...n)},CNativeTag:({children:t,$$attributes:e=[],htmlTag:r="div",...n})=>{let o=t;Array.isArray(t)||(o=[t]);const{style:a={},...s}=ot(e),i={...a,...n.style||{}};return S.createElement(r,{...n,...s,style:i},...o)}};class Om{constructor(){b(this,"refMap",new Map)}get(e){return this.refMap.get(e)}add(e,r){this.refMap.set(e,r)}remove(e){this.refMap.delete(e)}destroy(){this.refMap.clear()}}class ra extends S.Component{constructor(r){super(r);b(this,"refManager");b(this,"dynamicComponentInstanceMap",new Map);b(this,"onGetRef",(r,n,o)=>{var a,s;(s=(a=this.props).onGetRef)==null||s.call(a,r,n,o),this.dynamicComponentInstanceMap.set(n.id,o),this.refManager.add(n.value.refId||n.id,r)});b(this,"rerender",r=>{if(this.props.adapter.clear(),(r==null?void 0:r.nodeType)==="PAGE"&&r)this.setState({pageModel:r});else if(Rt(r)&&ao(r)){const n=r;this.setState({pageModel:new ge(n,{materials:this.state.pageModel.materialsModel.rawValue})})}});this.state={pageModel:r.pageModel||new ge(r.page)},this.refManager=new Om}getPageModel(){return this.state.pageModel}componentDidMount(){const{render:r}=this.props;r&&(r.ref.current=this)}componentWillUnmount(){this.refManager.destroy()}render(){const{props:r}=this,{adapter:n,onGetComponent:o,onComponentDestroy:a,onComponentMount:s}=r,{pageModel:i}=this.state;if(!i)return console.warn("pageModel is null"),null;const c={...jm,...r.components},u=this.props.$$context??{};return u.refs=this.refManager,n.pageRender(i,{libs:{},components:c,onGetRef:this.onGetRef,onGetComponent:o,onComponentMount:s,onComponentDestroy:a,$$context:u,renderMode:r.renderMode,processNodeConfigHook:r.processNodeConfigHook})}}const Cm=()=>{const t=S.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)}}};class wm extends S.Component{constructor(r){super(r);b(this,"onDoubleClick",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:""}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){var o,a;(a=(o=this.props).onError)==null||a.call(o,n)}render(){if(this.state.hasError){const{onDoubleClick:r}=this,n=this.props.node.value;console.error(this.props.node,this.props.children);const o=S.createElement("div",{style:{backgroundColor:"rgb(255 206 215 / 13%)",padding:"5px",color:"#ff0000b0",textAlign:"center",fontSize:"12px"}},"Render error, node id: ",n.id,", node name:",n.title," component name:",n.title||n.componentName,S.createElement("p",null,"msg: ",String(this.state.error)),S.createElement("button",{onDoubleClick:r,style:{border:"1px solid rgba(100,100,100,0.1)",backgroundColor:"#fff",padding:"5px 10px",borderRadius:"2px",color:"gray",cursor:"pointer",marginTop:"5px"}},"double click to refresh"),S.createElement("div",{style:{display:"none"}}));return S.createElement(this.props.targetComponent,{onlyRenderChild:!0},o)}return this.props.children}}class na{constructor(){b(this,"instanceMap",new Map)}get(e){return this.instanceMap.get(e)}add(e,r){const n=this.instanceMap.get(e);n?n.push(r):this.instanceMap.set(e,[r])}remove(e,r){const n=this.instanceMap.get(e);if(r!==void 0&&Array.isArray(n)){const o=n.filter(a=>a!==r);this.instanceMap.set(e,o)}else this.instanceMap.delete(e)}destroy(){this.instanceMap.clear()}}const oa=t=>{const{node:e}=t,r=S.useMemo(()=>{const i=e.isContainer();return Rt(i)?i:{placeholder:"Drag the component to place it",width:"100%",height:"100%",style:{}}},[t.node]),{placeholder:n,height:o,width:a,style:s}=r;return S.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(200,200,200,0.1)",border:"1px solid rgba(0,0,0,0.1)",borderRadius:"2px",fontSize:"14px",color:"gray",cursor:"default",minWidth:"300px",minHeight:"50px",width:a,height:o,...s}},n)};class Em extends S.Component{constructor(r){super(r);b(this,"instanceManager",new na);b(this,"renderRef");b(this,"dropPlaceholder",oa);b(this,"onGetComponent",(r,n)=>{var c,u;const o=this;let a=r;const s=(u=(c=n.material)==null?void 0:c.value.advanceCustom)==null?void 0:u.wrapComponent;s&&(a=s(r,{node:n,ctx:window.__C_ENGINE_DESIGNER_PLUGIN_CTX__}));class i extends S.Component{constructor(){super(...arguments);b(this,"_DESIGN_BOX",!0);b(this,"_NODE_MODEL",n);b(this,"_NODE_ID",n.id);b(this,"_UNIQUE_ID",`${n.id}_${X()}`);b(this,"_STATUS")}componentDidMount(){o.instanceManager.add(n.id,this)}componentWillUnmount(){this._STATUS="DESTROY",o.instanceManager.remove(n.id,this)}render(){const{children:f=[],onlyRenderChild:p,...v}=this.props;let y=f;return It(f)||(y=[f]),!!!y.filter(Boolean).length&&(n.isContainer()||n.value.componentName===$t.ROOT_CONTAINER)&&y.push(S.createElement(o.dropPlaceholder,{node:n})),p?y:S.createElement(a,v,...y)}}return S.forwardRef(function(d,f){return S.createElement(wm,{node:n,targetComponent:i},S.createElement(i,{ref:f,...d}))})});this.renderRef=S.createRef(),r.dropPlaceholder&&(this.dropPlaceholder=r.dropPlaceholder)}componentDidMount(){var r,n;(n=(r=this.props).onMount)==null||n.call(r,this)}getPageModel(){var r;return(r=this.renderRef.current)==null?void 0:r.state.pageModel}rerender(r){var n;return(n=this.renderRef.current)==null?void 0:n.rerender(r)}getInstancesById(r,n){let o=[...this.instanceManager.get(r)||[]];return n!==void 0&&(o=o.filter(a=>n===(a==null?void 0:a._UNIQUE_ID))),o}getInstanceByDom(r){const n=aa(r);if(!n)return null;const o=ia(n);return(o==null?void 0:o.stateNode)||null}getDomsById(r,n){const o=this.getInstancesById(r),a=[];return o==null||o.forEach(s=>{var c;if((s==null?void 0:s._STATUS)==="DESTROY")return;const i=da.findDOMNode(s);if(i&&!(i instanceof Text))if(n){const u=Array.from(((c=i.querySelectorAll)==null?void 0:c.call(i,n))||[]);a.push(...u)}else a.push(i)}),a}getDomRectById(r,n){return this.getDomsById(r,n).map(s=>s==null?void 0:s.getBoundingClientRect()).filter(Boolean)}render(){const{props:r,onGetComponent:n}=this,{render:o,...a}=r;return o&&(o.ref.current=this),S.createElement(ra,{onGetComponent:n,...a,processNodeConfigHook:(s,i)=>{var v,y;if(i.nodeType!=="NODE")return s;const{props:c,condition:u}=s;let l={...c};const d=((v=i.value.configure)==null?void 0:v.devState)||{},f=(y=i.material)==null?void 0:y.value.fixedProps;if(f!==void 0){if(Rt(f))l={...l,...f};else if(typeof f=="function"){const _=f(l);l={...l,..._}}}let p=u;return d.condition===!1&&(p=d.condition),{props:um(l,d.props||{}),condition:p}},ref:this.renderRef})}}const aa=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:aa(t.parentElement)},ia=t=>{var e;return t?(e=t==null?void 0:t.stateNode)!=null&&e._DESIGN_BOX?t:ia(t.return):null},Nm=()=>{const t=S.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)},getInstancesById(e,r){var n;return((n=t.current)==null?void 0:n.getInstancesById(e,r))||[]},getInstanceByDom(e){var r;return((r=t.current)==null?void 0:r.getInstanceByDom(e))||null},getDomsById(e,r){var n;return((n=t.current)==null?void 0:n.getDomsById(e,r))||[]},getDomRectById(e,r){var n;return((n=t.current)==null?void 0:n.getDomRectById(e,r))||[]}}};var Tm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $m(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var sa={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Tm,function(){var r=function(){},n={},o={},a={};function s(f,p){f=f.push?f:[f];var v=[],y=f.length,_=y,O,C,D,M;for(O=function(L,z){z.length&&v.push(L),_--,_||p(v)};y--;){if(C=f[y],D=o[C],D){O(C,D);continue}M=a[C]=a[C]||[],M.push(O)}}function i(f,p){if(f){var v=a[f];if(o[f]=p,!!v)for(;v.length;)v[0](f,p),v.splice(0,1)}}function c(f,p){f.call&&(f={success:f}),p.length?(f.error||r)(p):(f.success||r)(f)}function u(f,p,v,y){var _=document,O=v.async,C=(v.numRetries||0)+1,D=v.before||r,M=f.replace(/[\?|#].*$/,""),L=f.replace(/^(css|img|module|nomodule)!/,""),z,ne,E;if(y=y||0,/(^css!|\.css$)/.test(M))E=_.createElement("link"),E.rel="stylesheet",E.href=L,z="hideFocus"in E,z&&E.relList&&(z=0,E.rel="preload",E.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(M))E=_.createElement("img"),E.src=L;else if(E=_.createElement("script"),E.src=L,E.async=O===void 0?!0:O,ne="noModule"in E,/^module!/.test(M)){if(!ne)return p(f,"l");E.type="module"}else if(/^nomodule!/.test(M)&&ne)return p(f,"l");E.onload=E.onerror=E.onbeforeload=function(st){var bt=st.type[0];if(z)try{E.sheet.cssText.length||(bt="e")}catch(Oe){Oe.code!=18&&(bt="e")}if(bt=="e"){if(y+=1,y<C)return u(f,p,v,y)}else if(E.rel=="preload"&&E.as=="style")return E.rel="stylesheet";p(f,bt,st.defaultPrevented)},D(f,E)!==!1&&_.head.appendChild(E)}function l(f,p,v){f=f.push?f:[f];var y=f.length,_=y,O=[],C,D;for(C=function(M,L,z){if(L=="e"&&O.push(M),L=="b")if(z)O.push(M);else return;y--,y||p(O)},D=0;D<_;D++)u(f[D],C,v)}function d(f,p,v){var y,_;if(p&&p.trim&&(y=p),_=(y?v:p)||{},y){if(y in n)throw"LoadJS";n[y]=!0}function O(C,D){l(f,function(M){c(_,M),C&&c({success:C,error:D},M),i(y,M)},_)}if(_.returnPromise)return new Promise(O);O()}return d.ready=function(p,v){return s(p,function(y){c(v,y)}),d},d.done=function(p){i(p,[])},d.reset=function(){n={},o={},a={}},d.isDefined=function(p){return p in n},d})})(sa);var Am=sa.exports;const ca=$m(Am);class Mm{constructor(e,r){b(this,"assets");b(this,"loadStatus");b(this,"win",window);b(this,"_onSuccessList",[]);b(this,"_onErrorList",[]);this.assets=JSON.parse(JSON.stringify(e||[])),this.loadStatus="INIT",r!=null&&r.window&&(this.win=r.window)}load(){const e=this.assets||[],r=[];for(let n=0;n<e.length;n++){const o=e[n];o.id||(o.id=X()),r.push(o.id);const a=o.resources.map(s=>s.src);a.length&&ca(a,o.id,{async:!1,before:(s,i)=>(this.win.document.body.appendChild(i),!1)})}return new Promise((n,o)=>{if(e.length===0){this._onSuccessList.forEach(a=>a()),n("");return}ca.ready(r,{success:()=>{this._onSuccessList.forEach(a=>a()),n("")},error:a=>{this._onErrorList.forEach(s=>s(a)),o(a)}})})}onSuccess(e){return this._onSuccessList.push(e),this}onError(e){return this._onErrorList.push(e),this}}g.AssetLoader=Mm,g.ComponentInstanceManager=na,g.DefaultDropPlaceholder=oa,g.DefineReactAdapter=ea,g.DesignRender=Em,g.ReactAdapter=bm,g.Render=ra,g.canAcceptsRef=qo,g.collectVariable=fm,g.compWrapper=Yo,g.convertCodeStringToFunction=Ko,g.flatObject=dm,g.formatSourceStylePropertyName=Pr,g.getAdapter=Br,g.getCSSTextValue=Dr,g.getComponentsLibs=pm,g.getMatchVal=Xo,g.getObjFromArrayMap=Mr,g.getThirdLibs=hm,g.isClass=lm,g.runExpression=yt,g.shouldConstruct=Qo,g.useDesignRender=Nm,g.useRender=Cm,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
20
|
+
`;new Function(a)(...o,e,r)}catch(a){console.warn(a)}},cn=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},un=t=>{const e={};return Object.keys(t).forEach(r=>{let n=r.replace("-webkit","Webkit");n=n.replace("-ms","ms"),n=n.replace("-moz","Moz"),n=n.replace("-o","O");let o=n.split("-");o.length>=2&&(o=o.map((a,s)=>s!==0?Dv(a):a)),e[o.join("")]=t[r]}),e},ln=t=>{let e="";return Object.keys(t).forEach(r=>{e+=`${r}:${t[r]};`}),e},nm=(t,e)=>{const r={};return t.forEach(n=>{if(n.globalName){const o=e[n.globalName];o&&(r[n.globalName]=o)}}),r},om=(t,e=1)=>{let r=0,n=t,o={},a={};for(;r<e;)Object.keys(n).forEach(s=>{o={...o,...n[s]}}),a=o,n=o,o={},r+=1;return a},Pa=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},Aa=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},am=(t,e)=>Aa(t,e),im=(t,e)=>Aa(t,e),Qe="DYNAMIC",sm=["$$context","$$nodeModel"],Ra=t=>{let e;const r=new Set,n=(c,l)=>{const f=typeof c=="function"?c(e):c;if(!Object.is(f,e)){const p=e;e=l??typeof f!="object"?f:Object.assign({},e,f),r.forEach(d=>d(e,p))}},o=()=>e,i={setState:n,getState:o,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,o,i),i},cm=t=>t?Ra(t):Ra;class um{constructor(){j(this,"storeMap",new Map)}addStore(e,r){const n=cm(r);return this.storeMap.set(e,n),n.name=e,n}setStore(e,r){this.storeMap.set(e,r)}removeStore(e){this.storeMap.delete(e)}getStore(e){return this.storeMap.get(e)}getState(e){var r;return(r=this.storeMap.get(e))==null?void 0:r.getState()}getStateObj(e){return{state:this.getState(e),updateState:r=>{this.setState(e,r)}}}setState(e,r){var n;return(n=this.storeMap.get(e))==null?void 0:n.setState(r)}connect(e,r){const n=this.storeMap.get(e);return n?n.subscribe(r):(console.warn("store not exits"),()=>{})}getStateSnapshot(){const e={};return this.storeMap.forEach((r,n)=>{e[n]=this.getStateObj(n)}),e}destroy(){this.storeMap=new Map}}class lm{constructor(){j(this,"varSpace",new Map)}get(e){return this.varSpace.get(e)}add(e,r){this.varSpace.set(e,r)}remove(e){this.varSpace.delete(e)}destroy(){this.varSpace.clear()}getStateSnapshot(){const e={};return this.varSpace.forEach((r,n)=>{e[n]=r}),e}}class Ma{constructor(){j(this,"renderMode","normal");j(this,"components",{});j(this,"storeManager",new um);j(this,"variableManager",new lm);j(this,"runtimeComponentCache",new Map);j(this,"onGetRef");j(this,"onGetComponent");j(this,"onComponentMount");j(this,"onComponentDestroy");j(this,"processNodeConfigHook")}getComponent(e){var o;const r=e.value.componentName;let n=this.components[r]||(()=>`Component [${r}] not found`);return Ta(n)||(n=Na(n),this.components[r]=n),this.onGetComponent&&(n=(o=this.onGetComponent)==null?void 0:o.call(this,n,e)),n}getContext(e={},r){let n=e;return r&&(n={...e},n.__proto__=r||null),n}pageRender(e,{components:r,onGetRef:n,$$context:o={},onGetComponent:a,onComponentMount:s,onComponentDestroy:i,renderMode:c,processNodeConfigHook:l}){this.renderMode=c,this.components=r,this.onGetRef=n,this.onGetComponent=a,this.onComponentMount=s,this.onComponentDestroy=i,this.processNodeConfigHook=l;const f=e.value.componentsTree,p=this.getComponent(f),d=this.convertModelToComponent(p,e.value.componentsTree),v={},y=f.props;return Object.keys(y).forEach(S=>{v[S]=y[S].value}),v.$$context=o,this.render(d,v)}transformProps(e={},{$$context:r}){const n=e,o=s=>{if(Array.isArray(s))return s.map(i=>o(i));if(Hr(s))return o(s.value);if(Cd(s)){const i=s.value,c=i.value;if(!c)return console.warn("slot value is null, this maybe cause some error, pls check it",e),()=>{};const l=f=>{const p=`${f.id}-${Qe}`;if(this.runtimeComponentCache.get(f.id))return{key:p,component:this.runtimeComponentCache.get(f.id)};const d=this.getComponent(f),v=this.convertModelToComponent(d,f),y=i.params||[];return{component:(...N)=>{const w=cn(N,y),U=this.getContext({params:w},r);return this.render(v,{$$context:U,key:p})},key:p}};if(Array.isArray(c)){const f=c==null?void 0:c.map(p=>l(p));return(...p)=>f.map(d=>Ea(d.component)?C.createElement(d.component,{$$context:r,key:d.key}):d.component(...p))}else return l(c).component}else{if(Mt(s))return Lt(s.value,r||{});if(Od(s))return $a(s.value,r,this.storeManager);if(ne(s)){let i=s;Hr(s)&&(i=s.value);const c=i,l={};return Object.keys(i).forEach(f=>{l[f]=o(c[f])}),l}else return s}},a={};return Object.keys(n).forEach(s=>{const i=n[s];a[s]=o(i)}),a}collectSpecialProps(e={},r){const n=[],o=(a,s)=>{let i=s;Hr(s)&&(i=s.value),r(i)?n.push({keyPath:a,val:i}):ee(i)?i.forEach((c,l)=>{o([...a,String(l)],c)}):ne(i)&&Object.keys(i).forEach(c=>{o([...a,c],i[c])})};return o(["$root"],e),n}convertModelToComponent(e,r){const n=this;class o extends C.Component{constructor(i){super(i);j(this,"_CONDITION",!0);j(this,"_DESIGN_BOX",!1);j(this,"_NODE_MODEL",r);j(this,"_NODE_ID",r.id);j(this,"UNIQUE_ID",`${r.id}_${vt()}`);j(this,"targetComponentRef");j(this,"listenerHandle",[]);j(this,"storeState");j(this,"storeListenDisposeList",[]);j(this,"domHeader");j(this,"mediaStyleDomMap",{});j(this,"variableSpace");j(this,"nodeName");j(this,"updateState",i=>{this.storeState.setState(i),this.forceUpdate()});j(this,"getStyleDomById",i=>{const c=this.mediaStyleDomMap;let l=c[i];return l||(l=document.createElement("style"),c[i]=l),l.id=i,l});j(this,"addMediaCSS",()=>{var l;let i=this.domHeader;if(i||(i=(l=document.getElementsByTagName("head"))==null?void 0:l[0],this.domHeader=i),!this.domHeader)return;const c=this._NODE_MODEL.value.css;c&&c.value.forEach(f=>{var v;const p=`${this.UNIQUE_ID}_${f.state}`;let d=`.${c.class}`;if(f.state!=="normal"&&(d=`${d}:${f.state}`),Object.keys(f.style).length!==0){const y=this.getStyleDomById(p);y.innerText=`${d} { ${ln(f.style)} }`,i==null||i.appendChild(y)}(v=f.media)!=null&&v.length&&f.media.forEach(y=>{const S=`${p}_${y.type}_${y.value}`,O=this.getStyleDomById(S);O.media=`screen and (${y.type}:${y.value}px)`,O.innerHTML=`${d} { ${ln(y.style)} }`,i==null||i.appendChild(O)})})});j(this,"removeMediaCSS",()=>{const i=this.mediaStyleDomMap;Object.keys(i).forEach(c=>{var l;(l=this.domHeader)==null||l.removeChild(i[c])}),this.mediaStyleDomMap={}});j(this,"rebuildNode",()=>{this.storeListenDisposeList.forEach(i=>i()),this.removeMediaCSS(),this.connectStore(),this.addMediaCSS(),this.forceUpdate()});this.targetComponentRef=C.createRef(),this.state=r.value.state||{};const c=r.value.nodeName||r.id;this.nodeName=c;const l=n.storeManager.getStore(c);l?(this.storeState=l,l.setState({...r.value.state||{}})):this.storeState=n.storeManager.addStore(c,()=>({...r.value.state||{}})),this.storeState.subscribe(p=>{this.setState({...p})}),this.connectStore();const f=n.variableManager.get(c);f?this.variableSpace=f:(this.variableSpace={staticVar:{},methods:{}},n.variableManager.add(c,this.variableSpace))}connectStore(){const i=n.collectSpecialProps(r.props,d=>!!Mt(d)),c=n.collectSpecialProps({css:r.value.css,class:r.value.classNames},d=>!!Mt(d));let l=[];[...i,...c].map(d=>{const v=d.val,y=[/\$\$context.stateManager\.(.+?)\./gim,/\$\$context.stateManager\["(.+?)"\]/gim,/\$\$context.stateManager\['(.+?)'\]/gim,/getStateObj\('(.+?)'\)/gim,/getStateObj\("(.+?)"\)/gim,/getStateById\('(.+?)'\)/gim,/getStateById\("(.+?)"\)/gim],S=Pa(v.value,y);l=[...l,...S]}).filter(Boolean);const f=Array.from(new Set(l)),p=[];f.length&&f.forEach(d=>{n.storeManager.getStore(d)||(n.storeManager.addStore(d,()=>({})),console.warn(n.storeManager,d,"not exits"));const y=n.storeManager.connect(d,()=>{this.forceUpdate()});p.push(y)}),this.storeListenDisposeList=p}componentDidMount(){var c;this.addMediaCSS(),n.onGetRef&&n.onGetRef(this.targetComponentRef,r,this),(c=n.onComponentMount)==null||c.call(n,this,r);const i=()=>{n.storeManager.setStore(r.value.nodeName||r.id,this.storeState),this.storeState.setState({...this.state,...r.value.state||{}}),this.rebuildNode()};r.onChange(i)}componentWillUnmount(){var i;this.storeListenDisposeList.forEach(c=>c()),this.removeMediaCSS(),(i=n.onComponentDestroy)==null||i.call(n,this,r)}render(){var ae;const{$$context:i,...c}=this.props,l=r.value.nodeName||r.id,f={key:r.id,...r.props,...c},p={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:n.storeManager,getState:()=>n.storeManager.getStateObj(l),getStateObj:()=>n.storeManager.getStateObj(l),getStateObjById:B=>n.storeManager.getStateObj(B),stateManager:n.storeManager.getStateSnapshot(),getMethods:()=>n.variableManager.get(l).methods,getMethodsById:B=>n.variableManager.get(B).methods,getStaticVar:()=>n.variableManager.get(l).staticVar,getStaticVarById:B=>n.variableManager.get(B).staticVar};r.value.componentName===Qt.ROOT_CONTAINER&&(p.globalState=this.state,p.updateGlobalState=this.updateState);const d=n.getContext(p,i),S=n.transformProps({methods:r.value.methods},{$$context:d}).methods.reduce((B,H)=>(B[H.name]=H.define,B),{});d.methods=S,this.variableSpace.methods=Object.assign(this.variableSpace.methods,S);const O=r.value.loop;let N=[];if(O&&O.open){this.targetComponentRef.current=[];let B=O.data||[];if(Mt(O.data)){const H=O.data;B=Lt(H.value,d||{})}return N=B.map((...H)=>{var Ze;const rt=H[1],it=[O.forName||"item",O.forIndex||"index"],ie=cn(H,it);let se="loopData";O.name&&(se=`${se}${O.name}`);const Ct=n.getContext({[se]:ie},d),nt=n.transformProps(f,{$$context:Ct}),Ke=((Ze=r.value.classNames)==null?void 0:Ze.map(q=>{var Et;const wt=q.name;return(Mt(q.status)?Lt(String(((Et=q.status)==null?void 0:Et.value)||""),Ct):!1)?wt:""}))||[];let ce=`${nt.className??""} ${Ke.join(" ")}`.trim();r.value.css&&(ce=`${r.value.css.class} ${ce}`.trim()),nt.className=ce;const Xe=n.transformProps(r.value.style,{$$context:Ct});r.value.style&&(nt.style=un(Xe||{}));const{children:kt}=nt;let Re=[];if(kt!==void 0)delete nt.children,Re=Array.isArray(kt)?kt:[kt];else{const q=[];r.value.children.forEach((Ut,Et)=>{const ue=n.buildComponent(Ut,{$$context:Ct,idx:Et});q.push(ue)}),Re=q}if(nt.key=`${nt.key}-${rt}`,Mt(O.key)){const q=O.key,wt=Lt(q.value,Ct||{});nt.key+=`-${wt}`}return nt.ref=q=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[rt]=q},n.render(e,nt,...Re)}),N}const w=n.transformProps(f,{$$context:d}),{children:U}=w;let F=[];if(U!==void 0)delete w.children,F=Array.isArray(U)?U:[U];else{const B=[];r.value.children.forEach((rt,it)=>{const ie=n.buildComponent(rt,{$$context:d,idx:it});B.push(ie)}),F=B}w.ref=this.targetComponentRef;const J=((ae=r.value.classNames)==null?void 0:ae.map(B=>{var it;const H=B.name;return(Mt(B.status)?Lt(((it=B.status)==null?void 0:it.value)||"",d):!1)?H:""}))||[];let tt=`${w.className??""} ${J.join(" ")}`.trim();r.value.css&&(tt=`${r.value.css.class} ${tt}`.trim()),w.className=tt;const Ft=n.transformProps(r.value.style,{$$context:d});r.value.style&&(w.style=un(Ft||{}));let R=r.value.condition??!0;typeof R!="boolean"&&(R=Lt(R.value,d||{}));let ft={condition:R,props:w};n.processNodeConfigHook&&(ft=n.processNodeConfigHook(ft,r));const _t=n.render(e,ft.props,...F);return this._CONDITION=ft.condition,ft.condition?_t:C.createElement("div",{style:{display:"none"}},_t)}}return j(o,"__CP_TYPE__",Qe),o.displayName=`${r.value.componentName}Dynamic`,o}buildComponent(e,{$$context:r={}}){const n=this.runtimeComponentCache;return typeof e=="string"?this.render(e):jd(e)?(({currentNode:a})=>{const s=a.value.id;let i=null;if(n.get(s))i=n.get(s);else{const f=this.getComponent(a);i=this.convertModelToComponent(f,a)}!n.get(s)&&this.renderMode!=="design"&&n.set(s,i);const c=`${s}-${Qe}`,l={$$context:r,$$nodeModel:e,key:c};return this.render(i,l)})({currentNode:e}):void 0}render(e,r={},...n){return typeof e=="string"||typeof e=="number"?String(e):(sm.forEach(a=>{a in r&&e.__CP_TYPE__!==Qe&&delete r[a]}),C.createElement(e,r,...n))}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const fm=yn(new Ma),dm=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"];var pm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fn={exports:{}},Pe={};/**
|
|
21
|
+
* @license React
|
|
22
|
+
* react-jsx-runtime.production.min.js
|
|
23
|
+
*
|
|
24
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the MIT license found in the
|
|
27
|
+
* LICENSE file in the root directory of this source tree.
|
|
28
|
+
*/var xa;function vm(){if(xa)return Pe;xa=1;var t=C,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(i,c,l){var f,p={},d=null,v=null;l!==void 0&&(d=""+l),c.key!==void 0&&(d=""+c.key),c.ref!==void 0&&(v=c.ref);for(f in c)n.call(c,f)&&!a.hasOwnProperty(f)&&(p[f]=c[f]);if(i&&i.defaultProps)for(f in c=i.defaultProps,c)p[f]===void 0&&(p[f]=c[f]);return{$$typeof:e,type:i,key:d,ref:v,props:p,_owner:o.current}}return Pe.Fragment=r,Pe.jsx=s,Pe.jsxs=s,Pe}var Ae={};/**
|
|
29
|
+
* @license React
|
|
30
|
+
* react-jsx-runtime.development.js
|
|
31
|
+
*
|
|
32
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the MIT license found in the
|
|
35
|
+
* LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/var Da;function mm(){return Da||(Da=1,process.env.NODE_ENV!=="production"&&function(){var t=C,e=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),y=Symbol.iterator,S="@@iterator";function O(u){if(u===null||typeof u!="object")return null;var h=y&&u[y]||u[S];return typeof h=="function"?h:null}var N=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(u){{for(var h=arguments.length,m=new Array(h>1?h-1:0),E=1;E<h;E++)m[E-1]=arguments[E];U("error",u,m)}}function U(u,h,m){{var E=N.ReactDebugCurrentFrame,A=E.getStackAddendum();A!==""&&(h+="%s",m=m.concat([A]));var x=m.map(function(P){return String(P)});x.unshift("Warning: "+h),Function.prototype.apply.call(console[u],console,x)}}var F=!1,J=!1,tt=!1,Ft=!1,R=!1,ft;ft=Symbol.for("react.module.reference");function _t(u){return!!(typeof u=="string"||typeof u=="function"||u===n||u===a||R||u===o||u===l||u===f||Ft||u===v||F||J||tt||typeof u=="object"&&u!==null&&(u.$$typeof===d||u.$$typeof===p||u.$$typeof===s||u.$$typeof===i||u.$$typeof===c||u.$$typeof===ft||u.getModuleId!==void 0))}function ae(u,h,m){var E=u.displayName;if(E)return E;var A=h.displayName||h.name||"";return A!==""?m+"("+A+")":m}function B(u){return u.displayName||"Context"}function H(u){if(u==null)return null;if(typeof u.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case n:return"Fragment";case r:return"Portal";case a:return"Profiler";case o:return"StrictMode";case l:return"Suspense";case f:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case i:var h=u;return B(h)+".Consumer";case s:var m=u;return B(m._context)+".Provider";case c:return ae(u,u.render,"ForwardRef");case p:var E=u.displayName||null;return E!==null?E:H(u.type)||"Memo";case d:{var A=u,x=A._payload,P=A._init;try{return H(P(x))}catch{return null}}}return null}var rt=Object.assign,it=0,ie,se,Ct,nt,Ke,ce,Xe;function kt(){}kt.__reactDisabledLog=!0;function Re(){{if(it===0){ie=console.log,se=console.info,Ct=console.warn,nt=console.error,Ke=console.group,ce=console.groupCollapsed,Xe=console.groupEnd;var u={configurable:!0,enumerable:!0,value:kt,writable:!0};Object.defineProperties(console,{info:u,log:u,warn:u,error:u,group:u,groupCollapsed:u,groupEnd:u})}it++}}function Ze(){{if(it--,it===0){var u={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:rt({},u,{value:ie}),info:rt({},u,{value:se}),warn:rt({},u,{value:Ct}),error:rt({},u,{value:nt}),group:rt({},u,{value:Ke}),groupCollapsed:rt({},u,{value:ce}),groupEnd:rt({},u,{value:Xe})})}it<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=N.ReactCurrentDispatcher,wt;function Ut(u,h,m){{if(wt===void 0)try{throw Error()}catch(A){var E=A.stack.trim().match(/\n( *(at )?)/);wt=E&&E[1]||""}return`
|
|
37
|
+
`+wt+u}}var Et=!1,ue;{var Nm=typeof WeakMap=="function"?WeakMap:Map;ue=new Nm}function Ga(u,h){if(!u||Et)return"";{var m=ue.get(u);if(m!==void 0)return m}var E;Et=!0;var A=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var x;x=q.current,q.current=null,Re();try{if(h){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(St){E=St}Reflect.construct(u,[],P)}else{try{P.call()}catch(St){E=St}u.call(P.prototype)}}else{try{throw Error()}catch(St){E=St}u()}}catch(St){if(St&&E&&typeof St.stack=="string"){for(var $=St.stack.split(`
|
|
38
|
+
`),Q=E.stack.split(`
|
|
39
|
+
`),W=$.length-1,Y=Q.length-1;W>=1&&Y>=0&&$[W]!==Q[Y];)Y--;for(;W>=1&&Y>=0;W--,Y--)if($[W]!==Q[Y]){if(W!==1||Y!==1)do if(W--,Y--,Y<0||$[W]!==Q[Y]){var st=`
|
|
40
|
+
`+$[W].replace(" at new "," at ");return u.displayName&&st.includes("<anonymous>")&&(st=st.replace("<anonymous>",u.displayName)),typeof u=="function"&&ue.set(u,st),st}while(W>=1&&Y>=0);break}}}finally{Et=!1,q.current=x,Ze(),Error.prepareStackTrace=A}var fe=u?u.displayName||u.name:"",ri=fe?Ut(fe):"";return typeof u=="function"&&ue.set(u,ri),ri}function $m(u,h,m){return Ga(u,!1)}function Pm(u){var h=u.prototype;return!!(h&&h.isReactComponent)}function tr(u,h,m){if(u==null)return"";if(typeof u=="function")return Ga(u,Pm(u));if(typeof u=="string")return Ut(u);switch(u){case l:return Ut("Suspense");case f:return Ut("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case c:return $m(u.render);case p:return tr(u.type,h,m);case d:{var E=u,A=E._payload,x=E._init;try{return tr(x(A),h,m)}catch{}}}return""}var er=Object.prototype.hasOwnProperty,za={},Wa=N.ReactDebugCurrentFrame;function rr(u){if(u){var h=u._owner,m=tr(u.type,u._source,h?h.type:null);Wa.setExtraStackFrame(m)}else Wa.setExtraStackFrame(null)}function Am(u,h,m,E,A){{var x=Function.call.bind(er);for(var P in u)if(x(u,P)){var $=void 0;try{if(typeof u[P]!="function"){var Q=Error((E||"React class")+": "+m+" type `"+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[P]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Q.name="Invariant Violation",Q}$=u[P](h,P,E,m,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(W){$=W}$&&!($ instanceof Error)&&(rr(A),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",E||"React class",m,P,typeof $),rr(null)),$ instanceof Error&&!($.message in za)&&(za[$.message]=!0,rr(A),w("Failed %s type: %s",m,$.message),rr(null))}}}var Rm=Array.isArray;function dn(u){return Rm(u)}function Mm(u){{var h=typeof Symbol=="function"&&Symbol.toStringTag,m=h&&u[Symbol.toStringTag]||u.constructor.name||"Object";return m}}function xm(u){try{return Ha(u),!1}catch{return!0}}function Ha(u){return""+u}function Ya(u){if(xm(u))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Mm(u)),Ha(u)}var Me=N.ReactCurrentOwner,Dm={key:!0,ref:!0,__self:!0,__source:!0},Ja,qa,pn;pn={};function Im(u){if(er.call(u,"ref")){var h=Object.getOwnPropertyDescriptor(u,"ref").get;if(h&&h.isReactWarning)return!1}return u.ref!==void 0}function Lm(u){if(er.call(u,"key")){var h=Object.getOwnPropertyDescriptor(u,"key").get;if(h&&h.isReactWarning)return!1}return u.key!==void 0}function Fm(u,h){if(typeof u.ref=="string"&&Me.current&&h&&Me.current.stateNode!==h){var m=H(Me.current.type);pn[m]||(w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',H(Me.current.type),u.ref),pn[m]=!0)}}function km(u,h){{var m=function(){Ja||(Ja=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",h))};m.isReactWarning=!0,Object.defineProperty(u,"key",{get:m,configurable:!0})}}function Um(u,h){{var m=function(){qa||(qa=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",h))};m.isReactWarning=!0,Object.defineProperty(u,"ref",{get:m,configurable:!0})}}var Bm=function(u,h,m,E,A,x,P){var $={$$typeof:e,type:u,key:h,ref:m,props:P,_owner:x};return $._store={},Object.defineProperty($._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty($,"_self",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.defineProperty($,"_source",{configurable:!1,enumerable:!1,writable:!1,value:A}),Object.freeze&&(Object.freeze($.props),Object.freeze($)),$};function Vm(u,h,m,E,A){{var x,P={},$=null,Q=null;m!==void 0&&(Ya(m),$=""+m),Lm(h)&&(Ya(h.key),$=""+h.key),Im(h)&&(Q=h.ref,Fm(h,A));for(x in h)er.call(h,x)&&!Dm.hasOwnProperty(x)&&(P[x]=h[x]);if(u&&u.defaultProps){var W=u.defaultProps;for(x in W)P[x]===void 0&&(P[x]=W[x])}if($||Q){var Y=typeof u=="function"?u.displayName||u.name||"Unknown":u;$&&km(P,Y),Q&&Um(P,Y)}return Bm(u,$,Q,A,E,Me.current,P)}}var hn=N.ReactCurrentOwner,Qa=N.ReactDebugCurrentFrame;function le(u){if(u){var h=u._owner,m=tr(u.type,u._source,h?h.type:null);Qa.setExtraStackFrame(m)}else Qa.setExtraStackFrame(null)}var vn;vn=!1;function mn(u){return typeof u=="object"&&u!==null&&u.$$typeof===e}function Ka(){{if(hn.current){var u=H(hn.current.type);if(u)return`
|
|
41
|
+
|
|
42
|
+
Check the render method of \``+u+"`."}return""}}function Gm(u){{if(u!==void 0){var h=u.fileName.replace(/^.*[\\\/]/,""),m=u.lineNumber;return`
|
|
43
|
+
|
|
44
|
+
Check your code at `+h+":"+m+"."}return""}}var Xa={};function zm(u){{var h=Ka();if(!h){var m=typeof u=="string"?u:u.displayName||u.name;m&&(h=`
|
|
45
|
+
|
|
46
|
+
Check the top-level render call using <`+m+">.")}return h}}function Za(u,h){{if(!u._store||u._store.validated||u.key!=null)return;u._store.validated=!0;var m=zm(h);if(Xa[m])return;Xa[m]=!0;var E="";u&&u._owner&&u._owner!==hn.current&&(E=" It was passed a child from "+H(u._owner.type)+"."),le(u),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',m,E),le(null)}}function ti(u,h){{if(typeof u!="object")return;if(dn(u))for(var m=0;m<u.length;m++){var E=u[m];mn(E)&&Za(E,h)}else if(mn(u))u._store&&(u._store.validated=!0);else if(u){var A=O(u);if(typeof A=="function"&&A!==u.entries)for(var x=A.call(u),P;!(P=x.next()).done;)mn(P.value)&&Za(P.value,h)}}}function Wm(u){{var h=u.type;if(h==null||typeof h=="string")return;var m;if(typeof h=="function")m=h.propTypes;else if(typeof h=="object"&&(h.$$typeof===c||h.$$typeof===p))m=h.propTypes;else return;if(m){var E=H(h);Am(m,u.props,"prop",E,u)}else if(h.PropTypes!==void 0&&!vn){vn=!0;var A=H(h);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",A||"Unknown")}typeof h.getDefaultProps=="function"&&!h.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Hm(u){{for(var h=Object.keys(u.props),m=0;m<h.length;m++){var E=h[m];if(E!=="children"&&E!=="key"){le(u),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",E),le(null);break}}u.ref!==null&&(le(u),w("Invalid attribute `ref` supplied to `React.Fragment`."),le(null))}}function ei(u,h,m,E,A,x){{var P=_t(u);if(!P){var $="";(u===void 0||typeof u=="object"&&u!==null&&Object.keys(u).length===0)&&($+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Q=Gm(A);Q?$+=Q:$+=Ka();var W;u===null?W="null":dn(u)?W="array":u!==void 0&&u.$$typeof===e?(W="<"+(H(u.type)||"Unknown")+" />",$=" Did you accidentally export a JSX literal instead of a component?"):W=typeof u,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",W,$)}var Y=Vm(u,h,m,A,x);if(Y==null)return Y;if(P){var st=h.children;if(st!==void 0)if(E)if(dn(st)){for(var fe=0;fe<st.length;fe++)ti(st[fe],u);Object.freeze&&Object.freeze(st)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ti(st,u)}return u===n?Hm(Y):Wm(Y),Y}}function Ym(u,h,m){return ei(u,h,m,!0)}function Jm(u,h,m){return ei(u,h,m,!1)}var qm=Jm,Qm=Ym;Ae.Fragment=n,Ae.jsx=qm,Ae.jsxs=Qm}()),Ae}process.env.NODE_ENV==="production"?fn.exports=vm():fn.exports=mm();var gm=fn.exports;const ym=gm.jsx,bt=t=>{const e={};return t.forEach(r=>{e[r.key]=r.value}),e},bm=[...dm,...cd].reduce((t,e)=>(t[e]=({children:r,$$attributes:n=[],...o})=>{let a=r;return Array.isArray(r)||(a=[r]),C.createElement(e,{...o,...bt(n)},...a)},t),{}),_m={RootContainer:({children:t})=>t,...bm,CContainer:({children:t,$$attributes:e=[],afterMount:r,beforeDestroy:n,...o})=>{let a=t;return Array.isArray(t)||(a=[t]),C.useEffect(()=>(r==null||r(o),()=>{n==null||n(o)}),[]),ym("div",{...o,...bt(e),children:a})},CVideo:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),C.createElement("video",{...r,...bt(e)},...n)},CAudio:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),C.createElement("audio",{...r,...bt(e)},...n)},CBlock:({children:t,width:e,height:r,$$attributes:n=[],...o})=>{let a=t;Array.isArray(t)||(a=[t]),a=a.filter(l=>l!==void 0);const{style:s={},...i}=bt(n),c={height:r,width:e,...s,...o.style||{}};return C.createElement("div",{...o,...i,style:c},...a)},CImage:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),C.createElement("img",{...r,...bt(e)},...n)},CText:({$$attributes:t=[],content:e,...r})=>C.createElement("span",{...r,...bt(t)},e),CCanvas:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),C.createElement("canvas",{...r,...bt(e)},...n)},CNativeTag:({children:t,$$attributes:e=[],htmlTag:r="div",...n})=>{let o=t;Array.isArray(t)||(o=[t]);const{style:a={},...s}=bt(e),i={...a,...n.style||{}};return C.createElement(r,{...n,...s,style:i},...o)}};class Sm{constructor(){j(this,"refMap",new Map)}get(e){return this.refMap.get(e)}add(e,r){this.refMap.set(e,r)}remove(e){this.refMap.delete(e)}destroy(){this.refMap.clear()}}class Ia extends C.Component{constructor(r){super(r);j(this,"refManager");j(this,"dynamicComponentInstanceMap",new Map);j(this,"onGetRef",(r,n,o)=>{var a,s;(s=(a=this.props).onGetRef)==null||s.call(a,r,n,o),this.dynamicComponentInstanceMap.set(n.id,o),this.refManager.add(n.value.refId||n.id,r)});j(this,"rerender",r=>{if(this.props.adapter.clear(),(r==null?void 0:r.nodeType)==="PAGE"&&r)this.setState({pageModel:r});else if(ne(r)&&Fo(r)){const n=r;this.setState({pageModel:new We(n,{materials:this.state.pageModel.materialsModel.rawValue})})}});this.state={pageModel:r.pageModel||new We(r.page)},this.refManager=new Sm}getPageModel(){return this.state.pageModel}componentDidMount(){const{render:r}=this.props;r&&(r.ref.current=this)}componentWillUnmount(){this.refManager.destroy()}render(){const{props:r}=this,{adapter:n,onGetComponent:o,onComponentDestroy:a,onComponentMount:s}=r,{pageModel:i}=this.state;if(!i)return console.warn("pageModel is null"),null;const c={..._m,...r.components},l=this.props.$$context??{};return l.refs=this.refManager,n.pageRender(i,{libs:{},components:c,onGetRef:this.onGetRef,onGetComponent:o,onComponentMount:s,onComponentDestroy:a,$$context:l,renderMode:r.renderMode,processNodeConfigHook:r.processNodeConfigHook})}}const Om=()=>{const t=C.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)}}};class jm extends C.Component{constructor(r){super(r);j(this,"onDoubleClick",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:""}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){var o,a;(a=(o=this.props).onError)==null||a.call(o,n)}render(){if(this.state.hasError){const{onDoubleClick:r}=this,n=this.props.node.value;console.error(this.props.node,this.props.children);const o=C.createElement("div",{style:{backgroundColor:"rgb(255 206 215 / 13%)",padding:"5px",color:"#ff0000b0",textAlign:"center",fontSize:"12px"}},"Render error, node id: ",n.id,", node name:",n.title," component name:",n.title||n.componentName,C.createElement("p",null,"msg: ",String(this.state.error)),C.createElement("button",{onDoubleClick:r,style:{border:"1px solid rgba(100,100,100,0.1)",backgroundColor:"#fff",padding:"5px 10px",borderRadius:"2px",color:"gray",cursor:"pointer",marginTop:"5px"}},"double click to refresh"),C.createElement("div",{style:{display:"none"}}));return C.createElement(this.props.targetComponent,{onlyRenderChild:!0},o)}return this.props.children}}class La{constructor(){j(this,"instanceMap",new Map)}get(e){return this.instanceMap.get(e)}add(e,r){const n=this.instanceMap.get(e);n?n.push(r):this.instanceMap.set(e,[r])}remove(e,r){const n=this.instanceMap.get(e);if(r!==void 0&&Array.isArray(n)){const o=n.filter(a=>a!==r);this.instanceMap.set(e,o)}else this.instanceMap.delete(e)}destroy(){this.instanceMap.clear()}}const Fa=t=>{const{node:e}=t,r=C.useMemo(()=>{const i=e.isContainer();return ne(i)?i:{placeholder:"Drag the component to place it",width:"100%",height:"100%",style:{}}},[t.node]),{placeholder:n,height:o,width:a,style:s}=r;return C.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(200,200,200,0.1)",border:"1px solid rgba(0,0,0,0.1)",borderRadius:"2px",fontSize:"14px",color:"gray",cursor:"default",minWidth:"300px",minHeight:"50px",width:a,height:o,...s}},n)};class Cm extends C.Component{constructor(r){super(r);j(this,"instanceManager",new La);j(this,"renderRef");j(this,"dropPlaceholder",Fa);j(this,"onGetComponent",(r,n)=>{var c,l;const o=this;let a=r;const s=(l=(c=n.material)==null?void 0:c.value.advanceCustom)==null?void 0:l.wrapComponent;s&&(a=s(r,{node:n,ctx:window.__C_ENGINE_DESIGNER_PLUGIN_CTX__}));class i extends C.Component{constructor(){super(...arguments);j(this,"_DESIGN_BOX",!0);j(this,"_NODE_MODEL",n);j(this,"_NODE_ID",n.id);j(this,"_UNIQUE_ID",`${n.id}_${vt()}`);j(this,"_STATUS")}componentDidMount(){o.instanceManager.add(n.id,this)}componentWillUnmount(){this._STATUS="DESTROY",o.instanceManager.remove(n.id,this)}render(){const{children:d=[],onlyRenderChild:v,...y}=this.props;let S=d;return ee(d)||(S=[d]),!!!S.filter(Boolean).length&&(n.isContainer()||n.value.componentName===Qt.ROOT_CONTAINER)&&S.push(C.createElement(o.dropPlaceholder,{node:n})),v?S:C.createElement(a,y,...S)}}return C.forwardRef(function(p,d){return C.createElement(jm,{node:n,targetComponent:i},C.createElement(i,{ref:d,...p}))})});this.renderRef=C.createRef(),r.dropPlaceholder&&(this.dropPlaceholder=r.dropPlaceholder)}componentDidMount(){var r,n;(n=(r=this.props).onMount)==null||n.call(r,this)}getPageModel(){var r;return(r=this.renderRef.current)==null?void 0:r.state.pageModel}rerender(r){var n;return(n=this.renderRef.current)==null?void 0:n.rerender(r)}getInstancesById(r,n){let o=[...this.instanceManager.get(r)||[]];return n!==void 0&&(o=o.filter(a=>n===(a==null?void 0:a._UNIQUE_ID))),o}getInstanceByDom(r){const n=ka(r);if(!n)return null;const o=Ua(n);return(o==null?void 0:o.stateNode)||null}getDomsById(r,n){const o=this.getInstancesById(r),a=[];return o==null||o.forEach(s=>{var c;if((s==null?void 0:s._STATUS)==="DESTROY")return;const i=oi.findDOMNode(s);if(i&&!(i instanceof Text))if(n){const l=Array.from(((c=i.querySelectorAll)==null?void 0:c.call(i,n))||[]);a.push(...l)}else a.push(i)}),a}getDomRectById(r,n){return this.getDomsById(r,n).map(s=>s==null?void 0:s.getBoundingClientRect()).filter(Boolean)}render(){const{props:r,onGetComponent:n}=this,{render:o,...a}=r;return o&&(o.ref.current=this),C.createElement(Ia,{onGetComponent:n,...a,processNodeConfigHook:(s,i)=>{var y,S;if(i.nodeType!=="NODE")return s;const{props:c,condition:l}=s;let f={...c};const p=((y=i.value.configure)==null?void 0:y.devState)||{},d=(S=i.material)==null?void 0:S.value.fixedProps;if(d!==void 0){if(ne(d))f={...f,...d};else if(typeof d=="function"){const O=d(f);f={...f,...O}}}let v=l;return p.condition===!1&&(v=p.condition),{props:em(f,p.props||{}),condition:v}},ref:this.renderRef})}}const ka=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:ka(t.parentElement)},Ua=t=>{var e;return t?(e=t==null?void 0:t.stateNode)!=null&&e._DESIGN_BOX?t:Ua(t.return):null},wm=()=>{const t=C.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)},getInstancesById(e,r){var n;return((n=t.current)==null?void 0:n.getInstancesById(e,r))||[]},getInstanceByDom(e){var r;return((r=t.current)==null?void 0:r.getInstanceByDom(e))||null},getDomsById(e,r){var n;return((n=t.current)==null?void 0:n.getDomsById(e,r))||[]},getDomRectById(e,r){var n;return((n=t.current)==null?void 0:n.getDomRectById(e,r))||[]}}};var Ba={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(pm,function(){var r=function(){},n={},o={},a={};function s(d,v){d=d.push?d:[d];var y=[],S=d.length,O=S,N,w,U,F;for(N=function(J,tt){tt.length&&y.push(J),O--,O||v(y)};S--;){if(w=d[S],U=o[w],U){N(w,U);continue}F=a[w]=a[w]||[],F.push(N)}}function i(d,v){if(d){var y=a[d];if(o[d]=v,!!y)for(;y.length;)y[0](d,v),y.splice(0,1)}}function c(d,v){d.call&&(d={success:d}),v.length?(d.error||r)(v):(d.success||r)(d)}function l(d,v,y,S){var O=document,N=y.async,w=(y.numRetries||0)+1,U=y.before||r,F=d.replace(/[\?|#].*$/,""),J=d.replace(/^(css|img|module|nomodule)!/,""),tt,Ft,R;if(S=S||0,/(^css!|\.css$)/.test(F))R=O.createElement("link"),R.rel="stylesheet",R.href=J,tt="hideFocus"in R,tt&&R.relList&&(tt=0,R.rel="preload",R.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(F))R=O.createElement("img"),R.src=J;else if(R=O.createElement("script"),R.src=J,R.async=N===void 0?!0:N,Ft="noModule"in R,/^module!/.test(F)){if(!Ft)return v(d,"l");R.type="module"}else if(/^nomodule!/.test(F)&&Ft)return v(d,"l");R.onload=R.onerror=R.onbeforeload=function(ft){var _t=ft.type[0];if(tt)try{R.sheet.cssText.length||(_t="e")}catch(ae){ae.code!=18&&(_t="e")}if(_t=="e"){if(S+=1,S<w)return l(d,v,y,S)}else if(R.rel=="preload"&&R.as=="style")return R.rel="stylesheet";v(d,_t,ft.defaultPrevented)},U(d,R)!==!1&&O.head.appendChild(R)}function f(d,v,y){d=d.push?d:[d];var S=d.length,O=S,N=[],w,U;for(w=function(F,J,tt){if(J=="e"&&N.push(F),J=="b")if(tt)N.push(F);else return;S--,S||v(N)},U=0;U<O;U++)l(d[U],w,y)}function p(d,v,y){var S,O;if(v&&v.trim&&(S=v),O=(S?y:v)||{},S){if(S in n)throw"LoadJS";n[S]=!0}function N(w,U){f(d,function(F){c(O,F),w&&c({success:w,error:U},F),i(S,F)},O)}if(O.returnPromise)return new Promise(N);N()}return p.ready=function(v,y){return s(v,function(S){c(y,S)}),p},p.done=function(v){i(v,[])},p.reset=function(){n={},o={},a={}},p.isDefined=function(v){return v in n},p})})(Ba);var Em=Ba.exports;const Va=hm(Em);class Tm{constructor(e,r){j(this,"assets");j(this,"loadStatus");j(this,"win",window);j(this,"_onSuccessList",[]);j(this,"_onErrorList",[]);this.assets=JSON.parse(JSON.stringify(e||[])),this.loadStatus="INIT",r!=null&&r.window&&(this.win=r.window)}load(){const e=this.assets||[],r=[];for(let n=0;n<e.length;n++){const o=e[n];o.id||(o.id=vt()),r.push(o.id);const a=o.resources.map(s=>s.src);a.length&&Va(a,o.id,{async:!1,before:(s,i)=>(this.win.document.body.appendChild(i),!1)})}return new Promise((n,o)=>{if(e.length===0){this._onSuccessList.forEach(a=>a()),n("");return}Va.ready(r,{success:()=>{this._onSuccessList.forEach(a=>a()),n("")},error:a=>{this._onErrorList.forEach(s=>s(a)),o(a)}})})}onSuccess(e){return this._onSuccessList.push(e),this}onError(e){return this._onErrorList.push(e),this}}_.AssetLoader=Tm,_.ComponentInstanceManager=La,_.DefaultDropPlaceholder=Fa,_.DefineReactAdapter=Ma,_.DesignRender=Cm,_.ReactAdapter=fm,_.Render=Ia,_.canAcceptsRef=Ta,_.collectVariable=nm,_.compWrapper=Na,_.convertCodeStringToFunction=$a,_.flatObject=om,_.formatSourceStylePropertyName=un,_.getAdapter=yn,_.getCSSTextValue=ln,_.getComponentsLibs=am,_.getMatchVal=Pa,_.getObjFromArrayMap=cn,_.getThirdLibs=im,_.isClass=rm,_.runExpression=Lt,_.shouldConstruct=Ea,_.useDesignRender=wm,_.useRender=Om,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
|
|
21
47
|
//# sourceMappingURL=index.umd.js.map
|