@chamn/render 0.9.3 → 0.10.2
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/core/ReactAdapter/convertModelToComponent.d.ts +1 -0
- package/dist/index.cjs.js +75 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.es.js +1785 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +23 -23
- package/dist/index.umd.js.map +1 -1
- package/package.json +16 -7
- package/dist/index.cjs +0 -88
- package/dist/index.cjs.map +0 -1
- package/dist/index.js +0 -5561
- package/dist/index.js.map +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
(function(C,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],w):(C=typeof globalThis<"u"?globalThis:C||self,w(C.CRender={},C.React))})(this,function(C,w){"use strict";var gm=Object.defineProperty;var mm=(C,w,Pt)=>w in C?gm(C,w,{enumerable:!0,configurable:!0,writable:!0,value:Pt}):C[w]=Pt;var $=(C,w,Pt)=>mm(C,typeof w!="symbol"?w+"":w,Pt);const Pt=t=>()=>{console.warn(`${t} need to be implement getComponent`)},za=["customPageRootRender"],Zr=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","transformProps","errorCatch","requestAPI","clear"],tn=t=>[...Zr,...za].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):Zr.includes(n)&&(r[n]=Pt),r},{});var en=typeof global=="object"&&global&&global.Object===Object&&global,ka=typeof self=="object"&&self&&self.Object===Object&&self,X=en||ka||Function("return this")(),lt=X.Symbol,rn=Object.prototype,Ha=rn.hasOwnProperty,Wa=rn.toString,Wt=lt?lt.toStringTag:void 0;function Ja(t){var e=Ha.call(t,Wt),r=t[Wt];try{t[Wt]=void 0;var n=!0}catch{}var o=Wa.call(t);return n&&(e?t[Wt]=r:delete t[Wt]),o}var qa=Object.prototype,Ka=qa.toString;function Qa(t){return Ka.call(t)}var Ya="[object Null]",Xa="[object Undefined]",nn=lt?lt.toStringTag:void 0;function gt(t){return t==null?t===void 0?Xa:Ya:nn&&nn in Object(t)?Ja(t):Qa(t)}function ft(t){return t!=null&&typeof t=="object"}var Za="[object Symbol]";function ts(t){return typeof t=="symbol"||ft(t)&>(t)==Za}function es(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 nt=Array.isArray,on=lt?lt.prototype:void 0,an=on?on.toString:void 0;function sn(t){if(typeof t=="string")return t;if(nt(t))return es(t,sn)+"";if(ts(t))return an?an.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function mt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function cn(t){return t}var rs="[object AsyncFunction]",ns="[object Function]",os="[object GeneratorFunction]",as="[object Proxy]";function Re(t){if(!mt(t))return!1;var e=gt(t);return e==ns||e==os||e==rs||e==as}var De=X["__core-js_shared__"],un=function(){var t=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ss(t){return!!un&&un in t}var is=Function.prototype,cs=is.toString;function vt(t){if(t!=null){try{return cs.call(t)}catch{}try{return t+""}catch{}}return""}var us=/[\\^$.*+?()[\]{}|]/g,ls=/^\[object .+?Constructor\]$/,fs=Function.prototype,ds=Object.prototype,ps=fs.toString,hs=ds.hasOwnProperty,gs=RegExp("^"+ps.call(hs).replace(us,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ms(t){if(!mt(t)||ss(t))return!1;var e=Re(t)?gs:ls;return e.test(vt(t))}function vs(t,e){return t==null?void 0:t[e]}function yt(t,e){var r=vs(t,e);return ms(r)?r:void 0}var Le=yt(X,"WeakMap"),ln=Object.create,ys=function(){function t(){}return function(e){if(!mt(e))return{};if(ln)return ln(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function bs(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 _s(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Ss=800,Os=16,Cs=Date.now;function Es(t){var e=0,r=0;return function(){var n=Cs(),o=Os-(n-r);if(r=n,o>0){if(++e>=Ss)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function $s(t){return function(){return t}}var pe=function(){try{var t=yt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),ws=pe?function(t,e){return pe(t,"toString",{configurable:!0,enumerable:!1,value:$s(e),writable:!0})}:cn,Ns=Es(ws),js=9007199254740991,As=/^(?:0|[1-9]\d*)$/;function fn(t,e){var r=typeof t;return e=e??js,!!e&&(r=="number"||r!="symbol"&&As.test(t))&&t>-1&&t%1==0&&t<e}function Ve(t,e,r){e=="__proto__"&&pe?pe(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Jt(t,e){return t===e||t!==t&&e!==e}var Ts=Object.prototype,Ms=Ts.hasOwnProperty;function Ps(t,e,r){var n=t[e];(!(Ms.call(t,e)&&Jt(n,r))||r===void 0&&!(e in t))&&Ve(t,e,r)}function xs(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=void 0;c===void 0&&(c=t[i]),o?Ve(r,i,c):Ps(r,i,c)}return r}var dn=Math.max;function Is(t,e,r){return e=dn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=dn(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),bs(t,this,i)}}function Rs(t,e){return Ns(Is(t,e,cn),t+"")}var Ds=9007199254740991;function pn(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ds}function he(t){return t!=null&&pn(t.length)&&!Re(t)}function Ls(t,e,r){if(!mt(r))return!1;var n=typeof e;return(n=="number"?he(r)&&fn(e,r.length):n=="string"&&e in r)?Jt(r[e],t):!1}function Vs(t){return Rs(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&&Ls(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 Fs=Object.prototype;function Fe(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Fs;return t===r}function Us(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Bs="[object Arguments]";function hn(t){return ft(t)&>(t)==Bs}var gn=Object.prototype,Gs=gn.hasOwnProperty,zs=gn.propertyIsEnumerable,Ue=hn(function(){return arguments}())?hn:function(t){return ft(t)&&Gs.call(t,"callee")&&!zs.call(t,"callee")};function ks(){return!1}var mn=typeof C=="object"&&C&&!C.nodeType&&C,vn=mn&&typeof module=="object"&&module&&!module.nodeType&&module,Hs=vn&&vn.exports===mn,yn=Hs?X.Buffer:void 0,Ws=yn?yn.isBuffer:void 0,ge=Ws||ks,Js="[object Arguments]",qs="[object Array]",Ks="[object Boolean]",Qs="[object Date]",Ys="[object Error]",Xs="[object Function]",Zs="[object Map]",ti="[object Number]",ei="[object Object]",ri="[object RegExp]",ni="[object Set]",oi="[object String]",ai="[object WeakMap]",si="[object ArrayBuffer]",ii="[object DataView]",ci="[object Float32Array]",ui="[object Float64Array]",li="[object Int8Array]",fi="[object Int16Array]",di="[object Int32Array]",pi="[object Uint8Array]",hi="[object Uint8ClampedArray]",gi="[object Uint16Array]",mi="[object Uint32Array]",I={};I[ci]=I[ui]=I[li]=I[fi]=I[di]=I[pi]=I[hi]=I[gi]=I[mi]=!0,I[Js]=I[qs]=I[si]=I[Ks]=I[ii]=I[Qs]=I[Ys]=I[Xs]=I[Zs]=I[ti]=I[ei]=I[ri]=I[ni]=I[oi]=I[ai]=!1;function vi(t){return ft(t)&&pn(t.length)&&!!I[gt(t)]}function yi(t){return function(e){return t(e)}}var bn=typeof C=="object"&&C&&!C.nodeType&&C,qt=bn&&typeof module=="object"&&module&&!module.nodeType&&module,bi=qt&&qt.exports===bn,Be=bi&&en.process,_n=function(){try{var t=qt&&qt.require&&qt.require("util").types;return t||Be&&Be.binding&&Be.binding("util")}catch{}}(),Sn=_n&&_n.isTypedArray,Ge=Sn?yi(Sn):vi,_i=Object.prototype,Si=_i.hasOwnProperty;function On(t,e){var r=nt(t),n=!r&&Ue(t),o=!r&&!n&&ge(t),a=!r&&!n&&!o&&Ge(t),s=r||n||o||a,i=s?Us(t.length,String):[],c=i.length;for(var u in t)(e||Si.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||fn(u,c)))&&i.push(u);return i}function Cn(t,e){return function(r){return t(e(r))}}var Oi=Cn(Object.keys,Object),Ci=Object.prototype,Ei=Ci.hasOwnProperty;function $i(t){if(!Fe(t))return Oi(t);var e=[];for(var r in Object(t))Ei.call(t,r)&&r!="constructor"&&e.push(r);return e}function wi(t){return he(t)?On(t):$i(t)}function Ni(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var ji=Object.prototype,Ai=ji.hasOwnProperty;function Ti(t){if(!mt(t))return Ni(t);var e=Fe(t),r=[];for(var n in t)n=="constructor"&&(e||!Ai.call(t,n))||r.push(n);return r}function En(t){return he(t)?On(t,!0):Ti(t)}var Kt=yt(Object,"create");function Mi(){this.__data__=Kt?Kt(null):{},this.size=0}function Pi(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var xi="__lodash_hash_undefined__",Ii=Object.prototype,Ri=Ii.hasOwnProperty;function Di(t){var e=this.__data__;if(Kt){var r=e[t];return r===xi?void 0:r}return Ri.call(e,t)?e[t]:void 0}var Li=Object.prototype,Vi=Li.hasOwnProperty;function Fi(t){var e=this.__data__;return Kt?e[t]!==void 0:Vi.call(e,t)}var Ui="__lodash_hash_undefined__";function Bi(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Kt&&e===void 0?Ui:e,this}function bt(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])}}bt.prototype.clear=Mi,bt.prototype.delete=Pi,bt.prototype.get=Di,bt.prototype.has=Fi,bt.prototype.set=Bi;function Gi(){this.__data__=[],this.size=0}function me(t,e){for(var r=t.length;r--;)if(Jt(t[r][0],e))return r;return-1}var zi=Array.prototype,ki=zi.splice;function Hi(t){var e=this.__data__,r=me(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ki.call(e,r,1),--this.size,!0}function Wi(t){var e=this.__data__,r=me(e,t);return r<0?void 0:e[r][1]}function Ji(t){return me(this.__data__,t)>-1}function qi(t,e){var r=this.__data__,n=me(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function ot(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])}}ot.prototype.clear=Gi,ot.prototype.delete=Hi,ot.prototype.get=Wi,ot.prototype.has=Ji,ot.prototype.set=qi;var Qt=yt(X,"Map");function Ki(){this.size=0,this.__data__={hash:new bt,map:new(Qt||ot),string:new bt}}function Qi(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ve(t,e){var r=t.__data__;return Qi(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Yi(t){var e=ve(this,t).delete(t);return this.size-=e?1:0,e}function Xi(t){return ve(this,t).get(t)}function Zi(t){return ve(this,t).has(t)}function tc(t,e){var r=ve(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function _t(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])}}_t.prototype.clear=Ki,_t.prototype.delete=Yi,_t.prototype.get=Xi,_t.prototype.has=Zi,_t.prototype.set=tc;function $n(t){return t==null?"":sn(t)}function ec(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var wn=Cn(Object.getPrototypeOf,Object),rc="[object Object]",nc=Function.prototype,oc=Object.prototype,Nn=nc.toString,ac=oc.hasOwnProperty,sc=Nn.call(Object);function xt(t){if(!ft(t)||gt(t)!=rc)return!1;var e=wn(t);if(e===null)return!0;var r=ac.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Nn.call(r)==sc}function ic(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 cc(t,e,r){var n=t.length;return r=r===void 0?n:r,ic(t,e,r)}var uc="\\ud800-\\udfff",lc="\\u0300-\\u036f",fc="\\ufe20-\\ufe2f",dc="\\u20d0-\\u20ff",pc=lc+fc+dc,hc="\\ufe0e\\ufe0f",gc="\\u200d",mc=RegExp("["+gc+uc+pc+hc+"]");function jn(t){return mc.test(t)}function vc(t){return t.split("")}var An="\\ud800-\\udfff",yc="\\u0300-\\u036f",bc="\\ufe20-\\ufe2f",_c="\\u20d0-\\u20ff",Sc=yc+bc+_c,Oc="\\ufe0e\\ufe0f",Cc="["+An+"]",ze="["+Sc+"]",ke="\\ud83c[\\udffb-\\udfff]",Ec="(?:"+ze+"|"+ke+")",Tn="[^"+An+"]",Mn="(?:\\ud83c[\\udde6-\\uddff]){2}",Pn="[\\ud800-\\udbff][\\udc00-\\udfff]",$c="\\u200d",xn=Ec+"?",In="["+Oc+"]?",wc="(?:"+$c+"(?:"+[Tn,Mn,Pn].join("|")+")"+In+xn+")*",Nc=In+xn+wc,jc="(?:"+[Tn+ze+"?",ze,Mn,Pn,Cc].join("|")+")",Ac=RegExp(ke+"(?="+ke+")|"+jc+Nc,"g");function Tc(t){return t.match(Ac)||[]}function Mc(t){return jn(t)?Tc(t):vc(t)}function Pc(t){return function(e){e=$n(e);var r=jn(e)?Mc(e):void 0,n=r?r[0]:e.charAt(0),o=r?cc(r,1).join(""):e.slice(1);return n[t]()+o}}var xc=Pc("toUpperCase");function Ic(t){return xc($n(t).toLowerCase())}function Rc(){this.__data__=new ot,this.size=0}function Dc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Lc(t){return this.__data__.get(t)}function Vc(t){return this.__data__.has(t)}var Fc=200;function Uc(t,e){var r=this.__data__;if(r instanceof ot){var n=r.__data__;if(!Qt||n.length<Fc-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new _t(n)}return r.set(t,e),this.size=r.size,this}function at(t){var e=this.__data__=new ot(t);this.size=e.size}at.prototype.clear=Rc,at.prototype.delete=Dc,at.prototype.get=Lc,at.prototype.has=Vc,at.prototype.set=Uc;var Rn=typeof C=="object"&&C&&!C.nodeType&&C,Dn=Rn&&typeof module=="object"&&module&&!module.nodeType&&module,Bc=Dn&&Dn.exports===Rn,Ln=Bc?X.Buffer:void 0;Ln&&Ln.allocUnsafe;function Gc(t,e){return t.slice()}function zc(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 kc(){return[]}var Hc=Object.prototype,Wc=Hc.propertyIsEnumerable,Vn=Object.getOwnPropertySymbols,Jc=Vn?function(t){return t==null?[]:(t=Object(t),zc(Vn(t),function(e){return Wc.call(t,e)}))}:kc;function qc(t,e,r){var n=e(t);return nt(t)?n:ec(n,r(t))}function Fn(t){return qc(t,wi,Jc)}var He=yt(X,"DataView"),We=yt(X,"Promise"),Je=yt(X,"Set"),Un="[object Map]",Kc="[object Object]",Bn="[object Promise]",Gn="[object Set]",zn="[object WeakMap]",kn="[object DataView]",Qc=vt(He),Yc=vt(Qt),Xc=vt(We),Zc=vt(Je),tu=vt(Le),dt=gt;(He&&dt(new He(new ArrayBuffer(1)))!=kn||Qt&&dt(new Qt)!=Un||We&&dt(We.resolve())!=Bn||Je&&dt(new Je)!=Gn||Le&&dt(new Le)!=zn)&&(dt=function(t){var e=gt(t),r=e==Kc?t.constructor:void 0,n=r?vt(r):"";if(n)switch(n){case Qc:return kn;case Yc:return Un;case Xc:return Bn;case Zc:return Gn;case tu:return zn}return e});var ye=X.Uint8Array;function eu(t){var e=new t.constructor(t.byteLength);return new ye(e).set(new ye(t)),e}function ru(t,e){var r=eu(t.buffer);return new t.constructor(r,t.byteOffset,t.length)}function nu(t){return typeof t.constructor=="function"&&!Fe(t)?ys(wn(t)):{}}var ou="__lodash_hash_undefined__";function au(t){return this.__data__.set(t,ou),this}function su(t){return this.__data__.has(t)}function be(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new _t;++e<r;)this.add(t[e])}be.prototype.add=be.prototype.push=au,be.prototype.has=su;function iu(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 cu(t,e){return t.has(e)}var uu=1,lu=2;function Hn(t,e,r,n,o,a){var s=r&uu,i=t.length,c=e.length;if(i!=c&&!(s&&c>i))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var f=-1,l=!0,h=r&lu?new be:void 0;for(a.set(t,e),a.set(e,t);++f<i;){var m=t[f],_=e[f];if(n)var p=s?n(_,m,f,e,t,a):n(m,_,f,t,e,a);if(p!==void 0){if(p)continue;l=!1;break}if(h){if(!iu(e,function(g,v){if(!cu(h,v)&&(m===g||o(m,g,r,n,a)))return h.push(v)})){l=!1;break}}else if(!(m===_||o(m,_,r,n,a))){l=!1;break}}return a.delete(t),a.delete(e),l}function fu(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function du(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var pu=1,hu=2,gu="[object Boolean]",mu="[object Date]",vu="[object Error]",yu="[object Map]",bu="[object Number]",_u="[object RegExp]",Su="[object Set]",Ou="[object String]",Cu="[object Symbol]",Eu="[object ArrayBuffer]",$u="[object DataView]",Wn=lt?lt.prototype:void 0,qe=Wn?Wn.valueOf:void 0;function wu(t,e,r,n,o,a,s){switch(r){case $u:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Eu:return!(t.byteLength!=e.byteLength||!a(new ye(t),new ye(e)));case gu:case mu:case bu:return Jt(+t,+e);case vu:return t.name==e.name&&t.message==e.message;case _u:case Ou:return t==e+"";case yu:var i=fu;case Su:var c=n&pu;if(i||(i=du),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=hu,s.set(t,e);var d=Hn(i(t),i(e),n,o,a,s);return s.delete(t),d;case Cu:if(qe)return qe.call(t)==qe.call(e)}return!1}var Nu=1,ju=Object.prototype,Au=ju.hasOwnProperty;function Tu(t,e,r,n,o,a){var s=r&Nu,i=Fn(t),c=i.length,u=Fn(e),d=u.length;if(c!=d&&!s)return!1;for(var f=c;f--;){var l=i[f];if(!(s?l in e:Au.call(e,l)))return!1}var h=a.get(t),m=a.get(e);if(h&&m)return h==e&&m==t;var _=!0;a.set(t,e),a.set(e,t);for(var p=s;++f<c;){l=i[f];var g=t[l],v=e[l];if(n)var b=s?n(v,g,l,e,t,a):n(g,v,l,t,e,a);if(!(b===void 0?g===v||o(g,v,r,n,a):b)){_=!1;break}p||(p=l=="constructor")}if(_&&!p){var y=t.constructor,S=e.constructor;y!=S&&"constructor"in t&&"constructor"in e&&!(typeof y=="function"&&y instanceof y&&typeof S=="function"&&S instanceof S)&&(_=!1)}return a.delete(t),a.delete(e),_}var Mu=1,Jn="[object Arguments]",qn="[object Array]",_e="[object Object]",Pu=Object.prototype,Kn=Pu.hasOwnProperty;function xu(t,e,r,n,o,a){var s=nt(t),i=nt(e),c=s?qn:dt(t),u=i?qn:dt(e);c=c==Jn?_e:c,u=u==Jn?_e:u;var d=c==_e,f=u==_e,l=c==u;if(l&&ge(t)){if(!ge(e))return!1;s=!0,d=!1}if(l&&!d)return a||(a=new at),s||Ge(t)?Hn(t,e,r,n,o,a):wu(t,e,c,r,n,o,a);if(!(r&Mu)){var h=d&&Kn.call(t,"__wrapped__"),m=f&&Kn.call(e,"__wrapped__");if(h||m){var _=h?t.value():t,p=m?e.value():e;return a||(a=new at),o(_,p,r,n,a)}}return l?(a||(a=new at),Tu(t,e,r,n,o,a)):!1}function Qn(t,e,r,n,o){return t===e?!0:t==null||e==null||!ft(t)&&!ft(e)?t!==t&&e!==e:xu(t,e,r,n,Qn,o)}function Iu(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[++o];if(r(a[c],c,a)===!1)break}return e}}var Ru=Iu();function Ke(t,e,r){(r!==void 0&&!Jt(t[e],r)||r===void 0&&!(e in t))&&Ve(t,e,r)}function Du(t){return ft(t)&&he(t)}function Qe(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Lu(t){return xs(t,En(t))}function Vu(t,e,r,n,o,a,s){var i=Qe(t,r),c=Qe(e,r),u=s.get(c);if(u){Ke(t,r,u);return}var d=a?a(i,c,r+"",t,e,s):void 0,f=d===void 0;if(f){var l=nt(c),h=!l&&ge(c),m=!l&&!h&&Ge(c);d=c,l||h||m?nt(i)?d=i:Du(i)?d=_s(i):h?(f=!1,d=Gc(c)):m?(f=!1,d=ru(c)):d=[]:xt(c)||Ue(c)?(d=i,Ue(i)?d=Lu(i):(!mt(i)||Re(i))&&(d=nu(c))):f=!1}f&&(s.set(c,d),o(d,c,n,a,s),s.delete(c)),Ke(t,r,d)}function Yn(t,e,r,n,o){t!==e&&Ru(e,function(a,s){if(o||(o=new at),mt(a))Vu(t,e,s,r,Yn,n,o);else{var i=n?n(Qe(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),Ke(t,s,i)}},En)}function Fu(t,e){return Qn(t,e)}var Uu=Vs(function(t,e,r){Yn(t,e,r)});const Xn=(t,e={keyListVar:"ALL_NODE_IDS",getReadValCode:""})=>{let r=t;return r[0]===String(Number(r[0]))&&(r=`_${r}`),`
|
|
2
|
-
var ${
|
|
1
|
+
(function(O,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],N):(O=typeof globalThis<"u"?globalThis:O||self,N(O.CRender={},O.React))})(this,(function(O,N){"use strict";var yf=Object.defineProperty;var vf=(O,N,ve)=>N in O?yf(O,N,{enumerable:!0,configurable:!0,writable:!0,value:ve}):O[N]=ve;var E=(O,N,ve)=>vf(O,typeof N!="symbol"?N+"":N,ve);const ve=e=>()=>{console.warn(`${e} need to be implement getComponent`)},ps=["customPageRootRender"],hn=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","transformProps","errorCatch","requestAPI","clear"],gn=e=>[...hn,...ps].reduce((n,r)=>{var s;return e!=null&&e[r]?n[r]=(s=e[r])==null?void 0:s.bind(e):hn.includes(r)&&(n[r]=ve),n},{});var mn=typeof global=="object"&&global&&global.Object===Object&&global,hs=typeof self=="object"&&self&&self.Object===Object&&self,Q=mn||hs||Function("return this")(),q=Q.Symbol,yn=Object.prototype,gs=yn.hasOwnProperty,ms=yn.toString,Ie=q?q.toStringTag:void 0;function ys(e){var t=gs.call(e,Ie),n=e[Ie];try{e[Ie]=void 0;var r=!0}catch{}var s=ms.call(e);return r&&(t?e[Ie]=n:delete e[Ie]),s}var vs=Object.prototype,bs=vs.toString;function _s(e){return bs.call(e)}var Ss="[object Null]",$s="[object Undefined]",vn=q?q.toStringTag:void 0;function ie(e){return e==null?e===void 0?$s:Ss:vn&&vn in Object(e)?ys(e):_s(e)}function X(e){return e!=null&&typeof e=="object"}var Cs="[object Symbol]";function ct(e){return typeof e=="symbol"||X(e)&&ie(e)==Cs}function ut(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var j=Array.isArray,bn=q?q.prototype:void 0,_n=bn?bn.toString:void 0;function Sn(e){if(typeof e=="string")return e;if(j(e))return ut(e,Sn)+"";if(ct(e))return _n?_n.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function J(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function lt(e){return e}var Es="[object AsyncFunction]",Os="[object Function]",Ns="[object GeneratorFunction]",ws="[object Proxy]";function ft(e){if(!J(e))return!1;var t=ie(e);return t==Os||t==Ns||t==Es||t==ws}var dt=Q["__core-js_shared__"],$n=(function(){var e=/[^.]+$/.exec(dt&&dt.keys&&dt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function Ts(e){return!!$n&&$n in e}var As=Function.prototype,Ms=As.toString;function ce(e){if(e!=null){try{return Ms.call(e)}catch{}try{return e+""}catch{}}return""}var Is=/[\\^$.*+?()[\]{}|]/g,Ps=/^\[object .+?Constructor\]$/,xs=Function.prototype,Rs=Object.prototype,Ds=xs.toString,Ls=Rs.hasOwnProperty,js=RegExp("^"+Ds.call(Ls).replace(Is,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Fs(e){if(!J(e)||Ts(e))return!1;var t=ft(e)?js:Ps;return t.test(ce(e))}function Vs(e,t){return e==null?void 0:e[t]}function ue(e,t){var n=Vs(e,t);return Fs(n)?n:void 0}var pt=ue(Q,"WeakMap"),Cn=Object.create,Bs=(function(){function e(){}return function(t){if(!J(t))return{};if(Cn)return Cn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function Us(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Gs(){}function En(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Hs=800,ks=16,qs=Date.now;function zs(e){var t=0,n=0;return function(){var r=qs(),s=ks-(r-n);if(n=r,s>0){if(++t>=Hs)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Js(e){return function(){return e}}var Je=(function(){try{var e=ue(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Ws=Je?function(e,t){return Je(e,"toString",{configurable:!0,enumerable:!1,value:Js(t),writable:!0})}:lt,On=zs(Ws);function Ys(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function Ks(e,t,n,r){for(var s=e.length,o=n+-1;++o<s;)if(t(e[o],o,e))return o;return-1}function Qs(e){return e!==e}function Xs(e,t,n){for(var r=n-1,s=e.length;++r<s;)if(e[r]===t)return r;return-1}function Zs(e,t,n){return t===t?Xs(e,t,n):Ks(e,Qs,n)}function eo(e,t){var n=e==null?0:e.length;return!!n&&Zs(e,t,0)>-1}var to=9007199254740991,no=/^(?:0|[1-9]\d*)$/;function We(e,t){var n=typeof e;return t=t??to,!!t&&(n=="number"||n!="symbol"&&no.test(e))&&e>-1&&e%1==0&&e<t}function ht(e,t,n){t=="__proto__"&&Je?Je(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Pe(e,t){return e===t||e!==e&&t!==t}var ro=Object.prototype,so=ro.hasOwnProperty;function gt(e,t,n){var r=e[t];(!(so.call(e,t)&&Pe(r,n))||n===void 0&&!(t in e))&&ht(e,t,n)}function be(e,t,n,r){var s=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var i=t[o],c=void 0;c===void 0&&(c=e[i]),s?ht(n,i,c):gt(n,i,c)}return n}var Nn=Math.max;function wn(e,t,n){return t=Nn(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,o=Nn(r.length-t,0),a=Array(o);++s<o;)a[s]=r[t+s];s=-1;for(var i=Array(t+1);++s<t;)i[s]=r[s];return i[t]=n(a),Us(e,this,i)}}function Tn(e,t){return On(wn(e,t,lt),e+"")}var oo=9007199254740991;function mt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=oo}function Ye(e){return e!=null&&mt(e.length)&&!ft(e)}function ao(e,t,n){if(!J(n))return!1;var r=typeof t;return(r=="number"?Ye(n)&&We(t,n.length):r=="string"&&t in n)?Pe(n[t],e):!1}function io(e){return Tn(function(t,n){var r=-1,s=n.length,o=s>1?n[s-1]:void 0,a=s>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(s--,o):void 0,a&&ao(n[0],n[1],a)&&(o=s<3?void 0:o,s=1),t=Object(t);++r<s;){var i=n[r];i&&e(t,i,r,o)}return t})}var co=Object.prototype;function yt(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||co;return e===n}function uo(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var lo="[object Arguments]";function An(e){return X(e)&&ie(e)==lo}var Mn=Object.prototype,fo=Mn.hasOwnProperty,po=Mn.propertyIsEnumerable,xe=An((function(){return arguments})())?An:function(e){return X(e)&&fo.call(e,"callee")&&!po.call(e,"callee")};function ho(){return!1}var In=typeof O=="object"&&O&&!O.nodeType&&O,Pn=In&&typeof module=="object"&&module&&!module.nodeType&&module,go=Pn&&Pn.exports===In,xn=go?Q.Buffer:void 0,mo=xn?xn.isBuffer:void 0,Re=mo||ho,yo="[object Arguments]",vo="[object Array]",bo="[object Boolean]",_o="[object Date]",So="[object Error]",$o="[object Function]",Co="[object Map]",Eo="[object Number]",Oo="[object Object]",No="[object RegExp]",wo="[object Set]",To="[object String]",Ao="[object WeakMap]",Mo="[object ArrayBuffer]",Io="[object DataView]",Po="[object Float32Array]",xo="[object Float64Array]",Ro="[object Int8Array]",Do="[object Int16Array]",Lo="[object Int32Array]",jo="[object Uint8Array]",Fo="[object Uint8ClampedArray]",Vo="[object Uint16Array]",Bo="[object Uint32Array]",R={};R[Po]=R[xo]=R[Ro]=R[Do]=R[Lo]=R[jo]=R[Fo]=R[Vo]=R[Bo]=!0,R[yo]=R[vo]=R[Mo]=R[bo]=R[Io]=R[_o]=R[So]=R[$o]=R[Co]=R[Eo]=R[Oo]=R[No]=R[wo]=R[To]=R[Ao]=!1;function Uo(e){return X(e)&&mt(e.length)&&!!R[ie(e)]}function vt(e){return function(t){return e(t)}}var Rn=typeof O=="object"&&O&&!O.nodeType&&O,De=Rn&&typeof module=="object"&&module&&!module.nodeType&&module,Go=De&&De.exports===Rn,bt=Go&&mn.process,_e=(function(){try{var e=De&&De.require&&De.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch{}})(),Dn=_e&&_e.isTypedArray,_t=Dn?vt(Dn):Uo,Ho=Object.prototype,ko=Ho.hasOwnProperty;function Ln(e,t){var n=j(e),r=!n&&xe(e),s=!n&&!r&&Re(e),o=!n&&!r&&!s&&_t(e),a=n||r||s||o,i=a?uo(e.length,String):[],c=i.length;for(var f in e)(t||ko.call(e,f))&&!(a&&(f=="length"||s&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||We(f,c)))&&i.push(f);return i}function jn(e,t){return function(n){return e(t(n))}}var qo=jn(Object.keys,Object),zo=Object.prototype,Jo=zo.hasOwnProperty;function Wo(e){if(!yt(e))return qo(e);var t=[];for(var n in Object(e))Jo.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ke(e){return Ye(e)?Ln(e):Wo(e)}function Yo(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Ko=Object.prototype,Qo=Ko.hasOwnProperty;function Xo(e){if(!J(e))return Yo(e);var t=yt(e),n=[];for(var r in e)r=="constructor"&&(t||!Qo.call(e,r))||n.push(r);return n}function Le(e){return Ye(e)?Ln(e,!0):Xo(e)}var Zo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ea=/^\w*$/;function St(e,t){if(j(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ct(e)?!0:ea.test(e)||!Zo.test(e)||t!=null&&e in Object(t)}var je=ue(Object,"create");function ta(){this.__data__=je?je(null):{},this.size=0}function na(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ra="__lodash_hash_undefined__",sa=Object.prototype,oa=sa.hasOwnProperty;function aa(e){var t=this.__data__;if(je){var n=t[e];return n===ra?void 0:n}return oa.call(t,e)?t[e]:void 0}var ia=Object.prototype,ca=ia.hasOwnProperty;function ua(e){var t=this.__data__;return je?t[e]!==void 0:ca.call(t,e)}var la="__lodash_hash_undefined__";function fa(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=je&&t===void 0?la:t,this}function le(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}le.prototype.clear=ta,le.prototype.delete=na,le.prototype.get=aa,le.prototype.has=ua,le.prototype.set=fa;function da(){this.__data__=[],this.size=0}function Qe(e,t){for(var n=e.length;n--;)if(Pe(e[n][0],t))return n;return-1}var pa=Array.prototype,ha=pa.splice;function ga(e){var t=this.__data__,n=Qe(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():ha.call(t,n,1),--this.size,!0}function ma(e){var t=this.__data__,n=Qe(t,e);return n<0?void 0:t[n][1]}function ya(e){return Qe(this.__data__,e)>-1}function va(e,t){var n=this.__data__,r=Qe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function te(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}te.prototype.clear=da,te.prototype.delete=ga,te.prototype.get=ma,te.prototype.has=ya,te.prototype.set=va;var Fe=ue(Q,"Map");function ba(){this.size=0,this.__data__={hash:new le,map:new(Fe||te),string:new le}}function _a(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Xe(e,t){var n=e.__data__;return _a(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Sa(e){var t=Xe(this,e).delete(e);return this.size-=t?1:0,t}function $a(e){return Xe(this,e).get(e)}function Ca(e){return Xe(this,e).has(e)}function Ea(e,t){var n=Xe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function ne(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ne.prototype.clear=ba,ne.prototype.delete=Sa,ne.prototype.get=$a,ne.prototype.has=Ca,ne.prototype.set=Ea;var Oa="Expected a function";function $t(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Oa);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],o=n.cache;if(o.has(s))return o.get(s);var a=e.apply(this,r);return n.cache=o.set(s,a)||o,a};return n.cache=new($t.Cache||ne),n}$t.Cache=ne;var Na=500;function wa(e){var t=$t(e,function(r){return n.size===Na&&n.clear(),r}),n=t.cache;return t}var Ta=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Aa=/\\(\\)?/g,Ma=wa(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Ta,function(n,r,s,o){t.push(s?o.replace(Aa,"$1"):r||n)}),t});function Ct(e){return e==null?"":Sn(e)}function Se(e,t){return j(e)?e:St(e,t)?[e]:Ma(Ct(e))}function $e(e){if(typeof e=="string"||ct(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ze(e,t){t=Se(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[$e(t[n++])];return n&&n==r?e:void 0}function Fn(e,t,n){var r=e==null?void 0:Ze(e,t);return r===void 0?n:r}function Et(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}var Vn=q?q.isConcatSpreadable:void 0;function Ia(e){return j(e)||xe(e)||!!(Vn&&e&&e[Vn])}function Bn(e,t,n,r,s){var o=-1,a=e.length;for(n||(n=Ia),s||(s=[]);++o<a;){var i=e[o];n(i)?Et(s,i):r||(s[s.length]=i)}return s}function Pa(e){var t=e==null?0:e.length;return t?Bn(e):[]}function xa(e){return On(wn(e,void 0,Pa),e+"")}var Ot=jn(Object.getPrototypeOf,Object),Ra="[object Object]",Da=Function.prototype,La=Object.prototype,Un=Da.toString,ja=La.hasOwnProperty,Fa=Un.call(Object);function F(e){if(!X(e)||ie(e)!=Ra)return!1;var t=Ot(e);if(t===null)return!0;var n=ja.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Un.call(n)==Fa}function Gn(e,t,n){var r=-1,s=e.length;t<0&&(t=-t>s?0:s+t),n=n>s?s:n,n<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(s);++r<s;)o[r]=e[r+t];return o}function Va(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Gn(e,t,n)}var Ba="\\ud800-\\udfff",Ua="\\u0300-\\u036f",Ga="\\ufe20-\\ufe2f",Ha="\\u20d0-\\u20ff",ka=Ua+Ga+Ha,qa="\\ufe0e\\ufe0f",za="\\u200d",Ja=RegExp("["+za+Ba+ka+qa+"]");function Hn(e){return Ja.test(e)}function Wa(e){return e.split("")}var kn="\\ud800-\\udfff",Ya="\\u0300-\\u036f",Ka="\\ufe20-\\ufe2f",Qa="\\u20d0-\\u20ff",Xa=Ya+Ka+Qa,Za="\\ufe0e\\ufe0f",ei="["+kn+"]",Nt="["+Xa+"]",wt="\\ud83c[\\udffb-\\udfff]",ti="(?:"+Nt+"|"+wt+")",qn="[^"+kn+"]",zn="(?:\\ud83c[\\udde6-\\uddff]){2}",Jn="[\\ud800-\\udbff][\\udc00-\\udfff]",ni="\\u200d",Wn=ti+"?",Yn="["+Za+"]?",ri="(?:"+ni+"(?:"+[qn,zn,Jn].join("|")+")"+Yn+Wn+")*",si=Yn+Wn+ri,oi="(?:"+[qn+Nt+"?",Nt,zn,Jn,ei].join("|")+")",ai=RegExp(wt+"(?="+wt+")|"+oi+si,"g");function ii(e){return e.match(ai)||[]}function ci(e){return Hn(e)?ii(e):Wa(e)}function ui(e){return function(t){t=Ct(t);var n=Hn(t)?ci(t):void 0,r=n?n[0]:t.charAt(0),s=n?Va(n,1).join(""):t.slice(1);return r[e]()+s}}var li=ui("toUpperCase");function fi(e){return li(Ct(e).toLowerCase())}function di(){this.__data__=new te,this.size=0}function pi(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function hi(e){return this.__data__.get(e)}function gi(e){return this.__data__.has(e)}var mi=200;function yi(e,t){var n=this.__data__;if(n instanceof te){var r=n.__data__;if(!Fe||r.length<mi-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ne(r)}return n.set(e,t),this.size=n.size,this}function W(e){var t=this.__data__=new te(e);this.size=t.size}W.prototype.clear=di,W.prototype.delete=pi,W.prototype.get=hi,W.prototype.has=gi,W.prototype.set=yi;function vi(e,t){return e&&be(t,Ke(t),e)}function bi(e,t){return e&&be(t,Le(t),e)}var Kn=typeof O=="object"&&O&&!O.nodeType&&O,Qn=Kn&&typeof module=="object"&&module&&!module.nodeType&&module,_i=Qn&&Qn.exports===Kn,Xn=_i?Q.Buffer:void 0,Zn=Xn?Xn.allocUnsafe:void 0;function er(e,t){if(t)return e.slice();var n=e.length,r=Zn?Zn(n):new e.constructor(n);return e.copy(r),r}function Si(e,t){for(var n=-1,r=e==null?0:e.length,s=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[s++]=a)}return o}function tr(){return[]}var $i=Object.prototype,Ci=$i.propertyIsEnumerable,nr=Object.getOwnPropertySymbols,Tt=nr?function(e){return e==null?[]:(e=Object(e),Si(nr(e),function(t){return Ci.call(e,t)}))}:tr;function Ei(e,t){return be(e,Tt(e),t)}var Oi=Object.getOwnPropertySymbols,rr=Oi?function(e){for(var t=[];e;)Et(t,Tt(e)),e=Ot(e);return t}:tr;function Ni(e,t){return be(e,rr(e),t)}function sr(e,t,n){var r=t(e);return j(e)?r:Et(r,n(e))}function At(e){return sr(e,Ke,Tt)}function Mt(e){return sr(e,Le,rr)}var It=ue(Q,"DataView"),Pt=ue(Q,"Promise"),Ce=ue(Q,"Set"),or="[object Map]",wi="[object Object]",ar="[object Promise]",ir="[object Set]",cr="[object WeakMap]",ur="[object DataView]",Ti=ce(It),Ai=ce(Fe),Mi=ce(Pt),Ii=ce(Ce),Pi=ce(pt),Y=ie;(It&&Y(new It(new ArrayBuffer(1)))!=ur||Fe&&Y(new Fe)!=or||Pt&&Y(Pt.resolve())!=ar||Ce&&Y(new Ce)!=ir||pt&&Y(new pt)!=cr)&&(Y=function(e){var t=ie(e),n=t==wi?e.constructor:void 0,r=n?ce(n):"";if(r)switch(r){case Ti:return ur;case Ai:return or;case Mi:return ar;case Ii:return ir;case Pi:return cr}return t});var xi=Object.prototype,Ri=xi.hasOwnProperty;function Di(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Ri.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var et=Q.Uint8Array;function xt(e){var t=new e.constructor(e.byteLength);return new et(t).set(new et(e)),t}function Li(e,t){var n=t?xt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var ji=/\w*$/;function Fi(e){var t=new e.constructor(e.source,ji.exec(e));return t.lastIndex=e.lastIndex,t}var lr=q?q.prototype:void 0,fr=lr?lr.valueOf:void 0;function Vi(e){return fr?Object(fr.call(e)):{}}function dr(e,t){var n=t?xt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Bi="[object Boolean]",Ui="[object Date]",Gi="[object Map]",Hi="[object Number]",ki="[object RegExp]",qi="[object Set]",zi="[object String]",Ji="[object Symbol]",Wi="[object ArrayBuffer]",Yi="[object DataView]",Ki="[object Float32Array]",Qi="[object Float64Array]",Xi="[object Int8Array]",Zi="[object Int16Array]",ec="[object Int32Array]",tc="[object Uint8Array]",nc="[object Uint8ClampedArray]",rc="[object Uint16Array]",sc="[object Uint32Array]";function oc(e,t,n){var r=e.constructor;switch(t){case Wi:return xt(e);case Bi:case Ui:return new r(+e);case Yi:return Li(e,n);case Ki:case Qi:case Xi:case Zi:case ec:case tc:case nc:case rc:case sc:return dr(e,n);case Gi:return new r;case Hi:case zi:return new r(e);case ki:return Fi(e);case qi:return new r;case Ji:return Vi(e)}}function pr(e){return typeof e.constructor=="function"&&!yt(e)?Bs(Ot(e)):{}}var ac="[object Map]";function ic(e){return X(e)&&Y(e)==ac}var hr=_e&&_e.isMap,cc=hr?vt(hr):ic,uc="[object Set]";function lc(e){return X(e)&&Y(e)==uc}var gr=_e&&_e.isSet,fc=gr?vt(gr):lc,dc=1,pc=2,hc=4,mr="[object Arguments]",gc="[object Array]",mc="[object Boolean]",yc="[object Date]",vc="[object Error]",yr="[object Function]",bc="[object GeneratorFunction]",_c="[object Map]",Sc="[object Number]",vr="[object Object]",$c="[object RegExp]",Cc="[object Set]",Ec="[object String]",Oc="[object Symbol]",Nc="[object WeakMap]",wc="[object ArrayBuffer]",Tc="[object DataView]",Ac="[object Float32Array]",Mc="[object Float64Array]",Ic="[object Int8Array]",Pc="[object Int16Array]",xc="[object Int32Array]",Rc="[object Uint8Array]",Dc="[object Uint8ClampedArray]",Lc="[object Uint16Array]",jc="[object Uint32Array]",x={};x[mr]=x[gc]=x[wc]=x[Tc]=x[mc]=x[yc]=x[Ac]=x[Mc]=x[Ic]=x[Pc]=x[xc]=x[_c]=x[Sc]=x[vr]=x[$c]=x[Cc]=x[Ec]=x[Oc]=x[Rc]=x[Dc]=x[Lc]=x[jc]=!0,x[vc]=x[yr]=x[Nc]=!1;function Ve(e,t,n,r,s,o){var a,i=t&dc,c=t&pc,f=t&hc;if(n&&(a=s?n(e,r,s,o):n(e)),a!==void 0)return a;if(!J(e))return e;var p=j(e);if(p){if(a=Di(e),!i)return En(e,a)}else{var u=Y(e),l=u==yr||u==bc;if(Re(e))return er(e,i);if(u==vr||u==mr||l&&!s){if(a=c||l?{}:pr(e),!i)return c?Ni(e,bi(a,e)):Ei(e,vi(a,e))}else{if(!x[u])return s?e:{};a=oc(e,u,i)}}o||(o=new W);var h=o.get(e);if(h)return h;o.set(e,a),fc(e)?e.forEach(function(d){a.add(Ve(d,t,n,d,e,o))}):cc(e)&&e.forEach(function(d,g){a.set(g,Ve(d,t,n,g,e,o))});var b=f?c?Mt:At:c?Le:Ke,C=p?void 0:b(e);return Ys(C||e,function(d,g){C&&(g=d,d=e[g]),gt(a,g,Ve(d,t,n,g,e,o))}),a}var Fc=1,Vc=4;function br(e){return Ve(e,Fc|Vc)}var Bc="__lodash_hash_undefined__";function Uc(e){return this.__data__.set(e,Bc),this}function Gc(e){return this.__data__.has(e)}function Be(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ne;++t<n;)this.add(e[t])}Be.prototype.add=Be.prototype.push=Uc,Be.prototype.has=Gc;function Hc(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function _r(e,t){return e.has(t)}var kc=1,qc=2;function Sr(e,t,n,r,s,o){var a=n&kc,i=e.length,c=t.length;if(i!=c&&!(a&&c>i))return!1;var f=o.get(e),p=o.get(t);if(f&&p)return f==t&&p==e;var u=-1,l=!0,h=n&qc?new Be:void 0;for(o.set(e,t),o.set(t,e);++u<i;){var b=e[u],C=t[u];if(r)var d=a?r(C,b,u,t,e,o):r(b,C,u,e,t,o);if(d!==void 0){if(d)continue;l=!1;break}if(h){if(!Hc(t,function(g,m){if(!_r(h,m)&&(b===g||s(b,g,n,r,o)))return h.push(m)})){l=!1;break}}else if(!(b===C||s(b,C,n,r,o))){l=!1;break}}return o.delete(e),o.delete(t),l}function zc(e){var t=-1,n=Array(e.size);return e.forEach(function(r,s){n[++t]=[s,r]}),n}function Rt(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Jc=1,Wc=2,Yc="[object Boolean]",Kc="[object Date]",Qc="[object Error]",Xc="[object Map]",Zc="[object Number]",eu="[object RegExp]",tu="[object Set]",nu="[object String]",ru="[object Symbol]",su="[object ArrayBuffer]",ou="[object DataView]",$r=q?q.prototype:void 0,Dt=$r?$r.valueOf:void 0;function au(e,t,n,r,s,o,a){switch(n){case ou:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case su:return!(e.byteLength!=t.byteLength||!o(new et(e),new et(t)));case Yc:case Kc:case Zc:return Pe(+e,+t);case Qc:return e.name==t.name&&e.message==t.message;case eu:case nu:return e==t+"";case Xc:var i=zc;case tu:var c=r&Jc;if(i||(i=Rt),e.size!=t.size&&!c)return!1;var f=a.get(e);if(f)return f==t;r|=Wc,a.set(e,t);var p=Sr(i(e),i(t),r,s,o,a);return a.delete(e),p;case ru:if(Dt)return Dt.call(e)==Dt.call(t)}return!1}var iu=1,cu=Object.prototype,uu=cu.hasOwnProperty;function lu(e,t,n,r,s,o){var a=n&iu,i=At(e),c=i.length,f=At(t),p=f.length;if(c!=p&&!a)return!1;for(var u=c;u--;){var l=i[u];if(!(a?l in t:uu.call(t,l)))return!1}var h=o.get(e),b=o.get(t);if(h&&b)return h==t&&b==e;var C=!0;o.set(e,t),o.set(t,e);for(var d=a;++u<c;){l=i[u];var g=e[l],m=t[l];if(r)var y=a?r(m,g,l,t,e,o):r(g,m,l,e,t,o);if(!(y===void 0?g===m||s(g,m,n,r,o):y)){C=!1;break}d||(d=l=="constructor")}if(C&&!d){var v=e.constructor,S=t.constructor;v!=S&&"constructor"in e&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof S=="function"&&S instanceof S)&&(C=!1)}return o.delete(e),o.delete(t),C}var fu=1,Cr="[object Arguments]",Er="[object Array]",tt="[object Object]",du=Object.prototype,Or=du.hasOwnProperty;function pu(e,t,n,r,s,o){var a=j(e),i=j(t),c=a?Er:Y(e),f=i?Er:Y(t);c=c==Cr?tt:c,f=f==Cr?tt:f;var p=c==tt,u=f==tt,l=c==f;if(l&&Re(e)){if(!Re(t))return!1;a=!0,p=!1}if(l&&!p)return o||(o=new W),a||_t(e)?Sr(e,t,n,r,s,o):au(e,t,c,n,r,s,o);if(!(n&fu)){var h=p&&Or.call(e,"__wrapped__"),b=u&&Or.call(t,"__wrapped__");if(h||b){var C=h?e.value():e,d=b?t.value():t;return o||(o=new W),s(C,d,n,r,o)}}return l?(o||(o=new W),lu(e,t,n,r,s,o)):!1}function nt(e,t,n,r,s){return e===t?!0:e==null||t==null||!X(e)&&!X(t)?e!==e&&t!==t:pu(e,t,n,r,nt,s)}var hu=1,gu=2;function mu(e,t,n,r){var s=n.length,o=s;if(e==null)return!o;for(e=Object(e);s--;){var a=n[s];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++s<o;){a=n[s];var i=a[0],c=e[i],f=a[1];if(a[2]){if(c===void 0&&!(i in e))return!1}else{var p=new W,u;if(!(u===void 0?nt(f,c,hu|gu,r,p):u))return!1}}return!0}function Nr(e){return e===e&&!J(e)}function yu(e){for(var t=Ke(e),n=t.length;n--;){var r=t[n],s=e[r];t[n]=[r,s,Nr(s)]}return t}function wr(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function vu(e){var t=yu(e);return t.length==1&&t[0][2]?wr(t[0][0],t[0][1]):function(n){return n===e||mu(n,e,t)}}function bu(e,t){return e!=null&&t in Object(e)}function _u(e,t,n){t=Se(t,e);for(var r=-1,s=t.length,o=!1;++r<s;){var a=$e(t[r]);if(!(o=e!=null&&n(e,a)))break;e=e[a]}return o||++r!=s?o:(s=e==null?0:e.length,!!s&&mt(s)&&We(a,s)&&(j(e)||xe(e)))}function Su(e,t){return e!=null&&_u(e,t,bu)}var $u=1,Cu=2;function Eu(e,t){return St(e)&&Nr(t)?wr($e(e),t):function(n){var r=Fn(n,e);return r===void 0&&r===t?Su(n,e):nt(t,r,$u|Cu)}}function Ou(e){return function(t){return t==null?void 0:t[e]}}function Nu(e){return function(t){return Ze(t,e)}}function wu(e){return St(e)?Ou($e(e)):Nu(e)}function Lt(e){return typeof e=="function"?e:e==null?lt:typeof e=="object"?j(e)?Eu(e[0],e[1]):vu(e):wu(e)}function Tu(e){return function(t,n,r){for(var s=-1,o=Object(t),a=r(t),i=a.length;i--;){var c=a[++s];if(n(o[c],c,o)===!1)break}return t}}var Au=Tu();function jt(e,t,n){(n!==void 0&&!Pe(e[t],n)||n===void 0&&!(t in e))&&ht(e,t,n)}function Ft(e){return X(e)&&Ye(e)}function Vt(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Mu(e){return be(e,Le(e))}function Iu(e,t,n,r,s,o,a){var i=Vt(e,n),c=Vt(t,n),f=a.get(c);if(f){jt(e,n,f);return}var p=o?o(i,c,n+"",e,t,a):void 0,u=p===void 0;if(u){var l=j(c),h=!l&&Re(c),b=!l&&!h&&_t(c);p=c,l||h||b?j(i)?p=i:Ft(i)?p=En(i):h?(u=!1,p=er(c,!0)):b?(u=!1,p=dr(c,!0)):p=[]:F(c)||xe(c)?(p=i,xe(i)?p=Mu(i):(!J(i)||ft(i))&&(p=pr(c))):u=!1}u&&(a.set(c,p),s(p,c,r,o,a),a.delete(c)),jt(e,n,p)}function Tr(e,t,n,r,s){e!==t&&Au(t,function(o,a){if(s||(s=new W),J(o))Iu(e,t,a,n,Tr,r,s);else{var i=r?r(Vt(e,a),o,a+"",e,t,s):void 0;i===void 0&&(i=o),jt(e,a,i)}},Le)}function Ar(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Pu(e,t){return t.length<2?e:Ze(e,Gn(t,0,-1))}function xu(e,t){return nt(e,t)}var Bt=io(function(e,t,n){Tr(e,t,n)}),Ru="Expected a function";function Du(e){if(typeof e!="function")throw new TypeError(Ru);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var Lu=Object.prototype,ju=Lu.hasOwnProperty;function Fu(e,t){t=Se(t,e);var n=-1,r=t.length;if(!r)return!0;for(var s=e==null||typeof e!="object"&&typeof e!="function";++n<r;){var o=t[n];if(typeof o=="string"){if(o==="__proto__"&&!ju.call(e,"__proto__"))return!1;if(o==="constructor"&&n+1<r&&typeof t[n+1]=="string"&&t[n+1]==="prototype"){if(s&&n===0)continue;return!1}}}var a=Pu(e,t);return a==null||delete a[$e(Ar(t))]}function Vu(e){return F(e)?void 0:e}var Bu=1,Uu=2,Gu=4,Mr=xa(function(e,t){var n={};if(e==null)return n;var r=!1;t=ut(t,function(o){return o=Se(o,e),r||(r=o.length>1),o}),be(e,Mt(e),n),r&&(n=Ve(n,Bu|Uu|Gu,Vu));for(var s=t.length;s--;)Fu(n,t[s]);return n});function Hu(e,t,n,r){if(!J(e))return e;t=Se(t,e);for(var s=-1,o=t.length,a=o-1,i=e;i!=null&&++s<o;){var c=$e(t[s]),f=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(s!=a){var p=i[c];f=void 0,f===void 0&&(f=J(p)?p:We(t[s+1])?[]:{})}gt(i,c,f),i=i[c]}return e}function ku(e,t,n){for(var r=-1,s=t.length,o={};++r<s;){var a=t[r],i=Ze(e,a);n(i,a)&&Hu(o,Se(a,e),i)}return o}function qu(e,t){if(e==null)return{};var n=ut(Mt(e),function(r){return[r]});return t=Lt(t),ku(e,n,function(r,s){return t(r,s[0])})}function zu(e,t){return qu(e,Du(Lt(t)))}var Ju=1/0,Wu=Ce&&1/Rt(new Ce([,-0]))[1]==Ju?function(e){return new Ce(e)}:Gs,Yu=200;function Ku(e,t,n){var r=-1,s=eo,o=e.length,a=!0,i=[],c=i;if(o>=Yu){var f=t?null:Wu(e);if(f)return Rt(f);a=!1,s=_r,c=new Be}else c=t?[]:i;e:for(;++r<o;){var p=e[r],u=t?t(p):p;if(p=p!==0?p:0,a&&u===u){for(var l=c.length;l--;)if(c[l]===u)continue e;t&&c.push(u),i.push(p)}else s(c,u,n)||(c!==i&&c.push(u),i.push(p))}return i}var Qu=Tn(function(e){var t=Ar(e);return Ft(t)&&(t=void 0),Ku(Bn(e,1,Ft,!0),Lt(t))});const Ir=(e,t={keyListVar:"ALL_NODE_IDS",getReadValCode:""})=>{let n=e;return n[0]===String(Number(n[0]))&&(n=`_${n}`),`
|
|
2
|
+
var ${e} = {};
|
|
3
3
|
|
|
4
|
-
${
|
|
4
|
+
${t.keyListVar}.forEach(function (key) {
|
|
5
5
|
var tempK = /^\\d/.test(key) ? ('_' + key) : key;
|
|
6
|
-
Object.defineProperty(${
|
|
6
|
+
Object.defineProperty(${e}, tempK, {
|
|
7
7
|
get: function () {
|
|
8
|
-
${
|
|
8
|
+
${t.getReadValCode}
|
|
9
9
|
},
|
|
10
10
|
set: function (value) {},
|
|
11
11
|
enumerable: true
|
|
12
12
|
});
|
|
13
13
|
});
|
|
14
|
-
`},
|
|
14
|
+
`},Xu=function(e){return!(!e||typeof e!="function"||!e.prototype)};function Pr(e){const t=e==null?void 0:e.prototype;return!!(t&&t.isReactComponent)}function xr(e){var r,s;const n=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.forward_ref"):60112;return(e==null?void 0:e.$$typeof)===n||((r=e==null?void 0:e.prototype)==null?void 0:r.isReactComponent)||((s=e==null?void 0:e.prototype)==null?void 0:s.setState)||e._forwardRef}function Rr(e){class t extends N.Component{render(){return N.createElement(e,this.props)}}return t.displayName=e.displayName,t}const fe=(e,t)=>{const n=r=>{let s=`function run () { return ${r}; }`;return String(r).includes("return ")&&(s=`function runExp () { ${r} }`),Ee({funcBody:s,funcName:"run",nodeContext:t.nodeContext,storeManager:t.storeManager,nodeModel:t.nodeModel})()};try{return n(e)}catch(r){console.warn(r);const s=`[${e}] expression run failed`;return console.warn(s),null}},Ee=e=>{const{funcBody:t,funcName:n,nodeContext:r,storeManager:s,$$response:o,nodeModel:a,actionVariableSpace:i}=e,c=n||"anonymous";return{[c]:function(...p){let u;const h=Object.keys(i||{}).map(b=>`var ${b} = $ACTION_VAR_SPACE[${JSON.stringify(b)}];`);try{return u=`
|
|
15
15
|
var $$$__args__$$$ = Array.from(arguments);
|
|
16
16
|
function $$_run_$$() {
|
|
17
17
|
var __extraParams = $$$__args__$$$.pop();
|
|
@@ -28,7 +28,7 @@ ${e.keyListVar}.forEach(function (key) {
|
|
|
28
28
|
|
|
29
29
|
var $ACTION_VAR_SPACE = __extraParams.actionVariableSpace;
|
|
30
30
|
// 新增的变量
|
|
31
|
-
var $N_ID = ${JSON.stringify(
|
|
31
|
+
var $N_ID = ${JSON.stringify(a.id)};
|
|
32
32
|
var $NODE_MODAL = __extraParams.nodeModel;
|
|
33
33
|
var $IDS = $ALL_NODE_IDS.reduce(function (res, id) {
|
|
34
34
|
res[id] = id;
|
|
@@ -40,43 +40,43 @@ ${e.keyListVar}.forEach(function (key) {
|
|
|
40
40
|
var $LOOP_DATA = $CTX.loopData;
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
${
|
|
43
|
+
${Ir("$ALL_STATE",{keyListVar:"$ALL_NODE_IDS ",getReadValCode:"return __$$storeManager__.getState(key);"})}
|
|
44
44
|
|
|
45
|
-
${
|
|
45
|
+
${Ir("$U_STATE",{keyListVar:"$ALL_NODE_IDS ",getReadValCode:"return function (newVal) { __$$storeManager__.setState(key, newVal); }"})}
|
|
46
46
|
|
|
47
47
|
$$context.stateManager = __$$storeManager__.getStateSnapshot();
|
|
48
48
|
// action flowACTION_VAR_SPACE 中定义的变量
|
|
49
49
|
${h.join(`;
|
|
50
50
|
`)}
|
|
51
51
|
|
|
52
|
-
var $$_f_$$ = ${
|
|
52
|
+
var $$_f_$$ = ${t.trim()||"function () {}"};
|
|
53
53
|
|
|
54
54
|
return $$_f_$$.apply($$_f_$$, $$$__args__$$$);
|
|
55
55
|
}
|
|
56
56
|
return $$_run_$$();
|
|
57
|
-
`,new Function(f)(...d,{$$context:n,storeManager:o,$$response:a,actionVariableSpace:i,nodeModel:s})}catch(m){console.warn(m)}}}[c]},Ye=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},ro=(t=[])=>{const e={};return t.forEach(({property:r,value:n})=>{let o=r.replace("-webkit","Webkit");o=o.replace("-ms","ms"),o=o.replace("-moz","Moz"),o=o.replace("-o","O");let a=o.split("-");a.length>=2&&(a=a.map((s,i)=>i!==0?Ic(s):s)),e[a.join("")]=n}),e},Gu=t=>{let e="";return Object.keys(t||{}).forEach(r=>{e+=`${r}:${t[r]};`}),e},zu=(t,e)=>{const r={};return t.forEach(n=>{if(n.globalName){const o=e[n.globalName];o&&(r[n.globalName]=o,o.__esModule&&o.default&&(r[n.globalName]=o.default))}}),r},ku=(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},no=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},oo=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},Hu=(t,e)=>oo(t,e),Wu=(t,e)=>oo(t,e),Xe=t=>{var r;return((r=t.value.css)==null?void 0:r.class)||`c_${t.id}`},ao=(t,e)=>{const r=t.split(".");let n,o=e;return r.forEach(a=>{n=o==null?void 0:o[a],o=n}),n||(()=>`Component [${t}] not found`)},Ze=(t,e)=>{const r={...t};return r.__proto__=e,r},Ju={},so=t=>{let e;const r=new Set,n=(d,f)=>{const l=typeof d=="function"?d(e):d;if(!Object.is(l,e)){const h=e;e=f??(typeof l!="object"||l===null)?l:Object.assign({},e,l),r.forEach(m=>m(e,h))}},o=()=>e,c={setState:n,getState:o,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(Ju?"production":void 0)!=="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()}},u=e=t(n,o,c);return c},qu=t=>t?so(t):so;class Ku{constructor(){$(this,"storeMap",new Map)}addStore(e,r){const n=qu(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 Qu{constructor(){$(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 tr{constructor(){$(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()}}var Yu=Object.defineProperty,Xu=(t,e,r)=>e in t?Yu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e,r)=>Xu(t,typeof e!="symbol"?e+"":e,r),io=typeof global=="object"&&global&&global.Object===Object&&global,Zu=typeof self=="object"&&self&&self.Object===Object&&self,Z=io||Zu||Function("return this")(),W=Z.Symbol,co=Object.prototype,tl=co.hasOwnProperty,el=co.toString,Yt=W?W.toStringTag:void 0;function rl(t){var e=tl.call(t,Yt),r=t[Yt];try{t[Yt]=void 0;var n=!0}catch{}var o=el.call(t);return n&&(e?t[Yt]=r:delete t[Yt]),o}var nl=Object.prototype,ol=nl.toString;function al(t){return ol.call(t)}var sl="[object Null]",il="[object Undefined]",uo=W?W.toStringTag:void 0;function Ot(t){return t==null?t===void 0?il:sl:uo&&uo in Object(t)?rl(t):al(t)}function tt(t){return t!=null&&typeof t=="object"}var cl="[object Symbol]";function er(t){return typeof t=="symbol"||tt(t)&&Ot(t)==cl}function rr(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 V=Array.isArray,lo=W?W.prototype:void 0,fo=lo?lo.toString:void 0;function po(t){if(typeof t=="string")return t;if(V(t))return rr(t,po)+"";if(er(t))return fo?fo.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function q(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function nr(t){return t}var ul="[object AsyncFunction]",ll="[object Function]",fl="[object GeneratorFunction]",dl="[object Proxy]";function or(t){if(!q(t))return!1;var e=Ot(t);return e==ll||e==fl||e==ul||e==dl}var ar=Z["__core-js_shared__"],ho=function(){var t=/[^.]+$/.exec(ar&&ar.keys&&ar.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function pl(t){return!!ho&&ho in t}var hl=Function.prototype,gl=hl.toString;function Ct(t){if(t!=null){try{return gl.call(t)}catch{}try{return t+""}catch{}}return""}var ml=/[\\^$.*+?()[\]{}|]/g,vl=/^\[object .+?Constructor\]$/,yl=Function.prototype,bl=Object.prototype,_l=yl.toString,Sl=bl.hasOwnProperty,Ol=RegExp("^"+_l.call(Sl).replace(ml,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Cl(t){if(!q(t)||pl(t))return!1;var e=or(t)?Ol:vl;return e.test(Ct(t))}function El(t,e){return t==null?void 0:t[e]}function Et(t,e){var r=El(t,e);return Cl(r)?r:void 0}var sr=Et(Z,"WeakMap"),go=Object.create,$l=function(){function t(){}return function(e){if(!q(e))return{};if(go)return go(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function wl(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 Nl(){}function mo(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var jl=800,Al=16,Tl=Date.now;function Ml(t){var e=0,r=0;return function(){var n=Tl(),o=Al-(n-r);if(r=n,o>0){if(++e>=jl)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Pl(t){return function(){return t}}var Se=function(){try{var t=Et(Object,"defineProperty");return t({},"",{}),t}catch{}}(),xl=Se?function(t,e){return Se(t,"toString",{configurable:!0,enumerable:!1,value:Pl(e),writable:!0})}:nr,vo=Ml(xl);function Il(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function Rl(t,e,r,n){for(var o=t.length,a=r+-1;++a<o;)if(e(t[a],a,t))return a;return-1}function Dl(t){return t!==t}function Ll(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function Vl(t,e,r){return e===e?Ll(t,e,r):Rl(t,Dl,r)}function Fl(t,e){var r=t==null?0:t.length;return!!r&&Vl(t,e,0)>-1}var Ul=9007199254740991,Bl=/^(?:0|[1-9]\d*)$/;function Oe(t,e){var r=typeof t;return e=e??Ul,!!e&&(r=="number"||r!="symbol"&&Bl.test(t))&&t>-1&&t%1==0&&t<e}function ir(t,e,r){e=="__proto__"&&Se?Se(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Xt(t,e){return t===e||t!==t&&e!==e}var Gl=Object.prototype,zl=Gl.hasOwnProperty;function cr(t,e,r){var n=t[e];(!(zl.call(t,e)&&Xt(n,r))||r===void 0&&!(e in t))&&ir(t,e,r)}function Rt(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=void 0;c===void 0&&(c=t[i]),o?ir(r,i,c):cr(r,i,c)}return r}var yo=Math.max;function bo(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),wl(t,this,i)}}function _o(t,e){return vo(bo(t,e,nr),t+"")}var kl=9007199254740991;function ur(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=kl}function Ce(t){return t!=null&&ur(t.length)&&!or(t)}function Hl(t,e,r){if(!q(r))return!1;var n=typeof e;return(n=="number"?Ce(r)&&Oe(e,r.length):n=="string"&&e in r)?Xt(r[e],t):!1}function Wl(t){return _o(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&&Hl(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 Jl=Object.prototype;function lr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Jl;return t===r}function ql(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Kl="[object Arguments]";function So(t){return tt(t)&&Ot(t)==Kl}var Oo=Object.prototype,Ql=Oo.hasOwnProperty,Yl=Oo.propertyIsEnumerable,Zt=So(function(){return arguments}())?So:function(t){return tt(t)&&Ql.call(t,"callee")&&!Yl.call(t,"callee")};function Xl(){return!1}var Co=typeof C=="object"&&C&&!C.nodeType&&C,Eo=Co&&typeof module=="object"&&module&&!module.nodeType&&module,Zl=Eo&&Eo.exports===Co,$o=Zl?Z.Buffer:void 0,tf=$o?$o.isBuffer:void 0,te=tf||Xl,ef="[object Arguments]",rf="[object Array]",nf="[object Boolean]",of="[object Date]",af="[object Error]",sf="[object Function]",cf="[object Map]",uf="[object Number]",lf="[object Object]",ff="[object RegExp]",df="[object Set]",pf="[object String]",hf="[object WeakMap]",gf="[object ArrayBuffer]",mf="[object DataView]",vf="[object Float32Array]",yf="[object Float64Array]",bf="[object Int8Array]",_f="[object Int16Array]",Sf="[object Int32Array]",Of="[object Uint8Array]",Cf="[object Uint8ClampedArray]",Ef="[object Uint16Array]",$f="[object Uint32Array]",R={};R[vf]=R[yf]=R[bf]=R[_f]=R[Sf]=R[Of]=R[Cf]=R[Ef]=R[$f]=!0,R[ef]=R[rf]=R[gf]=R[nf]=R[mf]=R[of]=R[af]=R[sf]=R[cf]=R[uf]=R[lf]=R[ff]=R[df]=R[pf]=R[hf]=!1;function wf(t){return tt(t)&&ur(t.length)&&!!R[Ot(t)]}function fr(t){return function(e){return t(e)}}var wo=typeof C=="object"&&C&&!C.nodeType&&C,ee=wo&&typeof module=="object"&&module&&!module.nodeType&&module,Nf=ee&&ee.exports===wo,dr=Nf&&io.process,Dt=function(){try{var t=ee&&ee.require&&ee.require("util").types;return t||dr&&dr.binding&&dr.binding("util")}catch{}}(),No=Dt&&Dt.isTypedArray,pr=No?fr(No):wf,jf=Object.prototype,Af=jf.hasOwnProperty;function jo(t,e){var r=V(t),n=!r&&Zt(t),o=!r&&!n&&te(t),a=!r&&!n&&!o&&pr(t),s=r||n||o||a,i=s?ql(t.length,String):[],c=i.length;for(var u in t)(e||Af.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Oe(u,c)))&&i.push(u);return i}function Ao(t,e){return function(r){return t(e(r))}}var Tf=Ao(Object.keys,Object),Mf=Object.prototype,Pf=Mf.hasOwnProperty;function xf(t){if(!lr(t))return Tf(t);var e=[];for(var r in Object(t))Pf.call(t,r)&&r!="constructor"&&e.push(r);return e}function Ee(t){return Ce(t)?jo(t):xf(t)}function If(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Rf=Object.prototype,Df=Rf.hasOwnProperty;function Lf(t){if(!q(t))return If(t);var e=lr(t),r=[];for(var n in t)n=="constructor"&&(e||!Df.call(t,n))||r.push(n);return r}function re(t){return Ce(t)?jo(t,!0):Lf(t)}var Vf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ff=/^\w*$/;function hr(t,e){if(V(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||er(t)?!0:Ff.test(t)||!Vf.test(t)||e!=null&&t in Object(e)}var ne=Et(Object,"create");function Uf(){this.__data__=ne?ne(null):{},this.size=0}function Bf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Gf="__lodash_hash_undefined__",zf=Object.prototype,kf=zf.hasOwnProperty;function Hf(t){var e=this.__data__;if(ne){var r=e[t];return r===Gf?void 0:r}return kf.call(e,t)?e[t]:void 0}var Wf=Object.prototype,Jf=Wf.hasOwnProperty;function qf(t){var e=this.__data__;return ne?e[t]!==void 0:Jf.call(e,t)}var Kf="__lodash_hash_undefined__";function Qf(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ne&&e===void 0?Kf:e,this}function $t(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])}}$t.prototype.clear=Uf,$t.prototype.delete=Bf,$t.prototype.get=Hf,$t.prototype.has=qf,$t.prototype.set=Qf;function Yf(){this.__data__=[],this.size=0}function $e(t,e){for(var r=t.length;r--;)if(Xt(t[r][0],e))return r;return-1}var Xf=Array.prototype,Zf=Xf.splice;function td(t){var e=this.__data__,r=$e(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Zf.call(e,r,1),--this.size,!0}function ed(t){var e=this.__data__,r=$e(e,t);return r<0?void 0:e[r][1]}function rd(t){return $e(this.__data__,t)>-1}function nd(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 st(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])}}st.prototype.clear=Yf,st.prototype.delete=td,st.prototype.get=ed,st.prototype.has=rd,st.prototype.set=nd;var oe=Et(Z,"Map");function od(){this.size=0,this.__data__={hash:new $t,map:new(oe||st),string:new $t}}function ad(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function we(t,e){var r=t.__data__;return ad(e)?r[typeof e=="string"?"string":"hash"]:r.map}function sd(t){var e=we(this,t).delete(t);return this.size-=e?1:0,e}function id(t){return we(this,t).get(t)}function cd(t){return we(this,t).has(t)}function ud(t,e){var r=we(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function it(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}it.prototype.clear=od,it.prototype.delete=sd,it.prototype.get=id,it.prototype.has=cd,it.prototype.set=ud;var ld="Expected a function";function gr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(ld);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=t.apply(this,n);return r.cache=a.set(o,s)||a,s};return r.cache=new(gr.Cache||it),r}gr.Cache=it;var fd=500;function dd(t){var e=gr(t,function(n){return r.size===fd&&r.clear(),n}),r=e.cache;return e}var pd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hd=/\\(\\)?/g,gd=dd(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(pd,function(r,n,o,a){e.push(o?a.replace(hd,"$1"):n||r)}),e});function md(t){return t==null?"":po(t)}function Lt(t,e){return V(t)?t:hr(t,e)?[t]:gd(md(t))}function Vt(t){if(typeof t=="string"||er(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Ne(t,e){e=Lt(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Vt(e[r++])];return r&&r==n?t:void 0}function To(t,e,r){var n=t==null?void 0:Ne(t,e);return n===void 0?r:n}function mr(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var Mo=W?W.isConcatSpreadable:void 0;function vd(t){return V(t)||Zt(t)||!!(Mo&&t&&t[Mo])}function Po(t,e,r,n,o){var a=-1,s=t.length;for(r||(r=vd),o||(o=[]);++a<s;){var i=t[a];r(i)?mr(o,i):n||(o[o.length]=i)}return o}function yd(t){var e=t==null?0:t.length;return e?Po(t):[]}function bd(t){return vo(bo(t,void 0,yd),t+"")}var vr=Ao(Object.getPrototypeOf,Object),_d="[object Object]",Sd=Function.prototype,Od=Object.prototype,xo=Sd.toString,Cd=Od.hasOwnProperty,Ed=xo.call(Object);function U(t){if(!tt(t)||Ot(t)!=_d)return!1;var e=vr(t);if(e===null)return!0;var r=Cd.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&xo.call(r)==Ed}function $d(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 wd(){this.__data__=new st,this.size=0}function Nd(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function jd(t){return this.__data__.get(t)}function Ad(t){return this.__data__.has(t)}var Td=200;function Md(t,e){var r=this.__data__;if(r instanceof st){var n=r.__data__;if(!oe||n.length<Td-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new it(n)}return r.set(t,e),this.size=r.size,this}function K(t){var e=this.__data__=new st(t);this.size=e.size}K.prototype.clear=wd,K.prototype.delete=Nd,K.prototype.get=jd,K.prototype.has=Ad,K.prototype.set=Md;function Pd(t,e){return t&&Rt(e,Ee(e),t)}function xd(t,e){return t&&Rt(e,re(e),t)}var Io=typeof C=="object"&&C&&!C.nodeType&&C,Ro=Io&&typeof module=="object"&&module&&!module.nodeType&&module,Id=Ro&&Ro.exports===Io,Do=Id?Z.Buffer:void 0,Lo=Do?Do.allocUnsafe:void 0;function Vo(t,e){if(e)return t.slice();var r=t.length,n=Lo?Lo(r):new t.constructor(r);return t.copy(n),n}function Rd(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 Fo(){return[]}var Dd=Object.prototype,Ld=Dd.propertyIsEnumerable,Uo=Object.getOwnPropertySymbols,yr=Uo?function(t){return t==null?[]:(t=Object(t),Rd(Uo(t),function(e){return Ld.call(t,e)}))}:Fo;function Vd(t,e){return Rt(t,yr(t),e)}var Fd=Object.getOwnPropertySymbols,Bo=Fd?function(t){for(var e=[];t;)mr(e,yr(t)),t=vr(t);return e}:Fo;function Ud(t,e){return Rt(t,Bo(t),e)}function Go(t,e,r){var n=e(t);return V(t)?n:mr(n,r(t))}function br(t){return Go(t,Ee,yr)}function _r(t){return Go(t,re,Bo)}var Sr=Et(Z,"DataView"),Or=Et(Z,"Promise"),Ft=Et(Z,"Set"),zo="[object Map]",Bd="[object Object]",ko="[object Promise]",Ho="[object Set]",Wo="[object WeakMap]",Jo="[object DataView]",Gd=Ct(Sr),zd=Ct(oe),kd=Ct(Or),Hd=Ct(Ft),Wd=Ct(sr),Q=Ot;(Sr&&Q(new Sr(new ArrayBuffer(1)))!=Jo||oe&&Q(new oe)!=zo||Or&&Q(Or.resolve())!=ko||Ft&&Q(new Ft)!=Ho||sr&&Q(new sr)!=Wo)&&(Q=function(t){var e=Ot(t),r=e==Bd?t.constructor:void 0,n=r?Ct(r):"";if(n)switch(n){case Gd:return Jo;case zd:return zo;case kd:return ko;case Hd:return Ho;case Wd:return Wo}return e});var Jd=Object.prototype,qd=Jd.hasOwnProperty;function Kd(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&qd.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var je=Z.Uint8Array;function Cr(t){var e=new t.constructor(t.byteLength);return new je(e).set(new je(t)),e}function Qd(t,e){var r=e?Cr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Yd=/\w*$/;function Xd(t){var e=new t.constructor(t.source,Yd.exec(t));return e.lastIndex=t.lastIndex,e}var qo=W?W.prototype:void 0,Ko=qo?qo.valueOf:void 0;function Zd(t){return Ko?Object(Ko.call(t)):{}}function Qo(t,e){var r=e?Cr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var tp="[object Boolean]",ep="[object Date]",rp="[object Map]",np="[object Number]",op="[object RegExp]",ap="[object Set]",sp="[object String]",ip="[object Symbol]",cp="[object ArrayBuffer]",up="[object DataView]",lp="[object Float32Array]",fp="[object Float64Array]",dp="[object Int8Array]",pp="[object Int16Array]",hp="[object Int32Array]",gp="[object Uint8Array]",mp="[object Uint8ClampedArray]",vp="[object Uint16Array]",yp="[object Uint32Array]";function bp(t,e,r){var n=t.constructor;switch(e){case cp:return Cr(t);case tp:case ep:return new n(+t);case up:return Qd(t,r);case lp:case fp:case dp:case pp:case hp:case gp:case mp:case vp:case yp:return Qo(t,r);case rp:return new n;case np:case sp:return new n(t);case op:return Xd(t);case ap:return new n;case ip:return Zd(t)}}function Yo(t){return typeof t.constructor=="function"&&!lr(t)?$l(vr(t)):{}}var _p="[object Map]";function Sp(t){return tt(t)&&Q(t)==_p}var Xo=Dt&&Dt.isMap,Op=Xo?fr(Xo):Sp,Cp="[object Set]";function Ep(t){return tt(t)&&Q(t)==Cp}var Zo=Dt&&Dt.isSet,$p=Zo?fr(Zo):Ep,wp=1,Np=2,jp=4,ta="[object Arguments]",Ap="[object Array]",Tp="[object Boolean]",Mp="[object Date]",Pp="[object Error]",ea="[object Function]",xp="[object GeneratorFunction]",Ip="[object Map]",Rp="[object Number]",ra="[object Object]",Dp="[object RegExp]",Lp="[object Set]",Vp="[object String]",Fp="[object Symbol]",Up="[object WeakMap]",Bp="[object ArrayBuffer]",Gp="[object DataView]",zp="[object Float32Array]",kp="[object Float64Array]",Hp="[object Int8Array]",Wp="[object Int16Array]",Jp="[object Int32Array]",qp="[object Uint8Array]",Kp="[object Uint8ClampedArray]",Qp="[object Uint16Array]",Yp="[object Uint32Array]",x={};x[ta]=x[Ap]=x[Bp]=x[Gp]=x[Tp]=x[Mp]=x[zp]=x[kp]=x[Hp]=x[Wp]=x[Jp]=x[Ip]=x[Rp]=x[ra]=x[Dp]=x[Lp]=x[Vp]=x[Fp]=x[qp]=x[Kp]=x[Qp]=x[Yp]=!0,x[Pp]=x[ea]=x[Up]=!1;function ae(t,e,r,n,o,a){var s,i=e&wp,c=e&Np,u=e&jp;if(r&&(s=o?r(t,n,o,a):r(t)),s!==void 0)return s;if(!q(t))return t;var d=V(t);if(d){if(s=Kd(t),!i)return mo(t,s)}else{var f=Q(t),l=f==ea||f==xp;if(te(t))return Vo(t,i);if(f==ra||f==ta||l&&!o){if(s=c||l?{}:Yo(t),!i)return c?Ud(t,xd(s,t)):Vd(t,Pd(s,t))}else{if(!x[f])return o?t:{};s=bp(t,f,i)}}a||(a=new K);var h=a.get(t);if(h)return h;a.set(t,s),$p(t)?t.forEach(function(p){s.add(ae(p,e,r,p,t,a))}):Op(t)&&t.forEach(function(p,g){s.set(g,ae(p,e,r,g,t,a))});var m=u?c?_r:br:c?re:Ee,_=d?void 0:m(t);return Il(_||t,function(p,g){_&&(g=p,p=t[g]),cr(s,g,ae(p,e,r,g,t,a))}),s}var Xp=1,Zp=4;function na(t){return ae(t,Xp|Zp)}var th="__lodash_hash_undefined__";function eh(t){return this.__data__.set(t,th),this}function rh(t){return this.__data__.has(t)}function se(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new it;++e<r;)this.add(t[e])}se.prototype.add=se.prototype.push=eh,se.prototype.has=rh;function nh(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 oa(t,e){return t.has(e)}var oh=1,ah=2;function aa(t,e,r,n,o,a){var s=r&oh,i=t.length,c=e.length;if(i!=c&&!(s&&c>i))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var f=-1,l=!0,h=r&ah?new se:void 0;for(a.set(t,e),a.set(e,t);++f<i;){var m=t[f],_=e[f];if(n)var p=s?n(_,m,f,e,t,a):n(m,_,f,t,e,a);if(p!==void 0){if(p)continue;l=!1;break}if(h){if(!nh(e,function(g,v){if(!oa(h,v)&&(m===g||o(m,g,r,n,a)))return h.push(v)})){l=!1;break}}else if(!(m===_||o(m,_,r,n,a))){l=!1;break}}return a.delete(t),a.delete(e),l}function sh(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function Er(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var ih=1,ch=2,uh="[object Boolean]",lh="[object Date]",fh="[object Error]",dh="[object Map]",ph="[object Number]",hh="[object RegExp]",gh="[object Set]",mh="[object String]",vh="[object Symbol]",yh="[object ArrayBuffer]",bh="[object DataView]",sa=W?W.prototype:void 0,$r=sa?sa.valueOf:void 0;function _h(t,e,r,n,o,a,s){switch(r){case bh:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case yh:return!(t.byteLength!=e.byteLength||!a(new je(t),new je(e)));case uh:case lh:case ph:return Xt(+t,+e);case fh:return t.name==e.name&&t.message==e.message;case hh:case mh:return t==e+"";case dh:var i=sh;case gh:var c=n&ih;if(i||(i=Er),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=ch,s.set(t,e);var d=aa(i(t),i(e),n,o,a,s);return s.delete(t),d;case vh:if($r)return $r.call(t)==$r.call(e)}return!1}var Sh=1,Oh=Object.prototype,Ch=Oh.hasOwnProperty;function Eh(t,e,r,n,o,a){var s=r&Sh,i=br(t),c=i.length,u=br(e),d=u.length;if(c!=d&&!s)return!1;for(var f=c;f--;){var l=i[f];if(!(s?l in e:Ch.call(e,l)))return!1}var h=a.get(t),m=a.get(e);if(h&&m)return h==e&&m==t;var _=!0;a.set(t,e),a.set(e,t);for(var p=s;++f<c;){l=i[f];var g=t[l],v=e[l];if(n)var b=s?n(v,g,l,e,t,a):n(g,v,l,t,e,a);if(!(b===void 0?g===v||o(g,v,r,n,a):b)){_=!1;break}p||(p=l=="constructor")}if(_&&!p){var y=t.constructor,S=e.constructor;y!=S&&"constructor"in t&&"constructor"in e&&!(typeof y=="function"&&y instanceof y&&typeof S=="function"&&S instanceof S)&&(_=!1)}return a.delete(t),a.delete(e),_}var $h=1,ia="[object Arguments]",ca="[object Array]",Ae="[object Object]",wh=Object.prototype,ua=wh.hasOwnProperty;function Nh(t,e,r,n,o,a){var s=V(t),i=V(e),c=s?ca:Q(t),u=i?ca:Q(e);c=c==ia?Ae:c,u=u==ia?Ae:u;var d=c==Ae,f=u==Ae,l=c==u;if(l&&te(t)){if(!te(e))return!1;s=!0,d=!1}if(l&&!d)return a||(a=new K),s||pr(t)?aa(t,e,r,n,o,a):_h(t,e,c,r,n,o,a);if(!(r&$h)){var h=d&&ua.call(t,"__wrapped__"),m=f&&ua.call(e,"__wrapped__");if(h||m){var _=h?t.value():t,p=m?e.value():e;return a||(a=new K),o(_,p,r,n,a)}}return l?(a||(a=new K),Eh(t,e,r,n,o,a)):!1}function wr(t,e,r,n,o){return t===e?!0:t==null||e==null||!tt(t)&&!tt(e)?t!==t&&e!==e:Nh(t,e,r,n,wr,o)}var jh=1,Ah=2;function Th(t,e,r,n){var o=r.length,a=o;if(t==null)return!a;for(t=Object(t);o--;){var s=r[o];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<a;){s=r[o];var i=s[0],c=t[i],u=s[1];if(s[2]){if(c===void 0&&!(i in t))return!1}else{var d=new K,f;if(!(f===void 0?wr(u,c,jh|Ah,n,d):f))return!1}}return!0}function la(t){return t===t&&!q(t)}function Mh(t){for(var e=Ee(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,la(o)]}return e}function fa(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Ph(t){var e=Mh(t);return e.length==1&&e[0][2]?fa(e[0][0],e[0][1]):function(r){return r===t||Th(r,t,e)}}function xh(t,e){return t!=null&&e in Object(t)}function Ih(t,e,r){e=Lt(e,t);for(var n=-1,o=e.length,a=!1;++n<o;){var s=Vt(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&&ur(o)&&Oe(s,o)&&(V(t)||Zt(t)))}function Rh(t,e){return t!=null&&Ih(t,e,xh)}var Dh=1,Lh=2;function Vh(t,e){return hr(t)&&la(e)?fa(Vt(t),e):function(r){var n=To(r,t);return n===void 0&&n===e?Rh(r,t):wr(e,n,Dh|Lh)}}function Fh(t){return function(e){return e==null?void 0:e[t]}}function Uh(t){return function(e){return Ne(e,t)}}function Bh(t){return hr(t)?Fh(Vt(t)):Uh(t)}function Nr(t){return typeof t=="function"?t:t==null?nr:typeof t=="object"?V(t)?Vh(t[0],t[1]):Ph(t):Bh(t)}function Gh(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[++o];if(r(a[c],c,a)===!1)break}return e}}var zh=Gh();function jr(t,e,r){(r!==void 0&&!Xt(t[e],r)||r===void 0&&!(e in t))&&ir(t,e,r)}function Ar(t){return tt(t)&&Ce(t)}function Tr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function kh(t){return Rt(t,re(t))}function Hh(t,e,r,n,o,a,s){var i=Tr(t,r),c=Tr(e,r),u=s.get(c);if(u){jr(t,r,u);return}var d=a?a(i,c,r+"",t,e,s):void 0,f=d===void 0;if(f){var l=V(c),h=!l&&te(c),m=!l&&!h&&pr(c);d=c,l||h||m?V(i)?d=i:Ar(i)?d=mo(i):h?(f=!1,d=Vo(c,!0)):m?(f=!1,d=Qo(c,!0)):d=[]:U(c)||Zt(c)?(d=i,Zt(i)?d=kh(i):(!q(i)||or(i))&&(d=Yo(c))):f=!1}f&&(s.set(c,d),o(d,c,n,a,s),s.delete(c)),jr(t,r,d)}function da(t,e,r,n,o){t!==e&&zh(e,function(a,s){if(o||(o=new K),q(a))Hh(t,e,s,r,da,n,o);else{var i=n?n(Tr(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),jr(t,s,i)}},re)}function pa(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Wh(t,e){return e.length<2?t:Ne(t,$d(e,0,-1))}var ha=Wl(function(t,e,r){da(t,e,r)}),Jh="Expected a function";function qh(t){if(typeof t!="function")throw new TypeError(Jh);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 Kh(t,e){return e=Lt(e,t),t=Wh(t,e),t==null||delete t[Vt(pa(e))]}function Qh(t){return U(t)?void 0:t}var Yh=1,Xh=2,Zh=4,ga=bd(function(t,e){var r={};if(t==null)return r;var n=!1;e=rr(e,function(a){return a=Lt(a,t),n||(n=a.length>1),a}),Rt(t,_r(t),r),n&&(r=ae(r,Yh|Xh|Zh,Qh));for(var o=e.length;o--;)Kh(r,e[o]);return r});function tg(t,e,r,n){if(!q(t))return t;e=Lt(e,t);for(var o=-1,a=e.length,s=a-1,i=t;i!=null&&++o<a;){var c=Vt(e[o]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(o!=s){var d=i[c];u=void 0,u===void 0&&(u=q(d)?d:Oe(e[o+1])?[]:{})}cr(i,c,u),i=i[c]}return t}function eg(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var s=e[n],i=Ne(t,s);r(i,s)&&tg(a,Lt(s,t),i)}return a}function rg(t,e){if(t==null)return{};var r=rr(_r(t),function(n){return[n]});return e=Nr(e),eg(t,r,function(n,o){return e(n,o[0])})}function ng(t,e){return rg(t,qh(Nr(e)))}var og=1/0,ag=Ft&&1/Er(new Ft([,-0]))[1]==og?function(t){return new Ft(t)}:Nl,sg=200;function ig(t,e,r){var n=-1,o=Fl,a=t.length,s=!0,i=[],c=i;if(a>=sg){var u=e?null:ag(t);if(u)return Er(u);s=!1,o=oa,c=new se}else c=e?[]:i;t:for(;++n<a;){var d=t[n],f=e?e(d):d;if(d=d!==0?d:0,s&&f===f){for(var l=c.length;l--;)if(c[l]===f)continue t;e&&c.push(f),i.push(d)}else o(c,f,r)||(c!==i&&c.push(f),i.push(d))}return i}var cg=_o(function(t){var e=pa(t);return Ar(e)&&(e=void 0),ig(Po(t,1,Ar,!0),Nr(e))});class ma extends TypeError{constructor(e,r){let n;const{message:o,...a}=e,{path:s}=e,i=s.length===0?o:`At path: ${s.join(".")} -- ${o}`;super(i),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function ug(t){return Y(t)&&typeof t[Symbol.iterator]=="function"}function Y(t){return typeof t=="object"&&t!=null}function z(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function lg(t){const{done:e,value:r}=t.next();return e?void 0:r}function fg(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: \`${z(n)}\``}=t;return{value:n,type:s,refinement:i,key:o[o.length-1],path:o,branch:a,...t,message:c}}function*va(t,e,r,n){ug(t)||(t=[t]);for(const o of t){const a=fg(o,e,r,n);a&&(yield a)}}function*Mr(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"&&Y(e.schema)&&Y(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,d,f]of e.entries(t,i)){const l=Mr(d,f,{path:u===void 0?n:[...n,u],branch:u===void 0?o:[...o,d],coerce:a,mask:s});for(const h of l)h[0]?(c=h[0].refinement!=null?"not_refined":"not_valid",yield[h[0],void 0]):a&&(d=h[1],u===void 0?t=d:t instanceof Map?t.set(u,d):t instanceof Set?t.add(d):Y(t)&&(d!==void 0||u in t)&&(t[u]=d))}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 et{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 d=o(c,u);return va(d,u,this,c)}:this.validator=()=>[],a?this.refiner=(c,u)=>{const d=a(c,u);return va(d,u,this,c)}:this.refiner=()=>[]}assert(e){return ya(e,this)}create(e){return dg(e,this)}is(e){return hg(e,this)}mask(e){return pg(e,this)}validate(e,r){return r===void 0&&(r={}),Ut(e,this,r)}}function ya(t,e){const r=Ut(t,e);if(r[0])throw r[0]}function dg(t,e){const r=Ut(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function pg(t,e){const r=Ut(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function hg(t,e){return!Ut(t,e)[0]}function Ut(t,e,r){r===void 0&&(r={});const n=Mr(t,e,r),o=lg(n);return o[0]?[new ma(o[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,o[1]]}function Pr(){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?Oa(a):M(a)}function pt(t,e){return new et({type:t,schema:null,validator:e})}function Bt(t){return new et({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 ba(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return Oa(n);default:return M(n)}}function P(){return pt("any",()=>!0)}function D(t){return new et({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: ${z(e)}`}})}function wt(){return pt("boolean",t=>typeof t=="boolean")}function xr(t){const e={},r=t.map(n=>z(n)).join();for(const n of t)e[n]=n;return new et({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${z(n)}`}})}function _a(){return pt("func",t=>typeof t=="function"||`Expected a function, but received: ${z(t)}`)}function k(t){const e=z(t),r=typeof t;return new et({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${z(n)}`}})}function gg(){return pt("never",()=>!1)}function Sa(){return pt("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${z(t)}`)}function M(t){const e=t?Object.keys(t):[],r=gg();return new et({type:"object",schema:t||null,*entries(n){if(t&&Y(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 Y(n)||`Expected an object, but received: ${z(n)}`},coercer(n){return Y(n)?{...n}:n}})}function O(t){return new et({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function ie(t,e){return new et({type:"record",schema:null,*entries(r){if(Y(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return Y(r)||`Expected an object, but received: ${z(r)}`}})}function E(){return pt("string",t=>typeof t=="string"||`Expected a string, but received: ${z(t)}`)}function Oa(t){const e=Object.keys(t);return new et({type:"type",schema:t,*entries(r){if(Y(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return Y(r)||`Expected an object, but received: ${z(r)}`}})}function H(t){const e=t.map(r=>r.type).join(" | ");return new et({type:"union",schema:null,coercer(r,n){return(t.find(o=>{const[a]=o.validate(r,{coerce:!0});return!a})||mg()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...s]=Mr(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: ${z(r)}`,...o]}})}function mg(){return pt("unknown",()=>!0)}const Ir=M({package:E(),version:E(),name:E(),exportName:O(E()),destructuring:O(wt()),subName:O(E()),main:O(E()),cssPaths:O(D(E()))}),vg=D(Ir);var B=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t.ACTION="ACTION",t.EVENT="EVENT",t))(B||{}),Rr=(t=>(t.DESIGN="design",t.SAVE="save",t))(Rr||{}),Dr=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(Dr||{});const yg=()=>pt("normalObj",t=>!U(t)||[B.SLOT,B.EXPRESSION,B.FUNCTION].includes(t==null?void 0:t.type)?!1:(Ut(t,ie(E(),Lr)),!0)),Lr=H([E(),Sa(),wt(),M({type:k(B.SLOT),renderType:xr([Dr.FUNC,Dr.COMP]),params:O(D(E())),value:Bt(()=>H([Gt,D(Gt)]))}),M({type:k(B.EXPRESSION),value:E()}),M({type:k(B.FUNCTION),value:E()}),M({type:k(B.ACTION),handler:P()}),yg(),D(Bt(()=>Lr))]);var Ca=(t=>(t.COMPONENTS="COMPONENTS",t))(Ca||{});const Ea=M({type:k(B.EXPRESSION),value:E()}),Gt=M({id:O(E()),title:O(E()),componentName:E(),props:O(ie(E(),Lr)),nodeName:O(E()),state:O(ie(E(),P())),children:Bt(()=>O(D(H([E(),Gt])))),eventListener:O(D(P())),configure:O(P()),css:O(P()),style:O(P()),classNames:O(D(P())),refId:O(E()),extra:O(ie(P(),P())),condition:O(H([wt(),Ea])),loop:O(M({open:wt(),data:H([D(P()),Ea]),args:O(D(E())),forName:O(E()),forIndex:O(E()),key:O(P()),name:O(E())})),injectEnvList:O(D(P())),methods:O(D(P()))}),Te=H([E(),M({label:E(),tip:O(E())})]),bg=M({type:k("shape"),value:D(M({name:E(),title:Te,valueType:Bt(()=>Me)}))}),_g=M({type:k("enums"),value:D(E())});M({type:k("array"),value:Bt(()=>Me)});const Sg=M({type:k("array"),value:Bt(()=>D(Me))}),Me=H([xr(["array","boolean","number","object","string"]),xr(["component","expression","function"]),bg,_g,Sg]),Og=H([E(),M({componentName:E(),props:O(P()),initialValue:O(P()),component:O(P()),hiddenLabel:O(wt())})]),Vr=M({name:E(),title:Te,valueType:Me,description:O(E()),defaultValue:P(),setters:O(D(Og)),condition:O(_a())});H([E(),_a()]);var Fr=(t=>(t.SINGLE="single",t.GROUP="group",t))(Fr||{});H([E(),M({event:E(),name:O(E()),describe:O(E()),params:O(D(M({name:E(),description:E(),example:E()}))),template:O(E())})]);const Cg=M({id:O(E()),title:E(),snapshot:H([E(),P()]),snapshotText:O(E()),description:O(E()),tags:O(D(E())),groupName:O(E()),category:O(E()),schema:Pr(ba(Gt,["id"]),M({componentName:O(E())}))}),Eg=M({componentName:E(),title:E(),screenshot:O(E()),icon:O(E()),tags:O(D(E())),groupName:O(E()),category:O(E()),priority:O(Sa()),npm:O(Ir),snippets:D(Cg),props:D(H([Vr,M({title:O(Te),type:k("single"),content:Vr}),M({title:O(Te),type:k("group"),content:D(Vr)})])),events:O(P()),methods:O(P()),fixedProps:O(P()),isContainer:O(H([wt(),M({placeholder:E(),width:E(),height:E()})])),disableEditorDragDom:O(P()),isLayout:O(wt()),rootSelector:O(E()),advanceCustom:O(P()),extra:O(ie(P(),P()))}),$g=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}
|
|
58
|
-
originData: ${JSON.stringify(
|
|
59
|
-
data struct format is invalidate`);return
|
|
60
|
-
originData: ${JSON.stringify(
|
|
61
|
-
data struct format is invalidate`),
|
|
62
|
-
`)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var ct=(t=>(t.ROOT_CONTAINER="RootContainer",t))(ct||{});const wg=M({type:k(B.FUNCTION),value:E()}),Ng=Pr(ba(Gt,["componentName"]),M({componentName:k("RootContainer")}));function jg(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(o){o(r)}),(n=t.get("*"))&&n.slice().map(function(o){o(e,r)})}}}const ce=jg(),Ag=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new kt([]);return e&&(o=e.materialsMode||new kt([])),n&&(V(n)?r.value=n.map(a=>new L(a,{parent:e,materials:o})):U(n)&&r.value.push(new L(n,{parent:e,materials:o}))),r};class zt{constructor(e,r){j(this,"nodeType","SLOT"),j(this,"rawData"),j(this,"parent"),j(this,"emitter",ce),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 kt([]);this.materialsMode=n,this.id=rt(),this.data=Ag(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof L)return o.export(e);if(U(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return V(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const $a=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===Fr.SINGLE?e.push(n.content):n.type===Fr.GROUP&&(e=[...e,...$a(n.content)]):e.push(r)}),e},Br=(t,e,r)=>{if(t.type)return t.type===B.SLOT?new zt(t,{parent:e,materials:r}):t;if(U(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=Gr(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>Br(n,e,r)):t},Gr=(t,e,r)=>U(t)?Br(t,e,r):V(t)?t.map(n=>Br(n,e,r)):t;class ht{constructor(e,r,n){j(this,"nodeType","PROP"),j(this,"rawData"),j(this,"parent"),j(this,"emitter",ce),j(this,"data"),j(this,"name"),j(this,"materialsMode");const o=(n==null?void 0:n.materials)||new kt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=Gr(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=Gr(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof zt)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof L){const r=e.material;return $a((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 ht||o instanceof zt||o instanceof L)return o.export(e);if(V(o))return o.map(a=>n(a));if(U(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return o};return n(r)}}const Tg=t=>{if(typeof t=="string")return!0;Ur({data:t,dataStruct:Gt,throwError:!1})},wa=(t,e,r)=>{if(typeof t=="string")return t;const n={...t,id:t.id??rt(),children:[],props:{},methods:t.methods||[],configure:ha(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 ht){n.props[a]=i;return}n.props[a]=new ht(a,i,{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof L)return a;if(U(a)){const s=a;return new L(s,{parent:e,materials:r})}else return a}):(t.children instanceof L&&(n.children=[t.children]),n.children=[new L(t.children,{parent:e,materials:r})])),n};class L{constructor(e,r){j(this,"nodeType","NODE"),j(this,"rawData"),j(this,"data"),j(this,"emitter",ce),j(this,"parent"),j(this,"materialsModel"),j(this,"listenerHandler"),j(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Tg(e);const n=(r==null?void 0:r.materials)||new kt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=wa(e,this,n),this.listenerHandler=[],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.listenerHandler.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}destroy(){this.listenerHandler.forEach(e=>e())}get id(){return this.data.id}get value(){return this.data}clone(e){const r={...this.export("design"),id:e||rt()};return new L(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=wa(r,this,this.materialsModel),r}updateValue(e){const r=this.data,n=this.updateWithPlainObj(e);this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return Hr(this,e)}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e){var r;const n=this.data;if(typeof n=="string")return n;const o={};Object.keys(n.props||{}).forEach(f=>{o[f]=n.props[f].export(e)});const a=(r=n.children)==null?void 0:r.map(f=>f instanceof L?f.export(e):f),s=n.configure||{},i=s.propsSetter||{},c={};Object.keys(i).forEach(f=>{const l=To(i,f,!1);l&&(c[f]=l)}),s.propsSetter=c;const u=this.materialsModel.usedMaterials.find(f=>{var l;return f.componentName===((l=this.material)==null?void 0:l.componentName)});this.material&&!u&&this.materialsModel.usedMaterials.push(this.material);let d={...n,configure:s,props:o,children:a,condition:n.condition,extra:this.data.extra};return e==="design"&&delete d.id,d=kr(d),d}}const Na=(t,e,r)=>{const n={...t,id:rt(),props:{},componentName:ct.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:ha(t.configure||{},{propsSetter:{},advanceSetter:{}}),injectEnvList:t.injectEnvList};let o=[];V(t.children)?o=t.children.map(s=>s instanceof L?s:U(s)?new L(s,{parent:e,materials:r}):s):t.children instanceof L?o.push(t.children):t.children&&U(t.children)&&o.push(new L(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 ht?n.props[s]=c:n.props[s]=new ht(s,c||"",{parent:e,materials:r})}),n.children=o,n};class ue{constructor(e,{parent:r,materials:n}){j(this,"rawData"),j(this,"data"),j(this,"nodeType",ct.ROOT_CONTAINER),j(this,"emitter",ce),j(this,"materialsModel"),j(this,"listenerHandler"),j(this,"onChangeCbQueue"),j(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=Na(e,this,n),this.listenerHandler=[],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.listenerHandler.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=Na(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 Hr(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=Rr.SAVE){var r;const n=this.data,o={};Object.keys(n.props||{}).forEach(c=>{o[c]=n.props[c].export(e)});const a=((r=n.children)==null?void 0:r.map(c=>{var u;return(u=c==null?void 0:c.export)==null?void 0:u.call(c,e)}))||[],s={...n,props:o,children:a.filter(c=>c),condition:n.condition,extra:this.data.extra};let i=ga(s,["id"]);return i=kr(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.listenerHandler.forEach(e=>e())}clone(e){const r={...this.export("design"),id:e||rt()};return new ue(r,{materials:this.materialsModel,parent:null})}}const Nt=t=>(t==null?void 0:t.type)===B.EXPRESSION,ja=t=>(t==null?void 0:t.type)===B.FUNCTION,Mg=t=>(t==null?void 0:t.type)===B.ACTION,rt=()=>Math.random().toString(32).slice(3,9),Pg=t=>(t==null?void 0:t.nodeType)==="NODE",zr=t=>(t==null?void 0:t.nodeType)==="PROP",xg=t=>(t==null?void 0:t.nodeType)==="SLOT",kr=t=>ng(t,e=>U(e)?!Object.keys(e).length:V(e)?!e.length:e==null);function Ig(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 L){r.push(i);return}if(i instanceof zt&&a(i.value.value),i instanceof ht){a(i.value);return}if(U(i)){const c=i;Object.keys(c).forEach(u=>{a(c[u])});return}if(V(i)){i.forEach(c=>{a(c)});return}};a(o);const s=(n==null?void 0:n.value.children.filter(i=>i instanceof L))||[];r.push(...s)}}function Hr(t,e){return Ig(t,r=>r.id===e)}const Rg=t=>{const e=na(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${rt()}`,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 Dg{constructor(e){j(this,"rawData"),j(this,"data"),this.rawData=e,this.data=Rg(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 Wr=t=>{if(!V(t))throw new Error("Materials must be a array");return t.map(e=>new Dg(e))},Lg=t=>{t==null||t.forEach(e=>{Ur({data:e,dataStruct:Eg,throwError:!1})})};class kt{constructor(e){j(this,"rawData"),j(this,"data"),j(this,"usedMaterials",[]),this.rawData=e,Lg(e),this.data=Wr(e)}addMaterials(e){const r=Wr(e),n=[],o=this.data.map(s=>{const i=r.findIndex(c=>c.componentName===s.componentName);return i>=0?(n.push(i),r[i]):s}),a=r.filter((s,i)=>!n.includes(i));this.data=[...o,...a]}replaceMaterials(e){const r=Wr(e);this.data=[...r]}removeMaterial(e){const r=this.data.filter(n=>!e.includes(n.componentName));this.data=r}findByComponentName(e){return this.data.find(r=>r.componentName===e)}findSnippetById(e){const r=[...this.data];let n=null;for(;!n&&r.length;){const o=r.pop();n=o==null?void 0:o.getSnippetById(e)}return n}getAllSnippets(){const e=this.data.reduce((a,s)=>(a.push(...s.snippets),a),[]),r=[],n={default:[]};e.forEach(a=>{const s=a.groupName||"default";r.includes(s)||(r.push(s),n[s]=[]),n[s].push(a)});let o=[];return r.forEach(a=>{const s=["default"],i={default:[]},c=n[a];if(c.length!==0){c.forEach(f=>{const l=f.category||"default";s.includes(l)||(s.push(l),i[l]=[]),i[l].push(f)});const u=[];s.forEach(f=>{i[f].length&&u.push({name:f,list:i[f]})});const d={name:a,list:u};o.push(d)}}),o=o.sort((a,s)=>(a.name||"")>(s.name||"")?1:-1),o}get value(){return this.data}get rawValue(){return this.rawData}}const Vg=M({version:O(E()),name:O(E()),css:O(E()),lifecycle:O(P()),props:O(P()),methods:O(D(wg)),componentsMeta:D(Pr(M({componentName:E()}),Ir)),thirdLibs:O(vg),componentsTree:Ng,assets:O(D(P())),extra:O(P())}),Aa=t=>(Ur({data:t,dataStruct:Vg,throwError:!1}),t),Jr=(t,e,r)=>({...t,componentsTree:new ue(t.componentsTree,{parent:e,materials:r})});class Pe{constructor(e,r){j(this,"nodeType","PAGE"),j(this,"rawData"),j(this,"emitter",ce),j(this,"data"),j(this,"parent"),j(this,"materialsModel"),j(this,"assetPackagesList"),Aa(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new kt((r==null?void 0:r.materials)||[]),this.data=Jr(e,this,this.materialsModel),this.assetPackagesList=[...(r==null?void 0:r.assetPackagesList)||[],...this.data.assets||[]]}updatePage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=Jr(e,this,this.materialsModel),this.emitter.emit("onPageChange",{value:this.data,preValue:r,node:this})}reloadPage(e){const r=this.data;e&&(this.rawData=JSON.parse(JSON.stringify(e)),this.data=Jr(e,this,this.materialsModel)),this.emitter.emit("onReloadPage",{value:this.data,preValue:r,node:this})}get value(){return this.data}getNode(e){if(!e)return;const r=this.data.componentsTree;return Hr(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof ue)return console.warn("Not found parent node"),!1;if(a instanceof ht)return console.warn("CProp can not add node"),!1;if(a instanceof zt){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 Pe)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(U(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 L(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=rt();const n=new L(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 L?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 L&&a instanceof L?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 zt){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 L||n instanceof ue){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=Rr.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],s=this.materialsModel.usedMaterials.map(c=>{const u=o.find(d=>{var f;return d.package===((f=c.value.npm)==null?void 0:f.package)});return u&&a.push(u),{componentName:c.componentName,...na(c.value.npm||{})}}).filter(c=>c.componentName&&c.package&&c.version?!0:(console.warn(`${JSON.stringify(c,null,2)} not a valid material info`),!1));this.materialsModel.usedMaterials=[];let i={...this.data,componentsTree:kr(n),componentsMeta:s,thirdLibs:this.data.thirdLibs,assets:[],extra:this.data.extra};return(r=this.data.thirdLibs)==null||r.forEach(c=>{const u=o.find(d=>c.package===d.package);u&&a.push(u)}),i.assets=cg(a,c=>c.package),i=ga(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}ct.ROOT_CONTAINER;const le="DYNAMIC",Ta=["$$context","$$nodeModel"],qr="ON_DID_RENDER",Kr="ON_WILL_DESTROY",Ma=[qr,Kr],Qr=(t,e)=>{let r=t;return e&&(r={...t},r.__proto__=e||null),r},fe=(t,e={},...r)=>typeof t=="string"||typeof t=="number"?String(t):(Ta.forEach(o=>{o in e&&t.__CP_TYPE__!==le&&delete e[o]}),w.createElement(t,e,...r)),Pa=(t={},e)=>{const r=[],n=(o,a)=>{let s=a;zr(a)&&(s=a.value),e(s)?r.push({keyPath:o,val:s}):nt(s)?s.forEach((i,c)=>{n([...o,String(c)],i)}):xt(s)&&Object.keys(s).forEach(i=>{n([...o,i],s[i])})};return n(["$root"],t),r},Ht=(t,e)=>{const r=t.handler,{context:n,storeManager:o}=e;return e.actionVariableSpace||(e.actionVariableSpace={}),async function(...a){const s={},i=async d=>{const f=d;if(f.type==="RUN_CODE"){const l=It({funcName:"",funcBody:`function() {
|
|
63
|
-
${
|
|
64
|
-
}`,nodeContext:
|
|
57
|
+
`,new Function(u)(...p,{$$context:r,storeManager:s,$$response:o,actionVariableSpace:i,nodeModel:a})}catch(b){console.warn(b)}}}[c]},Ut=(e,t)=>{const n={};return t.forEach((r,s)=>{n[r]=e[s]}),n},Dr=(e=[])=>{const t={};return e.forEach(({property:n,value:r})=>{let s=n.replace("-webkit","Webkit");s=s.replace("-ms","ms"),s=s.replace("-moz","Moz"),s=s.replace("-o","O");let o=s.split("-");o.length>=2&&(o=o.map((a,i)=>i!==0?fi(a):a)),t[o.join("")]=r}),t},Zu=e=>{let t="";return Object.keys(e||{}).forEach(n=>{t+=`${n}:${e[n]};`}),t},el=(e,t)=>{const n={};return e.forEach(r=>{if(r.globalName){const s=t[r.globalName];s&&(n[r.globalName]=s,s.__esModule&&s.default&&(n[r.globalName]=s.default))}}),n},tl=(e,t=1)=>{let n=0,r=e,s={},o={};for(;n<t;)Object.keys(r).forEach(a=>{s={...s,...r[a]}}),o=s,r=s,s={},n+=1;return o},Lr=(e,t)=>{const n=[];return t.forEach(r=>{const o=r.exec(e);o!=null&&o.length&&n.push(o[1])}),n},jr=(e,t)=>{const n={};return t.forEach(r=>{e[r.name]&&(n[r.name]=e[r.name])}),n},nl=(e,t)=>jr(e,t),rl=(e,t)=>jr(e,t),Gt=e=>{var n;return((n=e.value.css)==null?void 0:n.class)||`c_${e.id}`},Fr=(e,t)=>{const n=e.split(".");let r,s=t;return n.forEach(o=>{r=s==null?void 0:s[o],s=r}),r||(()=>`Component [${e}] not found`)},Ht=(e,t)=>{const n={...e};return n.__proto__=t,n},sl={},Vr=e=>{let t;const n=new Set,r=(p,u)=>{const l=typeof p=="function"?p(t):p;if(!Object.is(l,t)){const h=t;t=u??(typeof l!="object"||l===null)?l:Object.assign({},t,l),n.forEach(b=>b(t,h))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>f,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(sl?"production":void 0)!=="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."),n.clear()}},f=t=e(r,s,c);return c},ol=e=>e?Vr(e):Vr;class al{constructor(){E(this,"storeMap",new Map)}addStore(t,n){const r=ol(n);return this.storeMap.set(t,r),r.name=t,r}setStore(t,n){this.storeMap.set(t,n)}removeStore(t){this.storeMap.delete(t)}getStore(t){return this.storeMap.get(t)}getState(t){var n;return(n=this.storeMap.get(t))==null?void 0:n.getState()}getStateObj(t){return{state:this.getState(t),updateState:n=>{this.setState(t,n)}}}setState(t,n){var r;return(r=this.storeMap.get(t))==null?void 0:r.setState(n)}connect(t,n){const r=this.storeMap.get(t);return r?r.subscribe(n):(console.warn("store not exits"),()=>{})}getStateSnapshot(){const t={};return this.storeMap.forEach((n,r)=>{t[r]=this.getStateObj(r)}),t}destroy(){this.storeMap=new Map}}class il{constructor(){E(this,"varSpace",new Map)}get(t){return this.varSpace.get(t)}add(t,n){this.varSpace.set(t,n)}remove(t){this.varSpace.delete(t)}destroy(){this.varSpace.clear()}getStateSnapshot(){const t={};return this.varSpace.forEach((n,r)=>{t[r]=n}),t}}class kt{constructor(){E(this,"refMap",new Map)}get(t){return this.refMap.get(t)}add(t,n){this.refMap.set(t,n)}remove(t){this.refMap.delete(t)}destroy(){this.refMap.clear()}}class Br extends TypeError{constructor(t,n){let r;const{message:s,...o}=t,{path:a}=t,i=a.length===0?s:`At path: ${a.join(".")} -- ${s}`;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,o),this.name=this.constructor.name,this.failures=()=>r??(r=[t,...n()])}}function cl(e){return K(e)&&typeof e[Symbol.iterator]=="function"}function K(e){return typeof e=="object"&&e!=null}function G(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function ul(e){const{done:t,value:n}=e.next();return t?void 0:n}function ll(e,t,n,r){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:s,branch:o}=t,{type:a}=n,{refinement:i,message:c=`Expected a value of type \`${a}\`${i?` with refinement \`${i}\``:""}, but received: \`${G(r)}\``}=e;return{value:r,type:a,refinement:i,key:s[s.length-1],path:s,branch:o,...e,message:c}}function*Ur(e,t,n,r){cl(e)||(e=[e]);for(const s of e){const o=ll(s,t,n,r);o&&(yield o)}}function*qt(e,t,n){n===void 0&&(n={});const{path:r=[],branch:s=[e],coerce:o=!1,mask:a=!1}=n,i={path:r,branch:s};if(o&&(e=t.coercer(e,i),a&&t.type!=="type"&&K(t.schema)&&K(e)&&!Array.isArray(e)))for(const f in e)t.schema[f]===void 0&&delete e[f];let c="valid";for(const f of t.validator(e,i))c="not_valid",yield[f,void 0];for(let[f,p,u]of t.entries(e,i)){const l=qt(p,u,{path:f===void 0?r:[...r,f],branch:f===void 0?s:[...s,p],coerce:o,mask:a});for(const h of l)h[0]?(c=h[0].refinement!=null?"not_refined":"not_valid",yield[h[0],void 0]):o&&(p=h[1],f===void 0?e=p:e instanceof Map?e.set(f,p):e instanceof Set?e.add(p):K(e)&&(p!==void 0||f in e)&&(e[f]=p))}if(c!=="not_valid")for(const f of t.refiner(e,i))c="not_refined",yield[f,void 0];c==="valid"&&(yield[void 0,e])}class Z{constructor(t){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:n,schema:r,validator:s,refiner:o,coercer:a=c=>c,entries:i=function*(){}}=t;this.type=n,this.schema=r,this.entries=i,this.coercer=a,s?this.validator=(c,f)=>{const p=s(c,f);return Ur(p,f,this,c)}:this.validator=()=>[],o?this.refiner=(c,f)=>{const p=o(c,f);return Ur(p,f,this,c)}:this.refiner=()=>[]}assert(t){return Gr(t,this)}create(t){return fl(t,this)}is(t){return pl(t,this)}mask(t){return dl(t,this)}validate(t,n){return n===void 0&&(n={}),Oe(t,this,n)}}function Gr(e,t){const n=Oe(e,t);if(n[0])throw n[0]}function fl(e,t){const n=Oe(e,t,{coerce:!0});if(n[0])throw n[0];return n[1]}function dl(e,t){const n=Oe(e,t,{coerce:!0,mask:!0});if(n[0])throw n[0];return n[1]}function pl(e,t){return!Oe(e,t)[0]}function Oe(e,t,n){n===void 0&&(n={});const r=qt(e,t,n),s=ul(r);return s[0]?[new Br(s[0],function*(){for(const a of r)a[0]&&(yield a[0])}),void 0]:[void 0,s[1]]}function zt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t[0].type==="type",s=t.map(a=>a.schema),o=Object.assign({},...s);return r?zr(o):I(o)}function oe(e,t){return new Z({type:e,schema:null,validator:t})}function Ne(e){return new Z({type:"dynamic",schema:null,*entries(t,n){yield*e(t,n).entries(t,n)},validator(t,n){return e(t,n).validator(t,n)},coercer(t,n){return e(t,n).coercer(t,n)},refiner(t,n){return e(t,n).refiner(t,n)}})}function Hr(e,t){const{schema:n}=e,r={...n};for(const s of t)delete r[s];switch(e.type){case"type":return zr(r);default:return I(r)}}function P(){return oe("any",()=>!0)}function D(e){return new Z({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${G(t)}`}})}function de(){return oe("boolean",e=>typeof e=="boolean")}function Jt(e){const t={},n=e.map(r=>G(r)).join();for(const r of e)t[r]=r;return new Z({type:"enums",schema:t,validator(r){return e.includes(r)||`Expected one of \`${n}\`, but received: ${G(r)}`}})}function kr(){return oe("func",e=>typeof e=="function"||`Expected a function, but received: ${G(e)}`)}function H(e){const t=G(e),n=typeof e;return new Z({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?e:null,validator(r){return r===e||`Expected the literal \`${t}\`, but received: ${G(r)}`}})}function hl(){return oe("never",()=>!1)}function qr(){return oe("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${G(e)}`)}function I(e){const t=e?Object.keys(e):[],n=hl();return new Z({type:"object",schema:e||null,*entries(r){if(e&&K(r)){const s=new Set(Object.keys(r));for(const o of t)s.delete(o),yield[o,r[o],e[o]];for(const o of s)yield[o,r[o],n]}},validator(r){return K(r)||`Expected an object, but received: ${G(r)}`},coercer(r){return K(r)?{...r}:r}})}function _(e){return new Z({...e,validator:(t,n)=>t===void 0||e.validator(t,n),refiner:(t,n)=>t===void 0||e.refiner(t,n)})}function Ue(e,t){return new Z({type:"record",schema:null,*entries(n){if(K(n))for(const r in n){const s=n[r];yield[r,r,e],yield[r,s,t]}},validator(n){return K(n)||`Expected an object, but received: ${G(n)}`}})}function $(){return oe("string",e=>typeof e=="string"||`Expected a string, but received: ${G(e)}`)}function zr(e){const t=Object.keys(e);return new Z({type:"type",schema:e,*entries(n){if(K(n))for(const r of t)yield[r,n[r],e[r]]},validator(n){return K(n)||`Expected an object, but received: ${G(n)}`}})}function k(e){const t=e.map(n=>n.type).join(" | ");return new Z({type:"union",schema:null,coercer(n,r){return(e.find(o=>{const[a]=o.validate(n,{coerce:!0});return!a})||gl()).coercer(n,r)},validator(n,r){const s=[];for(const o of e){const[...a]=qt(n,o,r),[i]=a;if(i[0])for(const[c]of a)c&&s.push(c);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${G(n)}`,...s]}})}function gl(){return oe("unknown",()=>!0)}const ml=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"];function yl(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(s){s(n)}),(r=e.get("*"))&&r.slice().map(function(s){s(t,n)})}}}var vl=Object.defineProperty,bl=(e,t,n)=>t in e?vl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t,n)=>bl(e,typeof t!="symbol"?t+"":t,n);const Wt=I({package:$(),version:$(),name:$(),exportName:_($()),destructuring:_(de()),subName:_($()),main:_($()),cssPaths:_(D($()))}),_l=D(Wt);var B=(e=>(e.SLOT="SLOT",e.FUNCTION="FUNCTION",e.EXPRESSION="EXPRESSION",e.ACTION="ACTION",e.EVENT="EVENT",e))(B||{}),Yt=(e=>(e.DESIGN="design",e.SAVE="save",e))(Yt||{}),Kt=(e=>(e.FUNC="FUNC",e.COMP="COMP",e))(Kt||{});const Sl=()=>oe("normalObj",e=>!F(e)||[B.SLOT,B.EXPRESSION,B.FUNCTION].includes(e==null?void 0:e.type)?!1:(Oe(e,Ue($(),Qt)),!0)),Qt=k([$(),qr(),de(),I({type:H(B.SLOT),renderType:Jt([Kt.FUNC,Kt.COMP]),params:_(D($())),value:Ne(()=>k([we,D(we)]))}),I({type:H(B.EXPRESSION),value:$()}),I({type:H(B.FUNCTION),value:$()}),I({type:H(B.ACTION),handler:P()}),Sl(),D(Ne(()=>Qt))]);var Jr=(e=>(e.COMPONENTS="COMPONENTS",e))(Jr||{});const Wr=I({type:H(B.EXPRESSION),value:$()}),we=I({id:_($()),title:_($()),componentName:$(),props:_(Ue($(),Qt)),nodeName:_($()),state:_(Ue($(),P())),children:Ne(()=>_(D(k([$(),we])))),eventListener:_(D(P())),configure:_(P()),css:_(P()),style:_(P()),classNames:_(D(P())),refId:_($()),extra:_(Ue(P(),P())),condition:_(k([de(),Wr])),loop:_(I({open:de(),data:k([D(P()),Wr]),args:_(D($())),forName:_($()),forIndex:_($()),key:_(P()),name:_($())})),injectEnvList:_(D(P())),methods:_(D(P()))}),rt=k([$(),I({label:$(),tip:_($())})]),$l=I({type:H("shape"),value:D(I({name:$(),title:rt,valueType:Ne(()=>st)}))}),Cl=I({type:H("enums"),value:D($())});I({type:H("array"),value:Ne(()=>st)});const El=I({type:H("array"),value:Ne(()=>D(st))}),st=k([Jt(["array","boolean","number","object","string"]),Jt(["component","expression","function"]),$l,Cl,El]),Ol=k([$(),I({componentName:$(),props:_(P()),initialValue:_(P()),component:_(P()),hiddenLabel:_(de())})]),Xt=I({name:$(),title:rt,valueType:st,description:_($()),defaultValue:P(),setters:_(D(Ol)),condition:_(kr())});k([$(),kr()]);var Zt=(e=>(e.SINGLE="single",e.GROUP="group",e))(Zt||{});k([$(),I({event:$(),name:_($()),describe:_($()),params:_(D(I({name:$(),description:$(),example:$()}))),template:_($())})]);const Nl=I({id:_($()),title:$(),snapshot:k([$(),P()]),snapshotText:_($()),description:_($()),tags:_(D($())),groupName:_($()),category:_($()),schema:zt(Hr(we,["id"]),I({componentName:_($())}))}),wl=I({componentName:$(),title:$(),screenshot:_($()),icon:_($()),tags:_(D($())),groupName:_($()),category:_($()),priority:_(qr()),npm:_(Wt),snippets:D(Nl),props:D(k([Xt,I({title:_(rt),type:H("single"),content:Xt}),I({title:_(rt),type:H("group"),content:D(Xt)})])),events:_(P()),methods:_(P()),fixedProps:_(P()),isContainer:_(k([de(),I({placeholder:$(),width:$(),height:$()})])),disableEditorDragDom:_(P()),isLayout:_(de()),rootSelector:_($()),advanceCustom:_(P()),extra:_(Ue(P(),P()))}),Tl=e=>({data:t,message:n,throwError:r})=>{const s=e({data:t,message:n,throwError:r});if(s.isValidate)return s;if(r)throw s.message||n?new Error(`${s.message||n}
|
|
58
|
+
originData: ${JSON.stringify(t)}`):new Error(`${JSON.stringify(t)}
|
|
59
|
+
data struct format is invalidate`);return s.message||n?console.warn(`${s.message||n}
|
|
60
|
+
originData: ${JSON.stringify(t)}`):console.warn(`${JSON.stringify(t)}
|
|
61
|
+
data struct format is invalidate`),s},en=e=>{const{data:t,message:n,throwError:r,dataStruct:s}=e;return Tl(({data:o})=>{try{return Gr(o,s),{isValidate:!0}}catch(a){let i=a;return a instanceof Br&&(i=a.failures().map(c=>`【${c.path.join(".")}】: ${c.message}
|
|
62
|
+
`)),{isValidate:!1,message:i,error:a}}})({data:t,message:n,throwError:r})};var re=(e=>(e.ROOT_CONTAINER="RootContainer",e))(re||{});const Al=I({type:H(B.FUNCTION),value:$()}),Ml=zt(Hr(we,["componentName"]),I({componentName:H("RootContainer")})),Ge=yl(),Il=(e,t)=>{const n={...e,value:[]},r=e.value;let s=new Ae([]);return t&&(s=t.materialsMode||new Ae([])),r&&(j(r)?n.value=r.map(o=>new L(o,{parent:t,materials:s})):F(r)&&n.value.push(new L(r,{parent:t,materials:s}))),n};class Te{constructor(t,n){T(this,"nodeType","SLOT"),T(this,"rawData"),T(this,"parent"),T(this,"emitter",Ge),T(this,"data"),T(this,"id"),T(this,"materialsMode"),this.parent=(n==null?void 0:n.parent)||null,this.rawData=t;const r=(n==null?void 0:n.materials)||new Ae([]);this.materialsMode=r,this.id=ee(),this.data=Il(t,this)}get value(){return this.data}export(t){const n=this.data,r=s=>{if(s instanceof L)return s.export(t);if(F(s)){const o={};return Object.keys(s||{}).forEach(a=>{o[a]=r(s[a])}),o}return j(s)?s.map(o=>r(o)):(t==="design"&&delete s.id,s)};return r(n)}}const Yr=e=>{let t=[];return e.forEach(n=>{const r=n;r.type?r.type===Zt.SINGLE?t.push(r.content):r.type===Zt.GROUP&&(t=[...t,...Yr(r.content)]):t.push(n)}),t},tn=(e,t,n)=>{if(e.type)return e.type===B.SLOT?new Te(e,{parent:t,materials:n}):e;if(F(e)){const r={};return Object.keys(e).forEach(s=>{r[s]=nn(e[s],t,n)}),r}else return Array.isArray(e)?e.map(r=>tn(r,t,n)):e},nn=(e,t,n)=>F(e)?tn(e,t,n):j(e)?e.map(r=>tn(r,t,n)):e;class ae{constructor(t,n,r){T(this,"nodeType","PROP"),T(this,"rawData"),T(this,"parent"),T(this,"emitter",Ge),T(this,"data"),T(this,"name"),T(this,"materialsMode");const s=(r==null?void 0:r.materials)||new Ae([]);this.materialsMode=s,this.parent=r==null?void 0:r.parent,this.rawData=n,this.name=t,this.data=nn(n,this,s)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(t){const n=this.data;this.data=nn(t??n,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:n,node:this}),this.parent&&!(this.parent instanceof Te)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const t=this.parent;if(t instanceof L){const n=t.material;return Yr((n==null?void 0:n.value.props)||[]).find(r=>r.name===this.name)}else return null}export(t){const n=this.data,r=s=>{if(s instanceof ae||s instanceof Te||s instanceof L)return s.export(t);if(j(s))return s.map(o=>r(o));if(F(s)){const o={};return Object.keys(s||{}).forEach(a=>{o[a]=r(s[a])}),o}return s};return r(n)}}const Pl=e=>{if(typeof e=="string")return!0;en({data:e,dataStruct:we,throwError:!1})},Kr=(e,t,n)=>{if(typeof e=="string")return e;const r={...e,id:e.id??ee(),children:[],props:{},methods:e.methods||[],configure:Bt(e.configure||{},{propsSetter:{},advanceSetter:{}})},s=Object.keys(e.props||{});return s.length&&s.forEach(o=>{var a;const i=(a=e.props)==null?void 0:a[o];if(i instanceof ae){r.props[o]=i;return}r.props[o]=new ae(o,i,{parent:t,materials:n})}),e.children&&(Array.isArray(e.children)?r.children=e.children.map(o=>{if(o instanceof L)return o;if(F(o)){const a=o;return new L(a,{parent:t,materials:n})}else return o}):(e.children instanceof L&&(r.children=[e.children]),r.children=[new L(e.children,{parent:t,materials:n})])),r};class L{constructor(t,n){T(this,"nodeType","NODE"),T(this,"rawData"),T(this,"data"),T(this,"emitter",Ge),T(this,"parent"),T(this,"materialsModel"),T(this,"listenerHandler"),T(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(t)),Pl(t);const r=(n==null?void 0:n.materials)||new Ae([]);this.parent=(n==null?void 0:n.parent)||null,this.materialsModel=r,this.data=Kr(t,this,r),this.listenerHandler=[],this.onChangeCbQueue=[],this.registerListener()}registerListener(){const t=n=>{const{node:r}=n;r===this&&r.id===this.id&&this.onChangeCbQueue.forEach(s=>s(n))};this.emitter.on("onNodeChange",t),this.listenerHandler.push(()=>{this.emitter.off("onNodeChange",t)})}onChange(t){return this.onChangeCbQueue.push(t),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(n=>n!==t)}}destroy(){this.listenerHandler.forEach(t=>t())}get id(){return this.data.id}get value(){return this.data}clone(t){const n={...this.export("design"),id:t||ee()};return new L(n,{materials:this.materialsModel})}updateWithPlainObj(t){const n={...this.data,...t};return this.data=Kr(n,this,this.materialsModel),n}updateValue(t){const n=this.data,r=this.updateWithPlainObj(t);this.emitter.emit("onNodeChange",{value:r,preValue:n,node:this})}contains(t){return on(this,t)}get props(){return this.data.props}get material(){const t=this.materialsModel;return t==null?void 0:t.findByComponentName(this.data.componentName)}getPlainProps(){const t=this.data,n={};return Object.keys(t.props||{}).forEach(r=>{n[r]=t.props[r].export("design")}),n}getMaterialConfig(t){var n;return this.data.configure[t]!==void 0?this.data.configure.isContainer:(n=this.material)==null?void 0:n.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(t){var n;const r=this.data;if(typeof r=="string")return r;const s={};Object.keys(r.props||{}).forEach(u=>{s[u]=r.props[u].export(t)});const o=(n=r.children)==null?void 0:n.map(u=>u instanceof L?u.export(t):u),a=r.configure||{},i=a.propsSetter||{},c={};Object.keys(i).forEach(u=>{const l=Fn(i,u,!1);l&&(c[u]=l)}),a.propsSetter=c;const f=this.materialsModel.usedMaterials.find(u=>{var l;return u.componentName===((l=this.material)==null?void 0:l.componentName)});this.material&&!f&&this.materialsModel.usedMaterials.push(this.material);let p={...r,configure:a,props:s,children:o,condition:r.condition,extra:this.data.extra};return t==="design"&&delete p.id,p=sn(p),p}}const Qr=(e,t,n)=>{const r={...e,id:ee(),props:{},componentName:re.ROOT_CONTAINER,children:[],methods:e.methods||[],configure:Bt(e.configure||{},{propsSetter:{},advanceSetter:{}}),injectEnvList:e.injectEnvList};let s=[];j(e.children)?s=e.children.map(a=>a instanceof L?a:F(a)?new L(a,{parent:t,materials:n}):a):e.children instanceof L?s.push(e.children):e.children&&F(e.children)&&s.push(new L(e.children,{parent:t,materials:n}));const o=Object.keys(e.props||{});return o.length&&o.forEach(a=>{var i;const c=(i=e.props)==null?void 0:i[a];c instanceof ae?r.props[a]=c:r.props[a]=new ae(a,c||"",{parent:t,materials:n})}),r.children=s,r};class He{constructor(t,{parent:n,materials:r}){T(this,"rawData"),T(this,"data"),T(this,"nodeType",re.ROOT_CONTAINER),T(this,"emitter",Ge),T(this,"materialsModel"),T(this,"listenerHandler"),T(this,"onChangeCbQueue"),T(this,"parent"),this.materialsModel=r,this.rawData=JSON.parse(JSON.stringify(t)),this.data=Qr(t,this,r),this.listenerHandler=[],this.onChangeCbQueue=[],this.registerListener(),this.parent=n}registerListener(){const t=n=>{const{node:r}=n;r===this&&r.id===this.id&&this.onChangeCbQueue.forEach(s=>s(n))};this.emitter.on("onNodeChange",t),this.listenerHandler.push(()=>{this.emitter.off("onNodeChange",t)})}onChange(t){return this.onChangeCbQueue.push(t),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(n=>n!==t)}}get id(){return this.data.id}get value(){return this.data}get props(){return this.data.props}get material(){const t=this.materialsModel;return t==null?void 0:t.findByComponentName(this.data.componentName)}updateWithPlainObj(t){const n={...this.data,...t};return this.data=Qr(n,this,this.materialsModel),n}updateValue(t){const n=this.data;this.updateWithPlainObj(t),this.emitter.emit("onNodeChange",{value:this.data,preValue:n,node:this})}contains(t){return on(this,t)}getMaterialConfig(t){var n;return this.data.configure[t]!==void 0?this.data.configure.isContainer:(n=this.material)==null?void 0:n.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(t=Yt.SAVE){var n;const r=this.data,s={};Object.keys(r.props||{}).forEach(c=>{s[c]=r.props[c].export(t)});const o=((n=r.children)==null?void 0:n.map(c=>{var f;return(f=c==null?void 0:c.export)==null?void 0:f.call(c,t)}))||[],a={...r,props:s,children:o.filter(c=>c),condition:r.condition,extra:this.data.extra};let i=Mr(a,["id"]);return i=sn(i),i}getPlainProps(){const t=this.data,n={};return Object.keys(t.props||{}).forEach(r=>{n[r]=t.props[r].export("design")}),n}destroy(){this.listenerHandler.forEach(t=>t())}clone(t){const n={...this.export("design"),id:t||ee()};return new He(n,{materials:this.materialsModel,parent:null})}}const pe=e=>(e==null?void 0:e.type)===B.EXPRESSION,Xr=e=>(e==null?void 0:e.type)===B.FUNCTION,xl=e=>(e==null?void 0:e.type)===B.ACTION,ee=()=>Math.random().toString(32).slice(3,9),Rl=e=>(e==null?void 0:e.nodeType)==="NODE",rn=e=>(e==null?void 0:e.nodeType)==="PROP",Dl=e=>(e==null?void 0:e.nodeType)==="SLOT",sn=e=>zu(e,t=>F(t)?!Object.keys(t).length:j(t)?!t.length:t==null);function Ll(e,t){const n=[e];for(;n.length;){const r=n.shift();if(r&&t(r))return r;const s=(r==null?void 0:r.props)||{},o=i=>{if(i instanceof L){n.push(i);return}if(i instanceof Te&&o(i.value.value),i instanceof ae){o(i.value);return}if(F(i)){const c=i;Object.keys(c).forEach(f=>{o(c[f])});return}if(j(i)){i.forEach(c=>{o(c)});return}};o(s);const a=(r==null?void 0:r.value.children.filter(i=>i instanceof L))||[];n.push(...a)}}function on(e,t){return Ll(e,n=>n.id===t)}const jl=e=>{const t=br(e),n=t.snippets;return delete t.snippets,t.snippets=n.map(r=>({...t,...r,id:r.id||`${e.componentName}-${ee()}`,title:r.title||e.title,category:r.category||e.category,tags:[...r.tags||[],...e.tags||[]],groupName:r.groupName||e.groupName,snapshot:r.snapshot||e.icon,snapshotText:r.snapshotText,schema:{...r.schema,componentName:r.schema.componentName||e.componentName}})),t};class Fl{constructor(t){T(this,"rawData"),T(this,"data"),this.rawData=t,this.data=jl(t)}get value(){return this.data}get rawValue(){return this.rawData}get componentName(){return this.data.componentName}get snippets(){return this.data.snippets}getSnippetById(t){return this.data.snippets.find(n=>n.id===t)}}const an=e=>{if(!j(e))throw new Error("Materials must be a array");return e.map(t=>new Fl(t))},Vl=e=>{e==null||e.forEach(t=>{en({data:t,dataStruct:wl,throwError:!1})})};class Ae{constructor(t){T(this,"rawData"),T(this,"data"),T(this,"usedMaterials",[]),this.rawData=t,Vl(t),this.data=an(t)}addMaterials(t){const n=an(t),r=[],s=this.data.map(a=>{const i=n.findIndex(c=>c.componentName===a.componentName);return i>=0?(r.push(i),n[i]):a}),o=n.filter((a,i)=>!r.includes(i));this.data=[...s,...o]}replaceMaterials(t){const n=an(t);this.data=[...n]}removeMaterial(t){const n=this.data.filter(r=>!t.includes(r.componentName));this.data=n}findByComponentName(t){return this.data.find(n=>n.componentName===t)}findSnippetById(t){const n=[...this.data];let r=null;for(;!r&&n.length;){const s=n.pop();r=s==null?void 0:s.getSnippetById(t)}return r}getAllSnippets(){const t=this.data.reduce((o,a)=>(o.push(...a.snippets),o),[]),n=[],r={default:[]};t.forEach(o=>{const a=o.groupName||"default";n.includes(a)||(n.push(a),r[a]=[]),r[a].push(o)});let s=[];return n.forEach(o=>{const a=["default"],i={default:[]},c=r[o];if(c.length!==0){c.forEach(u=>{const l=u.category||"default";a.includes(l)||(a.push(l),i[l]=[]),i[l].push(u)});const f=[];a.forEach(u=>{i[u].length&&f.push({name:u,list:i[u]})});const p={name:o,list:f};s.push(p)}}),s=s.sort((o,a)=>(o.name||"")>(a.name||"")?1:-1),s}get value(){return this.data}get rawValue(){return this.rawData}}const Bl=I({version:_($()),name:_($()),css:_($()),lifecycle:_(P()),props:_(P()),methods:_(D(Al)),componentsMeta:D(zt(I({componentName:$()}),Wt)),thirdLibs:_(_l),componentsTree:Ml,assets:_(D(P())),extra:_(P())}),Zr=e=>(en({data:e,dataStruct:Bl,throwError:!1}),e),cn=(e,t,n)=>({...e,componentsTree:new He(e.componentsTree,{parent:t,materials:n})});class ot{constructor(t,n){T(this,"nodeType","PAGE"),T(this,"rawData"),T(this,"emitter",Ge),T(this,"data"),T(this,"parent"),T(this,"materialsModel"),T(this,"assetPackagesList"),Zr(t),this.rawData=JSON.parse(JSON.stringify(t)),this.materialsModel=new Ae((n==null?void 0:n.materials)||[]),this.data=cn(t,this,this.materialsModel),this.assetPackagesList=[...(n==null?void 0:n.assetPackagesList)||[],...this.data.assets||[]]}updatePage(t){const n=this.data;this.rawData=JSON.parse(JSON.stringify(t)),this.data=cn(t,this,this.materialsModel),this.emitter.emit("onPageChange",{value:this.data,preValue:n,node:this})}reloadPage(t){const n=this.data;t&&(this.rawData=JSON.parse(JSON.stringify(t)),this.data=cn(t,this,this.materialsModel)),this.emitter.emit("onReloadPage",{value:this.data,preValue:n,node:this})}get value(){return this.data}getNode(t){if(!t)return;const n=this.data.componentsTree;return on(n,t)}addNode(t,n,r="AFTER"){var s;if(r==="AFTER"||r==="BEFORE"){const o=n.parent;if(o===null&&n instanceof He)return console.warn("Not found parent node"),!1;if(o instanceof ae)return console.warn("CProp can not add node"),!1;if(o instanceof Te){const i=o.value.value,c=i.findIndex(f=>f===n)??-1;return c>=0?(r==="BEFORE"?i.splice(c,0,t):i.splice(c+1,0,t),t.parent=o,(s=o.parent)==null||s.updateValue(),!0):!1}if(o instanceof ot)return!1;const a=(o==null?void 0:o.value.children.findIndex(i=>i===n))??-1;return a>=0?(r==="BEFORE"?o==null||o.value.children.splice(a,0,t):o==null||o.value.children.splice(a+1,0,t),t.parent=o,o==null||o.updateValue(),!0):(console.warn("Not found target node"),!1)}if(r==="CHILD_START")return n.value.children.unshift(t),t.parent=n,n.updateValue(),!0;if(r==="CHILD_END")return n.value.children.push(t),t.parent=n,n.updateValue(),!0;if(F(r)){const o=r;if(o.type==="CHILD"){const a=o.pos,i=o.index||0;return a==="BEFORE"?n==null||n.value.children.splice(i,0,t):n==null||n.value.children.splice(i+1,0,t),t.parent=n,n.updateValue(),!0}else console.warn("Can not parse pos obj")}return!1}createNode(t){return delete t.id,new L(t,{parent:null,materials:this.materialsModel})}addNodeById(t,n,r="AFTER"){const s=this.getNode(n);return s?this.addNode(t,s,r):(console.warn(`Not find a node by ${n}, pls check it`),!1)}copyNode(t){const n=t.export("design");n.id=ee();const r=new L(n,{parent:t.parent,materials:this.materialsModel});return this.addNode(r,t,"AFTER"),r}copyNodeById(t){const n=this.getNode(t);return n&&n instanceof L?this.copyNode(n):!1}moveNode(t,n,r){this.deleteNode(t);let s=n;return["AFTER","BEFORE"].includes(r)&&(s=n.parent),t.parent=s,this.addNode(t,n,r)}moveNodeById(t,n,r){const s=this.getNode(t),o=this.getNode(n);return s&&o&&s instanceof L&&o instanceof L?this.moveNode(s,o,r):!1}deleteNode(t){var n;const r=t.parent;if(!r)throw new Error("parent node is null or undefined, pls check it");if(r instanceof Te){const s=r.value.value,o=s.findIndex(i=>i===t),a=s[o];return s.splice(o,1),(n=r.parent)==null||n.updateValue(),a}if(r instanceof L||r instanceof He){const s=r.value.children,o=s.findIndex(i=>i===t),a=s[o];return s.splice(o,1),r.updateValue(),a}}deleteNodeById(t){const n=this.getNode(t);if(n)return this.deleteNode(n)}export(t=Yt.SAVE){var n;const r=this.data.componentsTree.export(t),s=this.assetPackagesList,o=[],a=this.materialsModel.usedMaterials.map(c=>{const f=s.find(p=>{var u;return p.package===((u=c.value.npm)==null?void 0:u.package)});return f&&o.push(f),{componentName:c.componentName,...br(c.value.npm||{})}}).filter(c=>c.componentName&&c.package&&c.version?!0:(console.warn(`${JSON.stringify(c,null,2)} not a valid material info`),!1));this.materialsModel.usedMaterials=[];let i={...this.data,componentsTree:sn(r),componentsMeta:a,thirdLibs:this.data.thirdLibs,assets:[],extra:this.data.extra};return(n=this.data.thirdLibs)==null||n.forEach(c=>{const f=s.find(p=>c.package===p.package);f&&o.push(f)}),i.assets=Qu(o,c=>c.package),i=Mr(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}re.ROOT_CONTAINER;const ke="DYNAMIC",es=["$$context","$$nodeModel"],un="ON_DID_RENDER",ln="ON_WILL_DESTROY",ts=[un,ln],fn=(e,t)=>{let n=e;return t&&(n={...e},n.__proto__=t||null),n},qe=(e,t={},...n)=>typeof e=="string"||typeof e=="number"?String(e):(es.forEach(s=>{s in t&&e.__CP_TYPE__!==ke&&delete t[s]}),N.createElement(e,t,...n)),ns=(e={},t)=>{const n=[],r=(s,o)=>{let a=o;rn(o)&&(a=o.value),t(a)?n.push({keyPath:s,val:a}):j(a)?a.forEach((i,c)=>{r([...s,String(c)],i)}):F(a)&&Object.keys(a).forEach(i=>{r([...s,i],a[i])})};return r(["$root"],e),n},Me=(e,t)=>{const n=e.handler,{context:r,storeManager:s}=t;return t.actionVariableSpace||(t.actionVariableSpace={}),async function(...o){const a={},i=async p=>{const u=p;if(u.type==="RUN_CODE"){const l=Ee({funcName:"",funcBody:`function() {
|
|
63
|
+
${u.value}
|
|
64
|
+
}`,nodeContext:r,storeManager:s,$$response:t.$$response,actionVariableSpace:t.actionVariableSpace,nodeModel:t.nodeModel});let h;t.$$response!==void 0?h=l(t.$$response,...o):h=l(...o),h!=null&&h.then?a[u.id]=await h:a[u.id]=h}if(u.type==="JUMP_LINK"){const h=Ul(u,t)(...o);h!=null&&h.then?a[u.id]=await h:a[u.id]=h}if(u.type==="REQUEST_API"){const{run:l,afterFailedResponse:h,afterSuccessResponse:b}=Gl(u,t);try{const C=l(...o);C!=null&&C.then?a[u.id]=await C:a[u.id]=C,u.responseVarName&&(t.actionVariableSpace[u.responseVarName]=a[u.id]);const d=b(a[u.id],...o);return d!=null&&d.then?await d:d}catch(C){const d=await h(C);return d!=null&&d.then?await d:d}}if(u.type==="CALL_NODE_METHOD"){const h=Hl(u,t)(...o);h!=null&&h.then?a[u.id]=await h:a[u.id]=h,u.returnVarName&&(t.actionVariableSpace[u.returnVarName]=a[u.id])}if(u.type==="ASSIGN_VALUE"){const l=kl(u,t);let h=[...o];t.$$response!==void 0&&(h=[t.$$response,h]);const b=l(...h);a[u.id]=await b}};let c=n[0];const f=new Set;for(;c;){if(f.has(c.id))return;await i(c),f.add(c.id),c=n.find(u=>(c==null?void 0:c.next)&&u.id===(c==null?void 0:c.next))}}};function Ul(e,t){return he(e.link,t)}const he=(e,t)=>function(...n){return pe(e)?fe(e.value,{...t.context,nodeContext:t.context,storeManager:t.storeManager,$$response:t.$$response,actionVariableSpace:t.actionVariableSpace,nodeModel:t.nodeModel}):Xr(e)?Ee({funcName:e.name||"",funcBody:e.value,nodeContext:t.context,storeManager:t.storeManager,$$response:t.$$response,actionVariableSpace:t.actionVariableSpace,nodeModel:t.nodeModel})(...n):e},Gl=(e,t)=>({run:function(...o){var l,h;let a="";e.apiPath&&(a=he(e.apiPath,t)(...o));const i=e.body||{};Object.keys(i).forEach(b=>{i[b]=he(i[b],t)(...o)});const c=e.query||{};Object.keys(c).forEach(b=>{c[b]=he(c[b],t)(...o)});const f=e.header||{};Object.keys(f).forEach(b=>{f[b]=he(f[b],t)(...o)});const p=e.method||"GET";return(h=(l=t.context).requestAPI)==null?void 0:h.call(l,{url:a,method:p,header:f,body:i,query:c})},afterSuccessResponse:async(o,...a)=>{if(!e.afterSuccessResponse)return o;const i=[...e.afterSuccessResponse||[],...e.afterFailedResponse||[]];return Me({handler:i},{...t,$$response:o})(...a)},afterFailedResponse:async(o,...a)=>{if(!e.afterFailedResponse)return o;const i=[...e.afterFailedResponse||[],...e.afterSuccessResponse||[]];return Me({handler:i},{...t,$$response:o})(...a)}}),Hl=(e,t)=>(...n)=>{const r=Ee({funcName:"",funcBody:`
|
|
65
65
|
function () {
|
|
66
66
|
var args = arguments;
|
|
67
|
-
var nodeRef = $$context.nodeRefs.get(${JSON.stringify(
|
|
67
|
+
var nodeRef = $$context.nodeRefs.get(${JSON.stringify(e.nodeId)});
|
|
68
68
|
if(nodeRef && nodeRef.current) {
|
|
69
|
-
var func = nodeRef.current[${JSON.stringify(
|
|
69
|
+
var func = nodeRef.current[${JSON.stringify(e.methodName)}]?.bind(nodeRef.current);
|
|
70
70
|
var isDev = Boolean(nodeRef.current?.getTargetComponentRef);
|
|
71
71
|
if (isDev) {
|
|
72
72
|
const ins = nodeRef.current.getTargetComponentRef()?.current;
|
|
73
|
-
func = ins?.[${JSON.stringify(
|
|
73
|
+
func = ins?.[${JSON.stringify(e.methodName)}]?.bind(ins);
|
|
74
74
|
}
|
|
75
75
|
if (func) {
|
|
76
76
|
func.apply(null, args);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
}`,nodeContext:e.context,storeManager:e.storeManager,$$response:e.$$response,nodeModel:e.nodeModel});let o=r;return Array.isArray(t.args)&&(o=t.args.map(a=>{const s=[e.$$response,...r].filter(Boolean);return jt(a,e)(...s)})),n(...o)},Gg=(t,e)=>async(...r)=>{const o=jt(t.currentValue,e)(...r);let a;if(o!=null&&o.then?a=await o:a=o,t.valueType==="STATE"){const s=t.targetValueName,i=e.storeManager.getStore(s.nodeId);i&&i.setState({[s.keyPath]:a})}else t.valueType==="MEMORY"&&(e.actionVariableSpace[t.targetValueName]=a);return a},xe=(t={},e)=>{const{$$context:r,getComponent:n,storeManager:o}=e,a=t,s=c=>{if(Array.isArray(c))return c.map(u=>s(u));if(zr(c))return s(c.value);if(xg(c)){const u=c.value,d=u.value;if(!d)return console.warn("slot value is null, this maybe cause some error, pls check it",t),()=>{};const f=l=>{const h=`${l.id}-${le}`,m=n(l),_=Yr(m,l,{...e}),p=u.params||[];return{component:(...b)=>{const y=Ye(b,p),S=Qr({params:y,nodeRefs:r.nodeRefs,getProps:function(){},callEventMethod:function(){}},r);return fe(_,{$$context:S,key:h})},key:h}};if(Array.isArray(d)){const l=d==null?void 0:d.map(h=>f(h));return(...h)=>l.map(m=>{if(Zn(m.component)){const p=m.component;return w.createElement(p,{$$context:r,key:m.key})}else{const p=m.component;return p==null?void 0:p(...h)}})}else return f(d).component}else{if(Nt(c))return St(c.value,{nodeContext:r,storeManager:e.storeManager,nodeModel:e.nodeModel});if(ja(c)){const u=c;return It({funcBody:u.value,funcName:u.name||"",nodeContext:r,storeManager:o,nodeModel:e.nodeModel})}else{if(Mg(c))return Ht(c,{context:r,storeManager:o,actionVariableSpace:{},nodeModel:e.nodeModel});if(xt(c)){let u=c;zr(c)&&(u=c.value);const d=u,f={};return Object.keys(u).forEach(l=>{f[l]=s(d[l])}),f}else return c}}},i={};return Object.keys(a).forEach(c=>{const u=a[c];i[c]=s(u)}),i},zg=(t,e)=>{const{runtimeComponentCache:r,$$context:n={},getComponent:o,renderMode:a}=e,{$$context:s,idx:i,...c}=e;return typeof t=="string"?fe(t):Pg(t)?(({currentNode:d})=>{const f=d.value.id;let l=null;if(r.get(f)){const _=r.get(f);l=_==null?void 0:_.component}else{const _=o(d);l=Yr(_,d,{...c}),!r.get(f)&&a!=="design"&&r.set(f,{component:l})}const h=`${f}-${le}`;return fe(l,{$$context:n,$$nodeModel:t,key:h})})({currentNode:t}):void 0},Yr=(t,e,r)=>{const{storeManager:n,variableManager:o,onGetRef:a,onComponentMount:s,onComponentDestroy:i,refManager:c,processNodeConfigHook:u,requestAPI:d,doc:f}=r,{...l}=r;class h extends w.Component{constructor(p){super(p);$(this,"_CONDITION",!0);$(this,"_DESIGN_BOX",!1);$(this,"_NODE_MODEL",e);$(this,"_NODE_ID",e.id);$(this,"UNIQUE_ID",`${e.id}_${rt()}`);$(this,"targetComponentRef");$(this,"listenerHandler",[]);$(this,"storeState");$(this,"storeListenDisposeList",[]);$(this,"domHeader");$(this,"mediaStyleDomMap",{});$(this,"variableSpace");$(this,"nodeName");$(this,"updateState",p=>{e.value.componentName===ct.ROOT_CONTAINER?this.setState(p):this.storeState.setState(p)});$(this,"getStyleDomById",p=>{const g=this.mediaStyleDomMap;let v=g[p];return v||(v=f.createElement("style"),g[p]=v),v.id=p,v});$(this,"addMediaCSS",()=>{var v;let p=this.domHeader;if(p||(p=(v=f.getElementsByTagName("head"))==null?void 0:v[0],this.domHeader=p),!this.domHeader){console.warn("not found header dom");return}const g=this._NODE_MODEL.value.css;g&&g.value.forEach(b=>{var T;const y=`${this.UNIQUE_ID}_${b.state}`;let S=Xe(this._NODE_MODEL);if(b.state!=="normal"&&(S=`${S}:${b.state}`),b.text){const A=this.getStyleDomById(y);A.innerText=`.${S} { ${b.text} }`,p==null||p.appendChild(A)}(T=b.media)!=null&&T.length&&b.media.forEach(A=>{const N=`${y}_${A.type}_${A.value}`,G=this.getStyleDomById(N);G.media=`screen and (${A.type}:${A.value}px)`,G.innerHTML=`.${S} { ${A.text} }`,p==null||p.appendChild(G)})})});$(this,"removeMediaCSS",()=>{const p=this.mediaStyleDomMap;Object.keys(p).forEach(g=>{var v;(v=this.domHeader)==null||v.removeChild(p[g])}),this.mediaStyleDomMap={}});$(this,"rebuildNode",()=>{this.storeListenDisposeList.forEach(p=>p()),this.removeMediaCSS(),this.connectStore(),this.addMediaCSS(),this.forceUpdate()});this.targetComponentRef=w.createRef(),this.listenerHandler=[],this.state=e.value.state||{};let g=e.value.nodeName||e.id;e.value.componentName===ct.ROOT_CONTAINER&&(g="globalState"),this.nodeName=g;const v=n.getStore(g);v?(this.storeState=v,v.setState({...e.value.state||{}})):this.storeState=n.addStore(g,()=>({...e.value.state||{}}));const b=this.storeState.subscribe(S=>{this.setStateIfChanged(S)});this.storeListenDisposeList.push(b),this.connectStore();const y=o.get(g);y?this.variableSpace=y:(this.variableSpace={staticVar:{},methods:{}},o.add(g,this.variableSpace))}setStateIfChanged(p){e.value.componentName!==ct.ROOT_CONTAINER&&this.setState(g=>{const v=typeof p=="function"?p(g):p;return Fu(g,{...g,...v})?null:v})}connectStore(){const p=Pa(e.props,S=>!!Nt(S)),g=Pa({css:e.value.css,class:e.value.classNames},S=>!!Nt(S));let v=[];[...p,...g].map(S=>{const T=S.val,A=[new RegExp(`(?<=context\\.stateManager(?:\\.|\\[["'])?)\\w+(?=(?:["']?\\])?(?:\\.|\\[)?["']?state)`,"gim"),/\$ALL_STATE(?:\.|(?:\[\s*["']))(\w+)(?=(?:["']\s*\])?)/gim,/getStateObj\(["']([^"']+)["']\)/gim],N=no(T.value,A);v=[...v,...N],/\$CTX\.globalState|\$G_STATE/.test(T.value)&&v.push("globalState")}).filter(Boolean);const b=Array.from(new Set(v)),y=[];b.length&&b.forEach(S=>{if(!S)return;n.getStore(S)||(n.addStore(S,()=>({})),console.warn(n,S,"not exits, auto create"));const A=n.connect(S,N=>{this.setStateIfChanged(N)});y.push(A)}),this.storeListenDisposeList=y}componentDidMount(){var v;this.addMediaCSS(),a==null||a(this.targetComponentRef,e,this),s==null||s(this,e);const p=(v=e.value.eventListener)==null?void 0:v.find(b=>b.name===qr);p&&Ht(p.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{},nodeModel:e})();const g=()=>{n.setStore(e.value.nodeName||e.id,this.storeState),this.storeState.setState({...this.state,...e.value.state||{}}),this.rebuildNode()};e.onChange(g)}componentWillUnmount(){var v;this.storeListenDisposeList.forEach(b=>b()),this.removeMediaCSS(),i==null||i(this,e);const p=Kr,g=(v=e.value.eventListener)==null?void 0:v.find(b=>b.name===p);g&&Ht(g.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{},nodeModel:e})()}transformMethods(p){const{context:g}=p,v=xe({methods:e.value.methods},{$$context:g,...l,nodeModel:e}),b=e.value.methods||[],y=v.methods,S=b.reduce((T,A,N)=>(T[A.name]=y[N],T),{});g.methods=S,this.variableSpace.methods=Object.assign(this.variableSpace.methods,S)}processRootContext(p){e.value.componentName===ct.ROOT_CONTAINER&&(p.globalState=this.state,p.updateGlobalState=this.updateState,p.requestAPI=d,p.getGlobalState=()=>this.state)}processNodeClassName(p,g){var y;const v=((y=e.value.classNames)==null?void 0:y.map(S=>{var N;const T=S.name;return(Nt(S.status)?St(((N=S.status)==null?void 0:N.value)||"",{nodeContext:g,nodeModel:e,storeManager:n}):!1)?T:""}))||[];let b=`${p??""} ${v.join(" ")}`.trim();return e.value.css&&(b=`${Xe(e)} ${b}`.trim()),b}processNodeStyle(p){if(!e.value.style)return{};const g=xe({style:e.value.style},{$$context:p,...l,nodeModel:e});return ro(g.style||[])}processNodeChild(p,g){let v=[];if(p!==void 0)v=Array.isArray(p)?p:[p];else{const b=[];e.value.children.forEach((S,T)=>{const A=zg(S,{$$context:g,idx:T,...l});b.push(A)}),v=b}return v}processNodeConditionAndConfigHook(p,g,v){let b=e.value.condition??!0;typeof b!="boolean"&&(b=St(b.value,{nodeContext:v||{},nodeModel:e,storeManager:n}));let y={condition:b,props:p};u&&(y=u(y,e));const S=fe(t,y.props,...g);return this._CONDITION=y.condition,y.condition?S:w.createElement("div",{key:p.key,style:{display:"none"}},S)}processNodeEventListener(p){const g=e.value.eventListener,v={};return g==null||g.forEach(b=>{if(Ma.includes(b.name))return;const y=Ht(b.func,{context:p,storeManager:n,actionVariableSpace:{},nodeModel:e});v[b.name]=y}),v}createCurrentNodeCtx(){const{$$context:p}=this.props,g=e.value.nodeName||e.id,v=e.id,b={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:n,getState:()=>n.getStateObj(g),getStateObj:()=>n.getStateObj(g),getStateObjById:S=>n.getStateObj(S),stateManager:n.getStateSnapshot(),getMethods:()=>{const S=o.get(v).methods,T=c.get(v).current;return Ze(S,T)},getMethodsById:S=>{const T=o.get(S).methods,A=c.get(S).current;return Ze(T,A)},getStaticVar:()=>o.get(g).staticVar,getStaticVarById:S=>o.get(S).staticVar,callEventMethod:(S,T)=>{var N,G;const A=c.get(v).current;(G=A==null?void 0:(N=A.props)[S])==null||G.call(N,T)},getProps:()=>{const S=c.get(v).current;return S==null?void 0:S.props},nodeRefs:p.nodeRefs};return this.processRootContext(b),Qr(b,p)}injectEngEnv(){const p={},g=e.value.injectEnvList||[];if(Array.isArray(e.value.injectEnvList)){const v={[Ca.COMPONENTS]:r.components};g.reduce((b,y)=>(b[y]=v[y],b),p)}return p}renderCore(){const{$$context:p,...g}=this.props,v={key:e.id,...e.props,...g},b=this.createCurrentNodeCtx();this.transformMethods({context:b});let y=xe(v,{$$context:b,...l,nodeModel:e});const S=this.injectEngEnv();Object.assign(y,S);const T=this.processNodeClassName(y.className,b);y.className=T;const A=this.processNodeStyle(b);y.style={...(y==null?void 0:y.style)||{},...A||{}};const{children:N}=y;delete y.children;const G=this.processNodeChild(N,b);if(y.ref=this.targetComponentRef,e.value.eventListener){const Tt=this.processNodeEventListener(b);y={...y,...Tt}}return this.processNodeConditionAndConfigHook(y,G,b)}renderLoop(){const{$$context:p,...g}=this.props,v={key:e.id,...e.props,...g},b=this.createCurrentNodeCtx();this.transformMethods({context:b});const y=e.value.loop;let S=[];if(y&&y.open){this.targetComponentRef.current=[];let T=y.data||[];if(Nt(y.data)){const A=y.data;T=St(A.value,{nodeContext:b||{},storeManager:n,nodeModel:e})||[]}return S=T.map((...A)=>{const N=A[1],G=[y.forName||"item",y.forIndex||"index"],At=Ye(A,G);let Tt="loopData";y.name&&(Tt=`${Tt}${y.name}`);const Mt=Qr({[Tt]:At,nodeRefs:b.nodeRefs,getProps:function(){},callEventMethod:function(){}},b);let F=xe(v,{$$context:Mt,...l,nodeModel:e});const um=this.injectEngEnv();Object.assign(F,um);const lm=this.processNodeClassName(F.className,Mt);F.className=lm;const fm=this.processNodeStyle(Mt);F.style={...(F==null?void 0:F.style)||{},...fm||{}};const{children:dm}=F;delete F.children;const pm=this.processNodeChild(dm,Mt);if(F.key=`${F.key}-${N}`,Nt(y.key)){const de=y.key,hm=St(de.value,{nodeContext:Mt||{},storeManager:n,nodeModel:e});F.key+=`-${hm}`}if(F.ref=de=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[N]=de},e.value.eventListener){const de=this.processNodeEventListener(Mt);F={...F,...de}}return this.processNodeConditionAndConfigHook(F,pm,Mt)}),S}}render(){const p=e.value.loop;return p&&p.open?this.renderLoop():this.renderCore()}}return $(h,"__CP_TYPE__",le),h.displayName=`${e.value.componentName}Dynamic`,h};class xa{constructor(){$(this,"renderMode","normal");$(this,"components",{});$(this,"storeManager",new Ku);$(this,"variableManager",new Qu);$(this,"runtimeComponentCache",new Map);$(this,"onGetRef");$(this,"onGetComponent");$(this,"onComponentMount");$(this,"refManager",new tr);$(this,"onComponentDestroy");$(this,"processNodeConfigHook");$(this,"requestAPI",async e=>{throw console.log(e),new Error("Need to implement requestAPI for Render")})}getComponent(e){var o;const r=e.value.componentName;let n=ao(r,this.components);return to(n)||(n=eo(n),this.components[r]=n),this.onGetComponent&&(n=(o=this.onGetComponent)==null?void 0:o.call(this,n,e)),n}pageRender(e,{components:r,onGetRef:n,refManager:o,$$context:a={nodeRefs:o,getProps:function(){},callEventMethod:function(){}},onGetComponent:s,onComponentMount:i,onComponentDestroy:c,renderMode:u,processNodeConfigHook:d,requestAPI:f,doc:l}){this.renderMode=u,this.components=r,this.onGetRef=n,this.onGetComponent=s,this.onComponentMount=i,this.onComponentDestroy=c,this.processNodeConfigHook=d,this.refManager=o,this.requestAPI=f;const h=e.value.componentsTree,m=this.getComponent(h),_=Yr(m,e.value.componentsTree,{storeManager:this.storeManager,variableManager:this.variableManager,runtimeComponentCache:this.runtimeComponentCache,getComponent:this.getComponent.bind(this),refManager:this.refManager,onGetRef:this.onGetRef,processNodeConfigHook:d,onComponentMount:i,onComponentDestroy:c,renderMode:u,requestAPI:f,components:this.components,doc:l}),p={},g=h.props;return Object.keys(g).forEach(v=>{p[v]=g[v].value}),p.$$context=a,fe(_,p)}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const kg=tn(new xa),Hg=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"],ut=t=>{const e={};return t.forEach(r=>{e[r.key]=r.value}),e},Wg=Hg.reduce((t,e)=>(t[e]=({children:r,$$attributes:n=[],...o})=>{let a=r;Array.isArray(r)||(a=[r]);const s={boxSizing:"border-box",...o.style||{}};return w.createElement(e,{...o,...ut(n),style:s},...a)},t),{}),Jg={RootContainer:({children:t})=>t,...Wg,CContainer:({children:t,$$attributes:e=[],afterMount:r,beforeDestroy:n,style:o,...a})=>{let s=t;Array.isArray(t)||(s=[t]),w.useEffect(()=>(r==null||r(a),()=>{n==null||n(a)}),[]);const i={boxSizing:"border-box",...o||{}};return w.createElement("div",{...a,...ut(e),style:i},...s)},CVideo:({children:t,$$attributes:e=[],...r})=>{let n=t;Array.isArray(t)||(n=[t]);const o={boxSizing:"border-box",...r.style||{}};return w.createElement("video",{...r,...ut(e),style:o},...n)},CAudio:({children:t,$$attributes:e=[],...r})=>{let n=t;Array.isArray(t)||(n=[t]);const o={boxSizing:"border-box",...r.style||{}};return w.createElement("audio",{...r,...ut(e),style:o},...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}=ut(n),c={height:r,width:e,boxSizing:"border-box",...s,...o.style||{}};return w.createElement("div",{...o,...i,style:c},...a)},CImage:({children:t,$$attributes:e=[],...r})=>{let n=t;Array.isArray(t)||(n=[t]);const o={boxSizing:"border-box",...r.style||{}};return w.createElement("img",{...r,...ut(e),style:o},...n)},CText:({$$attributes:t=[],content:e,...r})=>{const n={boxSizing:"border-box",...r.style||{}};return w.createElement("span",{...r,...ut(t),style:n},e)},CCanvas:({afterMount:t,beforeDestroy:e,$$attributes:r=[],...n})=>{w.useEffect(()=>(t==null||t(n),()=>{e==null||e(n)}),[]);const o={boxSizing:"border-box",...n.style||{}};return w.createElement("canvas",{...n,...ut(r),style:o})},CNativeTag:({children:t,$$attributes:e=[],htmlTag:r="div",...n})=>{let o=t;Array.isArray(t)||(o=[t]);const{style:a={},...s}=ut(e),i={boxSizing:"border-box",...a,...n.style||{}};return w.createElement(r,{...n,...s,style:i},...o)}};class Ia extends w.Component{constructor(r){super(r);$(this,"refManager");$(this,"dynamicComponentInstanceMap",new Map);$(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)});$(this,"rerender",r=>{if(this.props.adapter.clear(),(r==null?void 0:r.nodeType)==="PAGE"&&r)this.setState({pageModel:r});else if(xt(r)&&Aa(r)){const n=r;this.setState({pageModel:new Pe(n,{materials:this.state.pageModel.materialsModel.rawValue})})}});this.state={pageModel:r.pageModel||new Pe(r.page)},this.refManager=new tr}getPageModel(){return this.state.pageModel}componentDidMount(){const{render:r}=this.props;r&&(r.ref.current=this),window.parent&&(window.parent.__CB_RENDER_WIN__=window)}componentWillUnmount(){this.refManager.destroy()}render(){const{props:r}=this,{adapter:n,onGetComponent:o,onComponentDestroy:a,onComponentMount:s,doc:i}=r,{pageModel:c}=this.state;if(!c)return console.warn("pageModel is null"),null;const u={...Jg,...r.components},d=this.props.$$context||{};return n.pageRender(c,{libs:{},components:u,refManager:this.refManager,onGetRef:this.onGetRef,onGetComponent:o,onComponentMount:s,onComponentDestroy:a,$$context:{...d,nodeRefs:this.refManager},renderMode:r.renderMode||"normal",requestAPI:r.requestAPI??n.requestAPI,processNodeConfigHook:r.processNodeConfigHook,doc:i||document})}}const qg=()=>{const t=w.useRef(null);return w.useMemo(()=>({ref:t,rerender:function(...r){t.current&&t.current.rerender(...r)}}),[])};class Kg extends w.Component{constructor(r){super(r);$(this,"onDoubleClick",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:""}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){var o,a;(a=(o=this.props).onError)==null||a.call(o,n)}render(){if(this.state.hasError){const{onDoubleClick:r}=this,n=this.props.node.value;console.error(this.props.node,this.props.children);const o=w.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,w.createElement("p",null,"msg: ",String(this.state.error)),w.createElement("button",{onDoubleClick:r,style:{border:"1px solid rgba(100,100,100,0.1)",backgroundColor:"#fff",padding:"5px 10px",borderRadius:"2px",color:"gray",cursor:"pointer",marginTop:"5px"}},"double click to refresh"),w.createElement("div",{style:{display:"none"}}));return w.createElement(this.props.targetComponent,{onlyRenderChild:!0},o)}return this.props.children}}function Qg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xr={exports:{}},J={};/**
|
|
79
|
+
}`,nodeContext:t.context,storeManager:t.storeManager,$$response:t.$$response,nodeModel:t.nodeModel});let s=n;return Array.isArray(e.args)&&(s=e.args.map(o=>{const a=[t.$$response,...n].filter(Boolean);return he(o,t)(...a)})),r(...s)},kl=(e,t)=>async(...n)=>{const s=he(e.currentValue,t)(...n);let o;if(s!=null&&s.then?o=await s:o=s,e.valueType==="STATE"){const a=e.targetValueName,i=t.storeManager.getStore(a.nodeId);i&&i.setState({[a.keyPath]:o})}else e.valueType==="MEMORY"&&(t.actionVariableSpace[e.targetValueName]=o);return o},at=(e={},t)=>{const{$$context:n,getComponent:r,storeManager:s}=t,o=e,a=c=>{if(Array.isArray(c))return c.map(f=>a(f));if(rn(c))return a(c.value);if(Dl(c)){const f=c.value,p=f.value;if(!p)return console.warn("slot value is null, this maybe cause some error, pls check it",e),()=>{};const u=l=>{const h=`${l.id}-${ke}`,b=r(l),C=dn(b,l,{...t}),d=f.params||[];return{component:(...y)=>{const v=Ut(y,d),S=fn({params:v,nodeRefs:n.nodeRefs,getProps:function(){},callEventMethod:function(){}},n);return qe(C,{$$context:S,key:h})},key:h}};if(Array.isArray(p)){const l=p==null?void 0:p.map(h=>u(h));return(...h)=>l.map(b=>{if(Pr(b.component)){const d=b.component;return N.createElement(d,{$$context:n,key:b.key})}else{const d=b.component;return d==null?void 0:d(...h)}})}else return u(p).component}else{if(pe(c))return fe(c.value,{nodeContext:n,storeManager:t.storeManager,nodeModel:t.nodeModel});if(Xr(c)){const f=c;return Ee({funcBody:f.value,funcName:f.name||"",nodeContext:n,storeManager:s,nodeModel:t.nodeModel})}else{if(xl(c))return Me(c,{context:n,storeManager:s,actionVariableSpace:{},nodeModel:t.nodeModel});if(F(c)){let f=c;rn(c)&&(f=c.value);const p=f,u={};return Object.keys(f).forEach(l=>{u[l]=a(p[l])}),u}else return c}}},i={};return Object.keys(o).forEach(c=>{const f=o[c];i[c]=a(f)}),i},ql=(e,t)=>{const{runtimeComponentCache:n,$$context:r={},getComponent:s,renderMode:o}=t,{$$context:a,idx:i,...c}=t;return typeof e=="string"?qe(e):Rl(e)?(({currentNode:p})=>{const u=p.value.id;let l=null;if(n.get(u)){const C=n.get(u);l=C==null?void 0:C.component}else{const C=s(p);l=dn(C,p,{...c}),!n.get(u)&&o!=="design"&&n.set(u,{component:l})}const h=`${u}-${ke}`;return qe(l,{$$context:r,$$nodeModel:e,key:h})})({currentNode:e}):void 0},dn=(e,t,n)=>{const{storeManager:r,variableManager:s,onGetRef:o,onComponentMount:a,onComponentDestroy:i,refManager:c,processNodeConfigHook:f,requestAPI:p,doc:u}=n,{...l}=n;class h extends N.Component{constructor(d){super(d);E(this,"_CONDITION",!0);E(this,"_DESIGN_BOX",!1);E(this,"_NODE_MODEL",t);E(this,"_NODE_ID",t.id);E(this,"UNIQUE_ID",`${t.id}_${ee()}`);E(this,"targetComponentRef");E(this,"listenerHandler",[]);E(this,"storeState");E(this,"storeListenDisposeList",[]);E(this,"domHeader");E(this,"mediaStyleDomMap",{});E(this,"variableSpace");E(this,"nodeName");E(this,"isMounted",!1);E(this,"updateState",d=>{this.isMounted&&(t.value.componentName===re.ROOT_CONTAINER?this.setState(d):this.storeState.setState(d))});E(this,"getStyleDomById",d=>{const g=this.mediaStyleDomMap;let m=g[d];return m||(m=u.createElement("style"),g[d]=m),m.id=d,m});E(this,"addMediaCSS",()=>{var m;let d=this.domHeader;if(d||(d=(m=u.getElementsByTagName("head"))==null?void 0:m[0],this.domHeader=d),!this.domHeader){console.warn("not found header dom");return}const g=this._NODE_MODEL.value.css;g&&g.value.forEach(y=>{var M;const v=`${this.UNIQUE_ID}_${y.state}`;let S=Gt(this._NODE_MODEL);if(y.state!=="normal"&&(S=`${S}:${y.state}`),y.text){const A=this.getStyleDomById(v);A.innerText=`.${S} { ${y.text} }`,d==null||d.appendChild(A)}(M=y.media)!=null&&M.length&&y.media.forEach(A=>{const w=`${v}_${A.type}_${A.value}`,U=this.getStyleDomById(w);U.media=`screen and (${A.type}:${A.value}px)`,U.innerHTML=`.${S} { ${A.text} }`,d==null||d.appendChild(U)})})});E(this,"removeMediaCSS",()=>{const d=this.mediaStyleDomMap;Object.keys(d).forEach(g=>{var m;(m=this.domHeader)==null||m.removeChild(d[g])}),this.mediaStyleDomMap={}});E(this,"rebuildNode",()=>{this.storeListenDisposeList.forEach(d=>d()),this.removeMediaCSS(),this.connectStore(),this.addMediaCSS(),this.forceUpdate()});this.targetComponentRef=N.createRef(),this.listenerHandler=[],this.state=t.value.state||{};let g=t.value.nodeName||t.id;t.value.componentName===re.ROOT_CONTAINER&&(g="globalState"),this.nodeName=g;const m=r.getStore(g);m?(this.storeState=m,m.setState({...t.value.state||{}})):this.storeState=r.addStore(g,()=>({...t.value.state||{}}));const y=this.storeState.subscribe(S=>{this.setStateIfChanged(S)});this.storeListenDisposeList.push(y),this.connectStore();const v=s.get(g);v?this.variableSpace=v:(this.variableSpace={staticVar:{},methods:{}},s.add(g,this.variableSpace))}setStateIfChanged(d){this.isMounted&&t.value.componentName!==re.ROOT_CONTAINER&&this.setState(g=>{const m=typeof d=="function"?d(g):d;return xu(g,{...g,...m})?null:m})}connectStore(){const d=ns(t.props,S=>!!pe(S)),g=ns({css:t.value.css,class:t.value.classNames},S=>!!pe(S));let m=[];[...d,...g].map(S=>{const M=S.val,A=[new RegExp(`(?<=context\\.stateManager(?:\\.|\\[["'])?)\\w+(?=(?:["']?\\])?(?:\\.|\\[)?["']?state)`,"gim"),/\$ALL_STATE(?:\.|(?:\[\s*["']))(\w+)(?=(?:["']\s*\])?)/gim,/getStateObj\(["']([^"']+)["']\)/gim],w=Lr(M.value,A);m=[...m,...w],/\$CTX\.globalState|\$G_STATE/.test(M.value)&&m.push("globalState")}).filter(Boolean);const y=Array.from(new Set(m)),v=[];y.length&&y.forEach(S=>{if(!S)return;r.getStore(S)||(r.addStore(S,()=>({})),console.warn(r,S,"not exits, auto create"));const A=r.connect(S,w=>{this.setStateIfChanged(w)});v.push(A)}),this.storeListenDisposeList=v}componentDidMount(){var m;this.isMounted=!0,this.addMediaCSS(),o==null||o(this.targetComponentRef,t,this),a==null||a(this,t);const d=(m=t.value.eventListener)==null?void 0:m.find(y=>y.name===un);d&&Me(d.func,{context:this.createCurrentNodeCtx(),storeManager:r,actionVariableSpace:{},nodeModel:t})();const g=()=>{this.isMounted&&(r.setStore(t.value.nodeName||t.id,this.storeState),this.storeState.setState({...this.state,...t.value.state||{}}),this.rebuildNode())};t.onChange(g)}componentWillUnmount(){var m;this.storeListenDisposeList.forEach(y=>y()),this.removeMediaCSS(),i==null||i(this,t);const d=ln,g=(m=t.value.eventListener)==null?void 0:m.find(y=>y.name===d);g&&Me(g.func,{context:this.createCurrentNodeCtx(),storeManager:r,actionVariableSpace:{},nodeModel:t})()}transformMethods(d){const{context:g}=d,m=at({methods:t.value.methods},{$$context:g,...l,nodeModel:t}),y=t.value.methods||[],v=m.methods,S=y.reduce((M,A,w)=>(M[A.name]=v[w],M),{});g.methods=S,this.variableSpace.methods=Object.assign(this.variableSpace.methods,S)}processRootContext(d){t.value.componentName===re.ROOT_CONTAINER&&(d.globalState=this.state,d.updateGlobalState=this.updateState,d.requestAPI=p,d.getGlobalState=()=>this.state)}processNodeClassName(d,g){var v;const m=((v=t.value.classNames)==null?void 0:v.map(S=>{var w;const M=S.name;return(pe(S.status)?fe(((w=S.status)==null?void 0:w.value)||"",{nodeContext:g,nodeModel:t,storeManager:r}):!1)?M:""}))||[];let y=`${d??""} ${m.join(" ")}`.trim();return t.value.css&&(y=`${Gt(t)} ${y}`.trim()),y}processNodeStyle(d){if(!t.value.style)return{};const g=at({style:t.value.style},{$$context:d,...l,nodeModel:t});return Dr(g.style||[])}processNodeChild(d,g){let m=[];if(d!==void 0)m=Array.isArray(d)?d:[d];else{const y=[];t.value.children.forEach((S,M)=>{const A=ql(S,{$$context:g,idx:M,...l});y.push(A)}),m=y}return m}processNodeConditionAndConfigHook(d,g,m){let y=t.value.condition??!0;typeof y!="boolean"&&(y=fe(y.value,{nodeContext:m||{},nodeModel:t,storeManager:r}));let v={condition:y,props:d};f&&(v=f(v,t));const S=qe(e,v.props,...g);return this._CONDITION=v.condition,v.condition?S:N.createElement("div",{key:d.key,style:{display:"none"}},S)}processNodeEventListener(d){const g=t.value.eventListener,m={};return g==null||g.forEach(y=>{if(ts.includes(y.name))return;const v=Me(y.func,{context:d,storeManager:r,actionVariableSpace:{},nodeModel:t});m[y.name]=v}),m}createCurrentNodeCtx(){const{$$context:d}=this.props,g=t.value.nodeName||t.id,m=t.id,y={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:r,getState:()=>r.getStateObj(g),getStateObj:()=>r.getStateObj(g),getStateObjById:S=>r.getStateObj(S),stateManager:r.getStateSnapshot(),getMethods:()=>{const S=s.get(m).methods,M=c.get(m).current;return Ht(S,M)},getMethodsById:S=>{const M=s.get(S).methods,A=c.get(S).current;return Ht(M,A)},getStaticVar:()=>s.get(g).staticVar,getStaticVarById:S=>s.get(S).staticVar,callEventMethod:(S,M)=>{var w,U;const A=c.get(m).current;(U=A==null?void 0:(w=A.props)[S])==null||U.call(w,M)},getProps:()=>{const S=c.get(m).current;return S==null?void 0:S.props},nodeRefs:d.nodeRefs};return this.processRootContext(y),fn(y,d)}injectEngEnv(){const d={},g=t.value.injectEnvList||[];if(Array.isArray(t.value.injectEnvList)){const m={[Jr.COMPONENTS]:n.components};g.reduce((y,v)=>(y[v]=m[v],y),d)}return d}renderCore(){const{$$context:d,...g}=this.props,m={key:t.id,...t.props,...g},y=this.createCurrentNodeCtx();this.transformMethods({context:y});let v=at(m,{$$context:y,...l,nodeModel:t});const S=this.injectEngEnv();Object.assign(v,S);const M=this.processNodeClassName(v.className,y);v.className=M;const A=this.processNodeStyle(y);v.style={...(v==null?void 0:v.style)||{},...A||{}};const{children:w}=v;delete v.children;const U=this.processNodeChild(w,y);if(v.ref=this.targetComponentRef,t.value.eventListener){const me=this.processNodeEventListener(y);v={...v,...me}}return this.processNodeConditionAndConfigHook(v,U,y)}renderLoop(){const{$$context:d,...g}=this.props,m={key:t.id,...t.props,...g},y=this.createCurrentNodeCtx();this.transformMethods({context:y});const v=t.value.loop;let S=[];if(v&&v.open){this.targetComponentRef.current=[];let M=v.data||[];if(pe(v.data)){const A=v.data;M=fe(A.value,{nodeContext:y||{},storeManager:r,nodeModel:t})||[]}return S=M.map((...A)=>{const w=A[1],U=[v.forName||"item",v.forIndex||"index"],ge=Ut(A,U);let me="loopData";v.name&&(me=`${me}${v.name}`);const ye=fn({[me]:ge,nodeRefs:y.nodeRefs,getProps:function(){},callEventMethod:function(){}},y);let V=at(m,{$$context:ye,...l,nodeModel:t});const ff=this.injectEngEnv();Object.assign(V,ff);const df=this.processNodeClassName(V.className,ye);V.className=df;const pf=this.processNodeStyle(ye);V.style={...(V==null?void 0:V.style)||{},...pf||{}};const{children:hf}=V;delete V.children;const gf=this.processNodeChild(hf,ye);if(V.key=`${V.key}-${w}`,pe(v.key)){const ze=v.key,mf=fe(ze.value,{nodeContext:ye||{},storeManager:r,nodeModel:t});V.key+=`-${mf}`}if(V.ref=ze=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[w]=ze},t.value.eventListener){const ze=this.processNodeEventListener(ye);V={...V,...ze}}return this.processNodeConditionAndConfigHook(V,gf,ye)}),S}}render(){const d=t.value.loop;return d&&d.open?this.renderLoop():this.renderCore()}}return E(h,"__CP_TYPE__",ke),h.displayName=`${t.value.componentName}Dynamic`,h};class rs{constructor(){E(this,"renderMode","normal");E(this,"components",{});E(this,"storeManager",new al);E(this,"variableManager",new il);E(this,"runtimeComponentCache",new Map);E(this,"onGetRef");E(this,"onGetComponent");E(this,"onComponentMount");E(this,"refManager",new kt);E(this,"onComponentDestroy");E(this,"processNodeConfigHook");E(this,"requestAPI",async t=>{throw console.log(t),new Error("Need to implement requestAPI for Render")})}getComponent(t){var s;const n=t.value.componentName;let r=Fr(n,this.components);return xr(r)||(r=Rr(r),this.components[n]=r),this.onGetComponent&&(r=(s=this.onGetComponent)==null?void 0:s.call(this,r,t)),r}pageRender(t,{components:n,onGetRef:r,refManager:s,$$context:o={nodeRefs:s,getProps:function(){},callEventMethod:function(){}},onGetComponent:a,onComponentMount:i,onComponentDestroy:c,renderMode:f,processNodeConfigHook:p,requestAPI:u,doc:l}){this.renderMode=f,this.components=n,this.onGetRef=r,this.onGetComponent=a,this.onComponentMount=i,this.onComponentDestroy=c,this.processNodeConfigHook=p,this.refManager=s,this.requestAPI=u;const h=t.value.componentsTree,b=this.getComponent(h),C=dn(b,t.value.componentsTree,{storeManager:this.storeManager,variableManager:this.variableManager,runtimeComponentCache:this.runtimeComponentCache,getComponent:this.getComponent.bind(this),refManager:this.refManager,onGetRef:this.onGetRef,processNodeConfigHook:p,onComponentMount:i,onComponentDestroy:c,renderMode:f,requestAPI:u,components:this.components,doc:l}),d={},g=h.props;return Object.keys(g).forEach(m=>{d[m]=g[m].value}),d.$$context=o,qe(C,d)}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const zl=gn(new rs),se=e=>{const t={};return e.forEach(n=>{t[n.key]=n.value}),t},Jl=ml.reduce((e,t)=>(e[t]=({children:n,$$attributes:r=[],...s})=>{let o=n;Array.isArray(n)||(o=[n]);const a={boxSizing:"border-box",...s.style||{}};return N.createElement(t,{...s,...se(r),style:a},...o)},e),{}),Wl={RootContainer:({children:e})=>e,...Jl,CContainer:({children:e,$$attributes:t=[],afterMount:n,beforeDestroy:r,style:s,...o})=>{let a=e;Array.isArray(e)||(a=[e]),N.useEffect(()=>(n==null||n(o),()=>{r==null||r(o)}),[]);const i={boxSizing:"border-box",...s||{}};return N.createElement("div",{...o,...se(t),style:i},...a)},CVideo:({children:e,$$attributes:t=[],...n})=>{let r=e;Array.isArray(e)||(r=[e]);const s={boxSizing:"border-box",...n.style||{}};return N.createElement("video",{...n,...se(t),style:s},...r)},CAudio:({children:e,$$attributes:t=[],...n})=>{let r=e;Array.isArray(e)||(r=[e]);const s={boxSizing:"border-box",...n.style||{}};return N.createElement("audio",{...n,...se(t),style:s},...r)},CBlock:({children:e,width:t,height:n,$$attributes:r=[],...s})=>{let o=e;Array.isArray(e)||(o=[e]),o=o.filter(f=>f!==void 0);const{style:a={},...i}=se(r),c={height:n,width:t,boxSizing:"border-box",...a,...s.style||{}};return N.createElement("div",{...s,...i,style:c},...o)},CImage:({children:e,$$attributes:t=[],...n})=>{let r=e;Array.isArray(e)||(r=[e]);const s={boxSizing:"border-box",...n.style||{}};return N.createElement("img",{...n,...se(t),style:s},...r)},CText:({$$attributes:e=[],content:t,...n})=>{const r={boxSizing:"border-box",...n.style||{}};return N.createElement("span",{...n,...se(e),style:r},t)},CCanvas:({afterMount:e,beforeDestroy:t,$$attributes:n=[],...r})=>{N.useEffect(()=>(e==null||e(r),()=>{t==null||t(r)}),[]);const s={boxSizing:"border-box",...r.style||{}};return N.createElement("canvas",{...r,...se(n),style:s})},CNativeTag:({children:e,$$attributes:t=[],htmlTag:n="div",...r})=>{let s=e;Array.isArray(e)||(s=[e]);const{style:o={},...a}=se(t),i={boxSizing:"border-box",...o,...r.style||{}};return N.createElement(n,{...r,...a,style:i},...s)}};class ss extends N.Component{constructor(n){super(n);E(this,"refManager");E(this,"dynamicComponentInstanceMap",new Map);E(this,"onGetRef",(n,r,s)=>{var o,a;(a=(o=this.props).onGetRef)==null||a.call(o,n,r,s),this.dynamicComponentInstanceMap.set(r.id,s),this.refManager.add(r.value.refId||r.id,n)});E(this,"rerender",n=>{if(this.props.adapter.clear(),(n==null?void 0:n.nodeType)==="PAGE"&&n)this.setState({pageModel:n});else if(F(n)&&Zr(n)){const r=n;this.setState({pageModel:new ot(r,{materials:this.state.pageModel.materialsModel.rawValue})})}});this.state={pageModel:n.pageModel||new ot(n.page)},this.refManager=new kt}getPageModel(){return this.state.pageModel}componentDidMount(){const{render:n}=this.props;n&&(n.ref.current=this),window.parent&&(window.parent.__CB_RENDER_WIN__=window)}componentWillUnmount(){this.refManager.destroy()}render(){const{props:n}=this,{adapter:r,onGetComponent:s,onComponentDestroy:o,onComponentMount:a}=n,{pageModel:i}=this.state;if(!i)return console.warn("pageModel is null"),null;const c={...Wl,...n.components},f=this.props.$$context||{};let p=this.props.doc;return typeof window<"u"&&(p=this.props.doc||window.document),r.pageRender(i,{libs:{},components:c,refManager:this.refManager,onGetRef:this.onGetRef,onGetComponent:s,onComponentMount:a,onComponentDestroy:o,$$context:{...f,nodeRefs:this.refManager},renderMode:n.renderMode||"normal",requestAPI:n.requestAPI??r.requestAPI,processNodeConfigHook:n.processNodeConfigHook,doc:p})}}const Yl=()=>{const e=N.useRef(null);return N.useMemo(()=>({ref:e,rerender:function(...n){e.current&&e.current.rerender(...n)}}),[])};class Kl extends N.Component{constructor(n){super(n);E(this,"onDoubleClick",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:""}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){var s,o;(o=(s=this.props).onError)==null||o.call(s,r)}render(){if(this.state.hasError){const{onDoubleClick:n}=this,r=this.props.node.value;console.error(this.props.node,this.props.children);const s=N.createElement("div",{style:{backgroundColor:"rgb(255 206 215 / 13%)",padding:"5px",color:"#ff0000b0",textAlign:"center",fontSize:"12px"}},"Render error, node id: ",r.id,", node name:",r.title," component name:",r.title||r.componentName,N.createElement("p",null,"msg: ",String(this.state.error)),N.createElement("button",{onDoubleClick:n,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"),N.createElement("div",{style:{display:"none"}}));return N.createElement(this.props.targetComponent,{onlyRenderChild:!0},s)}return this.props.children}}function Ql(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pn={exports:{}},z={};/**
|
|
80
80
|
* @license React
|
|
81
81
|
* react-reconciler-reflection.production.js
|
|
82
82
|
*
|
|
@@ -84,5 +84,5 @@ ${f.value}
|
|
|
84
84
|
*
|
|
85
85
|
* This source code is licensed under the MIT license found in the
|
|
86
86
|
* LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/var Ra;function Yg(){if(Ra)return J;Ra=1;function t(s){var i="https://react.dev/errors/"+s;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)i+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+s+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function e(s){var i=s,c=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(c=i.return),s=i.return;while(s)}return i.tag===3?c:null}function r(s){if(e(s)!==s)throw Error(t(188))}function n(s){var i=s.alternate;if(!i){if(i=e(s),i===null)throw Error(t(188));return i!==s?null:s}for(var c=s,u=i;;){var d=c.return;if(d===null)break;var f=d.alternate;if(f===null){if(u=d.return,u!==null){c=u;continue}break}if(d.child===f.child){for(f=d.child;f;){if(f===c)return r(d),s;if(f===u)return r(d),i;f=f.sibling}throw Error(t(188))}if(c.return!==u.return)c=d,u=f;else{for(var l=!1,h=d.child;h;){if(h===c){l=!0,c=d,u=f;break}if(h===u){l=!0,u=d,c=f;break}h=h.sibling}if(!l){for(h=f.child;h;){if(h===c){l=!0,c=f,u=d;break}if(h===u){l=!0,u=f,c=d;break}h=h.sibling}if(!l)throw Error(t(189))}}if(c.alternate!==u)throw Error(t(190))}if(c.tag!==3)throw Error(t(188));return c.stateNode.current===c?s:i}function o(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(i=o(s),i!==null)return i;s=s.sibling}return null}function a(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(s.tag!==4&&(i=a(s),i!==null))return i;s=s.sibling}return null}return J.doesFiberContain=function(s,i){for(var c=s.alternate;i!==null;){if(i===s||i===c)return!0;i=i.return}return!1},J.findCurrentFiberUsingSlowPath=n,J.findCurrentHostFiber=function(s){return s=n(s),s!==null?o(s):null},J.findCurrentHostFiberWithNoPortals=function(s){return s=n(s),s!==null?a(s):null},J.getContainerFromFiber=function(s){return s.tag===3?s.stateNode.containerInfo:null},J.getNearestMountedFiber=e,J.getSuspenseInstanceFromFiber=function(s){if(s.tag===13){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null},J.isFiberMounted=function(s){return e(s)===s},J.isFiberSuspenseAndTimedOut=function(s){var i=s.memoizedState;return s.tag===13&&i!==null&&i.dehydrated===null},J.isMounted=function(s){return(s=s._reactInternals)?e(s)===s:!1},J}var Da;function Xg(){return Da||(Da=1,Xr.exports=Yg()),Xr.exports}var Zg=Xg();function tm(t){return t._reactInternals}function $m(t){return t}function em(t){const e=tm(t);if(e===void 0){if(typeof t.render=="function")throw new Error("Unable to find node on an unmounted component.");{const n=Object.keys(t).join(",");throw new Error(`Argument appears to not be a ReactComponent. Keys: ${n}`)}}const r=Zg.findCurrentHostFiber(e);return r===null?null:r.stateNode}function rm(t){return em(t)}class La{constructor(){$(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 Va=t=>{const{node:e}=t,r=w.useMemo(()=>{const i=e.isContainer();return xt(i)?i:{placeholder:"Drag the component to place it",width:"100%",height:"100%",style:{}}},[e]),{placeholder:n,height:o,width:a,style:s}=r;return w.createElement("div",{style:{margin:0,padding:0,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",minHeight:"50px",width:a,height:o,boxSizing:"border-box",...s}},n)};class nm extends w.Component{constructor(r){super(r);$(this,"instanceManager",new La);$(this,"renderRef");$(this,"dropPlaceholder",Va);$(this,"_components",{});$(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 w.Component{constructor(){super(...arguments);$(this,"_DESIGN_BOX",!0);$(this,"_NODE_MODEL",n);$(this,"_NODE_ID",n.id);$(this,"_UNIQUE_ID",`${n.id}_${rt()}`);$(this,"_STATUS");$(this,"_design_target_component",w.createRef());$(this,"_dom")}componentDidMount(){o.instanceManager.add(n.id,this)}getTargetComponentRef(){return this._design_target_component}componentWillUnmount(){this._STATUS="DESTROY",o.instanceManager.remove(n.id,this)}getDom(){var h,m;return((m=(h=n.material)==null?void 0:h.value.advanceCustom)==null?void 0:m.autoGetDom)??!0?rm(this):this._dom}render(){var b,y,S,T;const{children:l=[],onlyRenderChild:h,...m}=this.props,_={...m,ref:A=>{this._design_target_component.current=A}};let p=l;if(nt(l)||(p=[l]),!!!p.filter(Boolean).length&&(n.isContainer()||n.value.componentName===ct.ROOT_CONTAINER)){const A=(y=(b=n.material)==null?void 0:b.value.advanceCustom)==null?void 0:y.dropPlaceholder;p.push(w.createElement(A||o.dropPlaceholder,{node:n}))}return h?p:((T=(S=n.material)==null?void 0:S.value.advanceCustom)==null?void 0:T.autoGetDom)??!0?w.createElement(a,_,...p):w.createElement(a,{..._,$SET_DOM:N=>{this._dom=N}},...p)}}return w.forwardRef(function(f,l){return w.createElement(Kg,{node:n,targetComponent:i},w.createElement(i,{ref:l,...f}))})});this._components=Object.assign(this._components,this.props.components),this.renderRef=w.createRef(),r.dropPlaceholder&&(this.dropPlaceholder=r.dropPlaceholder)}updateComponents(r={}){this._components=Object.assign(this._components,r),this.forceUpdate()}componentDidMount(){var r,n;window.__CHAMN_RENDER_MODE="DESIGN",this.updateComponents(this.props.components),(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=Fa(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=s.getDom();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),w.createElement(Ia,{onGetComponent:n,...a,components:this._components,processNodeConfigHook:(s,i)=>{var m,_;if(i.nodeType!=="NODE")return s;const{props:c,condition:u}=s;let d={...c};const f=((m=i.value.configure)==null?void 0:m.devState)||{},l=(_=i.material)==null?void 0:_.value.fixedProps;if(l!==void 0){if(xt(l))d={...d,...l};else if(typeof l=="function"){const p=l(d);d={...d,...p}}}let h=u;return f.condition===!1&&(h=f.condition),{props:Uu(d,f.props||{}),condition:h}},renderMode:"design",ref:this.renderRef})}}const Fa=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:Fa(t.parentElement)},Ua=t=>{var e;return t?(e=t==null?void 0:t.stateNode)!=null&&e._DESIGN_BOX?t:Ua(t.return):null},om=()=>{const t=w.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 Ie={exports:{}},am=Ie.exports,Ba;function sm(){return Ba||(Ba=1,function(t,e){(function(r,n){t.exports=n()})(am,function(){var r=function(){},n={},o={},a={};function s(l,h){l=l.push?l:[l];var m=[],_=l.length,p=_,g,v,b,y;for(g=function(S,T){T.length&&m.push(S),p--,p||h(m)};_--;){if(v=l[_],b=o[v],b){g(v,b);continue}y=a[v]=a[v]||[],y.push(g)}}function i(l,h){if(l){var m=a[l];if(o[l]=h,!!m)for(;m.length;)m[0](l,h),m.splice(0,1)}}function c(l,h){l.call&&(l={success:l}),h.length?(l.error||r)(h):(l.success||r)(l)}function u(l,h,m,_){var p=document,g=m.async,v=(m.numRetries||0)+1,b=m.before||r,y=l.replace(/[\?|#].*$/,""),S=l.replace(/^(css|img|module|nomodule)!/,""),T,A,N;if(_=_||0,/(^css!|\.css$)/.test(y))N=p.createElement("link"),N.rel="stylesheet",N.href=S,T="hideFocus"in N,T&&N.relList&&(T=0,N.rel="preload",N.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(y))N=p.createElement("img"),N.src=S;else if(N=p.createElement("script"),N.src=S,N.async=g===void 0?!0:g,A="noModule"in N,/^module!/.test(y)){if(!A)return h(l,"l");N.type="module"}else if(/^nomodule!/.test(y)&&A)return h(l,"l");N.onload=N.onerror=N.onbeforeload=function(G){var At=G.type[0];if(T)try{N.sheet.cssText.length||(At="e")}catch(Tt){Tt.code!=18&&(At="e")}if(At=="e"){if(_+=1,_<v)return u(l,h,m,_)}else if(N.rel=="preload"&&N.as=="style")return N.rel="stylesheet";h(l,At,G.defaultPrevented)},b(l,N)!==!1&&p.head.appendChild(N)}function d(l,h,m){l=l.push?l:[l];var _=l.length,p=_,g=[],v,b;for(v=function(y,S,T){if(S=="e"&&g.push(y),S=="b")if(T)g.push(y);else return;_--,_||h(g)},b=0;b<p;b++)u(l[b],v,m)}function f(l,h,m){var _,p;if(h&&h.trim&&(_=h),p=(_?m:h)||{},_){if(_ in n)throw"LoadJS";n[_]=!0}function g(v,b){d(l,function(y){c(p,y),v&&c({success:v,error:b},y),i(_,y)},p)}if(p.returnPromise)return new Promise(g);g()}return f.ready=function(h,m){return s(h,function(_){c(m,_)}),f},f.done=function(h){i(h,[])},f.reset=function(){n={},o={},a={}},f.isDefined=function(h){return h in n},f})}(Ie)),Ie.exports}var im=sm();const Ga=Qg(im);class cm{constructor(e,r){$(this,"assets");$(this,"loadStatus");$(this,"win",window);$(this,"_onSuccessList",[]);$(this,"_onErrorList",[]);this.assets=JSON.parse(JSON.stringify(e||[])),this.loadStatus="INIT",r!=null&&r.window&&(this.win=r.window)}load(e){const r=this.assets||[],n=[];for(let o=0;o<r.length;o++){const a=r[o];a.id||(a.id=rt()),n.push(a.id);const s=a.resources.map(i=>i.src);s.length&&Ga(s,a.id,{async:(e==null?void 0:e.async)??!1,before:(i,c)=>(this.win.document.body.appendChild(c),!1)})}return new Promise((o,a)=>{if(r.length===0){this._onSuccessList.forEach(s=>s()),o("");return}Ga.ready(n,{success:()=>{this._onSuccessList.forEach(s=>s()),o("")},error:s=>{this._onErrorList.forEach(i=>i(s)),a(s)}})})}onSuccess(e){return this._onSuccessList.push(e),this}onError(e){return this._onErrorList.push(e),this}}C.AssetLoader=cm,C.ComponentInstanceManager=La,C.DYNAMIC_COMPONENT_TYPE=le,C.DefaultDropPlaceholder=Va,C.DefineReactAdapter=xa,C.DesignRender=nm,C.INNER_EVENT_LIST=Ma,C.InnerPropList=Ta,C.ON_DID_RENDER=qr,C.ON_WILL_DESTROY=Kr,C.ReactAdapter=kg,C.RefManager=tr,C.Render=Ia,C.canAcceptsRef=to,C.collectVariable=zu,C.compWrapper=eo,C.convertCodeStringToFunction=It,C.findComponentByChainRefer=ao,C.flatObject=ku,C.formatSourceStylePropertyName=ro,C.getAdapter=tn,C.getCSSTextValue=Gu,C.getComponentsLibs=Hu,C.getInheritObj=Ze,C.getMatchVal=no,C.getNodeCssClassName=Xe,C.getObjFromArrayMap=Ye,C.getThirdLibs=Wu,C.isClass=Bu,C.runExpression=St,C.shouldConstruct=Zn,C.useDesignRender=om,C.useRender=qg,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
|
|
87
|
+
*/var os;function Xl(){if(os)return z;os=1;function e(a){var i="https://react.dev/errors/"+a;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)i+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+a+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(a){var i=a,c=a;if(a.alternate)for(;i.return;)i=i.return;else{a=i;do i=a,(i.flags&4098)!==0&&(c=i.return),a=i.return;while(a)}return i.tag===3?c:null}function n(a){if(t(a)!==a)throw Error(e(188))}function r(a){var i=a.alternate;if(!i){if(i=t(a),i===null)throw Error(e(188));return i!==a?null:a}for(var c=a,f=i;;){var p=c.return;if(p===null)break;var u=p.alternate;if(u===null){if(f=p.return,f!==null){c=f;continue}break}if(p.child===u.child){for(u=p.child;u;){if(u===c)return n(p),a;if(u===f)return n(p),i;u=u.sibling}throw Error(e(188))}if(c.return!==f.return)c=p,f=u;else{for(var l=!1,h=p.child;h;){if(h===c){l=!0,c=p,f=u;break}if(h===f){l=!0,f=p,c=u;break}h=h.sibling}if(!l){for(h=u.child;h;){if(h===c){l=!0,c=u,f=p;break}if(h===f){l=!0,f=u,c=p;break}h=h.sibling}if(!l)throw Error(e(189))}}if(c.alternate!==f)throw Error(e(190))}if(c.tag!==3)throw Error(e(188));return c.stateNode.current===c?a:i}function s(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a;for(a=a.child;a!==null;){if(i=s(a),i!==null)return i;a=a.sibling}return null}function o(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a;for(a=a.child;a!==null;){if(a.tag!==4&&(i=o(a),i!==null))return i;a=a.sibling}return null}return z.doesFiberContain=function(a,i){for(var c=a.alternate;i!==null;){if(i===a||i===c)return!0;i=i.return}return!1},z.findCurrentFiberUsingSlowPath=r,z.findCurrentHostFiber=function(a){return a=r(a),a!==null?s(a):null},z.findCurrentHostFiberWithNoPortals=function(a){return a=r(a),a!==null?o(a):null},z.getContainerFromFiber=function(a){return a.tag===3?a.stateNode.containerInfo:null},z.getNearestMountedFiber=t,z.getSuspenseInstanceFromFiber=function(a){if(a.tag===13){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null},z.isFiberMounted=function(a){return t(a)===a},z.isFiberSuspenseAndTimedOut=function(a){var i=a.memoizedState;return a.tag===13&&i!==null&&i.dehydrated===null},z.isMounted=function(a){return(a=a._reactInternals)?t(a)===a:!1},z}var as;function Zl(){return as||(as=1,pn.exports=Xl()),pn.exports}var ef=Zl();function tf(e){return e._reactInternals}function wf(e){return e}function nf(e){const t=tf(e);if(t===void 0){if(typeof e.render=="function")throw new Error("Unable to find node on an unmounted component.");{const r=Object.keys(e).join(",");throw new Error(`Argument appears to not be a ReactComponent. Keys: ${r}`)}}const n=ef.findCurrentHostFiber(t);return n===null?null:n.stateNode}function rf(e){return nf(e)}class is{constructor(){E(this,"instanceMap",new Map)}get(t){return this.instanceMap.get(t)}add(t,n){const r=this.instanceMap.get(t);r?r.push(n):this.instanceMap.set(t,[n])}remove(t,n){const r=this.instanceMap.get(t);if(n!==void 0&&Array.isArray(r)){const s=r.filter(o=>o!==n);this.instanceMap.set(t,s)}else this.instanceMap.delete(t)}destroy(){this.instanceMap.clear()}}const cs=e=>{const{node:t}=e,n=N.useMemo(()=>{const i=t.isContainer();return F(i)?i:{placeholder:"Drag the component to place it",width:"100%",height:"100%",style:{}}},[t]),{placeholder:r,height:s,width:o,style:a}=n;return N.createElement("div",{style:{margin:0,padding:0,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",minHeight:"50px",width:o,height:s,boxSizing:"border-box",...a}},r)};class sf extends N.Component{constructor(n){super(n);E(this,"instanceManager",new is);E(this,"renderRef");E(this,"dropPlaceholder",cs);E(this,"_components",{});E(this,"onGetComponent",(n,r)=>{var c,f;const s=this;let o=n;const a=(f=(c=r.material)==null?void 0:c.value.advanceCustom)==null?void 0:f.wrapComponent;a&&(o=a(n,{node:r,ctx:window.__C_ENGINE_DESIGNER_PLUGIN_CTX__}));class i extends N.Component{constructor(){super(...arguments);E(this,"_DESIGN_BOX",!0);E(this,"_NODE_MODEL",r);E(this,"_NODE_ID",r.id);E(this,"_UNIQUE_ID",`${r.id}_${ee()}`);E(this,"_STATUS");E(this,"_design_target_component",N.createRef());E(this,"_dom")}componentDidMount(){s.instanceManager.add(r.id,this)}getTargetComponentRef(){return this._design_target_component}componentWillUnmount(){this._STATUS="DESTROY",s.instanceManager.remove(r.id,this)}getDom(){var h,b,C,d;if(((b=(h=r.material)==null?void 0:h.value.advanceCustom)==null?void 0:b.autoGetDom)??!0){const g=rf(this),m=(C=r.material)==null?void 0:C.value.rootSelector;return m&&((d=g==null?void 0:g.querySelector)==null?void 0:d.call(g,m))||g}else return this._dom}render(){var y,v,S,M;const{children:l=[],onlyRenderChild:h,...b}=this.props,C={...b,ref:A=>{this._design_target_component.current=A}};let d=l;if(j(l)||(d=[l]),!!!d.filter(Boolean).length&&(r.isContainer()||r.value.componentName===re.ROOT_CONTAINER)){const A=(v=(y=r.material)==null?void 0:y.value.advanceCustom)==null?void 0:v.dropPlaceholder;d.push(N.createElement(A||s.dropPlaceholder,{node:r}))}return h?d:((M=(S=r.material)==null?void 0:S.value.advanceCustom)==null?void 0:M.autoGetDom)??!0?N.createElement(o,C,...d):N.createElement(o,{...C,$SET_DOM:w=>{this._dom=w}},...d)}}return N.forwardRef(function(u,l){return N.createElement(Kl,{node:r,targetComponent:i},N.createElement(i,{ref:l,...u}))})});this._components=Object.assign(this._components,this.props.components),this.renderRef=N.createRef(),n.dropPlaceholder&&(this.dropPlaceholder=n.dropPlaceholder)}updateComponents(n={}){this._components=Object.assign(this._components,n),this.forceUpdate()}componentDidMount(){var n,r;window.__CHAMN_RENDER_MODE="DESIGN",this.updateComponents(this.props.components),(r=(n=this.props).onMount)==null||r.call(n,this)}getPageModel(){var n;return(n=this.renderRef.current)==null?void 0:n.state.pageModel}rerender(n){var r;return(r=this.renderRef.current)==null?void 0:r.rerender(n)}getInstancesById(n,r){let s=[...this.instanceManager.get(n)||[]];return r!==void 0&&(s=s.filter(o=>r===(o==null?void 0:o._UNIQUE_ID))),s}getInstanceByDom(n){const r=us(n);if(!r)return null;const s=ls(r);return(s==null?void 0:s.stateNode)||null}getDomsById(n,r){const s=this.getInstancesById(n),o=[];return s==null||s.forEach(a=>{var c;if((a==null?void 0:a._STATUS)==="DESTROY")return;const i=a.getDom();if(i&&!(i instanceof Text))if(r){const f=Array.from(((c=i.querySelectorAll)==null?void 0:c.call(i,r))||[]);o.push(...f)}else o.push(i)}),o}getDomRectById(n,r){return this.getDomsById(n,r).map(a=>a==null?void 0:a.getBoundingClientRect()).filter(Boolean)}render(){const{props:n,onGetComponent:r}=this,{render:s,...o}=n;return s&&(s.ref.current=this),N.createElement(ss,{onGetComponent:r,...o,components:this._components,processNodeConfigHook:(a,i)=>{var b,C;if(i.nodeType!=="NODE")return a;const{props:c,condition:f}=a;let p={...c};const u=((b=i.value.configure)==null?void 0:b.devState)||{},l=(C=i.material)==null?void 0:C.value.fixedProps;if(l!==void 0){if(F(l))p={...p,...l};else if(typeof l=="function"){const d=l(p);p={...p,...d}}}let h=f;return u.condition===!1&&(h=u.condition),{props:Bt(p,u.props||{}),condition:h}},renderMode:"design",ref:this.renderRef})}}const us=e=>{if(!e)return null;const t=Object.keys(e).find(n=>n.startsWith("__reactInternalInstance$")||n.startsWith("__reactFiber$"))||"";return t?e[t]:us(e.parentElement)},ls=e=>{var t;return e?(t=e==null?void 0:e.stateNode)!=null&&t._DESIGN_BOX?e:ls(e.return):null},of=()=>{const e=N.useRef(null);return{ref:e,rerender:function(...t){e.current&&e.current.rerender(...t)},getInstancesById(t,n){var r;return((r=e.current)==null?void 0:r.getInstancesById(t,n))||[]},getInstanceByDom(t){var n;return((n=e.current)==null?void 0:n.getInstanceByDom(t))||null},getDomsById(t,n){var r;return((r=e.current)==null?void 0:r.getDomsById(t,n))||[]},getDomRectById(t,n){var r;return((r=e.current)==null?void 0:r.getDomRectById(t,n))||[]}}};var it={exports:{}},af=it.exports,fs;function cf(){return fs||(fs=1,(function(e,t){(function(n,r){e.exports=r()})(af,function(){var n=function(){},r={},s={},o={};function a(l,h){l=l.push?l:[l];var b=[],C=l.length,d=C,g,m,y,v;for(g=function(S,M){M.length&&b.push(S),d--,d||h(b)};C--;){if(m=l[C],y=s[m],y){g(m,y);continue}v=o[m]=o[m]||[],v.push(g)}}function i(l,h){if(l){var b=o[l];if(s[l]=h,!!b)for(;b.length;)b[0](l,h),b.splice(0,1)}}function c(l,h){l.call&&(l={success:l}),h.length?(l.error||n)(h):(l.success||n)(l)}function f(l,h,b,C){var d=document,g=b.async,m=(b.numRetries||0)+1,y=b.before||n,v=l.replace(/[\?|#].*$/,""),S=l.replace(/^(css|img|module|nomodule)!/,""),M,A,w;if(C=C||0,/(^css!|\.css$)/.test(v))w=d.createElement("link"),w.rel="stylesheet",w.href=S,M="hideFocus"in w,M&&w.relList&&(M=0,w.rel="preload",w.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(v))w=d.createElement("img"),w.src=S;else if(w=d.createElement("script"),w.src=S,w.async=g===void 0?!0:g,A="noModule"in w,/^module!/.test(v)){if(!A)return h(l,"l");w.type="module"}else if(/^nomodule!/.test(v)&&A)return h(l,"l");w.onload=w.onerror=w.onbeforeload=function(U){var ge=U.type[0];if(M)try{w.sheet.cssText.length||(ge="e")}catch(me){me.code!=18&&(ge="e")}if(ge=="e"){if(C+=1,C<m)return f(l,h,b,C)}else if(w.rel=="preload"&&w.as=="style")return w.rel="stylesheet";h(l,ge,U.defaultPrevented)},y(l,w)!==!1&&d.head.appendChild(w)}function p(l,h,b){l=l.push?l:[l];var C=l.length,d=C,g=[],m,y;for(m=function(v,S,M){if(S=="e"&&g.push(v),S=="b")if(M)g.push(v);else return;C--,C||h(g)},y=0;y<d;y++)f(l[y],m,b)}function u(l,h,b){var C,d;if(h&&h.trim&&(C=h),d=(C?b:h)||{},C){if(C in r)throw"LoadJS";r[C]=!0}function g(m,y){p(l,function(v){c(d,v),m&&c({success:m,error:y},v),i(C,v)},d)}if(d.returnPromise)return new Promise(g);g()}return u.ready=function(h,b){return a(h,function(C){c(b,C)}),u},u.done=function(h){i(h,[])},u.reset=function(){r={},s={},o={}},u.isDefined=function(h){return h in r},u})})(it)),it.exports}var uf=cf();const ds=Ql(uf);class lf{constructor(t,n){E(this,"assets");E(this,"loadStatus");E(this,"win",window);E(this,"_onSuccessList",[]);E(this,"_onErrorList",[]);this.assets=JSON.parse(JSON.stringify(t||[])),this.loadStatus="INIT",n!=null&&n.window&&(this.win=n.window)}load(t){const n=this.assets||[],r=[];for(let s=0;s<n.length;s++){const o=n[s];o.id||(o.id=ee()),r.push(o.id);const a=o.resources.map(i=>i.src);a.length&&ds(a,o.id,{async:(t==null?void 0:t.async)??!1,before:(i,c)=>(this.win.document.body.appendChild(c),!1)})}return new Promise((s,o)=>{if(n.length===0){this._onSuccessList.forEach(a=>a()),s("");return}ds.ready(r,{success:()=>{this._onSuccessList.forEach(a=>a()),s("")},error:a=>{this._onErrorList.forEach(i=>i(a)),o(a)}})})}onSuccess(t){return this._onSuccessList.push(t),this}onError(t){return this._onErrorList.push(t),this}}O.AssetLoader=lf,O.ComponentInstanceManager=is,O.DYNAMIC_COMPONENT_TYPE=ke,O.DefaultDropPlaceholder=cs,O.DefineReactAdapter=rs,O.DesignRender=sf,O.INNER_EVENT_LIST=ts,O.InnerPropList=es,O.ON_DID_RENDER=un,O.ON_WILL_DESTROY=ln,O.ReactAdapter=zl,O.RefManager=kt,O.Render=ss,O.canAcceptsRef=xr,O.collectVariable=el,O.compWrapper=Rr,O.convertCodeStringToFunction=Ee,O.findComponentByChainRefer=Fr,O.flatObject=tl,O.formatSourceStylePropertyName=Dr,O.getAdapter=gn,O.getCSSTextValue=Zu,O.getComponentsLibs=nl,O.getInheritObj=Ht,O.getMatchVal=Lr,O.getNodeCssClassName=Gt,O.getObjFromArrayMap=Ut,O.getThirdLibs=rl,O.isClass=Xu,O.runExpression=fe,O.shouldConstruct=Pr,O.useDesignRender=of,O.useRender=Yl,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})}));
|
|
88
88
|
//# sourceMappingURL=index.umd.js.map
|