@chamn/render 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +15 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +527 -510
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +16 -10
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(C,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],$):(C=typeof globalThis<"u"?globalThis:C||self,$(C.CRender={},C.React))})(this,function(C,$){"use strict";var gm=Object.defineProperty;var mm=(C,$,Pt)=>$ in C?gm(C,$,{enumerable:!0,configurable:!0,writable:!0,value:Pt}):C[$]=Pt;var w=(C,$,Pt)=>mm(C,typeof $!="symbol"?$+"":$,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 qa(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 Ja=Object.prototype,Ka=Ja.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)?qa(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 ws(t){return function(){return t}}var pe=function(){try{var t=yt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),$s=pe?function(t,e){return pe(t,"toString",{configurable:!0,enumerable:!1,value:ws(e),writable:!0})}:cn,Ns=Es($s),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 Fe(t,e,r){e=="__proto__"&&pe?pe(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function qt(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)&&qt(n,r))||r===void 0&&!(e in t))&&Fe(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?Fe(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)?qt(r[e],t):!1}function Fs(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 Vs=Object.prototype;function Ve(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Vs;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,qs="[object Arguments]",Js="[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[qs]=I[Js]=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,Jt=bn&&typeof module=="object"&&module&&!module.nodeType&&module,bi=Jt&&Jt.exports===bn,Be=bi&&en.process,_n=function(){try{var t=Jt&&Jt.require&&Jt.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 wi(t){if(!Ve(t))return Oi(t);var e=[];for(var r in Object(t))Ei.call(t,r)&&r!="constructor"&&e.push(r);return e}function $i(t){return he(t)?On(t):wi(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=Ve(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,Fi=Li.hasOwnProperty;function Vi(t){var e=this.__data__;return Kt?e[t]!==void 0:Fi.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=Vi,bt.prototype.set=Bi;function Gi(){this.__data__=[],this.size=0}function me(t,e){for(var r=t.length;r--;)if(qt(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 qi(t){return me(this.__data__,t)>-1}function Ji(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=qi,ot.prototype.set=Ji;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 wn(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 $n=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=$n(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]",wc="\\u200d",xn=Ec+"?",In="["+Oc+"]?",$c="(?:"+wc+"(?:"+[Tn,Mn,Pn].join("|")+")"+In+xn+")*",Nc=In+xn+$c,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=wn(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(wn(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 Fc(t){return this.__data__.has(t)}var Vc=200;function Uc(t,e){var r=this.__data__;if(r instanceof ot){var n=r.__data__;if(!Qt||n.length<Vc-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=Fc,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,Fn=Object.getOwnPropertySymbols,qc=Fn?function(t){return t==null?[]:(t=Object(t),zc(Fn(t),function(e){return Wc.call(t,e)}))}:kc;function Jc(t,e,r){var n=e(t);return nt(t)?n:ec(n,r(t))}function Vn(t){return Jc(t,$i,qc)}var He=yt(X,"DataView"),We=yt(X,"Promise"),qe=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(qe),tu=vt(Le),dt=gt;(He&&dt(new He(new ArrayBuffer(1)))!=kn||Qt&&dt(new Qt)!=Un||We&&dt(We.resolve())!=Bn||qe&&dt(new qe)!=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"&&!Ve(t)?ys($n(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 g=t[f],b=e[f];if(n)var p=s?n(b,g,f,e,t,a):n(g,b,f,t,e,a);if(p!==void 0){if(p)continue;l=!1;break}if(h){if(!iu(e,function(m,v){if(!cu(h,v)&&(g===m||o(g,m,r,n,a)))return h.push(v)})){l=!1;break}}else if(!(g===b||o(g,b,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]",wu="[object DataView]",Wn=lt?lt.prototype:void 0,Je=Wn?Wn.valueOf:void 0;function $u(t,e,r,n,o,a,s){switch(r){case wu: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 qt(+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(Je)return Je.call(t)==Je.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=Vn(t),c=i.length,u=Vn(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),g=a.get(e);if(h&&g)return h==e&&g==t;var b=!0;a.set(t,e),a.set(e,t);for(var p=s;++f<c;){l=i[f];var m=t[l],v=e[l];if(n)var y=s?n(v,m,l,e,t,a):n(m,v,l,t,e,a);if(!(y===void 0?m===v||o(m,v,r,n,a):y)){b=!1;break}p||(p=l=="constructor")}if(b&&!p){var _=t.constructor,S=e.constructor;_!=S&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof S=="function"&&S instanceof S)&&(b=!1)}return a.delete(t),a.delete(e),b}var Mu=1,qn="[object Arguments]",Jn="[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?Jn:dt(t),u=i?Jn:dt(e);c=c==qn?_e:c,u=u==qn?_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):$u(t,e,c,r,n,o,a);if(!(r&Mu)){var h=d&&Kn.call(t,"__wrapped__"),g=f&&Kn.call(e,"__wrapped__");if(h||g){var b=h?t.value():t,p=g?e.value():e;return a||(a=new at),o(b,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&&!qt(t[e],r)||r===void 0&&!(e in t))&&Fe(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 Fu(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),g=!l&&!h&&Ge(c);d=c,l||h||g?nt(i)?d=i:Du(i)?d=_s(i):h?(f=!1,d=Gc(c)):g?(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))Fu(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 Vu(t,e){return Qn(t,e)}var Uu=Fs(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}`),`
|
|
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
2
|
var ${t} = {};
|
|
3
3
|
|
|
4
4
|
${e.keyListVar}.forEach(function (key) {
|
|
@@ -11,7 +11,7 @@ ${e.keyListVar}.forEach(function (key) {
|
|
|
11
11
|
enumerable: true
|
|
12
12
|
});
|
|
13
13
|
});
|
|
14
|
-
`},Bu=function(t){return!(!t||typeof t!="function"||!t.prototype)};function Zn(t){const e=t==null?void 0:t.prototype;return!!(e&&e.isReactComponent)}function to(t){var n,o;const r=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.forward_ref"):60112;return(t==null?void 0:t.$$typeof)===r||((n=t==null?void 0:t.prototype)==null?void 0:n.isReactComponent)||((o=t==null?void 0:t.prototype)==null?void 0:o.setState)||t._forwardRef}function eo(t){class e extends
|
|
14
|
+
`},Bu=function(t){return!(!t||typeof t!="function"||!t.prototype)};function Zn(t){const e=t==null?void 0:t.prototype;return!!(e&&e.isReactComponent)}function to(t){var n,o;const r=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.forward_ref"):60112;return(t==null?void 0:t.$$typeof)===r||((n=t==null?void 0:t.prototype)==null?void 0:n.isReactComponent)||((o=t==null?void 0:t.prototype)==null?void 0:o.setState)||t._forwardRef}function eo(t){class e extends w.Component{render(){return w.createElement(t,this.props)}}return e.displayName=t.displayName,e}const St=(t,e)=>{const r=n=>{let o=`function run () { return ${n}; }`;return String(n).includes("return ")&&(o=`function runExp () { ${n} }`),It({funcBody:o,funcName:"run",nodeContext:e.nodeContext,storeManager:e.storeManager,nodeModel:e.nodeModel})()};try{return r(t)}catch(n){console.warn(n);const o=`[${t}] expression run failed`;return console.warn(o),null}},It=t=>{const{funcBody:e,funcName:r,nodeContext:n,storeManager:o,$$response:a,nodeModel:s,actionVariableSpace:i}=t,c=r||"anonymous";return{[c]:function(...d){let f;const h=Object.keys(i||{}).map(m=>`var ${m} = $ACTION_VAR_SPACE[${JSON.stringify(m)}];`);try{return f=`
|
|
15
15
|
var $$$__args__$$$ = Array.from(arguments);
|
|
16
16
|
function $$_run_$$() {
|
|
17
17
|
var __extraParams = $$$__args__$$$.pop();
|
|
@@ -21,8 +21,9 @@ ${e.keyListVar}.forEach(function (key) {
|
|
|
21
21
|
var $CTX = __extraParams.$$context;
|
|
22
22
|
var $$context = $CTX;
|
|
23
23
|
var $PARAMS = $$context.params || {};
|
|
24
|
-
var
|
|
24
|
+
var $EVENT_PARAMS = $$$__args__$$$[0];
|
|
25
25
|
var $Event = $$$__args__$$$[0];
|
|
26
|
+
var $EVENT = $$$__args__$$$[0];
|
|
26
27
|
var $ARGS = $$$__args__$$$;
|
|
27
28
|
|
|
28
29
|
var $ACTION_VAR_SPACE = __extraParams.actionVariableSpace;
|
|
@@ -53,24 +54,29 @@ ${Xn("$U_STATE",{keyListVar:"$ALL_NODE_IDS ",getReadValCode:"return function (ne
|
|
|
53
54
|
return $$_f_$$.apply($$_f_$$, $$$__args__$$$);
|
|
54
55
|
}
|
|
55
56
|
return $$_run_$$();
|
|
56
|
-
`,new Function(f)(...d,{$$context:n,storeManager:o,$$response:a,actionVariableSpace:i,nodeModel:s})}catch(g){console.warn(g)}}}[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},qu={},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(g=>g(e,h))}},o=()=>e,c={setState:n,getState:o,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(qu?"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},Ju=t=>t?so(t):so;class Ku{constructor(){w(this,"storeMap",new Map)}addStore(e,r){const n=Ju(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(){w(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(){w(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 F=Array.isArray,lo=W?W.prototype:void 0,fo=lo?lo.toString:void 0;function po(t){if(typeof t=="string")return t;if(F(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 J(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(!J(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(!J(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,wl=function(){function t(){}return function(e){if(!J(e))return{};if(go)return go(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function $l(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 Fl(t,e,r){return e===e?Ll(t,e,r):Rl(t,Dl,r)}function Vl(t,e){var r=t==null?0:t.length;return!!r&&Fl(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),$l(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(!J(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 ql=Object.prototype;function lr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||ql;return t===r}function Jl(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,wo=Zl?Z.Buffer:void 0,tf=wo?wo.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]",wf="[object Uint32Array]",R={};R[vf]=R[yf]=R[bf]=R[_f]=R[Sf]=R[Of]=R[Cf]=R[Ef]=R[wf]=!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 $f(t){return tt(t)&&ur(t.length)&&!!R[Ot(t)]}function fr(t){return function(e){return t(e)}}var $o=typeof C=="object"&&C&&!C.nodeType&&C,ee=$o&&typeof module=="object"&&module&&!module.nodeType&&module,Nf=ee&&ee.exports===$o,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):$f,jf=Object.prototype,Af=jf.hasOwnProperty;function jo(t,e){var r=F(t),n=!r&&Zt(t),o=!r&&!n&&te(t),a=!r&&!n&&!o&&pr(t),s=r||n||o||a,i=s?Jl(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(!J(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 Ff=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vf=/^\w*$/;function hr(t,e){if(F(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||er(t)?!0:Vf.test(t)||!Ff.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,qf=Wf.hasOwnProperty;function Jf(t){var e=this.__data__;return ne?e[t]!==void 0:qf.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 wt(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])}}wt.prototype.clear=Uf,wt.prototype.delete=Bf,wt.prototype.get=Hf,wt.prototype.has=Jf,wt.prototype.set=Qf;function Yf(){this.__data__=[],this.size=0}function we(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=we(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=we(e,t);return r<0?void 0:e[r][1]}function rd(t){return we(this.__data__,t)>-1}function nd(t,e){var r=this.__data__,n=we(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function 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 wt,map:new(oe||st),string:new wt}}function ad(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function $e(t,e){var r=t.__data__;return ad(e)?r[typeof e=="string"?"string":"hash"]:r.map}function sd(t){var e=$e(this,t).delete(t);return this.size-=e?1:0,e}function id(t){return $e(this,t).get(t)}function cd(t){return $e(this,t).has(t)}function ud(t,e){var r=$e(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 F(t)?t:hr(t,e)?[t]:gd(md(t))}function Ft(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[Ft(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 F(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 V(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 wd(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 $d(){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=$d,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 Fo(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 Vo(){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)}))}:Vo;function Fd(t,e){return Rt(t,yr(t),e)}var Vd=Object.getOwnPropertySymbols,Bo=Vd?function(t){for(var e=[];t;)mr(e,yr(t)),t=vr(t);return e}:Vo;function Ud(t,e){return Rt(t,Bo(t),e)}function Go(t,e,r){var n=e(t);return F(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"),Vt=Et(Z,"Set"),zo="[object Map]",Bd="[object Object]",ko="[object Promise]",Ho="[object Set]",Wo="[object WeakMap]",qo="[object DataView]",Gd=Ct(Sr),zd=Ct(oe),kd=Ct(Or),Hd=Ct(Vt),Wd=Ct(sr),Q=Ot;(Sr&&Q(new Sr(new ArrayBuffer(1)))!=qo||oe&&Q(new oe)!=zo||Or&&Q(Or.resolve())!=ko||Vt&&Q(new Vt)!=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 qo;case zd:return zo;case kd:return ko;case Hd:return Ho;case Wd:return Wo}return e});var qd=Object.prototype,Jd=qd.hasOwnProperty;function Kd(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Jd.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 Jo=W?W.prototype:void 0,Ko=Jo?Jo.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)?wl(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,wp=Zo?fr(Zo):Ep,$p=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]",Fp="[object String]",Vp="[object Symbol]",Up="[object WeakMap]",Bp="[object ArrayBuffer]",Gp="[object DataView]",zp="[object Float32Array]",kp="[object Float64Array]",Hp="[object Int8Array]",Wp="[object Int16Array]",qp="[object Int32Array]",Jp="[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[qp]=x[Ip]=x[Rp]=x[ra]=x[Dp]=x[Lp]=x[Fp]=x[Vp]=x[Jp]=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&$p,c=e&Np,u=e&jp;if(r&&(s=o?r(t,n,o,a):r(t)),s!==void 0)return s;if(!J(t))return t;var d=F(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 Fo(t,i);if(f==ra||f==ta||l&&!o){if(s=c||l?{}:Yo(t),!i)return c?Ud(t,xd(s,t)):Fd(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),wp(t)?t.forEach(function(p){s.add(ae(p,e,r,p,t,a))}):Op(t)&&t.forEach(function(p,m){s.set(m,ae(p,e,r,m,t,a))});var g=u?c?_r:br:c?re:Ee,b=d?void 0:g(t);return Il(b||t,function(p,m){b&&(m=p,p=t[m]),cr(s,m,ae(p,e,r,m,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 g=t[f],b=e[f];if(n)var p=s?n(b,g,f,e,t,a):n(g,b,f,t,e,a);if(p!==void 0){if(p)continue;l=!1;break}if(h){if(!nh(e,function(m,v){if(!oa(h,v)&&(g===m||o(g,m,r,n,a)))return h.push(v)})){l=!1;break}}else if(!(g===b||o(g,b,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,wr=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(wr)return wr.call(t)==wr.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),g=a.get(e);if(h&&g)return h==e&&g==t;var b=!0;a.set(t,e),a.set(e,t);for(var p=s;++f<c;){l=i[f];var m=t[l],v=e[l];if(n)var y=s?n(v,m,l,e,t,a):n(m,v,l,t,e,a);if(!(y===void 0?m===v||o(m,v,r,n,a):y)){b=!1;break}p||(p=l=="constructor")}if(b&&!p){var _=t.constructor,S=e.constructor;_!=S&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof S=="function"&&S instanceof S)&&(b=!1)}return a.delete(t),a.delete(e),b}var wh=1,ia="[object Arguments]",ca="[object Array]",Ae="[object Object]",$h=Object.prototype,ua=$h.hasOwnProperty;function Nh(t,e,r,n,o,a){var s=F(t),i=F(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&wh)){var h=d&&ua.call(t,"__wrapped__"),g=f&&ua.call(e,"__wrapped__");if(h||g){var b=h?t.value():t,p=g?e.value():e;return a||(a=new K),o(b,p,r,n,a)}}return l?(a||(a=new K),Eh(t,e,r,n,o,a)):!1}function $r(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,$r,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?$r(u,c,jh|Ah,n,d):f))return!1}}return!0}function la(t){return t===t&&!J(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=Ft(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)&&(F(t)||Zt(t)))}function Rh(t,e){return t!=null&&Ih(t,e,xh)}var Dh=1,Lh=2;function Fh(t,e){return hr(t)&&la(e)?fa(Ft(t),e):function(r){var n=To(r,t);return n===void 0&&n===e?Rh(r,t):$r(e,n,Dh|Lh)}}function Vh(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)?Vh(Ft(t)):Uh(t)}function Nr(t){return typeof t=="function"?t:t==null?nr:typeof t=="object"?F(t)?Fh(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=F(c),h=!l&&te(c),g=!l&&!h&&pr(c);d=c,l||h||g?F(i)?d=i:Ar(i)?d=mo(i):h?(f=!1,d=Fo(c,!0)):g?(f=!1,d=Qo(c,!0)):d=[]:V(c)||Zt(c)?(d=i,Zt(i)?d=kh(i):(!J(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),J(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,wd(e,0,-1))}var ha=Wl(function(t,e,r){da(t,e,r)}),qh="Expected a function";function Jh(t){if(typeof t!="function")throw new TypeError(qh);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[Ft(pa(e))]}function Qh(t){return V(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(!J(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=Ft(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=J(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,Jh(Nr(e)))}var og=1/0,ag=Vt&&1/Er(new Vt([,-0]))[1]==og?function(t){return new Vt(t)}:Nl,sg=200;function ig(t,e,r){var n=-1,o=Vl,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 G(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: \`${G(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: ${G(e)}`}})}function $t(){return pt("boolean",t=>typeof t=="boolean")}function xr(t){const e={},r=t.map(n=>G(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: ${G(n)}`}})}function _a(){return pt("func",t=>typeof t=="function"||`Expected a function, but received: ${G(t)}`)}function z(t){const e=G(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: ${G(n)}`}})}function gg(){return pt("never",()=>!1)}function Sa(){return pt("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${G(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: ${G(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: ${G(r)}`}})}function E(){return pt("string",t=>typeof t=="string"||`Expected a string, but received: ${G(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: ${G(r)}`}})}function k(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: ${G(r)}`,...o]}})}function mg(){return pt("unknown",()=>!0)}const Ir=M({package:E(),version:E(),name:E(),exportName:O(E()),destructuring:O($t()),subName:O(E()),main:O(E()),cssPaths:O(D(E()))}),vg=D(Ir);var U=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t.ACTION="ACTION",t.EVENT="EVENT",t))(U||{}),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=>!V(t)||[U.SLOT,U.EXPRESSION,U.FUNCTION].includes(t==null?void 0:t.type)?!1:(Ut(t,ie(E(),Lr)),!0)),Lr=k([E(),Sa(),$t(),M({type:z(U.SLOT),renderType:xr([Dr.FUNC,Dr.COMP]),params:O(D(E())),value:Bt(()=>k([Gt,D(Gt)]))}),M({type:z(U.EXPRESSION),value:E()}),M({type:z(U.FUNCTION),value:E()}),M({type:z(U.ACTION),handler:P()}),yg(),D(Bt(()=>Lr))]);var Ca=(t=>(t.COMPONENTS="COMPONENTS",t))(Ca||{});const Ea=M({type:z(U.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(k([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(k([$t(),Ea])),loop:O(M({open:$t(),data:k([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=k([E(),M({label:E(),tip:O(E())})]),bg=M({type:z("shape"),value:D(M({name:E(),title:Te,valueType:Bt(()=>Me)}))}),_g=M({type:z("enums"),value:D(E())});M({type:z("array"),value:Bt(()=>Me)});const Sg=M({type:z("array"),value:Bt(()=>D(Me))}),Me=k([xr(["array","boolean","number","object","string"]),xr(["component","expression","function"]),bg,_g,Sg]),Og=k([E(),M({componentName:E(),props:O(P()),initialValue:O(P()),component:O(P()),hiddenLabel:O($t())})]),Fr=M({name:E(),title:Te,valueType:Me,description:O(E()),defaultValue:P(),setters:O(D(Og)),condition:O(_a())});k([E(),_a()]);var Vr=(t=>(t.SINGLE="single",t.GROUP="group",t))(Vr||{});k([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:k([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(k([Fr,M({title:O(Te),type:z("single"),content:Fr}),M({title:O(Te),type:z("group"),content:D(Fr)})])),events:O(P()),methods:O(P()),fixedProps:O(P()),isContainer:O(k([$t(),M({placeholder:E(),width:E(),height:E()})])),disableEditorDragDom:O(P()),isLayout:O($t()),rootSelector:O(E()),advanceCustom:O(P()),extra:O(ie(P(),P()))}),wg=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}
|
|
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}
|
|
57
58
|
originData: ${JSON.stringify(e)}`):new Error(`${JSON.stringify(e)}
|
|
58
59
|
data struct format is invalidate`);return o.message||r?console.warn(`${o.message||r}
|
|
59
60
|
originData: ${JSON.stringify(e)}`):console.warn(`${JSON.stringify(e)}
|
|
60
|
-
data struct format is invalidate`),o},Ur=t=>{const{data:e,message:r,throwError:n,dataStruct:o}=t;return
|
|
61
|
-
`)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var ct=(t=>(t.ROOT_CONTAINER="RootContainer",t))(ct||{});const $g=M({type:z(U.FUNCTION),value:E()}),Ng=Pr(ba(Gt,["componentName"]),M({componentName:z("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&&(F(n)?r.value=n.map(a=>new L(a,{parent:e,materials:o})):V(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(V(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return F(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const wa=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===Vr.SINGLE?e.push(n.content):n.type===Vr.GROUP&&(e=[...e,...wa(n.content)]):e.push(r)}),e},Br=(t,e,r)=>{if(t.type)return t.type===U.SLOT?new zt(t,{parent:e,materials:r}):t;if(V(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)=>V(t)?Br(t,e,r):F(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 wa((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(F(o))return o.map(a=>n(a));if(V(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})},$a=(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(V(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=$a(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=$a(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=[];F(t.children)?o=t.children.map(s=>s instanceof L?s:V(s)?new L(s,{parent:e,materials:r}):s):t.children instanceof L?o.push(t.children):t.children&&V(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)===U.EXPRESSION,ja=t=>(t==null?void 0:t.type)===U.FUNCTION,Mg=t=>(t==null?void 0:t.type)===U.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=>V(e)?!Object.keys(e).length:F(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(V(i)){const c=i;Object.keys(c).forEach(u=>{a(c[u])});return}if(F(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(!F(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 Fg=M({version:O(E()),name:O(E()),css:O(E()),lifecycle:O(P()),props:O(P()),methods:O(D($g)),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:Fg,throwError:!1}),t),qr=(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=qr(e,this,this.materialsModel),this.assetPackagesList=[...(r==null?void 0:r.assetPackagesList)||[],...this.data.assets||[]]}updatePage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=qr(e,this,this.materialsModel),this.emitter.emit("onPageChange",{value:this.data,preValue:r,node:this})}reloadPage(e){const r=this.data;e&&(this.rawData=JSON.parse(JSON.stringify(e)),this.data=qr(e,this,this.materialsModel)),this.emitter.emit("onReloadPage",{value:this.data,preValue:r,node:this})}get value(){return this.data}getNode(e){if(!e)return;const r=this.data.componentsTree;return 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(V(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"],Jr="ON_DID_RENDER",Kr="ON_WILL_DESTROY",Ma=[Jr,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]}),$.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() {
|
|
61
|
+
data struct format is invalidate`),o},Ur=t=>{const{data:e,message:r,throwError:n,dataStruct:o}=t;return $g(({data:a})=>{try{return ya(a,o),{isValidate:!0}}catch(s){let i=s;return s instanceof ma&&(i=s.failures().map(c=>`【${c.path.join(".")}】: ${c.message}
|
|
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() {
|
|
62
63
|
${f.value}
|
|
63
|
-
}`,nodeContext:n,storeManager:o,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace,nodeModel:e.nodeModel});let h;e.$$response!==void 0?h=l(e.$$response,...a):h=l(...a),h!=null&&h.then?s[f.id]=await h:s[f.id]=h}if(f.type==="JUMP_LINK"){const h=
|
|
64
|
+
}`,nodeContext:n,storeManager:o,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace,nodeModel:e.nodeModel});let h;e.$$response!==void 0?h=l(e.$$response,...a):h=l(...a),h!=null&&h.then?s[f.id]=await h:s[f.id]=h}if(f.type==="JUMP_LINK"){const h=Fg(f,e)(...a);h!=null&&h.then?s[f.id]=await h:s[f.id]=h}if(f.type==="REQUEST_API"){const{run:l,afterFailedResponse:h,afterSuccessResponse:m}=Ug(f,e);try{const _=l(...a);_!=null&&_.then?s[f.id]=await _:s[f.id]=_,f.responseVarName&&(e.actionVariableSpace[f.responseVarName]=s[f.id]);const p=m(s[f.id],...a);return p!=null&&p.then?await p:p}catch(_){const p=await h(_);return p!=null&&p.then?await p:p}}if(f.type==="CALL_NODE_METHOD"){const h=Bg(f,e)(...a);h!=null&&h.then?s[f.id]=await h:s[f.id]=h,f.returnVarName&&(e.actionVariableSpace[f.returnVarName]=s[f.id])}if(f.type==="ASSIGN_VALUE"){const l=Gg(f,e);let h=[...a];e.$$response!==void 0&&(h=[e.$$response,h]);const m=l(...h);s[f.id]=await m}};let c=r[0];const u=new Set;for(;c;){if(u.has(c.id))return;await i(c),u.add(c.id),c=r.find(f=>(c==null?void 0:c.next)&&f.id===(c==null?void 0:c.next))}}};function Fg(t,e){return jt(t.link,e)}const jt=(t,e)=>function(...r){return Nt(t)?St(t.value,{...e.context,nodeContext:e.context,storeManager:e.storeManager,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace,nodeModel:e.nodeModel}):ja(t)?It({funcName:t.name||"",funcBody:t.value,nodeContext:e.context,storeManager:e.storeManager,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace,nodeModel:e.nodeModel})(...r):t},Ug=(t,e)=>({run:function(...a){var l,h;let s="";t.apiPath&&(s=jt(t.apiPath,e)(...a));const i=t.body||{};Object.keys(i).forEach(m=>{i[m]=jt(i[m],e)(...a)});const c=t.query||{};Object.keys(c).forEach(m=>{c[m]=jt(c[m],e)(...a)});const u=t.header||{};Object.keys(u).forEach(m=>{u[m]=jt(u[m],e)(...a)});const d=t.method||"GET";return(h=(l=e.context).requestAPI)==null?void 0:h.call(l,{url:s,method:d,header:u,body:i,query:c})},afterSuccessResponse:async(a,...s)=>{if(!t.afterSuccessResponse)return a;const i=[...t.afterSuccessResponse||[],...t.afterFailedResponse||[]];return Ht({handler:i},{...e,$$response:a})(...s)},afterFailedResponse:async(a,...s)=>{if(!t.afterFailedResponse)return a;const i=[...t.afterFailedResponse||[],...t.afterSuccessResponse||[]];return Ht({handler:i},{...e,$$response:a})(...s)}}),Bg=(t,e)=>(...r)=>{const n=It({funcName:"",funcBody:`
|
|
64
65
|
function () {
|
|
65
66
|
var args = arguments;
|
|
66
67
|
var nodeRef = $$context.nodeRefs.get(${JSON.stringify(t.nodeId)});
|
|
67
68
|
if(nodeRef && nodeRef.current) {
|
|
68
|
-
var func = nodeRef.current[${JSON.stringify(t.methodName)}];
|
|
69
|
+
var func = nodeRef.current[${JSON.stringify(t.methodName)}]?.bind(nodeRef.current);
|
|
70
|
+
var isDev = Boolean(nodeRef.current?.getTargetComponentRef);
|
|
71
|
+
if (isDev) {
|
|
72
|
+
const ins = nodeRef.current.getTargetComponentRef()?.current;
|
|
73
|
+
func = ins?.[${JSON.stringify(t.methodName)}]?.bind(ins);
|
|
74
|
+
}
|
|
69
75
|
if (func) {
|
|
70
76
|
func.apply(null, args);
|
|
71
77
|
}
|
|
72
78
|
}
|
|
73
|
-
}`,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}`,g=n(l),b=Yr(g,l,{...e}),p=u.params||[];return{component:(...y)=>{const _=Ye(y,p),S=Qr({params:_,nodeRefs:r.nodeRefs,getProps:function(){},callEventMethod:function(){}},r);return fe(b,{$$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(g=>{if(Zn(g.component)){const p=g.component;return $.createElement(p,{$$context:r,key:g.key})}else{const p=g.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 b=r.get(f);l=b==null?void 0:b.component}else{const b=o(d);l=Yr(b,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 $.Component{constructor(p){super(p);w(this,"_CONDITION",!0);w(this,"_DESIGN_BOX",!1);w(this,"_NODE_MODEL",e);w(this,"_NODE_ID",e.id);w(this,"UNIQUE_ID",`${e.id}_${rt()}`);w(this,"targetComponentRef");w(this,"listenerHandler",[]);w(this,"storeState");w(this,"storeListenDisposeList",[]);w(this,"domHeader");w(this,"mediaStyleDomMap",{});w(this,"variableSpace");w(this,"nodeName");w(this,"updateState",p=>{e.value.componentName===ct.ROOT_CONTAINER?this.setState(p):this.storeState.setState(p)});w(this,"getStyleDomById",p=>{const m=this.mediaStyleDomMap;let v=m[p];return v||(v=f.createElement("style"),m[p]=v),v.id=p,v});w(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 m=this._NODE_MODEL.value.css;m&&m.value.forEach(y=>{var A;const _=`${this.UNIQUE_ID}_${y.state}`;let S=Xe(this._NODE_MODEL);if(y.state!=="normal"&&(S=`${S}:${y.state}`),y.text){const T=this.getStyleDomById(_);T.innerText=`.${S} { ${y.text} }`,p==null||p.appendChild(T)}(A=y.media)!=null&&A.length&&y.media.forEach(T=>{const N=`${_}_${T.type}_${T.value}`,B=this.getStyleDomById(N);B.media=`screen and (${T.type}:${T.value}px)`,B.innerHTML=`.${S} { ${T.text} }`,p==null||p.appendChild(B)})})});w(this,"removeMediaCSS",()=>{const p=this.mediaStyleDomMap;Object.keys(p).forEach(m=>{var v;(v=this.domHeader)==null||v.removeChild(p[m])}),this.mediaStyleDomMap={}});w(this,"rebuildNode",()=>{this.storeListenDisposeList.forEach(p=>p()),this.removeMediaCSS(),this.connectStore(),this.addMediaCSS(),this.forceUpdate()});this.targetComponentRef=$.createRef(),this.listenerHandler=[],this.state=e.value.state||{};let m=e.value.nodeName||e.id;e.value.componentName===ct.ROOT_CONTAINER&&(m="globalState"),this.nodeName=m;const v=n.getStore(m);v?(this.storeState=v,v.setState({...e.value.state||{}})):this.storeState=n.addStore(m,()=>({...e.value.state||{}}));const y=this.storeState.subscribe(S=>{this.setStateIfChanged(S)});this.storeListenDisposeList.push(y),this.connectStore();const _=o.get(m);_?this.variableSpace=_:(this.variableSpace={staticVar:{},methods:{}},o.add(m,this.variableSpace))}setStateIfChanged(p){e.value.componentName!==ct.ROOT_CONTAINER&&this.setState(m=>{const v=typeof p=="function"?p(m):p;return Vu(m,{...m,...v})?null:v})}connectStore(){const p=Pa(e.props,S=>!!Nt(S)),m=Pa({css:e.value.css,class:e.value.classNames},S=>!!Nt(S));let v=[];[...p,...m].map(S=>{const A=S.val,T=[new RegExp(`(?<=context\\.stateManager(?:\\.|\\[["'])?)\\w+(?=(?:["']?\\])?(?:\\.|\\[)?["']?state)`,"gim"),/\$ALL_STATE(?:\.|(?:\[\s*["']))(\w+)(?=(?:["']\s*\])?)/gim,/getStateObj\(["']([^"']+)["']\)/gim],N=no(A.value,T);v=[...v,...N],/\$CTX\.globalState|\$G_STATE/.test(A.value)&&v.push("globalState")}).filter(Boolean);const y=Array.from(new Set(v)),_=[];y.length&&y.forEach(S=>{if(!S)return;n.getStore(S)||(n.addStore(S,()=>({})),console.warn(n,S,"not exits, auto create"));const T=n.connect(S,N=>{this.setStateIfChanged(N)});_.push(T)}),this.storeListenDisposeList=_}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(y=>y.name===Jr);p&&Ht(p.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{},nodeModel:e})();const m=()=>{n.setStore(e.value.nodeName||e.id,this.storeState),this.storeState.setState({...this.state,...e.value.state||{}}),this.rebuildNode()};e.onChange(m)}componentWillUnmount(){var v;this.storeListenDisposeList.forEach(y=>y()),this.removeMediaCSS(),i==null||i(this,e);const p=Kr,m=(v=e.value.eventListener)==null?void 0:v.find(y=>y.name===p);m&&Ht(m.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{},nodeModel:e})()}transformMethods(p){const{context:m}=p,v=xe({methods:e.value.methods},{$$context:m,...l,nodeModel:e}),y=e.value.methods||[],_=v.methods,S=y.reduce((A,T,N)=>(A[T.name]=_[N],A),{});m.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,m){var _;const v=((_=e.value.classNames)==null?void 0:_.map(S=>{var N;const A=S.name;return(Nt(S.status)?St(((N=S.status)==null?void 0:N.value)||"",{nodeContext:m,nodeModel:e,storeManager:n}):!1)?A:""}))||[];let y=`${p??""} ${v.join(" ")}`.trim();return e.value.css&&(y=`${Xe(e)} ${y}`.trim()),y}processNodeStyle(p){if(!e.value.style)return{};const m=xe({style:e.value.style},{$$context:p,...l,nodeModel:e});return ro(m.style||[])}processNodeChild(p,m){let v=[];if(p!==void 0)v=Array.isArray(p)?p:[p];else{const y=[];e.value.children.forEach((S,A)=>{const T=zg(S,{$$context:m,idx:A,...l});y.push(T)}),v=y}return v}processNodeConditionAndConfigHook(p,m,v){let y=e.value.condition??!0;typeof y!="boolean"&&(y=St(y.value,{nodeContext:v||{},nodeModel:e,storeManager:n}));let _={condition:y,props:p};u&&(_=u(_,e));const S=fe(t,_.props,...m);return this._CONDITION=_.condition,_.condition?S:$.createElement("div",{key:p.key,style:{display:"none"}},S)}processNodeEventListener(p){const m=e.value.eventListener,v={};return m==null||m.forEach(y=>{if(Ma.includes(y.name))return;const _=Ht(y.func,{context:p,storeManager:n,actionVariableSpace:{},nodeModel:e});v[y.name]=_}),v}createCurrentNodeCtx(){const{$$context:p}=this.props,m=e.value.nodeName||e.id,v=e.id,y={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:n,getState:()=>n.getStateObj(m),getStateObj:()=>n.getStateObj(m),getStateObjById:S=>n.getStateObj(S),stateManager:n.getStateSnapshot(),getMethods:()=>{const S=o.get(v).methods,A=c.get(v).current;return Ze(S,A)},getMethodsById:S=>{const A=o.get(S).methods,T=c.get(S).current;return Ze(A,T)},getStaticVar:()=>o.get(m).staticVar,getStaticVarById:S=>o.get(S).staticVar,callEventMethod:(S,A)=>{var N,B;const T=c.get(v).current;(B=T==null?void 0:(N=T.props)[S])==null||B.call(N,A)},getProps:()=>{const S=c.get(v).current;return S==null?void 0:S.props},nodeRefs:p.nodeRefs};return this.processRootContext(y),Qr(y,p)}injectEngEnv(){const p={},m=e.value.injectEnvList||[];if(Array.isArray(e.value.injectEnvList)){const v={[Ca.COMPONENTS]:r.components};m.reduce((y,_)=>(y[_]=v[_],y),p)}return p}renderCore(){const{$$context:p,...m}=this.props,v={key:e.id,...e.props,...m},y=this.createCurrentNodeCtx();this.transformMethods({context:y});let _=xe(v,{$$context:y,...l,nodeModel:e});const S=this.injectEngEnv();Object.assign(_,S);const A=this.processNodeClassName(_.className,y);_.className=A;const T=this.processNodeStyle(y);_.style=T;const{children:N}=_;delete _.children;const B=this.processNodeChild(N,y);if(_.ref=this.targetComponentRef,e.value.eventListener){const Tt=this.processNodeEventListener(y);_={..._,...Tt}}return this.processNodeConditionAndConfigHook(_,B,y)}renderLoop(){const{$$context:p,...m}=this.props,v={key:e.id,...e.props,...m},y=this.createCurrentNodeCtx();this.transformMethods({context:y});const _=e.value.loop;let S=[];if(_&&_.open){this.targetComponentRef.current=[];let A=_.data||[];if(Nt(_.data)){const T=_.data;A=St(T.value,{nodeContext:y||{},storeManager:n,nodeModel:e})||[]}return S=A.map((...T)=>{const N=T[1],B=[_.forName||"item",_.forIndex||"index"],At=Ye(T,B);let Tt="loopData";_.name&&(Tt=`${Tt}${_.name}`);const Mt=Qr({[Tt]:At,nodeRefs:y.nodeRefs,getProps:function(){},callEventMethod:function(){}},y);let H=xe(v,{$$context:Mt,...l,nodeModel:e});const um=this.injectEngEnv();Object.assign(H,um);const lm=this.processNodeClassName(H.className,Mt);H.className=lm;const fm=this.processNodeStyle(Mt);H.style=fm;const{children:dm}=H;delete H.children;const pm=this.processNodeChild(dm,Mt);if(H.key=`${H.key}-${N}`,Nt(_.key)){const de=_.key,hm=St(de.value,{nodeContext:Mt||{},storeManager:n,nodeModel:e});H.key+=`-${hm}`}if(H.ref=de=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[N]=de},e.value.eventListener){const de=this.processNodeEventListener(Mt);H={...H,...de}}return this.processNodeConditionAndConfigHook(H,pm,Mt)}),S}}render(){const p=e.value.loop;return p&&p.open?this.renderLoop():this.renderCore()}}return w(h,"__CP_TYPE__",le),h.displayName=`${e.value.componentName}Dynamic`,h};class xa{constructor(){w(this,"renderMode","normal");w(this,"components",{});w(this,"storeManager",new Ku);w(this,"variableManager",new Qu);w(this,"runtimeComponentCache",new Map);w(this,"onGetRef");w(this,"onGetComponent");w(this,"onComponentMount");w(this,"refManager",new tr);w(this,"onComponentDestroy");w(this,"processNodeConfigHook");w(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,g=this.getComponent(h),b=Yr(g,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={},m=h.props;return Object.keys(m).forEach(v=>{p[v]=m[v].value}),p.$$context=a,fe(b,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 $.createElement(e,{...o,...ut(n),style:s},...a)},t),{}),qg={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]),$.useEffect(()=>(r==null||r(a),()=>{n==null||n(a)}),[]);const i={boxSizing:"border-box",...a.style||{}};return $.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 $.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 $.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 $.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 $.createElement("img",{...r,...ut(e),style:o},...n)},CText:({$$attributes:t=[],content:e,...r})=>{const n={boxSizing:"border-box",...r.style||{}};return $.createElement("span",{...r,...ut(t),style:n},e)},CCanvas:({afterMount:t,beforeDestroy:e,$$attributes:r=[],...n})=>{$.useEffect(()=>(t==null||t(n),()=>{e==null||e(n)}),[]);const o={boxSizing:"border-box",...n.style||{}};return $.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 $.createElement(r,{...n,...s,style:i},...o)}};class Ia extends $.Component{constructor(r){super(r);w(this,"refManager");w(this,"dynamicComponentInstanceMap",new Map);w(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)});w(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={...qg,...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 Jg=()=>{const t=$.useRef(null);return $.useMemo(()=>({ref:t,rerender:function(...r){t.current&&t.current.rerender(...r)}}),[])};class Kg extends $.Component{constructor(r){super(r);w(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=$.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,$.createElement("p",null,"msg: ",String(this.state.error)),$.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"),$.createElement("div",{style:{display:"none"}}));return $.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:{}},q={};/**
|
|
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={};/**
|
|
74
80
|
* @license React
|
|
75
81
|
* react-reconciler-reflection.production.js
|
|
76
82
|
*
|
|
@@ -78,5 +84,5 @@ ${f.value}
|
|
|
78
84
|
*
|
|
79
85
|
* This source code is licensed under the MIT license found in the
|
|
80
86
|
* LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/var Ra;function Yg(){if(Ra)return q;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 q.doesFiberContain=function(s,i){for(var c=s.alternate;i!==null;){if(i===s||i===c)return!0;i=i.return}return!1},q.findCurrentFiberUsingSlowPath=n,q.findCurrentHostFiber=function(s){return s=n(s),s!==null?o(s):null},q.findCurrentHostFiberWithNoPortals=function(s){return s=n(s),s!==null?a(s):null},q.getContainerFromFiber=function(s){return s.tag===3?s.stateNode.containerInfo:null},q.getNearestMountedFiber=e,q.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},q.isFiberMounted=function(s){return e(s)===s},q.isFiberSuspenseAndTimedOut=function(s){var i=s.memoizedState;return s.tag===13&&i!==null&&i.dehydrated===null},q.isMounted=function(s){return(s=s._reactInternals)?e(s)===s:!1},q}var Da;function Xg(){return Da||(Da=1,Xr.exports=Yg()),Xr.exports}var Zg=Xg();function tm(t){return t._reactInternals}function wm(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(){w(this,"instanceMap",new Map)}get(e){return this.instanceMap.get(e)}add(e,r){const n=this.instanceMap.get(e);n?n.push(r):this.instanceMap.set(e,[r])}remove(e,r){const n=this.instanceMap.get(e);if(r!==void 0&&Array.isArray(n)){const o=n.filter(a=>a!==r);this.instanceMap.set(e,o)}else this.instanceMap.delete(e)}destroy(){this.instanceMap.clear()}}const Fa=t=>{const{node:e}=t,r=$.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 $.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 $.Component{constructor(r){super(r);w(this,"instanceManager",new La);w(this,"renderRef");w(this,"dropPlaceholder",Fa);w(this,"_components",{});w(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 $.Component{constructor(){super(...arguments);w(this,"_DESIGN_BOX",!0);w(this,"_NODE_MODEL",n);w(this,"_NODE_ID",n.id);w(this,"_UNIQUE_ID",`${n.id}_${rt()}`);w(this,"_STATUS");w(this,"_design_target_component");w(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,g;return((g=(h=n.material)==null?void 0:h.value.advanceCustom)==null?void 0:g.autoGetDom)??!0?rm(this):this._dom}render(){var v,y,_,S;const{children:l=[],onlyRenderChild:h,...g}=this.props;let b=l;if(nt(l)||(b=[l]),!!!b.filter(Boolean).length&&(n.isContainer()||n.value.componentName===ct.ROOT_CONTAINER)){const A=(y=(v=n.material)==null?void 0:v.value.advanceCustom)==null?void 0:y.dropPlaceholder;b.push($.createElement(A||o.dropPlaceholder,{node:n}))}return h?b:((S=(_=n.material)==null?void 0:_.value.advanceCustom)==null?void 0:S.autoGetDom)??!0?$.createElement(a,g,...b):$.createElement(a,{...g,$SET_DOM:T=>{this._dom=T}},...b)}}return $.forwardRef(function(f,l){return $.createElement(Kg,{node:n,targetComponent:i},$.createElement(i,{ref:l,...f}))})});this._components=Object.assign(this._components,this.props.components),this.renderRef=$.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=Va(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),$.createElement(Ia,{onGetComponent:n,...a,components:this._components,processNodeConfigHook:(s,i)=>{var g,b;if(i.nodeType!=="NODE")return s;const{props:c,condition:u}=s;let d={...c};const f=((g=i.value.configure)==null?void 0:g.devState)||{},l=(b=i.material)==null?void 0:b.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 Va=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:Va(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=$.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 g=[],b=l.length,p=b,m,v,y,_;for(m=function(S,A){A.length&&g.push(S),p--,p||h(g)};b--;){if(v=l[b],y=o[v],y){m(v,y);continue}_=a[v]=a[v]||[],_.push(m)}}function i(l,h){if(l){var g=a[l];if(o[l]=h,!!g)for(;g.length;)g[0](l,h),g.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,g,b){var p=document,m=g.async,v=(g.numRetries||0)+1,y=g.before||r,_=l.replace(/[\?|#].*$/,""),S=l.replace(/^(css|img|module|nomodule)!/,""),A,T,N;if(b=b||0,/(^css!|\.css$)/.test(_))N=p.createElement("link"),N.rel="stylesheet",N.href=S,A="hideFocus"in N,A&&N.relList&&(A=0,N.rel="preload",N.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(_))N=p.createElement("img"),N.src=S;else if(N=p.createElement("script"),N.src=S,N.async=m===void 0?!0:m,T="noModule"in N,/^module!/.test(_)){if(!T)return h(l,"l");N.type="module"}else if(/^nomodule!/.test(_)&&T)return h(l,"l");N.onload=N.onerror=N.onbeforeload=function(B){var At=B.type[0];if(A)try{N.sheet.cssText.length||(At="e")}catch(Tt){Tt.code!=18&&(At="e")}if(At=="e"){if(b+=1,b<v)return u(l,h,g,b)}else if(N.rel=="preload"&&N.as=="style")return N.rel="stylesheet";h(l,At,B.defaultPrevented)},y(l,N)!==!1&&p.head.appendChild(N)}function d(l,h,g){l=l.push?l:[l];var b=l.length,p=b,m=[],v,y;for(v=function(_,S,A){if(S=="e"&&m.push(_),S=="b")if(A)m.push(_);else return;b--,b||h(m)},y=0;y<p;y++)u(l[y],v,g)}function f(l,h,g){var b,p;if(h&&h.trim&&(b=h),p=(b?g:h)||{},b){if(b in n)throw"LoadJS";n[b]=!0}function m(v,y){d(l,function(_){c(p,_),v&&c({success:v,error:y},_),i(b,_)},p)}if(p.returnPromise)return new Promise(m);m()}return f.ready=function(h,g){return s(h,function(b){c(g,b)}),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){w(this,"assets");w(this,"loadStatus");w(this,"win",window);w(this,"_onSuccessList",[]);w(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=Fa,C.DefineReactAdapter=xa,C.DesignRender=nm,C.INNER_EVENT_LIST=Ma,C.InnerPropList=Ta,C.ON_DID_RENDER=Jr,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=Jg,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
|
|
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"})});
|
|
82
88
|
//# sourceMappingURL=index.umd.js.map
|