@chamn/render 0.0.27 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,9 +1,9 @@
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 Wm=Object.defineProperty;var Jm=(g,S,ct)=>S in g?Wm(g,S,{enumerable:!0,configurable:!0,writable:!0,value:ct}):g[S]=ct;var b=(g,S,ct)=>(Jm(g,typeof S!="symbol"?S+"":S,ct),ct);function ha(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 ma=ha(ct),va=t=>()=>{console.warn(`${t} need to be implement getComponent`)},ga=["customPageRootRender"],Br=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","getDataLink","createDataLink","transformProps","transformData","transformGlobalData","errorCatch","clear"],Ur=t=>[...Br,...ga].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):Br.includes(n)&&(r[n]=va),r},{});var ya=Object.defineProperty,ba=(t,e,r)=>e in t?ya(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e,r)=>(ba(t,typeof e!="symbol"?e+"":e,r),r),_a=typeof global=="object"&&global&&global.Object===Object&&global;const kr=_a;var Sa=typeof self=="object"&&self&&self.Object===Object&&self,ja=kr||Sa||Function("return this")();const q=ja;var Oa=q.Symbol;const V=Oa;var Vr=Object.prototype,wa=Vr.hasOwnProperty,Ca=Vr.toString,Bt=V?V.toStringTag:void 0;function Ea(t){var e=wa.call(t,Bt),r=t[Bt];try{t[Bt]=void 0;var n=!0}catch{}var o=Ca.call(t);return n&&(e?t[Bt]=r:delete t[Bt]),o}var $a=Object.prototype,Na=$a.toString;function Ta(t){return Na.call(t)}var Aa="[object Null]",Ma="[object Undefined]",zr=V?V.toStringTag:void 0;function ut(t){return t==null?t===void 0?Ma:Aa:zr&&zr in Object(t)?Ea(t):Ta(t)}function Y(t){return t!=null&&typeof t=="object"}var Pa="[object Symbol]";function Ne(t){return typeof t=="symbol"||Y(t)&&ut(t)==Pa}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 xa=Array.isArray;const I=xa;var Ia=1/0,Gr=V?V.prototype:void 0,Hr=Gr?Gr.toString:void 0;function Wr(t){if(typeof t=="string")return t;if(I(t))return Te(t,Wr)+"";if(Ne(t))return Hr?Hr.call(t):"";var e=t+"";return e=="0"&&1/t==-Ia?"-0":e}function H(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Ae(t){return t}var Da="[object AsyncFunction]",Ra="[object Function]",La="[object GeneratorFunction]",Fa="[object Proxy]";function Me(t){if(!H(t))return!1;var e=ut(t);return e==Ra||e==La||e==Da||e==Fa}var Ba=q["__core-js_shared__"];const Pe=Ba;var Jr=function(){var t=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Ua(t){return!!Jr&&Jr in t}var ka=Function.prototype,Va=ka.toString;function lt(t){if(t!=null){try{return Va.call(t)}catch{}try{return t+""}catch{}}return""}var za=/[\\^$.*+?()[\]{}|]/g,Ga=/^\[object .+?Constructor\]$/,Ha=Function.prototype,Wa=Object.prototype,Ja=Ha.toString,Qa=Wa.hasOwnProperty,qa=RegExp("^"+Ja.call(Qa).replace(za,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ya(t){if(!H(t)||Ua(t))return!1;var e=Me(t)?qa:Ga;return e.test(lt(t))}function Ka(t,e){return t==null?void 0:t[e]}function ft(t,e){var r=Ka(t,e);return Ya(r)?r:void 0}var Xa=ft(q,"WeakMap");const xe=Xa;var Qr=Object.create,Za=function(){function t(){}return function(e){if(!H(e))return{};if(Qr)return Qr(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const ti=Za;function ei(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 ri(){}function qr(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var ni=800,oi=16,ai=Date.now;function ii(t){var e=0,r=0;return function(){var n=ai(),o=oi-(n-r);if(r=n,o>0){if(++e>=ni)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function si(t){return function(){return t}}var ci=function(){try{var t=ft(Object,"defineProperty");return t({},"",{}),t}catch{}}();const ie=ci;var ui=ie?function(t,e){return ie(t,"toString",{configurable:!0,enumerable:!1,value:si(e),writable:!0})}:Ae,li=ii(ui);const Yr=li;function fi(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function di(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 pi(t){return t!==t}function hi(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function mi(t,e,r){return e===e?hi(t,e,r):di(t,pi,r)}function vi(t,e){var r=t==null?0:t.length;return!!r&&mi(t,e,0)>-1}var gi=9007199254740991,yi=/^(?:0|[1-9]\d*)$/;function se(t,e){var r=typeof t;return e=e??gi,!!e&&(r=="number"||r!="symbol"&&yi.test(t))&&t>-1&&t%1==0&&t<e}function Ie(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 bi=Object.prototype,_i=bi.hasOwnProperty;function De(t,e,r){var n=t[e];(!(_i.call(t,e)&&Ut(n,r))||r===void 0&&!(e in t))&&Ie(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?Ie(r,i,c):De(r,i,c)}return r}var Kr=Math.max;function Xr(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),ei(t,this,i)}}function Zr(t,e){return Yr(Xr(t,e,Ae),t+"")}var Si=9007199254740991;function Re(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Si}function ce(t){return t!=null&&Re(t.length)&&!Me(t)}function ji(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 Oi(t){return Zr(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&&ji(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 wi=Object.prototype;function Le(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||wi;return t===r}function Ci(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Ei="[object Arguments]";function tn(t){return Y(t)&&ut(t)==Ei}var en=Object.prototype,$i=en.hasOwnProperty,Ni=en.propertyIsEnumerable,Ti=tn(function(){return arguments}())?tn:function(t){return Y(t)&&$i.call(t,"callee")&&!Ni.call(t,"callee")};const kt=Ti;function Ai(){return!1}var rn=typeof g=="object"&&g&&!g.nodeType&&g,nn=rn&&typeof module=="object"&&module&&!module.nodeType&&module,Mi=nn&&nn.exports===rn,on=Mi?q.Buffer:void 0,Pi=on?on.isBuffer:void 0,xi=Pi||Ai;const Vt=xi;var Ii="[object Arguments]",Di="[object Array]",Ri="[object Boolean]",Li="[object Date]",Fi="[object Error]",Bi="[object Function]",Ui="[object Map]",ki="[object Number]",Vi="[object Object]",zi="[object RegExp]",Gi="[object Set]",Hi="[object String]",Wi="[object WeakMap]",Ji="[object ArrayBuffer]",Qi="[object DataView]",qi="[object Float32Array]",Yi="[object Float64Array]",Ki="[object Int8Array]",Xi="[object Int16Array]",Zi="[object Int32Array]",ts="[object Uint8Array]",es="[object Uint8ClampedArray]",rs="[object Uint16Array]",ns="[object Uint32Array]",N={};N[qi]=N[Yi]=N[Ki]=N[Xi]=N[Zi]=N[ts]=N[es]=N[rs]=N[ns]=!0,N[Ii]=N[Di]=N[Ji]=N[Ri]=N[Qi]=N[Li]=N[Fi]=N[Bi]=N[Ui]=N[ki]=N[Vi]=N[zi]=N[Gi]=N[Hi]=N[Wi]=!1;function os(t){return Y(t)&&Re(t.length)&&!!N[ut(t)]}function Fe(t){return function(e){return t(e)}}var an=typeof g=="object"&&g&&!g.nodeType&&g,zt=an&&typeof module=="object"&&module&&!module.nodeType&&module,as=zt&&zt.exports===an,Be=as&&kr.process,is=function(){try{var t=zt&&zt.require&&zt.require("util").types;return t||Be&&Be.binding&&Be.binding("util")}catch{}}();const St=is;var sn=St&&St.isTypedArray,ss=sn?Fe(sn):os;const Ue=ss;var cs=Object.prototype,us=cs.hasOwnProperty;function cn(t,e){var r=I(t),n=!r&&kt(t),o=!r&&!n&&Vt(t),a=!r&&!n&&!o&&Ue(t),s=r||n||o||a,i=s?Ci(t.length,String):[],c=i.length;for(var u in t)(e||us.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 un(t,e){return function(r){return t(e(r))}}var ls=un(Object.keys,Object);const fs=ls;var ds=Object.prototype,ps=ds.hasOwnProperty;function hs(t){if(!Le(t))return fs(t);var e=[];for(var r in Object(t))ps.call(t,r)&&r!="constructor"&&e.push(r);return e}function ue(t){return ce(t)?cn(t):hs(t)}function ms(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var vs=Object.prototype,gs=vs.hasOwnProperty;function ys(t){if(!H(t))return ms(t);var e=Le(t),r=[];for(var n in t)n=="constructor"&&(e||!gs.call(t,n))||r.push(n);return r}function Gt(t){return ce(t)?cn(t,!0):ys(t)}var bs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_s=/^\w*$/;function ke(t,e){if(I(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Ne(t)?!0:_s.test(t)||!bs.test(t)||e!=null&&t in Object(e)}var Ss=ft(Object,"create");const Ht=Ss;function js(){this.__data__=Ht?Ht(null):{},this.size=0}function Os(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var ws="__lodash_hash_undefined__",Cs=Object.prototype,Es=Cs.hasOwnProperty;function $s(t){var e=this.__data__;if(Ht){var r=e[t];return r===ws?void 0:r}return Es.call(e,t)?e[t]:void 0}var Ns=Object.prototype,Ts=Ns.hasOwnProperty;function As(t){var e=this.__data__;return Ht?e[t]!==void 0:Ts.call(e,t)}var Ms="__lodash_hash_undefined__";function Ps(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ht&&e===void 0?Ms: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=js,dt.prototype.delete=Os,dt.prototype.get=$s,dt.prototype.has=As,dt.prototype.set=Ps;function xs(){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 Is=Array.prototype,Ds=Is.splice;function Rs(t){var e=this.__data__,r=le(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Ds.call(e,r,1),--this.size,!0}function Ls(t){var e=this.__data__,r=le(e,t);return r<0?void 0:e[r][1]}function Fs(t){return le(this.__data__,t)>-1}function Bs(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=xs,et.prototype.delete=Rs,et.prototype.get=Ls,et.prototype.has=Fs,et.prototype.set=Bs;var Us=ft(q,"Map");const Wt=Us;function ks(){this.size=0,this.__data__={hash:new dt,map:new(Wt||et),string:new dt}}function Vs(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 Vs(e)?r[typeof e=="string"?"string":"hash"]:r.map}function zs(t){var e=fe(this,t).delete(t);return this.size-=e?1:0,e}function Gs(t){return fe(this,t).get(t)}function Hs(t){return fe(this,t).has(t)}function Ws(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=ks,rt.prototype.delete=zs,rt.prototype.get=Gs,rt.prototype.has=Hs,rt.prototype.set=Ws;var Js="Expected a function";function Ve(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Js);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(Ve.Cache||rt),r}Ve.Cache=rt;var Qs=500;function qs(t){var e=Ve(t,function(n){return r.size===Qs&&r.clear(),n}),r=e.cache;return e}var Ys=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ks=/\\(\\)?/g,Xs=qs(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Ys,function(r,n,o,a){e.push(o?a.replace(Ks,"$1"):n||r)}),e});const Zs=Xs;function tc(t){return t==null?"":Wr(t)}function jt(t,e){return I(t)?t:ke(t,e)?[t]:Zs(tc(t))}var ec=1/0;function Ot(t){if(typeof t=="string"||Ne(t))return t;var e=t+"";return e=="0"&&1/t==-ec?"-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 ln(t,e,r){var n=t==null?void 0:de(t,e);return n===void 0?r:n}function ze(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var fn=V?V.isConcatSpreadable:void 0;function rc(t){return I(t)||kt(t)||!!(fn&&t&&t[fn])}function Ge(t,e,r,n,o){var a=-1,s=t.length;for(r||(r=rc),o||(o=[]);++a<s;){var i=t[a];e>0&&r(i)?e>1?Ge(i,e-1,r,n,o):ze(o,i):n||(o[o.length]=i)}return o}function nc(t){var e=t==null?0:t.length;return e?Ge(t,1):[]}function oc(t){return Yr(Xr(t,void 0,nc),t+"")}var ac=un(Object.getPrototypeOf,Object);const He=ac;var ic="[object Object]",sc=Function.prototype,cc=Object.prototype,dn=sc.toString,uc=cc.hasOwnProperty,lc=dn.call(Object);function F(t){if(!Y(t)||ut(t)!=ic)return!1;var e=He(t);if(e===null)return!0;var r=uc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&dn.call(r)==lc}function fc(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 dc(){this.__data__=new et,this.size=0}function pc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function hc(t){return this.__data__.get(t)}function mc(t){return this.__data__.has(t)}var vc=200;function gc(t,e){var r=this.__data__;if(r instanceof et){var n=r.__data__;if(!Wt||n.length<vc-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 W(t){var e=this.__data__=new et(t);this.size=e.size}W.prototype.clear=dc,W.prototype.delete=pc,W.prototype.get=hc,W.prototype.has=mc,W.prototype.set=gc;function yc(t,e){return t&&_t(e,ue(e),t)}function bc(t,e){return t&&_t(e,Gt(e),t)}var pn=typeof g=="object"&&g&&!g.nodeType&&g,hn=pn&&typeof module=="object"&&module&&!module.nodeType&&module,_c=hn&&hn.exports===pn,mn=_c?q.Buffer:void 0,vn=mn?mn.allocUnsafe:void 0;function gn(t,e){if(e)return t.slice();var r=t.length,n=vn?vn(r):new t.constructor(r);return t.copy(n),n}function Sc(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 yn(){return[]}var jc=Object.prototype,Oc=jc.propertyIsEnumerable,bn=Object.getOwnPropertySymbols,wc=bn?function(t){return t==null?[]:(t=Object(t),Sc(bn(t),function(e){return Oc.call(t,e)}))}:yn;const We=wc;function Cc(t,e){return _t(t,We(t),e)}var Ec=Object.getOwnPropertySymbols,$c=Ec?function(t){for(var e=[];t;)ze(e,We(t)),t=He(t);return e}:yn;const _n=$c;function Nc(t,e){return _t(t,_n(t),e)}function Sn(t,e,r){var n=e(t);return I(t)?n:ze(n,r(t))}function Je(t){return Sn(t,ue,We)}function Qe(t){return Sn(t,Gt,_n)}var Tc=ft(q,"DataView");const qe=Tc;var Ac=ft(q,"Promise");const Ye=Ac;var Mc=ft(q,"Set");const wt=Mc;var jn="[object Map]",Pc="[object Object]",On="[object Promise]",wn="[object Set]",Cn="[object WeakMap]",En="[object DataView]",xc=lt(qe),Ic=lt(Wt),Dc=lt(Ye),Rc=lt(wt),Lc=lt(xe),pt=ut;(qe&&pt(new qe(new ArrayBuffer(1)))!=En||Wt&&pt(new Wt)!=jn||Ye&&pt(Ye.resolve())!=On||wt&&pt(new wt)!=wn||xe&&pt(new xe)!=Cn)&&(pt=function(t){var e=ut(t),r=e==Pc?t.constructor:void 0,n=r?lt(r):"";if(n)switch(n){case xc:return En;case Ic:return jn;case Dc:return On;case Rc:return wn;case Lc:return Cn}return e});const Jt=pt;var Fc=Object.prototype,Bc=Fc.hasOwnProperty;function Uc(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Bc.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var kc=q.Uint8Array;const pe=kc;function Ke(t){var e=new t.constructor(t.byteLength);return new pe(e).set(new pe(t)),e}function Vc(t,e){var r=e?Ke(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var zc=/\w*$/;function Gc(t){var e=new t.constructor(t.source,zc.exec(t));return e.lastIndex=t.lastIndex,e}var $n=V?V.prototype:void 0,Nn=$n?$n.valueOf:void 0;function Hc(t){return Nn?Object(Nn.call(t)):{}}function Tn(t,e){var r=e?Ke(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Wc="[object Boolean]",Jc="[object Date]",Qc="[object Map]",qc="[object Number]",Yc="[object RegExp]",Kc="[object Set]",Xc="[object String]",Zc="[object Symbol]",tu="[object ArrayBuffer]",eu="[object DataView]",ru="[object Float32Array]",nu="[object Float64Array]",ou="[object Int8Array]",au="[object Int16Array]",iu="[object Int32Array]",su="[object Uint8Array]",cu="[object Uint8ClampedArray]",uu="[object Uint16Array]",lu="[object Uint32Array]";function fu(t,e,r){var n=t.constructor;switch(e){case tu:return Ke(t);case Wc:case Jc:return new n(+t);case eu:return Vc(t,r);case ru:case nu:case ou:case au:case iu:case su:case cu:case uu:case lu:return Tn(t,r);case Qc:return new n;case qc:case Xc:return new n(t);case Yc:return Gc(t);case Kc:return new n;case Zc:return Hc(t)}}function An(t){return typeof t.constructor=="function"&&!Le(t)?ti(He(t)):{}}var du="[object Map]";function pu(t){return Y(t)&&Jt(t)==du}var Mn=St&&St.isMap,hu=Mn?Fe(Mn):pu;const mu=hu;var vu="[object Set]";function gu(t){return Y(t)&&Jt(t)==vu}var Pn=St&&St.isSet,yu=Pn?Fe(Pn):gu;const bu=yu;var _u=1,Su=2,ju=4,xn="[object Arguments]",Ou="[object Array]",wu="[object Boolean]",Cu="[object Date]",Eu="[object Error]",In="[object Function]",$u="[object GeneratorFunction]",Nu="[object Map]",Tu="[object Number]",Dn="[object Object]",Au="[object RegExp]",Mu="[object Set]",Pu="[object String]",xu="[object Symbol]",Iu="[object WeakMap]",Du="[object ArrayBuffer]",Ru="[object DataView]",Lu="[object Float32Array]",Fu="[object Float64Array]",Bu="[object Int8Array]",Uu="[object Int16Array]",ku="[object Int32Array]",Vu="[object Uint8Array]",zu="[object Uint8ClampedArray]",Gu="[object Uint16Array]",Hu="[object Uint32Array]",$={};$[xn]=$[Ou]=$[Du]=$[Ru]=$[wu]=$[Cu]=$[Lu]=$[Fu]=$[Bu]=$[Uu]=$[ku]=$[Nu]=$[Tu]=$[Dn]=$[Au]=$[Mu]=$[Pu]=$[xu]=$[Vu]=$[zu]=$[Gu]=$[Hu]=!0,$[Eu]=$[In]=$[Iu]=!1;function Qt(t,e,r,n,o,a){var s,i=e&_u,c=e&Su,u=e&ju;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=Uc(t),!i)return qr(t,s)}else{var d=Jt(t),f=d==In||d==$u;if(Vt(t))return gn(t,i);if(d==Dn||d==xn||f&&!o){if(s=c||f?{}:An(t),!i)return c?Nc(t,bc(s,t)):Cc(t,yc(s,t))}else{if(!$[d])return o?t:{};s=fu(t,d,i)}}a||(a=new W);var p=a.get(t);if(p)return p;a.set(t,s),bu(t)?t.forEach(function(_){s.add(Qt(_,e,r,_,t,a))}):mu(t)&&t.forEach(function(_,O){s.set(O,Qt(_,e,r,O,t,a))});var v=u?c?Qe:Je:c?Gt:ue,y=l?void 0:v(t);return fi(y||t,function(_,O){y&&(O=_,_=t[O]),De(s,O,Qt(_,e,r,O,t,a))}),s}var Wu=1,Ju=4;function Rn(t){return Qt(t,Wu|Ju)}var Qu="__lodash_hash_undefined__";function qu(t){return this.__data__.set(t,Qu),this}function Yu(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=qu,qt.prototype.has=Yu;function Ku(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 Ln(t,e){return t.has(e)}var Xu=1,Zu=2;function Fn(t,e,r,n,o,a){var s=r&Xu,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&Zu?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(!Ku(e,function(O,w){if(!Ln(p,w)&&(v===O||o(v,O,r,n,a)))return p.push(w)})){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 tl(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function Xe(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var el=1,rl=2,nl="[object Boolean]",ol="[object Date]",al="[object Error]",il="[object Map]",sl="[object Number]",cl="[object RegExp]",ul="[object Set]",ll="[object String]",fl="[object Symbol]",dl="[object ArrayBuffer]",pl="[object DataView]",Bn=V?V.prototype:void 0,Ze=Bn?Bn.valueOf:void 0;function hl(t,e,r,n,o,a,s){switch(r){case pl:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case dl:return!(t.byteLength!=e.byteLength||!a(new pe(t),new pe(e)));case nl:case ol:case sl:return Ut(+t,+e);case al:return t.name==e.name&&t.message==e.message;case cl:case ll:return t==e+"";case il:var i=tl;case ul:var c=n&el;if(i||(i=Xe),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=rl,s.set(t,e);var l=Fn(i(t),i(e),n,o,a,s);return s.delete(t),l;case fl:if(Ze)return Ze.call(t)==Ze.call(e)}return!1}var ml=1,vl=Object.prototype,gl=vl.hasOwnProperty;function yl(t,e,r,n,o,a){var s=r&ml,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:gl.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],w=e[f];if(n)var x=s?n(w,O,f,e,t,a):n(O,w,f,t,e,a);if(!(x===void 0?O===w||o(O,w,r,n,a):x)){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 bl=1,Un="[object Arguments]",kn="[object Array]",he="[object Object]",_l=Object.prototype,Vn=_l.hasOwnProperty;function Sl(t,e,r,n,o,a){var s=I(t),i=I(e),c=s?kn:Jt(t),u=i?kn:Jt(e);c=c==Un?he:c,u=u==Un?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 W),s||Ue(t)?Fn(t,e,r,n,o,a):hl(t,e,c,r,n,o,a);if(!(r&bl)){var p=l&&Vn.call(t,"__wrapped__"),v=d&&Vn.call(e,"__wrapped__");if(p||v){var y=p?t.value():t,_=v?e.value():e;return a||(a=new W),o(y,_,r,n,a)}}return f?(a||(a=new W),yl(t,e,r,n,o,a)):!1}function tr(t,e,r,n,o){return t===e?!0:t==null||e==null||!Y(t)&&!Y(e)?t!==t&&e!==e:Sl(t,e,r,n,tr,o)}var jl=1,Ol=2;function wl(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 W;if(n)var f=n(u,l,c,t,e,d);if(!(f===void 0?tr(l,u,jl|Ol,n,d):f))return!1}}return!0}function zn(t){return t===t&&!H(t)}function Cl(t){for(var e=ue(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,zn(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 El(t){var e=Cl(t);return e.length==1&&e[0][2]?Gn(e[0][0],e[0][1]):function(r){return r===t||wl(r,t,e)}}function $l(t,e){return t!=null&&e in Object(t)}function Nl(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&&Re(o)&&se(s,o)&&(I(t)||kt(t)))}function Tl(t,e){return t!=null&&Nl(t,e,$l)}var Al=1,Ml=2;function Pl(t,e){return ke(t)&&zn(e)?Gn(Ot(t),e):function(r){var n=ln(r,t);return n===void 0&&n===e?Tl(r,t):tr(e,n,Al|Ml)}}function xl(t){return function(e){return e==null?void 0:e[t]}}function Il(t){return function(e){return de(e,t)}}function Dl(t){return ke(t)?xl(Ot(t)):Il(t)}function er(t){return typeof t=="function"?t:t==null?Ae:typeof t=="object"?I(t)?Pl(t[0],t[1]):El(t):Dl(t)}function Rl(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 Ll=Rl();const Fl=Ll;function rr(t,e,r){(r!==void 0&&!Ut(t[e],r)||r===void 0&&!(e in t))&&Ie(t,e,r)}function nr(t){return Y(t)&&ce(t)}function or(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Bl(t){return _t(t,Gt(t))}function Ul(t,e,r,n,o,a,s){var i=or(t,r),c=or(e,r),u=s.get(c);if(u){rr(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&&Ue(c);l=c,f||p||v?I(i)?l=i:nr(i)?l=qr(i):p?(d=!1,l=gn(c,!0)):v?(d=!1,l=Tn(c,!0)):l=[]:F(c)||kt(c)?(l=i,kt(i)?l=Bl(i):(!H(i)||Me(i))&&(l=An(c))):d=!1}d&&(s.set(c,l),o(l,c,n,a,s),s.delete(c)),rr(t,r,l)}function Hn(t,e,r,n,o){t!==e&&Fl(e,function(a,s){if(o||(o=new W),H(a))Ul(t,e,s,r,Hn,n,o);else{var i=n?n(or(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),rr(t,s,i)}},Gt)}function kl(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 Wn(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Vl(t,e){return e.length<2?t:de(t,fc(e,0,-1))}var zl=Oi(function(t,e,r){Hn(t,e,r)});const Jn=zl;var Gl="Expected a function";function Hl(t){if(typeof t!="function")throw new TypeError(Gl);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 Wl(t,e){return e=jt(e,t),t=Vl(t,e),t==null||delete t[Ot(Wn(e))]}function Jl(t){return F(t)?void 0:t}var Ql=1,ql=2,Yl=4,Kl=oc(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,Qe(t),r),n&&(r=Qt(r,Ql|ql|Yl,Jl));for(var o=e.length;o--;)Wl(r,e[o]);return r});const Qn=Kl;function Xl(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])?[]:{})}De(i,c,u),i=i[c]}return t}function Zl(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var s=e[n],i=de(t,s);r(i,s)&&Xl(a,jt(s,t),i)}return a}function tf(t,e){if(t==null)return{};var r=Te(Qe(t),function(n){return[n]});return e=er(e),Zl(t,r,function(n,o){return e(n,o[0])})}function ef(t,e){return tf(t,Hl(er(e)))}var rf=1/0,nf=wt&&1/Xe(new wt([,-0]))[1]==rf?function(t){return new wt(t)}:ri;const of=nf;var af=200;function sf(t,e,r){var n=-1,o=vi,a=t.length,s=!0,i=[],c=i;if(r)s=!1,o=kl;else if(a>=af){var u=e?null:of(t);if(u)return Xe(u);s=!1,o=Ln,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 cf=Zr(function(t){var e=Wn(t);return nr(e)&&(e=void 0),sf(Ge(t,1,nr,!0),er(e))});const uf=cf;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 lf(t){return J(t)&&typeof t[Symbol.iterator]=="function"}function J(t){return typeof t=="object"&&t!=null}function k(t){return typeof t=="string"?JSON.stringify(t):""+t}function ff(t){const{done:e,value:r}=t.next();return e?void 0:r}function df(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*Yn(t,e,r,n){lf(t)||(t=[t]);for(const o of t){const a=df(o,e,r,n);a&&(yield a)}}function*ar(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"&&J(e.schema)&&J(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=ar(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):J(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 Yn(l,u,this,c)}:this.validator=()=>[],a?this.refiner=(c,u)=>{const l=a(c,u);return Yn(l,u,this,c)}:this.refiner=()=>[]}assert(e){return Kn(e,this)}create(e){return pf(e,this)}is(e){return mf(e,this)}mask(e){return hf(e,this)}validate(e,r){return r===void 0&&(r={}),Ct(e,this,r)}}function Kn(t,e){const r=Ct(t,e);if(r[0])throw r[0]}function pf(t,e){const r=Ct(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function hf(t,e){const r=Ct(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function mf(t,e){return!Ct(t,e)[0]}function Ct(t,e,r){r===void 0&&(r={});const n=ar(t,e,r),o=ff(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 ir(){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?eo(a):C(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 Xn(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return eo(n);default:return C(n)}}function D(){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 $t(){return at("boolean",t=>typeof t=="boolean")}function sr(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 Zn(){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 vf(){return at("never",()=>!1)}function to(){return at("number",t=>typeof t=="number"&&!isNaN(t)||"Expected a number, but received: "+k(t))}function C(t){const e=t?Object.keys(t):[],r=vf();return new K({type:"object",schema:t||null,*entries(n){if(t&&J(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 J(n)||"Expected an object, but received: "+k(n)},coercer(n){return J(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(J(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return J(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 eo(t){const e=Object.keys(t);return new K({type:"type",schema:t,*entries(r){if(J(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return J(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})||gf()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...s]=ar(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 gf(){return at("unknown",()=>!0)}const cr=C({package:h(),version:h(),name:h(),exportName:m(h()),destructuring:m($t()),subName:m(h()),main:m(h()),cssPaths:m(P(h()))}),yf=P(cr),bf=["CBlock","CContainer","CImage","CCanvas","CVideo","CAudio","CText","CNativeTag"];var z=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t))(z||{}),ur=(t=>(t.DESIGN="design",t.SAVE="save",t))(ur||{}),lr=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(lr||{});const _f=()=>at("normalObj",t=>!F(t)||[z.SLOT,z.EXPRESSION,z.FUNCTION].includes(t==null?void 0:t.type)?!1:(Ct(t,Yt(h(),fr)),!0)),fr=U([h(),to(),$t(),C({type:B(z.SLOT),renderType:sr([lr.FUNC,lr.COMP]),params:m(P(h())),value:Et(()=>U([Nt,P(Nt)]))}),C({type:B(z.EXPRESSION),value:h()}),C({type:B(z.FUNCTION),value:h()}),_f(),P(Et(()=>fr))]),ro=C({type:B(z.EXPRESSION),value:h()}),Nt=C({id:m(h()),title:m(h()),componentName:h(),props:m(Yt(h(),fr)),nodeName:m(h()),state:m(Yt(h(),D())),children:Et(()=>m(P(U([h(),Nt])))),configure:m(D()),css:m(D()),style:m(D()),classNames:m(P(D())),refId:m(h()),extra:m(Yt(D(),D())),condition:m(U([$t(),ro])),loop:m(C({open:$t(),data:U([P(D()),ro]),args:m(P(h())),forName:m(h()),forIndex:m(h()),key:m(D()),name:m(h())})),methods:m(P(D()))}),me=U([h(),C({label:h(),tip:m(h())})]),Sf=C({type:B("shape"),value:P(C({name:h(),title:me,valueType:Et(()=>ve)}))}),jf=C({type:B("enums"),value:P(h())});C({type:B("array"),value:Et(()=>ve)});const Of=C({type:B("array"),value:Et(()=>P(ve))}),ve=U([sr(["array","boolean","number","object","string"]),sr(["component","expression","function"]),Sf,jf,Of]),wf=U([h(),C({componentName:h(),props:m(D()),initialValue:m(D()),component:m(D())})]),dr=C({name:h(),title:me,valueType:ve,description:m(h()),defaultValue:D(),setters:m(P(wf)),condition:m(Zn())});U([h(),Zn()]);var pr=(t=>(t.SINGLE="single",t.GROUP="group",t))(pr||{});U([h(),C({name:h(),describe:m(h()),params:m(C({name:h(),description:h()})),template:h()})]);const Cf=C({id:m(h()),title:h(),snapshot:U([h(),D()]),snapshotText:m(h()),description:m(h()),tags:m(P(h())),groupName:m(h()),category:m(h()),schema:ir(Xn(Nt,["id"]),C({componentName:m(h())}))}),Ef=C({componentName:h(),title:h(),screenshot:m(h()),icon:m(h()),tags:m(P(h())),groupName:m(h()),category:m(h()),priority:m(to()),npm:m(cr),snippets:P(Cf),props:P(U([dr,C({title:m(me),type:B("single"),content:dr}),C({title:m(me),type:B("group"),content:P(dr)})])),fixedProps:m(D()),isContainer:m(U([$t(),C({placeholder:h(),width:h(),height:h()})])),disableEditorDragDom:m(D()),isLayout:m($t()),rootSelector:m(h()),advanceCustom:m(D()),extra:m(Yt(D(),D()))}),$f=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(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 Wm=Object.defineProperty;var Jm=(g,S,ct)=>S in g?Wm(g,S,{enumerable:!0,configurable:!0,writable:!0,value:ct}):g[S]=ct;var b=(g,S,ct)=>(Jm(g,typeof S!="symbol"?S+"":S,ct),ct);function ha(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 ma=ha(ct),va=t=>()=>{console.warn(`${t} need to be implement getComponent`)},ga=["customPageRootRender"],Br=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","getDataLink","createDataLink","transformProps","transformData","transformGlobalData","errorCatch","clear"],Ur=t=>[...Br,...ga].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):Br.includes(n)&&(r[n]=va),r},{});var ya=Object.defineProperty,ba=(t,e,r)=>e in t?ya(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e,r)=>(ba(t,typeof e!="symbol"?e+"":e,r),r),_a=typeof global=="object"&&global&&global.Object===Object&&global;const kr=_a;var Sa=typeof self=="object"&&self&&self.Object===Object&&self,ja=kr||Sa||Function("return this")();const q=ja;var Oa=q.Symbol;const V=Oa;var Vr=Object.prototype,Ca=Vr.hasOwnProperty,wa=Vr.toString,Bt=V?V.toStringTag:void 0;function Ea(t){var e=Ca.call(t,Bt),r=t[Bt];try{t[Bt]=void 0;var n=!0}catch{}var o=wa.call(t);return n&&(e?t[Bt]=r:delete t[Bt]),o}var $a=Object.prototype,Na=$a.toString;function Ta(t){return Na.call(t)}var Aa="[object Null]",Ma="[object Undefined]",zr=V?V.toStringTag:void 0;function ut(t){return t==null?t===void 0?Ma:Aa:zr&&zr in Object(t)?Ea(t):Ta(t)}function Y(t){return t!=null&&typeof t=="object"}var Pa="[object Symbol]";function Ne(t){return typeof t=="symbol"||Y(t)&&ut(t)==Pa}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 xa=Array.isArray;const D=xa;var Ia=1/0,Gr=V?V.prototype:void 0,Hr=Gr?Gr.toString:void 0;function Wr(t){if(typeof t=="string")return t;if(D(t))return Te(t,Wr)+"";if(Ne(t))return Hr?Hr.call(t):"";var e=t+"";return e=="0"&&1/t==-Ia?"-0":e}function H(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Ae(t){return t}var Da="[object AsyncFunction]",Ra="[object Function]",La="[object GeneratorFunction]",Fa="[object Proxy]";function Me(t){if(!H(t))return!1;var e=ut(t);return e==Ra||e==La||e==Da||e==Fa}var Ba=q["__core-js_shared__"];const Pe=Ba;var Jr=function(){var t=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Ua(t){return!!Jr&&Jr in t}var ka=Function.prototype,Va=ka.toString;function lt(t){if(t!=null){try{return Va.call(t)}catch{}try{return t+""}catch{}}return""}var za=/[\\^$.*+?()[\]{}|]/g,Ga=/^\[object .+?Constructor\]$/,Ha=Function.prototype,Wa=Object.prototype,Ja=Ha.toString,Qa=Wa.hasOwnProperty,qa=RegExp("^"+Ja.call(Qa).replace(za,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ya(t){if(!H(t)||Ua(t))return!1;var e=Me(t)?qa:Ga;return e.test(lt(t))}function Ka(t,e){return t==null?void 0:t[e]}function ft(t,e){var r=Ka(t,e);return Ya(r)?r:void 0}var Xa=ft(q,"WeakMap");const xe=Xa;var Qr=Object.create,Za=function(){function t(){}return function(e){if(!H(e))return{};if(Qr)return Qr(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const ti=Za;function ei(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 ri(){}function qr(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var ni=800,oi=16,ai=Date.now;function ii(t){var e=0,r=0;return function(){var n=ai(),o=oi-(n-r);if(r=n,o>0){if(++e>=ni)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function si(t){return function(){return t}}var ci=function(){try{var t=ft(Object,"defineProperty");return t({},"",{}),t}catch{}}();const ie=ci;var ui=ie?function(t,e){return ie(t,"toString",{configurable:!0,enumerable:!1,value:si(e),writable:!0})}:Ae,li=ii(ui);const Yr=li;function fi(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function di(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 pi(t){return t!==t}function hi(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function mi(t,e,r){return e===e?hi(t,e,r):di(t,pi,r)}function vi(t,e){var r=t==null?0:t.length;return!!r&&mi(t,e,0)>-1}var gi=9007199254740991,yi=/^(?:0|[1-9]\d*)$/;function se(t,e){var r=typeof t;return e=e??gi,!!e&&(r=="number"||r!="symbol"&&yi.test(t))&&t>-1&&t%1==0&&t<e}function Ie(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 bi=Object.prototype,_i=bi.hasOwnProperty;function De(t,e,r){var n=t[e];(!(_i.call(t,e)&&Ut(n,r))||r===void 0&&!(e in t))&&Ie(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?Ie(r,i,c):De(r,i,c)}return r}var Kr=Math.max;function Xr(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),ei(t,this,i)}}function Zr(t,e){return Yr(Xr(t,e,Ae),t+"")}var Si=9007199254740991;function Re(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Si}function ce(t){return t!=null&&Re(t.length)&&!Me(t)}function ji(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 Oi(t){return Zr(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&&ji(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 Ci=Object.prototype;function Le(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ci;return t===r}function wi(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Ei="[object Arguments]";function tn(t){return Y(t)&&ut(t)==Ei}var en=Object.prototype,$i=en.hasOwnProperty,Ni=en.propertyIsEnumerable,Ti=tn(function(){return arguments}())?tn:function(t){return Y(t)&&$i.call(t,"callee")&&!Ni.call(t,"callee")};const kt=Ti;function Ai(){return!1}var rn=typeof g=="object"&&g&&!g.nodeType&&g,nn=rn&&typeof module=="object"&&module&&!module.nodeType&&module,Mi=nn&&nn.exports===rn,on=Mi?q.Buffer:void 0,Pi=on?on.isBuffer:void 0,xi=Pi||Ai;const Vt=xi;var Ii="[object Arguments]",Di="[object Array]",Ri="[object Boolean]",Li="[object Date]",Fi="[object Error]",Bi="[object Function]",Ui="[object Map]",ki="[object Number]",Vi="[object Object]",zi="[object RegExp]",Gi="[object Set]",Hi="[object String]",Wi="[object WeakMap]",Ji="[object ArrayBuffer]",Qi="[object DataView]",qi="[object Float32Array]",Yi="[object Float64Array]",Ki="[object Int8Array]",Xi="[object Int16Array]",Zi="[object Int32Array]",ts="[object Uint8Array]",es="[object Uint8ClampedArray]",rs="[object Uint16Array]",ns="[object Uint32Array]",N={};N[qi]=N[Yi]=N[Ki]=N[Xi]=N[Zi]=N[ts]=N[es]=N[rs]=N[ns]=!0,N[Ii]=N[Di]=N[Ji]=N[Ri]=N[Qi]=N[Li]=N[Fi]=N[Bi]=N[Ui]=N[ki]=N[Vi]=N[zi]=N[Gi]=N[Hi]=N[Wi]=!1;function os(t){return Y(t)&&Re(t.length)&&!!N[ut(t)]}function Fe(t){return function(e){return t(e)}}var an=typeof g=="object"&&g&&!g.nodeType&&g,zt=an&&typeof module=="object"&&module&&!module.nodeType&&module,as=zt&&zt.exports===an,Be=as&&kr.process,is=function(){try{var t=zt&&zt.require&&zt.require("util").types;return t||Be&&Be.binding&&Be.binding("util")}catch{}}();const St=is;var sn=St&&St.isTypedArray,ss=sn?Fe(sn):os;const Ue=ss;var cs=Object.prototype,us=cs.hasOwnProperty;function cn(t,e){var r=D(t),n=!r&&kt(t),o=!r&&!n&&Vt(t),a=!r&&!n&&!o&&Ue(t),s=r||n||o||a,i=s?wi(t.length,String):[],c=i.length;for(var u in t)(e||us.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 un(t,e){return function(r){return t(e(r))}}var ls=un(Object.keys,Object);const fs=ls;var ds=Object.prototype,ps=ds.hasOwnProperty;function hs(t){if(!Le(t))return fs(t);var e=[];for(var r in Object(t))ps.call(t,r)&&r!="constructor"&&e.push(r);return e}function ue(t){return ce(t)?cn(t):hs(t)}function ms(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var vs=Object.prototype,gs=vs.hasOwnProperty;function ys(t){if(!H(t))return ms(t);var e=Le(t),r=[];for(var n in t)n=="constructor"&&(e||!gs.call(t,n))||r.push(n);return r}function Gt(t){return ce(t)?cn(t,!0):ys(t)}var bs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_s=/^\w*$/;function ke(t,e){if(D(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Ne(t)?!0:_s.test(t)||!bs.test(t)||e!=null&&t in Object(e)}var Ss=ft(Object,"create");const Ht=Ss;function js(){this.__data__=Ht?Ht(null):{},this.size=0}function Os(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Cs="__lodash_hash_undefined__",ws=Object.prototype,Es=ws.hasOwnProperty;function $s(t){var e=this.__data__;if(Ht){var r=e[t];return r===Cs?void 0:r}return Es.call(e,t)?e[t]:void 0}var Ns=Object.prototype,Ts=Ns.hasOwnProperty;function As(t){var e=this.__data__;return Ht?e[t]!==void 0:Ts.call(e,t)}var Ms="__lodash_hash_undefined__";function Ps(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ht&&e===void 0?Ms: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=js,dt.prototype.delete=Os,dt.prototype.get=$s,dt.prototype.has=As,dt.prototype.set=Ps;function xs(){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 Is=Array.prototype,Ds=Is.splice;function Rs(t){var e=this.__data__,r=le(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Ds.call(e,r,1),--this.size,!0}function Ls(t){var e=this.__data__,r=le(e,t);return r<0?void 0:e[r][1]}function Fs(t){return le(this.__data__,t)>-1}function Bs(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=xs,et.prototype.delete=Rs,et.prototype.get=Ls,et.prototype.has=Fs,et.prototype.set=Bs;var Us=ft(q,"Map");const Wt=Us;function ks(){this.size=0,this.__data__={hash:new dt,map:new(Wt||et),string:new dt}}function Vs(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 Vs(e)?r[typeof e=="string"?"string":"hash"]:r.map}function zs(t){var e=fe(this,t).delete(t);return this.size-=e?1:0,e}function Gs(t){return fe(this,t).get(t)}function Hs(t){return fe(this,t).has(t)}function Ws(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=ks,rt.prototype.delete=zs,rt.prototype.get=Gs,rt.prototype.has=Hs,rt.prototype.set=Ws;var Js="Expected a function";function Ve(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Js);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(Ve.Cache||rt),r}Ve.Cache=rt;var Qs=500;function qs(t){var e=Ve(t,function(n){return r.size===Qs&&r.clear(),n}),r=e.cache;return e}var Ys=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ks=/\\(\\)?/g,Xs=qs(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Ys,function(r,n,o,a){e.push(o?a.replace(Ks,"$1"):n||r)}),e});const Zs=Xs;function tc(t){return t==null?"":Wr(t)}function jt(t,e){return D(t)?t:ke(t,e)?[t]:Zs(tc(t))}var ec=1/0;function Ot(t){if(typeof t=="string"||Ne(t))return t;var e=t+"";return e=="0"&&1/t==-ec?"-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 ln(t,e,r){var n=t==null?void 0:de(t,e);return n===void 0?r:n}function ze(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var fn=V?V.isConcatSpreadable:void 0;function rc(t){return D(t)||kt(t)||!!(fn&&t&&t[fn])}function Ge(t,e,r,n,o){var a=-1,s=t.length;for(r||(r=rc),o||(o=[]);++a<s;){var i=t[a];e>0&&r(i)?e>1?Ge(i,e-1,r,n,o):ze(o,i):n||(o[o.length]=i)}return o}function nc(t){var e=t==null?0:t.length;return e?Ge(t,1):[]}function oc(t){return Yr(Xr(t,void 0,nc),t+"")}var ac=un(Object.getPrototypeOf,Object);const He=ac;var ic="[object Object]",sc=Function.prototype,cc=Object.prototype,dn=sc.toString,uc=cc.hasOwnProperty,lc=dn.call(Object);function F(t){if(!Y(t)||ut(t)!=ic)return!1;var e=He(t);if(e===null)return!0;var r=uc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&dn.call(r)==lc}function fc(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 dc(){this.__data__=new et,this.size=0}function pc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function hc(t){return this.__data__.get(t)}function mc(t){return this.__data__.has(t)}var vc=200;function gc(t,e){var r=this.__data__;if(r instanceof et){var n=r.__data__;if(!Wt||n.length<vc-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 W(t){var e=this.__data__=new et(t);this.size=e.size}W.prototype.clear=dc,W.prototype.delete=pc,W.prototype.get=hc,W.prototype.has=mc,W.prototype.set=gc;function yc(t,e){return t&&_t(e,ue(e),t)}function bc(t,e){return t&&_t(e,Gt(e),t)}var pn=typeof g=="object"&&g&&!g.nodeType&&g,hn=pn&&typeof module=="object"&&module&&!module.nodeType&&module,_c=hn&&hn.exports===pn,mn=_c?q.Buffer:void 0,vn=mn?mn.allocUnsafe:void 0;function gn(t,e){if(e)return t.slice();var r=t.length,n=vn?vn(r):new t.constructor(r);return t.copy(n),n}function Sc(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 yn(){return[]}var jc=Object.prototype,Oc=jc.propertyIsEnumerable,bn=Object.getOwnPropertySymbols,Cc=bn?function(t){return t==null?[]:(t=Object(t),Sc(bn(t),function(e){return Oc.call(t,e)}))}:yn;const We=Cc;function wc(t,e){return _t(t,We(t),e)}var Ec=Object.getOwnPropertySymbols,$c=Ec?function(t){for(var e=[];t;)ze(e,We(t)),t=He(t);return e}:yn;const _n=$c;function Nc(t,e){return _t(t,_n(t),e)}function Sn(t,e,r){var n=e(t);return D(t)?n:ze(n,r(t))}function Je(t){return Sn(t,ue,We)}function Qe(t){return Sn(t,Gt,_n)}var Tc=ft(q,"DataView");const qe=Tc;var Ac=ft(q,"Promise");const Ye=Ac;var Mc=ft(q,"Set");const Ct=Mc;var jn="[object Map]",Pc="[object Object]",On="[object Promise]",Cn="[object Set]",wn="[object WeakMap]",En="[object DataView]",xc=lt(qe),Ic=lt(Wt),Dc=lt(Ye),Rc=lt(Ct),Lc=lt(xe),pt=ut;(qe&&pt(new qe(new ArrayBuffer(1)))!=En||Wt&&pt(new Wt)!=jn||Ye&&pt(Ye.resolve())!=On||Ct&&pt(new Ct)!=Cn||xe&&pt(new xe)!=wn)&&(pt=function(t){var e=ut(t),r=e==Pc?t.constructor:void 0,n=r?lt(r):"";if(n)switch(n){case xc:return En;case Ic:return jn;case Dc:return On;case Rc:return Cn;case Lc:return wn}return e});const Jt=pt;var Fc=Object.prototype,Bc=Fc.hasOwnProperty;function Uc(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Bc.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var kc=q.Uint8Array;const pe=kc;function Ke(t){var e=new t.constructor(t.byteLength);return new pe(e).set(new pe(t)),e}function Vc(t,e){var r=e?Ke(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var zc=/\w*$/;function Gc(t){var e=new t.constructor(t.source,zc.exec(t));return e.lastIndex=t.lastIndex,e}var $n=V?V.prototype:void 0,Nn=$n?$n.valueOf:void 0;function Hc(t){return Nn?Object(Nn.call(t)):{}}function Tn(t,e){var r=e?Ke(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Wc="[object Boolean]",Jc="[object Date]",Qc="[object Map]",qc="[object Number]",Yc="[object RegExp]",Kc="[object Set]",Xc="[object String]",Zc="[object Symbol]",tu="[object ArrayBuffer]",eu="[object DataView]",ru="[object Float32Array]",nu="[object Float64Array]",ou="[object Int8Array]",au="[object Int16Array]",iu="[object Int32Array]",su="[object Uint8Array]",cu="[object Uint8ClampedArray]",uu="[object Uint16Array]",lu="[object Uint32Array]";function fu(t,e,r){var n=t.constructor;switch(e){case tu:return Ke(t);case Wc:case Jc:return new n(+t);case eu:return Vc(t,r);case ru:case nu:case ou:case au:case iu:case su:case cu:case uu:case lu:return Tn(t,r);case Qc:return new n;case qc:case Xc:return new n(t);case Yc:return Gc(t);case Kc:return new n;case Zc:return Hc(t)}}function An(t){return typeof t.constructor=="function"&&!Le(t)?ti(He(t)):{}}var du="[object Map]";function pu(t){return Y(t)&&Jt(t)==du}var Mn=St&&St.isMap,hu=Mn?Fe(Mn):pu;const mu=hu;var vu="[object Set]";function gu(t){return Y(t)&&Jt(t)==vu}var Pn=St&&St.isSet,yu=Pn?Fe(Pn):gu;const bu=yu;var _u=1,Su=2,ju=4,xn="[object Arguments]",Ou="[object Array]",Cu="[object Boolean]",wu="[object Date]",Eu="[object Error]",In="[object Function]",$u="[object GeneratorFunction]",Nu="[object Map]",Tu="[object Number]",Dn="[object Object]",Au="[object RegExp]",Mu="[object Set]",Pu="[object String]",xu="[object Symbol]",Iu="[object WeakMap]",Du="[object ArrayBuffer]",Ru="[object DataView]",Lu="[object Float32Array]",Fu="[object Float64Array]",Bu="[object Int8Array]",Uu="[object Int16Array]",ku="[object Int32Array]",Vu="[object Uint8Array]",zu="[object Uint8ClampedArray]",Gu="[object Uint16Array]",Hu="[object Uint32Array]",$={};$[xn]=$[Ou]=$[Du]=$[Ru]=$[Cu]=$[wu]=$[Lu]=$[Fu]=$[Bu]=$[Uu]=$[ku]=$[Nu]=$[Tu]=$[Dn]=$[Au]=$[Mu]=$[Pu]=$[xu]=$[Vu]=$[zu]=$[Gu]=$[Hu]=!0,$[Eu]=$[In]=$[Iu]=!1;function Qt(t,e,r,n,o,a){var s,i=e&_u,c=e&Su,u=e&ju;if(r&&(s=o?r(t,n,o,a):r(t)),s!==void 0)return s;if(!H(t))return t;var l=D(t);if(l){if(s=Uc(t),!i)return qr(t,s)}else{var d=Jt(t),f=d==In||d==$u;if(Vt(t))return gn(t,i);if(d==Dn||d==xn||f&&!o){if(s=c||f?{}:An(t),!i)return c?Nc(t,bc(s,t)):wc(t,yc(s,t))}else{if(!$[d])return o?t:{};s=fu(t,d,i)}}a||(a=new W);var p=a.get(t);if(p)return p;a.set(t,s),bu(t)?t.forEach(function(_){s.add(Qt(_,e,r,_,t,a))}):mu(t)&&t.forEach(function(_,O){s.set(O,Qt(_,e,r,O,t,a))});var v=u?c?Qe:Je:c?Gt:ue,y=l?void 0:v(t);return fi(y||t,function(_,O){y&&(O=_,_=t[O]),De(s,O,Qt(_,e,r,O,t,a))}),s}var Wu=1,Ju=4;function Rn(t){return Qt(t,Wu|Ju)}var Qu="__lodash_hash_undefined__";function qu(t){return this.__data__.set(t,Qu),this}function Yu(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=qu,qt.prototype.has=Yu;function Ku(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 Ln(t,e){return t.has(e)}var Xu=1,Zu=2;function Fn(t,e,r,n,o,a){var s=r&Xu,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&Zu?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(!Ku(e,function(O,C){if(!Ln(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 tl(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function Xe(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var el=1,rl=2,nl="[object Boolean]",ol="[object Date]",al="[object Error]",il="[object Map]",sl="[object Number]",cl="[object RegExp]",ul="[object Set]",ll="[object String]",fl="[object Symbol]",dl="[object ArrayBuffer]",pl="[object DataView]",Bn=V?V.prototype:void 0,Ze=Bn?Bn.valueOf:void 0;function hl(t,e,r,n,o,a,s){switch(r){case pl:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case dl:return!(t.byteLength!=e.byteLength||!a(new pe(t),new pe(e)));case nl:case ol:case sl:return Ut(+t,+e);case al:return t.name==e.name&&t.message==e.message;case cl:case ll:return t==e+"";case il:var i=tl;case ul:var c=n&el;if(i||(i=Xe),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=rl,s.set(t,e);var l=Fn(i(t),i(e),n,o,a,s);return s.delete(t),l;case fl:if(Ze)return Ze.call(t)==Ze.call(e)}return!1}var ml=1,vl=Object.prototype,gl=vl.hasOwnProperty;function yl(t,e,r,n,o,a){var s=r&ml,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:gl.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 P=s?n(C,O,f,e,t,a):n(O,C,f,t,e,a);if(!(P===void 0?O===C||o(O,C,r,n,a):P)){y=!1;break}_||(_=f=="constructor")}if(y&&!_){var x=t.constructor,L=e.constructor;x!=L&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof L=="function"&&L instanceof L)&&(y=!1)}return a.delete(t),a.delete(e),y}var bl=1,Un="[object Arguments]",kn="[object Array]",he="[object Object]",_l=Object.prototype,Vn=_l.hasOwnProperty;function Sl(t,e,r,n,o,a){var s=D(t),i=D(e),c=s?kn:Jt(t),u=i?kn:Jt(e);c=c==Un?he:c,u=u==Un?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 W),s||Ue(t)?Fn(t,e,r,n,o,a):hl(t,e,c,r,n,o,a);if(!(r&bl)){var p=l&&Vn.call(t,"__wrapped__"),v=d&&Vn.call(e,"__wrapped__");if(p||v){var y=p?t.value():t,_=v?e.value():e;return a||(a=new W),o(y,_,r,n,a)}}return f?(a||(a=new W),yl(t,e,r,n,o,a)):!1}function tr(t,e,r,n,o){return t===e?!0:t==null||e==null||!Y(t)&&!Y(e)?t!==t&&e!==e:Sl(t,e,r,n,tr,o)}var jl=1,Ol=2;function Cl(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 W;if(n)var f=n(u,l,c,t,e,d);if(!(f===void 0?tr(l,u,jl|Ol,n,d):f))return!1}}return!0}function zn(t){return t===t&&!H(t)}function wl(t){for(var e=ue(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,zn(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 El(t){var e=wl(t);return e.length==1&&e[0][2]?Gn(e[0][0],e[0][1]):function(r){return r===t||Cl(r,t,e)}}function $l(t,e){return t!=null&&e in Object(t)}function Nl(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&&Re(o)&&se(s,o)&&(D(t)||kt(t)))}function Tl(t,e){return t!=null&&Nl(t,e,$l)}var Al=1,Ml=2;function Pl(t,e){return ke(t)&&zn(e)?Gn(Ot(t),e):function(r){var n=ln(r,t);return n===void 0&&n===e?Tl(r,t):tr(e,n,Al|Ml)}}function xl(t){return function(e){return e==null?void 0:e[t]}}function Il(t){return function(e){return de(e,t)}}function Dl(t){return ke(t)?xl(Ot(t)):Il(t)}function er(t){return typeof t=="function"?t:t==null?Ae:typeof t=="object"?D(t)?Pl(t[0],t[1]):El(t):Dl(t)}function Rl(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 Ll=Rl();const Fl=Ll;function rr(t,e,r){(r!==void 0&&!Ut(t[e],r)||r===void 0&&!(e in t))&&Ie(t,e,r)}function nr(t){return Y(t)&&ce(t)}function or(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Bl(t){return _t(t,Gt(t))}function Ul(t,e,r,n,o,a,s){var i=or(t,r),c=or(e,r),u=s.get(c);if(u){rr(t,r,u);return}var l=a?a(i,c,r+"",t,e,s):void 0,d=l===void 0;if(d){var f=D(c),p=!f&&Vt(c),v=!f&&!p&&Ue(c);l=c,f||p||v?D(i)?l=i:nr(i)?l=qr(i):p?(d=!1,l=gn(c,!0)):v?(d=!1,l=Tn(c,!0)):l=[]:F(c)||kt(c)?(l=i,kt(i)?l=Bl(i):(!H(i)||Me(i))&&(l=An(c))):d=!1}d&&(s.set(c,l),o(l,c,n,a,s),s.delete(c)),rr(t,r,l)}function Hn(t,e,r,n,o){t!==e&&Fl(e,function(a,s){if(o||(o=new W),H(a))Ul(t,e,s,r,Hn,n,o);else{var i=n?n(or(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),rr(t,s,i)}},Gt)}function kl(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 Wn(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Vl(t,e){return e.length<2?t:de(t,fc(e,0,-1))}var zl=Oi(function(t,e,r){Hn(t,e,r)});const Jn=zl;var Gl="Expected a function";function Hl(t){if(typeof t!="function")throw new TypeError(Gl);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 Wl(t,e){return e=jt(e,t),t=Vl(t,e),t==null||delete t[Ot(Wn(e))]}function Jl(t){return F(t)?void 0:t}var Ql=1,ql=2,Yl=4,Kl=oc(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,Qe(t),r),n&&(r=Qt(r,Ql|ql|Yl,Jl));for(var o=e.length;o--;)Wl(r,e[o]);return r});const Qn=Kl;function Xl(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])?[]:{})}De(i,c,u),i=i[c]}return t}function Zl(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var s=e[n],i=de(t,s);r(i,s)&&Xl(a,jt(s,t),i)}return a}function tf(t,e){if(t==null)return{};var r=Te(Qe(t),function(n){return[n]});return e=er(e),Zl(t,r,function(n,o){return e(n,o[0])})}function ef(t,e){return tf(t,Hl(er(e)))}var rf=1/0,nf=Ct&&1/Xe(new Ct([,-0]))[1]==rf?function(t){return new Ct(t)}:ri;const of=nf;var af=200;function sf(t,e,r){var n=-1,o=vi,a=t.length,s=!0,i=[],c=i;if(r)s=!1,o=kl;else if(a>=af){var u=e?null:of(t);if(u)return Xe(u);s=!1,o=Ln,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 cf=Zr(function(t){var e=Wn(t);return nr(e)&&(e=void 0),sf(Ge(t,1,nr,!0),er(e))});const uf=cf;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 lf(t){return J(t)&&typeof t[Symbol.iterator]=="function"}function J(t){return typeof t=="object"&&t!=null}function k(t){return typeof t=="string"?JSON.stringify(t):""+t}function ff(t){const{done:e,value:r}=t.next();return e?void 0:r}function df(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*Yn(t,e,r,n){lf(t)||(t=[t]);for(const o of t){const a=df(o,e,r,n);a&&(yield a)}}function*ar(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"&&J(e.schema)&&J(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=ar(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):J(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 Yn(l,u,this,c)}:this.validator=()=>[],a?this.refiner=(c,u)=>{const l=a(c,u);return Yn(l,u,this,c)}:this.refiner=()=>[]}assert(e){return Kn(e,this)}create(e){return pf(e,this)}is(e){return mf(e,this)}mask(e){return hf(e,this)}validate(e,r){return r===void 0&&(r={}),wt(e,this,r)}}function Kn(t,e){const r=wt(t,e);if(r[0])throw r[0]}function pf(t,e){const r=wt(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function hf(t,e){const r=wt(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function mf(t,e){return!wt(t,e)[0]}function wt(t,e,r){r===void 0&&(r={});const n=ar(t,e,r),o=ff(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 ir(){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?eo(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 Xn(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return eo(n);default:return w(n)}}function A(){return at("any",()=>!0)}function I(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 $t(){return at("boolean",t=>typeof t=="boolean")}function sr(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 Zn(){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 vf(){return at("never",()=>!1)}function to(){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=vf();return new K({type:"object",schema:t||null,*entries(n){if(t&&J(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 J(n)||"Expected an object, but received: "+k(n)},coercer(n){return J(n)?{...n}:n}})}function h(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(J(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return J(r)||"Expected an object, but received: "+k(r)}})}function m(){return at("string",t=>typeof t=="string"||"Expected a string, but received: "+k(t))}function eo(t){const e=Object.keys(t);return new K({type:"type",schema:t,*entries(r){if(J(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return J(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})||gf()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...s]=ar(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 gf(){return at("unknown",()=>!0)}const cr=w({package:m(),version:m(),name:m(),exportName:h(m()),destructuring:h($t()),subName:h(m()),main:h(m()),cssPaths:h(I(m()))}),yf=I(cr),bf=["CBlock","CContainer","CImage","CCanvas","CVideo","CAudio","CText","CNativeTag"];var z=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t))(z||{}),ur=(t=>(t.DESIGN="design",t.SAVE="save",t))(ur||{}),lr=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(lr||{});const _f=()=>at("normalObj",t=>!F(t)||[z.SLOT,z.EXPRESSION,z.FUNCTION].includes(t==null?void 0:t.type)?!1:(wt(t,Yt(m(),fr)),!0)),fr=U([m(),to(),$t(),w({type:B(z.SLOT),renderType:sr([lr.FUNC,lr.COMP]),params:h(I(m())),value:Et(()=>U([Nt,I(Nt)]))}),w({type:B(z.EXPRESSION),value:m()}),w({type:B(z.FUNCTION),value:m()}),_f(),I(Et(()=>fr))]),ro=w({type:B(z.EXPRESSION),value:m()}),Nt=w({id:h(m()),title:h(m()),componentName:m(),props:h(Yt(m(),fr)),nodeName:h(m()),state:h(Yt(m(),A())),children:Et(()=>h(I(U([m(),Nt])))),configure:h(A()),css:h(A()),style:h(A()),classNames:h(I(A())),refId:h(m()),extra:h(Yt(A(),A())),condition:h(U([$t(),ro])),loop:h(w({open:$t(),data:U([I(A()),ro]),args:h(I(m())),forName:h(m()),forIndex:h(m()),key:h(A()),name:h(m())})),methods:h(I(A()))}),me=U([m(),w({label:m(),tip:h(m())})]),Sf=w({type:B("shape"),value:I(w({name:m(),title:me,valueType:Et(()=>ve)}))}),jf=w({type:B("enums"),value:I(m())});w({type:B("array"),value:Et(()=>ve)});const Of=w({type:B("array"),value:Et(()=>I(ve))}),ve=U([sr(["array","boolean","number","object","string"]),sr(["component","expression","function"]),Sf,jf,Of]),Cf=U([m(),w({componentName:m(),props:h(A()),initialValue:h(A()),component:h(A())})]),dr=w({name:m(),title:me,valueType:ve,description:h(m()),defaultValue:A(),setters:h(I(Cf)),condition:h(Zn())});U([m(),Zn()]);var pr=(t=>(t.SINGLE="single",t.GROUP="group",t))(pr||{});U([m(),w({name:m(),describe:h(m()),params:h(w({name:m(),description:m()})),template:m()})]);const wf=w({id:h(m()),title:m(),snapshot:U([m(),A()]),snapshotText:h(m()),description:h(m()),tags:h(I(m())),groupName:h(m()),category:h(m()),schema:ir(Xn(Nt,["id"]),w({componentName:h(m())}))}),Ef=w({componentName:m(),title:m(),screenshot:h(m()),icon:h(m()),tags:h(I(m())),groupName:h(m()),category:h(m()),priority:h(to()),npm:h(cr),snippets:I(wf),props:I(U([dr,w({title:h(me),type:B("single"),content:dr}),w({title:h(me),type:B("group"),content:I(dr)})])),fixedProps:h(A()),isContainer:h(U([$t(),w({placeholder:m(),width:m(),height:m()})])),disableEditorDragDom:h(A()),isLayout:h($t()),rootSelector:h(m()),advanceCustom:h(A()),extra:h(Yt(A(),A()))}),$f=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
5
  data struct format is invalidate`),o},hr=t=>{const{data:e,message:r,throwError:n,dataStruct:o}=t;return $f(({data:a})=>{try{return Kn(a,o),{isValidate:!0}}catch(s){let i=s;return s instanceof qn&&(i=s.failures().map(c=>`【${c.path.join(".")}】: ${c.message}
6
- `)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var Tt=(t=>(t.ROOT_CONTAINER="RootContainer",t))(Tt||{});const Nf=C({type:B(z.FUNCTION),value:h()}),Tf=ir(Xn(Nt,["componentName"]),C({componentName:B("RootContainer")}));function Af(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=Af(),Mf=(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=Mf(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 no=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===pr.SINGLE?e.push(n.content):n.type===pr.GROUP&&(e=[...e,...no(n.content)]):e.push(r)}),e},mr=(t,e,r)=>{if(t.type)return t.type===z.SLOT?new At(t,{parent:e,materials:r}):t;if(F(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=vr(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>mr(n,e,r)):t},vr=(t,e,r)=>F(t)?mr(t,e,r):I(t)?t.map(n=>mr(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=vr(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=vr(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 no((r==null?void 0:r.value.props)||[]).find(n=>n.name===this.name)}else return null}export(e){const r=this.data,n=o=>{if(o instanceof it||o instanceof At||o instanceof 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 Pf=t=>{if(typeof t=="string")return!0;hr({data:t,dataStruct:Nt,throwError:!1})},oo=(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)),Pf(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=oo(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener()}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}destroy(){this.listenerHandle.forEach(e=>e())}get id(){return this.data.id}get value(){return this.data}clone(e){const r={...this.export("design"),id:e||X()};return new A(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=oo(r,this),r}updateValue(e){const r=this.data,n=this.updateWithPlainObj(e);this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return br(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=ln(i,l,!1);d&&(c[l]=d)}),s.propsSetter=c,this.material&&this.materialsModel.usedMaterials.push(this.material);let u={...n,configure:s,props:o,children:a};return e==="design"&&delete u.id,u=yr(u),u}}const ao=(t,e,r)=>{const n={...t,id:X(),props:{},componentName:Tt.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",Tt.ROOT_CONTAINER),j(this,"emitter",Kt),j(this,"materialsModel"),j(this,"listenerHandle"),j(this,"onChangeCbQueue"),j(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=ao(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener(),this.parent=r}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}get id(){return this.data.id}get value(){return this.data}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}updateWithPlainObj(e){const r={...this.data,...e};return this.data=ao(r,this,this.materialsModel),r}updateValue(e){const r=this.data;this.updateWithPlainObj(e),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return br(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=ur.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=Qn(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||X()};return new Xt(r,{materials:this.materialsModel,parent:null})}}const ht=t=>(t==null?void 0:t.type)===z.EXPRESSION,xf=t=>(t==null?void 0:t.type)===z.FUNCTION,X=()=>Math.random().toString(32).slice(3,9),If=t=>(t==null?void 0:t.nodeType)==="NODE",gr=t=>(t==null?void 0:t.nodeType)==="PROP",Df=t=>(t==null?void 0:t.nodeType)==="SLOT",yr=t=>ef(t,e=>F(e)?!Object.keys(e).length:I(e)?!e.length:!e);function Rf(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 br(t,e){return Rf(t,r=>r.id===e)}const Lf=t=>{const e=Rn(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 Ff{constructor(e){j(this,"rawData"),j(this,"data"),this.rawData=e,this.data=Lf(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 Bf=t=>{if(!I(t))throw new Error("Materials must be a array");return t.map(e=>new Ff(e))},Uf=t=>{t==null||t.forEach(e=>{hr({data:e,dataStruct:Ef,throwError:!1})})};class mt{constructor(e){j(this,"rawData"),j(this,"data"),j(this,"usedMaterials",[]),this.rawData=e,Uf(e),this.data=Bf(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(){const e=this.data.reduce((a,s)=>(a.push(...s.snippets),a),[]),r=[],n={default:[]};e.forEach(a=>{const s=a.groupName||"default";r.includes(s)||(r.push(s),n[s]=[]),n[s].push(a)});let o=[];return r.forEach(a=>{const s=["default"],i={default:[]},c=n[a];if(c.length!==0){c.forEach(d=>{const f=d.category||"default";s.includes(f)||(s.push(f),i[f]=[]),i[f].push(d)});const u=[];s.forEach(d=>{i[d].length&&u.push({name:d,list:i[d]})});const l={name:a,list:u};o.push(l)}}),o=o.sort((a,s)=>(a.name||"")>(s.name||"")?1:-1),o}get value(){return this.data}get rawValue(){return this.rawData}}const kf=C({version:h(),name:h(),css:m(h()),renderType:m(U([B("COMPONENT"),B("PAGE")])),methods:m(P(Nf)),componentsMeta:P(ir(C({componentName:h()}),cr)),thirdLibs:m(yf),componentsTree:Tf,assets:m(P(D()))}),io=t=>(hr({data:t,dataStruct:kf,throwError:!1}),t),_r=(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"),io(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new mt((r==null?void 0:r.materials)||[]),this.data=_r(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=_r(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=_r(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 br(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=ur.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],s=this.materialsModel.usedMaterials.map(c=>{const u=o.find(l=>{var d;return l.package===((d=c.value.npm)==null?void 0:d.package)});return u&&a.push(u),{componentName:c.componentName,...Rn(c.value.npm||{})}}).filter(c=>!!(c.componentName&&c.package&&c.version));this.materialsModel.usedMaterials=[];let i={...this.data,componentsTree:yr(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=uf(a,c=>c.package),i=Qn(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}Tt.ROOT_CONTAINER;var Vf=typeof global=="object"&&global&&global.Object===Object&&global;const so=Vf;var zf=typeof self=="object"&&self&&self.Object===Object&&self,Gf=so||zf||Function("return this")();const Mt=Gf;var Hf=Mt.Symbol;const Pt=Hf;var co=Object.prototype,Wf=co.hasOwnProperty,Jf=co.toString,Zt=Pt?Pt.toStringTag:void 0;function Qf(t){var e=Wf.call(t,Zt),r=t[Zt];try{t[Zt]=void 0;var n=!0}catch{}var o=Jf.call(t);return n&&(e?t[Zt]=r:delete t[Zt]),o}var qf=Object.prototype,Yf=qf.toString;function Kf(t){return Yf.call(t)}var Xf="[object Null]",Zf="[object Undefined]",uo=Pt?Pt.toStringTag:void 0;function te(t){return t==null?t===void 0?Zf:Xf:uo&&uo in Object(t)?Qf(t):Kf(t)}function xt(t){return t!=null&&typeof t=="object"}var td="[object Symbol]";function ed(t){return typeof t=="symbol"||xt(t)&&te(t)==td}function rd(t,e){for(var r=-1,n=t==null?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var nd=Array.isArray;const It=nd;var od=1/0,lo=Pt?Pt.prototype:void 0,fo=lo?lo.toString:void 0;function po(t){if(typeof t=="string")return t;if(It(t))return rd(t,po)+"";if(ed(t))return fo?fo.call(t):"";var e=t+"";return e=="0"&&1/t==-od?"-0":e}function vt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function ho(t){return t}var ad="[object AsyncFunction]",id="[object Function]",sd="[object GeneratorFunction]",cd="[object Proxy]";function Sr(t){if(!vt(t))return!1;var e=te(t);return e==id||e==sd||e==ad||e==cd}var ud=Mt["__core-js_shared__"];const jr=ud;var mo=function(){var t=/[^.]+$/.exec(jr&&jr.keys&&jr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ld(t){return!!mo&&mo in t}var fd=Function.prototype,dd=fd.toString;function pd(t){if(t!=null){try{return dd.call(t)}catch{}try{return t+""}catch{}}return""}var hd=/[\\^$.*+?()[\]{}|]/g,md=/^\[object .+?Constructor\]$/,vd=Function.prototype,gd=Object.prototype,yd=vd.toString,bd=gd.hasOwnProperty,_d=RegExp("^"+yd.call(bd).replace(hd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Sd(t){if(!vt(t)||ld(t))return!1;var e=Sr(t)?_d:md;return e.test(pd(t))}function jd(t,e){return t==null?void 0:t[e]}function Or(t,e){var r=jd(t,e);return Sd(r)?r:void 0}var vo=Object.create,Od=function(){function t(){}return function(e){if(!vt(e))return{};if(vo)return vo(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const wd=Od;function Cd(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ed(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var $d=800,Nd=16,Td=Date.now;function Ad(t){var e=0,r=0;return function(){var n=Td(),o=Nd-(n-r);if(r=n,o>0){if(++e>=$d)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Md(t){return function(){return t}}var Pd=function(){try{var t=Or(Object,"defineProperty");return t({},"",{}),t}catch{}}();const ye=Pd;var xd=ye?function(t,e){return ye(t,"toString",{configurable:!0,enumerable:!1,value:Md(e),writable:!0})}:ho,Id=Ad(xd);const Dd=Id;var Rd=9007199254740991,Ld=/^(?:0|[1-9]\d*)$/;function go(t,e){var r=typeof t;return e=e??Rd,!!e&&(r=="number"||r!="symbol"&&Ld.test(t))&&t>-1&&t%1==0&&t<e}function wr(t,e,r){e=="__proto__"&&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 Fd=Object.prototype,Bd=Fd.hasOwnProperty;function Ud(t,e,r){var n=t[e];(!(Bd.call(t,e)&&be(n,r))||r===void 0&&!(e in t))&&wr(t,e,r)}function kd(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=n?n(r[i],t[i],i,r,t):void 0;c===void 0&&(c=t[i]),o?wr(r,i,c):Ud(r,i,c)}return r}var yo=Math.max;function Vd(t,e,r){return e=yo(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=yo(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),Cd(t,this,i)}}function zd(t,e){return Dd(Vd(t,e,ho),t+"")}var Gd=9007199254740991;function bo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Gd}function Cr(t){return t!=null&&bo(t.length)&&!Sr(t)}function Hd(t,e,r){if(!vt(r))return!1;var n=typeof e;return(n=="number"?Cr(r)&&go(e,r.length):n=="string"&&e in r)?be(r[e],t):!1}function Wd(t){return zd(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,s&&Hd(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var i=r[n];i&&t(e,i,n,a)}return e})}var Jd=Object.prototype;function _o(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Jd;return t===r}function Qd(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var qd="[object Arguments]";function So(t){return xt(t)&&te(t)==qd}var jo=Object.prototype,Yd=jo.hasOwnProperty,Kd=jo.propertyIsEnumerable,Xd=So(function(){return arguments}())?So:function(t){return xt(t)&&Yd.call(t,"callee")&&!Kd.call(t,"callee")};const Er=Xd;function Zd(){return!1}var Oo=typeof g=="object"&&g&&!g.nodeType&&g,wo=Oo&&typeof module=="object"&&module&&!module.nodeType&&module,tp=wo&&wo.exports===Oo,Co=tp?Mt.Buffer:void 0,ep=Co?Co.isBuffer:void 0,rp=ep||Zd;const Eo=rp;var np="[object Arguments]",op="[object Array]",ap="[object Boolean]",ip="[object Date]",sp="[object Error]",cp="[object Function]",up="[object Map]",lp="[object Number]",fp="[object Object]",dp="[object RegExp]",pp="[object Set]",hp="[object String]",mp="[object WeakMap]",vp="[object ArrayBuffer]",gp="[object DataView]",yp="[object Float32Array]",bp="[object Float64Array]",_p="[object Int8Array]",Sp="[object Int16Array]",jp="[object Int32Array]",Op="[object Uint8Array]",wp="[object Uint8ClampedArray]",Cp="[object Uint16Array]",Ep="[object Uint32Array]",T={};T[yp]=T[bp]=T[_p]=T[Sp]=T[jp]=T[Op]=T[wp]=T[Cp]=T[Ep]=!0,T[np]=T[op]=T[vp]=T[ap]=T[gp]=T[ip]=T[sp]=T[cp]=T[up]=T[lp]=T[fp]=T[dp]=T[pp]=T[hp]=T[mp]=!1;function $p(t){return xt(t)&&bo(t.length)&&!!T[te(t)]}function Np(t){return function(e){return t(e)}}var $o=typeof g=="object"&&g&&!g.nodeType&&g,ee=$o&&typeof module=="object"&&module&&!module.nodeType&&module,Tp=ee&&ee.exports===$o,$r=Tp&&so.process,Ap=function(){try{var t=ee&&ee.require&&ee.require("util").types;return t||$r&&$r.binding&&$r.binding("util")}catch{}}();const No=Ap;var To=No&&No.isTypedArray,Mp=To?Np(To):$p;const Ao=Mp;var Pp=Object.prototype,xp=Pp.hasOwnProperty;function Ip(t,e){var r=It(t),n=!r&&Er(t),o=!r&&!n&&Eo(t),a=!r&&!n&&!o&&Ao(t),s=r||n||o||a,i=s?Qd(t.length,String):[],c=i.length;for(var u in t)(e||xp.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||go(u,c)))&&i.push(u);return i}function Dp(t,e){return function(r){return t(e(r))}}function Rp(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Lp=Object.prototype,Fp=Lp.hasOwnProperty;function Bp(t){if(!vt(t))return Rp(t);var e=_o(t),r=[];for(var n in t)n=="constructor"&&(e||!Fp.call(t,n))||r.push(n);return r}function Mo(t){return Cr(t)?Ip(t,!0):Bp(t)}var Up=Or(Object,"create");const re=Up;function kp(){this.__data__=re?re(null):{},this.size=0}function Vp(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var zp="__lodash_hash_undefined__",Gp=Object.prototype,Hp=Gp.hasOwnProperty;function Wp(t){var e=this.__data__;if(re){var r=e[t];return r===zp?void 0:r}return Hp.call(e,t)?e[t]:void 0}var Jp=Object.prototype,Qp=Jp.hasOwnProperty;function qp(t){var e=this.__data__;return re?e[t]!==void 0:Qp.call(e,t)}var Yp="__lodash_hash_undefined__";function Kp(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=re&&e===void 0?Yp:e,this}function 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=kp,gt.prototype.delete=Vp,gt.prototype.get=Wp,gt.prototype.has=qp,gt.prototype.set=Kp;function Xp(){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 Zp=Array.prototype,th=Zp.splice;function eh(t){var e=this.__data__,r=_e(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():th.call(e,r,1),--this.size,!0}function rh(t){var e=this.__data__,r=_e(e,t);return r<0?void 0:e[r][1]}function nh(t){return _e(this.__data__,t)>-1}function oh(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=Xp,nt.prototype.delete=eh,nt.prototype.get=rh,nt.prototype.has=nh,nt.prototype.set=oh;var ah=Or(Mt,"Map");const Po=ah;function ih(){this.size=0,this.__data__={hash:new gt,map:new(Po||nt),string:new gt}}function sh(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 sh(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ch(t){var e=Se(this,t).delete(t);return this.size-=e?1:0,e}function uh(t){return Se(this,t).get(t)}function lh(t){return Se(this,t).has(t)}function fh(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=ih,Dt.prototype.delete=ch,Dt.prototype.get=uh,Dt.prototype.has=lh,Dt.prototype.set=fh;function xo(t){return t==null?"":po(t)}var dh=Dp(Object.getPrototypeOf,Object);const Io=dh;var ph="[object Object]",hh=Function.prototype,mh=Object.prototype,Do=hh.toString,vh=mh.hasOwnProperty,gh=Do.call(Object);function Rt(t){if(!xt(t)||te(t)!=ph)return!1;var e=Io(t);if(e===null)return!0;var r=vh.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Do.call(r)==gh}function yh(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(o);++n<o;)a[n]=t[n+e];return a}function bh(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:yh(t,e,r)}var _h="\\ud800-\\udfff",Sh="\\u0300-\\u036f",jh="\\ufe20-\\ufe2f",Oh="\\u20d0-\\u20ff",wh=Sh+jh+Oh,Ch="\\ufe0e\\ufe0f",Eh="\\u200d",$h=RegExp("["+Eh+_h+wh+Ch+"]");function Ro(t){return $h.test(t)}function Nh(t){return t.split("")}var Lo="\\ud800-\\udfff",Th="\\u0300-\\u036f",Ah="\\ufe20-\\ufe2f",Mh="\\u20d0-\\u20ff",Ph=Th+Ah+Mh,xh="\\ufe0e\\ufe0f",Ih="["+Lo+"]",Nr="["+Ph+"]",Tr="\\ud83c[\\udffb-\\udfff]",Dh="(?:"+Nr+"|"+Tr+")",Fo="[^"+Lo+"]",Bo="(?:\\ud83c[\\udde6-\\uddff]){2}",Uo="[\\ud800-\\udbff][\\udc00-\\udfff]",Rh="\\u200d",ko=Dh+"?",Vo="["+xh+"]?",Lh="(?:"+Rh+"(?:"+[Fo,Bo,Uo].join("|")+")"+Vo+ko+")*",Fh=Vo+ko+Lh,Bh="(?:"+[Fo+Nr+"?",Nr,Bo,Uo,Ih].join("|")+")",Uh=RegExp(Tr+"(?="+Tr+")|"+Bh+Fh,"g");function kh(t){return t.match(Uh)||[]}function Vh(t){return Ro(t)?kh(t):Nh(t)}function zh(t){return function(e){e=xo(e);var r=Ro(e)?Vh(e):void 0,n=r?r[0]:e.charAt(0),o=r?bh(r,1).join(""):e.slice(1);return n[t]()+o}}var Gh=zh("toUpperCase");const Hh=Gh;function Wh(t){return Hh(xo(t).toLowerCase())}function Jh(){this.__data__=new nt,this.size=0}function Qh(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function qh(t){return this.__data__.get(t)}function Yh(t){return this.__data__.has(t)}var Kh=200;function Xh(t,e){var r=this.__data__;if(r instanceof nt){var n=r.__data__;if(!Po||n.length<Kh-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Dt(n)}return r.set(t,e),this.size=r.size,this}function Lt(t){var e=this.__data__=new nt(t);this.size=e.size}Lt.prototype.clear=Jh,Lt.prototype.delete=Qh,Lt.prototype.get=qh,Lt.prototype.has=Yh,Lt.prototype.set=Xh;var zo=typeof g=="object"&&g&&!g.nodeType&&g,Go=zo&&typeof module=="object"&&module&&!module.nodeType&&module,Zh=Go&&Go.exports===zo,Ho=Zh?Mt.Buffer:void 0,Wo=Ho?Ho.allocUnsafe:void 0;function tm(t,e){if(e)return t.slice();var r=t.length,n=Wo?Wo(r):new t.constructor(r);return t.copy(n),n}var em=Mt.Uint8Array;const Jo=em;function rm(t){var e=new t.constructor(t.byteLength);return new Jo(e).set(new Jo(t)),e}function nm(t,e){var r=e?rm(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function om(t){return typeof t.constructor=="function"&&!_o(t)?wd(Io(t)):{}}function am(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[t?i:++o];if(r(a[c],c,a)===!1)break}return e}}var im=am();const sm=im;function Ar(t,e,r){(r!==void 0&&!be(t[e],r)||r===void 0&&!(e in t))&&wr(t,e,r)}function cm(t){return xt(t)&&Cr(t)}function Mr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function um(t){return kd(t,Mo(t))}function lm(t,e,r,n,o,a,s){var i=Mr(t,r),c=Mr(e,r),u=s.get(c);if(u){Ar(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&&Eo(c),v=!f&&!p&&Ao(c);l=c,f||p||v?It(i)?l=i:cm(i)?l=Ed(i):p?(d=!1,l=tm(c,!0)):v?(d=!1,l=nm(c,!0)):l=[]:Rt(c)||Er(c)?(l=i,Er(i)?l=um(i):(!vt(i)||Sr(i))&&(l=om(c))):d=!1}d&&(s.set(c,l),o(l,c,n,a,s),s.delete(c)),Ar(t,r,l)}function Qo(t,e,r,n,o){t!==e&&sm(e,function(a,s){if(o||(o=new Lt),vt(a))lm(t,e,s,r,Qo,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)}},Mo)}var fm=Wd(function(t,e,r){Qo(t,e,r)});const dm=fm,pm=function(t){return!(!t||typeof t!="function"||!t.prototype)};function qo(t){const e=t.prototype;return!!(e&&e.isReactComponent)}function Yo(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 Ko(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=`
6
+ `)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var Tt=(t=>(t.ROOT_CONTAINER="RootContainer",t))(Tt||{});const Nf=w({type:B(z.FUNCTION),value:m()}),Tf=ir(Xn(Nt,["componentName"]),w({componentName:B("RootContainer")}));function Af(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=Af(),Mf=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new mt([]);return e&&(o=e.materialsMode||new mt([])),n&&(D(n)?r.value=n.map(a=>new M(a,{parent:e,materials:o})):F(n)&&r.value.push(new M(n,{parent:e,materials:o}))),r};class At{constructor(e,r){j(this,"nodeType","SLOT"),j(this,"rawData"),j(this,"parent"),j(this,"emitter",Kt),j(this,"data"),j(this,"id"),j(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new mt([]);this.materialsMode=n,this.id=X(),this.data=Mf(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof M)return o.export(e);if(F(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return D(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const no=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===pr.SINGLE?e.push(n.content):n.type===pr.GROUP&&(e=[...e,...no(n.content)]):e.push(r)}),e},mr=(t,e,r)=>{if(t.type)return t.type===z.SLOT?new At(t,{parent:e,materials:r}):t;if(F(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=vr(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>mr(n,e,r)):t},vr=(t,e,r)=>F(t)?mr(t,e,r):D(t)?t.map(n=>mr(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=vr(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=vr(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof At)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof M){const r=e.material;return no((r==null?void 0:r.value.props)||[]).find(n=>n.name===this.name)}else return null}export(e){const r=this.data,n=o=>{if(o instanceof it||o instanceof At||o instanceof M)return o.export(e);if(D(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 Pf=t=>{if(typeof t=="string")return!0;hr({data:t,dataStruct:Nt,throwError:!1})},oo=(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 M)return a;if(F(a)){const s=a;return new M(s,{parent:e,materials:r})}else return a}):(t.children instanceof M&&(n.children=[t.children]),n.children=[new M(t.children,{parent:e,materials:r})])),n};class M{constructor(e,r){j(this,"nodeType","NODE"),j(this,"rawData"),j(this,"data"),j(this,"emitter",Kt),j(this,"parent"),j(this,"materialsModel"),j(this,"listenerHandle"),j(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Pf(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=oo(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener()}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}destroy(){this.listenerHandle.forEach(e=>e())}get id(){return this.data.id}get value(){return this.data}clone(e){const r={...this.export("design"),id:e||X()};return new M(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=oo(r,this),r}updateValue(e){const r=this.data,n=this.updateWithPlainObj(e);this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return br(this,e)}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e){var r;const n=this.data;if(typeof n=="string")return n;const o={};Object.keys(n.props||{}).forEach(l=>{o[l]=n.props[l].export(e)});const a=(r=n.children)==null?void 0:r.map(l=>l instanceof M?l.export(e):l),s=n.configure||{},i=s.propsSetter||{},c={};Object.keys(i).forEach(l=>{const d=ln(i,l,!1);d&&(c[l]=d)}),s.propsSetter=c,this.material&&this.materialsModel.usedMaterials.push(this.material);let u={...n,configure:s,props:o,children:a};return e==="design"&&delete u.id,u=yr(u),u}}const ao=(t,e,r)=>{const n={...t,id:X(),props:{},componentName:Tt.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:Jn(t.configure||{},{propsSetter:{},advanceSetter:{}})};let o=[];D(t.children)?o=t.children.map(s=>s instanceof M?s:F(s)?new M(s,{parent:e,materials:r}):s):t.children instanceof M?o.push(t.children):t.children&&F(t.children)&&o.push(new M(t.children,{parent:e,materials:r}));const a=Object.keys(t.props||{});return a.length&&a.forEach(s=>{var i;const c=(i=t.props)==null?void 0:i[s];c instanceof it?n.props[s]=c:n.props[s]=new it(s,c||"",{parent:e,materials:r})}),n.children=o,n};class Xt{constructor(e,{parent:r,materials:n}){j(this,"rawData"),j(this,"data"),j(this,"nodeType",Tt.ROOT_CONTAINER),j(this,"emitter",Kt),j(this,"materialsModel"),j(this,"listenerHandle"),j(this,"onChangeCbQueue"),j(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=ao(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener(),this.parent=r}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}get id(){return this.data.id}get value(){return this.data}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}updateWithPlainObj(e){const r={...this.data,...e};return this.data=ao(r,this,this.materialsModel),r}updateValue(e){const r=this.data;this.updateWithPlainObj(e),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return br(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=ur.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=Qn(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||X()};return new Xt(r,{materials:this.materialsModel,parent:null})}}const ht=t=>(t==null?void 0:t.type)===z.EXPRESSION,xf=t=>(t==null?void 0:t.type)===z.FUNCTION,X=()=>Math.random().toString(32).slice(3,9),If=t=>(t==null?void 0:t.nodeType)==="NODE",gr=t=>(t==null?void 0:t.nodeType)==="PROP",Df=t=>(t==null?void 0:t.nodeType)==="SLOT",yr=t=>ef(t,e=>F(e)?!Object.keys(e).length:D(e)?!e.length:!e);function Rf(t,e){const r=[t];for(;r.length;){const n=r.shift();if(n&&e(n))return n;const o=(n==null?void 0:n.props)||{},a=i=>{if(i instanceof M){r.push(i);return}if(i instanceof At&&a(i.value.value),i instanceof it){a(i.value);return}if(F(i)){const c=i;Object.keys(c).forEach(u=>{a(c[u])});return}if(D(i)){i.forEach(c=>{a(c)});return}};a(o);const s=(n==null?void 0:n.value.children.filter(i=>i instanceof M))||[];r.push(...s)}}function br(t,e){return Rf(t,r=>r.id===e)}const Lf=t=>{const e=Rn(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 Ff{constructor(e){j(this,"rawData"),j(this,"data"),this.rawData=e,this.data=Lf(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 Bf=t=>{if(!D(t))throw new Error("Materials must be a array");return t.map(e=>new Ff(e))},Uf=t=>{t==null||t.forEach(e=>{hr({data:e,dataStruct:Ef,throwError:!1})})};class mt{constructor(e){j(this,"rawData"),j(this,"data"),j(this,"usedMaterials",[]),this.rawData=e,Uf(e),this.data=Bf(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(){const e=this.data.reduce((a,s)=>(a.push(...s.snippets),a),[]),r=[],n={default:[]};e.forEach(a=>{const s=a.groupName||"default";r.includes(s)||(r.push(s),n[s]=[]),n[s].push(a)});let o=[];return r.forEach(a=>{const s=["default"],i={default:[]},c=n[a];if(c.length!==0){c.forEach(d=>{const f=d.category||"default";s.includes(f)||(s.push(f),i[f]=[]),i[f].push(d)});const u=[];s.forEach(d=>{i[d].length&&u.push({name:d,list:i[d]})});const l={name:a,list:u};o.push(l)}}),o=o.sort((a,s)=>(a.name||"")>(s.name||"")?1:-1),o}get value(){return this.data}get rawValue(){return this.rawData}}const kf=w({version:m(),name:m(),css:h(m()),renderType:h(U([B("COMPONENT"),B("PAGE")])),loadType:h(A()),lifecycle:h(A()),props:h(A()),methods:h(I(Nf)),componentsMeta:I(ir(w({componentName:m()}),cr)),thirdLibs:h(yf),componentsTree:Tf,assets:h(I(A()))}),io=t=>(hr({data:t,dataStruct:kf,throwError:!1}),t),_r=(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"),io(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new mt((r==null?void 0:r.materials)||[]),this.data=_r(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=_r(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=_r(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 br(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 M(e,{parent:null,materials:this.materialsModel})}addNodeById(e,r,n="AFTER"){const o=this.getNode(r);return o?this.addNode(e,o,n):(console.warn(`Not find a node by ${r}, pls check it`),!1)}copyNode(e){const r=e.export("design");r.id=X();const n=new M(r,{parent:e.parent,materials:this.materialsModel});return this.addNode(n,e,"AFTER"),n}copyNodeById(e){const r=this.getNode(e);return r&&r instanceof M?this.copyNode(r):!1}moveNode(e,r,n){this.deleteNode(e);let o=r;return["AFTER","BEFORE"].includes(n)&&(o=r.parent),e.parent=o,this.addNode(e,r,n)}moveNodeById(e,r,n){const o=this.getNode(e),a=this.getNode(r);return o&&a&&o instanceof M&&a instanceof M?this.moveNode(o,a,n):!1}deleteNode(e){var r;const n=e.parent;if(!n)throw new Error("parent node is null or undefined, pls check it");if(n instanceof At){const o=n.value.value,a=o.findIndex(i=>i===e),s=o[a];return o.splice(a,1),(r=n.parent)==null||r.updateValue(),s}if(n instanceof M||n instanceof Xt){const o=n.value.children,a=o.findIndex(i=>i===e),s=o[a];return o.splice(a,1),n.updateValue(),s}}deleteNodeById(e){const r=this.getNode(e);if(r)return this.deleteNode(r)}export(e=ur.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],s=this.materialsModel.usedMaterials.map(c=>{const u=o.find(l=>{var d;return l.package===((d=c.value.npm)==null?void 0:d.package)});return u&&a.push(u),{componentName:c.componentName,...Rn(c.value.npm||{})}}).filter(c=>!!(c.componentName&&c.package&&c.version));this.materialsModel.usedMaterials=[];let i={...this.data,componentsTree:yr(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=uf(a,c=>c.package),i=Qn(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}Tt.ROOT_CONTAINER;var Vf=typeof global=="object"&&global&&global.Object===Object&&global;const so=Vf;var zf=typeof self=="object"&&self&&self.Object===Object&&self,Gf=so||zf||Function("return this")();const Mt=Gf;var Hf=Mt.Symbol;const Pt=Hf;var co=Object.prototype,Wf=co.hasOwnProperty,Jf=co.toString,Zt=Pt?Pt.toStringTag:void 0;function Qf(t){var e=Wf.call(t,Zt),r=t[Zt];try{t[Zt]=void 0;var n=!0}catch{}var o=Jf.call(t);return n&&(e?t[Zt]=r:delete t[Zt]),o}var qf=Object.prototype,Yf=qf.toString;function Kf(t){return Yf.call(t)}var Xf="[object Null]",Zf="[object Undefined]",uo=Pt?Pt.toStringTag:void 0;function te(t){return t==null?t===void 0?Zf:Xf:uo&&uo in Object(t)?Qf(t):Kf(t)}function xt(t){return t!=null&&typeof t=="object"}var td="[object Symbol]";function ed(t){return typeof t=="symbol"||xt(t)&&te(t)==td}function rd(t,e){for(var r=-1,n=t==null?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var nd=Array.isArray;const It=nd;var od=1/0,lo=Pt?Pt.prototype:void 0,fo=lo?lo.toString:void 0;function po(t){if(typeof t=="string")return t;if(It(t))return rd(t,po)+"";if(ed(t))return fo?fo.call(t):"";var e=t+"";return e=="0"&&1/t==-od?"-0":e}function vt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function ho(t){return t}var ad="[object AsyncFunction]",id="[object Function]",sd="[object GeneratorFunction]",cd="[object Proxy]";function Sr(t){if(!vt(t))return!1;var e=te(t);return e==id||e==sd||e==ad||e==cd}var ud=Mt["__core-js_shared__"];const jr=ud;var mo=function(){var t=/[^.]+$/.exec(jr&&jr.keys&&jr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ld(t){return!!mo&&mo in t}var fd=Function.prototype,dd=fd.toString;function pd(t){if(t!=null){try{return dd.call(t)}catch{}try{return t+""}catch{}}return""}var hd=/[\\^$.*+?()[\]{}|]/g,md=/^\[object .+?Constructor\]$/,vd=Function.prototype,gd=Object.prototype,yd=vd.toString,bd=gd.hasOwnProperty,_d=RegExp("^"+yd.call(bd).replace(hd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Sd(t){if(!vt(t)||ld(t))return!1;var e=Sr(t)?_d:md;return e.test(pd(t))}function jd(t,e){return t==null?void 0:t[e]}function Or(t,e){var r=jd(t,e);return Sd(r)?r:void 0}var vo=Object.create,Od=function(){function t(){}return function(e){if(!vt(e))return{};if(vo)return vo(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const Cd=Od;function wd(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ed(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var $d=800,Nd=16,Td=Date.now;function Ad(t){var e=0,r=0;return function(){var n=Td(),o=Nd-(n-r);if(r=n,o>0){if(++e>=$d)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Md(t){return function(){return t}}var Pd=function(){try{var t=Or(Object,"defineProperty");return t({},"",{}),t}catch{}}();const ye=Pd;var xd=ye?function(t,e){return ye(t,"toString",{configurable:!0,enumerable:!1,value:Md(e),writable:!0})}:ho,Id=Ad(xd);const Dd=Id;var Rd=9007199254740991,Ld=/^(?:0|[1-9]\d*)$/;function go(t,e){var r=typeof t;return e=e??Rd,!!e&&(r=="number"||r!="symbol"&&Ld.test(t))&&t>-1&&t%1==0&&t<e}function Cr(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 Fd=Object.prototype,Bd=Fd.hasOwnProperty;function Ud(t,e,r){var n=t[e];(!(Bd.call(t,e)&&be(n,r))||r===void 0&&!(e in t))&&Cr(t,e,r)}function kd(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=n?n(r[i],t[i],i,r,t):void 0;c===void 0&&(c=t[i]),o?Cr(r,i,c):Ud(r,i,c)}return r}var yo=Math.max;function Vd(t,e,r){return e=yo(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=yo(n.length-e,0),s=Array(a);++o<a;)s[o]=n[e+o];o=-1;for(var i=Array(e+1);++o<e;)i[o]=n[o];return i[e]=r(s),wd(t,this,i)}}function zd(t,e){return Dd(Vd(t,e,ho),t+"")}var Gd=9007199254740991;function bo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Gd}function wr(t){return t!=null&&bo(t.length)&&!Sr(t)}function Hd(t,e,r){if(!vt(r))return!1;var n=typeof e;return(n=="number"?wr(r)&&go(e,r.length):n=="string"&&e in r)?be(r[e],t):!1}function Wd(t){return zd(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,s&&Hd(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var i=r[n];i&&t(e,i,n,a)}return e})}var Jd=Object.prototype;function _o(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Jd;return t===r}function Qd(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var qd="[object Arguments]";function So(t){return xt(t)&&te(t)==qd}var jo=Object.prototype,Yd=jo.hasOwnProperty,Kd=jo.propertyIsEnumerable,Xd=So(function(){return arguments}())?So:function(t){return xt(t)&&Yd.call(t,"callee")&&!Kd.call(t,"callee")};const Er=Xd;function Zd(){return!1}var Oo=typeof g=="object"&&g&&!g.nodeType&&g,Co=Oo&&typeof module=="object"&&module&&!module.nodeType&&module,tp=Co&&Co.exports===Oo,wo=tp?Mt.Buffer:void 0,ep=wo?wo.isBuffer:void 0,rp=ep||Zd;const Eo=rp;var np="[object Arguments]",op="[object Array]",ap="[object Boolean]",ip="[object Date]",sp="[object Error]",cp="[object Function]",up="[object Map]",lp="[object Number]",fp="[object Object]",dp="[object RegExp]",pp="[object Set]",hp="[object String]",mp="[object WeakMap]",vp="[object ArrayBuffer]",gp="[object DataView]",yp="[object Float32Array]",bp="[object Float64Array]",_p="[object Int8Array]",Sp="[object Int16Array]",jp="[object Int32Array]",Op="[object Uint8Array]",Cp="[object Uint8ClampedArray]",wp="[object Uint16Array]",Ep="[object Uint32Array]",T={};T[yp]=T[bp]=T[_p]=T[Sp]=T[jp]=T[Op]=T[Cp]=T[wp]=T[Ep]=!0,T[np]=T[op]=T[vp]=T[ap]=T[gp]=T[ip]=T[sp]=T[cp]=T[up]=T[lp]=T[fp]=T[dp]=T[pp]=T[hp]=T[mp]=!1;function $p(t){return xt(t)&&bo(t.length)&&!!T[te(t)]}function Np(t){return function(e){return t(e)}}var $o=typeof g=="object"&&g&&!g.nodeType&&g,ee=$o&&typeof module=="object"&&module&&!module.nodeType&&module,Tp=ee&&ee.exports===$o,$r=Tp&&so.process,Ap=function(){try{var t=ee&&ee.require&&ee.require("util").types;return t||$r&&$r.binding&&$r.binding("util")}catch{}}();const No=Ap;var To=No&&No.isTypedArray,Mp=To?Np(To):$p;const Ao=Mp;var Pp=Object.prototype,xp=Pp.hasOwnProperty;function Ip(t,e){var r=It(t),n=!r&&Er(t),o=!r&&!n&&Eo(t),a=!r&&!n&&!o&&Ao(t),s=r||n||o||a,i=s?Qd(t.length,String):[],c=i.length;for(var u in t)(e||xp.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||go(u,c)))&&i.push(u);return i}function Dp(t,e){return function(r){return t(e(r))}}function Rp(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Lp=Object.prototype,Fp=Lp.hasOwnProperty;function Bp(t){if(!vt(t))return Rp(t);var e=_o(t),r=[];for(var n in t)n=="constructor"&&(e||!Fp.call(t,n))||r.push(n);return r}function Mo(t){return wr(t)?Ip(t,!0):Bp(t)}var Up=Or(Object,"create");const re=Up;function kp(){this.__data__=re?re(null):{},this.size=0}function Vp(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var zp="__lodash_hash_undefined__",Gp=Object.prototype,Hp=Gp.hasOwnProperty;function Wp(t){var e=this.__data__;if(re){var r=e[t];return r===zp?void 0:r}return Hp.call(e,t)?e[t]:void 0}var Jp=Object.prototype,Qp=Jp.hasOwnProperty;function qp(t){var e=this.__data__;return re?e[t]!==void 0:Qp.call(e,t)}var Yp="__lodash_hash_undefined__";function Kp(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=re&&e===void 0?Yp:e,this}function 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=kp,gt.prototype.delete=Vp,gt.prototype.get=Wp,gt.prototype.has=qp,gt.prototype.set=Kp;function Xp(){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 Zp=Array.prototype,th=Zp.splice;function eh(t){var e=this.__data__,r=_e(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():th.call(e,r,1),--this.size,!0}function rh(t){var e=this.__data__,r=_e(e,t);return r<0?void 0:e[r][1]}function nh(t){return _e(this.__data__,t)>-1}function oh(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=Xp,nt.prototype.delete=eh,nt.prototype.get=rh,nt.prototype.has=nh,nt.prototype.set=oh;var ah=Or(Mt,"Map");const Po=ah;function ih(){this.size=0,this.__data__={hash:new gt,map:new(Po||nt),string:new gt}}function sh(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 sh(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ch(t){var e=Se(this,t).delete(t);return this.size-=e?1:0,e}function uh(t){return Se(this,t).get(t)}function lh(t){return Se(this,t).has(t)}function fh(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=ih,Dt.prototype.delete=ch,Dt.prototype.get=uh,Dt.prototype.has=lh,Dt.prototype.set=fh;function xo(t){return t==null?"":po(t)}var dh=Dp(Object.getPrototypeOf,Object);const Io=dh;var ph="[object Object]",hh=Function.prototype,mh=Object.prototype,Do=hh.toString,vh=mh.hasOwnProperty,gh=Do.call(Object);function Rt(t){if(!xt(t)||te(t)!=ph)return!1;var e=Io(t);if(e===null)return!0;var r=vh.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Do.call(r)==gh}function yh(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(o);++n<o;)a[n]=t[n+e];return a}function bh(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:yh(t,e,r)}var _h="\\ud800-\\udfff",Sh="\\u0300-\\u036f",jh="\\ufe20-\\ufe2f",Oh="\\u20d0-\\u20ff",Ch=Sh+jh+Oh,wh="\\ufe0e\\ufe0f",Eh="\\u200d",$h=RegExp("["+Eh+_h+Ch+wh+"]");function Ro(t){return $h.test(t)}function Nh(t){return t.split("")}var Lo="\\ud800-\\udfff",Th="\\u0300-\\u036f",Ah="\\ufe20-\\ufe2f",Mh="\\u20d0-\\u20ff",Ph=Th+Ah+Mh,xh="\\ufe0e\\ufe0f",Ih="["+Lo+"]",Nr="["+Ph+"]",Tr="\\ud83c[\\udffb-\\udfff]",Dh="(?:"+Nr+"|"+Tr+")",Fo="[^"+Lo+"]",Bo="(?:\\ud83c[\\udde6-\\uddff]){2}",Uo="[\\ud800-\\udbff][\\udc00-\\udfff]",Rh="\\u200d",ko=Dh+"?",Vo="["+xh+"]?",Lh="(?:"+Rh+"(?:"+[Fo,Bo,Uo].join("|")+")"+Vo+ko+")*",Fh=Vo+ko+Lh,Bh="(?:"+[Fo+Nr+"?",Nr,Bo,Uo,Ih].join("|")+")",Uh=RegExp(Tr+"(?="+Tr+")|"+Bh+Fh,"g");function kh(t){return t.match(Uh)||[]}function Vh(t){return Ro(t)?kh(t):Nh(t)}function zh(t){return function(e){e=xo(e);var r=Ro(e)?Vh(e):void 0,n=r?r[0]:e.charAt(0),o=r?bh(r,1).join(""):e.slice(1);return n[t]()+o}}var Gh=zh("toUpperCase");const Hh=Gh;function Wh(t){return Hh(xo(t).toLowerCase())}function Jh(){this.__data__=new nt,this.size=0}function Qh(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function qh(t){return this.__data__.get(t)}function Yh(t){return this.__data__.has(t)}var Kh=200;function Xh(t,e){var r=this.__data__;if(r instanceof nt){var n=r.__data__;if(!Po||n.length<Kh-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Dt(n)}return r.set(t,e),this.size=r.size,this}function Lt(t){var e=this.__data__=new nt(t);this.size=e.size}Lt.prototype.clear=Jh,Lt.prototype.delete=Qh,Lt.prototype.get=qh,Lt.prototype.has=Yh,Lt.prototype.set=Xh;var zo=typeof g=="object"&&g&&!g.nodeType&&g,Go=zo&&typeof module=="object"&&module&&!module.nodeType&&module,Zh=Go&&Go.exports===zo,Ho=Zh?Mt.Buffer:void 0,Wo=Ho?Ho.allocUnsafe:void 0;function tm(t,e){if(e)return t.slice();var r=t.length,n=Wo?Wo(r):new t.constructor(r);return t.copy(n),n}var em=Mt.Uint8Array;const Jo=em;function rm(t){var e=new t.constructor(t.byteLength);return new Jo(e).set(new Jo(t)),e}function nm(t,e){var r=e?rm(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function om(t){return typeof t.constructor=="function"&&!_o(t)?Cd(Io(t)):{}}function am(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[t?i:++o];if(r(a[c],c,a)===!1)break}return e}}var im=am();const sm=im;function Ar(t,e,r){(r!==void 0&&!be(t[e],r)||r===void 0&&!(e in t))&&Cr(t,e,r)}function cm(t){return xt(t)&&wr(t)}function Mr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function um(t){return kd(t,Mo(t))}function lm(t,e,r,n,o,a,s){var i=Mr(t,r),c=Mr(e,r),u=s.get(c);if(u){Ar(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&&Eo(c),v=!f&&!p&&Ao(c);l=c,f||p||v?It(i)?l=i:cm(i)?l=Ed(i):p?(d=!1,l=tm(c,!0)):v?(d=!1,l=nm(c,!0)):l=[]:Rt(c)||Er(c)?(l=i,Er(i)?l=um(i):(!vt(i)||Sr(i))&&(l=om(c))):d=!1}d&&(s.set(c,l),o(l,c,n,a,s),s.delete(c)),Ar(t,r,l)}function Qo(t,e,r,n,o){t!==e&&sm(e,function(a,s){if(o||(o=new Lt),vt(a))lm(t,e,s,r,Qo,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)}},Mo)}var fm=Wd(function(t,e,r){Qo(t,e,r)});const dm=fm,pm=function(t){return!(!t||typeof t!="function"||!t.prototype)};function qo(t){const e=t.prototype;return!!(e&&e.isReactComponent)}function Yo(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 Ko(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=`
7
7
  ${Object.keys(e).map(s=>`const ${s} = $$context['${s}'];`).join(`
8
8
  `)}
9
9
  return ${n};
@@ -17,7 +17,7 @@ function $$_run_$$() {
17
17
  return $$_f_$$.apply($$_f_$$, $$$__args__$$$);
18
18
  }
19
19
  return $$_run_$$();
20
- `,new Function(a)(...o,e,r)}catch(s){console.log(a),console.warn(s)}},Pr=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},xr=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?Wh(a):a)),e[o.join("")]=t[r]}),e},Ir=t=>{let e="";return Object.keys(t).forEach(r=>{e+=`${r}:${t[r]};`}),e},hm=(t,e)=>{const r={};return t.forEach(n=>{if(n.globalName){const o=e[n.globalName];o&&(r[n.globalName]=o)}}),r},mm=(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},Zo=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},ta=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},vm=(t,e)=>ta(t,e),gm=(t,e)=>ta(t,e),je="DYNAMIC",ym=["$$context","$$nodeModel"],ea=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},bm=t=>t?ea(t):ea;class _m{constructor(){b(this,"storeMap",new Map)}addStore(e,r){const n=bm(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 Sm{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 ra{constructor(){b(this,"renderMode","normal");b(this,"components",{});b(this,"storeManager",new _m);b(this,"variableManager",new Sm);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 Yo(n)||(n=Ko(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(gr(s))return o(s.value);if(Df(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 w=Pr(O,v),x=this.getContext({params:w},r);return this.render(p,{$$context:x,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(xf(s))return Xo(s.value,r,this.storeManager);if(Rt(s)){let i=s;gr(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;gr(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} { ${Ir(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} { ${Ir(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=Zo(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 we;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===Tt.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 da;const oe=Z[1],Ft=[_.forName||"item",_.forIndex||"index"],Dr=Pr(Z,Ft);let Rr="loopData";_.name&&(Rr=`${Rr}${_.name}`);const ae=n.getContext({[Rr]:Dr},f),tt=n.transformProps(l,{$$context:ae}),zm=((da=r.value.classNames)==null?void 0:da.map(Q=>{var $e;const Ee=Q.name;return(ht(Q.status)?yt(String((($e=Q.status)==null?void 0:$e.value)||""),ae):!1)?Ee:""}))||[];let Lr=`${tt.className??""} ${zm.join(" ")}`.trim();r.value.css&&(Lr=`${r.value.css.class} ${Lr}`.trim()),tt.className=Lr;const Gm=n.transformProps(r.value.style,{$$context:ae});r.value.style&&(tt.style=xr(Gm||{}));const{children:Ce}=tt;let Fr=[];if(Ce!==void 0)delete tt.children,Fr=Array.isArray(Ce)?Ce:[Ce];else{const Q=[];r.value.children.forEach((pa,$e)=>{const Hm=n.buildComponent(pa,{$$context:ae,idx:$e});Q.push(Hm)}),Fr=Q}if(tt.key=`${tt.key}-${oe}`,ht(_.key)){const Q=_.key,Ee=yt(Q.value,ae||{});tt.key+=`-${Ee}`}return tt.ref=Q=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[oe]=Q},n.render(e,tt,...Fr)}),O}const w=n.transformProps(l,{$$context:f}),{children:x}=w;let M=[];if(x!==void 0)delete w.children,M=Array.isArray(x)?x:[x];else{const R=[];r.value.children.forEach((oe,Ft)=>{const Dr=n.buildComponent(oe,{$$context:f,idx:Ft});R.push(Dr)}),M=R}w.ref=this.targetComponentRef;const L=((we=r.value.classNames)==null?void 0:we.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 G=`${w.className??""} ${L.join(" ")}`.trim();r.value.css&&(G=`${r.value.css.class} ${G}`.trim()),w.className=G;const ne=n.transformProps(r.value.style,{$$context:f});r.value.style&&(w.style=xr(ne||{}));let E=r.value.condition??!0;typeof E!="boolean"&&(E=yt(E.value,f||{}));let st={condition:E,props:w};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):If(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):(ym.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 jm=Ur(new ra),Om=["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 wm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var na={exports:{}},Oe={};/**
20
+ `,new Function(a)(...o,e,r)}catch(s){console.log(a),console.warn(s)}},Pr=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},xr=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?Wh(a):a)),e[o.join("")]=t[r]}),e},Ir=t=>{let e="";return Object.keys(t).forEach(r=>{e+=`${r}:${t[r]};`}),e},hm=(t,e)=>{const r={};return t.forEach(n=>{if(n.globalName){const o=e[n.globalName];o&&(r[n.globalName]=o)}}),r},mm=(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},Zo=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},ta=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},vm=(t,e)=>ta(t,e),gm=(t,e)=>ta(t,e),je="DYNAMIC",ym=["$$context","$$nodeModel"],ea=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},bm=t=>t?ea(t):ea;class _m{constructor(){b(this,"storeMap",new Map)}addStore(e,r){const n=bm(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 Sm{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 ra{constructor(){b(this,"renderMode","normal");b(this,"components",{});b(this,"storeManager",new _m);b(this,"variableManager",new Sm);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 Yo(n)||(n=Ko(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(gr(s))return o(s.value);if(Df(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=Pr(O,v),P=this.getContext({params:C},r);return this.render(p,{$$context:P,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(xf(s))return Xo(s.value,r,this.storeManager);if(Rt(s)){let i=s;gr(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;gr(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} { ${Ir(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} { ${Ir(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=Zo(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 Ce;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===Tt.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 da;const oe=Z[1],Ft=[_.forName||"item",_.forIndex||"index"],Dr=Pr(Z,Ft);let Rr="loopData";_.name&&(Rr=`${Rr}${_.name}`);const ae=n.getContext({[Rr]:Dr},f),tt=n.transformProps(l,{$$context:ae}),zm=((da=r.value.classNames)==null?void 0:da.map(Q=>{var $e;const Ee=Q.name;return(ht(Q.status)?yt(String((($e=Q.status)==null?void 0:$e.value)||""),ae):!1)?Ee:""}))||[];let Lr=`${tt.className??""} ${zm.join(" ")}`.trim();r.value.css&&(Lr=`${r.value.css.class} ${Lr}`.trim()),tt.className=Lr;const Gm=n.transformProps(r.value.style,{$$context:ae});r.value.style&&(tt.style=xr(Gm||{}));const{children:we}=tt;let Fr=[];if(we!==void 0)delete tt.children,Fr=Array.isArray(we)?we:[we];else{const Q=[];r.value.children.forEach((pa,$e)=>{const Hm=n.buildComponent(pa,{$$context:ae,idx:$e});Q.push(Hm)}),Fr=Q}if(tt.key=`${tt.key}-${oe}`,ht(_.key)){const Q=_.key,Ee=yt(Q.value,ae||{});tt.key+=`-${Ee}`}return tt.ref=Q=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[oe]=Q},n.render(e,tt,...Fr)}),O}const C=n.transformProps(l,{$$context:f}),{children:P}=C;let x=[];if(P!==void 0)delete C.children,x=Array.isArray(P)?P:[P];else{const R=[];r.value.children.forEach((oe,Ft)=>{const Dr=n.buildComponent(oe,{$$context:f,idx:Ft});R.push(Dr)}),x=R}C.ref=this.targetComponentRef;const L=((Ce=r.value.classNames)==null?void 0:Ce.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 G=`${C.className??""} ${L.join(" ")}`.trim();r.value.css&&(G=`${r.value.css.class} ${G}`.trim()),C.className=G;const ne=n.transformProps(r.value.style,{$$context:f});r.value.style&&(C.style=xr(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,...x);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):If(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):(ym.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 jm=Ur(new ra),Om=["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 Cm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var na={exports:{}},Oe={};/**
21
21
  * @license React
22
22
  * react-jsx-runtime.production.min.js
23
23
  *
@@ -25,5 +25,5 @@ return $$_run_$$();
25
25
  *
26
26
  * This source code is licensed under the MIT license found in the
27
27
  * LICENSE file in the root directory of this source tree.
28
- */var Em=S,$m=Symbol.for("react.element"),Nm=Symbol.for("react.fragment"),Tm=Object.prototype.hasOwnProperty,Am=Em.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Mm={key:!0,ref:!0,__self:!0,__source:!0};function oa(t,e,r){var n,o={},a=null,s=null;r!==void 0&&(a=""+r),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(s=e.ref);for(n in e)Tm.call(e,n)&&!Mm.hasOwnProperty(n)&&(o[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)o[n]===void 0&&(o[n]=e[n]);return{$$typeof:$m,type:t,key:a,ref:s,props:o,_owner:Am.current}}Oe.Fragment=Nm,Oe.jsx=oa,Oe.jsxs=oa,na.exports=Oe;var Pm=na.exports;const xm=Pm.jsx,ot=t=>{const e={};return t.forEach(r=>{e[r.key]=r.value}),e},Im=[...Om,...bf].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),{}),Dm={RootContainer:({children:t})=>t,...Im,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)}),[]),xm("div",{...o,...ot(e),children: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:({afterMount:t,beforeDestroy:e,$$attributes:r=[],...n})=>(S.useEffect(()=>(t==null||t(n),()=>{e==null||e(n)}),[]),S.createElement("canvas",{...n,...ot(r)})),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 Rm{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 aa 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)&&io(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 Rm}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={...Dm,...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 Lm=()=>{const t=S.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)}}};class Fm 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 ia{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 sa=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 Bm extends S.Component{constructor(r){super(r);b(this,"instanceManager",new ia);b(this,"renderRef");b(this,"dropPlaceholder",sa);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===Tt.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(Fm,{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=ca(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=ma.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(aa,{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:dm(l,d.props||{}),condition:p}},ref:this.renderRef})}}const ca=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:ca(t.parentElement)},ua=t=>{var e;return t?(e=t==null?void 0:t.stateNode)!=null&&e._DESIGN_BOX?t:ua(t.return):null},Um=()=>{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 la={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(wm,function(){var r=function(){},n={},o={},a={};function s(f,p){f=f.push?f:[f];var v=[],y=f.length,_=y,O,w,x,M;for(O=function(L,G){G.length&&v.push(L),_--,_||p(v)};y--;){if(w=f[y],x=o[w],x){O(w,x);continue}M=a[w]=a[w]||[],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,w=(v.numRetries||0)+1,x=v.before||r,M=f.replace(/[\?|#].*$/,""),L=f.replace(/^(css|img|module|nomodule)!/,""),G,ne,E;if(y=y||0,/(^css!|\.css$)/.test(M))E=_.createElement("link"),E.rel="stylesheet",E.href=L,G="hideFocus"in E,G&&E.relList&&(G=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(G)try{E.sheet.cssText.length||(bt="e")}catch(we){we.code!=18&&(bt="e")}if(bt=="e"){if(y+=1,y<w)return u(f,p,v,y)}else if(E.rel=="preload"&&E.as=="style")return E.rel="stylesheet";p(f,bt,st.defaultPrevented)},x(f,E)!==!1&&_.head.appendChild(E)}function l(f,p,v){f=f.push?f:[f];var y=f.length,_=y,O=[],w,x;for(w=function(M,L,G){if(L=="e"&&O.push(M),L=="b")if(G)O.push(M);else return;y--,y||p(O)},x=0;x<_;x++)u(f[x],w,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(w,x){l(f,function(M){c(_,M),w&&c({success:w,error:x},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})})(la);var km=la.exports;const fa=Cm(km);class Vm{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&&fa(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}fa.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=Vm,g.ComponentInstanceManager=ia,g.DefaultDropPlaceholder=sa,g.DefineReactAdapter=ra,g.DesignRender=Bm,g.ReactAdapter=jm,g.Render=aa,g.canAcceptsRef=Yo,g.collectVariable=hm,g.compWrapper=Ko,g.convertCodeStringToFunction=Xo,g.flatObject=mm,g.formatSourceStylePropertyName=xr,g.getAdapter=Ur,g.getCSSTextValue=Ir,g.getComponentsLibs=vm,g.getMatchVal=Zo,g.getObjFromArrayMap=Pr,g.getThirdLibs=gm,g.isClass=pm,g.runExpression=yt,g.shouldConstruct=qo,g.useDesignRender=Um,g.useRender=Lm,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
28
+ */var Em=S,$m=Symbol.for("react.element"),Nm=Symbol.for("react.fragment"),Tm=Object.prototype.hasOwnProperty,Am=Em.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Mm={key:!0,ref:!0,__self:!0,__source:!0};function oa(t,e,r){var n,o={},a=null,s=null;r!==void 0&&(a=""+r),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(s=e.ref);for(n in e)Tm.call(e,n)&&!Mm.hasOwnProperty(n)&&(o[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)o[n]===void 0&&(o[n]=e[n]);return{$$typeof:$m,type:t,key:a,ref:s,props:o,_owner:Am.current}}Oe.Fragment=Nm,Oe.jsx=oa,Oe.jsxs=oa,na.exports=Oe;var Pm=na.exports;const xm=Pm.jsx,ot=t=>{const e={};return t.forEach(r=>{e[r.key]=r.value}),e},Im=[...Om,...bf].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),{}),Dm={RootContainer:({children:t})=>t,...Im,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)}),[]),xm("div",{...o,...ot(e),children: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:({afterMount:t,beforeDestroy:e,$$attributes:r=[],...n})=>(S.useEffect(()=>(t==null||t(n),()=>{e==null||e(n)}),[]),S.createElement("canvas",{...n,...ot(r)})),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 Rm{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 aa 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)&&io(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 Rm}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={...Dm,...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 Lm=()=>{const t=S.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)}}};class Fm 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 ia{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 sa=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",width:a,height:o,...s}},n)};class Bm extends S.Component{constructor(r){super(r);b(this,"instanceManager",new ia);b(this,"renderRef");b(this,"dropPlaceholder",sa);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(){var O,C;const{children:f=[],onlyRenderChild:p,...v}=this.props;let y=f;if(It(f)||(y=[f]),!!!y.filter(Boolean).length&&(n.isContainer()||n.value.componentName===Tt.ROOT_CONTAINER)){const P=(C=(O=n.material)==null?void 0:O.value.advanceCustom)==null?void 0:C.dropPlaceholder;y.push(S.createElement(P||o.dropPlaceholder,{node:n}))}return p?y:S.createElement(a,v,...y)}}return S.forwardRef(function(d,f){return S.createElement(Fm,{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=ca(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=ma.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(aa,{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:dm(l,d.props||{}),condition:p}},ref:this.renderRef})}}const ca=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:ca(t.parentElement)},ua=t=>{var e;return t?(e=t==null?void 0:t.stateNode)!=null&&e._DESIGN_BOX?t:ua(t.return):null},Um=()=>{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 la={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Cm,function(){var r=function(){},n={},o={},a={};function s(f,p){f=f.push?f:[f];var v=[],y=f.length,_=y,O,C,P,x;for(O=function(L,G){G.length&&v.push(L),_--,_||p(v)};y--;){if(C=f[y],P=o[C],P){O(C,P);continue}x=a[C]=a[C]||[],x.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,P=v.before||r,x=f.replace(/[\?|#].*$/,""),L=f.replace(/^(css|img|module|nomodule)!/,""),G,ne,E;if(y=y||0,/(^css!|\.css$)/.test(x))E=_.createElement("link"),E.rel="stylesheet",E.href=L,G="hideFocus"in E,G&&E.relList&&(G=0,E.rel="preload",E.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(x))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(x)){if(!ne)return p(f,"l");E.type="module"}else if(/^nomodule!/.test(x)&&ne)return p(f,"l");E.onload=E.onerror=E.onbeforeload=function(st){var bt=st.type[0];if(G)try{E.sheet.cssText.length||(bt="e")}catch(Ce){Ce.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)},P(f,E)!==!1&&_.head.appendChild(E)}function l(f,p,v){f=f.push?f:[f];var y=f.length,_=y,O=[],C,P;for(C=function(x,L,G){if(L=="e"&&O.push(x),L=="b")if(G)O.push(x);else return;y--,y||p(O)},P=0;P<_;P++)u(f[P],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,P){l(f,function(x){c(_,x),C&&c({success:C,error:P},x),i(y,x)},_)}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})})(la);var km=la.exports;const fa=wm(km);class Vm{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&&fa(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}fa.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=Vm,g.ComponentInstanceManager=ia,g.DefaultDropPlaceholder=sa,g.DefineReactAdapter=ra,g.DesignRender=Bm,g.ReactAdapter=jm,g.Render=aa,g.canAcceptsRef=Yo,g.collectVariable=hm,g.compWrapper=Ko,g.convertCodeStringToFunction=Xo,g.flatObject=mm,g.formatSourceStylePropertyName=xr,g.getAdapter=Ur,g.getCSSTextValue=Ir,g.getComponentsLibs=vm,g.getMatchVal=Zo,g.getObjFromArrayMap=Pr,g.getThirdLibs=gm,g.isClass=pm,g.runExpression=yt,g.shouldConstruct=qo,g.useDesignRender=Um,g.useRender=Lm,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
29
29
  //# sourceMappingURL=index.umd.js.map