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