@chamn/render 0.3.15 → 0.3.17

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