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