var Ce=Object.defineProperty;var Z=Object.getOwnPropertySymbols;var je=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable;var q=(e,t,n)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W=(e,t)=>{for(var n in t||(t={}))je.call(t,n)&&q(e,n,t[n]);if(Z)for(var n of Z(t))Ee.call(t,n)&&q(e,n,t[n]);return e};import{n as A,t as Me}from"./vueComponentNormalizer.e7d45796.js";var ke=function(e){return Object.prototype.toString.call(e)};function ee(e){return typeof e=="function"&&/native code/.test(e.toString())}var Ae=typeof Symbol!="undefined"&&ee(Symbol)&&typeof Reflect!="undefined"&&ee(Reflect.ownKeys),x=function(e){return e};function p(e,t,n){var r=n.get,i=n.set;Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:r||x,set:i||x})}function le(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function S(e,t){return Object.hasOwnProperty.call(e,t)}function k(e){return Array.isArray(e)}function ve(e){return e!==null&&typeof e=="object"}function h(e){return ke(e)==="[object Object]"}function m(e){return typeof e=="function"}var G=void 0;try{var b=require("vue");b&&te(b)?G=b:b&&"default"in b&&te(b.default)&&(G=b.default)}catch{}var Q=null,D=null,de="__composition_api_installed__";function te(e){return e&&m(e)&&e.name==="Vue"}function Pe(e){return S(e,de)}function C(){return Q}function Ne(){var e=Q||G;return e}function Te(e){Q=e,Object.defineProperty(e,de,{configurable:!0,writable:!0,value:!0})}function K(e){D=e}function Fe(){return D}function y(){return D?I(D):null}var B=new WeakMap;function I(e){if(B.has(e))return B.get(e);var t={proxy:e,update:e.$forceUpdate,uid:e._uid,emit:e.$emit.bind(e),parent:null,root:null},n=["data","props","attrs","refs","vnode","slots"];return n.forEach(function(r){p(t,r,{get:function(){return e["$"+r]}})}),p(t,"isMounted",{get:function(){return e._isMounted}}),p(t,"isUnmounted",{get:function(){return e._isDestroyed}}),p(t,"isDeactivated",{get:function(){return e._inactive}}),p(t,"emitted",{get:function(){return e._events}}),B.set(e,t),e.$parent&&(t.parent=I(e.$parent)),e.$root&&(t.root=I(e.$root)),t}function _e(e){var t=y();return t==null?void 0:t.proxy}function H(e,t){t===void 0&&(t={});var n=e.config.silent;e.config.silent=!0;var r=new e(t);return e.config.silent=n,r}function De(e){var t=C();return t&&e instanceof t}function Ke(e,t){return function(){for(var n=[],r=0;r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Be(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,u=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)u.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return u}function Ue(e,t){for(var n=0,r=t.length,i=e.length;n{var i,u;const t=be("app"),n=(i=t==null?void 0:t.page)==null?void 0:i.getNode(e.config.id),r=(u=y())==null?void 0:u.proxy;return n==null||n.emit("created",r),Ze(()=>{n==null||n.emit("mounted",r)}),qe(()=>{n==null||n.emit("destroy",r)}),t},ct={name:"magic-ui-page",props:{config:{type:Object,defautl:()=>({})}},setup(e){e.config&&Y(e)}},ft=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("magic-ui-container",{staticClass:"magic-ui-page",attrs:{config:e.config}},[e._t("default")],2)},st=[];const ae={};var lt=A(ct,ft,st,!1,vt,null,null,null);function vt(e){for(let t in ae)this[t]=ae[t]}var dt=function(){return lt.exports}(),Se=()=>{var t;const e=(t=y())==null?void 0:t.proxy;return{show:()=>{e.$set(e.config.style,"display","initial")},hide:()=>{e.$set(e.config.style,"display","none")}}},_t={name:"magic-ui-component",props:{config:{type:Object,default:()=>({})}},setup(e){var r;const t=(r=y())==null?void 0:r.proxy,n=Y(e);return tt("hoc",t),W({tagName:R(()=>`magic-ui-${Me(e.config.type)}`),style:R(()=>n==null?void 0:n.transformStyle(e.config.style||{})),display:()=>{var u;const i=(u=e.config)==null?void 0:u.display;return typeof i=="function"?i(n):i!==!1}},Se())}},pt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.display()?n(e.tagName,{tag:"component",class:"magic-ui-component"+(e.config.className?" "+e.config.className:""),style:e.style,attrs:{id:e.config.id,config:e.config}}):e._e()},gt=[];const ue={};var yt=A(_t,pt,gt,!1,mt,null,null,null);function mt(e){for(let t in ue)this[t]=ue[t]}var we=function(){return yt.exports}(),ht={name:"magic-ui-container",components:{"magic-ui-component":we},props:{config:{type:Object,default:()=>({})}},setup(e){const t=Y(e);return W({style:R(()=>t==null?void 0:t.transformStyle(e.config.style||{})),display:()=>{var r;const n=(r=e.config)==null?void 0:r.display;return typeof n=="function"?n(t):n!==!1}},Se())}},$t=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.display()?n("div",{class:"magic-ui-container"+(e.config.className?" "+e.config.className:""),style:e.style,attrs:{id:e.config.id}},[e._t("default"),e._l(e.config.items,function(r){return n("magic-ui-component",{key:r.id,attrs:{config:r}})})],2):e._e()},bt=[];const ce={};var xt=A(ht,$t,bt,!1,St,null,null,null);function St(e){for(let t in ce)this[t]=ce[t]}var wt=function(){return xt.exports}(),Ot={name:"magic-ui-button",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})}},setup(e){var a;const t=(a=y())==null?void 0:a.proxy,n=X([]),r=R(()=>[typeof e.config.preAction=="function"?e.config.preAction:()=>!0,...n,typeof e.config.postAction=="function"?e.config.postAction:()=>!0]);function i(c){n.push(c)}async function u(){for(const c of r.value)if(typeof c=="function"&&await c(t,{model:e.model})===!1)break}const o=R(()=>{var c,v,f;return{type:"text",text:((c=e.config)==null?void 0:c.text)||"",disabledText:((v=e.config)==null?void 0:v.disabledText)||"",html:((f=e.config)==null?void 0:f.html)||""}});return{pushAction:i,clickHandler:u,textConfig:o}}},Rt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("button",{staticClass:"magic-ui-button",on:{click:e.clickHandler}},[e._t("default",function(){return[n("magic-ui-text",{attrs:{config:e.textConfig}})]})],2)},Ct=[];const fe={};var jt=A(Ot,Rt,Ct,!1,Et,null,null,null);function Et(e){for(let t in fe)this[t]=fe[t]}var Mt=function(){return jt.exports}(),kt={name:"magic-ui-text",props:{config:{type:Object,default:()=>({})},model:{type:Object,default:()=>({})},vars:{type:Object,default:()=>({})}},setup(e){var i;const t=(i=y())==null?void 0:i.proxy,n=be("hoc");return{displayText:R(()=>{var a,c;let u=((a=e.config)==null?void 0:a.text)||"";const{vars:o}=e;if((n==null?void 0:n.disabled)&&((c=e.config)==null?void 0:c.disabledText)&&(u=e.config.disabledText),typeof u=="function")return u.bind(t)(t,{model:e.model});if(Object.prototype.toString.call(o)==="[object Object]"){let v=u;return Object.entries(o).forEach(([f,s])=>{v=v.replace(new RegExp(`{{${f}}}`,"g"),s)}),v}return u||""})}},render(){var t,n,r,i;const e=(t=this.config)!=null&&t.multiple?"magic-ui-text":"magic-ui-text magic-ui-text--single-line";return typeof((n=this.$slots)==null?void 0:n.default)=="function"?ie("span",{class:e},[((i=(r=this.$slots)==null?void 0:r.default)==null?void 0:i.call(r))||""]):ie("span",{class:e,domProps:{innerHTML:this.displayText}})}};let At,Pt;const se={};var Nt=A(kt,At,Pt,!1,Tt,null,null,null);function Tt(e){for(let t in se)this[t]=se[t]}var Ft=function(){return Nt.exports}();const Dt={page:dt,container:wt,button:Mt,text:Ft,component:we},Kt={},Ht={components:Dt,plugins:Kt};window.magicPresetComponents=Ht;export{Ht as e};