omni-magic-cube
Version:
[文档中心](https://www.yuque.com/u12572940/wujiemofang) ### 商用请保留版权信息 [演示网址](http://demo.mlyt.top/) ``` 这是一个支持VUE3主流UI组件库的可视化框架 问题交流请加QQ群:685018059 ```
22 lines • 122 kB
JavaScript
"use strict";var st=Object.defineProperty;var at=(n,t,r)=>t in n?st(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r;var ue=(n,t,r)=>at(n,typeof t!="symbol"?t+"":t,r);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),I=require("@vueuse/core"),Ae=require("es-toolkit"),it=require("change-case"),lt=require("dexie"),P=require("gsap");require("@vueuse/math");const D=require("@iconify/vue"),ct=require("echarts"),ut=require("sortablejs"),J=require("vue-i18n"),dt=require("monaco-editor");function X(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>n[r]})}}return t.default=n,Object.freeze(t)}const Q=X(e),pt=X(it),ft=X(ct),S=X(dt);let mt=0;function Ee(n=""){const t=++mt;return`${n}${t}`}e.ref({SvgIcon:{icon:{default:"comps-default"},size:{default:32}}});const de=e.ref({click:["evt"],dblclick:["evt"],contextmenu:["evt"],mouseenter:["evt"],mouseleave:["evt"],keydown:["evt"],keyup:["evt"],keypress:["evt"]}),j=e.ref({beforeCreate:{codeVar:[],code:""},created:{codeVar:[],code:""},beforeMount:{codeVar:[],code:"",function:e.onBeforeMount},mounted:{codeVar:[],code:"",function:e.onMounted},beforeUpdate:{codeVar:[],code:"",function:e.onBeforeUpdate},updated:{codeVar:[],code:"",function:e.onUpdated},beforeUnmount:{codeVar:[],code:"",function:e.onBeforeUnmount},unmounted:{codeVar:[],code:"",function:e.onUnmounted},errorCaptured:{codeVar:["err","vm","info"],code:"",function:e.onErrorCaptured},activated:{codeVar:[],code:"",function:e.onActivated},deactivated:{codeVar:[],code:"",function:e.onDeactivated}}),gt=e.ref({div:{default:"auto"},span:{default:"auto"},ul:{default:{auto:!0,allowComps:["li"]}},li:{default:"auto"}}),ht="molian-cube";e.ref("https://wujie.mlyt.top/getData");const K=e.ref("http://flower.molianpro.com:33000");I.useStorage("omc_setting",{immerseLeftMode:!0,immerseRightMode:!0});const vt=Object.getPrototypeOf(async function(){}).constructor,yt=Object.getPrototypeOf(function(){}).constructor,U=(n,t,r,o)=>{const s={asyncFunction:vt,function:yt},a=`
try {
${r}
} catch (error) {
${o==="designer"?"throw error;":"console.error('[Function Execution Error]:', error);"}
}
`,i=s[n];return new i(...t,a||"")},bt=function(n,t,r){const o=e.isRef(n)?n.value:n,s=(a,i,u,f,l=[])=>{const d=f.__type;U(a,u,i,d).bind(f).call(null,...l)};Object.entries(o).forEach(([a,i])=>{const{type:u,value:f}=i;if(!f)return;const{code:l,codeVar:d}=f,p={app:Q,vars:t,...r};j.value[a].function?j.value[a].function(function(...y){s(u,l,d,p,y)}):s(u,l,d,p)})},F=function(n,t,r){const{code:o,codeVar:s=[],functionMode:a}=n.value,i=s.map((l,d)=>`const ${l} = arguments[${d}];`).join(`
`),u={app:Q,vars:t,...r},f=r.__type;return U(a,[],i?`${i}
${o}`:o,f).bind(u)},pe=["once","capture","passive"],Ct=function(n,t){if(!t[n]?.value?.modifiers)return{newKey:n,modifiers:[]};const{modifiers:r}=t[n].value,o=r.filter(i=>pe.includes(i)),s=r.filter(i=>!pe.includes(i));return{newKey:o.length>0?`${n}${o.map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join("")}`:n,modifiers:s}},Ie=(n,t,r,o,s)=>{const a=f=>Object.entries(f).reduce((l,[d,p])=>{if(!p)return l;const{newKey:y,modifiers:g}=Ct(d,f),c=p.type==="variable"&&p.value?.length?r[p.value[0]]:p.value?.code?p:null;if(c){const v=(h,...m)=>kt(c,t,o,s)(h,...m);l[y]=e.withModifiers(v,g)}return l},{}),{on:i={},nativeOn:u={}}=n;return e.mergeProps(a(i),a(u))},_e=(n,t={},r)=>{const o=e.reactive({}),s={app:Q,vars:o,...t},a=t.__type,i=u=>u?.functionMode&&["asyncFunction","function"].includes(u.functionMode)?U(u.functionMode,u.codeVar||[],u.code||"",a):U("function",[],"",a);return Object.entries(n).forEach(([u,{type:f,value:l}])=>{switch(f){case"function":o[u]=i(l).bind(s);break;case"computed":if(l?.functionMode&&["asyncFunction","function"].includes(l.functionMode)){const d={functionMode:l.functionMode,codeVar:l.codeVar||[],code:l.code||""};o[u]=xt(d,o,t)}break;default:o[u]=l}}),o},xt=(n,t,r={})=>{const o={app:Q,vars:e.reactive(t),...r},s=r.__type,a=U(n.functionMode,n.codeVar,n.code,s);return e.computed(a.bind(o))};function kt(n,t,r,o){const s=()=>F(n,t,o);return r?(...a)=>s()(...a,{$slot:r}):s}class wt{pool=new Map;maxSize=50;constructor(t){t&&(this.maxSize=t)}acquire(t){const r=this.pool.get(t)||[];return r.length>0?r.pop():null}release(t,r){this.pool.has(t)||this.pool.set(t,[]);const o=this.pool.get(t);o.length<this.maxSize&&o.push(r)}clear(){this.pool.clear()}}const Ne=e.ref("element-plus"),Vt=e.ref(!1),Te=e.ref(null),Y=e.reactive([{name:"tiny-vue",prefix:"Tiny",icon:"tinyvue",docUrl:"https://opentiny.design/tiny-vue/zh-CN/os-theme/overview",removeAttrs:["tiny_template","tiny_renderless","tiny_mode","tiny_mode_root","tiny_theme","tiny_chart_theme"],compMapping:{ButtonGroup:{},Button:{theme:"type",text:{type:"text"},size:{size:"mini"}},Tag:{size:{size:"mini"}},Input:{prefixIcon:"prefix",size:{size:"mini"}},InputNumber:{component:"Numeric",size:{size:"mini"}},Divider:{},Slider:{},Select:{size:{size:"mini"},options:n=>({default:n.map(t=>t.isGroup?{_isSlot:!0,tag:"TinyOptionGroup",attrs:{label:t.label},slots:t&&t.children.map(r=>({_isSlot:!0,tag:"TinyOption",attrs:{disabled:r.disabled,label:r.label,value:r.value}}))}:{_isSlot:!0,tag:"TinyOption",attrs:{disabled:t.disabled,label:t.label,value:t.value}})})},Switch:{size:{size:"mini"}},Tooltip:{},Popup:{component:"Popover",default:"reference",content:"default"},RadioGroup:{size:{size:"mini"}},RadioButton:{value:"label",size:{size:"mini"}},Cascader:{optionItems:"options",size:{size:"mini",separator:"."},checkStrictly:{props:{checkStrictly:!0}}},CascaderPanel:{optionItems:"options",size:{size:"mini",separator:"."},checkStrictly:{props:{checkStrictly:!0}}},Dropdown:{optionItems:n=>({dropdown:{_isSlot:!0,tag:"TinyDropdownMenu",attrs:{},slots:n&&n.map(t=>({_isSlot:!0,tag:"TinyDropdownItem",attrs:{disabled:t.disabled,onClick:t.onclick,name:t.value},slots:t.label}))}})},Collapse:{},CollapseItem:{},Dialog:{component:"DialogBox"}}},{name:"arco",prefix:"A",icon:"Arco",docUrl:"https://arco.design/vue/docs/pro/start",compMapping:{ButtonGroup:{},Button:{theme:n=>n!=="default"?{type:n}:{},text:{type:"text"}},Tag:{theme:n=>({color:n==="primary"&&"arcoblue"||n==="default"&&"gray"||"orangered"})},Input:{prefixIcon:"prefix",onEnter:{}},InputNumber:{},Divider:{},Slider:{},Select:{size:{size:"small",fieldNames:{value:"value",label:"label"}}},Switch:{},Tooltip:{content:"content"},Popup:{component:"Popover",default:"default",content:"content",trigger:{trigger:"click"}},RadioGroup:{size:{type:"button"}},RadioButton:{component:"Radio",value:"value"},Cascader:{optionItems:"options",checkStrictly:"check-strictly",size:{size:"small","path-mode":!0,"allow-clear":!0}},CascaderPanel:{optionItems:"options",checkStrictly:"check-strictly",size:{size:"small","path-mode":!0,"allow-clear":!0,style:"border-width: 0px;box-shadow: none;"}},Dropdown:{optionItems:n=>{const t=Te||Y.find(r=>r.name==="arco");return{content:{_isSlot:!0,tag:t+"Dgroup",attrs:{},slots:n&&n.map(r=>({_isSlot:!0,tag:t+"Doption",attrs:{disabled:r.disabled,onClick:r.onclick,command:r.value},slots:r.label}))}}}},Collapse:{},CollapseItem:{},Dialog:{component:"Modal",destroyOnClose:"unmount-on-close",appendToBody:"render-to-body",header:"title"}}},{name:"tdesign-vue-next",prefix:"T",icon:"TDesign",docUrl:"https://tdesign.tencent.com/vue-next/overview",compMapping:{ButtonGroup:{},Button:{theme:"theme",text:{variant:"text"}},Tag:{},Input:{prefixIcon:"prefixIcon",onKeyup:{}},InputNumber:{},Divider:{},Slider:{},Select:{},Switch:{},Tooltip:{content:{content:"content",destroyOnClose:!0}},Popup:{component:"Popup",default:"default",content:"content"},RadioGroup:{},RadioButton:{value:"label"},Cascader:{optionItems:"options"},CascaderPanel:{optionItems:"options"},Dropdown:{optionItems:n=>({options:n.map(t=>({content:t.label,value:t.value,disabled:t.disabled,onClick:t.onclick}))})},Dialog:{appendToBody:{attach:"body"}}}},{name:"element-plus",prefix:"El",icon:"ElementPlus",docUrl:"https://element-plus.org/zh-CN/",compMapping:{ButtonGroup:{},Button:{theme:"type",text:"text"},Tag:{theme:"type"},Input:{prefixIcon:"prefix",onEnter:{},textarea:{type:"textarea"}},InputNumber:{},Divider:{},Slider:{},Select:{component:"SelectV2",size:{size:"small",props:{options:"children"},clearable:!0}},Switch:{},Tooltip:{content:"content"},Popup:{component:"Popover",default:"reference",content:"default",trigger:{trigger:"click",width:"auto"}},Popconfirm:{default:"reference",content:"title",confirmBtn:"confirmButtonText",cancelBtn:"cancelButtonText"},RadioGroup:{},RadioButton:{value:"label"},Cascader:{optionItems:"options",checkStrictly:{props:{checkStrictly:!0}}},CascaderPanel:{optionItems:"options",checkStrictly:{props:{checkStrictly:!0}}},Dropdown:{optionItems:n=>({dropdown:{_isSlot:!0,tag:"ElDropdownMenu",attrs:{},slots:n&&n.map(t=>({_isSlot:!0,tag:"ElDropdownItem",attrs:{disabled:t.disabled,onClick:t.onclick,command:t.value},slots:t.label}))}})},Collapse:{},CollapseItem:{},Dialog:{visible:"modelValue","onUpdate:visible":"onUpdate:modelValue",destroyOnClose:"destroy-on-close",appendToBody:"append-to-body",header:"title"}}},{name:"ant-design-vue",prefix:"A",icon:"Ant",docUrl:"https://www.antdv.com/components/overview",compMapping:{ButtonGroup:{},Button:{theme:n=>n==="warning"?{type:"primary",danger:!0}:{type:"primary"},text:{type:"link"}},Tag:{},Input:{prefixIcon:"prefix",modelValue:"value","onUpdate:modelValue":"onUpdate:value"},InputNumber:{modelValue:"value","onUpdate:modelValue":"onUpdate:value"},Divider:{},Slider:{},Select:{modelValue:"value","onUpdate:modelValue":"onUpdate:value"},Switch:{modelValue:"value","onUpdate:modelValue":"onUpdate:value"},Tooltip:{content:"title"},Popup:{component:"Popover"},RadioGroup:{modelValue:"value","onUpdate:modelValue":"onUpdate:value",variant:{buttonStyle:"solid"}},RadioButton:{value:"label"},Cascader:{optionItems:"options",valueType:n=>n==="full"?{changeOnSelect:!0}:{},modelValue:"value","onUpdate:modelValue":"onUpdate:value"},CascaderPanel:{component:"Cascader",optionItems:"options",valueType:n=>n==="full"?{changeOnSelect:!0}:{},modelValue:"value","onUpdate:modelValue":"onUpdate:value"},Dropdown:{optionItems:n=>({overlay:{_isSlot:!0,tag:"AMenu",attrs:{},slots:n&&n.map(t=>({_isSlot:!0,tag:"AMenuItem",attrs:{disabled:t.disabled,onClick:t.onclick,command:t.value},slots:t.label}))}})},Collapse:{},CollapseItem:{},Dialog:{component:"Modal",appendToBody:{getContainer:()=>document.body,zIndex:1001},header:"title",visible:"open","onUpdate:visible":"onUpdate:open"}}},{name:"naive",prefix:"N",icon:"naive",docUrl:"https://www.naiveui.com/zh-CN/os-theme",compMapping:{ButtonGroup:{},Button:{theme:"type",text:"text"},Tag:{theme:"type"},Input:{prefixIcon:"prefix",onEnter:{},modelValue:"value","onUpdate:modelValue":"onUpdate:value"},InputNumber:{modelValue:"value","onUpdate:modelValue":"onUpdate:value"},Divider:{},Slider:{},Select:{modelValue:"value","onUpdate:modelValue":"onUpdate:value",size:{size:"small",virtualScroll:!1}},Switch:{modelValue:"value","onUpdate:modelValue":"onUpdate:value"},Tooltip:{default:"trigger",content:n=>({default:{_isSlot:!0,tag:"NEllipsis",attrs:{},slots:n}})},Popup:{component:"Popover",default:"trigger",content:"default",trigger:{trigger:"click",style:"min-width:180px;"},visible:"show","onUpdate:visible":"onUpdate:show"},RadioGroup:{modelValue:"value","onUpdate:modelValue":"onUpdate:value"},RadioButton:{value:"label"},Cascader:{optionItems:"options",checkStrictly:{checkStrategy:"all",separator:".",virtualScroll:!1,cascade:!1},modelValue:n=>({value:n[n.length-1]}),"onUpdate:modelValue":"onUpdate:value"},CascaderPanel:{component:"Cascader",optionItems:"options",checkStrictly:{checkStrategy:"all",separator:".",virtualScroll:!1,cascade:!1},modelValue:n=>({value:n[n.length-1]}),"onUpdate:modelValue":"onUpdate:value"},Dropdown:{optionItems:n=>({options:n.map(t=>({label:t.label,key:t.value,disabled:t.disabled,props:{onClick:t.onclick}}))})},Collapse:{},CollapseItem:{},Dialog:{component:"Modal",visible:"show","onUpdate:visible":"onUpdate:show",destroyOnClose:"destroy-on-close",appendToBody:{preset:"dialog",style:{width:"80vw"}},header:"title",footer:"action"}}},{name:"vexip",prefix:"V",icon:"vexip",docUrl:"https://www.vexipui.com/zh-CN/",compMapping:{ButtonGroup:{},Button:{theme:"type",text:"text"},Tag:{theme:"type"},Input:{prefixIcon:"prefix",onEnter:{},modelValue:"value","onUpdate:modelValue":"onUpdate:value"},InputNumber:{component:"NumberInput",modelValue:"value","onUpdate:modelValue":"onUpdate:value"},Divider:{},Slider:{},Select:{size:{size:"small",props:{options:"children"},transfer:"body"},modelValue:"value","onUpdate:modelValue":"onUpdate:value"},Switch:{modelValue:"value","onUpdate:modelValue":"onUpdate:value"},Tooltip:{content:n=>({default:{_isSlot:!0,tag:"NEllipsis",attrs:{},slots:n}}),default:"trigger"},Popup:{component:"Tooltip",default:"trigger",content:"default",trigger:{trigger:"click",transfer:!0}},RadioGroup:{size:{size:"small",shape:"button-group"},modelValue:"value","onUpdate:modelValue":"onUpdate:value"},RadioButton:{component:"Radio",value:"label"},Cascader:{optionItems:"options",checkStrictly:{clearable:!0,noCascaded:!0},modelValue:"value","onUpdate:modelValue":"onUpdate:value"},CascaderPanel:{component:"Cascader",optionItems:"options",checkStrictly:{clearable:!0,noCascaded:!0},modelValue:"value","onUpdate:modelValue":"onUpdate:value"},Dropdown:{optionItems:n=>({drop:{_isSlot:!0,tag:"VDropdownList",attrs:{},slots:n&&n.map(t=>({_isSlot:!0,tag:"VDropdownItem",attrs:{disabled:t.disabled,onClick:t.onclick,command:t.value},slots:t.label}))}})},Collapse:{},CollapseItem:{},Dialog:{component:"Modal",visible:"active","onUpdate:visible":"onUpdate:active",destroyOnClose:{"auto-remove":!0,undivided:!0},appendToBody:{transfer:!0},header:"title"}}}]),fe=50;function q(n,t,r,o,s=0){if(s>fe)return console.warn(`递归深度超过${fe}层,可能存在循环引用`),e.h("div",{class:"recursion-error"},"递归深度超限");const a=i=>Array.isArray(i)?i.map(u=>q(u.slots,u.attrs,u.tag,o,s+1)):typeof i=="object"&&i!==null?q(i.slots,i.attrs,i.tag,o,s+1):typeof i=="function"?i():()=>i;return o[r]?e.h(o[r],t,a(n)):(console.warn(`组件 ${r} 不存在`),e.h("div",{class:"component-not-found"},`组件 ${r} 不存在`))}const ee=new Map,St=function(n,t,r,o){const s=`${n}${t}`;if(ee.has(s))return ee.get(s);const a=e.defineComponent({inheritAttrs:!1,setup(i,{attrs:u,slots:f}){const l=e.shallowRef(o?._context?.components||{}),d=e.shallowRef(null),p=e.shallowRef({});e.onMounted(()=>{try{d.value=l.value[`${n}${t}`]}catch(c){console.error(`组件${n}${t}不存在:`,c)}}),(()=>{const c={};for(const v in f){const h=r[v]||v;c[h]=f[v]}p.value=c})();const g=e.computed(()=>{if(!Object.keys(u).length)return{ref:"ref"};const c={ref:"ref"},v=m=>{if(!m.length)return;const C={};m.forEach((b,V)=>{C[`slot${V}`]=q(b.slots,b.attrs,b.tag,l.value)}),p.value=C},h=(m,C)=>{if(C)if(Array.isArray(C))v(C);else if(!C._isSlot)c[m]=C;else{const b=p.value;b[m]=q(C.slots,C.attrs,C.tag,l.value),p.value=b}};for(const m in u){const C=typeof r[m];try{switch(C){case"string":c[r[m]]=u[m];break;case"object":r[m]&&Object.assign(c,r[m]);break;case"function":const b=r[m](u[m]);if(b)for(const V in b)h(V,b[V]);break;default:c[m]=u[m]}}catch(b){console.error(`处理属性 ${m} 时出错:`,b),c[m]=u[m]}}return c});return()=>{const c=d.value;return c?e.h(c,g.value,p.value):e.h("div",{class:"component-loading"},`加载组件 ${n}${t} 中...`)}}});return ee.set(s,a),a},At=new lt(ht);At.version(2).stores({i18n:"++id, key, UIName, value",attrs:"++id, key, UIName, value",slots:"++id, key, UIName, value"});e.ref([]);const Et=e.shallowRef({});e.ref(gt.value);const It=e.ref({}),me=e.markRaw({}),Be=function(n,t){const r=Y.find(a=>a.name===(t||Ne.value)),{prefix:o,compMapping:s}=r;for(const a in s)if(Object.hasOwnProperty.call(s,a)){const i=s[a];me["custom"+a]=St(o,i.component||a,i,n)}n.provide("customComps",me)},{Message:_t}=It.value,Nt=({comp:n,$slot:t,expandAPI:r})=>{if(!n?.directives||!Pe({comp:{directives:{if:n.directives?.if},vars:n.vars},$slot:t}))return!1;const{directives:o,vars:s}=n;if(!o.for)return!1;const a=Z(o.for,s,{slotData:t,expandAPI:r});return typeof a=="function"?!!a({$slot:t}):!!a},Pe=({comp:n,$slot:t,expandAPI:r})=>{if(!n?.directives?.if)return!0;const{directives:o,vars:s}=n,a=Z(o.if,s,{slotData:t,expandAPI:r});return typeof a=="function"?!!a({$slot:t}):!!a},ge=({comp:n,$slot:t,expandAPI:r})=>{if(!n?.directives?.show)return!0;const{directives:o,vars:s}=n,a=Z(o.show,s,{slotData:t,expandAPI:r});return typeof a=="function"?!!a({$slot:t}):!!a},Tt=(n,t,r,o,s,a)=>n.map(i=>({...i,vars:t,cacheOn:Ie({on:i.on,nativeOn:i.nativeOn},t,s,o,r)})),he=(n,t,r,o)=>{const{dataKey:s="item",idKey:a="key"}=r.directives.for,u={[`${r.key}_for`]:{[s]:n,[a]:t}};return o?{...o,...u}:u},Z=(n,t,r={})=>{const{type:o,value:s}=n;switch(o){case"variable":return!Array.isArray(s)||!s.length?void 0:s.reduce((a,i,u)=>u===0?t[i]:a?.[i],void 0);case"string":return s;case"function":return F(n,t,r.expandAPI||{})({$slot:r.slotData});default:return}},Bt=(n,t,r,o,s,a)=>{const i={};if(!n?.attrs||!t[n.name]){if(console.log("不存在组件或者属性",n.name,n.attrs),!["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"].find(g=>n?.name===g))try{_t.error(`${n?.name||"Unknown"} 组件不存在`)}catch{console.log(`${n?.name||"Unknown"} 组件不存在`)}return i}const u=(p,y)=>{if(!p.value?.length)return null;const g=p.value.reduce((v,h)=>v&&v[h]?v[h]:void 0,r);return typeof g!="function"?g:(y.type==="function"||typeof y=="function"||Array.isArray(y.type)&&y.type.includes("function"))&&s?(...v)=>g(...v,{$slot:s}):g.call(null,{$slot:s})},f=(p,y)=>{if(!p.value?.code)return null;const g=s?(...v)=>F(p,r,o)(...v,{$slot:s}):F(p,r,o);return y?.type==="function"||typeof y=="function"||Array.isArray(y?.type)&&y.type.includes("function")?g:g()||null},l=(p,y,g)=>{if(p.value===null||p.value===void 0)return null;const c=t[n.name].render||t[n.name].setup?t[n.name].props[g]:t[n.name].comp?.props[g];return typeof c=="object"&&!Array.isArray(c)?p.value!==c.default&&a==="designer"||a==="render"?p.value:null:(typeof c=="function"&&p.value!==null,p.value)},d=p=>{switch(p){case"array":return[];case"object":return{};case"boolean":return!1;case"number":return 0;default:return""}};return Object.entries(n.attrs).forEach(([p,y])=>{if(!y)return;const g=t[n.name].props[p];if(g?.hidden&&(typeof g.hidden=="function"&&g.hidden(n.attrs)||typeof g.hidden=="boolean"&&g.hidden))return;let c=null;switch(y.type){case"variable":c=u(y,g);break;case"function":c=f(y,g);break;default:c=l(y,g,p)}g?.required&&c===null&&(c=d(g.type)),e.isRef(c)&&(c=c.value),c!==null&&(i[p]=c)}),i},Pt=n=>{const{directives:t,vars:r}=n.comp,{text:o}=t;switch(o.type){case"variable":return e.computed(()=>{const s=o.value.reduce((a,i)=>a?.[i],r);return typeof s=="function"?s({comp:n.comp,$slot:n.$slot}):typeof s=="object"?JSON.stringify(s):String(s??"")});case"string":return o.value;case"function":try{return F(o,n.variable,n.expandAPI)({comp:n.comp,$slot:n.$slot})}catch{return"function Text"}default:return""}},Mt={mounted:(n,t)=>{n._once=!0,n.textContent=t.comp??n.innerHTML},updated:(n,t)=>{!n._once&&t?.comp&&(n.textContent=t.comp)}},te=(n,t,r)=>{r?Rt(n,t):n.textContent=t},$t=n=>{const t=n.comp.directives?.text?Pt(n):null,r=Object.keys(n.comp.slots||{}).length>0;return{mounted(o){n.comp.directives.text&&(e.isRef(t)?e.watch(()=>t.value,s=>te(o,s,r),{immediate:!0}):te(o,t,r)),n.comp.directives.once&&Mt.mounted(o,n)},updated(o){n.comp.directives.text&&!e.isRef(t)&&te(o,t,r)}}},Rt=(n,t)=>{let r=n.querySelector("#custom-text");if(r){if(r.textContent===t)return;r.textContent=t}else r=document.createElement("span"),r.id="custom-text",n.appendChild(r),e.nextTick(()=>{r&&(r.textContent=t)})},z=class z{static runAnimation(t,r,o){if(!(!t||!r))if(Array.isArray(r)&&r.length>1){const s=P.gsap.timeline();return r.forEach(a=>{const i=a.engine,f=(this.engines[i]||this.engines.gsap).runAnimation(t,a,o);f&&s.add(f)}),s}else{const s=Array.isArray(r)?r[0]:r,a=s?.engine;return(this.engines[a]||this.engines.gsap).runAnimation(t,s,o)}}static stopAnimation(t){t&&Object.values(this.engines).forEach(r=>{r.stopAnimation(t)})}static registerEngine(t,r){this.engines[t]=r}static convertEffectsToTweenConfig(t){const r={duration:.3,ease:"power1.out"};return t.forEach(o=>{if(o.duration&&(r.duration=o.duration),o.ease&&(r.ease=o.ease),o.type==="scale"&&o.to)r.scale=o.to.scale;else if(o.type==="fade"&&o.to)r.opacity=o.to.opacity;else if(o.type==="slide"){const s=o.properties?.distance??"100%";o.direction==="up"?r.y=`-${s}`:o.direction==="down"?r.y=s:o.direction==="left"?r.x=`-${s}`:o.direction==="right"&&(r.x=s),o.to?.x!==void 0&&o.direction!=="left"&&o.direction!=="right"&&(r.x=o.to.x),o.to?.y!==void 0&&o.direction!=="up"&&o.direction!=="down"&&(r.y=o.to.y)}else o.type==="rotate"&&o.to?r.rotation=o.to.rotation:o.type==="custom"&&o.properties&&Object.assign(r,o.properties)}),r}static createDirectAnimation(t,r){const o=this.convertEffectsToTweenConfig(r);return P.gsap.to(t,o)}static resetElementStyles(t,r=.3,o=!1){return o?(t.style.scale="",t.style.backgroundColor="",t.style.transform="",t.style.opacity="",t.style.translate="",t.style.rotate="",P.gsap.killTweensOf(t),P.gsap.set(t,{clearProps:"all"}),null):P.gsap.to(t,{scale:1,backgroundColor:"",transform:"",opacity:"",x:"",y:"",rotation:"",duration:r,ease:"power1.out",clearProps:"all"})}static runGsapAnimation(t,r,o){const s=Array.isArray(r)?r[0]:r;if(!s||!s.effects||s.effects.length===0)return null;const a=this.resolveTargets(t,s.target),i=P.gsap.timeline({...s.timeline||{},onStart:s.callbacks?.onStart?this.createCallback(s.callbacks.onStart,o):void 0,onUpdate:s.callbacks?.onUpdate?this.createCallback(s.callbacks.onUpdate,o):void 0,onComplete:s.callbacks?.onComplete?this.createCallback(s.callbacks.onComplete,o):void 0});return s.effects.forEach((u,f)=>{const l=this.convertEffectsToTweenConfig([u]),d=f===0?0:u.delay?`+=${u.delay}`:"+=0";i.to(a,{...l,stagger:s.target?.stagger},d)}),i}static runCssAnimation(t,r){const o=Array.isArray(r)?r[0]:r;if(!o||!o.effects||o.effects.length===0)return null;const s=this.resolveTargets(t,o.target),a=o.effects[0],i=s instanceof HTMLElement?[s]:Array.from(s);return i.forEach(u=>{if(!(u instanceof HTMLElement))return;u.style.animationDuration=`${a.duration}s`,u.style.animationDelay=`${a.delay||0}s`,u.style.animationFillMode="both";let f="";if(a.type==="fade"?f="fade-in":a.type==="slide"?f=`slide-${a.direction||"up"}`:a.type==="scale"?f="scale-in":a.type==="rotate"?f="rotate-in":a.type==="custom"&&a.properties?.className&&(f=a.properties.className),f){u.classList.add(f);const l=()=>{u.classList.remove(f),u.removeEventListener("animationend",l)};u.addEventListener("animationend",l)}}),{pause:()=>{i.forEach(u=>{u instanceof HTMLElement&&(u.style.animationPlayState="paused")})},play:()=>{i.forEach(u=>{u instanceof HTMLElement&&(u.style.animationPlayState="running")})},restart:()=>{i.forEach(u=>{u instanceof HTMLElement&&(u.style.animation="none",u.offsetHeight,u.style.animation="")})}}}static resolveTargets(t,r){return r?r.selector?t.querySelectorAll(r.selector):r.children?r.childSelector?t.querySelectorAll(r.childSelector):t.children:t:t}static createCallback(t,r){try{return new Function("context",`
return function() {
${t}
}.bind(context);
`)(r)}catch(o){return console.error("创建动画回调函数失败:",o),()=>{}}}};ue(z,"engines",{}),z.registerEngine("gsap",{runAnimation:(t,r,o)=>z.runGsapAnimation(t,r,o),stopAnimation:t=>{P.gsap.killTweensOf(t)}}),z.registerEngine("css",{runAnimation:(t,r,o)=>z.runCssAnimation(t,r),stopAnimation:t=>{t instanceof HTMLElement&&(t.style.animation="none")}});let E=z;class Dt{element;animations;context;enterAnimation=null;leaveAnimation=null;interactionAnimations=new Map;stateWatchers=new Map;constructor(t,r,o){this.element=t,this.animations=r,this.context=o}init(){return this.setupEnterAnimation(),this.setupInteractionAnimations(),this.setupStateChangeAnimations(),this}destroy(){this.setupLeaveAnimation(),this.cleanupInteractionAnimations(),this.cleanupStateAnimations()}resetStyles(t,r=.3){return E.resetElementStyles(t,r)}setupEnterAnimation(){return this.animations?.enter?(this.enterAnimation=E.runAnimation(this.element,this.animations.enter,this.context),this.enterAnimation):null}setupLeaveAnimation(){return this.animations?.leave?(this.leaveAnimation=E.runAnimation(this.element,this.animations.leave,this.context),this.leaveAnimation):null}setupInteractionAnimations(){if(!this.animations?.interaction)return;const t=this.animations.interaction;if(this.element){if(t.hover){const r=()=>{const s={...t.hover};if(s.effects){const a=E.createDirectAnimation(this.element,s.effects);this.interactionAnimations.set("hover",a)}else{const a=E.runAnimation(this.element,s,this.context);a&&this.interactionAnimations.set("hover",a)}},o=()=>{const s=this.interactionAnimations.get("hover");s?typeof s.reverse=="function"?s.reverse():typeof s.kill=="function"&&(s.kill(),E.resetElementStyles(this.element)):E.resetElementStyles(this.element)};this.element.addEventListener("mouseenter",r,!0),this.element.addEventListener("mouseleave",o,!0),this.interactionAnimations.set("hoverListeners",{mouseEnterHandler:r,mouseLeaveHandler:o})}if(t.click){const r=()=>{const o={...t.click};if(o.effects){const s=P.gsap.timeline();s.add(E.createDirectAnimation(this.element,o.effects));const a=o.effects[0]?.duration||.3,i=E.resetElementStyles(this.element,a);i&&s.add(i,`+=${a+.2}`)}else{const s=E.runAnimation(this.element,o,this.context);s&&setTimeout(()=>{typeof s?.reverse=="function"?s?.reverse():E.resetElementStyles(this.element)},800)}};this.element.addEventListener("click",r,!0),this.interactionAnimations.set("clickListener",r)}(this.element.__vue__||this.element._vnode)&&this.element.querySelectorAll("*").forEach((o,s)=>{s<5&&this.addInteractionToElement(o,t)})}}addInteractionToElement(t,r){if(r.hover){const o=()=>{if(r.hover.effects){const a=E.createDirectAnimation(this.element,r.hover.effects);this.interactionAnimations.set("hover-child",a)}else{const a=E.runAnimation(this.element,r.hover,this.context);this.interactionAnimations.set("hover-child",a)}},s=()=>{const a=this.interactionAnimations.get("hover-child");a?typeof a.reverse=="function"?a.reverse():typeof a.kill=="function"&&(a.kill(),E.resetElementStyles(this.element)):E.resetElementStyles(this.element)};t.addEventListener("mouseenter",o,!0),t.addEventListener("mouseleave",s,!0)}if(r.click){const o=()=>{if(r.click.effects){const s=P.gsap.timeline();s.add(E.createDirectAnimation(this.element,r.click.effects));const a=r.click.effects[0]?.duration||.3,i=E.resetElementStyles(this.element,a);i&&s.add(i,`+=${a+.2}`)}else E.runAnimation(this.element,r.click,this.context)};t.addEventListener("click",o,!0)}}cleanupInteractionAnimations(){if(this.element){if(this.interactionAnimations.has("hoverListeners")){const{mouseEnterHandler:t,mouseLeaveHandler:r}=this.interactionAnimations.get("hoverListeners");this.element.removeEventListener("mouseenter",t,!0),this.element.removeEventListener("mouseleave",r,!0)}this.interactionAnimations.has("clickListener")&&this.element.removeEventListener("click",this.interactionAnimations.get("clickListener"),!0),this.interactionAnimations.clear()}}setupStateChangeAnimations(){if(!this.animations?.stateChange||!this.context)return;const t=this.animations.stateChange;Object.keys(t).forEach(r=>{const o=r.split(".");let s=!1,a=this.context;for(const i of o)if(a&&typeof a=="object"){if(a.value!==void 0&&typeof a.value=="object")a=a.value[i];else if(i in a)a=a[i];else{s=!1;break}s=!0}else{s=!1;break}if(s){const i=(l,d)=>{const p=t[r];if(p.trigger?.condition){const y=p.trigger?.condition;let g=!1;if(y.expression)try{const c={newValue:l,oldValue:d,context:this.context};g=new Function("newValue","oldValue","context",`return ${y.expression};`)(l,d,this.context)}catch(c){console.error("Error evaluating animation condition:",c)}else if(y.operator&&y.value!==void 0)switch(y.operator){case"==":g=l==y.value;break;case"===":g=l===y.value;break;case"!=":g=l!=y.value;break;case"!==":g=l!==y.value;break;case">":g=l>y.value;break;case">=":g=l>=y.value;break;case"<":g=l<y.value;break;case"<=":g=l<=y.value;break;case"includes":g=Array.isArray(y.value)?y.value.includes(l):String(l).includes(String(y.value));break;case"startsWith":g=String(l).startsWith(String(y.value));break;case"endsWith":g=String(l).endsWith(String(y.value));break;default:g=l===y.value}else g=l===!0||l===1||l==="active";if(g)E.runAnimation(this.element,p,this.context);else{const c=this.getOppositeStateName(r);c&&t[c]&&E.runAnimation(this.element,t[c],this.context)}}else if(l===!0||l===1||l==="active")E.runAnimation(this.element,p,this.context);else if(d===!0||d===1||d==="active"){const y=this.getOppositeStateName(r);y&&t[y]&&E.runAnimation(this.element,t[y],this.context)}},u=()=>{let l=this.context;const d=o[0];if(d in l&&l[d]&&typeof l[d].value<"u"){l=l[d].value;for(let p=1;p<o.length;p++){const y=o[p];if(l&&typeof l=="object"&&y in l)l=l[y],l&&typeof l.value<"u"&&(l=l.value);else return}}else for(const p of o)if(l&&typeof l=="object"&&p in l)l=l[p],l&&typeof l.value<"u"&&(l=l.value);else return;return l},f=e.watch(u,i,{immediate:!1});this.stateWatchers.set(r,f)}})}getOppositeStateName(t){const r={active:"inactive",selected:"unselected",expanded:"collapsed",enabled:"disabled",focused:"blurred",loading:"loaded",visible:"hidden",open:"closed"};if(t in r)return r[t];for(const[o,s]of Object.entries(r))if(s===t)return o;return null}cleanupStateAnimations(){this.stateWatchers.forEach(t=>{typeof t=="function"&&t()}),this.stateWatchers.clear()}triggerAnimation(t,r){return t==="stateChange"&&this.animations?.stateChange?.[r]?E.runAnimation(this.element,this.animations.stateChange[r],this.context):t==="interaction"&&this.animations?.interaction?.[r]?E.runAnimation(this.element,this.animations.interaction[r],this.context):null}}const ve=e.defineComponent({__name:"slottemplate",props:{comp:{type:Object,default:()=>{}},expandAPI:{type:Object,default:()=>{}},slotData:{type:Object,default:()=>{}},interInc:{type:Object,default:()=>{}}},setup(n,{expose:t}){const r=e.inject("mlComps"),o=n,{variable:s,setRenderRef:a}=o.interInc,i=e.shallowRef(null);I.watchThrottled(()=>o.comp.name,m=>{m&&(i.value=r[m]?.comp||m)},{immediate:!0,throttle:50});const u=e.computed(()=>m=>!m||Object.keys(m).length===0?o.slotData||{}:{...o.slotData||{},[o.comp.id]:m}),f=e.computed(()=>Bt(o.comp,r.value,s.value,o.expandAPI,o.slotData,"render")),l=`comp_${o.comp.key}`,d=e.computed(()=>({comp:o.comp,$slot:o.slotData,variable:s.value,expandAPI:o.expandAPI})),p=e.computed(()=>$t(d.value)),y=e.ref(null);let g=null;e.onMounted(()=>{if(c()){const m=y.value.$el||y.value;g=new Dt(m,o.comp.animations,{component:y,props:f,variable:s}).init()}});function c(){if(!y.value||!o.comp.animations||Array.isArray(o.comp.animations)&&o.comp.animations.length===0||typeof o.comp.animations=="object"&&!Array.isArray(o.comp.animations)&&!Object.keys(o.comp.animations).some(b=>{const V=o.comp.animations[b];return V&&(V.keyframes||V.duration||V.trigger||V.type)}))return!1;const m=y.value.$el||y.value;return!(!m||!m.nodeType)}e.onBeforeUnmount(()=>{g&&(g.destroy(),g=null)});const v=(m,C)=>{y.value=m,a(m,C)};function h(m,C){return g?g.triggerAnimation(m,C):null}return t({triggerAnimation:h}),(m,C)=>e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(i)),e.mergeProps({id:m.comp.id,ref:b=>v(b,m.comp)},e.unref(f),{class:l}),e.createSlots({_:2},[e.renderList(m.comp.slots,(b,V)=>({name:V,fn:e.withCtx(x=>[b&&b.children?(e.openBlock(),e.createBlock(Me,{key:0,expandAPI:m.expandAPI,slotData:e.unref(u)(x),modelValue:b.children,"onUpdate:modelValue":w=>b.children=w,interInc:m.interInc},null,8,["expandAPI","slotData","modelValue","onUpdate:modelValue","interInc"])):e.createCommentVNode("",!0)])}))]),1040,["id"])),[[e.unref(p),e.unref(d)]])}}),Lt=e.defineComponent({__name:"renderfor",props:{comp:{type:Object,default:()=>{}},slotData:{type:Object,default:()=>{}},expandAPI:{type:Object,default:()=>{}},modelValue:{type:Array,default:()=>[]},interInc:{type:Object,default:()=>{}}},setup(n){const t=n,{variable:r,originVariable:o}=t.interInc,s=Ae.memoize((i,u)=>Ie({on:t.comp.on,nativeOn:t.comp.nativeOn},r.value,o.value,he(i,u,t.comp,t.slotData),t.expandAPI)),a=e.computed(()=>t.comp.directives.for.idKey);return(i,u)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.modelValue,(f,l)=>e.renderSlot(i.$slots,"default",{key:f[e.unref(a)]||l,slotData:e.unref(he)(f,l,n.comp,n.slotData),cacheOn:e.unref(s)(f,l)})),128))}});function zt(n,t,r={}){const{batchSize:o=10,timeSlice:s=5,onProgress:a,onComplete:i}=r;return new Promise(u=>{let f=0;const l=n.length;function d(p){const y=performance.now();for(;f<l&&(p?p.timeRemaining()>1:performance.now()-y<s);){const g=Math.min(f+o,l);for(let c=f;c<g;c++)t(n[c],c);f=g,a&&a(f/l)}f<l?typeof requestIdleCallback<"u"?requestIdleCallback(d):setTimeout(()=>d(),0):(i&&i(),u())}typeof requestIdleCallback<"u"?requestIdleCallback(d):setTimeout(()=>d(),0)})}function Ot(n,t,r={}){const o=[];return new Promise(s=>{zt(n,(a,i)=>{o[i]=t(a)},{...r,onComplete:()=>{r.onComplete?.(),s(o)}})})}function Ut(n){const t=e.ref(n),r=e.ref(!1),o=e.ref(0);async function s(a,i,u){if(!r.value){r.value=!0,o.value=0;try{if(i){const f=await Ot(a,i,{...u,onProgress:l=>{o.value=l,u?.onProgress?.(l)}});t.value=f}else t.value=a}finally{r.value=!1,o.value=1}}}return{data:e.readonly(t),isProcessing:e.readonly(r),progress:e.readonly(o),updateWithTimeSlicing:s}}const Ft={key:0,class:"time-slicing-loading"},jt={class:"progress-bar"},Kt={class:"loading-info"},qt=e.defineComponent({__name:"deeptreetorender",props:{modelValue:{type:Array,default:()=>[]},expandAPI:{type:Object,default:()=>{}},slotData:{type:Object,default:()=>{}},interInc:{type:Object,default:()=>{}}},setup(n,{expose:t}){const r=n,{variable:o,originVariable:s}=r.interInc,{data:a,isProcessing:i,progress:u,updateWithTimeSlicing:f}=Ut([]),l=e.ref({lastRenderTime:0,componentCount:0,useTimeSlicing:!1}),d=e.inject("componentPool");if(!d)throw new Error("componentPool not provided");const p=new Map,y=c=>{if(!c||!c.type)return c;const v=c.type,h=c.key;if(p.has(h)){const C=p.get(h);return C.props=c.props||{},C.events=c.events||{},C.directives=c.directives,C}let m=d.acquire(v);return m?(m.key=h,m.props=c.props||{},m.events=c.events||{},m.directives=c.directives):m={type:v,key:h,instance:null,props:c.props||{},events:c.events||{},directives:c.directives},p.set(h,m),m};I.watchThrottled(()=>r.modelValue,async(c,v)=>{if(JSON.stringify(c)===JSON.stringify(v))return;const h=performance.now(),m=Tt(c,o.value,r.expandAPI,r.slotData,s.value);if(!Array.isArray(m)){await f([]);return}const C=m.length;l.value.componentCount=C;const b=C>50;if(l.value.useTimeSlicing=b,b)await f(m,x=>y(x),{batchSize:10,timeSlice:5,onProgress:x=>{console.log(`渲染进度: ${Math.round(x*100)}%`)}});else{const x=m.map(w=>y(w));await f(x)}const V=performance.now();l.value.lastRenderTime=V-h,C>20&&console.log(`渲染性能: ${C}个组件, 耗时${Math.round(l.value.lastRenderTime)}ms, 使用时间切片: ${b}`)},{immediate:!0,throttle:50});const g=Ae.memoize(({comp:c,$slot:v})=>{if(c.directives.for){const h=Z(c.directives.for,o.value,{slotData:v,expandAPI:{__type:"render"}});return typeof h=="function"?h(v):h}});return e.onUnmounted(()=>{for(const[c,v]of p)d.release(v.type,v);p.clear()}),t({performanceMetrics:e.readonly(l),isProcessing:e.readonly(i),progress:e.readonly(u)}),(c,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(i)&&e.unref(l).useTimeSlicing?(e.openBlock(),e.createElementBlock("div",Ft,[v[1]||(v[1]=e.createElementVNode("div",{class:"loading-text"},"正在渲染组件...",-1)),e.createElementVNode("div",jt,[e.createElementVNode("div",{class:"progress-fill",style:e.normalizeStyle({width:`${e.unref(u)*100}%`})},null,4)]),e.createElementVNode("div",Kt,e.toDisplayString(e.unref(l).componentCount)+" 个组件 | 进度: "+e.toDisplayString(Math.round(e.unref(u)*100))+"% ",1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),h=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:h.key},[e.unref(Nt)({comp:h,$slot:c.slotData})?(e.openBlock(),e.createBlock(Lt,{key:0,modelValue:e.unref(g)({comp:h,$slot:c.slotData}),comp:h,slotData:c.slotData,expandAPI:c.expandAPI,interInc:c.interInc},{default:e.withCtx(m=>[e.withDirectives(e.createVNode(ve,e.mergeProps({comp:h,expandAPI:c.expandAPI,slotData:m.slotData},e.toHandlers(m.cacheOn),{interInc:c.interInc}),null,16,["comp","expandAPI","slotData","interInc"]),[[e.vShow,e.unref(ge)({comp:h,$slot:m.slotData})]])]),_:2},1032,["modelValue","comp","slotData","expandAPI","interInc"])):e.unref(Pe)({comp:h,$slot:c.slotData})?e.withMemo([h.directives?.if,h.key,h.props],()=>e.withDirectives((e.openBlock(),e.createBlock(ve,e.mergeProps({key:1,comp:h,expandAPI:c.expandAPI,slotData:c.slotData},e.toHandlers(h.cacheOn),{interInc:c.interInc}),null,16,["comp","expandAPI","slotData","interInc"])),[[e.vShow,e.unref(ge)({comp:h,$slot:c.slotData})]]),v,0):e.createCommentVNode("",!0)],64))),128))],64))}}),N=(n,t)=>{const r=n.__vccOpts||n;for(const[o,s]of t)r[o]=s;return r},Me=N(qt,[["__scopeId","data-v-8fd3a8a1"]]),ne=Object.entries(pt).filter(([n,t])=>typeof t=="function"&&n.endsWith("Case")).reduce((n,[t,r])=>(n[t]=r,n),{});function Ht(n,t,r){const o=e.computed(()=>{const a=e.toValue(t);if(!ne[a])throw new Error(`Invalid change case type "${a}"`);return a});if(typeof n=="function")return e.computed(()=>ne[o.value](e.toValue(n),e.toValue(r)));const s=e.ref(n);return e.computed({get(){return ne[o.value](s.value,e.toValue(r))},set(a){s.value=a}})}const Wt=function(n){return Ht(n,"kebabCase").value},$e=function(n,t){const r=[];return t.forEach(o=>{const s=[];n.forEach(a=>{const i=o.data.find(u=>u.name===a);i?s.push(i.value):s.push(0)}),r.push({name:o.name,data:s})}),r},Gt=Math.random().toString(36).substring(2,7),Jt=function(n,t){return Ee(`${t}_${Gt}_`)};e.ref(null);e.ref(null);const Xt=e.ref(null);e.ref(-1);const ye=e.ref(-1),Qt=e.ref(null),Yt=e.ref(null),Zt=e.ref(null);e.ref(!1);e.ref(!1);e.ref(null);const en=e.ref(null);e.ref(null);e.ref(-1);I.useElementBounding(en);I.useThrottleFn((n,t,r=null,o)=>{n>-1?ye.value=n:ye.value=-1,Zt.value=r,Qt.value=t,Yt.value=t.key,Xt.value=o},200);const tn=I.useStorage("omc_deviceList",[{name:"PC(720P)",width:1280,height:720,device:"PC(720P)",deviceType:"PC",resolutionRatio:"720P"},{name:"PC(1080P)",width:1920,height:1080,device:"PC(1080P)",deviceType:"PC",resolutionRatio:"1080P"},{name:"PC(1440P)",width:2560,height:1440,device:"PC(1440P)",deviceType:"PC",resolutionRatio:"1440P"},{name:"PC(3.1K)",width:3120,height:2080,device:"PC(3.1K)",deviceType:"PC",resolutionRatio:"3.1K"},{name:"PC(4K)",width:4096,height:2160,device:"PC(4K)",deviceType:"PC",resolutionRatio:"4K"},{name:"Phone(750P)",width:750,height:1334,device:"Phone(750P)",deviceType:"Phone",resolutionRatio:"750P",coverBackground:[]},{name:"iPhone15",width:1179,height:2556,device:"iPhone15",deviceType:"Phone",resolutionRatio:"iPhone15",coverBackground:[{left:100,width:979,top:0,height:140,borderRadius:[0,0,50,50]}]},{name:"iPhone15Pro",width:1179,height:2556,device:"iPhone15Pro",deviceType:"Phone",resolutionRatio:"iPhone15Pro",coverBackground:[{left:300,width:579,top:70,height:120,borderRadius:[50,50,50,50]}]},{name:"twoCamera",width:1179,height:2556,device:"twoCamera",deviceType:"Phone",resolutionRatio:"twoCamera",coverBackground:[{left:450,width:110,top:70,height:100,borderRadius:[50,50,50,50]},{left:629,width:110,top:70,height:100,borderRadius:[50,50,50,50]}]},{name:"iPad(1024P)",width:1024,height:1366,device:"iPad(1024P)",deviceType:"iPad",resolutionRatio:"1024P"},{name:"custom",width:1080,height:1920,device:"custom",deviceType:"custom",resolutionRatio:"custom"}]);e.ref(!1);e.ref("basic");e.ref("style");e.ref("");e.ref("");e.ref("");e.ref("");e.ref();e.ref();e.ref(!1);e.ref("");e.ref([]);const H=I.useStorage("omc_history",{modelValue:[],globalAttrs:{import:{},export:{},lifecycle:{},variable:{},actions:[],extend:{}}}),nn=e.ref(H.value.modelValue?H.value.modelValue:[]),W=e.reactive(H.value.globalAttrs);e.computed(()=>_e(W.variable));const on={deep:!0,debounce:500,capacity:5,clone:!0},{history:rn,undo:Ar,redo:Er,clear:Ir,canRedo:_r,canUndo:Nr}=I.useDebouncedRefHistory(nn,on);I.useStorage("omc_screenRatio",{...tn.value[0],rotate:!1});e.watch(rn,n=>{H.value={modelValue:n[0]?.snapshot??[],globalAttrs:W}});const be=e.reactive({});e.reactive({});const L=e.ref(null);e.ref();const Ce=I.useActiveElement();e.computed(()=>Ce.value?.tagName!=="INPUT"&&Ce.value?.tagName!=="TEXTAREA");const xe=e.computed(()=>L.value?L.value&&L.value.nativeOn:{});e.computed(()=>{if(!L.value)return[];const n=new Set(Object.keys(de.value)),t=xe.value?Object.keys(xe.value):[];return[...new Set([...n,...t])].map(r=>({key:r,type:"function",codeVar:de.value[r]}))});e.computed(()=>L.value?L.value&&L.value.on:{});e.computed(()=>{if(!L.value)return[];const n=Et.value[L.value.name]?.emits;return n?.length?n.filter(t=>!t.startsWith("update:")).map(t=>({key:t,type:"function"})):[]});e.computed(()=>Array.from(new Set(Object.keys(j.value).concat(W.lifecycle?Object.keys(W.lifecycle):[]))).map(t=>({key:t,type:"function",codeVar:j.value[t].codeVar})));const oe={width:"px",height:"px",fontSize:"px",lineHeight:"px",letterSpacing:"px",paragraphSpacing:"%",marginTop:"px",marginLeft:"px",marginRight:"px",marginBottom:"px",paddingTop:"px",paddingLeft:"px",paddingRight:"px",paddingBottom:"px"},se={marginTop:"",marginLeft:"",marginRight:"",marginBottom:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",moveX:{value:()=>""},moveY:{value:()=>""},units:{value:()=>""},opacity:{prop:"opacity",value:function(n){return n=="100"||!n?"":n+"%"}},rotate:{prop:"transform",value:function(n){return n&&n!=="0"?`rotate(${n}deg)`:""}},borderRadius:{isGlobal:!0,prop:"border-radius",value:function(n,t){return n.findIndex(o=>o!=="0"||!o)>-1?n&&n.map((o,s)=>R(o,t.units&&t.units.borderRadius&&t.units.borderRadius[s])).join(" "):""}},margin:{isGlobal:!0,prop:"margin",value:function(n,t){if(n){const r=n.findIndex(o=>o!=="0"||!o);return r>-1?n&&n.map(o=>R(o,t.units&&t.units.margin&&t.units.margin[r])).join(" "):""}}},padding:{isGlobal:!0,prop:"padding",value:function(n,t){if(n){const r=n.findIndex(o=>o!=="0"||!o);return r>-1?n&&n.map(o=>R(o,t.units&&t.units.padding&&t.units.padding[r])).join(" "):""}}},constX:{rawValue:function(n,t,r){if(!t.moveX||t.moveX=="0"&&!be[r])return"";const o=R(t.moveX,t.units&&t.units.moveX);if(n==="left")return{left:o};if(n==="right")return{right:o};if(n==="left2right"){let s=0;return Number(t.width)?(s=Number(t.moveX)+Number(t.width),{left:o,right:R(s,"px")}):{left:o}}}},constY:{rawValue:function(n,t,r){if(!t.moveY||t.moveY=="0"&&!be[r])return"";const o=R(t.moveY,t.units&&t.units.moveY);if(n==="top")return{top:o};if(n==="bottom")return{bottom:o};if(n==="top2bottom"){let s=0;return Number(t.height)?(s=Number(t.moveY)+Number(t.height),{top:o,bottom:R(s,"px")}):{top:o}}}},color:{prop:"color",value:function(n){return n.isShow?n.modelValue:""}},background:{prop:"background",value:function(n){return n.isShow?n.modelValue:""}},mixBlendMode:{prop:"mix-blend-mode",value:function(n){return n.isShow&&n.modelValue!=="normal"?n.modelValue:""}},blur:{prop:function(n){return n.field},value:function(n){return n.isShow&&n.modelValue&&n.modelValue!=="0"?`blur(${n.modelValue}px)`:""}},border:{prop:function(n){return n.type==="all"?"border":`border-${n.type}`},value:function(n){return n.isShow&&n.width?`${n.width}px ${n.style} ${n.color}`:""}},boxShadow:{isGlobal:!0,prop:"box-shadow",value:function(n){return n.filter(r=>!!r.isShow).map(r=>`${r.h||0}px ${r.v||0}px ${r.blur||0}px ${r.spread||0}px ${r.color}${r.type==="inset"&&" inset"||""}`).join(",")}}},sn=function(n,t){const r={};for(const o in n)if(Object.hasOwnProperty.call(n,o)){const s=n[o];if(!s)continue;se[o]?Array.isArray(s)&&!se[o].isGlobal?s.forEach(a=>{ke(a,r,o,n,t)}):ke(s,r,o,n,t):r[o]||(typeof Number(s)&&!Number.isNaN(Number(s))&&s!=0||n.units&&n.units[o]||oe[o]?(n.units||(n.units={[o]:"px"}),n.units[o]?r[o]=R(s,n.units[o]):r[o]=oe[o]?R(s,oe[o]):s):r[o]=s)}return r},re=new Map,an=n=>{if(re.has(n))return re.get(n);const t=Wt(n);return re.set(n,t),t},ln=function(n){const t=[];return Re(n,t),t.map(o=>{if(!o.value)return"";const s=[],{value:a,name:i,key:u}=o;if(Object.entries(a).filter(([l])=>l!=="customCss").forEach(([l,d])=>{s.push(`${an(l)}:${d}`)}),s.length===0&&!a.customCss)return"";let f="";if(a.customCss&&typeof a.customCss=="string"){const d=a.customCss.split(`
`).join(`
`);s.length>0?f=`.comp_${u}{
${s.join(";")};
${d}
}`:f=`.comp_${u}{${d}
}`}else f=`.comp_${u}{
${s.join(";")};
}`;return f}).filter(Boolean).join(`
`)};function ke(n,t,r,o,s){const{prop:a,value:i,rawValue:u}=se[r],f=u?u(n,o,s):i(n,o,s);if(f)if(u)for(const l in f)Object.hasOwnProperty.call(f,l)&&(t[l]=f[l]);else typeof a=="function"?t[a(n,o)]=f:t[a]=f}function Re(n,t){for(const r in n)if(Object.hasOwnProperty.call(n,r)){const o=n[r];t.push({key:o.key,name:o.name,value:sn(o.css,o.key)});const s=o.slots;if(s){for(const a in s)if(Object.hasOwnProperty.call(s,a)){const i=s[a].children;Re(i,t)}}}}function R(n,t){return t?t==="calc"?`${t}(${cn(n)})`:n+t:n+"px"}function cn(n){return n=n.replace(/ /g,""),n=n.replace(/([+\-*/])/g," $1 "),n}function un(){const n=e.ref({}),t=e.ref({}),r=e.reactive({});return{variable:n,originVariable:t,renderRef:r,setRenderRef:(s,a)=>{r[a.key]=s}}}const ae=e.defineComponent({name:"Render",__name:"index",props:{modelValue:{type:Array,default:()=>[]},globalAttrs:{type:Object,default:()=>{}},expandAPI:{type:Object,default:()=>{}}},setup(n,{expose:t}){const r=n,o=new wt(50);e.provide("componentPool",o);const s=e.ref({}),{css:a,unload:i}=I.useStyleTag("",{id:Ee("omc-r_")}),u=un(),{renderRef:f,variable:l,originVariable:d}=u,p=e.ref({});e.watchEffect(()=>{const c=r.expandAPI||{};p.value=new Proxy(c,{get(v,h){return h==="__type"?"render":v[h]}})});const y=e.ref({}),g=e.ref({});return e.watch(()=>r.globalAttrs,c=>{g.value=c,g.value.variable!==d.value&&(d.value=g.value.variable,l.value=_e(g.value.variable,p.value)),g.value.lifecycle!==s.value&&(s.value=g.value.lifecycle,bt(s,l.value,p.value))},{immediate:!0,deep:!1}),I.watchThrottled(()=>r.modelValue,c=>{y.value=c;const v=ln(y.value);v!==a.value&&(a.value=v)},{immediate:!0,throttle:50}),e.onUnmounted(()=>{i()}),t({renderRef:f,variable:l}),(c,v)=>(e.openBlock(),e.createBlock(Me,{modelValue:e.unref(y),expandAPI:e.unref(p),interInc:e.unref(u)},null,8,["modelValue","expandAPI","interInc"]))}}),dn={class:"svg-icon-wrapper",style:{}},pn=["xlink:href"],fn=e.defineComponent({name:"SvgIcon",__name:"index",props:{icon:{type:String,default:"",required:!0,expandType:"Icon"},flip:{type:String,default:"",optionItems:["","horizontal","vertical","both"]},rotate:{type:Number,default:0},color:{type:String,default:null,expandType:"Color"},size:{type:[String,Number],default:null}},setup(n){const t=n,r=e.computed(()=>/^https?:\/\//.test(t.icon)?"img":/i-[^:]+:[^:]+/.test(t.icon)?"unocss":t.icon&&t.icon.includes(":")?"iconify":"svg"),o=e.computed(()=>{const s=[];if(t.flip)switch(t.flip){case"horizontal":s.push("rotateY(180deg)");break;case"vertical":s.push("rotateX(180deg)");break;case"both":s.push("rotateX(180deg)"),s.push("rotateY(180deg)");break}return t.rotate&&s.push(`rotate(${t.rotate%360}deg)`),{...t.color&&{color:t.color},...t.size&&{fontSize:typeof t.size=="number"?`${t.size}px`:t.size},...s.length&&{transform:s.join(" ")}}});return(s,a)=>(e.openBlock(),e.createElementBlock("div",dn,[e.unref(r)==="iconify"?(e.openBlock(),e.createBlock(e.unref(D.Icon),{key:0,class:"svg-icon",icon:n.icon,style:e.normalizeStyle(e.unref(o))},null,8,["icon","style"])):(e.openBlock(),e.createElementBlock("svg",{key:1,class:"svg-icon","aria-hidden":"true",style:e.normalizeStyle(e.unref(o))},[e.createElementVNode("use",{"xlink:href":`#icon-${n.icon}`,rel:"external nofollow"},null,8,pn)],4))]))}}),G=N(fn,[["__scopeId","data-v-23d47990"]]),mn={class:"pagination-container"},gn={class:"pagination-page"},hn=["onClick"],vn={class:"pagination-total"},yn=e.defineComponent({name:"Pagination",__name:"index",props:{total:{type:Number,default:0},pageSize:{type:Number,default:10},current:{type:Number,default:1}},emits:["change","prev","next"],setup(n,{emit:t}){const r=n,o=t,s=({currentPage:C,currentPageSize:b})=>{o("change",{currentPage:C,currentPageSize:b})},a=e.computed(()=>r.total),{currentPage:i,currentPageSize:u,pageCount:f,isFirstPage:l,isLastPage:d,prev:p,next:y}=I.useOffsetPagination({total:a,page:r.current,pageSize:r.pageSize,onPageChange:s,onPageSizeChange:s}),g=e.computed(()=>c(1));function c(C=1,b){b=b||i.value+6;let V=Math.max(i.value-3,C),x=Math.min(V+6,b);x-V<6&&(V=x-6);let w=[];for(let k=V;k<=x;k++)k<=f.value&&w.push(k);return w}const v=()=>{l.value||p()},h=()=>{d.value||y()},m=C=>{i.value=C};return(C,b)=>{const V=e.resolveComponent("icon");return e.openBlock(),e.createElementBlock("