@chamn/render 0.0.1-beta.0
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/.eslintignore +1 -0
- package/.eslintrc.js +30 -0
- package/.prettierrc.json +7 -0
- package/LICENSE +201 -0
- package/__tests__/demo.test.ts +3 -0
- package/build.config.js +20 -0
- package/dist/commonComponent/index.d.ts +12 -0
- package/dist/const/index.d.ts +2 -0
- package/dist/core/ReactErrorBoundary.d.ts +26 -0
- package/dist/core/adapter.d.ts +64 -0
- package/dist/core/adapterReact.d.ts +108 -0
- package/dist/core/designReactRender.d.ts +47 -0
- package/dist/core/refManager.d.ts +7 -0
- package/dist/core/render.d.ts +32 -0
- package/dist/core/storeManager.d.ts +11 -0
- package/dist/core/type.d.ts +9 -0
- package/dist/index.cjs.js +16 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.es.js +4432 -0
- package/dist/index.es.js.map +1 -0
- package/dist/util/assetsLoader.d.ts +15 -0
- package/dist/util/index.d.ts +17 -0
- package/dist/vite-env.d.ts +1 -0
- package/dist/vite.svg +1 -0
- package/index.html +16 -0
- package/jest.config.js +196 -0
- package/package.json +42 -0
- package/public/vite.svg +1 -0
- package/src/_dev_/components.tsx +12 -0
- package/src/_dev_/dev.tsx +12 -0
- package/src/_dev_/index.css +13 -0
- package/src/_dev_/page/DesignerRenderDemo.tsx +65 -0
- package/src/_dev_/page/RenderDemo.tsx +60 -0
- package/src/_dev_/router.tsx +15 -0
- package/src/commonComponent/index.tsx +184 -0
- package/src/const/index.ts +5 -0
- package/src/core/ReactErrorBoundary.ts +91 -0
- package/src/core/adapter.ts +133 -0
- package/src/core/adapterReact.ts +734 -0
- package/src/core/designReactRender.ts +325 -0
- package/src/core/refManager.ts +18 -0
- package/src/core/render.ts +123 -0
- package/src/core/storeManager.ts +57 -0
- package/src/core/type.ts +10 -0
- package/src/index.ts +5 -0
- package/src/util/assetsLoader.ts +72 -0
- package/src/util/index.ts +129 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";var ia=Object.defineProperty;var sa=(t,e,r)=>e in t?ia(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var g=(t,e,r)=>(sa(t,typeof e!="symbol"?e+"":e,r),r);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const ut=require("react"),ca=require("react-dom"),ua=t=>t&&typeof t=="object"&&"default"in t?t:{default:t};function la(t){if(t&&t.__esModule)return 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 w=ua(ut),fa=la(ca),pa=t=>()=>{console.warn(`${t} need to be implement getComponent`)},da=["customPageRootRender"],Dr=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","getDataLink","createDataLink","transformProps","transformData","transformGlobalData","errorCatch","clear"],Dn=t=>[...Dr,...da].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):Dr.includes(n)&&(r[n]=pa),r},{});var ha=Object.defineProperty,va=(t,e,r)=>e in t?ha(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_=(t,e,r)=>(va(t,typeof e!="symbol"?e+"":e,r),r),ma=typeof global=="object"&&global&&global.Object===Object&&global;const In=ma;var ya=typeof self=="object"&&self&&self.Object===Object&&self,ga=In||ya||Function("return this")();const Y=ga;var ba=Y.Symbol;const z=ba;var Ln=Object.prototype,_a=Ln.hasOwnProperty,ja=Ln.toString,Ut=z?z.toStringTag:void 0;function wa(t){var e=_a.call(t,Ut),r=t[Ut];try{t[Ut]=void 0;var n=!0}catch{}var o=ja.call(t);return n&&(e?t[Ut]=r:delete t[Ut]),o}var Sa=Object.prototype,Oa=Sa.toString;function Ca(t){return Oa.call(t)}var Ea="[object Null]",Na="[object Undefined]",Ir=z?z.toStringTag:void 0;function dt(t){return t==null?t===void 0?Na:Ea:Ir&&Ir in Object(t)?wa(t):Ca(t)}function Q(t){return t!=null&&typeof t=="object"}var $a="[object Symbol]";function Ze(t){return typeof t=="symbol"||Q(t)&&dt(t)==$a}function tr(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 Ta=Array.isArray;const M=Ta;var Aa=1/0,Lr=z?z.prototype:void 0,Fr=Lr?Lr.toString:void 0;function Fn(t){if(typeof t=="string")return t;if(M(t))return tr(t,Fn)+"";if(Ze(t))return Fr?Fr.call(t):"";var e=t+"";return e=="0"&&1/t==-Aa?"-0":e}function J(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function er(t){return t}var xa="[object AsyncFunction]",Ma="[object Function]",Pa="[object GeneratorFunction]",Ra="[object Proxy]";function rr(t){if(!J(t))return!1;var e=dt(t);return e==Ma||e==Pa||e==xa||e==Ra}var Da=Y["__core-js_shared__"];const $e=Da;var Br=function(){var t=/[^.]+$/.exec($e&&$e.keys&&$e.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Ia(t){return!!Br&&Br in t}var La=Function.prototype,Fa=La.toString;function ht(t){if(t!=null){try{return Fa.call(t)}catch{}try{return t+""}catch{}}return""}var Ba=/[\\^$.*+?()[\]{}|]/g,Ua=/^\[object .+?Constructor\]$/,ka=Function.prototype,za=Object.prototype,Ga=ka.toString,Ha=za.hasOwnProperty,Va=RegExp("^"+Ga.call(Ha).replace(Ba,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Wa(t){if(!J(t)||Ia(t))return!1;var e=rr(t)?Va:Ua;return e.test(ht(t))}function Ja(t,e){return t==null?void 0:t[e]}function vt(t,e){var r=Ja(t,e);return Wa(r)?r:void 0}var qa=vt(Y,"WeakMap");const Ie=qa;var Ur=Object.create,Qa=function(){function t(){}return function(e){if(!J(e))return{};if(Ur)return Ur(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const Ya=Qa;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 Ka(){}function Bn(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Za=800,ti=16,ei=Date.now;function ri(t){var e=0,r=0;return function(){var n=ei(),o=ti-(n-r);if(r=n,o>0){if(++e>=Za)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function ni(t){return function(){return t}}var oi=function(){try{var t=vt(Object,"defineProperty");return t({},"",{}),t}catch{}}();const ue=oi;var ai=ue?function(t,e){return ue(t,"toString",{configurable:!0,enumerable:!1,value:ni(e),writable:!0})}:er;const ii=ai;var si=ri(ii);const Un=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 pi(t,e,r){return e===e?fi(t,e,r):ui(t,li,r)}function di(t,e){var r=t==null?0:t.length;return!!r&&pi(t,e,0)>-1}var hi=9007199254740991,vi=/^(?:0|[1-9]\d*)$/;function he(t,e){var r=typeof t;return e=e==null?hi:e,!!e&&(r=="number"||r!="symbol"&&vi.test(t))&&t>-1&&t%1==0&&t<e}function nr(t,e,r){e=="__proto__"&&ue?ue(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function te(t,e){return t===e||t!==t&&e!==e}var mi=Object.prototype,yi=mi.hasOwnProperty;function or(t,e,r){var n=t[e];(!(yi.call(t,e)&&te(n,r))||r===void 0&&!(e in t))&&nr(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?nr(r,i,c):or(r,i,c)}return r}var kr=Math.max;function kn(t,e,r){return e=kr(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=kr(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 zn(t,e){return Un(kn(t,e,er),t+"")}var gi=9007199254740991;function ar(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=gi}function ve(t){return t!=null&&ar(t.length)&&!rr(t)}function bi(t,e,r){if(!J(r))return!1;var n=typeof e;return(n=="number"?ve(r)&&he(e,r.length):n=="string"&&e in r)?te(r[e],t):!1}function _i(t){return zn(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 ji=Object.prototype;function ir(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||ji;return t===r}function wi(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Si="[object Arguments]";function zr(t){return Q(t)&&dt(t)==Si}var Gn=Object.prototype,Oi=Gn.hasOwnProperty,Ci=Gn.propertyIsEnumerable,Ei=zr(function(){return arguments}())?zr:function(t){return Q(t)&&Oi.call(t,"callee")&&!Ci.call(t,"callee")};const Wt=Ei;function Ni(){return!1}var Hn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gr=Hn&&typeof module=="object"&&module&&!module.nodeType&&module,$i=Gr&&Gr.exports===Hn,Hr=$i?Y.Buffer:void 0,Ti=Hr?Hr.isBuffer:void 0,Ai=Ti||Ni;const Jt=Ai;var xi="[object Arguments]",Mi="[object Array]",Pi="[object Boolean]",Ri="[object Date]",Di="[object Error]",Ii="[object Function]",Li="[object Map]",Fi="[object Number]",Bi="[object Object]",Ui="[object RegExp]",ki="[object Set]",zi="[object String]",Gi="[object WeakMap]",Hi="[object ArrayBuffer]",Vi="[object DataView]",Wi="[object Float32Array]",Ji="[object Float64Array]",qi="[object Int8Array]",Qi="[object Int16Array]",Yi="[object Int32Array]",Xi="[object Uint8Array]",Ki="[object Uint8ClampedArray]",Zi="[object Uint16Array]",ts="[object Uint32Array]",N={};N[Wi]=N[Ji]=N[qi]=N[Qi]=N[Yi]=N[Xi]=N[Ki]=N[Zi]=N[ts]=!0;N[xi]=N[Mi]=N[Hi]=N[Pi]=N[Vi]=N[Ri]=N[Di]=N[Ii]=N[Li]=N[Fi]=N[Bi]=N[Ui]=N[ki]=N[zi]=N[Gi]=!1;function es(t){return Q(t)&&ar(t.length)&&!!N[dt(t)]}function sr(t){return function(e){return t(e)}}var Vn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,zt=Vn&&typeof module=="object"&&module&&!module.nodeType&&module,rs=zt&&zt.exports===Vn,Te=rs&&In.process,ns=function(){try{var t=zt&&zt.require&&zt.require("util").types;return t||Te&&Te.binding&&Te.binding("util")}catch{}}();const jt=ns;var Vr=jt&&jt.isTypedArray,os=Vr?sr(Vr):es;const cr=os;var as=Object.prototype,is=as.hasOwnProperty;function Wn(t,e){var r=M(t),n=!r&&Wt(t),o=!r&&!n&&Jt(t),a=!r&&!n&&!o&&cr(t),s=r||n||o||a,i=s?wi(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")||he(u,c)))&&i.push(u);return i}function Jn(t,e){return function(r){return t(e(r))}}var ss=Jn(Object.keys,Object);const cs=ss;var us=Object.prototype,ls=us.hasOwnProperty;function fs(t){if(!ir(t))return cs(t);var e=[];for(var r in Object(t))ls.call(t,r)&&r!="constructor"&&e.push(r);return e}function me(t){return ve(t)?Wn(t):fs(t)}function ps(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var ds=Object.prototype,hs=ds.hasOwnProperty;function vs(t){if(!J(t))return ps(t);var e=ir(t),r=[];for(var n in t)n=="constructor"&&(e||!hs.call(t,n))||r.push(n);return r}function ee(t){return ve(t)?Wn(t,!0):vs(t)}var ms=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ys=/^\w*$/;function ur(t,e){if(M(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Ze(t)?!0:ys.test(t)||!ms.test(t)||e!=null&&t in Object(e)}var gs=vt(Object,"create");const qt=gs;function bs(){this.__data__=qt?qt(null):{},this.size=0}function _s(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var js="__lodash_hash_undefined__",ws=Object.prototype,Ss=ws.hasOwnProperty;function Os(t){var e=this.__data__;if(qt){var r=e[t];return r===js?void 0:r}return Ss.call(e,t)?e[t]:void 0}var Cs=Object.prototype,Es=Cs.hasOwnProperty;function Ns(t){var e=this.__data__;return qt?e[t]!==void 0:Es.call(e,t)}var $s="__lodash_hash_undefined__";function Ts(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=qt&&e===void 0?$s:e,this}function lt(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])}}lt.prototype.clear=bs;lt.prototype.delete=_s;lt.prototype.get=Os;lt.prototype.has=Ns;lt.prototype.set=Ts;function As(){this.__data__=[],this.size=0}function ye(t,e){for(var r=t.length;r--;)if(te(t[r][0],e))return r;return-1}var xs=Array.prototype,Ms=xs.splice;function Ps(t){var e=this.__data__,r=ye(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Ms.call(e,r,1),--this.size,!0}function Rs(t){var e=this.__data__,r=ye(e,t);return r<0?void 0:e[r][1]}function Ds(t){return ye(this.__data__,t)>-1}function Is(t,e){var r=this.__data__,n=ye(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=Ps;et.prototype.get=Rs;et.prototype.has=Ds;et.prototype.set=Is;var Ls=vt(Y,"Map");const Qt=Ls;function Fs(){this.size=0,this.__data__={hash:new lt,map:new(Qt||et),string:new lt}}function Bs(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ge(t,e){var r=t.__data__;return Bs(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Us(t){var e=ge(this,t).delete(t);return this.size-=e?1:0,e}function ks(t){return ge(this,t).get(t)}function zs(t){return ge(this,t).has(t)}function Gs(t,e){var r=ge(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=zs;rt.prototype.set=Gs;var Hs="Expected a function";function lr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Hs);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(lr.Cache||rt),r}lr.Cache=rt;var Vs=500;function Ws(t){var e=lr(t,function(n){return r.size===Vs&&r.clear(),n}),r=e.cache;return e}var Js=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qs=/\\(\\)?/g,Qs=Ws(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Js,function(r,n,o,a){e.push(o?a.replace(qs,"$1"):n||r)}),e});const Ys=Qs;function Xs(t){return t==null?"":Fn(t)}function Tt(t,e){return M(t)?t:ur(t,e)?[t]:Ys(Xs(t))}var Ks=1/0;function At(t){if(typeof t=="string"||Ze(t))return t;var e=t+"";return e=="0"&&1/t==-Ks?"-0":e}function be(t,e){e=Tt(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[At(e[r++])];return r&&r==n?t:void 0}function qn(t,e,r){var n=t==null?void 0:be(t,e);return n===void 0?r:n}function fr(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var Wr=z?z.isConcatSpreadable:void 0;function Zs(t){return M(t)||Wt(t)||!!(Wr&&t&&t[Wr])}function pr(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?pr(i,e-1,r,n,o):fr(o,i):n||(o[o.length]=i)}return o}function tc(t){var e=t==null?0:t.length;return e?pr(t,1):[]}function ec(t){return Un(kn(t,void 0,tc),t+"")}var rc=Jn(Object.getPrototypeOf,Object);const dr=rc;var nc="[object Object]",oc=Function.prototype,ac=Object.prototype,Qn=oc.toString,ic=ac.hasOwnProperty,sc=Qn.call(Object);function B(t){if(!Q(t)||dt(t)!=nc)return!1;var e=dr(t);if(e===null)return!0;var r=ic.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Qn.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 pc(t){return this.__data__.has(t)}var dc=200;function hc(t,e){var r=this.__data__;if(r instanceof et){var n=r.__data__;if(!Qt||n.length<dc-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 V(t){var e=this.__data__=new et(t);this.size=e.size}V.prototype.clear=uc;V.prototype.delete=lc;V.prototype.get=fc;V.prototype.has=pc;V.prototype.set=hc;function vc(t,e){return t&&$t(e,me(e),t)}function mc(t,e){return t&&$t(e,ee(e),t)}var Yn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Jr=Yn&&typeof module=="object"&&module&&!module.nodeType&&module,yc=Jr&&Jr.exports===Yn,qr=yc?Y.Buffer:void 0,Qr=qr?qr.allocUnsafe:void 0;function Xn(t,e){if(e)return t.slice();var r=t.length,n=Qr?Qr(r):new t.constructor(r);return t.copy(n),n}function gc(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 Kn(){return[]}var bc=Object.prototype,_c=bc.propertyIsEnumerable,Yr=Object.getOwnPropertySymbols,jc=Yr?function(t){return t==null?[]:(t=Object(t),gc(Yr(t),function(e){return _c.call(t,e)}))}:Kn;const hr=jc;function wc(t,e){return $t(t,hr(t),e)}var Sc=Object.getOwnPropertySymbols,Oc=Sc?function(t){for(var e=[];t;)fr(e,hr(t)),t=dr(t);return e}:Kn;const Zn=Oc;function Cc(t,e){return $t(t,Zn(t),e)}function to(t,e,r){var n=e(t);return M(t)?n:fr(n,r(t))}function Le(t){return to(t,me,hr)}function vr(t){return to(t,ee,Zn)}var Ec=vt(Y,"DataView");const Fe=Ec;var Nc=vt(Y,"Promise");const Be=Nc;var $c=vt(Y,"Set");const _t=$c;var Xr="[object Map]",Tc="[object Object]",Kr="[object Promise]",Zr="[object Set]",tn="[object WeakMap]",en="[object DataView]",Ac=ht(Fe),xc=ht(Qt),Mc=ht(Be),Pc=ht(_t),Rc=ht(Ie),ct=dt;(Fe&&ct(new Fe(new ArrayBuffer(1)))!=en||Qt&&ct(new Qt)!=Xr||Be&&ct(Be.resolve())!=Kr||_t&&ct(new _t)!=Zr||Ie&&ct(new Ie)!=tn)&&(ct=function(t){var e=dt(t),r=e==Tc?t.constructor:void 0,n=r?ht(r):"";if(n)switch(n){case Ac:return en;case xc:return Xr;case Mc:return Kr;case Pc:return Zr;case Rc:return tn}return e});const Yt=ct;var Dc=Object.prototype,Ic=Dc.hasOwnProperty;function Lc(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Ic.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Fc=Y.Uint8Array;const le=Fc;function mr(t){var e=new t.constructor(t.byteLength);return new le(e).set(new le(t)),e}function Bc(t,e){var r=e?mr(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 rn=z?z.prototype:void 0,nn=rn?rn.valueOf:void 0;function zc(t){return nn?Object(nn.call(t)):{}}function eo(t,e){var r=e?mr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Gc="[object Boolean]",Hc="[object Date]",Vc="[object Map]",Wc="[object Number]",Jc="[object RegExp]",qc="[object Set]",Qc="[object String]",Yc="[object Symbol]",Xc="[object ArrayBuffer]",Kc="[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 Xc:return mr(t);case Gc:case Hc:return new n(+t);case Kc:return Bc(t,r);case Zc:case tu:case eu:case ru:case nu:case ou:case au:case iu:case su:return eo(t,r);case Vc:return new n;case Wc:case Qc:return new n(t);case Jc:return kc(t);case qc:return new n;case Yc:return zc(t)}}function ro(t){return typeof t.constructor=="function"&&!ir(t)?Ya(dr(t)):{}}var uu="[object Map]";function lu(t){return Q(t)&&Yt(t)==uu}var on=jt&&jt.isMap,fu=on?sr(on):lu;const pu=fu;var du="[object Set]";function hu(t){return Q(t)&&Yt(t)==du}var an=jt&&jt.isSet,vu=an?sr(an):hu;const mu=vu;var yu=1,gu=2,bu=4,no="[object Arguments]",_u="[object Array]",ju="[object Boolean]",wu="[object Date]",Su="[object Error]",oo="[object Function]",Ou="[object GeneratorFunction]",Cu="[object Map]",Eu="[object Number]",ao="[object Object]",Nu="[object RegExp]",$u="[object Set]",Tu="[object String]",Au="[object Symbol]",xu="[object WeakMap]",Mu="[object ArrayBuffer]",Pu="[object DataView]",Ru="[object Float32Array]",Du="[object Float64Array]",Iu="[object Int8Array]",Lu="[object Int16Array]",Fu="[object Int32Array]",Bu="[object Uint8Array]",Uu="[object Uint8ClampedArray]",ku="[object Uint16Array]",zu="[object Uint32Array]",E={};E[no]=E[_u]=E[Mu]=E[Pu]=E[ju]=E[wu]=E[Ru]=E[Du]=E[Iu]=E[Lu]=E[Fu]=E[Cu]=E[Eu]=E[ao]=E[Nu]=E[$u]=E[Tu]=E[Au]=E[Bu]=E[Uu]=E[ku]=E[zu]=!0;E[Su]=E[oo]=E[xu]=!1;function Gt(t,e,r,n,o,a){var s,i=e&yu,c=e&gu,u=e&bu;if(r&&(s=o?r(t,n,o,a):r(t)),s!==void 0)return s;if(!J(t))return t;var l=M(t);if(l){if(s=Lc(t),!i)return Bn(t,s)}else{var p=Yt(t),f=p==oo||p==Ou;if(Jt(t))return Xn(t,i);if(p==ao||p==no||f&&!o){if(s=c||f?{}:ro(t),!i)return c?Cc(t,mc(s,t)):wc(t,vc(s,t))}else{if(!E[p])return o?t:{};s=cu(t,p,i)}}a||(a=new V);var d=a.get(t);if(d)return d;a.set(t,s),mu(t)?t.forEach(function(b){s.add(Gt(b,e,r,b,t,a))}):pu(t)&&t.forEach(function(b,j){s.set(j,Gt(b,e,r,j,t,a))});var h=u?c?vr:Le:c?ee:me,y=l?void 0:h(t);return ci(y||t,function(b,j){y&&(j=b,b=t[j]),or(s,j,Gt(b,e,r,j,t,a))}),s}var Gu=1,Hu=4;function io(t){return Gt(t,Gu|Hu)}var Vu="__lodash_hash_undefined__";function Wu(t){return this.__data__.set(t,Vu),this}function Ju(t){return this.__data__.has(t)}function Xt(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new rt;++e<r;)this.add(t[e])}Xt.prototype.add=Xt.prototype.push=Wu;Xt.prototype.has=Ju;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 so(t,e){return t.has(e)}var Qu=1,Yu=2;function co(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 p=-1,f=!0,d=r&Yu?new Xt:void 0;for(a.set(t,e),a.set(e,t);++p<i;){var h=t[p],y=e[p];if(n)var b=s?n(y,h,p,e,t,a):n(h,y,p,t,e,a);if(b!==void 0){if(b)continue;f=!1;break}if(d){if(!qu(e,function(j,O){if(!so(d,O)&&(h===j||o(h,j,r,n,a)))return d.push(O)})){f=!1;break}}else if(!(h===y||o(h,y,r,n,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function Xu(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function yr(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Ku=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]",sn=z?z.prototype:void 0,Ae=sn?sn.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 le(t),new le(e)));case tl:case el:case ol:return te(+t,+e);case rl:return t.name==e.name&&t.message==e.message;case al:case sl:return t==e+"";case nl:var i=Xu;case il:var c=n&Ku;if(i||(i=yr),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=co(i(t),i(e),n,o,a,s);return s.delete(t),l;case cl:if(Ae)return Ae.call(t)==Ae.call(e)}return!1}var pl=1,dl=Object.prototype,hl=dl.hasOwnProperty;function vl(t,e,r,n,o,a){var s=r&pl,i=Le(t),c=i.length,u=Le(e),l=u.length;if(c!=l&&!s)return!1;for(var p=c;p--;){var f=i[p];if(!(s?f in e:hl.call(e,f)))return!1}var d=a.get(t),h=a.get(e);if(d&&h)return d==e&&h==t;var y=!0;a.set(t,e),a.set(e,t);for(var b=s;++p<c;){f=i[p];var j=t[f],O=e[f];if(n)var P=s?n(O,j,f,e,t,a):n(j,O,f,t,e,a);if(!(P===void 0?j===O||o(j,O,r,n,a):P)){y=!1;break}b||(b=f=="constructor")}if(y&&!b){var T=t.constructor,R=e.constructor;T!=R&&"constructor"in t&&"constructor"in e&&!(typeof T=="function"&&T instanceof T&&typeof R=="function"&&R instanceof R)&&(y=!1)}return a.delete(t),a.delete(e),y}var ml=1,cn="[object Arguments]",un="[object Array]",se="[object Object]",yl=Object.prototype,ln=yl.hasOwnProperty;function gl(t,e,r,n,o,a){var s=M(t),i=M(e),c=s?un:Yt(t),u=i?un:Yt(e);c=c==cn?se:c,u=u==cn?se:u;var l=c==se,p=u==se,f=c==u;if(f&&Jt(t)){if(!Jt(e))return!1;s=!0,l=!1}if(f&&!l)return a||(a=new V),s||cr(t)?co(t,e,r,n,o,a):fl(t,e,c,r,n,o,a);if(!(r&ml)){var d=l&&ln.call(t,"__wrapped__"),h=p&&ln.call(e,"__wrapped__");if(d||h){var y=d?t.value():t,b=h?e.value():e;return a||(a=new V),o(y,b,r,n,a)}}return f?(a||(a=new V),vl(t,e,r,n,o,a)):!1}function gr(t,e,r,n,o){return t===e?!0:t==null||e==null||!Q(t)&&!Q(e)?t!==t&&e!==e:gl(t,e,r,n,gr,o)}var bl=1,_l=2;function jl(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 p=new V;if(n)var f=n(u,l,c,t,e,p);if(!(f===void 0?gr(l,u,bl|_l,n,p):f))return!1}}return!0}function uo(t){return t===t&&!J(t)}function wl(t){for(var e=me(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,uo(o)]}return e}function lo(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Sl(t){var e=wl(t);return e.length==1&&e[0][2]?lo(e[0][0],e[0][1]):function(r){return r===t||jl(r,t,e)}}function Ol(t,e){return t!=null&&e in Object(t)}function Cl(t,e,r){e=Tt(e,t);for(var n=-1,o=e.length,a=!1;++n<o;){var s=At(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&&ar(o)&&he(s,o)&&(M(t)||Wt(t)))}function El(t,e){return t!=null&&Cl(t,e,Ol)}var Nl=1,$l=2;function Tl(t,e){return ur(t)&&uo(e)?lo(At(t),e):function(r){var n=qn(r,t);return n===void 0&&n===e?El(r,t):gr(e,n,Nl|$l)}}function Al(t){return function(e){return e==null?void 0:e[t]}}function xl(t){return function(e){return be(e,t)}}function Ml(t){return ur(t)?Al(At(t)):xl(t)}function br(t){return typeof t=="function"?t:t==null?er:typeof t=="object"?M(t)?Tl(t[0],t[1]):Sl(t):Ml(t)}function Pl(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 Rl=Pl();const Dl=Rl;function Ue(t,e,r){(r!==void 0&&!te(t[e],r)||r===void 0&&!(e in t))&&nr(t,e,r)}function ke(t){return Q(t)&&ve(t)}function ze(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Il(t){return $t(t,ee(t))}function Ll(t,e,r,n,o,a,s){var i=ze(t,r),c=ze(e,r),u=s.get(c);if(u){Ue(t,r,u);return}var l=a?a(i,c,r+"",t,e,s):void 0,p=l===void 0;if(p){var f=M(c),d=!f&&Jt(c),h=!f&&!d&&cr(c);l=c,f||d||h?M(i)?l=i:ke(i)?l=Bn(i):d?(p=!1,l=Xn(c,!0)):h?(p=!1,l=eo(c,!0)):l=[]:B(c)||Wt(c)?(l=i,Wt(i)?l=Il(i):(!J(i)||rr(i))&&(l=ro(c))):p=!1}p&&(s.set(c,l),o(l,c,n,a,s),s.delete(c)),Ue(t,r,l)}function fo(t,e,r,n,o){t!==e&&Dl(e,function(a,s){if(o||(o=new V),J(a))Ll(t,e,s,r,fo,n,o);else{var i=n?n(ze(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),Ue(t,s,i)}},ee)}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 po(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Bl(t,e){return e.length<2?t:be(t,cc(e,0,-1))}var Ul=_i(function(t,e,r){fo(t,e,r)});const ho=Ul;var kl="Expected a function";function zl(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=Tt(e,t),t=Bl(t,e),t==null||delete t[At(po(e))]}function Hl(t){return B(t)?void 0:t}var Vl=1,Wl=2,Jl=4,ql=ec(function(t,e){var r={};if(t==null)return r;var n=!1;e=tr(e,function(a){return a=Tt(a,t),n||(n=a.length>1),a}),$t(t,vr(t),r),n&&(r=Gt(r,Vl|Wl|Jl,Hl));for(var o=e.length;o--;)Gl(r,e[o]);return r});const vo=ql;function Ql(t,e,r,n){if(!J(t))return t;e=Tt(e,t);for(var o=-1,a=e.length,s=a-1,i=t;i!=null&&++o<a;){var c=At(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=J(l)?l:he(e[o+1])?[]:{})}or(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=be(t,s);r(i,s)&&Ql(a,Tt(s,t),i)}return a}function Xl(t,e){if(t==null)return{};var r=tr(vr(t),function(n){return[n]});return e=br(e),Yl(t,r,function(n,o){return e(n,o[0])})}function Kl(t,e){return Xl(t,zl(br(e)))}var Zl=1/0,tf=_t&&1/yr(new _t([,-0]))[1]==Zl?function(t){return new _t(t)}:Ka;const ef=tf;var rf=200;function nf(t,e,r){var n=-1,o=di,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 yr(u);s=!1,o=so,c=new Xt}else c=e?[]:i;t:for(;++n<a;){var l=t[n],p=e?e(l):l;if(l=r||l!==0?l:0,s&&p===p){for(var f=c.length;f--;)if(c[f]===p)continue t;e&&c.push(p),i.push(l)}else o(c,p,r)||(c!==i&&c.push(p),i.push(l))}return i}var of=zn(function(t){var e=po(t);return ke(e)&&(e=void 0),nf(pr(t,1,ke,!0),br(e))});const af=of;class mo 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=()=>n!=null?n:n=[e,...r()]}}function sf(t){return W(t)&&typeof t[Symbol.iterator]=="function"}function W(t){return typeof t=="object"&&t!=null}function U(t){return typeof t=="symbol"?t.toString():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: \`${U(n)}\``}=t;return{value:n,type:s,refinement:i,key:o[o.length-1],path:o,branch:a,...t,message:c}}function*fn(t,e,r,n){sf(t)||(t=[t]);for(const o of t){const a=uf(o,e,r,n);a&&(yield a)}}function*_r(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,p]of e.entries(t,i)){const f=_r(l,p,{path:u===void 0?n:[...n,u],branch:u===void 0?o:[...o,l],coerce:a,mask:s});for(const d of f)d[0]?(c=d[0].refinement!=null?"not_refined":"not_valid",yield[d[0],void 0]):a&&(l=d[1],u===void 0?t=l:t instanceof Map?t.set(u,l):t instanceof Set?t.add(l):W(t)&&(l!==void 0||u in 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 X{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 fn(l,u,this,c)}:this.validator=()=>[],a?this.refiner=(c,u)=>{const l=a(c,u);return fn(l,u,this,c)}:this.refiner=()=>[]}assert(e){return yo(e,this)}create(e){return lf(e,this)}is(e){return pf(e,this)}mask(e){return ff(e,this)}validate(e,r){return r===void 0&&(r={}),xt(e,this,r)}}function yo(t,e){const r=xt(t,e);if(r[0])throw r[0]}function lf(t,e){const r=xt(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function ff(t,e){const r=xt(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function pf(t,e){return!xt(t,e)[0]}function xt(t,e,r){r===void 0&&(r={});const n=_r(t,e,r),o=cf(n);return o[0]?[new mo(o[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,o[1]]}function jr(){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?jo(a):S(a)}function it(t,e){return new X({type:t,schema:null,validator:e})}function wt(t){return new X({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 go(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return jo(n);default:return S(n)}}function D(){return it("any",()=>!0)}function x(t){return new X({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: ${U(e)}`}})}function tt(){return it("boolean",t=>typeof t=="boolean")}function Ge(t){const e={},r=t.map(n=>U(n)).join();for(const n of t)e[n]=n;return new X({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${U(n)}`}})}function bo(){return it("func",t=>typeof t=="function"||`Expected a function, but received: ${U(t)}`)}function F(t){const e=U(t),r=typeof t;return new X({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${U(n)}`}})}function df(){return it("never",()=>!1)}function _o(){return it("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${U(t)}`)}function S(t){const e=t?Object.keys(t):[],r=df();return new X({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: ${U(n)}`},coercer(n){return W(n)?{...n}:n}})}function m(t){return new X({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Ht(t,e){return new X({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: ${U(r)}`}})}function v(){return it("string",t=>typeof t=="string"||`Expected a string, but received: ${U(t)}`)}function jo(t){const e=Object.keys(t);return new X({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: ${U(r)}`}})}function L(t){const e=t.map(r=>r.type).join(" | ");return new X({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]=_r(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: ${U(r)}`,...o]}})}function hf(){return it("unknown",()=>!0)}const wr=S({package:v(),version:v(),exportName:v(),destructuring:m(tt()),subName:m(v()),main:m(v())}),vf=x(wr),mf=["CBlock","CContainer","CImage","CCanvas","CVideo","CAudio","CText","CNativeTag"];var k=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t))(k||{}),Sr=(t=>(t.DESIGN="design",t.SAVE="save",t))(Sr||{}),He=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(He||{});const yf=()=>it("normalObj",t=>!B(t)||[k.SLOT,k.EXPRESSION,k.FUNCTION].includes(t==null?void 0:t.type)?!1:(xt(t,Ht(v(),Or)),!0)),Or=L([v(),_o(),tt(),S({type:F(k.SLOT),renderType:Ge([He.FUNC,He.COMP]),params:m(x(v())),value:wt(()=>L([St,x(St)]))}),S({type:F(k.EXPRESSION),value:v()}),S({type:F(k.FUNCTION),value:v()}),yf(),x(wt(()=>Or))]),pn=S({type:F(k.EXPRESSION),value:v()}),St=S({id:m(v()),title:m(v()),componentName:v(),props:m(Ht(v(),Or)),stateName:m(v()),state:m(Ht(v(),D())),children:wt(()=>m(x(L([v(),St])))),configure:m(D()),css:m(D()),style:m(D()),classNames:m(x(D())),refId:m(v()),extra:m(Ht(D(),D())),condition:m(L([tt(),pn])),tempDevConfig:m(D()),loop:m(S({open:tt(),data:L([x(D()),pn]),args:m(x(v())),forName:m(v()),forIndex:m(v()),key:m(D()),name:m(v())}))}),fe=L([v(),S({label:v(),tip:m(v())})]),gf=S({type:F("shape"),value:x(S({name:v(),title:fe,valueType:wt(()=>_e)}))}),bf=S({type:F("enums"),value:x(v())});S({type:F("array"),value:wt(()=>_e)});const _f=S({type:F("array"),value:wt(()=>x(_e))}),_e=L([Ge(["array","boolean","number","object","string"]),Ge(["component","expression","function"]),gf,bf,_f]),jf=L([v(),S({componentName:v(),props:m(D()),initialValue:m(D()),component:m(D())})]),xe=S({name:v(),title:fe,valueType:_e,description:m(v()),defaultValue:D(),setters:m(x(jf)),condition:m(bo())}),wf=L([v(),bo()]);var Ve=(t=>(t.SINGLE="single",t.GROUP="group",t))(Ve||{});L([v(),S({name:v(),describe:m(v()),params:m(S({name:v(),description:v()})),template:v()})]);const Sf=S({id:m(v()),title:v(),snapshot:L([v(),D()]),snapshotText:m(v()),description:m(v()),tags:m(x(v())),groupName:m(v()),category:m(v()),schema:jr(go(St,["id"]),S({componentName:m(v())}))}),Of=S({componentName:v(),title:v(),screenshot:m(v()),icon:m(v()),tags:m(x(v())),groupName:m(v()),category:m(v()),priority:m(_o()),npm:m(wr),snippets:x(Sf),props:x(L([xe,S({title:m(fe),type:F("single"),content:xe}),S({title:m(fe),type:F("group"),content:x(xe)})])),fixedProps:m(D()),isContainer:m(L([tt(),S({placeholder:v(),width:v(),height:v()})])),isModal:m(L([tt(),S({visibleKey:v()})])),isSupportStyle:m(tt()),isSupportDispatchNativeEvent:m(tt()),isLayout:m(tt()),rootSelector:m(v()),selectionToolBars:m(x(wf)),extra:m(Ht(D(),D()))}),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}
|
|
2
|
+
originData: ${JSON.stringify(e)}`):new Error(`${JSON.stringify(e)}
|
|
3
|
+
data struct format is invalidate`);return o},Cr=t=>{const{data:e,message:r,throwError:n,dataStruct:o}=t;return Cf(({data:a})=>{try{return yo(a,o),{isValidate:!0}}catch(s){let i=s;return s instanceof mo&&(i=s.failures().map(c=>`\u3010${c.path.join(".")}\u3011: ${c.message}
|
|
4
|
+
`)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var Mt=(t=>(t.ROOT_CONTAINER="RootContainer",t))(Mt||{});const Ef=S({type:F(k.FUNCTION),value:v()}),Nf=jr(go(St,["componentName"]),S({componentName:F("RootContainer")}));function $f(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 re=$f(),Tf=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new ft([]);return e&&(o=e.materialsMode||new ft([])),n&&(M(n)?r.value=n.map(a=>new A(a,{parent:e,materials:o})):B(n)&&r.value.push(new A(n,{parent:e,materials:o}))),r};class Ot{constructor(e,r){_(this,"nodeType","SLOT"),_(this,"rawData"),_(this,"parent"),_(this,"emitter",re),_(this,"data"),_(this,"id"),_(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new ft([]);this.materialsMode=n,this.id=K(),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(B(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return M(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const wo=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===Ve.SINGLE?e.push(n.content):n.type===Ve.GROUP&&(e=[...e,...wo(n.content)]):e.push(r)}),e},We=(t,e,r)=>{if(t.type)return t.type===k.SLOT?new Ot(t,{parent:e,materials:r}):t;if(B(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=Je(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>We(n,e,r)):t},Je=(t,e,r)=>B(t)?We(t,e,r):M(t)?t.map(n=>We(n,e,r)):t;class at{constructor(e,r,n){_(this,"nodeType","PROP"),_(this,"rawData"),_(this,"parent"),_(this,"emitter",re),_(this,"data"),_(this,"name"),_(this,"materialsMode");const o=(n==null?void 0:n.materials)||new ft([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=Je(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=Je(e!=null?e:r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof Ot)&&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 wo((r==null?void 0:r.value.props)||[]).find(n=>n.name===this.name)}else return null}export(e){const r=this.data,n=o=>{if(o instanceof at||o instanceof Ot||o instanceof A)return o.export(e);if(M(o))return o.map(a=>n(a));if(B(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return o};return n(r)}}const Af=t=>{if(typeof t=="string")return!0;Cr({data:t,dataStruct:St,throwError:!0})},dn=(t,e,r=new ft([]))=>{var n;if(typeof t=="string")return t;const o={...t,id:(n=t.id)!=null?n:K(),children:[],props:{},configure:ho(t.configure||{},{propsSetter:{},advanceSetter:{}})},a=Object.keys(t.props||{});return a.length&&a.forEach(s=>{var i;const c=(i=t.props)==null?void 0:i[s];if(c instanceof at){o.props[s]=c;return}o.props[s]=new at(s,c||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?o.children=t.children.map(s=>{if(s instanceof A)return s;if(B(s)){const i=s;return new A(i,{parent:e,materials:r})}else return s}):(t.children instanceof A&&(o.children=[t.children]),o.children=[new A(t.children,{parent:e,materials:r})])),o};class A{constructor(e,r){_(this,"nodeType","NODE"),_(this,"rawData"),_(this,"data"),_(this,"emitter",re),_(this,"parent"),_(this,"materialsModel"),_(this,"listenerHandle"),_(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Af(e);const n=(r==null?void 0:r.materials)||new ft([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=dn(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||K()};return new A(r,{materials:this.materialsModel})}updateValue(e){const r=this.data,n={...this.data,...e};this.data=dn(n,this),this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return Nr(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}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 p=qn(i,l,!1);p&&(c[l]=p)}),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=Er(u),u}}const hn=(t,e,r)=>{const n={...t,id:K(),props:{},componentName:Mt.ROOT_CONTAINER,children:[],configure:ho(t.configure||{},{propsSetter:{},advanceSetter:{}})};let o=[];M(t.children)?o=t.children.map(s=>s instanceof A?s:B(s)?new A(s,{parent:e,materials:r}):s):t.children instanceof A?o.push(t.children):t.children&&B(t.children)&&o.push(new A(t.children,{parent:e,materials:r}));const a=Object.keys(t.props||{});return a.length&&a.forEach(s=>{var i;const c=(i=t.props)==null?void 0:i[s];c instanceof at?n.props[s]=c:n.props[s]=new at(s,c||"",{parent:e,materials:r})}),n.children=o,n};class Kt{constructor(e,{parent:r,materials:n}){_(this,"rawData"),_(this,"data"),_(this,"nodeType",Mt.ROOT_CONTAINER),_(this,"emitter",re),_(this,"materialsModel"),_(this,"listenerHandle"),_(this,"onChangeCbQueue"),_(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=hn(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=hn(n,this,this.materialsModel),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return Nr(this,e)}export(e=Sr.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=vo(s,["id"]);return i=Er(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||K()};return new Kt(r,{materials:this.materialsModel,parent:null})}}const st=t=>(t==null?void 0:t.type)===k.EXPRESSION,xf=t=>(t==null?void 0:t.type)==k.FUNCTION,K=()=>Math.random().toString(32).slice(3,9),Mf=t=>(t==null?void 0:t.nodeType)==="NODE",Me=t=>(t==null?void 0:t.nodeType)==="PROP",Pf=t=>(t==null?void 0:t.nodeType)==="SLOT",Er=t=>Kl(t,e=>B(e)?!Object.keys(e).length:M(e)?!e.length:!e);function Nr(t,e){const r=[t];for(;r.length;){const n=r.shift();if((n==null?void 0:n.id)===e)return n;const o=(n==null?void 0:n.props)||{},a=i=>{if(i instanceof A){r.push(i);return}if(i instanceof Ot&&a(i.value.value),i instanceof at){a(i.value);return}if(B(i)){const c=i;Object.keys(c).map(u=>{a(c[u])});return}if(M(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)}return null}const Rf=t=>{const e=io(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${K()}`,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 Df{constructor(e){_(this,"rawData"),_(this,"data"),this.rawData=e,this.data=Rf(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 If=t=>{if(!M(t))throw new Error("Materials must be a array");return t.map(e=>new Df(e))},Lf=t=>{t==null||t.forEach(e=>{Cr({data:e,dataStruct:Of,throwError:!0})})};class ft{constructor(e){_(this,"rawData"),_(this,"data"),_(this,"usedMaterials",[]),this.rawData=e,Lf(e),this.data=If(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 f=p.category||"default";s.includes(f)||(s.push(f),i[f]=[]),i[f].push(p)});const u=[];s.forEach(p=>{i[p].length&&u.push({name:p,list:i[p]})});const l={name:a,list:u};o.push(l)}}),o}get value(){return this.data}get rawValue(){return this.rawData}}const Ff=S({version:v(),name:v(),css:m(v()),renderType:m(L([F("COMPONENT"),F("PAGE")])),methods:m(x(Ef)),componentsMeta:x(jr(S({componentName:v()}),wr)),thirdLibs:m(vf),componentsTree:Nf,assets:m(x(D()))}),So=t=>(Cr({data:t,dataStruct:Ff,throwError:!0}),t),Pe=(t,e,r)=>({...t,componentsTree:new Kt(t.componentsTree,{parent:e,materials:r})});class pe{constructor(e,r){_(this,"nodeType","PAGE"),_(this,"rawData"),_(this,"emitter",re),_(this,"data"),_(this,"parent"),_(this,"materialsModel"),_(this,"assetPackagesList"),So(e),this.assetPackagesList=(r==null?void 0:r.assetPackagesList)||[],this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new ft((r==null?void 0:r.materials)||[]),this.data=Pe(e,this,this.materialsModel)}updatePage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=Pe(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=Pe(e,this,this.materialsModel),this.emitter.emit("onReloadPage",{value:this.data,preValue:r,node:this})}get value(){return this.data}getNode(e){const r=this.data.componentsTree;return Nr(r,e)}addNode(e,r,n="AFTER"){var o,a,s;if(n==="AFTER"||n==="BEFORE"){const i=r.parent;if(i===null&&r instanceof Kt)return console.warn("Not found parent node"),!1;if(i instanceof at)return console.warn("CProp can not add node"),!1;if(i instanceof Ot){const u=i.value.value,l=(o=u.findIndex(p=>p===r))!=null?o:-1;return l>=0?(n==="BEFORE"?u.splice(l,0,e):u.splice(l+1,0,e),e.parent=i,(a=i.parent)==null||a.updateValue(),!0):!1}if(i instanceof pe)return!1;const c=(s=i==null?void 0:i.value.children.findIndex(u=>u===r))!=null?s:-1;return c>=0?(n==="BEFORE"?i==null||i.value.children.splice(c,0,e):i==null||i.value.children.splice(c+1,0,e),e.parent=i,i==null||i.updateValue(),!0):(console.warn("Not found target node"),!1)}if(n==="CHILD_START")return r.value.children.unshift(e),e.parent=r,r.updateValue(),!0;if(n==="CHILD_END")return r.value.children.push(e),e.parent=r,r.updateValue(),!0;if(B(n)){const i=n;if(i.type==="CHILD"){const c=i.pos,u=i.index||0;return c==="BEFORE"?r==null||r.value.children.splice(u,0,e):r==null||r.value.children.splice(u+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=K();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 Ot){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 Kt){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=Sr.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 p;return l.package===((p=c.value.npm)==null?void 0:p.package)});return u&&a.push(u),{componentName:c.componentName,...io(c.value.npm||{})}}).filter(c=>{if(c.componentName&&c.package&&c.version)return!0});this.materialsModel.usedMaterials=[];let i={...this.data,componentsTree:Er(n),componentsMeta:s,thirdLibs:this.data.thirdLibs,assets:[]};return(r=this.data.thirdLibs)==null||r.forEach(c=>{const u=o.find(l=>{l.package,l.package});u&&a.push(u)}),i.assets=af(a,c=>c.package),i=vo(i,["id"]),JSON.parse(JSON.stringify(i))}}Mt.ROOT_CONTAINER;var Bf=typeof global=="object"&&global&&global.Object===Object&&global;const Oo=Bf;var Uf=typeof self=="object"&&self&&self.Object===Object&&self,kf=Oo||Uf||Function("return this")();const Pt=kf;var zf=Pt.Symbol;const Ct=zf;var Co=Object.prototype,Gf=Co.hasOwnProperty,Hf=Co.toString,kt=Ct?Ct.toStringTag:void 0;function Vf(t){var e=Gf.call(t,kt),r=t[kt];try{t[kt]=void 0;var n=!0}catch{}var o=Hf.call(t);return n&&(e?t[kt]=r:delete t[kt]),o}var Wf=Object.prototype,Jf=Wf.toString;function qf(t){return Jf.call(t)}var Qf="[object Null]",Yf="[object Undefined]",vn=Ct?Ct.toStringTag:void 0;function ne(t){return t==null?t===void 0?Yf:Qf:vn&&vn in Object(t)?Vf(t):qf(t)}function Rt(t){return t!=null&&typeof t=="object"}var Xf="[object Symbol]";function Kf(t){return typeof t=="symbol"||Rt(t)&&ne(t)==Xf}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 tp=Array.isArray;const Et=tp;var ep=1/0,mn=Ct?Ct.prototype:void 0,yn=mn?mn.toString:void 0;function Eo(t){if(typeof t=="string")return t;if(Et(t))return Zf(t,Eo)+"";if(Kf(t))return yn?yn.call(t):"";var e=t+"";return e=="0"&&1/t==-ep?"-0":e}function mt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function No(t){return t}var rp="[object AsyncFunction]",np="[object Function]",op="[object GeneratorFunction]",ap="[object Proxy]";function $r(t){if(!mt(t))return!1;var e=ne(t);return e==np||e==op||e==rp||e==ap}var ip=Pt["__core-js_shared__"];const Re=ip;var gn=function(){var t=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function sp(t){return!!gn&&gn in t}var cp=Function.prototype,up=cp.toString;function lp(t){if(t!=null){try{return up.call(t)}catch{}try{return t+""}catch{}}return""}var fp=/[\\^$.*+?()[\]{}|]/g,pp=/^\[object .+?Constructor\]$/,dp=Function.prototype,hp=Object.prototype,vp=dp.toString,mp=hp.hasOwnProperty,yp=RegExp("^"+vp.call(mp).replace(fp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function gp(t){if(!mt(t)||sp(t))return!1;var e=$r(t)?yp:pp;return e.test(lp(t))}function bp(t,e){return t==null?void 0:t[e]}function Tr(t,e){var r=bp(t,e);return gp(r)?r:void 0}var bn=Object.create,_p=function(){function t(){}return function(e){if(!mt(e))return{};if(bn)return bn(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const jp=_p;function wp(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 Sp(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Op=800,Cp=16,Ep=Date.now;function Np(t){var e=0,r=0;return function(){var n=Ep(),o=Cp-(n-r);if(r=n,o>0){if(++e>=Op)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function $p(t){return function(){return t}}var Tp=function(){try{var t=Tr(Object,"defineProperty");return t({},"",{}),t}catch{}}();const de=Tp;var Ap=de?function(t,e){return de(t,"toString",{configurable:!0,enumerable:!1,value:$p(e),writable:!0})}:No;const xp=Ap;var Mp=Np(xp);const Pp=Mp;var Rp=9007199254740991,Dp=/^(?:0|[1-9]\d*)$/;function $o(t,e){var r=typeof t;return e=e==null?Rp:e,!!e&&(r=="number"||r!="symbol"&&Dp.test(t))&&t>-1&&t%1==0&&t<e}function Ar(t,e,r){e=="__proto__"&&de?de(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function je(t,e){return t===e||t!==t&&e!==e}var Ip=Object.prototype,Lp=Ip.hasOwnProperty;function Fp(t,e,r){var n=t[e];(!(Lp.call(t,e)&&je(n,r))||r===void 0&&!(e in t))&&Ar(t,e,r)}function Bp(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?Ar(r,i,c):Fp(r,i,c)}return r}var _n=Math.max;function Up(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),wp(t,this,i)}}function kp(t,e){return Pp(Up(t,e,No),t+"")}var zp=9007199254740991;function To(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=zp}function xr(t){return t!=null&&To(t.length)&&!$r(t)}function Gp(t,e,r){if(!mt(r))return!1;var n=typeof e;return(n=="number"?xr(r)&&$o(e,r.length):n=="string"&&e in r)?je(r[e],t):!1}function Hp(t){return kp(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&&Gp(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 Vp=Object.prototype;function Ao(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Vp;return t===r}function Wp(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Jp="[object Arguments]";function jn(t){return Rt(t)&&ne(t)==Jp}var xo=Object.prototype,qp=xo.hasOwnProperty,Qp=xo.propertyIsEnumerable,Yp=jn(function(){return arguments}())?jn:function(t){return Rt(t)&&qp.call(t,"callee")&&!Qp.call(t,"callee")};const qe=Yp;function Xp(){return!1}var Mo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,wn=Mo&&typeof module=="object"&&module&&!module.nodeType&&module,Kp=wn&&wn.exports===Mo,Sn=Kp?Pt.Buffer:void 0,Zp=Sn?Sn.isBuffer:void 0,td=Zp||Xp;const Po=td;var ed="[object Arguments]",rd="[object Array]",nd="[object Boolean]",od="[object Date]",ad="[object Error]",id="[object Function]",sd="[object Map]",cd="[object Number]",ud="[object Object]",ld="[object RegExp]",fd="[object Set]",pd="[object String]",dd="[object WeakMap]",hd="[object ArrayBuffer]",vd="[object DataView]",md="[object Float32Array]",yd="[object Float64Array]",gd="[object Int8Array]",bd="[object Int16Array]",_d="[object Int32Array]",jd="[object Uint8Array]",wd="[object Uint8ClampedArray]",Sd="[object Uint16Array]",Od="[object Uint32Array]",$={};$[md]=$[yd]=$[gd]=$[bd]=$[_d]=$[jd]=$[wd]=$[Sd]=$[Od]=!0;$[ed]=$[rd]=$[hd]=$[nd]=$[vd]=$[od]=$[ad]=$[id]=$[sd]=$[cd]=$[ud]=$[ld]=$[fd]=$[pd]=$[dd]=!1;function Cd(t){return Rt(t)&&To(t.length)&&!!$[ne(t)]}function Ed(t){return function(e){return t(e)}}var Ro=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vt=Ro&&typeof module=="object"&&module&&!module.nodeType&&module,Nd=Vt&&Vt.exports===Ro,De=Nd&&Oo.process,$d=function(){try{var t=Vt&&Vt.require&&Vt.require("util").types;return t||De&&De.binding&&De.binding("util")}catch{}}();const On=$d;var Cn=On&&On.isTypedArray,Td=Cn?Ed(Cn):Cd;const Do=Td;var Ad=Object.prototype,xd=Ad.hasOwnProperty;function Md(t,e){var r=Et(t),n=!r&&qe(t),o=!r&&!n&&Po(t),a=!r&&!n&&!o&&Do(t),s=r||n||o||a,i=s?Wp(t.length,String):[],c=i.length;for(var u in t)(e||xd.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||$o(u,c)))&&i.push(u);return i}function Pd(t,e){return function(r){return t(e(r))}}function Rd(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Dd=Object.prototype,Id=Dd.hasOwnProperty;function Ld(t){if(!mt(t))return Rd(t);var e=Ao(t),r=[];for(var n in t)n=="constructor"&&(e||!Id.call(t,n))||r.push(n);return r}function Io(t){return xr(t)?Md(t,!0):Ld(t)}var Fd=Tr(Object,"create");const Zt=Fd;function Bd(){this.__data__=Zt?Zt(null):{},this.size=0}function Ud(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var kd="__lodash_hash_undefined__",zd=Object.prototype,Gd=zd.hasOwnProperty;function Hd(t){var e=this.__data__;if(Zt){var r=e[t];return r===kd?void 0:r}return Gd.call(e,t)?e[t]:void 0}var Vd=Object.prototype,Wd=Vd.hasOwnProperty;function Jd(t){var e=this.__data__;return Zt?e[t]!==void 0:Wd.call(e,t)}var qd="__lodash_hash_undefined__";function Qd(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Zt&&e===void 0?qd:e,this}function pt(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])}}pt.prototype.clear=Bd;pt.prototype.delete=Ud;pt.prototype.get=Hd;pt.prototype.has=Jd;pt.prototype.set=Qd;function Yd(){this.__data__=[],this.size=0}function we(t,e){for(var r=t.length;r--;)if(je(t[r][0],e))return r;return-1}var Xd=Array.prototype,Kd=Xd.splice;function Zd(t){var e=this.__data__,r=we(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Kd.call(e,r,1),--this.size,!0}function th(t){var e=this.__data__,r=we(e,t);return r<0?void 0:e[r][1]}function eh(t){return we(this.__data__,t)>-1}function rh(t,e){var r=this.__data__,n=we(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=Yd;nt.prototype.delete=Zd;nt.prototype.get=th;nt.prototype.has=eh;nt.prototype.set=rh;var nh=Tr(Pt,"Map");const Lo=nh;function oh(){this.size=0,this.__data__={hash:new pt,map:new(Lo||nt),string:new pt}}function ah(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 ah(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ih(t){var e=Se(this,t).delete(t);return this.size-=e?1:0,e}function sh(t){return Se(this,t).get(t)}function ch(t){return Se(this,t).has(t)}function uh(t,e){var r=Se(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Dt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Dt.prototype.clear=oh;Dt.prototype.delete=ih;Dt.prototype.get=sh;Dt.prototype.has=ch;Dt.prototype.set=uh;function Fo(t){return t==null?"":Eo(t)}var lh=Pd(Object.getPrototypeOf,Object);const Bo=lh;var fh="[object Object]",ph=Function.prototype,dh=Object.prototype,Uo=ph.toString,hh=dh.hasOwnProperty,vh=Uo.call(Object);function Nt(t){if(!Rt(t)||ne(t)!=fh)return!1;var e=Bo(t);if(e===null)return!0;var r=hh.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Uo.call(r)==vh}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 yh(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",bh="\\u0300-\\u036f",_h="\\ufe20-\\ufe2f",jh="\\u20d0-\\u20ff",wh=bh+_h+jh,Sh="\\ufe0e\\ufe0f",Oh="\\u200d",Ch=RegExp("["+Oh+gh+wh+Sh+"]");function ko(t){return Ch.test(t)}function Eh(t){return t.split("")}var zo="\\ud800-\\udfff",Nh="\\u0300-\\u036f",$h="\\ufe20-\\ufe2f",Th="\\u20d0-\\u20ff",Ah=Nh+$h+Th,xh="\\ufe0e\\ufe0f",Mh="["+zo+"]",Qe="["+Ah+"]",Ye="\\ud83c[\\udffb-\\udfff]",Ph="(?:"+Qe+"|"+Ye+")",Go="[^"+zo+"]",Ho="(?:\\ud83c[\\udde6-\\uddff]){2}",Vo="[\\ud800-\\udbff][\\udc00-\\udfff]",Rh="\\u200d",Wo=Ph+"?",Jo="["+xh+"]?",Dh="(?:"+Rh+"(?:"+[Go,Ho,Vo].join("|")+")"+Jo+Wo+")*",Ih=Jo+Wo+Dh,Lh="(?:"+[Go+Qe+"?",Qe,Ho,Vo,Mh].join("|")+")",Fh=RegExp(Ye+"(?="+Ye+")|"+Lh+Ih,"g");function Bh(t){return t.match(Fh)||[]}function Uh(t){return ko(t)?Bh(t):Eh(t)}function kh(t){return function(e){e=Fo(e);var r=ko(e)?Uh(e):void 0,n=r?r[0]:e.charAt(0),o=r?yh(r,1).join(""):e.slice(1);return n[t]()+o}}var zh=kh("toUpperCase");const Gh=zh;function Hh(t){return Gh(Fo(t).toLowerCase())}function Vh(){this.__data__=new nt,this.size=0}function Wh(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Jh(t){return this.__data__.get(t)}function qh(t){return this.__data__.has(t)}var Qh=200;function Yh(t,e){var r=this.__data__;if(r instanceof nt){var n=r.__data__;if(!Lo||n.length<Qh-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Dt(n)}return r.set(t,e),this.size=r.size,this}function It(t){var e=this.__data__=new nt(t);this.size=e.size}It.prototype.clear=Vh;It.prototype.delete=Wh;It.prototype.get=Jh;It.prototype.has=qh;It.prototype.set=Yh;var qo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,En=qo&&typeof module=="object"&&module&&!module.nodeType&&module,Xh=En&&En.exports===qo,Nn=Xh?Pt.Buffer:void 0,$n=Nn?Nn.allocUnsafe:void 0;function Kh(t,e){if(e)return t.slice();var r=t.length,n=$n?$n(r):new t.constructor(r);return t.copy(n),n}var Zh=Pt.Uint8Array;const Tn=Zh;function tv(t){var e=new t.constructor(t.byteLength);return new Tn(e).set(new Tn(t)),e}function ev(t,e){var r=e?tv(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function rv(t){return typeof t.constructor=="function"&&!Ao(t)?jp(Bo(t)):{}}function nv(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 ov=nv();const av=ov;function Xe(t,e,r){(r!==void 0&&!je(t[e],r)||r===void 0&&!(e in t))&&Ar(t,e,r)}function iv(t){return Rt(t)&&xr(t)}function Ke(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function sv(t){return Bp(t,Io(t))}function cv(t,e,r,n,o,a,s){var i=Ke(t,r),c=Ke(e,r),u=s.get(c);if(u){Xe(t,r,u);return}var l=a?a(i,c,r+"",t,e,s):void 0,p=l===void 0;if(p){var f=Et(c),d=!f&&Po(c),h=!f&&!d&&Do(c);l=c,f||d||h?Et(i)?l=i:iv(i)?l=Sp(i):d?(p=!1,l=Kh(c,!0)):h?(p=!1,l=ev(c,!0)):l=[]:Nt(c)||qe(c)?(l=i,qe(i)?l=sv(i):(!mt(i)||$r(i))&&(l=rv(c))):p=!1}p&&(s.set(c,l),o(l,c,n,a,s),s.delete(c)),Xe(t,r,l)}function Qo(t,e,r,n,o){t!==e&&av(e,function(a,s){if(o||(o=new It),mt(a))cv(t,e,s,r,Qo,n,o);else{var i=n?n(Ke(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),Xe(t,s,i)}},Io)}var uv=Hp(function(t,e,r){Qo(t,e,r)});const lv=uv;function fv(t){const e=t.prototype;return!!(e&&e.isReactComponent)}function pv(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 dv(t){class e extends ut.Component{render(){return ut.createElement(t,this.props)}}return e.displayName=t.displayName,e}const bt=(t,e)=>{const r=n=>{const a=`
|
|
5
|
+
${Object.keys(e).map(s=>`const ${s} = $$context['${s}'];`).join(`
|
|
6
|
+
`)}
|
|
7
|
+
return ${n};
|
|
8
|
+
`;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}},hv=(t,e,r)=>function(...o){try{const a=`
|
|
9
|
+
var f = ${t};
|
|
10
|
+
var args = Array.from(arguments);
|
|
11
|
+
var __$$storeManager__ = args.pop();
|
|
12
|
+
var $$context = args.pop();
|
|
13
|
+
$$context.stateManager = __$$storeManager__.getStateSnapshot();
|
|
14
|
+
return f.apply(f, args)
|
|
15
|
+
`;new Function(a)(...o,e,r)}catch(a){console.warn(a)}},An=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},xn=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?Hh(a):a)),e[o.join("")]=t[r]}),e},Mn=t=>{let e="";return Object.keys(t).forEach(r=>{e+=`${r}:${t[r]};`}),e},ce="DYNAMIC",vv=["$$context","$$nodeModel"],Pn=t=>{let e;const r=new Set,n=(c,u)=>{const l=typeof c=="function"?c(e):c;if(!Object.is(l,e)){const p=e;e=(u!=null?u:typeof l!="object")?l:Object.assign({},e,l),r.forEach(f=>f(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}&&"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},mv=t=>t?Pn(t):Pn;var yv=t=>(({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&console.warn("[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'."),mv(t));class gv{constructor(){g(this,"storeMap",new Map)}addStore(e,r){const n=yv(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)}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]={state:r.getState(),updateState:o=>{r.setState(o)}}}),e}destroy(){this.storeMap.forEach(e=>{e.destroy()}),this.storeMap=new Map}}class Yo{constructor(){g(this,"renderMode","normal");g(this,"components",{});g(this,"storeManager",new gv);g(this,"runtimeComponentCache",new Map);g(this,"onGetRef");g(this,"onGetComponent");g(this,"onComponentMount");g(this,"onComponentDestroy");g(this,"processNodeConfigHook")}getComponent(e){var o;const r=e.value.componentName;let n=this.components[r]||(()=>`Component [${r}] not found`);return pv(n)||(n=dv(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,p=this.getComponent(l),f=this.convertModelToComponent(p,e.value.componentsTree),d={},h=l.props;return Object.keys(h).forEach(y=>{d[y]=h[y].value}),d.$$context=o,this.render(f,d)}transformProps(e={},{$$context:r}){const n=e,o=s=>{if(Array.isArray(s))return s.map(i=>o(i));if(Me(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 p=`${l.id}-${ce}`;if(this.runtimeComponentCache.get(l.id))return{key:p,component:this.runtimeComponentCache.get(l.id)};const f=this.getComponent(l),d=this.convertModelToComponent(f,l),h=i.params||[];return{component:(...j)=>{const O=An(j,h),P=this.getContext({params:O},r);return this.render(d,{$$context:P,key:p})},key:p}};if(Array.isArray(c)){const l=c==null?void 0:c.map(p=>u(p));return(...p)=>l.map(f=>fv(f.component)?w.default.createElement(f.component,{$$context:r,key:f.key}):f.component(...p))}else return u(c).component}else{if(st(s))return bt(s.value,r||{});if(xf(s))return hv(s.value,r,this.storeManager);if(Nt(s)){let i=s;Me(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;Me(s)&&(i=s.value),r(i)?n.push({keyPath:a,val:i}):Et(i)?i.forEach((c,u)=>{o([...a,String(u)],c)}):Nt(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 w.default.Component{constructor(i){super(i);g(this,"_CONDITION",!0);g(this,"_DESIGN_BOX",!1);g(this,"_NODE_MODEL",r);g(this,"_NODE_ID",r.id);g(this,"UNIQUE_ID",`${r.id}_${K()}`);g(this,"targetComponentRef");g(this,"listenerHandle",[]);g(this,"storeState");g(this,"staticState",{});g(this,"storeListenDisposeLint",[]);g(this,"domHeader");g(this,"mediaStyleDomMap",{});g(this,"updateState",i=>{this.storeState.setState(i),this.forceUpdate()});g(this,"getStyleDomById",i=>{const c=this.mediaStyleDomMap;let u=c[i];return u||(u=document.createElement("style"),u.type="text/css",c[i]=u),u.id=i,u});g(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 d;const p=`${this.UNIQUE_ID}_${l.state}`;let f=`.${c.class}`;if(l.state!=="normal"&&(f=`${f}:${l.state}`),Object.keys(l.style).length!==0){const h=this.getStyleDomById(p);h.innerText=`${f} { ${Mn(l.style)} }`,i==null||i.appendChild(h)}(d=l.media)!=null&&d.length&&l.media.forEach(h=>{const y=`${p}_${h.type}_${h.value}`,b=this.getStyleDomById(y);b.media=`screen and (${h.type}:${h.value}px)`,b.innerHTML=`${f} { ${Mn(h.style)} }`,i==null||i.appendChild(b)})})});g(this,"removeMediaCSS",()=>{const i=this.mediaStyleDomMap;Object.keys(i).forEach(c=>{var u;(u=this.domHeader)==null||u.removeChild(i[c])})});g(this,"rebuildNode",()=>{this.storeListenDisposeLint.forEach(i=>i()),this.removeMediaCSS(),this.connectStore(),this.addMediaCSS(),this.forceUpdate()});this.targetComponentRef=w.default.createRef(),this.state=r.value.state||{};const c=r.value.stateName||r.id,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(l=>{this.setState({...l})}),this.connectStore()}connectStore(){const i=n.collectSpecialProps(r.props,f=>!!st(f)),c=n.collectSpecialProps({css:r.value.css,class:r.value.classNames},f=>!!st(f)),u=[...i,...c].map(f=>{const d=f.val,y=/\$\$context.stateManager\.(.+?)\./gim.exec(d.value);return y!=null&&y.length?y[1]:""}).filter(Boolean),l=Array.from(new Set(u)),p=[];l.length&&l.forEach(f=>{n.storeManager.getStore(f)||(n.storeManager.addStore(f,()=>({})),console.log(n.storeManager,f,"not exits"));const h=n.storeManager.connect(f,()=>{this.forceUpdate()});p.push(h)}),this.storeListenDisposeLint=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.stateName||r.id,this.storeState),this.storeState.setState({...this.state,...r.value.state||{}}),this.rebuildNode()};r.onChange(i)}componentWillUnmount(){var i;this.storeListenDisposeLint.forEach(c=>c()),this.removeMediaCSS(),(i=n.onComponentDestroy)==null||i.call(n,this,r)}render(){var yt,C,Lt;const{$$context:i,...c}=this.props,u={key:r.id,...r.props,...c},l={state:this.state||{},updateState:this.updateState,staticState:this.staticState};r.value.componentName===Mt.ROOT_CONTAINER&&(l.globalState=this.state,l.updateGlobalState=this.updateState),l.stateManager=n.storeManager.getStateSnapshot();const p=n.getContext(l,i),f=r.value.loop;let d=[];if(f&&f.open){this.targetComponentRef.current=[];let I=f.data||[];if(st(f.data)){const Z=f.data;I=bt(Z.value,p||{})}return d=I.map((...Z)=>{var Mr,Pr;const Ft=Z[1],gt=[f.forName||"item",f.forIndex||"index"],Oe=An(Z,gt);let Ce="loopData";f.name&&(Ce=`${Ce}${f.name}`);const Bt=n.getContext({[Ce]:Oe,staticState:this.staticState},p),q=n.transformProps(u,{$$context:Bt}),na=((Mr=r.value.classNames)==null?void 0:Mr.map(H=>{var ie;const ae=H.name;return(st(H.status)?bt(String(((ie=H.status)==null?void 0:ie.value)||""),Bt):!1)?ae:""}))||[];let Ee=`${(Pr=q.className)!=null?Pr:""} ${na.join(" ")}`.trim();r.value.css&&(Ee=`${r.value.css.class} ${Ee}`.trim()),q.className=Ee;const oa=n.transformProps(r.value.style,{$$context:Bt});r.value.style&&(q.style=xn(oa||{}));const{children:oe}=q;let Ne=[];if(oe!==void 0)delete q.children,Ne=Array.isArray(oe)?oe:[oe];else{const H=[];r.value.children.forEach((Rr,ie)=>{const aa=n.buildComponent(Rr,{$$context:Bt,idx:ie});H.push(aa)}),Ne=H}if(q.key=`${q.key}-${Ft}`,st(f.key)){const H=f.key,ae=bt(H.value,Bt||{});q.key+=`-${ae}`}return q.ref=H=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[Ft]=H},n.render(e,q,...Ne)}),d}const h=n.transformProps(u,{$$context:p}),{children:y}=h;let b=[];if(y!==void 0)delete h.children,b=Array.isArray(y)?y:[y];else{const I=[];r.value.children.forEach((Ft,gt)=>{const Oe=n.buildComponent(Ft,{$$context:p,idx:gt});I.push(Oe)}),b=I}h.ref=this.targetComponentRef;const j=((yt=r.value.classNames)==null?void 0:yt.map(I=>{var gt;const Z=I.name;return(st(I.status)?bt(((gt=I.status)==null?void 0:gt.value)||"",p):!1)?Z:""}))||[];let O=`${(C=h.className)!=null?C:""} ${j.join(" ")}`.trim();r.value.css&&(O=`${r.value.css.class} ${O}`.trim()),h.className=O;const P=n.transformProps(r.value.style,{$$context:p});r.value.style&&(h.style=xn(P||{}));let T=(Lt=r.value.condition)!=null?Lt:!0;typeof T!="boolean"&&(T=bt(T.value,p||{}));let R={condition:T,props:h};n.processNodeConfigHook&&(R=n.processNodeConfigHook(R,r));const G=n.render(e,R.props,...b);return this._CONDITION=R.condition,R.condition?G:w.default.createElement("div",{style:{display:"none"}},G)}}return g(o,"__CP_TYPE__",ce),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}-${ce}`,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):(vv.forEach(a=>{a in r&&e.__CP_TYPE__!==ce&&delete r[a]}),w.default.createElement(e,r,...n))}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const bv=Dn(new Yo),_v=["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","search","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},jv=[..._v,...mf],wv=jv.reduce((t,e)=>(t[e]=({children:r,$$attributes:n=[],...o})=>{let a=r;return Array.isArray(r)||(a=[r]),w.default.createElement(e,{...o,...ot(n)},...a)},t),{}),Sv=({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 w.default.createElement("div",{...o,...i,style:c},...a)},Ov=({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),w.default.createElement("canvas",{...r,...ot(e)},...n)},Cv=({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),w.default.createElement("img",{...r,...ot(e)},...n)},Ev=({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),w.default.createElement("video",{...r,...ot(e)},...n)},Nv=({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),w.default.createElement("video",{...r,...ot(e)},...n)},$v=({children:t,$$attributes:e=[],content:r,...n})=>w.default.createElement("span",{...n,...ot(e)},r),Tv=({children:t,$$attributes:e=[],afterMount:r,beforeDestroy:n,...o})=>{let a=t;return Array.isArray(t)||(a=[t]),ut.useEffect(()=>(r==null||r(o),()=>{n==null||n(o)}),[]),w.default.createElement("div",{...o,...ot(e)},...a)},Av=({children:t,$$attributes:e=[],htmlTag:r="div",...n})=>{let o=t;return Array.isArray(t)||(o=[t]),w.default.createElement(r,{...n,...ot(e)},...o)},xv={RootContainer:({children:t})=>t,...wv,CContainer:Tv,CVideo:Ev,CAudio:Nv,CBlock:Sv,CImage:Cv,CText:$v,CCanvas:Ov,CNativeTag:Av};class Mv{constructor(){g(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 Xo extends w.default.Component{constructor(r){super(r);g(this,"refManager");g(this,"dynamicComponentInstanceMap",new Map);g(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)});g(this,"rerender",r=>{if(this.props.adapter.clear(),(r==null?void 0:r.nodeType)==="PAGE"&&r)this.setState({pageModel:r});else if(Nt(r)&&So(r)){const n=r;this.setState({pageModel:new pe(n,{materials:this.state.pageModel.materialsModel.rawValue})})}});this.state={pageModel:r.pageModel||new pe(r.page)},this.refManager=new Mv}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={...xv,...r.components};return n.pageRender(i,{libs:{},components:c,onGetRef:this.onGetRef,onGetComponent:o,onComponentMount:s,onComponentDestroy:a,$$context:{refs:this.refManager},renderMode:r.renderMode,processNodeConfigHook:r.processNodeConfigHook})}}const Pv=()=>{const t=ut.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)}}};class Rv extends w.default.Component{constructor(r){super(r);g(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=w.default.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\uFF1A",n.title," component name\uFF1A",n.title||n.componentName,w.default.createElement("p",null,"msg: ",String(this.state.error)),w.default.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"),w.default.createElement("div",{style:{display:"none"}}));return w.default.createElement(this.props.targetComponent,{onlyRenderChild:!0},o)}return this.props.children}}class Ko{constructor(){g(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 Zo=t=>{const{node:e}=t,r=ut.useMemo(()=>{var c,u;const i=(u=(c=e.material)==null?void 0:c.value)==null?void 0:u.isContainer;return Nt(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 w.default.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 Dv extends w.default.Component{constructor(r){super(r);g(this,"instanceManager",new Ko);g(this,"renderRef");g(this,"dropPlaceholder",Zo);g(this,"onGetComponent",(r,n)=>{const o=this;class a extends w.default.Component{constructor(){super(...arguments);g(this,"_DESIGN_BOX",!0);g(this,"_NODE_MODEL",n);g(this,"_NODE_ID",n.id);g(this,"_UNIQUE_ID",`${n.id}_${K()}`);g(this,"_STATUS")}componentDidMount(){o.instanceManager.add(n.id,this)}componentWillUnmount(){this._STATUS="DESTROY",o.instanceManager.remove(n.id,this)}render(){var d;const{children:c=[],onlyRenderChild:u,...l}=this.props;let p=c;return Et(c)||(p=[c]),!Boolean(p.filter(Boolean).length)&&(((d=n.material)==null?void 0:d.value.isContainer)||n.value.componentName===Mt.ROOT_CONTAINER)&&p.push(w.default.createElement(o.dropPlaceholder,{node:n})),u?p:w.default.createElement(r,l,...p)}}return w.default.forwardRef(function(i,c){return w.default.createElement(Rv,{node:n,targetComponent:a},w.default.createElement(a,{ref:c,...i}))})});this.renderRef=w.default.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=ta(r);if(!n)return null;const o=ea(n);return(o==null?void 0:o.stateNode)||null}getDomsById(r,n){const o=this.getInstancesById(r),a=[];return o==null||o.forEach(s=>{if((s==null?void 0:s._STATUS)==="DESTROY")return;const i=fa.findDOMNode(s);if(i&&!(i instanceof Text))if(n){const c=Array.from(i.querySelectorAll(n));a.push(...c)}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),w.default.createElement(Xo,{onGetComponent:n,...a,processNodeConfigHook:(s,i)=>{var h,y;if(i.nodeType!=="NODE")return s;const{props:c,condition:u}=s;let l={...c};const p=((h=i.value.configure)==null?void 0:h.devState)||{},f=(y=i.material)==null?void 0:y.value.fixedProps;if(f!==void 0){if(Nt(f))l={...l,...f};else if(typeof f=="function"){const b=f(l);l={...l,...b}}}let d=u;return p.condition===!1&&(d=p.condition),{props:lv(l,p.props||{}),condition:d}},ref:this.renderRef})}}const ta=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:ta(t.parentElement)},ea=t=>{var e;return t?(e=t==null?void 0:t.stateNode)!=null&&e._DESIGN_BOX?t:ea(t.return):null},Iv=()=>{const t=ut.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 Lv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ra={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Lv,function(){var r=function(){},n={},o={},a={};function s(f,d){f=f.push?f:[f];var h=[],y=f.length,b=y,j,O,P,T;for(j=function(R,G){G.length&&h.push(R),b--,b||d(h)};y--;){if(O=f[y],P=o[O],P){j(O,P);continue}T=a[O]=a[O]||[],T.push(j)}}function i(f,d){if(!!f){var h=a[f];if(o[f]=d,!!h)for(;h.length;)h[0](f,d),h.splice(0,1)}}function c(f,d){f.call&&(f={success:f}),d.length?(f.error||r)(d):(f.success||r)(f)}function u(f,d,h,y){var b=document,j=h.async,O=(h.numRetries||0)+1,P=h.before||r,T=f.replace(/[\?|#].*$/,""),R=f.replace(/^(css|img|module|nomodule)!/,""),G,yt,C;if(y=y||0,/(^css!|\.css$)/.test(T))C=b.createElement("link"),C.rel="stylesheet",C.href=R,G="hideFocus"in C,G&&C.relList&&(G=0,C.rel="preload",C.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(T))C=b.createElement("img"),C.src=R;else if(C=b.createElement("script"),C.src=R,C.async=j===void 0?!0:j,yt="noModule"in C,/^module!/.test(T)){if(!yt)return d(f,"l");C.type="module"}else if(/^nomodule!/.test(T)&&yt)return d(f,"l");C.onload=C.onerror=C.onbeforeload=function(Lt){var I=Lt.type[0];if(G)try{C.sheet.cssText.length||(I="e")}catch(Z){Z.code!=18&&(I="e")}if(I=="e"){if(y+=1,y<O)return u(f,d,h,y)}else if(C.rel=="preload"&&C.as=="style")return C.rel="stylesheet";d(f,I,Lt.defaultPrevented)},P(f,C)!==!1&&b.head.appendChild(C)}function l(f,d,h){f=f.push?f:[f];var y=f.length,b=y,j=[],O,P;for(O=function(T,R,G){if(R=="e"&&j.push(T),R=="b")if(G)j.push(T);else return;y--,y||d(j)},P=0;P<b;P++)u(f[P],O,h)}function p(f,d,h){var y,b;if(d&&d.trim&&(y=d),b=(y?h:d)||{},y){if(y in n)throw"LoadJS";n[y]=!0}function j(O,P){l(f,function(T){c(b,T),O&&c({success:O,error:P},T),i(y,T)},b)}if(b.returnPromise)return new Promise(j);j()}return p.ready=function(d,h){return s(d,function(y){c(h,y)}),p},p.done=function(d){i(d,[])},p.reset=function(){n={},o={},a={}},p.isDefined=function(d){return d in n},p})})(ra);const Rn=ra.exports;class Fv{constructor(e,r){g(this,"assets");g(this,"loadStatus");g(this,"win",window);g(this,"_onSuccessList",[]);g(this,"_onErrorList",[]);this.assets=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=K()),r.push(o.id);const a=o.resources.map(s=>s.src);Rn(a,o.id,{async:!1,before:(s,i)=>(this.win.document.body.appendChild(i),!1)})}if(e.length===0){this._onSuccessList.forEach(n=>n());return}return setTimeout(()=>{Rn.ready(r,{success:()=>{this._onSuccessList.forEach(n=>n())},error:n=>{this._onErrorList.forEach(o=>o(n))}})},0),this}onSuccess(e){return this._onSuccessList.push(e),this}onError(e){return this._onErrorList.push(e),this}}exports.AssetLoader=Fv;exports.ComponentInstanceManager=Ko;exports.DefaultDropPlaceholder=Zo;exports.DefineReactAdapter=Yo;exports.DesignRender=Dv;exports.ReactAdapter=bv;exports.Render=Xo;exports.getAdapter=Dn;exports.useDesignRender=Iv;exports.useRender=Pv;
|
|
16
|
+
//# sourceMappingURL=index.cjs.js.map
|