UNPKG

@jiess/core

Version:

基于javascript的配置式渲染库,同时支持vue2,vue3和react

1 lines 19.3 kB
(()=>{"use strict";var t={d:(e,s)=>{for(var n in s)t.o(s,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:s[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{$check:()=>ut,$component:()=>vt,$computed:()=>bt,$entry:()=>_t,$isReactive:()=>lt,$reactive:()=>yt,$ref:()=>dt,$set:()=>mt,$useComponent:()=>gt,$watch:()=>ht,$watchEffect:()=>ft,default:()=>xt});const s="JIESS_CONSTRUCTOR",n="isJiess",i="THIS_IS_JIESS",r="JIESS_INIT_VALUE",o="_isJiessRef",c="_isJiessComputed",a="_initialParent",u=[s,"_isVue","_uid","_Ctor","__v_isRef","__v_isReactive","$$typeof","_store",{field:"install",type:"function"}],h=["is","component","$exclude"],f=(t,e,s=!0)=>{if(Object.is(t,e))return!0;const n=Object.prototype.toString.call(t);if(n!==Object.prototype.toString.call(e))return!1;if("[object Date]"===n)return t.getTime()===e.getTime();if("[object Promise]"===n)return!1;if("function"==typeof t)return String(t)===String(e);if(t&&"object"==typeof t){const n=Object.keys(t),i=Object.keys(e);if(n.length===i.length){let n=t,i=e;if(s){const s=[],r=[];if(n=d(t,(t=>(s.push(t),s.length))),i=d(e,(t=>(r.push(t),r.length))),s.length!==r.length)return!1;if(!s.every(((t,e)=>Object.is(t,r[e]))))return!1}return function(t,e){const s=Object.keys(t),n=Object.keys(e);for(let i of s){if(!n.includes(i))return!1;if(!f(t[i],e[i],!1))return!1}return!0}(n,i)}}return!1};const l=(...t)=>{},p=function(t,e,s=!0){if("exp"===e&&(e="RegExp"),Array.isArray(e))return e.some((e=>p(t,e)));if(s&&!p(e,"string",!1))throw new Error(`${e} Error:须提供字符串`);return e=(n=e).slice(0,1).toUpperCase()+n.slice(1),Object.prototype.toString.call(t)===`[object ${e}]`;var n},d=(t,e,s=new WeakSet)=>{if(p(t,["array","object"])){if(s.has(t))return e?.(t,"loop");if(s.add(t),Array.isArray(t))return t.map((t=>d(t,e,s)));if(_(t))return e?.(t,"filter")||t;{const n={};for(const i in t)if(h.includes(i))n[i]=t[i];else if(Reflect.has(t,i)){const r=t[i];n[i]=d(r,e,s)}return n}}return t},y=(t,e)=>!(!e||""!==t)||[null,void 0,NaN].some((e=>Object.is(e,t))),b=(t,e)=>!y(t,e),v=(t=!1)=>{let e;return function(s,n=100){b(e,!0)?clearTimeout(e):t&&s(),e=setTimeout(s,n)}},g=((((v(),()=>{let t=0;return function(e,s=100){let n=(new Date).getTime();n-t>s&&e(),t=n}})(),()=>{let t=!0;return function(e,s=100){t&&(t=!1,setTimeout((()=>{t=!0,e()}),s))}})(),()=>{let t=0;return function(e,s=100){let n=(new Date).getTime();n-t>s&&(t=n,e())}})(),(t,e)=>{throw new Error(`${t} Error:${e}`)}),m=(t,e,n=s)=>!!p(t,"object")&&Object.is(t[n],e),_=t=>u.some((e=>{if("string"==typeof e)return Reflect.has(t,e);{const{field:s,type:n}=e;if(Reflect.has(t,s))return p(t[s],n)}}));function x(t,e,s=l,n="数据类型"){if(p(t,e))return s();g(n,`须提供 ${e} 类型`)}const $=t=>{const e={...t},s=e.default;return delete e.default,Object.assign(e,s)};function w(t={},e="toString"){if("function"==typeof t[e]){if("string"==typeof e){const s=new RegExp(e,"g");return(t[e]+"").replace(s,"")}return t[e]+""}}const j=(()=>{const t=w();return(e,s)=>w(e,s)===t})(),R=(t,e)=>Array.isArray(t)?[...t]:p(t,"object")?{...t}:e?void g("shallowCopy","须提供对象或数组"):t,S=(t,e,s={})=>{if(t.has(e)){const n=s;s=t.get(e),"function"==typeof n&&n(s)}return s};function O(t){return m(t,"JsRender")}function P(t,e){O(t)?e(t):Array.isArray(t)&&t.forEach((t=>{O(t)&&e(t)}))}function C(t){P(t,(t=>{t.destory()}))}const E=new WeakMap;function k(t){return!(!t||"object"!=typeof t||!t[i])}const N=t=>!!p(t,"object")&&Reflect.has(t,"$proxy"),T=t=>{const{$proxy:e,field:s,done:n}=t;return n?n(e):s?e[s]:e},A=t=>{if(N(t)){const{$proxy:e,field:s="value"}=t;return e[s]}return t},J=(t,e)=>Array.isArray(t)?function(t){let e=null;return t.filter((t=>{if(!O(t))return!0;{const s=t,{_resConfig:n,_resData:i}=s;if(void 0!==n.$show){const t=i.style={...i.style};if(E.has(s)||E.set(s,t.display),n.$show){if("none"===t.display){const e=E.get(s);e?t.display=e:delete t.display}}else t.display="none"}let{$if:r=!0,$elseIf:o}=n;if(r=A(r),o=A(o),!b(o,!0))return n.hasOwnProperty("$if")?(e=!!r,r):(e=null,r);if("boolean"==typeof e){const t=o&&!e;return t&&(e=!0),t}g("$elseIf","须配合$if")}}))}(t).map(J):O(t)?t.getNative(e):b(t)?t:void 0;class D{static uid=1;constructor(t,e={}){this[s]=t,this.J_uid=D.uid++,"function"==typeof e&&(e=e(this)),Object.assign(this,e),this.bindCxt()}bindCxt(){for(const t of Reflect.ownKeys(this.__proto__))"constructor"!==t&&"string"==typeof t&&("function"==typeof this[t]&&(this[t]=this[t].bind(this)),this.freezeField(t))}resetField(t,e){Object.prototype.hasOwnProperty.call(this,t)&&Object.defineProperty(this,t,{value:e})}freezeField(t){Object.prototype.hasOwnProperty.call(this,t)&&Object.defineProperty(this,t,{writable:!1,enumerable:!0,configurable:!0})}}const V=class extends D{watcher;fn;flush;constructor(t,e,s="async"){super("Composite"),this.watcher=t,this.fn=e,this.flush=s,this.effecting="doned",this.debounce1=v()}initComputed(t,e){this.computer=!0,this.target=t,this.proxy=e}init(t,e,s,n){return this.watcher.effecter.addCurrent(this),this.done(t,e,s,n),this.watcher.effecter.removeCurrent(),this.value}done(t,e,s,n){return this.effecting="start",this.value=this.fn(t,e,s,n),this.effecting="computed",this.computer&&(this.proxy.value=this.value),this.effecting="doned",this.value}check(t){this.computer?"start"===this.effecting?g("Computed","计算中禁止赋值"):"function"==typeof t&&t((t=>{this.target.value=t,this.watcher.effecter.trigger(this.target,"value",t,this.proxy)})):"function"==typeof t&&t()}trigger(t,e,s,n){this.check(((i=l)=>{"sync"===this.flush?i(this.init(t,e,s,n)):this.debounce1((()=>i(this.init())),0)}))}},I=[Symbol.iterator,"constructor","__proto__","prototype",NaN,null,void 0,1/0],M=class extends D{watcher;current;execStack=[];mapStore;constructor(t){super("Effecter"),this.watcher=t,this.mapStore=new WeakMap}addCurrent(t){this.current&&this.execStack.push(this.current),this.current=t}removeCurrent(){this.current=this.execStack.pop()}collect(t,e){if("start"!==this.current?.effecting)return;if(I.includes(e))return;if(j(t,e))return;const s=S(this.mapStore,t),n=e;s[n]=s[n]||new Set,s[n].add(this.current),this.mapStore.set(t,s)}trigger(t,e,s,n){if(I.includes(e))return;if(j(t,e))return;this.current?.check();const i=S(this.mapStore,t);i.hasOwnProperty(e)&&i[e].forEach((i=>i.trigger(t,e,s,n))),this.watcher.update(n,e,s)}},U=(t,e)=>void 0===t?e:t;class W extends D{proxy;field;config;reuse=!1;constructor(t,e,s={}){super("Observe"),this.proxy=t,this.field=e,this.config=s,this.cbs=new Set,this.debounce1=v();const{hasKey:n,defaultValue:i,observe:r,...o}=s;this.observe(r),this.other=o,this.value=n?t[e]:R(t);const c=this.value=U(this.value,i);this.getValue(((t,e)=>{this.result=t,e&&this.dispatch(t,{value:c,...o})}))}getValue(t){const{value:e,config:s,result:n}=this,{defaultValue:i,done:r}=s;"function"==typeof r?p(r,"AsyncFunction")?(r(e,this).then((e=>t(e,!0))),t(U(n,i))):t(r(e,this)):t(e)}observe(t){return"function"==typeof t&&this.cbs.add(t),this}resolve(t){const e=this.value,s={value:t,oldValue:e,...this.other};let{isSync:n,hasKey:i,sameState:r=!1}=this.config;if(i){try{r=f(e,t)}catch(t){console.error(t)}if(r)return;this.value=t,this.oldValue=e,this.getValue((t=>this.dispatch(t,s)))}else{const e=()=>{this.value=R(t),this.getValue((t=>this.dispatch(t,s)))};n?e():this.debounce1((()=>e()),0)}}dispatch(t,e){e.oldResult=this.result,e.result=this.result=t,this.cbs.forEach((s=>s(t,e.oldResult,e)))}}const K=class extends D{watcher;constructor(t){super("Observer"),this.watcher=t}create(t,e){return _(t)&&"Target"!==t[s]?t:x(t,["array","object"],(()=>{const s=new Proxy(t,{get:(t,s,n)=>s===i||("_initialTarget"===s?t:s===a?e:s===Symbol.toStringTag?Array.isArray(t)?"Array":"Object":(this.watcher.effecter.collect(t,s),m(t,!0,c)&&"value"===s?t.getValue():Reflect.get(t,s,n))),set:(t,s,n,i)=>(s===a&&(e=n),!!Object.is(t[s],n)||(this.trigger(t,s,n,i),Reflect.set(t,s,n,i))),deleteProperty:(t,e)=>(e in t&&this.trigger(t,e,void 0,s),Reflect.deleteProperty(t,e))});for(const e in t)h.includes(e)||p(t[e],["array","object"])&&(t[e]=this.create(t[e],s));return s}),"创建响应式数据")}trigger(t,e,s,n){const{effecter:i}=this.watcher;m(t,!0,c)?t.setValue(s,e):i.trigger(t,e,s,n)}},F=class extends D{_setter;_composite;constructor(){super("Target"),this[i]=!0,this.value=r,this[c]=!0}initSetter(t){this._setter=t}initComposite(t){this._composite=t}getValue(){return this.value===r&&(this.value=this._composite?.init()),this.value}setValue(t,e){"value"!==e?g("Computed","仅允许对value赋值"):"function"==typeof this._setter?this._setter(t):"computed"===this._composite?.effecting||g("Computed","须提供setter")}},B=new WeakMap,z=new WeakMap;class q extends D{static instance;effecter;observer;constructor(){return super("Watcher"),this.observer=new K(this),this.effecter=new M(this),q.instance?q.instance:q.instance=this}createProxy(t){let e=!1;const s=d(t,((t,s)=>{"loop"===s&&(e=!0)}));return e?this.observer?.create(s):this.observer?.create(t)}createComputed(t,e){const s=new F,n=this.createProxy(s);if(p(t,"object")){const{get:e,set:n}=t;"function"==typeof e&&(t=e),"function"==typeof n&&s.initSetter(n)}const i=new V(this,t,e);return s.initComposite(i),i.initComputed(s,n),n}watchEffect(t,e){new V(this,t,e).init()}observe(t={$proxy:{}}){const{$proxy:e,field:s,warn:n=!0,...r}=t,a=Reflect.has(e,c)||Reflect.has(e,o)?"value":s,u=r.hasKey=p(a,["number","string"]);if(e[i]){const t=new W(e,a,r);if(u){const s=S(B,e,[]),n=a;s[n]=s[n]||[],s[n].push(t),B.set(e,s)}else{const s=S(z,e,[]);z.set(e,s),s.push(t)}return t}if(!n)return T(t);if("function"==typeof n){const t=r.done,s=n(e,a);return t?t(s):s}console.warn("$proxy:需要定义为响应式对象")}bind(t,e,s,{cb:n}){if(!p(s,["number","string"])){const i=s,r=this.createProxy(i);return r[a]=t,"function"==typeof n?n(r):e&&(t[e]=r),r}t[e]=s}update(t,e,s){S(B,t,(t=>{const n=t[e];Array.isArray(n)&&n.forEach((t=>t.resolve(s)))})),this.resolveParent(t)}resolveParent(t){S(z,t,(e=>{Array.isArray(e)&&e.forEach((e=>e.resolve(t)))}));const e=t[a];e?.[i]&&this.resolveParent(e)}}let H=1,L="jiess";const G=class extends D{ctx;expose={};isDestory=!1;constructor(t,e){super("JsRender"),this.ctx=t,this._buildNode(e)}_buildNode({config:t,data:e}){e.is=gt(e.is),this[n]=m(e.is,!0,n),this._resData=this._initParam(e),this._resConfig=this._initParam(t);const{$ref:s}=this._resConfig;"function"==typeof s?this.ctx.nextTick((()=>{((t=l,e=0)=>{let s=setTimeout((()=>{null!==s&&clearTimeout(s),t()}),e)})((()=>s(this.expose,this)))})):p(s,"object")&&s[o]&&(s.value=this.expose)}_initParam(t){const e={};for(const s in t){const n=t[s];p(n,["object","array"])?this._analyObserve(e,n,s):e[s]=n}return e}_analyObserve(t,e,s){const i=this.ctx._slotRender;if("$if"!==s&&"$elseIf"!==s&&this[n])t[s]=e;else if(N(e))if(k(e.$proxy)){const n=(e=this.ctx._observe(e)).result;t[s]="children"===s?i.initNodes(n):n,e.observe(((e,n)=>{this.isDestory||("children"===s?(C(n),t[s]=i.initNodes(e)):t[s]=e,this.ctx.forceUpdate())}))}else t[s]=T(e);else t[s]="children"===s?i.initNodes(e):e}_initKey(t,e){return p(t,"object")&&y(t.key)&&(t.key=b(e)?`${L}_${e}`:"auto_"+H++),t}_injectKey({J_uid:t}){let{key:e}=this._resData;if(e){if("string"==typeof e){if(e.startsWith("_static_"))return;if(Number(e.split("_")[1])===t)return}}else e=this.J_uid;this._resData.key=`${L}_${t}_${e}`}getNative(t){const{ctx:e,_resData:s}=this,{component:i,_slotRender:r}=e,{is:o,key:c,children:a,...u}=s;if(m(o,!0,n)){if(!this._vnode){const{jiessEnv:e}=i,{slot:s,...n}=u,r=this._initKey({is:o,key:c,slot:s},t);this._vnode=e.createVNode(r,(()=>(this.component=new rt(o,e),{NativeComponent:this.component.start(n,a,this),component:this.component})))}return this._vnode}return r.toRender(this,t)}destory(){this.isDestory||(this.isDestory=!0,this[n]?this.component&&C(this.ctx._nodes):C(this._resData.children))}},Q=[];class X extends D{contextParam;static instance;$env="";$render;$moTag="div";JiessComponent;constructor(t={},e){super("Jiess"),this.contextParam=e,Object.assign(this,t),X.instance=this}static addCtx(t){Q.push(t)}static removeCtx(t){Q.splice(Q.indexOf(t),1)}static useCtx(){return Q[Q.length-1]}useInjects(t){if(this.contextParam){const{$page:e,...s}=this.contextParam;return"function"==typeof e&&(s.$page=e.call(t,this)),s}}}const Y=X,Z=class extends D{ctx;constructor(t,e){super("Attrs"),this.ctx=t,this.config={},this.data={},this.init(this.initAttrs(e))}initAttrs({...t}={}){const e=t.class||t.className,{env:s}=this.ctx.component.jiessEnv;return delete t.class,delete t.className,e&&(t["vue3"===s?"class":"className"]=e),t}init(t){const{env:e}=this.ctx.component.jiessEnv,{children:s,...n}=function(t,e){const{$mergeAttrs:s,...n}=e;return Object.assign(n,s?.[t])}(e,t);var i,r,o;return i=["$if","$ref","$elseIf","$name","$show","$slots","$render","$observe","$slotData","$mergeAttrs"],r=n,o=this.config,i.forEach((t=>{r.hasOwnProperty(t)&&(o[t]=r[t],delete r[t])})),b(s)&&(n.children=s),this.data=n,this}},tt=new WeakMap,et=class extends D{ctx;attrs;constructor(t,e){if(super("Done"),this.ctx=t,this.attrs=e,tt.has(e))return tt.get(e);tt.set(e,this)}beginSetup(t){const{ctx:e}=this,s={},{setup:n,props:i,name:r}=t,c=new Z(e,this.attrs);s.$param=c.data,s.$props=function(t,e,s=""){if(e){let n="",i={};return s&&(n=`${s} 组件 `),x(e,"function",(()=>{let s=e();x(s,"object",(()=>{for(let e in s){const r=s[e];let c,a=!1,u=null,h=!1,f=!1;if("string"==typeof r)u=r;else if("object"==typeof r){const t=r;u=t.type,c=t.default,f=!!t.isRef,a=!!t.required,h=!!t.isResponsive}a&&!t.hasOwnProperty(e)&&g(`${n}${e}`,"必须");const l=t=>{if(void 0!==t)return"string"!=typeof u||p(t,u)||g(`${n}${e}`,`须提供 ${u} 类型`),t},d=t=>t&&"object"==typeof t&&t[o],y=t.hasOwnProperty(e)?t[e]:c;h&&!k(y)&&g(`${n}${e}`,"须提供 Jiess 响应式数据"),d(y)?(l(y.value),i[e]=y):void 0!==y&&f?g(`${n}${e}`,"须提供 JiessRef 响应式数据"):i[e]=l(y)}}),`${n}Props 返回`)}),`${n}Props 定义`),i}return{...t}}(c.data,i,r),e.expose(s),x(n,["function","asyncFunction"],(()=>{Y.addCtx(e),n.call(e,s.$props,s.$param),Y.removeCtx(e)}),"setup函数")}buildRender(t=this.attrs){return this.jsRender&&!this.jsRender.isDestory||(this.jsRender=new G(this.ctx,new Z(this.ctx,t))),this.jsRender}},st=class extends D{ctx;children;constructor(t,e){super("SlotRender"),this.ctx=t,this.children=e}initNodes(t){return y(t)?t:[t].flat(1/0).filter((t=>b(t))).map((t=>{if("function"==typeof t)return t;if("object"!=typeof t)return t+"";if(!("$slot"in t))return O(t)?t:new et(this.ctx,t).buildRender();{const{$slot:e="default",...s}=t,{slots:n,baseCnf:i}=this.initSlots(e,s);if(b(n))return this.initNodes(n);if(p(s,"object"))return this.initNodes(i)}}))}initSlots(t="default",{$slotData:e,...s}={}){const{$slots:n}=this.ctx.PJR?._resConfig||{};if(n&&"object"==typeof n){let i=n[t];return p(i,"function")&&(i=i.call(this.ctx,e)),"default"===t&&b(this.children)&&(i=b(i)?i:this.children),{baseCnf:s,slots:i}}return{baseCnf:s,slots:this.children}}toRender(t,e){const{$moTag:s,$env:n}=this.ctx.jiess,{is:i=s,children:r,...o}=t._resData;t._initKey(o,e);const c=this.getSlots(o,r,t);return"JiessFragment"===i?"vue3"===n?c.default.call(this):c:this.$h(i,o,c,t)}$h(t,e,s,n){const{jiessEnv:i}=this.ctx.component;return i.createElement(t,e,s,n)}getSlots(t,e,s){const{ctx:n}=this,{env:i}=n.component.jiessEnv,r=t=>{const e=this.initNodes(t);return P(e,(t=>t._injectKey(s))),J(e)};let{$slots:o}=s._resConfig||{};if("react"!==i){t.scopedSlots=t.scopedSlots||{};const s=t.scopedSlots;o={...o};let c={};for(let t in o){let e=o[t];"vue2"===i?"function"==typeof e?s[t]=t=>r(e.call(n,t)):c[t]=r(e):c[t]=t=>r(p(e,"function")?e.call(n,t):e)}return c.hasOwnProperty("default")||("vue2"===i?s.hasOwnProperty("default")||b(e)&&(c.default=r(e)):b(e)&&(c.default=()=>r(e))),"vue2"===i?Object.values(c).flat(1/0):c}if(b(e)){let t=r(e);return t.length>1?t:t[0]}}};function nt(t,e=1/0,s){const{_provideData:n,PJR:i}=s?.ctx||{},r=n;return p(r,"object")&&r.hasOwnProperty(t)?r[t]:i&&e>0?nt(t,--e,i):null}const it=class extends D{component;PJR;$obs={};_provideData={};_slotRender;_nodes=[];_lifts={beforeRender:[],beforeMount:[],mounted:[],beforeUpdate:[],updated:[],beforeUnmount:[]};constructor(t,e,s,n){const{IS:i,jiessEnv:r}=t;super("Context",(t=>r.jiess.useInjects(t))),this.component=t,this.PJR=n,this.jiess=r.jiess,this._slotRender=new st(this,s),new et(this,e).beginSetup(i)}forceUpdate(){this.component.frame?.forceUpdate()}onBeforeRender(t){this._lifts.beforeRender.push({fn:t,once:!1})}onBeforeMount(t){this._lifts.beforeMount.push({fn:t,once:!1})}onMounted(t){this._lifts.mounted.push({fn:t,once:!1})}onBeforeUpdate(t,e=!1){this._lifts.beforeUpdate.push({fn:t,once:e})}onUpdated(t,e=!1){this._lifts.updated.push({fn:t,once:e})}onBeforeUnmount(t){this._lifts.beforeUnmount.push({fn:t,once:!1})}nextTick(t){switch(this.jiess.$env){case"vue3":this.jiess.nextTick(t);break;case"vue2":this.component.frame?.$nextTick(t);break;default:y(t)}}add(...t){return this._nodes=[...this._nodes,...this._slotRender.initNodes(t)],this}native(...t){return J(this._slotRender.initNodes(t))}provide(t={}){Object.assign(this._provideData,t)}inject(t,e){return nt(t,e,this.PJR)}expose(t){this.PJR&&Object.assign(this.PJR.expose,t)}_buildVNodeTree(){let t=J(this._nodes);return this._lifts.beforeRender.forEach((e=>{"function"==typeof e.fn&&(t=e.fn(t)||t,e.once&&delete e.fn)})),t}_observe({key:t,...e}){const{$proxy:s,field:n="value"}=e;let i=null;if(t&&"string"==typeof t){this.$obs[t]=this.$obs[t]||new WeakMap;const r=this.$obs[t].get(s)||{};Reflect.has(r,n)&&(e={defaultValue:r[n].result,...e}),i=r[n]=(new q).observe(e),this.$obs[t].set(s,r)}else i=(new q).observe(e);return i}},rt=class extends D{IS;jiessEnv;cpn;ctx;frame;frameProps={};constructor(t,e){super("Component"),this.IS=t,this.jiessEnv=e,this[n]=!0}start(t={},e,s){return this.cpn=this.cpn||this.component(t,e,s)}component(t,e,s){return this.jiessEnv.component(this,(()=>{const n={...t};return this.ctx=new it(this,n,e,s),t=>{this.ctx._lifts[t].forEach((t=>{"function"==typeof t.fn&&(t.fn(),t.once&&delete t.fn)}))}}))}},ot=new WeakMap,ct=new WeakMap,at={},ut=m;function ht(t,e,s){const n={};e&&("object"==typeof e?Object.assign(n,e):n.field=e);const i=(new q).observe({$proxy:t,...n});m(i,"Observe")&&i.observe(s)}const ft=(t,e="async")=>x(t,"function",(()=>(new q).watchEffect(t,e))),lt=t=>k(t);let pt=1;function dt(t){return yt({value:t,[o]:!0,__uid:pt++})}function yt(t){return x(t,["Object","Array"],(()=>{let e=null;return ot.has(t)?e=ot.get(t):(e=(new q).createProxy(t),ot.set(t,e)),e}))}function bt(t,e="async"){return x(t,["Object","Function"],(()=>{let s=null;return ct.has(t)?s=ct.get(t):(s=(new q).createComputed(t,e),ct.set(t,s)),s}))}function vt(t,e){x(t,"string"),at[t]=e}function gt(t){return at[t]||t}function mt(t,e,s,n={}){return(new q).bind(t,e,s,n)}function _t(t,e,s){const i=new Y($(e),s);return new t(i,(({is:t,setup:e,jiessEnv:s})=>{if(m(t,!0,n));else{if("function"!=typeof e)throw new Error("须提供(组件is)或(setup函数)");t={isJiess:!0,name:"JiessComponent",setup:e}}return new rt(t,s)})),i}const xt=_t;module.exports=e})();