@vtj/materials 0.8.12 → 0.8.14
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/assets/antdv/index.umd.js +2 -2
- package/dist/assets/charts/index.umd.js +2 -2
- package/dist/assets/element/index.umd.js +2 -2
- package/dist/assets/ui/index.umd.js +2 -2
- package/dist/deps/@vtj/charts/index.umd.js +2 -2
- package/dist/deps/@vtj/icons/index.umd.js +2 -2
- package/dist/deps/@vtj/ui/index.umd.js +2 -2
- package/dist/deps/@vtj/utils/index.umd.js +2 -2
- package/package.json +5 -5
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
|
3
3
|
* @name @vtj/ui
|
|
4
4
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
5
|
-
* @version 0.8.
|
|
5
|
+
* @version 0.8.14
|
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
7
|
-
*/const ee="0.8.12",nt={default:14,small:12,large:18},ot={icon:{type:[String,Object]},color:{type:String},size:{type:[Number,String],default:"inherit"},src:{type:String},background:{type:String},padding:{type:Number},radius:{type:Number}};function j(o){return typeof o=="string"?o:`${o}px`}function te(o=0,e){if(typeof o=="number")return o;if(/(%|vh|vw)$/i.test(o)){const n=Number.parseInt(o);return Math.floor(e*n/100)}return Number.parseInt(o)}function be(o,e={}){const t={...e};return typeof o=="boolean"?t:Object.assign(t,o||{})}const _e=Symbol("INSTALLED_KEY"),ie=Symbol("ADAPTER_KEY");function ut(){return Vue.inject(ie,{})}const sn={install(o,e={}){o.provide(ie,e)}},rt=(o=[])=>({install:(t,n={})=>{t[_e]||(t[_e]=!0,o.forEach(u=>{u.name&&t.component(u.name,u)}),n.adapter&&t.provide(ie,n.adapter))}}),cn=["src"],A=Vue.defineComponent({name:"XIcon",__name:"Icon",props:ot,setup(o){const e=o,t=Vue.useAttrs(),n=Vue.getCurrentInstance(),u=Vue.computed(()=>{if(!e.icon)return null;const l=n?.appContext.app;return typeof e.icon=="object"?Vue.markRaw(e.icon):l?.component(e.icon)||e.icon}),r=Vue.computed(()=>{const l={"is-pointer":!!t.onClick};return!u.value&&e.icon&&(l[e.icon]=!0),l}),s=Vue.computed(()=>({"background-color":e.background,"border-radius":e.radius?j(e.radius):void 0,padding:e.padding?j(e.padding):void 0})),a=Vue.computed(()=>typeof e.size=="number"?e.size:nt[e.size]??void 0);return(l,c)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElIcon),{class:Vue.normalizeClass(["x-icon",r.value]),color:e.color,size:a.value,style:Vue.normalizeStyle(s.value)},{default:Vue.withCtx(()=>[Vue.renderSlot(l.$slots,"default",{},()=>[u.value?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(u.value),{key:0})):Vue.createCommentVNode("",!0),e.src?(Vue.openBlock(),Vue.createElementBlock("img",{key:1,src:e.src},null,8,cn)):Vue.createCommentVNode("",!0)])]),_:3},8,["class","color","size","style"]))}}),dn={class:"x-menu__wrapper"},mn={key:1,class:"x-menu__title"},fn=Vue.createElementVNode("i",null,null,-1),Vn={key:0,class:"x-menu__title"},pn=Vue.createElementVNode("i",null,null,-1),lt=Vue.defineComponent({inheritAttrs:!1,name:"XMenuItem",__name:"MenuItem",props:{item:{},subMenu:{},defaultIcon:{}},setup(o){const e=o,t=Vue.getCurrentInstance(),n=s=>{if(s)return typeof s=="string"&&(t?.appContext.app?.component(s)||e.defaultIcon)||s},u=s=>typeof s=="object"?s:{value:s},r=(s=[])=>s.filter(a=>!a.hidden);return(s,a)=>e.item.children?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElSubMenu),Vue.mergeProps({key:0,disabled:e.item.disabled},e.subMenu,{index:String(e.item.id)}),{title:Vue.withCtx(()=>[Vue.createElementVNode("div",dn,[e.item.icon?(Vue.openBlock(),Vue.createBlock(Vue.unref(A),{key:0,icon:n(e.item.icon)},null,8,["icon"])):Vue.createCommentVNode("",!0),e.item.title?(Vue.openBlock(),Vue.createElementBlock("span",mn,Vue.toDisplayString(e.item.title),1)):Vue.createCommentVNode("",!0),e.item.badge?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElBadge),Vue.mergeProps({key:2,class:"x-menu__badge"},u(e.item.badge)),{default:Vue.withCtx(()=>[fn]),_:1},16)):Vue.createCommentVNode("",!0)])]),default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(r(e.item.children),l=>(Vue.openBlock(),Vue.createBlock(Vue.unref(lt),{key:l.id,item:l,subMenu:e.subMenu,defaultIcon:e.defaultIcon},null,8,["item","subMenu","defaultIcon"]))),128))]),_:1},16,["disabled","index"])):(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElMenuItem),{key:1,index:String(e.item.id),disabled:e.item.disabled},{title:Vue.withCtx(()=>[e.item.title?(Vue.openBlock(),Vue.createElementBlock("span",Vn,Vue.toDisplayString(e.item.title),1)):Vue.createCommentVNode("",!0),e.item.badge?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElBadge),Vue.mergeProps({key:1,class:"x-menu__badge"},u(e.item.badge)),{default:Vue.withCtx(()=>[pn]),_:1},16)):Vue.createCommentVNode("",!0)]),default:Vue.withCtx(()=>[e.item.icon?(Vue.openBlock(),Vue.createBlock(Vue.unref(A),{key:0,icon:n(e.item.icon)},null,8,["icon"])):Vue.createCommentVNode("",!0)]),_:1},8,["index","disabled"]))}}),H=Vue.defineComponent({inheritAttrs:!1,name:"XMenu",__name:"Menu",props:{data:{default:()=>[]},subMenu:{},defaultIcon:{}},emits:["select"],setup(o,{emit:e}){const t=o,n=e,u=Vue.computed(()=>t.data.filter(a=>!a.hidden)),r=(a,l)=>{const c=(i,d=[])=>{for(const V of d){if(V.id.toString()===i.toString())return V;if(V.children?.length){const m=c(i,V.children);if(m)return m}}};return c(l,a)},s=a=>{const l=r(u.value,a);l&&n("select",l)};return(a,l)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElMenu),Vue.mergeProps({class:"x-menu"},a.$attrs,{onSelect:s}),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(u.value,c=>(Vue.openBlock(),Vue.createBlock(Vue.unref(lt),{item:{...c,icon:c.icon},defaultIcon:t.defaultIcon,subMenu:t.subMenu},null,8,["item","defaultIcon","subMenu"]))),256))]),_:1},16))}}),Be={name:{type:String},label:{type:String},value:{type:[String,Number,Object,Array,Boolean]},icon:{type:[String,Object]},mode:{type:String,default:"button"},menus:{type:Array},tooltip:{type:[String,Object]},badge:{type:[String,Number,Object]},dropdown:{type:Object},button:{type:Object},disabled:{type:[Boolean,Function]},size:{type:String,default:"default"},type:{type:String,default:"primary"},background:{type:String,default:"always"},circle:{type:Boolean},draggable:{type:Boolean}};function gn(o){return Vue.computed(()=>{const e=o.tooltip;if(e)return typeof e=="string"?{content:e}:e})}function hn(o){return Vue.computed(()=>{const e=o.badge;if(e)return typeof e=="object"?e:{value:e}})}function vn(o){return Vue.computed(()=>{const{dropdown:e,menus:t}=o;if(t&&t.length>0)return Object.assign({popperClass:"x-action__menus",size:o.size},e||{})})}function at(o){const e=Vue.getCurrentInstance();return Vue.computed(()=>{const t=Vue.unref(o);if(t)if(typeof t=="string"||t.setup||t.render||Vue.isVNode(t)){const n=e?.appContext.app;return{icon:typeof t=="string"&&n?.component(t)||t}}else return t;return null})}function X(o){const e=at(o);return e.value?Vue.markRaw(Vue.defineComponent({render:()=>Vue.h(A,e.value)})):void 0}function ce(o,e){return Vue.computed(()=>{const t=Vue.unref(o);return typeof t=="function"?t(e):!!t})}function st(o,e,t){const n=Vue.shallowRef(e),u=Vue.ref(!1),r=async a=>{const l=Vue.unref(o);return l?typeof l=="function"?await l(a):l:e},s=async a=>(u.value=!0,await r(a).then(l=>(n.value=l||e,u.value=!1,Vue.unref(n))));return Vue.watch(()=>o,()=>{s(t)},{immediate:!0}),t&&Vue.watch(t,()=>{s(t)}),{data:n,loading:u,loader:s}}const yn={key:0},wn=Vue.defineComponent({__name:"Trigger",props:Be,emits:["click"],setup(o,{emit:e}){const t=o,n=e,u=X(Vue.toRef(t,"icon")),r=ce(Vue.toRef(t,"disabled")),s=Vue.computed(()=>({[`is-${t.mode}`]:!!t.mode,[`is-${t.type}`]:!!t.type,[`is-${t.size}`]:!!t.size&&t.size!=="default",[`is-background-${t.background}`]:t.mode==="icon"&&!!t.background,"is-disabled":!!t.disabled,"is-circle":!!t.circle})),a=l=>{if(l.preventDefault(),!r.value)return n("click"),!1};return(l,c)=>t.mode==="button"?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),Vue.mergeProps({key:0,icon:Vue.unref(u),type:t.type,size:t.size,disabled:Vue.unref(r)},t.button,{onClick:a}),{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(l.label),1)]),_:1},16,["icon","type","size","disabled"])):(Vue.openBlock(),Vue.createElementBlock("div",{key:1,class:Vue.normalizeClass(["x-action__inner",s.value]),onClick:a},[(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(u)))),l.label?(Vue.openBlock(),Vue.createElementBlock("span",yn,Vue.toDisplayString(l.label),1)):Vue.createCommentVNode("",!0)],2))}}),kn=["draggable"],R=Vue.defineComponent({name:"XAction",__name:"Action",props:Be,emits:["click","command","dragstart","dragend"],setup(o,{emit:e}){const t=o,n=Vue.useSlots(),u=e,r=gn(t),s=hn(t),a=vn(t),l=ce(Vue.toRef(t,"disabled")),c=Vue.computed(()=>!!t.draggable&&!l.value),i=Vue.computed(()=>({[`x-action--${t.mode}`]:!!t.mode})),d=()=>{l.value||u("click",Vue.toRaw(t))},V=p=>{if(l.value)return;const h=t.menus?.find(y=>y.command===p);h&&u("command",Vue.toRaw(h))},m=p=>{c&&u("dragstart",Vue.toRaw(t),p)},f=p=>{c&&u("dragend",Vue.toRaw(t),p)},g=p=>Vue.h(ElementPlus.ElBadge,s.value,()=>[].concat(p)),b=p=>Vue.h(ElementPlus.ElDropdown,{...a.value,disabled:l.value,onCommand:V},{default:()=>[p],dropdown:()=>[Vue.h(ElementPlus.ElDropdownMenu,()=>(t.menus||[]).map((h,y)=>Vue.h(ElementPlus.ElDropdownItem,h,()=>n.item?n.item({item:h,index:y}):h.label)))]}),w=p=>Vue.h(ElementPlus.ElTooltip,{...r.value,disabled:l.value},()=>[p]),C=Vue.computed(()=>{let p=Vue.h(Vue.markRaw(wn),{...t,onClick:d});const h=n.default?.();return h&&h.length&&(p=h[0]),s.value&&(p=g(p)),a.value&&(p=b(p)),r.value&&(p=w(p)),p});return(p,h)=>(Vue.openBlock(),Vue.createElementBlock("div",{class:Vue.normalizeClass(["x-action",i.value]),draggable:c.value,onDragstart:m,onDragend:f},[(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(C.value)))],42,kn))}}),it={items:{type:Array},mode:{type:String,default:"button"},size:{type:String,default:"default"},type:{type:String,default:"primary"},background:{type:String,default:"always"},circle:{type:Boolean},disabled:{type:[Boolean,Function]},tooltip:{type:Object},badge:{type:Object},dropdown:{type:Object},button:{type:Object}},ne=Vue.defineComponent({name:"XActionBar",__name:"ActionBar",props:it,emits:["click","command"],setup(o,{emit:e}){const t=o,n=e,u=Vue.computed(()=>(t.items||[]).map(a=>a==="|"?a:{...a,badge:a.badge?{...t.badge,...typeof a.badge=="object"?a.badge||{}:{value:a.badge}}:void 0,tooltip:a.tooltip?{...t.tooltip,...typeof a.tooltip=="object"?a.tooltip||{}:{content:a.tooltip}}:void 0})),r=a=>{n("click",a)},s=(a,l)=>{n("command",a,l)};return(a,l)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:"x-action-bar",align:"center"},{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(u.value,c=>(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,null,[c==="|"?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:0,direction:"vertical",class:"x-action-bar__divider"})):(Vue.openBlock(),Vue.createBlock(Vue.unref(R),Vue.mergeProps({key:1,mode:t.mode,size:t.size,type:t.type,circle:t.circle,background:t.background,button:t.button,dropdown:t.dropdown,disabled:Vue.unref(ce)(t.disabled,c).value,ref_for:!0},c,{onClick:r,onCommand:i=>s(c,i)}),null,16,["mode","size","type","circle","background","button","dropdown","disabled","onCommand"]))],64))),256))]),_:1}))}}),ct={tag:{type:String,default:"div"},fit:{type:Boolean,default:!1},width:{type:[String,Number]},height:{type:[String,Number]},flex:{type:Boolean,default:!0},inline:{type:Boolean},direction:{type:String,default:"row"},wrap:{type:String,default:"nowrap"},justify:{type:String,default:"flex-start"},align:{type:String,default:"flex-start"},alignContent:{type:String,default:"stretch"},grow:{type:Boolean,default:!1},shrink:{type:Boolean,default:!1},alignSelf:{type:String,default:"auto"},overflow:{type:String},padding:{type:Boolean,default:!1},gap:{type:Boolean},autoPointer:{type:Boolean}},N=Vue.defineComponent({name:"XContainer",__name:"Container",props:ct,setup(o){const e=o,t=Vue.useAttrs(),n=Vue.getCurrentInstance(),u=Vue.computed(()=>{const a=n?.parent;if(!a)return!1;const l=a.proxy;return l.$options.name==="XContainer"||!!l.flex}),r=Vue.computed(()=>({"is-fit":e.fit,"is-flex":e.flex&&!e.inline,"is-inline-flex":e.flex&&e.inline,[`is-direction-${e.direction}`]:e.flex&&e.direction!=="row",[`is-wrap-${e.wrap}`]:e.flex&&e.wrap!=="nowrap",[`is-justify-${e.justify}`]:e.flex&&e.justify!=="flex-start",[`is-align-${e.align}`]:e.flex&&e.align!=="flex-start",[`is-align-content-${e.alignContent}`]:e.flex&&e.alignContent!=="stretch","is-grow":e.grow??u.value,"is-shrink":e.shrink,[`is-align-self-${e.alignSelf}`]:u.value&&e.alignSelf!=="auto",[`is-overflow-${e.overflow}`]:!!e.overflow,"is-padding":!!e.padding,"is-pointer":e.autoPointer&&!!t.onClick,"is-gap":!!e.gap})),s=Vue.computed(()=>{const{width:a,height:l,fit:c}=e;return c?null:{width:a?j(a):void 0,height:l?j(l):void 0}});return(a,l)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(e.tag),{class:Vue.normalizeClass(["x-container",r.value]),style:Vue.normalizeStyle(s.value)},{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"default")]),_:3},8,["class","style"]))}}),dt={size:{type:String,default:"default"},content:{type:String,default:""},subtitle:{type:String},icon:{type:[String,Object]},border:{type:Boolean},more:{type:Boolean}},Cn={class:"x-header__content"},bn={key:0,class:"x-header__actions"},Ee=Vue.defineComponent({name:"XHeader",inheritAttrs:!1,__name:"Header",props:dt,setup(o){const e=o,t=X(Vue.toRef(e,"icon")),n=Vue.useAttrs(),u=Vue.computed(()=>({[`is-size-${e.size}`]:!!e.size&&e.size!=="default","is-border":e.border,"is-pointer":!!n.onClick}));return(r,s)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:Vue.normalizeClass(["x-header",u.value]),justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(N),{align:"center",class:Vue.normalizeClass(["x-header__wrapper",u.value]),grow:"",onClick:Vue.unref(n).onClick},{default:Vue.withCtx(()=>[Vue.unref(t)?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(t)),{key:0,class:"x-header__icon",onClick:Vue.unref(n).onClickIcon||Vue.unref(n).onClick},null,8,["onClick"])):Vue.createCommentVNode("",!0),Vue.createElementVNode("span",Cn,[Vue.renderSlot(r.$slots,"default",{},()=>[Vue.createTextVNode(Vue.toDisplayString(e.content),1)])]),e.more?(Vue.openBlock(),Vue.createBlock(Vue.unref(A),{key:1,class:"x-header__more",icon:Vue.unref(VtjIcons.ArrowRight)},null,8,["icon"])):Vue.createCommentVNode("",!0),e.subtitle||r.$slots.subtitle?(Vue.openBlock(),Vue.createElementBlock("span",{key:2,class:"x-header__subtitle",onClick:s[0]||(s[0]=(...a)=>Vue.unref(n).onClick&&Vue.unref(n).onClick(...a))},[Vue.renderSlot(r.$slots,"subtitle",{},()=>[Vue.createTextVNode(Vue.toDisplayString(e.subtitle),1)])])):Vue.createCommentVNode("",!0)]),_:3},8,["class","onClick"]),r.$slots.actions?(Vue.openBlock(),Vue.createElementBlock("div",bn,[Vue.renderSlot(r.$slots,"actions")])):Vue.createCommentVNode("",!0)]),_:3},8,["class"]))}}),mt={fit:{type:Boolean,default:!1},width:{type:[String,Number]},height:{type:[String,Number]},border:{type:Boolean,default:!0},radius:{type:Boolean,default:!0},card:{type:Boolean},size:{type:String},shadow:{type:String},header:{type:[String,Object]},body:{type:Object},footer:{type:Object}},Y=Vue.defineComponent({name:"XPanel",__name:"Panel",props:mt,setup(o,{expose:e}){const t=o,n=Vue.ref(),u=Vue.computed(()=>({"x-panel--card":!!t.card,"x-panel--default":!t.card,[`is-${t.size}`]:!!t.size&&t.size!=="default","is-border":!!t.border,"is-radius":!!t.radius,[`is-shadow-${t.shadow}`]:!!t.shadow&&t.shadow!=="none"})),r=Vue.computed(()=>t.header===null?null:typeof t.header=="string"?{content:t.header,size:t.size}:{...t.header,size:t.size}),s=Vue.computed(()=>t.fit||t.height?"auto":void 0);return e({bodyRef:n}),(a,l)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:Vue.normalizeClass(["x-panel",u.value]),direction:"column",fit:t.fit,width:t.width,height:t.height},{default:Vue.withCtx(()=>[r.value?(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{key:0,flex:!1,class:"x-panel__header"},{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"header",{},()=>[Vue.createVNode(Vue.unref(Ee),Vue.normalizeProps(Vue.guardReactiveProps(r.value)),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"title")]),actions:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"actions")]),_:3},16)])]),_:3})):Vue.createCommentVNode("",!0),Vue.createVNode(Vue.unref(N),Vue.mergeProps({ref_key:"bodyRef",ref:n,flex:!1,overflow:s.value,grow:"",padding:"",class:"x-panel__body"},t.body),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"default")]),_:3},16,["overflow"]),a.$slots.footer?(Vue.openBlock(),Vue.createBlock(Vue.unref(N),Vue.mergeProps({key:1,flex:!1,padding:"",class:"x-panel__footer"},t.footer),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"footer")]),_:3},16)):Vue.createCommentVNode("",!0)]),_:3},8,["class","fit","width","height"]))}}),ft="user-select-none";class xe{constructor(e,t={}){this.el=e,this.options=t,this.scope=Vue.effectScope(),this.scope.run(()=>{this.init()})}scope;dragging=!1;getHandle(){const{selector:e,handle:t}=this.options;return e?this.el.querySelector(e):t}getTarget(){const{target:e="body"}=this.options;return typeof e=="string"?document.querySelector(e):Vue.unref(e)||document.body}init(){const{el:e,options:t}=this,{disabled:n,delay:u=150,onStart:r,onEnd:s}=t;if(n)return;let a=null;const l=this.getHandle(),c=this.getTarget();let i=e.getBoundingClientRect(),d=null;const{x:V,y:m}=VueUse.useDraggable(e,{initialValue:{x:i.x,y:i.y},...t,handle:l,onStart:(f,g)=>{document.body.classList.add(ft),clearTimeout(a),a=setTimeout(()=>{this.dragging=!0,i=e.getBoundingClientRect(),d=c?.getBoundingClientRect(),r&&r(f,g)},u)},onEnd:(f,g)=>{if(clearTimeout(a),document.body.classList.remove(ft),this.dragging&&d){this.dragging=!1;const{x:b,y:w}=f,C=this.getPosition(d,i,b,w);s&&s(C,g),d=null}}});Vue.watch([V,m],()=>{if(this.dragging&&d){const f=this.getPosition(d,i,V.value,m.value);e.style.left=`${f.x}px`,e.style.top=`${f.y}px`}})}getPosition(e,t,n,u){const{edge:r=50}=this.options,s=-t.width+r,a=e.width-r,l=0,c=e.height-r,i=Math.min(a,Math.max(n,s)),d=Math.min(c,Math.max(u,l));return{x:i,y:d}}destory(){this.scope.stop()}}const Vt={mounted(o,e){const t=e.value||{},n=new xe(o,t);o.__draggable__=n},updated(o,e){const t=e.value||{};let n=o.__draggable__;n&&!VtjUtils.isEqual(n.options,t)&&(n.destory(),o.__draggable__=new xe(o,t))},unmounted(o){const e=o.__draggable__;e&&(e.destory(),o.__draggable__=null)}},Se="user-select-none";class Ne{constructor(e,t={}){this.el=e,this.options=t,this.scope=Vue.effectScope(),this.scope.run(()=>{this.init()})}scope;resizing=Vue.ref(!1);direction=Vue.ref("");MIE=null;cleanMousedown;cleanMouseup;init(){const{el:e,options:t}=this,{disabled:n,onStart:u,onEnd:r}=t;if(n)return;this.MIE=VueUse.useMouseInElement(e),this.cleanMousedown=VueUse.useEventListener(document,"mousedown",()=>{this.direction?.value&&this.MIE&&(this.resizing.value=!0,e.classList.add("is-resizing",`is-${this.direction.value}-resizing`),u&&u(this.direction.value,this.MIE))}),this.cleanMouseup=VueUse.useEventListener(document,"mouseup",()=>{this.resizing.value&&this.direction?.value&&this.MIE&&(e.classList.remove("is-resizing",`is-${this.direction.value}-resizing`),r&&r(this.direction.value,this.MIE)),this.resizing.value=!1}),Vue.watch(this.direction,l=>{const c=document.body;c.style.cursor=l?`${l}-resize`:"",l?c.classList.add(Se):c.classList.remove(Se)});const{x:s,y:a}=this.MIE;Vue.watch([s,a],()=>{this.resizing.value?this.resize():this.direction.value=this.getDirection()})}resize(){const{MIE:e,direction:t,resizing:n,options:u,el:r}=this,s=t?.value||"";if(!e||!n.value||!s)return;const{x:a,y:l,elementX:c,elementY:i,elementHeight:d,elementWidth:V}=e,{onResizing:m}=u,{minWidth:f=0,minHeight:g=0,maxWidth:b=99999,maxHeight:w=99999}=u;if(s.includes("e")){const C=Math.min(Math.max(c.value,f),b);r.style.width=`${C}px`}if(s.includes("s")){const C=Math.min(Math.max(i.value,g),w);r.style.height=`${C}px`}if(s.includes("w")){const C=Math.min(Math.max(V.value-c.value,f),b);r.style.width=`${C}px`,r.style.left=`${a.value}px`}if(s.includes("n")){const C=Math.min(Math.max(d.value-i.value,g),w);this.el.style.height=`${C}px`,this.el.style.top=`${l.value}px`}m&&m(s,e)}getDirection(){if(!this.MIE)return"";const{elementX:e,elementY:t,elementHeight:n,elementWidth:u,isOutside:r}=this.MIE;if(r.value)return"";const{dirs:s=["n","s","w","e"],edge:a=5}=this.options;let l="";return s.includes("n")&&t.value<=a?l+="n":s.includes("s")&&t.value>n.value-a&&(l+="s"),s.includes("w")&&e.value<=a?l+="w":s.includes("e")&&e.value>u.value-a&&(l+="e"),l}destory(){const e=document.body;e.style.cursor="",e.classList.remove(Se),this.cleanMousedown&&this.cleanMousedown(),this.cleanMouseup&&this.cleanMouseup(),this.MIE?.stop(),this.scope.stop()}}const Pe={mounted(o,e){const t=e.value||{},n=new Ne(o,t);o.__resizable__=n},updated(o,e){const t=e.value||{};let n=o.__resizable__;n&&!VtjUtils.isEqual(n.options,t)&&(n.destory(),o.__resizable__=new Ne(o,t))},unmounted(o){const e=o.__resizable__;e&&(e.destory(),o.__resizable__=null)}},pt={modelValue:{type:Boolean,default:!0},title:{type:String},subtitle:{type:String},icon:{type:[String,Object]},size:{type:String,default:"default"},width:{type:[Number,String],default:"70%"},height:{type:[Number,String],default:"70%"},left:{type:[Number,String]},top:{type:[Number,String]},modal:{type:Boolean,default:!0},draggable:{type:[Boolean,Object],default:!0},resizable:{type:[Boolean,Object]},closable:{type:Boolean,default:!0},maximizable:{type:Boolean,default:!1},minimizable:{type:Boolean,default:!1},mode:{type:String,default:"normal"},content:{type:Object},src:{type:String},componentInstance:{type:Object},beforeClose:{type:Function},submit:{type:[Boolean,String]},cancel:{type:[Boolean,String]},bodyPadding:{type:Boolean,default:!0},primary:{type:Boolean}};let G=1e3;function _n(o,e){const{width:t,height:n}=VueUse.useElementSize(e),u=Vue.reactive({mode:o.mode||"normal",wrapperWidth:0,wrapperHeight:0,width:0,height:0,top:0,left:0,zIndex:++G,dragging:!1,resizing:!1});return Vue.watch([t,n],([r,s])=>{u.wrapperWidth=r,u.wrapperHeight=s,u.width=te(o.width,r),u.height=te(o.height,s),u.left=o.left?te(o.left,r)-u.width/2:Math.max(Math.floor((r-u.width)/2),0),u.top=o.top?te(o.top,s):Math.max(Math.floor((s-u.height)/2),0)}),Vue.watch(u,r=>{G=Math.max(r.zIndex,G)}),{state:u,normal:Vue.computed(()=>u.mode==="normal"),maximized:Vue.computed(()=>u.mode==="maximized"),minimized:Vue.computed(()=>u.mode==="minimized")}}function Bn(o,e){const t=Vue.computed(()=>{const{width:s,height:a,top:l,left:c,zIndex:i}=e;return{width:`${s}px`,height:`${a}px`,top:`${l}px`,left:`${c}px`,zIndex:i}}),n=Vue.computed(()=>({[`is-${e.mode}`]:!!e.mode,"is-draggable":!!o.draggable,"is-resizable":!!o.resizable,"is-primary":!!o.primary})),u=Vue.computed(()=>({[`is-${e.mode}`]:!!e.mode,"is-dragging":e.dragging,"is-resizing":e.resizing})),r=Vue.computed(()=>({zIndex:e.zIndex}));return{styles:t,classes:n,wrapperClass:u,modalStyle:r}}function En(o,e,t){const n=i=>{e.mode=i,["maximized","minimized","normal"].includes(i)&&t(i),t("modeChange",i)},u=async()=>{(!o.beforeClose||await o.beforeClose())&&(t("update:modelValue",!1),t("close"),t("destroy"))};return{close:u,changeMode:n,show:()=>n("normal"),hide:()=>n("minimized"),active:i=>{const d=i.target.nodeName||"";["INPUT","TEXTAREA","RADIO","CHECKBOX"].includes(d.toUpperCase())||(e.zIndex=Math.max(e.zIndex,++G))},submit:()=>t("submit"),cancel:()=>{t("cancel"),u()}}}function xn(o,e,t,n){return Vue.computed(()=>{const u=typeof o.draggable=="boolean"?!o.draggable:!!o.draggable?.disabled;return{...VtjUtils.isObject(o.draggable)?o.draggable:{},disabled:u,target:n,selector:".x-panel__header",onStart(r){e.dragging=!0,e.zIndex=Math.max(e.zIndex,++G),t("dragStart",r)},onMove(r){t("dragging",r)},onEnd(r){if(e.mode==="maximized")return;const{x:s,y:a}=r;e.left=s,e.top=a,e.dragging=!1,t("dragEnd",r)}}})}function Sn(o,e,t){return Vue.computed(()=>{const n=typeof o.resizable=="boolean"?!o.resizable:!!o.resizable?.disabled;return{minWidth:200,minHeight:150,...VtjUtils.isObject(o.resizable)?o.resizable:{},disabled:n,dirs:["e","s","w"],onStart(u,r){e.resizing=!0,e.zIndex=Math.max(e.zIndex,++G),t("resizeStart",u,r)},onResizing(u,r){t("resizing",u,r)},onEnd(u,r){e.left=r.elementPositionX.value,e.top=r.elementPositionY.value,e.width=r.elementWidth.value,e.height=r.elementHeight.value,e.resizing=!1,t("resizeEnd",u,r)}}})}function Nn(o,e){const t=o.componentInstance;if(!t)return;let n=null;return Vue.onMounted(()=>{const u=Vue.unref(e),r=Vue.unref(u?.bodyRef);n=t.$el,r&&r.$el&&r.$el.appendChild(n)}),Vue.onUnmounted(()=>{n&&n.parentNode&&n.parentNode.removeChild(n)}),{componentInstance:t}}const Pn=["src"],de=Vue.defineComponent({name:"XDialog",__name:"Dialog",props:pt,emits:["update:modelValue","open","close","destroy","maximized","minimized","normal","modeChange","dragStart","dragging","dragEnd","resizeStart","resizeEnd","resizing","submit","cancel"],setup(o,{expose:e,emit:t}){const n=o,u=t,r=Vue.getCurrentInstance(),s=Vue.ref(),a=Vue.ref(),{state:l,maximized:c,minimized:i,normal:d}=_n(n,s),{styles:V,classes:m,wrapperClass:f,modalStyle:g}=Bn(n,l),{changeMode:b,active:w,close:C,show:p,hide:h,submit:y,cancel:x}=En(n,l,u),v=xn(n,l,u,s),P=Sn(n,l,u),z=Nn(n,a);Vue.watchEffect(async()=>{n.modelValue&&(await Vue.nextTick(),r&&u("open",r))});const I=Vue.computed(()=>a.value?.$el);return e({$vtjEl:I,panelRef:a,state:l,maximized:c,minimized:i,changeMode:b,show:p,hide:h,submit:y,cancel:x,close:C,componentInstance:z}),(T,M)=>n.modelValue?(Vue.openBlock(),Vue.createBlock(Vue.Teleport,{key:0,to:"body"},[Vue.createElementVNode("div",{ref_key:"wrapper",ref:s,class:Vue.normalizeClass(["x-dialog__wrapper",Vue.unref(f)])},[n.modal?(Vue.openBlock(),Vue.createElementBlock("div",{key:0,class:"x-dialog__modal",style:Vue.normalizeStyle(Vue.unref(g))},null,4)):Vue.createCommentVNode("",!0),Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref(Y),Vue.mergeProps({ref_key:"panelRef",ref:a,class:["x-dialog",Vue.unref(m)],card:"",shadow:"always",header:{icon:n.icon,subtitle:n.subtitle},width:"800px",height:"600px",footer:{justify:"space-between",flex:!0,align:"center"},style:Vue.unref(V),size:n.size,body:{padding:n.bodyPadding},onClick:Vue.unref(w)},T.$attrs),Vue.createSlots({title:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(n.title),1)]),actions:Vue.withCtx(()=>[Vue.renderSlot(T.$slots,"actions"),n.minimizable?(Vue.openBlock(),Vue.createBlock(Vue.unref(R),{key:0,icon:Vue.unref(VtjIcons.Minimize),size:n.size,mode:"icon",type:"primary",background:"hover",onClick:M[0]||(M[0]=B=>Vue.unref(b)("minimized"))},null,8,["icon","size"])):Vue.createCommentVNode("",!0),n.maximizable?(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,{key:1},[Vue.unref(d)?(Vue.openBlock(),Vue.createBlock(Vue.unref(R),{key:1,icon:Vue.unref(VtjIcons.Maximize),size:n.size,mode:"icon",type:"primary",background:"hover",onClick:M[2]||(M[2]=B=>Vue.unref(b)("maximized"))},null,8,["icon","size"])):(Vue.openBlock(),Vue.createBlock(Vue.unref(R),{key:0,icon:Vue.unref(VtjIcons.Popup),size:n.size,mode:"icon",type:"primary",background:"hover",onClick:M[1]||(M[1]=B=>Vue.unref(b)("normal"))},null,8,["icon","size"]))],64)):Vue.createCommentVNode("",!0),n.closable?(Vue.openBlock(),Vue.createBlock(Vue.unref(R),{key:2,icon:Vue.unref(VtjIcons.RawClose),size:n.size,mode:"icon",type:"danger",background:"hover",onClick:Vue.unref(C)},null,8,["icon","size","onClick"])):Vue.createCommentVNode("",!0)]),default:Vue.withCtx(()=>[Vue.renderSlot(T.$slots,"default",{},()=>[n.content?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(n.content),{key:0})):Vue.createCommentVNode("",!0),n.src?(Vue.openBlock(),Vue.createElementBlock("iframe",{key:1,src:n.src,class:"x-dialog__frame"},null,8,Pn)):Vue.createCommentVNode("",!0)])]),_:2},[n.cancel||n.submit||T.$slots.footer||T.$slots.extra||T.$slots.handle?{name:"footer",fn:Vue.withCtx(()=>[Vue.renderSlot(T.$slots,"footer",{},()=>[Vue.createVNode(Vue.unref(N),{align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot(T.$slots,"extra")]),_:3}),Vue.createVNode(Vue.unref(N),{align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot(T.$slots,"handle"),n.cancel?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:0,type:"default",size:n.size,onClick:Vue.unref(x)},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(typeof n.cancel=="string"?n.cancel:"取消"),1)]),_:1},8,["size","onClick"])):Vue.createCommentVNode("",!0),n.submit?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:1,type:"primary",size:n.size,onClick:Vue.unref(y)},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(typeof n.submit=="string"?n.submit:"确定"),1)]),_:1},8,["size","onClick"])):Vue.createCommentVNode("",!0)]),_:3})])]),key:"0"}:void 0]),1040,["header","class","style","size","body","onClick"])),[[Vue.unref(Vt),Vue.unref(v)],[Vue.unref(Pe),Vue.unref(P)]])],2)])):Vue.createCommentVNode("",!0)}});function me(o,e){const t=document.createElement("div"),n=Vue.createVNode(de,o);n.appContext=e??me._context,Vue.render(n,t);const u=()=>{Vue.render(null,t),t.parentNode?.removeChild(t)};return n.props.onDestroy=()=>{u()},document.body.appendChild(t),{vnode:n,destroy:u}}const zn=Vue.createElementVNode("div",{class:"x-mask-sidebar__helper"},null,-1),Tn=Vue.defineComponent({__name:"Sidebar",props:{collapsed:{type:Boolean}},setup(o){const e=o;return(t,n)=>Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:Vue.normalizeClass(["x-mask-sidebar",{"is-collapsed":e.collapsed}]),grow:!1,flex:"",direction:"column"},{default:Vue.withCtx(()=>[Vue.renderSlot(t.$slots,"brand"),Vue.createVNode(Vue.unref(N),{class:"x-mask-sidebar__wrapper",flex:"",grow:"",direction:"column",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot(t.$slots,"default"),zn]),_:3})]),_:3},8,["class"])),[[Vue.unref(Pe),{dirs:["e"],disabled:e.collapsed,maxWidth:500,minWidth:200}]])}}),In=Vue.defineComponent({__name:"SwitchBar",props:{collasped:{type:Boolean,default:!1},favorite:{type:Boolean,default:!1},keyword:{}},emits:["update:collasped","update:keyword","update:favorite"],setup(o,{emit:e}){const t=o,n=e,u=Vue.ref(!1),r=Vue.ref(""),s=Vue.ref(!1),a=()=>{u.value=!0},l=()=>{r.value="",u.value=!1,n("update:keyword",r.value)},c=()=>{n("update:collasped",!t.collasped)},i=()=>{n("update:keyword",r.value)},d=()=>{n("update:favorite",s.value)};return(V,m)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:"x-mask-switch-bar",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[t.collasped?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{key:0,class:"x-mask-switch-bar__left",grow:""},{default:Vue.withCtx(()=>[u.value?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElSwitch),{key:0,modelValue:s.value,"onUpdate:modelValue":m[0]||(m[0]=f=>s.value=f),class:"x-mask-switch-bar__switch","active-icon":Vue.unref(VtjIcons.StarFilled),"inactive-icon":Vue.unref(VtjIcons.Menu),onChange:d},null,8,["modelValue","active-icon","inactive-icon"])),u.value?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElInput),{key:1,modelValue:r.value,"onUpdate:modelValue":m[1]||(m[1]=f=>r.value=f),class:"x-mask-switch-bar__input",size:"small",placeholder:"请输入查询关键字",onInput:i,"prefix-icon":Vue.unref(VtjIcons.Search)},{suffix:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(A),{icon:Vue.unref(VtjIcons.Close),onClick:l},null,8,["icon"])]),_:1},8,["modelValue","prefix-icon"])):Vue.createCommentVNode("",!0)]),_:1})),Vue.createVNode(Vue.unref(N),{class:Vue.normalizeClass(["x-mask-switch-bar__right",{"is-collasped":t.collasped}]),flex:"",align:"center",justify:"center"},{default:Vue.withCtx(()=>[!u.value&&!t.collasped?(Vue.openBlock(),Vue.createBlock(Vue.unref(R),{key:0,icon:Vue.unref(VtjIcons.Search),mode:"icon",background:"hover",size:"default",circle:"",onClick:a},null,8,["icon"])):Vue.createCommentVNode("",!0),t.collasped?(Vue.openBlock(),Vue.createBlock(Vue.unref(R),{key:1,icon:Vue.unref(VtjIcons.Expand),mode:"icon",size:"default",background:"hover",onClick:c,circle:""},null,8,["icon"])):Vue.createCommentVNode("",!0),t.collasped?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(R),{key:2,icon:Vue.unref(VtjIcons.Fold),mode:"icon",size:"default",background:"hover",circle:"",onClick:c},null,8,["icon"]))]),_:1},8,["class"])]),_:1}))}}),Dn=["src"],Mn={key:0},$n=Vue.defineComponent({__name:"Brand",props:{collapsed:{type:Boolean,default:!1},logo:{},title:{},url:{}},setup(o){const e=o,t=VueRouter.useRouter(),n=()=>{e.url&&t.push(e.url)};return(u,r)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:Vue.normalizeClass(["x-mask-brand",{"is-collapsed":e.collapsed}]),align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(N),{class:"x-mask-brand__logo",flex:"",justify:"center",align:"center",onClick:n},{default:Vue.withCtx(()=>[Vue.renderSlot(u.$slots,"logo",{},()=>[e.logo?(Vue.openBlock(),Vue.createElementBlock("img",{key:0,src:e.logo},null,8,Dn)):Vue.createCommentVNode("",!0)])]),_:3}),Vue.createVNode(Vue.unref(N),{class:"x-mask-brand__title",flex:"",align:"center"},{default:Vue.withCtx(()=>[e.title?(Vue.openBlock(),Vue.createElementBlock("span",Mn,[Vue.renderSlot(u.$slots,"title",{},()=>[Vue.createTextVNode(Vue.toDisplayString(e.title),1)])])):Vue.createCommentVNode("",!0)]),_:3})]),_:3},8,["class"]))}}),fe="__favorites__",Ve="__search__",An=Vue.defineComponent({__name:"Menu",props:{collapse:{type:Boolean,default:!1},keyword:{},favorite:{type:Boolean},favorites:{},flatMenus:{},menus:{},active:{}},emits:["select"],setup(o,{emit:e}){const t=o,n=Vue.computed(()=>t.menus||[]),u=e,r=Vue.computed(()=>String(t.active?.id)),s=Vue.computed(()=>[{id:fe,title:"收藏",icon:VtjIcons.Star,children:t.favorites?.length?t.favorites:[{id:fe+"empty",disabled:!0,title:"暂无收藏菜单"}]}]),a=Vue.computed(()=>{const c=(t.keyword||"").trim(),i=c?(t.flatMenus||[]).filter(d=>d.title?.includes(c)):[];return[{id:Ve,title:"搜索",icon:VtjIcons.Search,children:i?.length?i:[{id:Ve+"empty",disabled:!0,title:"查询匹配不到菜单项"}]}]}),l=c=>{u("select",c)};return(c,i)=>(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,null,[Vue.withDirectives(Vue.createVNode(Vue.unref(N),{class:"x-mask-menu",grow:"",flex:!1,overflow:"auto"},{default:Vue.withCtx(()=>[Vue.withDirectives(Vue.createVNode(Vue.unref(H),{subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:n.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!0,"collapse-transition":!1,"default-active":r.value,onSelect:l},null,8,["data","default-icon","default-active"]),[[Vue.vShow,t.collapse]]),Vue.withDirectives(Vue.createVNode(Vue.unref(H),{subMenu:{popperClass:"x-mask-menu-popper",teleported:!0},data:n.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!1,"collapse-transition":!1,"default-active":r.value,onSelect:l},null,8,["data","default-icon","default-active"]),[[Vue.vShow,!t.collapse]]),n.value.length?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElEmpty),{key:0,description:"暂无菜单数据"}))]),_:1},512),[[Vue.vShow,!t.favorite&&!t.keyword]]),Vue.withDirectives(Vue.createVNode(Vue.unref(N),{class:"x-mask-menu",grow:"",flex:!1,overflow:"auto"},{default:Vue.withCtx(()=>[Vue.withDirectives(Vue.createVNode(Vue.unref(H),{class:"x-mask-menu__favorites",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:s.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!0,"collapse-transition":!1,"default-active":r.value,"default-openeds":[fe],onSelect:l},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,t.collapse]]),Vue.withDirectives(Vue.createVNode(Vue.unref(H),{class:"x-mask-menu__favorites",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:s.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!1,"collapse-transition":!1,"default-active":r.value,"default-openeds":[fe],onSelect:l},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,!t.collapse]])]),_:1},512),[[Vue.vShow,t.favorite&&!t.keyword]]),t.keyword?Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref(N),{key:0,class:"x-mask-menu",grow:"",flex:!1,overflow:"auto"},{default:Vue.withCtx(()=>[Vue.withDirectives(Vue.createVNode(Vue.unref(H),{class:"x-mask-menu__search",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:a.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!0,"collapse-transition":!1,"default-active":r.value,"default-openeds":[Ve],onSelect:l},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,t.collapse]]),Vue.withDirectives(Vue.createVNode(Vue.unref(H),{class:"x-mask-menu__search",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:a.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!1,"collapse-transition":!1,"default-active":r.value,"default-openeds":[Ve],onSelect:l},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,!t.collapse]])]),_:1},512)),[[Vue.vShow,!!t.keyword]]):Vue.createCommentVNode("",!0)],64))}}),Rn="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1711803009570'%20class='icon'%20viewBox='0%200%201280%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1500'%20width='320'%20height='256'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M557.85%201023l-122-35.4c-12.8-3.6-20-17-16.4-29.8L692.45%2017.4c3.6-12.8%2017-20%2029.8-16.4l122%2035.4c12.8%203.6%2020%2017%2016.4%2029.8L587.65%201006.6c-3.8%2012.8-17%2020.2-29.8%2016.4z%20m-228-224.4l87-92.8c9.2-9.8%208.6-25.4-1.6-34.4L234.05%20512l181.2-159.4c10.2-9%2011-24.6%201.6-34.4l-87-92.8c-9-9.6-24.2-10.2-34-1L7.65%20494.4c-10.2%209.4-10.2%2025.6%200%2035l288.2%20270.2c9.8%209.2%2025%208.8%2034-1z%20m654.4%201.2l288.2-270.2c10.2-9.4%2010.2-25.6%200-35L984.25%20224.2c-9.6-9-24.8-8.6-34%201L863.25%20318c-9.2%209.8-8.6%2025.4%201.6%2034.4L1046.05%20512l-181.2%20159.4c-10.2%209-11%2024.6-1.6%2034.4l87%2092.8c9%209.8%2024.2%2010.2%2034%201.2z'%20fill='%230157fe'%20p-id='1501'%3e%3c/path%3e%3c/svg%3e",gt=140,ht={logo:{type:String,default:Rn},title:{type:String,default:"VTJ.PRO"},menus:{type:[Array,Function],default(){return[]}},favorites:{type:[Array,Function],default(){return[]}},menuAdapter:{type:Function},home:{type:[String,Object],default:"/"},tabs:{type:Number,default:20},actions:{type:Array},avatar:{type:String},theme:{type:Boolean},disabled:{type:Boolean},addFavorite:{type:Function},removeFavorite:{type:Function}},ze=Symbol(),Te=Symbol(),jn={class:"x-mask-tabs__trigger"},Fn={key:1},Ln=["onDragstart","onDragend"],Un={key:1},Hn=Vue.defineComponent({__name:"Tabs",props:{tabs:{},home:{},isActiveTab:{type:Function},value:{},favorites:{}},emits:["click","remove","refresh","toggleFavorite","dialog"],setup(o,{emit:e}){const t=o,n=e,u=i=>{const d=!!t.favorites.find(V=>V===i.menu||V.id===i.menu?.id);return[{icon:VtjIcons.Refresh,label:"刷新",name:"refresh",value:i},"|",{icon:d?VtjIcons.StarFilled:VtjIcons.Star,label:"收藏",name:"favorite",value:i.menu,disabled:!i.menu},"|",{icon:VtjIcons.CopyDocument,label:"弹窗",name:"dialog",value:i}]},r=i=>{const d=i.paneName;if(d===t.home.id){n("click",t.home);return}const V=t.tabs.find(m=>m.id===d);V&&n("click",V)},s=i=>{const d=t.tabs.find(V=>V.id===i);d&&n("remove",d)},a=i=>{switch(i.name){case"refresh":n("refresh",i.value);break;case"favorite":n("toggleFavorite",i.value);break;case"dialog":n("dialog",i.value);break}},l=(i,d)=>{d.dataTransfer&&(d.dataTransfer.setData("tab",i.id),d.target&&d.target.classList.add("is-dagging"))},c=(i,d)=>{d.target&&d.target.classList.remove("is-dagging")};return(i,d)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{ref:"tabsRef",class:"x-mask-tabs",height:"100%",grow:"",flex:"",justify:"flex-end",direction:"column"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElTabs),{type:"card","model-value":t.value,onTabRemove:s,onTabClick:r},{default:Vue.withCtx(()=>[t.home?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElTabPane),{key:0,name:t.home.id},{label:Vue.withCtx(()=>[Vue.createElementVNode("div",jn,[t.home.icon?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(X)(t.home.icon)),{key:0})):Vue.createCommentVNode("",!0),t.home.title?(Vue.openBlock(),Vue.createElementBlock("span",Fn,Vue.toDisplayString(t.home.title),1)):Vue.createCommentVNode("",!0)])]),_:1},8,["name"])):Vue.createCommentVNode("",!0),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(t.tabs,V=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElTabPane),{key:V.id,name:V.id,lazy:"",closable:""},{label:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElPopover),{"open-delay":500,placement:"bottom",trigger:"hover",width:"200px",disabled:V.id!==t.value},{reference:Vue.withCtx(()=>[Vue.createElementVNode("div",{class:"x-mask-tabs__trigger",draggable:"true",onDragstart:m=>l(V,m),onDragend:m=>c(V,m)},[V.icon?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(X)(V.icon)),{key:0})):Vue.createCommentVNode("",!0),V.title?(Vue.openBlock(),Vue.createElementBlock("span",Un,Vue.toDisplayString(V.title),1)):Vue.createCommentVNode("",!0)],40,Ln)]),default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ne),{items:u(V),mode:"text",size:"small",type:"info",onClick:a},null,8,["items"])]),_:2},1032,["disabled"])]),_:2},1032,["name"]))),128))]),_:1},8,["model-value"])]),_:1},512))}}),On=Vue.defineComponent({__name:"ThemeSwitch",setup(o){const e=VueUse.useDark();return(t,n)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElSwitch),{class:"x-mask-theme-switch",modelValue:Vue.unref(e),"onUpdate:modelValue":n[0]||(n[0]=u=>Vue.isRef(e)?e.value=u:null),size:"default","active-action-icon":Vue.unref(VtjIcons.Moon),"inactive-action-icon":Vue.unref(VtjIcons.Sunny)},null,8,["modelValue","active-action-icon","inactive-action-icon"]))}}),Kn={class:"x-mask-toolbar__menu-item"},Xn=Vue.defineComponent({__name:"Toolbar",props:{tabs:{default:()=>[]},actions:{},theme:{type:Boolean}},emits:["closeOtherTabs","closeAllTabs","closeTab","clickTab","actionClick","actionCommand"],setup(o,{emit:e}){const t=o,n=e,u=Vue.computed(()=>{const c=t.tabs.map((i,d)=>({divided:d===0,label:i.title,command:i}));return[{label:"关闭其他",command:"other"},{label:"关闭全部",command:"all"},...c]}),r=c=>{n("closeTab",c.command)},s=c=>{switch(c.command){case"all":n("closeAllTabs");break;case"other":n("closeOtherTabs");break;default:n("clickTab",c.command);break}},a=c=>{n("actionClick",c)},l=(c,i)=>{n("actionCommand",c,i)};return(c,i)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:"x-mask-toolbar",align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(R),{icon:Vue.unref(VtjIcons.MoreFilled),menus:u.value,dropdown:{size:"small"},mode:"icon",circle:"",background:"hover",onCommand:s},{item:Vue.withCtx(({item:d})=>[Vue.createElementVNode("span",Kn,[Vue.createTextVNode(Vue.toDisplayString(d.label)+" ",1),["other","all"].includes(d.command)?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(A),{key:0,onClick:Vue.withModifiers(V=>r(d),["stop"]),icon:Vue.unref(VtjIcons.Close)},null,8,["onClick","icon"]))])]),_:1},8,["icon","menus"]),Vue.createVNode(Vue.unref(ElementPlus.ElDivider),{direction:"vertical"}),t.actions?(Vue.openBlock(),Vue.createBlock(Vue.unref(ne),{key:0,circle:"",mode:"icon",size:"default",background:"hover",items:c.actions,onClick:a,onCommand:l},null,8,["items"])):Vue.createCommentVNode("",!0),t.actions?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:1,direction:"vertical"})):Vue.createCommentVNode("",!0),t.theme?(Vue.openBlock(),Vue.createBlock(On,{key:2})):Vue.createCommentVNode("",!0),t.theme?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:3,direction:"vertical"})):Vue.createCommentVNode("",!0),Vue.renderSlot(c.$slots,"default")]),_:3}))}}),Yn=Vue.defineComponent({__name:"Avatar",props:{avatar:{}},setup(o){const e=o;return(t,n)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElPopover),{width:200,"popper-class":"x-mask-avatar__popper",disabled:!t.$slots.default},{reference:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElAvatar),{class:"x-mask-avatar",shape:"circle",icon:Vue.unref(VtjIcons.UserFilled),src:e.avatar,size:26},null,8,["icon","src"])]),default:Vue.withCtx(()=>[t.$slots.default?Vue.renderSlot(t.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["disabled"]))}}),vt=Vue.defineComponent({__name:"Content",props:{createView:{type:Function},exclude:{}},setup(o){const e=o;return(t,n)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:"x-mask__content",flex:!1,grow:"",padding:!1},{default:Vue.withCtx(()=>[Vue.renderSlot(t.$slots,"default"),Vue.createVNode(Vue.unref(VueRouter.RouterView),null,{default:Vue.withCtx(({Component:u,route:r})=>[(Vue.openBlock(),Vue.createBlock(Vue.KeepAlive,{exclude:e.exclude},[u?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(e.createView(u,r)),{key:r.fullPath})):Vue.createCommentVNode("",!0)],1032,["exclude"]))]),_:1})]),_:3}))}});function Gn(){const o=Vue.ref(!1),e=Vue.ref(""),t=Vue.ref(!1);return{collapsed:o,keyword:e,favorite:t}}function Wn(o){const e=VtjUtils.uid();return Vue.computed(()=>{const t=o.home;return Object.assign({id:e,url:"/",name:"MaskHome",icon:VtjIcons.HomeFilled,closable:!1},typeof t=="string"?{url:t}:t||{})})}function yt(o,e){let t=[];return o.forEach(n=>{n=e?e(n):n,n.children?t=t.concat(yt(n.children,e)):t.push(n)}),t}function Jn(o,e){const t=VueRouter.useRouter(),n=Vue.shallowRef([]),u=Vue.shallowRef([]),r=Vue.computed(()=>yt(n.value,o.menuAdapter)),s=Vue.computed(()=>VtjUtils.arrayToMap(r.value,"id")),a=Vue.ref(null),l=f=>{const g=typeof f=="object"?f.id:f,b=s.value.get(g);if(!b){console.warn("找不到菜单",f);return}const{type:w="route",url:C,title:p,icon:h}=b;if(!C){a.value=b,e("select",b);return}if(w==="route"){VtjUtils.isUrl(C)||C.startsWith("//")?window.open(C):(a.value=b,t.push(C).catch(y=>y));return}if(w==="window"){window.open(C);return}w==="dialog"&&me({resizable:!0,bodyPadding:!1,width:"80%",height:"80%",title:p,icon:h,src:C})},c=async()=>{n.value=typeof o.menus=="function"?await o.menus()||[]:o.menus??[],u.value=typeof o.favorites=="function"?await o.favorites()||[]:o.favorites??[]},i=f=>{u.value=[f,...u.value],o.addFavorite&&o.addFavorite(f)},d=f=>{u.value=u.value.filter(g=>g.id!==f.id),o.removeFavorite&&o.removeFavorite(f)},V=f=>!!u.value.find(g=>g===f||g.id===f.id),m=f=>{V(f)?d(f):i(f)};return Vue.watchEffect(c),{menus:n,favorites:u,flatMenus:r,active:a,select:l,toggleFavorite:m}}function qn(o,e,t,n,u){const r=VueRouter.useRoute(),s=VueRouter.useRouter(),a={},l=Vue.ref([]),c=Vue.ref(),{width:i}=VueUse.useElementSize(c),d=Vue.computed(()=>Math.floor(i.value/gt)),V=Vue.computed(()=>l.value.slice(0,d.value).filter(E=>!E.dialog)),m=Vue.computed(()=>l.value.slice(d.value)),f=E=>t.value.find(_=>_.url===E),g=E=>r.fullPath===E.url,b=E=>u.value.id===E?u.value:l.value.find(_=>_.id===E),w=Vue.ref(""),C=Vue.computed(()=>b(w.value)),p=E=>{s.push(E.url).catch(_=>_)},h=E=>{w.value=E.id,r.fullPath!==E.url&&p(E)},y=()=>{p(u.value)},x=E=>{const _=l.value.find(S=>S.url===E.url||S.id===E.id);_?h(_):(l.value.unshift(E),h(E))},v=async E=>{const{url:_=r.fullPath,icon:S,title:L="新建标签页"}=E||{},Z=a[_],et=VtjUtils.uid(),tt=VtjUtils.upperFirstCamelCase(_);return{id:et,name:tt,url:_,icon:S,title:L,closable:!0,menu:E,...Z?await Z():{}}},P=async E=>{if(await ElementPlus.ElMessageBox.confirm("是否关闭页签","提示",{type:"warning"}).catch(()=>!1)){if(l.value=l.value.filter(S=>S.id!==E.id),w.value===E.id){const S=l.value[0];p(S||u.value)}return E}},z=E=>{const _=l.value.findIndex(S=>S.id===E.id);if(_>=0){const S=l.value[_];l.value.splice(_,1,Object.assign(S,E))}},I=async()=>{if(!await ElementPlus.ElMessageBox.confirm("是否关闭全部页签","提示",{type:"warning"}).catch(()=>!1))return;const _=l.value;return l.value=[],h(u.value),_},T=async()=>{if(!await ElementPlus.ElMessageBox.confirm("是否关闭其他页签","提示",{type:"warning"}).catch(()=>!1))return;const _=l.value.filter(S=>S.id!==w.value);return l.value=l.value.filter(S=>S.id===w.value),_},M=E=>{const _=l.value.filter(S=>S.id!==E.id);l.value=[E,..._],h(E)},B=async()=>{await Vue.nextTick();const E=u.value.url===r.fullPath,_=f(r.fullPath);if(E)w.value=u.value.id;else{const S=await v(_);x(S)}await Vue.nextTick(),n.value=_||null};return Vue.watch(t,B),Vue.watch(r,B,{immediate:!0}),Vue.provide(ze,a),{tabRef:c,tabs:l,showTabs:V,currentTab:C,changeTab:p,removeTab:P,updateTab:z,addTab:x,home:u,tabValue:w,isCurrentTab:g,activeHome:y,activeTab:h,dropdownTabs:m,removeAllTabs:I,removeOtherTabs:T,moveToShow:M}}function Qn(o){const e=new Map,t=Vue.ref([]),n=Vue.reactive({}),u=Vue.getCurrentInstance(),r={},{updateTab:s,isCurrentTab:a,activeHome:l,tabs:c}=o,i=(p,h)=>{const y=h.fullPath;if(e.has(y))return e.get(y);{const x=VtjUtils.upperFirstCamelCase(y),v={name:x,setup(){const P=Vue.computed(()=>n[y]||document.body),z=Vue.computed(()=>!n[y]),I=Vue.computed(()=>!t.value.includes(x));return Vue.provide(VueRouter.routeLocationKey,Vue.toRaw({...h})),()=>I.value?Vue.h(Vue.Teleport,{to:P.value,disabled:z.value},[Vue.h(p)]):null}};return e.set(y,v),v}},d=p=>{p.dialog=void 0,delete n[p.url];const h=r[p.id];h&&(h.destroy(),delete r[p.id],s(p))},V=(p=[])=>{p.forEach(h=>{d(h)})},m=async p=>{p.dialog={...p.dialog,onMinimized:()=>{d(p)},onClose:async()=>{d(p),c.value=c.value.filter(y=>y.id!==p.id)}},s(p);const h=me({title:p.title,icon:p.icon,modal:!1,resizable:!0,draggable:!0,maximizable:!0,minimizable:!0,...p.dialog,onOpen(y){n[p.url]=y.refs.panelRef?.bodyRef?.$el}},u?.appContext);return await Vue.nextTick(),a(p)&&l(),r[p.id]=h,h},f=async p=>{t.value=[p.name],await Vue.nextTick(),t.value=[]},g=async p=>{t.value=p.map(h=>h.name),await Vue.nextTick(),t.value=[]},b=p=>(p.preventDefault(),!1),w=p=>{if(p.dataTransfer){const h=p.dataTransfer.getData("tab"),y=c.value.find(x=>x.id===h);if(y){const{clientX:x,clientY:v}=p;y.dialog={left:x,top:v},m(y)}}},C=p=>!!n[p];return VueUse.useEventListener(document,"dragover",b),VueUse.useEventListener(document,"drop",w),{createView:i,openDialog:m,refresh:f,exclude:t,cleanCache:g,hasDialog:C,closeDialog:d,closeDialogs:V}}const wt=Vue.defineComponent({name:"XMask",__name:"Mask",props:ht,emits:["select","actionClick","actionCommand"],setup(o,{emit:e}){const t=o,n=e,u=Wn(t),{collapsed:r,keyword:s,favorite:a}=Gn(),{menus:l,favorites:c,flatMenus:i,active:d,select:V,toggleFavorite:m}=Jn(t,n),{tabRef:f,showTabs:g,currentTab:b,changeTab:w,removeTab:C,tabs:p,updateTab:h,isCurrentTab:y,activeHome:x,removeAllTabs:v,removeOtherTabs:P,dropdownTabs:z,moveToShow:I}=qn(t,n,i,d,u),{createView:T,openDialog:M,refresh:B,exclude:E,cleanCache:_,closeDialogs:S}=Qn({tabs:p,updateTab:h,isCurrentTab:y,activeHome:x}),L=async D=>{await C(D)&&await _([D])},Z=async()=>{const D=await v();D&&(S(D),await _(D))},et=async()=>{const D=await P();D&&(S(D),await _(D))},tt=D=>{n("actionClick",D)},F0=(D,U)=>{n("actionCommand",D,U)};return Vue.provide(Te,{tabs:p,flatMenus:i,favorites:c,updateTab:h,active:d,currentTab:b}),(D,U)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:Vue.normalizeClass(["x-mask",{"is-disabled":t.disabled}]),fit:""},{default:Vue.withCtx(()=>[t.disabled?(Vue.openBlock(),Vue.createBlock(vt,{key:1,createView:Vue.unref(T),exclude:Vue.unref(E)},{default:Vue.withCtx(()=>[D.$slots.default?Vue.renderSlot(D.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["createView","exclude"])):(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,{key:0},[Vue.createVNode(Tn,{collapsed:Vue.unref(r)},{brand:Vue.withCtx(()=>[Vue.createVNode($n,{logo:t.logo,title:t.title,url:Vue.unref(u).url,collapsed:Vue.unref(r)},null,8,["logo","title","url","collapsed"])]),default:Vue.withCtx(()=>[Vue.createVNode(In,{collasped:Vue.unref(r),"onUpdate:collasped":U[0]||(U[0]=se=>Vue.isRef(r)?r.value=se:null),favorite:Vue.unref(a),"onUpdate:favorite":U[1]||(U[1]=se=>Vue.isRef(a)?a.value=se:null),keyword:Vue.unref(s),"onUpdate:keyword":U[2]||(U[2]=se=>Vue.isRef(s)?s.value=se:null)},null,8,["collasped","favorite","keyword"]),Vue.createVNode(An,{collapse:Vue.unref(r),keyword:Vue.unref(s),favorite:Vue.unref(a),favorites:Vue.unref(c),flatMenus:Vue.unref(i),menus:Vue.unref(l),active:Vue.unref(d),onSelect:Vue.unref(V)},null,8,["collapse","keyword","favorite","favorites","flatMenus","menus","active","onSelect"])]),_:1},8,["collapsed"]),Vue.createVNode(Vue.unref(N),{class:"x-mask__main",grow:"",shrink:"",flex:"",direction:"column"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(N),{class:"x-mask-topbar",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Hn,{ref_key:"tabRef",ref:f,favorites:Vue.unref(c),tabs:Vue.unref(g),home:Vue.unref(u),value:Vue.unref(b)?.id,onClick:Vue.unref(w),onToggleFavorite:Vue.unref(m),onRemove:L,onDialog:Vue.unref(M),onRefresh:Vue.unref(B)},null,8,["favorites","tabs","home","value","onClick","onToggleFavorite","onDialog","onRefresh"]),Vue.createVNode(Xn,{tabs:Vue.unref(z),actions:t.actions,theme:t.theme,onCloseOtherTabs:et,onCloseAllTabs:Z,onCloseTab:L,onClickTab:Vue.unref(I),onActionClick:tt,onActionCommand:F0},{default:Vue.withCtx(()=>[Vue.createVNode(Yn,{avatar:t.avatar},Vue.createSlots({_:2},[D.$slots.user?{name:"default",fn:Vue.withCtx(()=>[Vue.renderSlot(D.$slots,"user")]),key:"0"}:void 0]),1032,["avatar"])]),_:3},8,["tabs","actions","theme","onClickTab"])]),_:3}),Vue.createVNode(vt,{createView:Vue.unref(T),exclude:Vue.unref(E)},{default:Vue.withCtx(()=>[D.$slots.default?Vue.renderSlot(D.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["createView","exclude"])]),_:3})],64))]),_:3},8,["class"]))}});function Zn(o={}){const e=VueRouter.useRoute(),t=Vue.inject(ze,null),n=Vue.inject(Te,null);if(t){const r=typeof o=="function"?o:async()=>o;t[e.fullPath]=r}return{tab:Vue.computed(()=>n?n.tabs.value.find(r=>r.url===e.fullPath):null),mask:n}}const eo=Vue.defineComponent({__name:"SelectEditor",props:{options:{default:()=>[]}},setup(o){const e=o;return(t,n)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElSelect),Vue.normalizeProps(Vue.guardReactiveProps(t.$attrs)),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.options,(u,r)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElOption),Vue.mergeProps({key:`item_${r}_${u.value}`,ref_for:!0},u),Vue.createSlots({_:2},[t.$slots.option?{name:"default",fn:Vue.withCtx(()=>[Vue.renderSlot(t.$slots,"option",{option:u})]),key:"0"}:void 0]),1040))),128))]),_:3},16))}}),to=Vue.defineComponent({__name:"CheckboxEditor",props:{options:{default:()=>[]},button:{type:Boolean,default:!1}},setup(o){const e=o,t=Vue.computed(()=>Vue.markRaw(e.button?ElementPlus.ElCheckboxButton:ElementPlus.ElCheckbox));return(n,u)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElCheckboxGroup),Vue.normalizeProps(Vue.guardReactiveProps(n.$attrs)),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.options,(r,s)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(t.value),Vue.mergeProps({key:`item_${s}_${r.value}`,ref_for:!0},r),{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(r.label),1)]),_:2},1040))),128))]),_:1},16))}}),no=Vue.defineComponent({__name:"RadioEditor",props:{options:{default:()=>[]},button:{type:Boolean,default:!1}},setup(o){const e=o,t=Vue.computed(()=>Vue.markRaw(e.button?ElementPlus.ElRadioButton:ElementPlus.ElRadio));return(n,u)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElRadioGroup),Vue.normalizeProps(Vue.guardReactiveProps(n.$attrs)),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.options,(r,s)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(t.value),Vue.mergeProps({key:`item_${s}_${r.value}`,ref_for:!0},r),{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(r.label),1)]),_:2},1040))),128))]),_:1},16))}}),Ie={none:{component:"div",props:{class:"x-field-none"}},text:{component:ElementPlus.ElInput,props:{clearable:!0},defaultValue:""},textarea:{component:ElementPlus.ElInput,props:{type:"textarea",rows:2},defaultValue:""},select:{component:eo,props:{clearable:!0}},checkbox:{component:to,props:{},defaultValue:[]},radio:{component:no,props:{}},number:{component:ElementPlus.ElInputNumber,props:{}},date:{component:ElementPlus.ElDatePicker,props:{}},time:{component:ElementPlus.ElTimePicker,props:{}},datetime:{component:ElementPlus.ElDatePicker,props:{type:"datetime"}},switch:{component:ElementPlus.ElSwitch,props:{}},rate:{component:ElementPlus.ElRate,props:{}},slider:{component:ElementPlus.ElSlider,props:{}},cascader:{component:ElementPlus.ElCascader,props:{}}},kt={name:{type:String},label:{type:String},editor:{type:[String,Object],default:"text"},props:{type:Object},modelValue:{type:[String,Number,Boolean,Object,Array],default(o){return Ie[o.editor]?.defaultValue}},size:{type:String},width:{type:[String,Number]},tooltipMessage:{type:[Boolean,Object],default:!0},tooltipPosition:{type:[String,Number],default:"outer"},placeholder:{type:String},disabled:{type:Boolean},readonly:{type:Boolean},options:{type:[Array,Function]},visible:{type:[Boolean,Object,Function],default:!0},cascader:{type:[String,Array]},error:{type:String},tip:{type:String},inline:{type:Boolean}};async function oo(o,e){const t=o.options;return t?typeof t=="function"?await t(e)||[]:t:[]}function uo(o,e,t,n,u){const r=Vue.ref([]),s=Vue.computed(()=>!n||!u?{}:VtjUtils.toArray(o.cascader).reduce((c,i)=>(c[i]=VtjUtils.get(u,i),c),{}));return Vue.watch(s,async l=>{if(t.value){r.value=await oo(o,l);const c=n?.exposed?.reset;c&&o.name&&c(o.name)}},{immediate:!0}),{editor:Vue.computed(()=>{const{editor:l="text",placeholder:c,label:i="...",disabled:d,readonly:V}=o,m={...o.props,placeholder:c||(c===null?void 0:`请输入${i}`),disabled:d,readonly:V,options:r.value,onFocus:()=>e("focus"),onBlur:()=>e("blur"),onChange:g=>e("change",g)},f=typeof l=="string"?Ie[l]:{component:l,props:{}};return VtjUtils.merge({},f,{props:m})})}}const ro={key:1,class:"el-form-item__error"},lo={key:0,class:"x-field__tip"},De=Vue.defineComponent({name:"XField",__name:"Field",props:kt,emits:["update:modelValue","change","focus","blur"],setup(o,{expose:e,emit:t}){const n=o,u=t,r=Vue.inject(Me,null),s=Vue.inject(ElementPlus.formContextKey,null),a=Vue.inject($e,null),l=Vue.computed(()=>!r?.proxy||!a?n.visible:typeof n.visible=="function"?n.visible(a):VtjUtils.isObject(n.visible)?Object.entries(n.visible).every(([P,z])=>VtjUtils.get(a,P)===z):n.visible),c=()=>r?.proxy&&a&&n.name?VtjUtils.get(a,n.name)??n.modelValue:n.modelValue,i=Vue.ref(c()),{editor:d}=uo(n,u,l,r,a),V=Vue.ref(),m=Vue.ref(),f=Vue.computed(()=>n.size||s?.size||"default"),g=Vue.computed(()=>Object.assign({},r?.props.tooltipMessage||{},typeof n.tooltipMessage=="boolean"?{}:n.tooltipMessage)),b=(v="")=>n.error?n.error:v.includes("is required")?`${n.label||n.name}是必填项!`:v,w=Vue.computed(()=>{const v=r?.props.tooltipMessage??n.tooltipMessage;return{[`is-tooltip-${n.tooltipPosition}`]:!!v&&!!n.tooltipPosition}}),C=Vue.computed(()=>{const v=r?.proxy;return{width:n.width?j(n.width):v&&v.inline&&v.inlineColumns?`${100/v.inlineColumns}%`:null}}),p=Vue.computed(()=>({right:typeof n.tooltipPosition=="number"?`${n.tooltipPosition}px`:void 0})),h=Vue.computed(()=>({...d.value.props,modelValue:i.value,"onUpdate:modelValue":v=>{i.value=v}}));return Vue.watch(i,(v,P)=>{l.value&&!VtjUtils.isEqual(v,P)&&(u("update:modelValue",v),r?.proxy&&a&&n.name&&VtjUtils.set(a,n.name,v))}),Vue.watch(()=>!r?.proxy||!n.name||!a?n.modelValue:VtjUtils.get(a,n.name)??n.modelValue,v=>{l.value&&(i.value=v)},{immediate:!0}),Vue.watch(l,v=>{r?.proxy&&a&&n.name&&(v?(i.value=c(),VtjUtils.set(a,n.name,i.value)):(i.value=void 0,VtjUtils.set(a,n.name,void 0)))},{immediate:!0}),e({fieldValue:i,itemRef:V,editorRef:m,focus:()=>{m.value?.focus&&m.value.focus()},blur:()=>{m.value?.foucs&&m.value.blur()}}),(v,P)=>l.value?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElFormItem),Vue.mergeProps({key:0,class:["x-field",w.value],ref_key:"itemRef",ref:V,prop:n.name,label:v.label,size:f.value,style:C.value},v.$attrs),Vue.createSlots({error:Vue.withCtx(({error:z})=>[Vue.renderSlot(v.$slots,"error",{error:z},()=>[Vue.unref(r)?.props.tooltipMessage??n.tooltipMessage?(Vue.openBlock(),Vue.createElementBlock("div",{key:0,class:"x-field__info",style:Vue.normalizeStyle(p.value)},[Vue.createVNode(Vue.unref(ElementPlus.ElTooltip),Vue.mergeProps({content:b(z)},g.value),{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(A),{class:"x-field__trigger",icon:Vue.unref(VtjIcons.WarningFilled),size:f.value},null,8,["icon","size"])]),_:2},1040,["content"])],4)):(Vue.openBlock(),Vue.createElementBlock("div",ro,Vue.toDisplayString(b(z)),1))])]),default:Vue.withCtx(()=>[Vue.createElementVNode("div",{class:Vue.normalizeClass(["x-field__editor_wrap",{"is-inline":n.inline}])},[Vue.renderSlot(v.$slots,"editor",{editor:h.value},()=>[Vue.unref(d).component?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(d).component),Vue.mergeProps({key:0,class:"x-field__editor",ref_key:"editorRef",ref:m,modelValue:i.value,"onUpdate:modelValue":P[0]||(P[0]=z=>i.value=z)},Vue.unref(d).props),Vue.createSlots({_:2},[v.$slots.option?{name:"option",fn:Vue.withCtx(({option:z})=>[Vue.renderSlot(v.$slots,"option",{option:z})]),key:"0"}:void 0]),1040,["modelValue"])):Vue.createCommentVNode("",!0)]),n.tip||v.$slots.tip?(Vue.openBlock(),Vue.createElementBlock("div",lo,[Vue.renderSlot(v.$slots,"tip",{},()=>[Vue.createTextVNode(Vue.toDisplayString(n.tip),1)])])):Vue.createCommentVNode("",!0)],2),Vue.renderSlot(v.$slots,"default")]),_:2},[v.$slots.label?{name:"label",fn:Vue.withCtx(()=>[Vue.renderSlot(v.$slots,"label")]),key:"0"}:void 0]),1040,["prop","label","size","class","style"])):Vue.createCommentVNode("",!0)}}),Ct={model:{type:Object,default(){return Object.create(null)}},inline:{type:Boolean},inlineColumns:{type:Number},footer:{type:Boolean,default:!0},submitText:{type:String,default:"提交"},resetText:{type:String,default:"重置"},submitMethod:{type:Function},tooltipMessage:{type:[Object,Boolean],default:void 0}},Me=Symbol("formInstanceKey"),$e=Symbol("formModelKey"),Ae=Vue.defineComponent({name:"XForm",__name:"Form",props:Ct,emits:["change","submit","reset"],setup(o,{expose:e,emit:t}){const n=o,u=t,r=Vue.getCurrentInstance(),s=Vue.ref(),a=Vue.reactive(n.model||{}),l=Vue.ref(!1);Vue.provide(Me,r),Vue.provide($e,a),Vue.watch(()=>n.model,d=>{Object.assign(a,d)},{deep:!0}),Vue.watch(a,()=>{u("change",Vue.toRaw(a))});const c=async()=>{await s.value.validate().catch(()=>!1)&&(u("submit",Vue.toRaw(a)),n.submitMethod&&(l.value=!0,await n.submitMethod(Vue.toRaw(a)),l.value=!1))},i=d=>{s.value.resetFields(d),u("reset")};return e({formRef:s,model:a,submit:c,reset:i}),(d,V)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElForm),Vue.mergeProps({ref_key:"formRef",ref:s,class:"x-form",inline:n.inline,model:a,onKeyup:Vue.withKeys(c,["enter"]),onSubmit:V[1]||(V[1]=Vue.withModifiers(()=>{},["stop","prevent"]))},d.$attrs),{default:Vue.withCtx(()=>[Vue.renderSlot(d.$slots,"default"),n.footer?(Vue.openBlock(),Vue.createBlock(Vue.unref(De),{key:0,editor:"none",class:"x-form__footer",label:" "},{editor:Vue.withCtx(()=>[Vue.renderSlot(d.$slots,"footer",{},()=>[n.submitText?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:0,loading:l.value,type:"primary",onClick:c},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(n.submitText),1)]),_:1},8,["loading"])):Vue.createCommentVNode("",!0),n.resetText?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:1,type:"default",onClick:V[0]||(V[0]=()=>i())},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(n.resetText),1)]),_:1})):Vue.createCommentVNode("",!0),Vue.renderSlot(d.$slots,"action")])]),_:3})):Vue.createCommentVNode("",!0)]),_:3},16,["inline","model"]))}}),bt={modelValue:{type:Boolean,default:!0},size:{type:String},formProps:{type:Object},submit:{type:[Boolean,String],default:"确定"},cancel:{type:[Boolean,String],default:"取消"},model:{type:Object,default(){return Object.create(null)}},rules:{type:Object},submitMethod:{type:Function}},_t=Vue.defineComponent({name:"XDialogForm",__name:"DialogForm",props:bt,emits:["update:modelValue","submit","close"],setup(o,{expose:e,emit:t}){const n=o,u=t,r=Vue.ref(),s=Vue.ref(),a=Vue.computed(()=>s.value?.$vtjEl),l=()=>{r.value?.submit()},c=()=>{u("update:modelValue",!1),u("close")},i=async m=>{u("submit",m),n.submitMethod?await n.submitMethod(m)&&c():c()},d=Vue.computed(()=>n.formProps?.disabled?!1:n.submit),V=Vue.computed(()=>n.formProps?.disabled?!1:n.cancel);return e({$vtjEl:a,formRef:r,dialogRef:s}),(m,f)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(de),Vue.mergeProps({ref_key:"dialogRef",ref:s,class:"x-dialog-form","model-value":n.modelValue,submit:d.value,cancel:V.value,size:n.size,onSubmit:l,onClose:c,minimizable:!1,maximizable:!1},m.$attrs),Vue.createSlots({default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(Ae),Vue.mergeProps({ref_key:"formRef",ref:r,class:"x-dialog-form__form",footer:!1,"label-width":"80px",size:n.size,model:n.model,rules:n.rules,"submit-method":i},n.formProps),{default:Vue.withCtx(()=>[Vue.renderSlot(m.$slots,"default")]),_:3},16,["size","model","rules"])]),_:2},[m.$slots.extra?{name:"extra",fn:Vue.withCtx(()=>[Vue.renderSlot(m.$slots,"extra")]),key:"0"}:void 0,m.$slots.handle?{name:"handle",fn:Vue.withCtx(()=>[Vue.renderSlot(m.$slots,"handle")]),key:"1"}:void 0,m.$slots.footer?{name:"footer",fn:Vue.withCtx(()=>[Vue.renderSlot(m.$slots,"footer")]),key:"2"}:void 0]),1040,["model-value","submit","cancel","size"]))}}),Bt={items:{type:Array,default(){return[]}},border:{type:Boolean},fit:{type:Boolean},align:{type:String}},ao={class:"x-tabs__label-inner"},so={key:0,class:"x-tabs__actions"},Et=Vue.defineComponent({name:"XTabs",__name:"Tabs",props:Bt,emits:["actionClick","actionCommand"],setup(o,{emit:e}){const t=o,n=e,u=l=>{const{label:c,name:i,value:d,disabled:V,closable:m,lazy:f}=l;return{label:c,name:d??i,disabled:V,closable:m,lazy:f}},r=Vue.computed(()=>({"is-no-border":!t.border,"is-fit":!!t.fit,[`is-align-${t.align}`]:!!t.align})),s=l=>{n("actionClick",l)},a=l=>{n("actionCommand",l)};return(l,c)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElTabs),Vue.mergeProps({class:["x-tabs",r.value]},l.$attrs),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(t.items,i=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElTabPane),Vue.mergeProps({key:i.value??i.name,ref_for:!0},u(i)),{label:Vue.withCtx(()=>[Vue.renderSlot(l.$slots,"label",Vue.mergeProps({ref_for:!0},i),()=>[i.icon?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(X)(i.icon)),{key:0,class:"x-tabs__icon"})):Vue.createCommentVNode("",!0),Vue.createElementVNode("div",ao,[Vue.createTextVNode(Vue.toDisplayString(i.label)+" ",1),i.actions&&[i.name,i.value].includes(l.$attrs.modelValue)?(Vue.openBlock(),Vue.createElementBlock("div",so,[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(i.actions,d=>(Vue.openBlock(),Vue.createBlock(Vue.unref(R),Vue.mergeProps({mode:"icon",type:"primary",size:"small",circle:"",ref_for:!0},d,{onClick:s,onCommand:a}),null,16))),256))])):Vue.createCommentVNode("",!0)])])]),default:Vue.withCtx(()=>[Vue.renderSlot(l.$slots,"default",Vue.mergeProps({ref_for:!0},i),()=>[i.component?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(i.component),Vue.mergeProps({key:0,ref_for:!0},i.props),null,16)):Vue.createCommentVNode("",!0)])]),_:2},1040))),128))]),_:3},16,["class"]))}}),xt={direction:{type:String,default:"column"},imageSrc:{type:String},imageWidth:{type:[Number,String]},imageHeight:{type:[Number,String]},icon:{type:[String,Object]},title:{type:String},description:{type:String},actions:{type:Array},actionBarProps:{type:Object},split:{type:Boolean},onImageClick:{type:Function},onTitleClick:{type:Function}},io={class:"x-data-item__title"},co={key:1,class:"x-data-item__section x-data-item__desc"},mo={key:2,class:"x-data-item__section x-data-item__extra"},fo={key:3,class:"x-data-item__section x-data-item__actions"},St=Vue.defineComponent({name:"XDataItem",__name:"DataItem",props:xt,emits:["imageClick","titleClick","actionClick","actionCommand"],setup(o,{emit:e}){const t=o,n=e,u=Vue.computed(()=>{const{imageWidth:d,imageHeight:V}=t;return{width:d?j(d):void 0,height:V?j(V):void 0}}),r=Vue.computed(()=>({[`is-image-${t.direction}`]:!!t.direction,"is-split":!!t.split})),s=Vue.computed(()=>({size:"small",mode:"text",justify:"flex-end",type:"info",items:t.actions,...t.actionBarProps})),a=()=>n("imageClick"),l=()=>n("titleClick"),c=d=>n("actionClick",d),i=(d,V)=>n("actionCommand",d,V);return(d,V)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:Vue.normalizeClass(["x-data-item",r.value]),direction:t.direction},{default:Vue.withCtx(()=>[t.imageSrc||d.$slots.image?(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{key:0,class:"x-data-item__img",autoPointer:!0,onClick:t.onImageClick?a:void 0},{default:Vue.withCtx(()=>[Vue.renderSlot(d.$slots,"image",{},()=>[t.imageSrc?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElImage),{key:0,style:Vue.normalizeStyle(u.value),src:t.imageSrc},null,8,["style","src"])):Vue.createCommentVNode("",!0)])]),_:3},8,["onClick"])):Vue.createCommentVNode("",!0),Vue.createVNode(Vue.unref(N),{class:"x-data-item__content",direction:"column",grow:"",shrink:""},{default:Vue.withCtx(()=>[t.title||d.$slots.title?(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{key:0,class:"x-data-item__section x-data-item__wrapper",align:"center",autoPointer:!0,onClick:t.onTitleClick?l:void 0},{default:Vue.withCtx(()=>[t.icon?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(X)(t.icon)),{key:0,class:"x-data-item__icon"})):Vue.createCommentVNode("",!0),Vue.createElementVNode("span",io,[Vue.renderSlot(d.$slots,"title",{},()=>[Vue.createTextVNode(Vue.toDisplayString(t.title),1)])])]),_:3},8,["onClick"])):Vue.createCommentVNode("",!0),t.description||d.$slots.description?(Vue.openBlock(),Vue.createElementBlock("div",co,[Vue.renderSlot(d.$slots,"description",{},()=>[Vue.createTextVNode(Vue.toDisplayString(t.description),1)])])):Vue.createCommentVNode("",!0),d.$slots.default?(Vue.openBlock(),Vue.createElementBlock("div",mo,[Vue.renderSlot(d.$slots,"default")])):Vue.createCommentVNode("",!0),t.actions||t.actionBarProps||d.$slots.actions?(Vue.openBlock(),Vue.createElementBlock("div",fo,[Vue.renderSlot(d.$slots,"actions",{},()=>[Vue.createVNode(Vue.unref(ne),Vue.mergeProps(s.value,{onClick:c,onCommand:i}),null,16)])])):Vue.createCommentVNode("",!0)]),_:3})]),_:3},8,["direction","class"]))}}),Nt={data:{type:[Object,Function],default(){return[]}},itemHeight:{type:[Number,Function]},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},pager:{type:[Boolean,Object]},page:{type:Number,default:1},pageSize:{type:Number,default:10},dataKey:{type:String},infiniteScroll:{type:[Boolean,Object]}},Vo={key:0,class:"x-list__loading"},po={key:1,class:"x-list__nomore"},go={key:0,class:"x-list__loading"},ho={key:1,class:"x-list__nomore"},vo={key:1,class:"x-list__pager"},Pt=Vue.defineComponent({name:"XList",__name:"List",props:Nt,emits:["load"],setup(o,{expose:e,emit:t}){const n=o,u=t,r=Vue.reactive({page:n.page,pageSize:n.pageSize});Vue.watchEffect(()=>{const{page:y,pageSize:x}=n;Object.assign(r,{page:y,pageSize:x})});const{data:s,loading:a}=st(n.data,{list:[],total:0},r),l=Vue.computed(()=>Math.ceil((s.value.total||0)/r.pageSize)),c=Vue.ref(!1),i=Vue.ref(),d=Vue.computed(()=>({width:j(n.width),height:j(n.height)})),V=Vue.computed(()=>({"is-virtual":!!n.itemHeight})),m=Vue.computed(()=>{const y={};for(let[x,v]of Object.entries(be(n.infiniteScroll)))y[`infinite-scroll-${x}`]=v;return(a.value||c.value)&&(y["infinite-scroll-disabled"]=!0),y}),f=Vue.computed(()=>be(n.pager,{})),{list:g,containerProps:b,wrapperProps:w,scrollTo:C}=VueUse.useVirtualList(Vue.computed(()=>s.value.list),{itemHeight:n.itemHeight||0}),p=()=>{!n.infiniteScroll||c.value||(r.page<l.value?(++r.page,u("load",r)):c.value=!0)},h=y=>n.dataKey?y[n.dataKey]:void 0;return e({list:g,scrollTo:C,wrapperRef:i,loading:a,state:r,pageCount:l,nomore:c,data:s,getKey:h}),(y,x)=>(Vue.openBlock(),Vue.createElementBlock("div",{class:Vue.normalizeClass(["x-list",V.value]),style:Vue.normalizeStyle(d.value)},[!Vue.unref(s).total&&!Vue.unref(a)?Vue.renderSlot(y.$slots,"empty",{key:0},()=>[Vue.createVNode(Vue.unref(ElementPlus.ElEmpty))]):Vue.createCommentVNode("",!0),Vue.createElementVNode("div",Vue.mergeProps({class:"x-list__content"},Vue.unref(b)),[n.itemHeight?Vue.withDirectives((Vue.openBlock(),Vue.createElementBlock("div",Vue.mergeProps({key:0,class:"x-list__wrapper",ref_key:"wrapperRef",ref:i},{...Vue.unref(w),...m.value}),[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(Vue.unref(g),(v,P)=>Vue.renderSlot(y.$slots,"default",Vue.mergeProps({key:h(v.data),ref_for:!0},{item:v.data,index:P}),()=>[Vue.createElementVNode("div",null,Vue.toDisplayString(v),1)])),128)),Vue.unref(a)?(Vue.openBlock(),Vue.createElementBlock("div",Vo,[Vue.renderSlot(y.$slots,"loading",{},()=>[Vue.createTextVNode(" 正在加载数据... ")])])):Vue.createCommentVNode("",!0),c.value?(Vue.openBlock(),Vue.createElementBlock("div",po,[Vue.renderSlot(y.$slots,"nomore",{},()=>[Vue.createTextVNode(" 没有更多数据 ")])])):Vue.createCommentVNode("",!0)],16)),[[Vue.unref(ElementPlus.ElInfiniteScroll),p]]):Vue.withDirectives((Vue.openBlock(),Vue.createElementBlock("div",Vue.mergeProps({key:1,class:"x-list__wrapper"},m.value),[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(Vue.unref(s).list,(v,P)=>Vue.renderSlot(y.$slots,"default",Vue.mergeProps({key:h(v),ref_for:!0},{item:v,index:P}),()=>[Vue.createElementVNode("div",null,Vue.toDisplayString(v),1)])),128)),Vue.unref(a)?(Vue.openBlock(),Vue.createElementBlock("div",go,[Vue.renderSlot(y.$slots,"loading",{},()=>[Vue.createTextVNode(" 正在加载数据... ")])])):Vue.createCommentVNode("",!0),c.value?(Vue.openBlock(),Vue.createElementBlock("div",ho,[Vue.renderSlot(y.$slots,"nomore",{},()=>[Vue.createTextVNode(" 没有更多数据 ")])])):Vue.createCommentVNode("",!0)],16)),[[Vue.unref(ElementPlus.ElInfiniteScroll),p]])],16),n.pager?(Vue.openBlock(),Vue.createElementBlock("div",vo,[Vue.createVNode(Vue.unref(ElementPlus.ElPagination),Vue.mergeProps({small:"",background:"",layout:"prev, pager, next",total:Vue.unref(s).total,"default-page-size":n.pageSize,"default-current-page":n.page,"current-page":r.page,"onUpdate:currentPage":x[0]||(x[0]=v=>r.page=v),"page-size":r.pageSize,"onUpdate:pageSize":x[1]||(x[1]=v=>r.pageSize=v)},f.value),null,16,["total","default-page-size","default-current-page","current-page","page-size"])])):Vue.createCommentVNode("",!0)],6))}}),zt={name:{type:String,default:"VTJ.PRO"},tagline:{type:String,default:"基于 Vue3 + TypeScript 快速打造高生产力的低代码研发平台"},actionText:{type:String,default:"开始设计"},actionLink:{type:String,default:"/@vtj/pro/"}},yo={class:"x-startup"},wo={class:"x-startup__wrapper"},ko={class:"x-startup__name"},Co={class:"clip"},bo={class:"x-startup__tagline"},_o={class:"x-startup__actions"},Tt=Vue.defineComponent({__name:"Startup",props:zt,setup(o){const e=o,t=()=>{if(typeof window<"u"){let u=(window.__VTJ_LINK__||{}).href||window.location.pathname+"@vtj/pro/#/";window.location.href=u}};return(n,u)=>(Vue.openBlock(),Vue.createElementBlock("div",yo,[Vue.createElementVNode("div",wo,[Vue.createElementVNode("div",ko,[Vue.createElementVNode("span",Co,Vue.toDisplayString(e.name),1)]),Vue.createElementVNode("div",bo,Vue.toDisplayString(e.tagline),1),Vue.createElementVNode("div",_o,[Vue.createVNode(Vue.unref(ElementPlus.ElButton),{type:"primary",size:"large",round:"",icon:Vue.unref(VtjIcons.EditPen),onClick:t},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(e.actionText),1)]),_:1},8,["icon"])])])]))}}),It={stringProp:{type:String},booleanProp:{type:Boolean},numberProp:{type:Number},selectProp:{type:String},objectProp:{type:Object},arrayProp:{type:Array},iconProp:{type:String},colorProp:{type:String},modelValue:{type:String},syncProp:{type:String}},Bo={class:"x-test__slot"},Eo={class:"x-test__slot"},Dt=Vue.defineComponent({name:"XTest",__name:"Test",props:It,emits:["click","submit","change","update:modelValue","update:syncProp"],setup(o,{expose:e,emit:t}){const n=o,u=t,r=Vue.computed(()=>Object.entries(n)),s=Vue.computed({get(){return n.modelValue},set(m){u("update:modelValue",m)}}),a=Vue.computed({get(){return n.syncProp},set(m){u("update:syncProp",m)}}),l=Vue.ref("default inner data"),c=()=>{ElementPlus.ElMessage.info({message:"触发click事件"}),u("click",n)},i=()=>{ElementPlus.ElMessage.info({message:"触发submit事件"}),u("submit",n)},d=m=>{l.value=m,u("change",l.value)},V=()=>{d("user click change:"+Date.now())};return e({click:c,submit:i,data:l,change:d}),(m,f)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(Y),{class:"x-test",header:"VTJ 低代码测试组件",border:""},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElDivider),null,{default:Vue.withCtx(()=>[Vue.createTextVNode("内部数据")]),_:1}),Vue.createVNode(Vue.unref(N),null,{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(l.value),1)]),_:1}),Vue.createVNode(Vue.unref(ElementPlus.ElDivider),null,{default:Vue.withCtx(()=>[Vue.createTextVNode("属性")]),_:1}),Vue.createVNode(Vue.unref(ElementPlus.ElDescriptions),{column:3,border:""},{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(r.value,([g,b])=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDescriptionsItem),{label:g},{default:Vue.withCtx(()=>[Vue.createElementVNode("pre",null,Vue.toDisplayString(JSON.stringify(b,null,2)),1)]),_:2},1032,["label"]))),256))]),_:1}),Vue.createVNode(Vue.unref(ElementPlus.ElDivider),null,{default:Vue.withCtx(()=>[Vue.createTextVNode("插槽")]),_:1}),Vue.createVNode(Vue.unref(N),{justify:"space-around",flex:"",gap:""},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(Y),{header:"default",grow:"",card:""},{default:Vue.withCtx(()=>[Vue.createElementVNode("div",Bo,[Vue.renderSlot(m.$slots,"default",{props:n,data:l.value},()=>[Vue.createElementVNode("pre",null,Vue.toDisplayString(JSON.stringify({props:n,data:l.value},null,2)),1)])])]),_:3}),Vue.createVNode(Vue.unref(Y),{header:"extra",grow:"",card:""},{default:Vue.withCtx(()=>[Vue.createElementVNode("div",Eo,[Vue.renderSlot(m.$slots,"extra",{props:n,data:l.value},()=>[Vue.createElementVNode("pre",null,Vue.toDisplayString(JSON.stringify({props:n,data:l.value},null,2)),1)])])]),_:3})]),_:3}),Vue.createVNode(Vue.unref(ElementPlus.ElDivider),null,{default:Vue.withCtx(()=>[Vue.createTextVNode("双向绑定")]),_:1}),Vue.createVNode(Vue.unref(N),null,{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElDescriptions),{column:2,border:""},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElDescriptionsItem),{label:"modelValue"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElInput),{modelValue:s.value,"onUpdate:modelValue":f[0]||(f[0]=g=>s.value=g)},null,8,["modelValue"])]),_:1}),Vue.createVNode(Vue.unref(ElementPlus.ElDescriptionsItem),{label:"syncProp"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElInput),{modelValue:a.value,"onUpdate:modelValue":f[1]||(f[1]=g=>a.value=g)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),Vue.createVNode(Vue.unref(ElementPlus.ElDivider),null,{default:Vue.withCtx(()=>[Vue.createTextVNode("事件和方法")]),_:1}),Vue.createVNode(Vue.unref(N),null,{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElButton),{onClick:c},{default:Vue.withCtx(()=>[Vue.createTextVNode("click")]),_:1}),Vue.createVNode(Vue.unref(ElementPlus.ElButton),{onClick:i},{default:Vue.withCtx(()=>[Vue.createTextVNode("submit")]),_:1}),Vue.createVNode(Vue.unref(ElementPlus.ElButton),{onClick:V},{default:Vue.withCtx(()=>[Vue.createTextVNode("change")]),_:1})]),_:1})]),_:3}))}}),Mt={units:{type:[String,Object,Array]},unit:{type:String},appendWidth:{type:Number,default:100},withUnit:{type:Boolean,default:!0},format:{type:String},modelValue:{type:[String,Number]},selectProps:{type:Object}},$t=Vue.defineComponent({name:"XInputUnit",__name:"InputUnit",props:Mt,emits:["update:modelValue","update:unit","change","unit-change"],setup(o,{expose:e,emit:t}){const n=o,u=t,r=Vue.computed(()=>VtjUtils.toArray(n.units).map(g=>typeof g=="string"?{label:g,value:g}:g)),s=Vue.computed(()=>{const f=r.value.map(g=>g.value);return n.unit&&f.push(n.unit),VtjUtils.dedupArray(f)}),a=Vue.ref(),l=Vue.ref(),c=f=>n.format&&f?VtjUtils.numberFormat(Number(f)||0,n.format):f,i=f=>{if(!n.withUnit||typeof f!="string")return{value:c(f),unit:n.unit};for(const g of s.value){const b=new RegExp(`${g}$`);if(b.test(f))return{value:c(f.toString().replace(b,"")),unit:g}}return{value:c(f),unit:n.unit}},d=()=>{const f=c(l.value),g=a.value;return n.withUnit&&f&&g?`${f}${g}`:f};Vue.watch(()=>n.modelValue,f=>{const{value:g,unit:b}=i(f);a.value=b,l.value=g},{immediate:!0}),Vue.watch(l,f=>{u("change",f)});const V=async()=>{const{value:f,unit:g}=i(d());l.value=f,a.value=g,u("update:modelValue",d())},m=()=>{u("unit-change",a.value),V()};return e({parser:i,formatValue:c}),(f,g)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElInput),{modelValue:l.value,"onUpdate:modelValue":g[1]||(g[1]=b=>l.value=b),modelModifiers:{trim:!0},class:"x-input-unit",onChange:V},Vue.createSlots({_:2},[r.value.length?{name:"append",fn:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElSelect),Vue.mergeProps({class:"x-input-unit__unit",modelValue:a.value,"onUpdate:modelValue":g[0]||(g[0]=b=>a.value=b),size:f.$attrs.size,style:{width:`${n.appendWidth}px`}},f.$props.selectProps,{onChange:m}),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(r.value,b=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElOption),{key:b.value,label:b.label,value:b.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","size","style"])]),key:"0"}:{name:"suffix",fn:Vue.withCtx(()=>[a.value?(Vue.openBlock(),Vue.createElementBlock("div",{key:0,class:"x-input-unit__unit"},[Vue.createElementVNode("span",null,Vue.toDisplayString(a.value),1)])):Vue.createCommentVNode("",!0)]),key:"1"}]),1032,["modelValue"]))}}),At={image:{type:Function},maxLength:{type:Number,default:4},placeholder:{type:String,default:"请输入图形验证码"},validate:{type:Function}},xo=["src"],Rt=Vue.defineComponent({name:"XImageCodeInput",__name:"ImageCodeInput",props:At,setup(o){const e=o,t=Vue.useAttrs(),n=Vue.ref(),u=Vue.ref(),r=async()=>{typeof e.image=="function"&&(u.value=await e.image())};r();const s=Vue.ref(),a=Vue.computed(()=>{const V=t.size||"default",m={small:22,default:30,large:38};return s.value=m[V],console.log(s.value),{[`is-${V}`]:!!V}}),l=Vue.ref(""),c=Vue.ref(e.maxLength);let i;typeof e.validate=="function"&&(i=e.validate);const d=()=>{r(),l.value=""};return Vue.watch(l,async()=>{l.value.length===c.value?await i(l.value)?n.value="success":n.value="error":n.value=""},{immediate:!0}),(V,m)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElInput),{modelValue:l.value,"onUpdate:modelValue":m[0]||(m[0]=f=>l.value=f),class:"x-image-code-input",maxlength:c.value,placeholder:e.placeholder},{prepend:Vue.withCtx(()=>[Vue.createElementVNode("img",{class:Vue.normalizeClass(["x-image-code-input__image",a.value]),onClick:d,src:u.value},null,10,xo)]),suffix:Vue.withCtx(()=>[n.value==="success"?(Vue.openBlock(),Vue.createBlock(Vue.unref(A),{key:0,class:"x-image-code-input__iconSuccess",icon:Vue.unref(VtjIcons.SuccessFilled),size:s.value},null,8,["icon","size"])):Vue.createCommentVNode("",!0),n.value==="error"?(Vue.openBlock(),Vue.createBlock(Vue.unref(A),{key:1,class:"x-image-code-input__iconError",icon:Vue.unref(VtjIcons.CircleCloseFilled),size:s.value},null,8,["icon","size"])):Vue.createCommentVNode("",!0)]),_:1},8,["modelValue","maxlength","placeholder"]))}}),So=["image/png","image/jpeg","image/webp"],jt={margin:{type:Number},scale:{type:Number},width:{type:Number,default:200},color:{type:Object},darkColor:{type:String,default:"#000000ff"},lightColor:{type:String,default:"#ffffffff"},quality:{type:Number,default:.92},value:{type:[String,Function],default:""},timeout:{type:Number,default:0},tip:{type:String,default:"二维码已失效请刷新后重试"}};var oe={},No=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Ft={},$={};let Re;const Po=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];$.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},$.getSymbolTotalCodewords=function(e){return Po[e]},$.getBCHDigit=function(o){let e=0;for(;o!==0;)e++,o>>>=1;return e},$.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Re=e},$.isKanjiModeEnabled=function(){return typeof Re<"u"},$.toSJIS=function(e){return Re(e)};var pe={};(function(o){o.L={bit:1},o.M={bit:0},o.Q={bit:3},o.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return o.L;case"m":case"medium":return o.M;case"q":case"quartile":return o.Q;case"h":case"high":return o.H;default:throw new Error("Unknown EC Level: "+t)}}o.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},o.from=function(n,u){if(o.isValid(n))return n;try{return e(n)}catch{return u}}})(pe);function Lt(){this.buffer=[],this.length=0}Lt.prototype={get:function(o){const e=Math.floor(o/8);return(this.buffer[e]>>>7-o%8&1)===1},put:function(o,e){for(let t=0;t<e;t++)this.putBit((o>>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(o){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),o&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var zo=Lt;function ue(o){if(!o||o<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=o,this.data=new Uint8Array(o*o),this.reservedBit=new Uint8Array(o*o)}ue.prototype.set=function(o,e,t,n){const u=o*this.size+e;this.data[u]=t,n&&(this.reservedBit[u]=!0)},ue.prototype.get=function(o,e){return this.data[o*this.size+e]},ue.prototype.xor=function(o,e,t){this.data[o*this.size+e]^=t},ue.prototype.isReserved=function(o,e){return this.reservedBit[o*this.size+e]};var To=ue,Ut={};(function(o){const e=$.getSymbolSize;o.getRowColCoords=function(n){if(n===1)return[];const u=Math.floor(n/7)+2,r=e(n),s=r===145?26:Math.ceil((r-13)/(2*u-2))*2,a=[r-7];for(let l=1;l<u-1;l++)a[l]=a[l-1]-s;return a.push(6),a.reverse()},o.getPositions=function(n){const u=[],r=o.getRowColCoords(n),s=r.length;for(let a=0;a<s;a++)for(let l=0;l<s;l++)a===0&&l===0||a===0&&l===s-1||a===s-1&&l===0||u.push([r[a],r[l]]);return u}})(Ut);var Ht={};const Io=$.getSymbolSize,Ot=7;Ht.getPositions=function(e){const t=Io(e);return[[0,0],[t-Ot,0],[0,t-Ot]]};var Kt={};(function(o){o.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};o.isValid=function(u){return u!=null&&u!==""&&!isNaN(u)&&u>=0&&u<=7},o.from=function(u){return o.isValid(u)?parseInt(u,10):void 0},o.getPenaltyN1=function(u){const r=u.size;let s=0,a=0,l=0,c=null,i=null;for(let d=0;d<r;d++){a=l=0,c=i=null;for(let V=0;V<r;V++){let m=u.get(d,V);m===c?a++:(a>=5&&(s+=e.N1+(a-5)),c=m,a=1),m=u.get(V,d),m===i?l++:(l>=5&&(s+=e.N1+(l-5)),i=m,l=1)}a>=5&&(s+=e.N1+(a-5)),l>=5&&(s+=e.N1+(l-5))}return s},o.getPenaltyN2=function(u){const r=u.size;let s=0;for(let a=0;a<r-1;a++)for(let l=0;l<r-1;l++){const c=u.get(a,l)+u.get(a,l+1)+u.get(a+1,l)+u.get(a+1,l+1);(c===4||c===0)&&s++}return s*e.N2},o.getPenaltyN3=function(u){const r=u.size;let s=0,a=0,l=0;for(let c=0;c<r;c++){a=l=0;for(let i=0;i<r;i++)a=a<<1&2047|u.get(c,i),i>=10&&(a===1488||a===93)&&s++,l=l<<1&2047|u.get(i,c),i>=10&&(l===1488||l===93)&&s++}return s*e.N3},o.getPenaltyN4=function(u){let r=0;const s=u.data.length;for(let l=0;l<s;l++)r+=u.data[l];return Math.abs(Math.ceil(r*100/s/5)-10)*e.N4};function t(n,u,r){switch(n){case o.Patterns.PATTERN000:return(u+r)%2===0;case o.Patterns.PATTERN001:return u%2===0;case o.Patterns.PATTERN010:return r%3===0;case o.Patterns.PATTERN011:return(u+r)%3===0;case o.Patterns.PATTERN100:return(Math.floor(u/2)+Math.floor(r/3))%2===0;case o.Patterns.PATTERN101:return u*r%2+u*r%3===0;case o.Patterns.PATTERN110:return(u*r%2+u*r%3)%2===0;case o.Patterns.PATTERN111:return(u*r%3+(u+r)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}o.applyMask=function(u,r){const s=r.size;for(let a=0;a<s;a++)for(let l=0;l<s;l++)r.isReserved(l,a)||r.xor(l,a,t(u,l,a))},o.getBestMask=function(u,r){const s=Object.keys(o.Patterns).length;let a=0,l=1/0;for(let c=0;c<s;c++){r(c),o.applyMask(c,u);const i=o.getPenaltyN1(u)+o.getPenaltyN2(u)+o.getPenaltyN3(u)+o.getPenaltyN4(u);o.applyMask(c,u),i<l&&(l=i,a=c)}return a}})(Kt);var ge={};const O=pe,he=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],ve=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];ge.getBlocksCount=function(e,t){switch(t){case O.L:return he[(e-1)*4+0];case O.M:return he[(e-1)*4+1];case O.Q:return he[(e-1)*4+2];case O.H:return he[(e-1)*4+3];default:return}},ge.getTotalCodewordsCount=function(e,t){switch(t){case O.L:return ve[(e-1)*4+0];case O.M:return ve[(e-1)*4+1];case O.Q:return ve[(e-1)*4+2];case O.H:return ve[(e-1)*4+3];default:return}};var Xt={},ye={};const re=new Uint8Array(512),we=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)re[t]=e,we[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t++)re[t]=re[t-255]})(),ye.log=function(e){if(e<1)throw new Error("log("+e+")");return we[e]},ye.exp=function(e){return re[e]},ye.mul=function(e,t){return e===0||t===0?0:re[we[e]+we[t]]},function(o){const e=ye;o.mul=function(n,u){const r=new Uint8Array(n.length+u.length-1);for(let s=0;s<n.length;s++)for(let a=0;a<u.length;a++)r[s+a]^=e.mul(n[s],u[a]);return r},o.mod=function(n,u){let r=new Uint8Array(n);for(;r.length-u.length>=0;){const s=r[0];for(let l=0;l<u.length;l++)r[l]^=e.mul(u[l],s);let a=0;for(;a<r.length&&r[a]===0;)a++;r=r.slice(a)}return r},o.generateECPolynomial=function(n){let u=new Uint8Array([1]);for(let r=0;r<n;r++)u=o.mul(u,new Uint8Array([1,e.exp(r)]));return u}}(Xt);const Yt=Xt;function je(o){this.genPoly=void 0,this.degree=o,this.degree&&this.initialize(this.degree)}je.prototype.initialize=function(e){this.degree=e,this.genPoly=Yt.generateECPolynomial(this.degree)},je.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=Yt.mod(t,this.genPoly),u=this.degree-n.length;if(u>0){const r=new Uint8Array(this.degree);return r.set(n,u),r}return n};var Do=je,Gt={},K={},Fe={};Fe.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var F={};const Wt="[0-9]+",Mo="[A-Z $%*+\\-./:]+";let le="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";le=le.replace(/u/g,"\\u");const $o="(?:(?![A-Z0-9 $%*+\\-./:]|"+le+`)(?:.|[\r
|
|
7
|
+
*/const ee="0.8.14",nt={default:14,small:12,large:18},ot={icon:{type:[String,Object]},color:{type:String},size:{type:[Number,String],default:"inherit"},src:{type:String},background:{type:String},padding:{type:Number},radius:{type:Number}};function j(o){return typeof o=="string"?o:`${o}px`}function te(o=0,e){if(typeof o=="number")return o;if(/(%|vh|vw)$/i.test(o)){const n=Number.parseInt(o);return Math.floor(e*n/100)}return Number.parseInt(o)}function be(o,e={}){const t={...e};return typeof o=="boolean"?t:Object.assign(t,o||{})}const _e=Symbol("INSTALLED_KEY"),ie=Symbol("ADAPTER_KEY");function ut(){return Vue.inject(ie,{})}const sn={install(o,e={}){o.provide(ie,e)}},rt=(o=[])=>({install:(t,n={})=>{t[_e]||(t[_e]=!0,o.forEach(u=>{u.name&&t.component(u.name,u)}),n.adapter&&t.provide(ie,n.adapter))}}),cn=["src"],A=Vue.defineComponent({name:"XIcon",__name:"Icon",props:ot,setup(o){const e=o,t=Vue.useAttrs(),n=Vue.getCurrentInstance(),u=Vue.computed(()=>{if(!e.icon)return null;const l=n?.appContext.app;return typeof e.icon=="object"?Vue.markRaw(e.icon):l?.component(e.icon)||e.icon}),r=Vue.computed(()=>{const l={"is-pointer":!!t.onClick};return!u.value&&e.icon&&(l[e.icon]=!0),l}),s=Vue.computed(()=>({"background-color":e.background,"border-radius":e.radius?j(e.radius):void 0,padding:e.padding?j(e.padding):void 0})),a=Vue.computed(()=>typeof e.size=="number"?e.size:nt[e.size]??void 0);return(l,c)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElIcon),{class:Vue.normalizeClass(["x-icon",r.value]),color:e.color,size:a.value,style:Vue.normalizeStyle(s.value)},{default:Vue.withCtx(()=>[Vue.renderSlot(l.$slots,"default",{},()=>[u.value?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(u.value),{key:0})):Vue.createCommentVNode("",!0),e.src?(Vue.openBlock(),Vue.createElementBlock("img",{key:1,src:e.src},null,8,cn)):Vue.createCommentVNode("",!0)])]),_:3},8,["class","color","size","style"]))}}),dn={class:"x-menu__wrapper"},mn={key:1,class:"x-menu__title"},fn=Vue.createElementVNode("i",null,null,-1),Vn={key:0,class:"x-menu__title"},pn=Vue.createElementVNode("i",null,null,-1),lt=Vue.defineComponent({inheritAttrs:!1,name:"XMenuItem",__name:"MenuItem",props:{item:{},subMenu:{},defaultIcon:{}},setup(o){const e=o,t=Vue.getCurrentInstance(),n=s=>{if(s)return typeof s=="string"&&(t?.appContext.app?.component(s)||e.defaultIcon)||s},u=s=>typeof s=="object"?s:{value:s},r=(s=[])=>s.filter(a=>!a.hidden);return(s,a)=>e.item.children?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElSubMenu),Vue.mergeProps({key:0,disabled:e.item.disabled},e.subMenu,{index:String(e.item.id)}),{title:Vue.withCtx(()=>[Vue.createElementVNode("div",dn,[e.item.icon?(Vue.openBlock(),Vue.createBlock(Vue.unref(A),{key:0,icon:n(e.item.icon)},null,8,["icon"])):Vue.createCommentVNode("",!0),e.item.title?(Vue.openBlock(),Vue.createElementBlock("span",mn,Vue.toDisplayString(e.item.title),1)):Vue.createCommentVNode("",!0),e.item.badge?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElBadge),Vue.mergeProps({key:2,class:"x-menu__badge"},u(e.item.badge)),{default:Vue.withCtx(()=>[fn]),_:1},16)):Vue.createCommentVNode("",!0)])]),default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(r(e.item.children),l=>(Vue.openBlock(),Vue.createBlock(Vue.unref(lt),{key:l.id,item:l,subMenu:e.subMenu,defaultIcon:e.defaultIcon},null,8,["item","subMenu","defaultIcon"]))),128))]),_:1},16,["disabled","index"])):(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElMenuItem),{key:1,index:String(e.item.id),disabled:e.item.disabled},{title:Vue.withCtx(()=>[e.item.title?(Vue.openBlock(),Vue.createElementBlock("span",Vn,Vue.toDisplayString(e.item.title),1)):Vue.createCommentVNode("",!0),e.item.badge?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElBadge),Vue.mergeProps({key:1,class:"x-menu__badge"},u(e.item.badge)),{default:Vue.withCtx(()=>[pn]),_:1},16)):Vue.createCommentVNode("",!0)]),default:Vue.withCtx(()=>[e.item.icon?(Vue.openBlock(),Vue.createBlock(Vue.unref(A),{key:0,icon:n(e.item.icon)},null,8,["icon"])):Vue.createCommentVNode("",!0)]),_:1},8,["index","disabled"]))}}),H=Vue.defineComponent({inheritAttrs:!1,name:"XMenu",__name:"Menu",props:{data:{default:()=>[]},subMenu:{},defaultIcon:{}},emits:["select"],setup(o,{emit:e}){const t=o,n=e,u=Vue.computed(()=>t.data.filter(a=>!a.hidden)),r=(a,l)=>{const c=(i,d=[])=>{for(const V of d){if(V.id.toString()===i.toString())return V;if(V.children?.length){const m=c(i,V.children);if(m)return m}}};return c(l,a)},s=a=>{const l=r(u.value,a);l&&n("select",l)};return(a,l)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElMenu),Vue.mergeProps({class:"x-menu"},a.$attrs,{onSelect:s}),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(u.value,c=>(Vue.openBlock(),Vue.createBlock(Vue.unref(lt),{item:{...c,icon:c.icon},defaultIcon:t.defaultIcon,subMenu:t.subMenu},null,8,["item","defaultIcon","subMenu"]))),256))]),_:1},16))}}),Be={name:{type:String},label:{type:String},value:{type:[String,Number,Object,Array,Boolean]},icon:{type:[String,Object]},mode:{type:String,default:"button"},menus:{type:Array},tooltip:{type:[String,Object]},badge:{type:[String,Number,Object]},dropdown:{type:Object},button:{type:Object},disabled:{type:[Boolean,Function]},size:{type:String,default:"default"},type:{type:String,default:"primary"},background:{type:String,default:"always"},circle:{type:Boolean},draggable:{type:Boolean}};function gn(o){return Vue.computed(()=>{const e=o.tooltip;if(e)return typeof e=="string"?{content:e}:e})}function hn(o){return Vue.computed(()=>{const e=o.badge;if(e)return typeof e=="object"?e:{value:e}})}function vn(o){return Vue.computed(()=>{const{dropdown:e,menus:t}=o;if(t&&t.length>0)return Object.assign({popperClass:"x-action__menus",size:o.size},e||{})})}function at(o){const e=Vue.getCurrentInstance();return Vue.computed(()=>{const t=Vue.unref(o);if(t)if(typeof t=="string"||t.setup||t.render||Vue.isVNode(t)){const n=e?.appContext.app;return{icon:typeof t=="string"&&n?.component(t)||t}}else return t;return null})}function X(o){const e=at(o);return e.value?Vue.markRaw(Vue.defineComponent({render:()=>Vue.h(A,e.value)})):void 0}function ce(o,e){return Vue.computed(()=>{const t=Vue.unref(o);return typeof t=="function"?t(e):!!t})}function st(o,e,t){const n=Vue.shallowRef(e),u=Vue.ref(!1),r=async a=>{const l=Vue.unref(o);return l?typeof l=="function"?await l(a):l:e},s=async a=>(u.value=!0,await r(a).then(l=>(n.value=l||e,u.value=!1,Vue.unref(n))));return Vue.watch(()=>o,()=>{s(t)},{immediate:!0}),t&&Vue.watch(t,()=>{s(t)}),{data:n,loading:u,loader:s}}const yn={key:0},wn=Vue.defineComponent({__name:"Trigger",props:Be,emits:["click"],setup(o,{emit:e}){const t=o,n=e,u=X(Vue.toRef(t,"icon")),r=ce(Vue.toRef(t,"disabled")),s=Vue.computed(()=>({[`is-${t.mode}`]:!!t.mode,[`is-${t.type}`]:!!t.type,[`is-${t.size}`]:!!t.size&&t.size!=="default",[`is-background-${t.background}`]:t.mode==="icon"&&!!t.background,"is-disabled":!!t.disabled,"is-circle":!!t.circle})),a=l=>{if(l.preventDefault(),!r.value)return n("click"),!1};return(l,c)=>t.mode==="button"?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),Vue.mergeProps({key:0,icon:Vue.unref(u),type:t.type,size:t.size,disabled:Vue.unref(r)},t.button,{onClick:a}),{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(l.label),1)]),_:1},16,["icon","type","size","disabled"])):(Vue.openBlock(),Vue.createElementBlock("div",{key:1,class:Vue.normalizeClass(["x-action__inner",s.value]),onClick:a},[(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(u)))),l.label?(Vue.openBlock(),Vue.createElementBlock("span",yn,Vue.toDisplayString(l.label),1)):Vue.createCommentVNode("",!0)],2))}}),kn=["draggable"],R=Vue.defineComponent({name:"XAction",__name:"Action",props:Be,emits:["click","command","dragstart","dragend"],setup(o,{emit:e}){const t=o,n=Vue.useSlots(),u=e,r=gn(t),s=hn(t),a=vn(t),l=ce(Vue.toRef(t,"disabled")),c=Vue.computed(()=>!!t.draggable&&!l.value),i=Vue.computed(()=>({[`x-action--${t.mode}`]:!!t.mode})),d=()=>{l.value||u("click",Vue.toRaw(t))},V=p=>{if(l.value)return;const h=t.menus?.find(y=>y.command===p);h&&u("command",Vue.toRaw(h))},m=p=>{c&&u("dragstart",Vue.toRaw(t),p)},f=p=>{c&&u("dragend",Vue.toRaw(t),p)},g=p=>Vue.h(ElementPlus.ElBadge,s.value,()=>[].concat(p)),b=p=>Vue.h(ElementPlus.ElDropdown,{...a.value,disabled:l.value,onCommand:V},{default:()=>[p],dropdown:()=>[Vue.h(ElementPlus.ElDropdownMenu,()=>(t.menus||[]).map((h,y)=>Vue.h(ElementPlus.ElDropdownItem,h,()=>n.item?n.item({item:h,index:y}):h.label)))]}),w=p=>Vue.h(ElementPlus.ElTooltip,{...r.value,disabled:l.value},()=>[p]),C=Vue.computed(()=>{let p=Vue.h(Vue.markRaw(wn),{...t,onClick:d});const h=n.default?.();return h&&h.length&&(p=h[0]),s.value&&(p=g(p)),a.value&&(p=b(p)),r.value&&(p=w(p)),p});return(p,h)=>(Vue.openBlock(),Vue.createElementBlock("div",{class:Vue.normalizeClass(["x-action",i.value]),draggable:c.value,onDragstart:m,onDragend:f},[(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(C.value)))],42,kn))}}),it={items:{type:Array},mode:{type:String,default:"button"},size:{type:String,default:"default"},type:{type:String,default:"primary"},background:{type:String,default:"always"},circle:{type:Boolean},disabled:{type:[Boolean,Function]},tooltip:{type:Object},badge:{type:Object},dropdown:{type:Object},button:{type:Object}},ne=Vue.defineComponent({name:"XActionBar",__name:"ActionBar",props:it,emits:["click","command"],setup(o,{emit:e}){const t=o,n=e,u=Vue.computed(()=>(t.items||[]).map(a=>a==="|"?a:{...a,badge:a.badge?{...t.badge,...typeof a.badge=="object"?a.badge||{}:{value:a.badge}}:void 0,tooltip:a.tooltip?{...t.tooltip,...typeof a.tooltip=="object"?a.tooltip||{}:{content:a.tooltip}}:void 0})),r=a=>{n("click",a)},s=(a,l)=>{n("command",a,l)};return(a,l)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:"x-action-bar",align:"center"},{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(u.value,c=>(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,null,[c==="|"?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:0,direction:"vertical",class:"x-action-bar__divider"})):(Vue.openBlock(),Vue.createBlock(Vue.unref(R),Vue.mergeProps({key:1,mode:t.mode,size:t.size,type:t.type,circle:t.circle,background:t.background,button:t.button,dropdown:t.dropdown,disabled:Vue.unref(ce)(t.disabled,c).value,ref_for:!0},c,{onClick:r,onCommand:i=>s(c,i)}),null,16,["mode","size","type","circle","background","button","dropdown","disabled","onCommand"]))],64))),256))]),_:1}))}}),ct={tag:{type:String,default:"div"},fit:{type:Boolean,default:!1},width:{type:[String,Number]},height:{type:[String,Number]},flex:{type:Boolean,default:!0},inline:{type:Boolean},direction:{type:String,default:"row"},wrap:{type:String,default:"nowrap"},justify:{type:String,default:"flex-start"},align:{type:String,default:"flex-start"},alignContent:{type:String,default:"stretch"},grow:{type:Boolean,default:!1},shrink:{type:Boolean,default:!1},alignSelf:{type:String,default:"auto"},overflow:{type:String},padding:{type:Boolean,default:!1},gap:{type:Boolean},autoPointer:{type:Boolean}},N=Vue.defineComponent({name:"XContainer",__name:"Container",props:ct,setup(o){const e=o,t=Vue.useAttrs(),n=Vue.getCurrentInstance(),u=Vue.computed(()=>{const a=n?.parent;if(!a)return!1;const l=a.proxy;return l.$options.name==="XContainer"||!!l.flex}),r=Vue.computed(()=>({"is-fit":e.fit,"is-flex":e.flex&&!e.inline,"is-inline-flex":e.flex&&e.inline,[`is-direction-${e.direction}`]:e.flex&&e.direction!=="row",[`is-wrap-${e.wrap}`]:e.flex&&e.wrap!=="nowrap",[`is-justify-${e.justify}`]:e.flex&&e.justify!=="flex-start",[`is-align-${e.align}`]:e.flex&&e.align!=="flex-start",[`is-align-content-${e.alignContent}`]:e.flex&&e.alignContent!=="stretch","is-grow":e.grow??u.value,"is-shrink":e.shrink,[`is-align-self-${e.alignSelf}`]:u.value&&e.alignSelf!=="auto",[`is-overflow-${e.overflow}`]:!!e.overflow,"is-padding":!!e.padding,"is-pointer":e.autoPointer&&!!t.onClick,"is-gap":!!e.gap})),s=Vue.computed(()=>{const{width:a,height:l,fit:c}=e;return c?null:{width:a?j(a):void 0,height:l?j(l):void 0}});return(a,l)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(e.tag),{class:Vue.normalizeClass(["x-container",r.value]),style:Vue.normalizeStyle(s.value)},{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"default")]),_:3},8,["class","style"]))}}),dt={size:{type:String,default:"default"},content:{type:String,default:""},subtitle:{type:String},icon:{type:[String,Object]},border:{type:Boolean},more:{type:Boolean}},Cn={class:"x-header__content"},bn={key:0,class:"x-header__actions"},Ee=Vue.defineComponent({name:"XHeader",inheritAttrs:!1,__name:"Header",props:dt,setup(o){const e=o,t=X(Vue.toRef(e,"icon")),n=Vue.useAttrs(),u=Vue.computed(()=>({[`is-size-${e.size}`]:!!e.size&&e.size!=="default","is-border":e.border,"is-pointer":!!n.onClick}));return(r,s)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:Vue.normalizeClass(["x-header",u.value]),justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(N),{align:"center",class:Vue.normalizeClass(["x-header__wrapper",u.value]),grow:"",onClick:Vue.unref(n).onClick},{default:Vue.withCtx(()=>[Vue.unref(t)?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(t)),{key:0,class:"x-header__icon",onClick:Vue.unref(n).onClickIcon||Vue.unref(n).onClick},null,8,["onClick"])):Vue.createCommentVNode("",!0),Vue.createElementVNode("span",Cn,[Vue.renderSlot(r.$slots,"default",{},()=>[Vue.createTextVNode(Vue.toDisplayString(e.content),1)])]),e.more?(Vue.openBlock(),Vue.createBlock(Vue.unref(A),{key:1,class:"x-header__more",icon:Vue.unref(VtjIcons.ArrowRight)},null,8,["icon"])):Vue.createCommentVNode("",!0),e.subtitle||r.$slots.subtitle?(Vue.openBlock(),Vue.createElementBlock("span",{key:2,class:"x-header__subtitle",onClick:s[0]||(s[0]=(...a)=>Vue.unref(n).onClick&&Vue.unref(n).onClick(...a))},[Vue.renderSlot(r.$slots,"subtitle",{},()=>[Vue.createTextVNode(Vue.toDisplayString(e.subtitle),1)])])):Vue.createCommentVNode("",!0)]),_:3},8,["class","onClick"]),r.$slots.actions?(Vue.openBlock(),Vue.createElementBlock("div",bn,[Vue.renderSlot(r.$slots,"actions")])):Vue.createCommentVNode("",!0)]),_:3},8,["class"]))}}),mt={fit:{type:Boolean,default:!1},width:{type:[String,Number]},height:{type:[String,Number]},border:{type:Boolean,default:!0},radius:{type:Boolean,default:!0},card:{type:Boolean},size:{type:String},shadow:{type:String},header:{type:[String,Object]},body:{type:Object},footer:{type:Object}},Y=Vue.defineComponent({name:"XPanel",__name:"Panel",props:mt,setup(o,{expose:e}){const t=o,n=Vue.ref(),u=Vue.computed(()=>({"x-panel--card":!!t.card,"x-panel--default":!t.card,[`is-${t.size}`]:!!t.size&&t.size!=="default","is-border":!!t.border,"is-radius":!!t.radius,[`is-shadow-${t.shadow}`]:!!t.shadow&&t.shadow!=="none"})),r=Vue.computed(()=>t.header===null?null:typeof t.header=="string"?{content:t.header,size:t.size}:{...t.header,size:t.size}),s=Vue.computed(()=>t.fit||t.height?"auto":void 0);return e({bodyRef:n}),(a,l)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:Vue.normalizeClass(["x-panel",u.value]),direction:"column",fit:t.fit,width:t.width,height:t.height},{default:Vue.withCtx(()=>[r.value?(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{key:0,flex:!1,class:"x-panel__header"},{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"header",{},()=>[Vue.createVNode(Vue.unref(Ee),Vue.normalizeProps(Vue.guardReactiveProps(r.value)),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"title")]),actions:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"actions")]),_:3},16)])]),_:3})):Vue.createCommentVNode("",!0),Vue.createVNode(Vue.unref(N),Vue.mergeProps({ref_key:"bodyRef",ref:n,flex:!1,overflow:s.value,grow:"",padding:"",class:"x-panel__body"},t.body),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"default")]),_:3},16,["overflow"]),a.$slots.footer?(Vue.openBlock(),Vue.createBlock(Vue.unref(N),Vue.mergeProps({key:1,flex:!1,padding:"",class:"x-panel__footer"},t.footer),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"footer")]),_:3},16)):Vue.createCommentVNode("",!0)]),_:3},8,["class","fit","width","height"]))}}),ft="user-select-none";class xe{constructor(e,t={}){this.el=e,this.options=t,this.scope=Vue.effectScope(),this.scope.run(()=>{this.init()})}scope;dragging=!1;getHandle(){const{selector:e,handle:t}=this.options;return e?this.el.querySelector(e):t}getTarget(){const{target:e="body"}=this.options;return typeof e=="string"?document.querySelector(e):Vue.unref(e)||document.body}init(){const{el:e,options:t}=this,{disabled:n,delay:u=150,onStart:r,onEnd:s}=t;if(n)return;let a=null;const l=this.getHandle(),c=this.getTarget();let i=e.getBoundingClientRect(),d=null;const{x:V,y:m}=VueUse.useDraggable(e,{initialValue:{x:i.x,y:i.y},...t,handle:l,onStart:(f,g)=>{document.body.classList.add(ft),clearTimeout(a),a=setTimeout(()=>{this.dragging=!0,i=e.getBoundingClientRect(),d=c?.getBoundingClientRect(),r&&r(f,g)},u)},onEnd:(f,g)=>{if(clearTimeout(a),document.body.classList.remove(ft),this.dragging&&d){this.dragging=!1;const{x:b,y:w}=f,C=this.getPosition(d,i,b,w);s&&s(C,g),d=null}}});Vue.watch([V,m],()=>{if(this.dragging&&d){const f=this.getPosition(d,i,V.value,m.value);e.style.left=`${f.x}px`,e.style.top=`${f.y}px`}})}getPosition(e,t,n,u){const{edge:r=50}=this.options,s=-t.width+r,a=e.width-r,l=0,c=e.height-r,i=Math.min(a,Math.max(n,s)),d=Math.min(c,Math.max(u,l));return{x:i,y:d}}destory(){this.scope.stop()}}const Vt={mounted(o,e){const t=e.value||{},n=new xe(o,t);o.__draggable__=n},updated(o,e){const t=e.value||{};let n=o.__draggable__;n&&!VtjUtils.isEqual(n.options,t)&&(n.destory(),o.__draggable__=new xe(o,t))},unmounted(o){const e=o.__draggable__;e&&(e.destory(),o.__draggable__=null)}},Se="user-select-none";class Ne{constructor(e,t={}){this.el=e,this.options=t,this.scope=Vue.effectScope(),this.scope.run(()=>{this.init()})}scope;resizing=Vue.ref(!1);direction=Vue.ref("");MIE=null;cleanMousedown;cleanMouseup;init(){const{el:e,options:t}=this,{disabled:n,onStart:u,onEnd:r}=t;if(n)return;this.MIE=VueUse.useMouseInElement(e),this.cleanMousedown=VueUse.useEventListener(document,"mousedown",()=>{this.direction?.value&&this.MIE&&(this.resizing.value=!0,e.classList.add("is-resizing",`is-${this.direction.value}-resizing`),u&&u(this.direction.value,this.MIE))}),this.cleanMouseup=VueUse.useEventListener(document,"mouseup",()=>{this.resizing.value&&this.direction?.value&&this.MIE&&(e.classList.remove("is-resizing",`is-${this.direction.value}-resizing`),r&&r(this.direction.value,this.MIE)),this.resizing.value=!1}),Vue.watch(this.direction,l=>{const c=document.body;c.style.cursor=l?`${l}-resize`:"",l?c.classList.add(Se):c.classList.remove(Se)});const{x:s,y:a}=this.MIE;Vue.watch([s,a],()=>{this.resizing.value?this.resize():this.direction.value=this.getDirection()})}resize(){const{MIE:e,direction:t,resizing:n,options:u,el:r}=this,s=t?.value||"";if(!e||!n.value||!s)return;const{x:a,y:l,elementX:c,elementY:i,elementHeight:d,elementWidth:V}=e,{onResizing:m}=u,{minWidth:f=0,minHeight:g=0,maxWidth:b=99999,maxHeight:w=99999}=u;if(s.includes("e")){const C=Math.min(Math.max(c.value,f),b);r.style.width=`${C}px`}if(s.includes("s")){const C=Math.min(Math.max(i.value,g),w);r.style.height=`${C}px`}if(s.includes("w")){const C=Math.min(Math.max(V.value-c.value,f),b);r.style.width=`${C}px`,r.style.left=`${a.value}px`}if(s.includes("n")){const C=Math.min(Math.max(d.value-i.value,g),w);this.el.style.height=`${C}px`,this.el.style.top=`${l.value}px`}m&&m(s,e)}getDirection(){if(!this.MIE)return"";const{elementX:e,elementY:t,elementHeight:n,elementWidth:u,isOutside:r}=this.MIE;if(r.value)return"";const{dirs:s=["n","s","w","e"],edge:a=5}=this.options;let l="";return s.includes("n")&&t.value<=a?l+="n":s.includes("s")&&t.value>n.value-a&&(l+="s"),s.includes("w")&&e.value<=a?l+="w":s.includes("e")&&e.value>u.value-a&&(l+="e"),l}destory(){const e=document.body;e.style.cursor="",e.classList.remove(Se),this.cleanMousedown&&this.cleanMousedown(),this.cleanMouseup&&this.cleanMouseup(),this.MIE?.stop(),this.scope.stop()}}const Pe={mounted(o,e){const t=e.value||{},n=new Ne(o,t);o.__resizable__=n},updated(o,e){const t=e.value||{};let n=o.__resizable__;n&&!VtjUtils.isEqual(n.options,t)&&(n.destory(),o.__resizable__=new Ne(o,t))},unmounted(o){const e=o.__resizable__;e&&(e.destory(),o.__resizable__=null)}},pt={modelValue:{type:Boolean,default:!0},title:{type:String},subtitle:{type:String},icon:{type:[String,Object]},size:{type:String,default:"default"},width:{type:[Number,String],default:"70%"},height:{type:[Number,String],default:"70%"},left:{type:[Number,String]},top:{type:[Number,String]},modal:{type:Boolean,default:!0},draggable:{type:[Boolean,Object],default:!0},resizable:{type:[Boolean,Object]},closable:{type:Boolean,default:!0},maximizable:{type:Boolean,default:!1},minimizable:{type:Boolean,default:!1},mode:{type:String,default:"normal"},content:{type:Object},src:{type:String},componentInstance:{type:Object},beforeClose:{type:Function},submit:{type:[Boolean,String]},cancel:{type:[Boolean,String]},bodyPadding:{type:Boolean,default:!0},primary:{type:Boolean}};let G=1e3;function _n(o,e){const{width:t,height:n}=VueUse.useElementSize(e),u=Vue.reactive({mode:o.mode||"normal",wrapperWidth:0,wrapperHeight:0,width:0,height:0,top:0,left:0,zIndex:++G,dragging:!1,resizing:!1});return Vue.watch([t,n],([r,s])=>{u.wrapperWidth=r,u.wrapperHeight=s,u.width=te(o.width,r),u.height=te(o.height,s),u.left=o.left?te(o.left,r)-u.width/2:Math.max(Math.floor((r-u.width)/2),0),u.top=o.top?te(o.top,s):Math.max(Math.floor((s-u.height)/2),0)}),Vue.watch(u,r=>{G=Math.max(r.zIndex,G)}),{state:u,normal:Vue.computed(()=>u.mode==="normal"),maximized:Vue.computed(()=>u.mode==="maximized"),minimized:Vue.computed(()=>u.mode==="minimized")}}function Bn(o,e){const t=Vue.computed(()=>{const{width:s,height:a,top:l,left:c,zIndex:i}=e;return{width:`${s}px`,height:`${a}px`,top:`${l}px`,left:`${c}px`,zIndex:i}}),n=Vue.computed(()=>({[`is-${e.mode}`]:!!e.mode,"is-draggable":!!o.draggable,"is-resizable":!!o.resizable,"is-primary":!!o.primary})),u=Vue.computed(()=>({[`is-${e.mode}`]:!!e.mode,"is-dragging":e.dragging,"is-resizing":e.resizing})),r=Vue.computed(()=>({zIndex:e.zIndex}));return{styles:t,classes:n,wrapperClass:u,modalStyle:r}}function En(o,e,t){const n=i=>{e.mode=i,["maximized","minimized","normal"].includes(i)&&t(i),t("modeChange",i)},u=async()=>{(!o.beforeClose||await o.beforeClose())&&(t("update:modelValue",!1),t("close"),t("destroy"))};return{close:u,changeMode:n,show:()=>n("normal"),hide:()=>n("minimized"),active:i=>{const d=i.target.nodeName||"";["INPUT","TEXTAREA","RADIO","CHECKBOX"].includes(d.toUpperCase())||(e.zIndex=Math.max(e.zIndex,++G))},submit:()=>t("submit"),cancel:()=>{t("cancel"),u()}}}function xn(o,e,t,n){return Vue.computed(()=>{const u=typeof o.draggable=="boolean"?!o.draggable:!!o.draggable?.disabled;return{...VtjUtils.isObject(o.draggable)?o.draggable:{},disabled:u,target:n,selector:".x-panel__header",onStart(r){e.dragging=!0,e.zIndex=Math.max(e.zIndex,++G),t("dragStart",r)},onMove(r){t("dragging",r)},onEnd(r){if(e.mode==="maximized")return;const{x:s,y:a}=r;e.left=s,e.top=a,e.dragging=!1,t("dragEnd",r)}}})}function Sn(o,e,t){return Vue.computed(()=>{const n=typeof o.resizable=="boolean"?!o.resizable:!!o.resizable?.disabled;return{minWidth:200,minHeight:150,...VtjUtils.isObject(o.resizable)?o.resizable:{},disabled:n,dirs:["e","s","w"],onStart(u,r){e.resizing=!0,e.zIndex=Math.max(e.zIndex,++G),t("resizeStart",u,r)},onResizing(u,r){t("resizing",u,r)},onEnd(u,r){e.left=r.elementPositionX.value,e.top=r.elementPositionY.value,e.width=r.elementWidth.value,e.height=r.elementHeight.value,e.resizing=!1,t("resizeEnd",u,r)}}})}function Nn(o,e){const t=o.componentInstance;if(!t)return;let n=null;return Vue.onMounted(()=>{const u=Vue.unref(e),r=Vue.unref(u?.bodyRef);n=t.$el,r&&r.$el&&r.$el.appendChild(n)}),Vue.onUnmounted(()=>{n&&n.parentNode&&n.parentNode.removeChild(n)}),{componentInstance:t}}const Pn=["src"],de=Vue.defineComponent({name:"XDialog",__name:"Dialog",props:pt,emits:["update:modelValue","open","close","destroy","maximized","minimized","normal","modeChange","dragStart","dragging","dragEnd","resizeStart","resizeEnd","resizing","submit","cancel"],setup(o,{expose:e,emit:t}){const n=o,u=t,r=Vue.getCurrentInstance(),s=Vue.ref(),a=Vue.ref(),{state:l,maximized:c,minimized:i,normal:d}=_n(n,s),{styles:V,classes:m,wrapperClass:f,modalStyle:g}=Bn(n,l),{changeMode:b,active:w,close:C,show:p,hide:h,submit:y,cancel:x}=En(n,l,u),v=xn(n,l,u,s),P=Sn(n,l,u),z=Nn(n,a);Vue.watchEffect(async()=>{n.modelValue&&(await Vue.nextTick(),r&&u("open",r))});const I=Vue.computed(()=>a.value?.$el);return e({$vtjEl:I,panelRef:a,state:l,maximized:c,minimized:i,changeMode:b,show:p,hide:h,submit:y,cancel:x,close:C,componentInstance:z}),(T,M)=>n.modelValue?(Vue.openBlock(),Vue.createBlock(Vue.Teleport,{key:0,to:"body"},[Vue.createElementVNode("div",{ref_key:"wrapper",ref:s,class:Vue.normalizeClass(["x-dialog__wrapper",Vue.unref(f)])},[n.modal?(Vue.openBlock(),Vue.createElementBlock("div",{key:0,class:"x-dialog__modal",style:Vue.normalizeStyle(Vue.unref(g))},null,4)):Vue.createCommentVNode("",!0),Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref(Y),Vue.mergeProps({ref_key:"panelRef",ref:a,class:["x-dialog",Vue.unref(m)],card:"",shadow:"always",header:{icon:n.icon,subtitle:n.subtitle},width:"800px",height:"600px",footer:{justify:"space-between",flex:!0,align:"center"},style:Vue.unref(V),size:n.size,body:{padding:n.bodyPadding},onClick:Vue.unref(w)},T.$attrs),Vue.createSlots({title:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(n.title),1)]),actions:Vue.withCtx(()=>[Vue.renderSlot(T.$slots,"actions"),n.minimizable?(Vue.openBlock(),Vue.createBlock(Vue.unref(R),{key:0,icon:Vue.unref(VtjIcons.Minimize),size:n.size,mode:"icon",type:"primary",background:"hover",onClick:M[0]||(M[0]=B=>Vue.unref(b)("minimized"))},null,8,["icon","size"])):Vue.createCommentVNode("",!0),n.maximizable?(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,{key:1},[Vue.unref(d)?(Vue.openBlock(),Vue.createBlock(Vue.unref(R),{key:1,icon:Vue.unref(VtjIcons.Maximize),size:n.size,mode:"icon",type:"primary",background:"hover",onClick:M[2]||(M[2]=B=>Vue.unref(b)("maximized"))},null,8,["icon","size"])):(Vue.openBlock(),Vue.createBlock(Vue.unref(R),{key:0,icon:Vue.unref(VtjIcons.Popup),size:n.size,mode:"icon",type:"primary",background:"hover",onClick:M[1]||(M[1]=B=>Vue.unref(b)("normal"))},null,8,["icon","size"]))],64)):Vue.createCommentVNode("",!0),n.closable?(Vue.openBlock(),Vue.createBlock(Vue.unref(R),{key:2,icon:Vue.unref(VtjIcons.RawClose),size:n.size,mode:"icon",type:"danger",background:"hover",onClick:Vue.unref(C)},null,8,["icon","size","onClick"])):Vue.createCommentVNode("",!0)]),default:Vue.withCtx(()=>[Vue.renderSlot(T.$slots,"default",{},()=>[n.content?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(n.content),{key:0})):Vue.createCommentVNode("",!0),n.src?(Vue.openBlock(),Vue.createElementBlock("iframe",{key:1,src:n.src,class:"x-dialog__frame"},null,8,Pn)):Vue.createCommentVNode("",!0)])]),_:2},[n.cancel||n.submit||T.$slots.footer||T.$slots.extra||T.$slots.handle?{name:"footer",fn:Vue.withCtx(()=>[Vue.renderSlot(T.$slots,"footer",{},()=>[Vue.createVNode(Vue.unref(N),{align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot(T.$slots,"extra")]),_:3}),Vue.createVNode(Vue.unref(N),{align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot(T.$slots,"handle"),n.cancel?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:0,type:"default",size:n.size,onClick:Vue.unref(x)},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(typeof n.cancel=="string"?n.cancel:"取消"),1)]),_:1},8,["size","onClick"])):Vue.createCommentVNode("",!0),n.submit?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:1,type:"primary",size:n.size,onClick:Vue.unref(y)},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(typeof n.submit=="string"?n.submit:"确定"),1)]),_:1},8,["size","onClick"])):Vue.createCommentVNode("",!0)]),_:3})])]),key:"0"}:void 0]),1040,["header","class","style","size","body","onClick"])),[[Vue.unref(Vt),Vue.unref(v)],[Vue.unref(Pe),Vue.unref(P)]])],2)])):Vue.createCommentVNode("",!0)}});function me(o,e){const t=document.createElement("div"),n=Vue.createVNode(de,o);n.appContext=e??me._context,Vue.render(n,t);const u=()=>{Vue.render(null,t),t.parentNode?.removeChild(t)};return n.props.onDestroy=()=>{u()},document.body.appendChild(t),{vnode:n,destroy:u}}const zn=Vue.createElementVNode("div",{class:"x-mask-sidebar__helper"},null,-1),Tn=Vue.defineComponent({__name:"Sidebar",props:{collapsed:{type:Boolean}},setup(o){const e=o;return(t,n)=>Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:Vue.normalizeClass(["x-mask-sidebar",{"is-collapsed":e.collapsed}]),grow:!1,flex:"",direction:"column"},{default:Vue.withCtx(()=>[Vue.renderSlot(t.$slots,"brand"),Vue.createVNode(Vue.unref(N),{class:"x-mask-sidebar__wrapper",flex:"",grow:"",direction:"column",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot(t.$slots,"default"),zn]),_:3})]),_:3},8,["class"])),[[Vue.unref(Pe),{dirs:["e"],disabled:e.collapsed,maxWidth:500,minWidth:200}]])}}),In=Vue.defineComponent({__name:"SwitchBar",props:{collasped:{type:Boolean,default:!1},favorite:{type:Boolean,default:!1},keyword:{}},emits:["update:collasped","update:keyword","update:favorite"],setup(o,{emit:e}){const t=o,n=e,u=Vue.ref(!1),r=Vue.ref(""),s=Vue.ref(!1),a=()=>{u.value=!0},l=()=>{r.value="",u.value=!1,n("update:keyword",r.value)},c=()=>{n("update:collasped",!t.collasped)},i=()=>{n("update:keyword",r.value)},d=()=>{n("update:favorite",s.value)};return(V,m)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:"x-mask-switch-bar",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[t.collasped?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{key:0,class:"x-mask-switch-bar__left",grow:""},{default:Vue.withCtx(()=>[u.value?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElSwitch),{key:0,modelValue:s.value,"onUpdate:modelValue":m[0]||(m[0]=f=>s.value=f),class:"x-mask-switch-bar__switch","active-icon":Vue.unref(VtjIcons.StarFilled),"inactive-icon":Vue.unref(VtjIcons.Menu),onChange:d},null,8,["modelValue","active-icon","inactive-icon"])),u.value?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElInput),{key:1,modelValue:r.value,"onUpdate:modelValue":m[1]||(m[1]=f=>r.value=f),class:"x-mask-switch-bar__input",size:"small",placeholder:"请输入查询关键字",onInput:i,"prefix-icon":Vue.unref(VtjIcons.Search)},{suffix:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(A),{icon:Vue.unref(VtjIcons.Close),onClick:l},null,8,["icon"])]),_:1},8,["modelValue","prefix-icon"])):Vue.createCommentVNode("",!0)]),_:1})),Vue.createVNode(Vue.unref(N),{class:Vue.normalizeClass(["x-mask-switch-bar__right",{"is-collasped":t.collasped}]),flex:"",align:"center",justify:"center"},{default:Vue.withCtx(()=>[!u.value&&!t.collasped?(Vue.openBlock(),Vue.createBlock(Vue.unref(R),{key:0,icon:Vue.unref(VtjIcons.Search),mode:"icon",background:"hover",size:"default",circle:"",onClick:a},null,8,["icon"])):Vue.createCommentVNode("",!0),t.collasped?(Vue.openBlock(),Vue.createBlock(Vue.unref(R),{key:1,icon:Vue.unref(VtjIcons.Expand),mode:"icon",size:"default",background:"hover",onClick:c,circle:""},null,8,["icon"])):Vue.createCommentVNode("",!0),t.collasped?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(R),{key:2,icon:Vue.unref(VtjIcons.Fold),mode:"icon",size:"default",background:"hover",circle:"",onClick:c},null,8,["icon"]))]),_:1},8,["class"])]),_:1}))}}),Dn=["src"],Mn={key:0},$n=Vue.defineComponent({__name:"Brand",props:{collapsed:{type:Boolean,default:!1},logo:{},title:{},url:{}},setup(o){const e=o,t=VueRouter.useRouter(),n=()=>{e.url&&t.push(e.url)};return(u,r)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:Vue.normalizeClass(["x-mask-brand",{"is-collapsed":e.collapsed}]),align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(N),{class:"x-mask-brand__logo",flex:"",justify:"center",align:"center",onClick:n},{default:Vue.withCtx(()=>[Vue.renderSlot(u.$slots,"logo",{},()=>[e.logo?(Vue.openBlock(),Vue.createElementBlock("img",{key:0,src:e.logo},null,8,Dn)):Vue.createCommentVNode("",!0)])]),_:3}),Vue.createVNode(Vue.unref(N),{class:"x-mask-brand__title",flex:"",align:"center"},{default:Vue.withCtx(()=>[e.title?(Vue.openBlock(),Vue.createElementBlock("span",Mn,[Vue.renderSlot(u.$slots,"title",{},()=>[Vue.createTextVNode(Vue.toDisplayString(e.title),1)])])):Vue.createCommentVNode("",!0)]),_:3})]),_:3},8,["class"]))}}),fe="__favorites__",Ve="__search__",An=Vue.defineComponent({__name:"Menu",props:{collapse:{type:Boolean,default:!1},keyword:{},favorite:{type:Boolean},favorites:{},flatMenus:{},menus:{},active:{}},emits:["select"],setup(o,{emit:e}){const t=o,n=Vue.computed(()=>t.menus||[]),u=e,r=Vue.computed(()=>String(t.active?.id)),s=Vue.computed(()=>[{id:fe,title:"收藏",icon:VtjIcons.Star,children:t.favorites?.length?t.favorites:[{id:fe+"empty",disabled:!0,title:"暂无收藏菜单"}]}]),a=Vue.computed(()=>{const c=(t.keyword||"").trim(),i=c?(t.flatMenus||[]).filter(d=>d.title?.includes(c)):[];return[{id:Ve,title:"搜索",icon:VtjIcons.Search,children:i?.length?i:[{id:Ve+"empty",disabled:!0,title:"查询匹配不到菜单项"}]}]}),l=c=>{u("select",c)};return(c,i)=>(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,null,[Vue.withDirectives(Vue.createVNode(Vue.unref(N),{class:"x-mask-menu",grow:"",flex:!1,overflow:"auto"},{default:Vue.withCtx(()=>[Vue.withDirectives(Vue.createVNode(Vue.unref(H),{subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:n.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!0,"collapse-transition":!1,"default-active":r.value,onSelect:l},null,8,["data","default-icon","default-active"]),[[Vue.vShow,t.collapse]]),Vue.withDirectives(Vue.createVNode(Vue.unref(H),{subMenu:{popperClass:"x-mask-menu-popper",teleported:!0},data:n.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!1,"collapse-transition":!1,"default-active":r.value,onSelect:l},null,8,["data","default-icon","default-active"]),[[Vue.vShow,!t.collapse]]),n.value.length?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElEmpty),{key:0,description:"暂无菜单数据"}))]),_:1},512),[[Vue.vShow,!t.favorite&&!t.keyword]]),Vue.withDirectives(Vue.createVNode(Vue.unref(N),{class:"x-mask-menu",grow:"",flex:!1,overflow:"auto"},{default:Vue.withCtx(()=>[Vue.withDirectives(Vue.createVNode(Vue.unref(H),{class:"x-mask-menu__favorites",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:s.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!0,"collapse-transition":!1,"default-active":r.value,"default-openeds":[fe],onSelect:l},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,t.collapse]]),Vue.withDirectives(Vue.createVNode(Vue.unref(H),{class:"x-mask-menu__favorites",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:s.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!1,"collapse-transition":!1,"default-active":r.value,"default-openeds":[fe],onSelect:l},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,!t.collapse]])]),_:1},512),[[Vue.vShow,t.favorite&&!t.keyword]]),t.keyword?Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref(N),{key:0,class:"x-mask-menu",grow:"",flex:!1,overflow:"auto"},{default:Vue.withCtx(()=>[Vue.withDirectives(Vue.createVNode(Vue.unref(H),{class:"x-mask-menu__search",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:a.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!0,"collapse-transition":!1,"default-active":r.value,"default-openeds":[Ve],onSelect:l},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,t.collapse]]),Vue.withDirectives(Vue.createVNode(Vue.unref(H),{class:"x-mask-menu__search",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:a.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!1,"collapse-transition":!1,"default-active":r.value,"default-openeds":[Ve],onSelect:l},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,!t.collapse]])]),_:1},512)),[[Vue.vShow,!!t.keyword]]):Vue.createCommentVNode("",!0)],64))}}),Rn="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1711803009570'%20class='icon'%20viewBox='0%200%201280%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1500'%20width='320'%20height='256'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M557.85%201023l-122-35.4c-12.8-3.6-20-17-16.4-29.8L692.45%2017.4c3.6-12.8%2017-20%2029.8-16.4l122%2035.4c12.8%203.6%2020%2017%2016.4%2029.8L587.65%201006.6c-3.8%2012.8-17%2020.2-29.8%2016.4z%20m-228-224.4l87-92.8c9.2-9.8%208.6-25.4-1.6-34.4L234.05%20512l181.2-159.4c10.2-9%2011-24.6%201.6-34.4l-87-92.8c-9-9.6-24.2-10.2-34-1L7.65%20494.4c-10.2%209.4-10.2%2025.6%200%2035l288.2%20270.2c9.8%209.2%2025%208.8%2034-1z%20m654.4%201.2l288.2-270.2c10.2-9.4%2010.2-25.6%200-35L984.25%20224.2c-9.6-9-24.8-8.6-34%201L863.25%20318c-9.2%209.8-8.6%2025.4%201.6%2034.4L1046.05%20512l-181.2%20159.4c-10.2%209-11%2024.6-1.6%2034.4l87%2092.8c9%209.8%2024.2%2010.2%2034%201.2z'%20fill='%230157fe'%20p-id='1501'%3e%3c/path%3e%3c/svg%3e",gt=140,ht={logo:{type:String,default:Rn},title:{type:String,default:"VTJ.PRO"},menus:{type:[Array,Function],default(){return[]}},favorites:{type:[Array,Function],default(){return[]}},menuAdapter:{type:Function},home:{type:[String,Object],default:"/"},tabs:{type:Number,default:20},actions:{type:Array},avatar:{type:String},theme:{type:Boolean},disabled:{type:Boolean},addFavorite:{type:Function},removeFavorite:{type:Function}},ze=Symbol(),Te=Symbol(),jn={class:"x-mask-tabs__trigger"},Fn={key:1},Ln=["onDragstart","onDragend"],Un={key:1},Hn=Vue.defineComponent({__name:"Tabs",props:{tabs:{},home:{},isActiveTab:{type:Function},value:{},favorites:{}},emits:["click","remove","refresh","toggleFavorite","dialog"],setup(o,{emit:e}){const t=o,n=e,u=i=>{const d=!!t.favorites.find(V=>V===i.menu||V.id===i.menu?.id);return[{icon:VtjIcons.Refresh,label:"刷新",name:"refresh",value:i},"|",{icon:d?VtjIcons.StarFilled:VtjIcons.Star,label:"收藏",name:"favorite",value:i.menu,disabled:!i.menu},"|",{icon:VtjIcons.CopyDocument,label:"弹窗",name:"dialog",value:i}]},r=i=>{const d=i.paneName;if(d===t.home.id){n("click",t.home);return}const V=t.tabs.find(m=>m.id===d);V&&n("click",V)},s=i=>{const d=t.tabs.find(V=>V.id===i);d&&n("remove",d)},a=i=>{switch(i.name){case"refresh":n("refresh",i.value);break;case"favorite":n("toggleFavorite",i.value);break;case"dialog":n("dialog",i.value);break}},l=(i,d)=>{d.dataTransfer&&(d.dataTransfer.setData("tab",i.id),d.target&&d.target.classList.add("is-dagging"))},c=(i,d)=>{d.target&&d.target.classList.remove("is-dagging")};return(i,d)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{ref:"tabsRef",class:"x-mask-tabs",height:"100%",grow:"",flex:"",justify:"flex-end",direction:"column"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElTabs),{type:"card","model-value":t.value,onTabRemove:s,onTabClick:r},{default:Vue.withCtx(()=>[t.home?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElTabPane),{key:0,name:t.home.id},{label:Vue.withCtx(()=>[Vue.createElementVNode("div",jn,[t.home.icon?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(X)(t.home.icon)),{key:0})):Vue.createCommentVNode("",!0),t.home.title?(Vue.openBlock(),Vue.createElementBlock("span",Fn,Vue.toDisplayString(t.home.title),1)):Vue.createCommentVNode("",!0)])]),_:1},8,["name"])):Vue.createCommentVNode("",!0),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(t.tabs,V=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElTabPane),{key:V.id,name:V.id,lazy:"",closable:""},{label:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElPopover),{"open-delay":500,placement:"bottom",trigger:"hover",width:"200px",disabled:V.id!==t.value},{reference:Vue.withCtx(()=>[Vue.createElementVNode("div",{class:"x-mask-tabs__trigger",draggable:"true",onDragstart:m=>l(V,m),onDragend:m=>c(V,m)},[V.icon?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(X)(V.icon)),{key:0})):Vue.createCommentVNode("",!0),V.title?(Vue.openBlock(),Vue.createElementBlock("span",Un,Vue.toDisplayString(V.title),1)):Vue.createCommentVNode("",!0)],40,Ln)]),default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ne),{items:u(V),mode:"text",size:"small",type:"info",onClick:a},null,8,["items"])]),_:2},1032,["disabled"])]),_:2},1032,["name"]))),128))]),_:1},8,["model-value"])]),_:1},512))}}),On=Vue.defineComponent({__name:"ThemeSwitch",setup(o){const e=VueUse.useDark();return(t,n)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElSwitch),{class:"x-mask-theme-switch",modelValue:Vue.unref(e),"onUpdate:modelValue":n[0]||(n[0]=u=>Vue.isRef(e)?e.value=u:null),size:"default","active-action-icon":Vue.unref(VtjIcons.Moon),"inactive-action-icon":Vue.unref(VtjIcons.Sunny)},null,8,["modelValue","active-action-icon","inactive-action-icon"]))}}),Kn={class:"x-mask-toolbar__menu-item"},Xn=Vue.defineComponent({__name:"Toolbar",props:{tabs:{default:()=>[]},actions:{},theme:{type:Boolean}},emits:["closeOtherTabs","closeAllTabs","closeTab","clickTab","actionClick","actionCommand"],setup(o,{emit:e}){const t=o,n=e,u=Vue.computed(()=>{const c=t.tabs.map((i,d)=>({divided:d===0,label:i.title,command:i}));return[{label:"关闭其他",command:"other"},{label:"关闭全部",command:"all"},...c]}),r=c=>{n("closeTab",c.command)},s=c=>{switch(c.command){case"all":n("closeAllTabs");break;case"other":n("closeOtherTabs");break;default:n("clickTab",c.command);break}},a=c=>{n("actionClick",c)},l=(c,i)=>{n("actionCommand",c,i)};return(c,i)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:"x-mask-toolbar",align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(R),{icon:Vue.unref(VtjIcons.MoreFilled),menus:u.value,dropdown:{size:"small"},mode:"icon",circle:"",background:"hover",onCommand:s},{item:Vue.withCtx(({item:d})=>[Vue.createElementVNode("span",Kn,[Vue.createTextVNode(Vue.toDisplayString(d.label)+" ",1),["other","all"].includes(d.command)?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(A),{key:0,onClick:Vue.withModifiers(V=>r(d),["stop"]),icon:Vue.unref(VtjIcons.Close)},null,8,["onClick","icon"]))])]),_:1},8,["icon","menus"]),Vue.createVNode(Vue.unref(ElementPlus.ElDivider),{direction:"vertical"}),t.actions?(Vue.openBlock(),Vue.createBlock(Vue.unref(ne),{key:0,circle:"",mode:"icon",size:"default",background:"hover",items:c.actions,onClick:a,onCommand:l},null,8,["items"])):Vue.createCommentVNode("",!0),t.actions?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:1,direction:"vertical"})):Vue.createCommentVNode("",!0),t.theme?(Vue.openBlock(),Vue.createBlock(On,{key:2})):Vue.createCommentVNode("",!0),t.theme?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:3,direction:"vertical"})):Vue.createCommentVNode("",!0),Vue.renderSlot(c.$slots,"default")]),_:3}))}}),Yn=Vue.defineComponent({__name:"Avatar",props:{avatar:{}},setup(o){const e=o;return(t,n)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElPopover),{width:200,"popper-class":"x-mask-avatar__popper",disabled:!t.$slots.default},{reference:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElAvatar),{class:"x-mask-avatar",shape:"circle",icon:Vue.unref(VtjIcons.UserFilled),src:e.avatar,size:26},null,8,["icon","src"])]),default:Vue.withCtx(()=>[t.$slots.default?Vue.renderSlot(t.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["disabled"]))}}),vt=Vue.defineComponent({__name:"Content",props:{createView:{type:Function},exclude:{}},setup(o){const e=o;return(t,n)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:"x-mask__content",flex:!1,grow:"",padding:!1},{default:Vue.withCtx(()=>[Vue.renderSlot(t.$slots,"default"),Vue.createVNode(Vue.unref(VueRouter.RouterView),null,{default:Vue.withCtx(({Component:u,route:r})=>[(Vue.openBlock(),Vue.createBlock(Vue.KeepAlive,{exclude:e.exclude},[u?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(e.createView(u,r)),{key:r.fullPath})):Vue.createCommentVNode("",!0)],1032,["exclude"]))]),_:1})]),_:3}))}});function Gn(){const o=Vue.ref(!1),e=Vue.ref(""),t=Vue.ref(!1);return{collapsed:o,keyword:e,favorite:t}}function Wn(o){const e=VtjUtils.uid();return Vue.computed(()=>{const t=o.home;return Object.assign({id:e,url:"/",name:"MaskHome",icon:VtjIcons.HomeFilled,closable:!1},typeof t=="string"?{url:t}:t||{})})}function yt(o,e){let t=[];return o.forEach(n=>{n=e?e(n):n,n.children?t=t.concat(yt(n.children,e)):t.push(n)}),t}function Jn(o,e){const t=VueRouter.useRouter(),n=Vue.shallowRef([]),u=Vue.shallowRef([]),r=Vue.computed(()=>yt(n.value,o.menuAdapter)),s=Vue.computed(()=>VtjUtils.arrayToMap(r.value,"id")),a=Vue.ref(null),l=f=>{const g=typeof f=="object"?f.id:f,b=s.value.get(g);if(!b){console.warn("找不到菜单",f);return}const{type:w="route",url:C,title:p,icon:h}=b;if(!C){a.value=b,e("select",b);return}if(w==="route"){VtjUtils.isUrl(C)||C.startsWith("//")?window.open(C):(a.value=b,t.push(C).catch(y=>y));return}if(w==="window"){window.open(C);return}w==="dialog"&&me({resizable:!0,bodyPadding:!1,width:"80%",height:"80%",title:p,icon:h,src:C})},c=async()=>{n.value=typeof o.menus=="function"?await o.menus()||[]:o.menus??[],u.value=typeof o.favorites=="function"?await o.favorites()||[]:o.favorites??[]},i=f=>{u.value=[f,...u.value],o.addFavorite&&o.addFavorite(f)},d=f=>{u.value=u.value.filter(g=>g.id!==f.id),o.removeFavorite&&o.removeFavorite(f)},V=f=>!!u.value.find(g=>g===f||g.id===f.id),m=f=>{V(f)?d(f):i(f)};return Vue.watchEffect(c),{menus:n,favorites:u,flatMenus:r,active:a,select:l,toggleFavorite:m}}function qn(o,e,t,n,u){const r=VueRouter.useRoute(),s=VueRouter.useRouter(),a={},l=Vue.ref([]),c=Vue.ref(),{width:i}=VueUse.useElementSize(c),d=Vue.computed(()=>Math.floor(i.value/gt)),V=Vue.computed(()=>l.value.slice(0,d.value).filter(E=>!E.dialog)),m=Vue.computed(()=>l.value.slice(d.value)),f=E=>t.value.find(_=>_.url===E),g=E=>r.fullPath===E.url,b=E=>u.value.id===E?u.value:l.value.find(_=>_.id===E),w=Vue.ref(""),C=Vue.computed(()=>b(w.value)),p=E=>{s.push(E.url).catch(_=>_)},h=E=>{w.value=E.id,r.fullPath!==E.url&&p(E)},y=()=>{p(u.value)},x=E=>{const _=l.value.find(S=>S.url===E.url||S.id===E.id);_?h(_):(l.value.unshift(E),h(E))},v=async E=>{const{url:_=r.fullPath,icon:S,title:L="新建标签页"}=E||{},Z=a[_],et=VtjUtils.uid(),tt=VtjUtils.upperFirstCamelCase(_);return{id:et,name:tt,url:_,icon:S,title:L,closable:!0,menu:E,...Z?await Z():{}}},P=async E=>{if(await ElementPlus.ElMessageBox.confirm("是否关闭页签","提示",{type:"warning"}).catch(()=>!1)){if(l.value=l.value.filter(S=>S.id!==E.id),w.value===E.id){const S=l.value[0];p(S||u.value)}return E}},z=E=>{const _=l.value.findIndex(S=>S.id===E.id);if(_>=0){const S=l.value[_];l.value.splice(_,1,Object.assign(S,E))}},I=async()=>{if(!await ElementPlus.ElMessageBox.confirm("是否关闭全部页签","提示",{type:"warning"}).catch(()=>!1))return;const _=l.value;return l.value=[],h(u.value),_},T=async()=>{if(!await ElementPlus.ElMessageBox.confirm("是否关闭其他页签","提示",{type:"warning"}).catch(()=>!1))return;const _=l.value.filter(S=>S.id!==w.value);return l.value=l.value.filter(S=>S.id===w.value),_},M=E=>{const _=l.value.filter(S=>S.id!==E.id);l.value=[E,..._],h(E)},B=async()=>{await Vue.nextTick();const E=u.value.url===r.fullPath,_=f(r.fullPath);if(E)w.value=u.value.id;else{const S=await v(_);x(S)}await Vue.nextTick(),n.value=_||null};return Vue.watch(t,B),Vue.watch(r,B,{immediate:!0}),Vue.provide(ze,a),{tabRef:c,tabs:l,showTabs:V,currentTab:C,changeTab:p,removeTab:P,updateTab:z,addTab:x,home:u,tabValue:w,isCurrentTab:g,activeHome:y,activeTab:h,dropdownTabs:m,removeAllTabs:I,removeOtherTabs:T,moveToShow:M}}function Qn(o){const e=new Map,t=Vue.ref([]),n=Vue.reactive({}),u=Vue.getCurrentInstance(),r={},{updateTab:s,isCurrentTab:a,activeHome:l,tabs:c}=o,i=(p,h)=>{const y=h.fullPath;if(e.has(y))return e.get(y);{const x=VtjUtils.upperFirstCamelCase(y),v={name:x,setup(){const P=Vue.computed(()=>n[y]||document.body),z=Vue.computed(()=>!n[y]),I=Vue.computed(()=>!t.value.includes(x));return Vue.provide(VueRouter.routeLocationKey,Vue.toRaw({...h})),()=>I.value?Vue.h(Vue.Teleport,{to:P.value,disabled:z.value},[Vue.h(p)]):null}};return e.set(y,v),v}},d=p=>{p.dialog=void 0,delete n[p.url];const h=r[p.id];h&&(h.destroy(),delete r[p.id],s(p))},V=(p=[])=>{p.forEach(h=>{d(h)})},m=async p=>{p.dialog={...p.dialog,onMinimized:()=>{d(p)},onClose:async()=>{d(p),c.value=c.value.filter(y=>y.id!==p.id)}},s(p);const h=me({title:p.title,icon:p.icon,modal:!1,resizable:!0,draggable:!0,maximizable:!0,minimizable:!0,...p.dialog,onOpen(y){n[p.url]=y.refs.panelRef?.bodyRef?.$el}},u?.appContext);return await Vue.nextTick(),a(p)&&l(),r[p.id]=h,h},f=async p=>{t.value=[p.name],await Vue.nextTick(),t.value=[]},g=async p=>{t.value=p.map(h=>h.name),await Vue.nextTick(),t.value=[]},b=p=>(p.preventDefault(),!1),w=p=>{if(p.dataTransfer){const h=p.dataTransfer.getData("tab"),y=c.value.find(x=>x.id===h);if(y){const{clientX:x,clientY:v}=p;y.dialog={left:x,top:v},m(y)}}},C=p=>!!n[p];return VueUse.useEventListener(document,"dragover",b),VueUse.useEventListener(document,"drop",w),{createView:i,openDialog:m,refresh:f,exclude:t,cleanCache:g,hasDialog:C,closeDialog:d,closeDialogs:V}}const wt=Vue.defineComponent({name:"XMask",__name:"Mask",props:ht,emits:["select","actionClick","actionCommand"],setup(o,{emit:e}){const t=o,n=e,u=Wn(t),{collapsed:r,keyword:s,favorite:a}=Gn(),{menus:l,favorites:c,flatMenus:i,active:d,select:V,toggleFavorite:m}=Jn(t,n),{tabRef:f,showTabs:g,currentTab:b,changeTab:w,removeTab:C,tabs:p,updateTab:h,isCurrentTab:y,activeHome:x,removeAllTabs:v,removeOtherTabs:P,dropdownTabs:z,moveToShow:I}=qn(t,n,i,d,u),{createView:T,openDialog:M,refresh:B,exclude:E,cleanCache:_,closeDialogs:S}=Qn({tabs:p,updateTab:h,isCurrentTab:y,activeHome:x}),L=async D=>{await C(D)&&await _([D])},Z=async()=>{const D=await v();D&&(S(D),await _(D))},et=async()=>{const D=await P();D&&(S(D),await _(D))},tt=D=>{n("actionClick",D)},F0=(D,U)=>{n("actionCommand",D,U)};return Vue.provide(Te,{tabs:p,flatMenus:i,favorites:c,updateTab:h,active:d,currentTab:b}),(D,U)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:Vue.normalizeClass(["x-mask",{"is-disabled":t.disabled}]),fit:""},{default:Vue.withCtx(()=>[t.disabled?(Vue.openBlock(),Vue.createBlock(vt,{key:1,createView:Vue.unref(T),exclude:Vue.unref(E)},{default:Vue.withCtx(()=>[D.$slots.default?Vue.renderSlot(D.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["createView","exclude"])):(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,{key:0},[Vue.createVNode(Tn,{collapsed:Vue.unref(r)},{brand:Vue.withCtx(()=>[Vue.createVNode($n,{logo:t.logo,title:t.title,url:Vue.unref(u).url,collapsed:Vue.unref(r)},null,8,["logo","title","url","collapsed"])]),default:Vue.withCtx(()=>[Vue.createVNode(In,{collasped:Vue.unref(r),"onUpdate:collasped":U[0]||(U[0]=se=>Vue.isRef(r)?r.value=se:null),favorite:Vue.unref(a),"onUpdate:favorite":U[1]||(U[1]=se=>Vue.isRef(a)?a.value=se:null),keyword:Vue.unref(s),"onUpdate:keyword":U[2]||(U[2]=se=>Vue.isRef(s)?s.value=se:null)},null,8,["collasped","favorite","keyword"]),Vue.createVNode(An,{collapse:Vue.unref(r),keyword:Vue.unref(s),favorite:Vue.unref(a),favorites:Vue.unref(c),flatMenus:Vue.unref(i),menus:Vue.unref(l),active:Vue.unref(d),onSelect:Vue.unref(V)},null,8,["collapse","keyword","favorite","favorites","flatMenus","menus","active","onSelect"])]),_:1},8,["collapsed"]),Vue.createVNode(Vue.unref(N),{class:"x-mask__main",grow:"",shrink:"",flex:"",direction:"column"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(N),{class:"x-mask-topbar",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Hn,{ref_key:"tabRef",ref:f,favorites:Vue.unref(c),tabs:Vue.unref(g),home:Vue.unref(u),value:Vue.unref(b)?.id,onClick:Vue.unref(w),onToggleFavorite:Vue.unref(m),onRemove:L,onDialog:Vue.unref(M),onRefresh:Vue.unref(B)},null,8,["favorites","tabs","home","value","onClick","onToggleFavorite","onDialog","onRefresh"]),Vue.createVNode(Xn,{tabs:Vue.unref(z),actions:t.actions,theme:t.theme,onCloseOtherTabs:et,onCloseAllTabs:Z,onCloseTab:L,onClickTab:Vue.unref(I),onActionClick:tt,onActionCommand:F0},{default:Vue.withCtx(()=>[Vue.createVNode(Yn,{avatar:t.avatar},Vue.createSlots({_:2},[D.$slots.user?{name:"default",fn:Vue.withCtx(()=>[Vue.renderSlot(D.$slots,"user")]),key:"0"}:void 0]),1032,["avatar"])]),_:3},8,["tabs","actions","theme","onClickTab"])]),_:3}),Vue.createVNode(vt,{createView:Vue.unref(T),exclude:Vue.unref(E)},{default:Vue.withCtx(()=>[D.$slots.default?Vue.renderSlot(D.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["createView","exclude"])]),_:3})],64))]),_:3},8,["class"]))}});function Zn(o={}){const e=VueRouter.useRoute(),t=Vue.inject(ze,null),n=Vue.inject(Te,null);if(t){const r=typeof o=="function"?o:async()=>o;t[e.fullPath]=r}return{tab:Vue.computed(()=>n?n.tabs.value.find(r=>r.url===e.fullPath):null),mask:n}}const eo=Vue.defineComponent({__name:"SelectEditor",props:{options:{default:()=>[]}},setup(o){const e=o;return(t,n)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElSelect),Vue.normalizeProps(Vue.guardReactiveProps(t.$attrs)),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.options,(u,r)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElOption),Vue.mergeProps({key:`item_${r}_${u.value}`,ref_for:!0},u),Vue.createSlots({_:2},[t.$slots.option?{name:"default",fn:Vue.withCtx(()=>[Vue.renderSlot(t.$slots,"option",{option:u})]),key:"0"}:void 0]),1040))),128))]),_:3},16))}}),to=Vue.defineComponent({__name:"CheckboxEditor",props:{options:{default:()=>[]},button:{type:Boolean,default:!1}},setup(o){const e=o,t=Vue.computed(()=>Vue.markRaw(e.button?ElementPlus.ElCheckboxButton:ElementPlus.ElCheckbox));return(n,u)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElCheckboxGroup),Vue.normalizeProps(Vue.guardReactiveProps(n.$attrs)),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.options,(r,s)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(t.value),Vue.mergeProps({key:`item_${s}_${r.value}`,ref_for:!0},r),{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(r.label),1)]),_:2},1040))),128))]),_:1},16))}}),no=Vue.defineComponent({__name:"RadioEditor",props:{options:{default:()=>[]},button:{type:Boolean,default:!1}},setup(o){const e=o,t=Vue.computed(()=>Vue.markRaw(e.button?ElementPlus.ElRadioButton:ElementPlus.ElRadio));return(n,u)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElRadioGroup),Vue.normalizeProps(Vue.guardReactiveProps(n.$attrs)),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.options,(r,s)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(t.value),Vue.mergeProps({key:`item_${s}_${r.value}`,ref_for:!0},r),{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(r.label),1)]),_:2},1040))),128))]),_:1},16))}}),Ie={none:{component:"div",props:{class:"x-field-none"}},text:{component:ElementPlus.ElInput,props:{clearable:!0},defaultValue:""},textarea:{component:ElementPlus.ElInput,props:{type:"textarea",rows:2},defaultValue:""},select:{component:eo,props:{clearable:!0}},checkbox:{component:to,props:{},defaultValue:[]},radio:{component:no,props:{}},number:{component:ElementPlus.ElInputNumber,props:{}},date:{component:ElementPlus.ElDatePicker,props:{}},time:{component:ElementPlus.ElTimePicker,props:{}},datetime:{component:ElementPlus.ElDatePicker,props:{type:"datetime"}},switch:{component:ElementPlus.ElSwitch,props:{}},rate:{component:ElementPlus.ElRate,props:{}},slider:{component:ElementPlus.ElSlider,props:{}},cascader:{component:ElementPlus.ElCascader,props:{}}},kt={name:{type:String},label:{type:String},editor:{type:[String,Object],default:"text"},props:{type:Object},modelValue:{type:[String,Number,Boolean,Object,Array],default(o){return Ie[o.editor]?.defaultValue}},size:{type:String},width:{type:[String,Number]},tooltipMessage:{type:[Boolean,Object],default:!0},tooltipPosition:{type:[String,Number],default:"outer"},placeholder:{type:String},disabled:{type:Boolean},readonly:{type:Boolean},options:{type:[Array,Function]},visible:{type:[Boolean,Object,Function],default:!0},cascader:{type:[String,Array]},error:{type:String},tip:{type:String},inline:{type:Boolean}};async function oo(o,e){const t=o.options;return t?typeof t=="function"?await t(e)||[]:t:[]}function uo(o,e,t,n,u){const r=Vue.ref([]),s=Vue.computed(()=>!n||!u?{}:VtjUtils.toArray(o.cascader).reduce((c,i)=>(c[i]=VtjUtils.get(u,i),c),{}));return Vue.watch(s,async l=>{if(t.value){r.value=await oo(o,l);const c=n?.exposed?.reset;c&&o.name&&c(o.name)}},{immediate:!0}),{editor:Vue.computed(()=>{const{editor:l="text",placeholder:c,label:i="...",disabled:d,readonly:V}=o,m={...o.props,placeholder:c||(c===null?void 0:`请输入${i}`),disabled:d,readonly:V,options:r.value,onFocus:()=>e("focus"),onBlur:()=>e("blur"),onChange:g=>e("change",g)},f=typeof l=="string"?Ie[l]:{component:l,props:{}};return VtjUtils.merge({},f,{props:m})})}}const ro={key:1,class:"el-form-item__error"},lo={key:0,class:"x-field__tip"},De=Vue.defineComponent({name:"XField",__name:"Field",props:kt,emits:["update:modelValue","change","focus","blur"],setup(o,{expose:e,emit:t}){const n=o,u=t,r=Vue.inject(Me,null),s=Vue.inject(ElementPlus.formContextKey,null),a=Vue.inject($e,null),l=Vue.computed(()=>!r?.proxy||!a?n.visible:typeof n.visible=="function"?n.visible(a):VtjUtils.isObject(n.visible)?Object.entries(n.visible).every(([P,z])=>VtjUtils.get(a,P)===z):n.visible),c=()=>r?.proxy&&a&&n.name?VtjUtils.get(a,n.name)??n.modelValue:n.modelValue,i=Vue.ref(c()),{editor:d}=uo(n,u,l,r,a),V=Vue.ref(),m=Vue.ref(),f=Vue.computed(()=>n.size||s?.size||"default"),g=Vue.computed(()=>Object.assign({},r?.props.tooltipMessage||{},typeof n.tooltipMessage=="boolean"?{}:n.tooltipMessage)),b=(v="")=>n.error?n.error:v.includes("is required")?`${n.label||n.name}是必填项!`:v,w=Vue.computed(()=>{const v=r?.props.tooltipMessage??n.tooltipMessage;return{[`is-tooltip-${n.tooltipPosition}`]:!!v&&!!n.tooltipPosition}}),C=Vue.computed(()=>{const v=r?.proxy;return{width:n.width?j(n.width):v&&v.inline&&v.inlineColumns?`${100/v.inlineColumns}%`:null}}),p=Vue.computed(()=>({right:typeof n.tooltipPosition=="number"?`${n.tooltipPosition}px`:void 0})),h=Vue.computed(()=>({...d.value.props,modelValue:i.value,"onUpdate:modelValue":v=>{i.value=v}}));return Vue.watch(i,(v,P)=>{l.value&&!VtjUtils.isEqual(v,P)&&(u("update:modelValue",v),r?.proxy&&a&&n.name&&VtjUtils.set(a,n.name,v))}),Vue.watch(()=>!r?.proxy||!n.name||!a?n.modelValue:VtjUtils.get(a,n.name)??n.modelValue,v=>{l.value&&(i.value=v)},{immediate:!0}),Vue.watch(l,v=>{r?.proxy&&a&&n.name&&(v?(i.value=c(),VtjUtils.set(a,n.name,i.value)):(i.value=void 0,VtjUtils.set(a,n.name,void 0)))},{immediate:!0}),e({fieldValue:i,itemRef:V,editorRef:m,focus:()=>{m.value?.focus&&m.value.focus()},blur:()=>{m.value?.foucs&&m.value.blur()}}),(v,P)=>l.value?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElFormItem),Vue.mergeProps({key:0,class:["x-field",w.value],ref_key:"itemRef",ref:V,prop:n.name,label:v.label,size:f.value,style:C.value},v.$attrs),Vue.createSlots({error:Vue.withCtx(({error:z})=>[Vue.renderSlot(v.$slots,"error",{error:z},()=>[Vue.unref(r)?.props.tooltipMessage??n.tooltipMessage?(Vue.openBlock(),Vue.createElementBlock("div",{key:0,class:"x-field__info",style:Vue.normalizeStyle(p.value)},[Vue.createVNode(Vue.unref(ElementPlus.ElTooltip),Vue.mergeProps({content:b(z)},g.value),{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(A),{class:"x-field__trigger",icon:Vue.unref(VtjIcons.WarningFilled),size:f.value},null,8,["icon","size"])]),_:2},1040,["content"])],4)):(Vue.openBlock(),Vue.createElementBlock("div",ro,Vue.toDisplayString(b(z)),1))])]),default:Vue.withCtx(()=>[Vue.createElementVNode("div",{class:Vue.normalizeClass(["x-field__editor_wrap",{"is-inline":n.inline}])},[Vue.renderSlot(v.$slots,"editor",{editor:h.value},()=>[Vue.unref(d).component?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(d).component),Vue.mergeProps({key:0,class:"x-field__editor",ref_key:"editorRef",ref:m,modelValue:i.value,"onUpdate:modelValue":P[0]||(P[0]=z=>i.value=z)},Vue.unref(d).props),Vue.createSlots({_:2},[v.$slots.option?{name:"option",fn:Vue.withCtx(({option:z})=>[Vue.renderSlot(v.$slots,"option",{option:z})]),key:"0"}:void 0]),1040,["modelValue"])):Vue.createCommentVNode("",!0)]),n.tip||v.$slots.tip?(Vue.openBlock(),Vue.createElementBlock("div",lo,[Vue.renderSlot(v.$slots,"tip",{},()=>[Vue.createTextVNode(Vue.toDisplayString(n.tip),1)])])):Vue.createCommentVNode("",!0)],2),Vue.renderSlot(v.$slots,"default")]),_:2},[v.$slots.label?{name:"label",fn:Vue.withCtx(()=>[Vue.renderSlot(v.$slots,"label")]),key:"0"}:void 0]),1040,["prop","label","size","class","style"])):Vue.createCommentVNode("",!0)}}),Ct={model:{type:Object,default(){return Object.create(null)}},inline:{type:Boolean},inlineColumns:{type:Number},footer:{type:Boolean,default:!0},submitText:{type:String,default:"提交"},resetText:{type:String,default:"重置"},submitMethod:{type:Function},tooltipMessage:{type:[Object,Boolean],default:void 0}},Me=Symbol("formInstanceKey"),$e=Symbol("formModelKey"),Ae=Vue.defineComponent({name:"XForm",__name:"Form",props:Ct,emits:["change","submit","reset"],setup(o,{expose:e,emit:t}){const n=o,u=t,r=Vue.getCurrentInstance(),s=Vue.ref(),a=Vue.reactive(n.model||{}),l=Vue.ref(!1);Vue.provide(Me,r),Vue.provide($e,a),Vue.watch(()=>n.model,d=>{Object.assign(a,d)},{deep:!0}),Vue.watch(a,()=>{u("change",Vue.toRaw(a))});const c=async()=>{await s.value.validate().catch(()=>!1)&&(u("submit",Vue.toRaw(a)),n.submitMethod&&(l.value=!0,await n.submitMethod(Vue.toRaw(a)),l.value=!1))},i=d=>{s.value.resetFields(d),u("reset")};return e({formRef:s,model:a,submit:c,reset:i}),(d,V)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElForm),Vue.mergeProps({ref_key:"formRef",ref:s,class:"x-form",inline:n.inline,model:a,onKeyup:Vue.withKeys(c,["enter"]),onSubmit:V[1]||(V[1]=Vue.withModifiers(()=>{},["stop","prevent"]))},d.$attrs),{default:Vue.withCtx(()=>[Vue.renderSlot(d.$slots,"default"),n.footer?(Vue.openBlock(),Vue.createBlock(Vue.unref(De),{key:0,editor:"none",class:"x-form__footer",label:" "},{editor:Vue.withCtx(()=>[Vue.renderSlot(d.$slots,"footer",{},()=>[n.submitText?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:0,loading:l.value,type:"primary",onClick:c},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(n.submitText),1)]),_:1},8,["loading"])):Vue.createCommentVNode("",!0),n.resetText?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:1,type:"default",onClick:V[0]||(V[0]=()=>i())},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(n.resetText),1)]),_:1})):Vue.createCommentVNode("",!0),Vue.renderSlot(d.$slots,"action")])]),_:3})):Vue.createCommentVNode("",!0)]),_:3},16,["inline","model"]))}}),bt={modelValue:{type:Boolean,default:!0},size:{type:String},formProps:{type:Object},submit:{type:[Boolean,String],default:"确定"},cancel:{type:[Boolean,String],default:"取消"},model:{type:Object,default(){return Object.create(null)}},rules:{type:Object},submitMethod:{type:Function}},_t=Vue.defineComponent({name:"XDialogForm",__name:"DialogForm",props:bt,emits:["update:modelValue","submit","close"],setup(o,{expose:e,emit:t}){const n=o,u=t,r=Vue.ref(),s=Vue.ref(),a=Vue.computed(()=>s.value?.$vtjEl),l=()=>{r.value?.submit()},c=()=>{u("update:modelValue",!1),u("close")},i=async m=>{u("submit",m),n.submitMethod?await n.submitMethod(m)&&c():c()},d=Vue.computed(()=>n.formProps?.disabled?!1:n.submit),V=Vue.computed(()=>n.formProps?.disabled?!1:n.cancel);return e({$vtjEl:a,formRef:r,dialogRef:s}),(m,f)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(de),Vue.mergeProps({ref_key:"dialogRef",ref:s,class:"x-dialog-form","model-value":n.modelValue,submit:d.value,cancel:V.value,size:n.size,onSubmit:l,onClose:c,minimizable:!1,maximizable:!1},m.$attrs),Vue.createSlots({default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(Ae),Vue.mergeProps({ref_key:"formRef",ref:r,class:"x-dialog-form__form",footer:!1,"label-width":"80px",size:n.size,model:n.model,rules:n.rules,"submit-method":i},n.formProps),{default:Vue.withCtx(()=>[Vue.renderSlot(m.$slots,"default")]),_:3},16,["size","model","rules"])]),_:2},[m.$slots.extra?{name:"extra",fn:Vue.withCtx(()=>[Vue.renderSlot(m.$slots,"extra")]),key:"0"}:void 0,m.$slots.handle?{name:"handle",fn:Vue.withCtx(()=>[Vue.renderSlot(m.$slots,"handle")]),key:"1"}:void 0,m.$slots.footer?{name:"footer",fn:Vue.withCtx(()=>[Vue.renderSlot(m.$slots,"footer")]),key:"2"}:void 0]),1040,["model-value","submit","cancel","size"]))}}),Bt={items:{type:Array,default(){return[]}},border:{type:Boolean},fit:{type:Boolean},align:{type:String}},ao={class:"x-tabs__label-inner"},so={key:0,class:"x-tabs__actions"},Et=Vue.defineComponent({name:"XTabs",__name:"Tabs",props:Bt,emits:["actionClick","actionCommand"],setup(o,{emit:e}){const t=o,n=e,u=l=>{const{label:c,name:i,value:d,disabled:V,closable:m,lazy:f}=l;return{label:c,name:d??i,disabled:V,closable:m,lazy:f}},r=Vue.computed(()=>({"is-no-border":!t.border,"is-fit":!!t.fit,[`is-align-${t.align}`]:!!t.align})),s=l=>{n("actionClick",l)},a=l=>{n("actionCommand",l)};return(l,c)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElTabs),Vue.mergeProps({class:["x-tabs",r.value]},l.$attrs),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(t.items,i=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElTabPane),Vue.mergeProps({key:i.value??i.name,ref_for:!0},u(i)),{label:Vue.withCtx(()=>[Vue.renderSlot(l.$slots,"label",Vue.mergeProps({ref_for:!0},i),()=>[i.icon?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(X)(i.icon)),{key:0,class:"x-tabs__icon"})):Vue.createCommentVNode("",!0),Vue.createElementVNode("div",ao,[Vue.createTextVNode(Vue.toDisplayString(i.label)+" ",1),i.actions&&[i.name,i.value].includes(l.$attrs.modelValue)?(Vue.openBlock(),Vue.createElementBlock("div",so,[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(i.actions,d=>(Vue.openBlock(),Vue.createBlock(Vue.unref(R),Vue.mergeProps({mode:"icon",type:"primary",size:"small",circle:"",ref_for:!0},d,{onClick:s,onCommand:a}),null,16))),256))])):Vue.createCommentVNode("",!0)])])]),default:Vue.withCtx(()=>[Vue.renderSlot(l.$slots,"default",Vue.mergeProps({ref_for:!0},i),()=>[i.component?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(i.component),Vue.mergeProps({key:0,ref_for:!0},i.props),null,16)):Vue.createCommentVNode("",!0)])]),_:2},1040))),128))]),_:3},16,["class"]))}}),xt={direction:{type:String,default:"column"},imageSrc:{type:String},imageWidth:{type:[Number,String]},imageHeight:{type:[Number,String]},icon:{type:[String,Object]},title:{type:String},description:{type:String},actions:{type:Array},actionBarProps:{type:Object},split:{type:Boolean},onImageClick:{type:Function},onTitleClick:{type:Function}},io={class:"x-data-item__title"},co={key:1,class:"x-data-item__section x-data-item__desc"},mo={key:2,class:"x-data-item__section x-data-item__extra"},fo={key:3,class:"x-data-item__section x-data-item__actions"},St=Vue.defineComponent({name:"XDataItem",__name:"DataItem",props:xt,emits:["imageClick","titleClick","actionClick","actionCommand"],setup(o,{emit:e}){const t=o,n=e,u=Vue.computed(()=>{const{imageWidth:d,imageHeight:V}=t;return{width:d?j(d):void 0,height:V?j(V):void 0}}),r=Vue.computed(()=>({[`is-image-${t.direction}`]:!!t.direction,"is-split":!!t.split})),s=Vue.computed(()=>({size:"small",mode:"text",justify:"flex-end",type:"info",items:t.actions,...t.actionBarProps})),a=()=>n("imageClick"),l=()=>n("titleClick"),c=d=>n("actionClick",d),i=(d,V)=>n("actionCommand",d,V);return(d,V)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{class:Vue.normalizeClass(["x-data-item",r.value]),direction:t.direction},{default:Vue.withCtx(()=>[t.imageSrc||d.$slots.image?(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{key:0,class:"x-data-item__img",autoPointer:!0,onClick:t.onImageClick?a:void 0},{default:Vue.withCtx(()=>[Vue.renderSlot(d.$slots,"image",{},()=>[t.imageSrc?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElImage),{key:0,style:Vue.normalizeStyle(u.value),src:t.imageSrc},null,8,["style","src"])):Vue.createCommentVNode("",!0)])]),_:3},8,["onClick"])):Vue.createCommentVNode("",!0),Vue.createVNode(Vue.unref(N),{class:"x-data-item__content",direction:"column",grow:"",shrink:""},{default:Vue.withCtx(()=>[t.title||d.$slots.title?(Vue.openBlock(),Vue.createBlock(Vue.unref(N),{key:0,class:"x-data-item__section x-data-item__wrapper",align:"center",autoPointer:!0,onClick:t.onTitleClick?l:void 0},{default:Vue.withCtx(()=>[t.icon?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(X)(t.icon)),{key:0,class:"x-data-item__icon"})):Vue.createCommentVNode("",!0),Vue.createElementVNode("span",io,[Vue.renderSlot(d.$slots,"title",{},()=>[Vue.createTextVNode(Vue.toDisplayString(t.title),1)])])]),_:3},8,["onClick"])):Vue.createCommentVNode("",!0),t.description||d.$slots.description?(Vue.openBlock(),Vue.createElementBlock("div",co,[Vue.renderSlot(d.$slots,"description",{},()=>[Vue.createTextVNode(Vue.toDisplayString(t.description),1)])])):Vue.createCommentVNode("",!0),d.$slots.default?(Vue.openBlock(),Vue.createElementBlock("div",mo,[Vue.renderSlot(d.$slots,"default")])):Vue.createCommentVNode("",!0),t.actions||t.actionBarProps||d.$slots.actions?(Vue.openBlock(),Vue.createElementBlock("div",fo,[Vue.renderSlot(d.$slots,"actions",{},()=>[Vue.createVNode(Vue.unref(ne),Vue.mergeProps(s.value,{onClick:c,onCommand:i}),null,16)])])):Vue.createCommentVNode("",!0)]),_:3})]),_:3},8,["direction","class"]))}}),Nt={data:{type:[Object,Function],default(){return[]}},itemHeight:{type:[Number,Function]},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},pager:{type:[Boolean,Object]},page:{type:Number,default:1},pageSize:{type:Number,default:10},dataKey:{type:String},infiniteScroll:{type:[Boolean,Object]}},Vo={key:0,class:"x-list__loading"},po={key:1,class:"x-list__nomore"},go={key:0,class:"x-list__loading"},ho={key:1,class:"x-list__nomore"},vo={key:1,class:"x-list__pager"},Pt=Vue.defineComponent({name:"XList",__name:"List",props:Nt,emits:["load"],setup(o,{expose:e,emit:t}){const n=o,u=t,r=Vue.reactive({page:n.page,pageSize:n.pageSize});Vue.watchEffect(()=>{const{page:y,pageSize:x}=n;Object.assign(r,{page:y,pageSize:x})});const{data:s,loading:a}=st(n.data,{list:[],total:0},r),l=Vue.computed(()=>Math.ceil((s.value.total||0)/r.pageSize)),c=Vue.ref(!1),i=Vue.ref(),d=Vue.computed(()=>({width:j(n.width),height:j(n.height)})),V=Vue.computed(()=>({"is-virtual":!!n.itemHeight})),m=Vue.computed(()=>{const y={};for(let[x,v]of Object.entries(be(n.infiniteScroll)))y[`infinite-scroll-${x}`]=v;return(a.value||c.value)&&(y["infinite-scroll-disabled"]=!0),y}),f=Vue.computed(()=>be(n.pager,{})),{list:g,containerProps:b,wrapperProps:w,scrollTo:C}=VueUse.useVirtualList(Vue.computed(()=>s.value.list),{itemHeight:n.itemHeight||0}),p=()=>{!n.infiniteScroll||c.value||(r.page<l.value?(++r.page,u("load",r)):c.value=!0)},h=y=>n.dataKey?y[n.dataKey]:void 0;return e({list:g,scrollTo:C,wrapperRef:i,loading:a,state:r,pageCount:l,nomore:c,data:s,getKey:h}),(y,x)=>(Vue.openBlock(),Vue.createElementBlock("div",{class:Vue.normalizeClass(["x-list",V.value]),style:Vue.normalizeStyle(d.value)},[!Vue.unref(s).total&&!Vue.unref(a)?Vue.renderSlot(y.$slots,"empty",{key:0},()=>[Vue.createVNode(Vue.unref(ElementPlus.ElEmpty))]):Vue.createCommentVNode("",!0),Vue.createElementVNode("div",Vue.mergeProps({class:"x-list__content"},Vue.unref(b)),[n.itemHeight?Vue.withDirectives((Vue.openBlock(),Vue.createElementBlock("div",Vue.mergeProps({key:0,class:"x-list__wrapper",ref_key:"wrapperRef",ref:i},{...Vue.unref(w),...m.value}),[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(Vue.unref(g),(v,P)=>Vue.renderSlot(y.$slots,"default",Vue.mergeProps({key:h(v.data),ref_for:!0},{item:v.data,index:P}),()=>[Vue.createElementVNode("div",null,Vue.toDisplayString(v),1)])),128)),Vue.unref(a)?(Vue.openBlock(),Vue.createElementBlock("div",Vo,[Vue.renderSlot(y.$slots,"loading",{},()=>[Vue.createTextVNode(" 正在加载数据... ")])])):Vue.createCommentVNode("",!0),c.value?(Vue.openBlock(),Vue.createElementBlock("div",po,[Vue.renderSlot(y.$slots,"nomore",{},()=>[Vue.createTextVNode(" 没有更多数据 ")])])):Vue.createCommentVNode("",!0)],16)),[[Vue.unref(ElementPlus.ElInfiniteScroll),p]]):Vue.withDirectives((Vue.openBlock(),Vue.createElementBlock("div",Vue.mergeProps({key:1,class:"x-list__wrapper"},m.value),[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(Vue.unref(s).list,(v,P)=>Vue.renderSlot(y.$slots,"default",Vue.mergeProps({key:h(v),ref_for:!0},{item:v,index:P}),()=>[Vue.createElementVNode("div",null,Vue.toDisplayString(v),1)])),128)),Vue.unref(a)?(Vue.openBlock(),Vue.createElementBlock("div",go,[Vue.renderSlot(y.$slots,"loading",{},()=>[Vue.createTextVNode(" 正在加载数据... ")])])):Vue.createCommentVNode("",!0),c.value?(Vue.openBlock(),Vue.createElementBlock("div",ho,[Vue.renderSlot(y.$slots,"nomore",{},()=>[Vue.createTextVNode(" 没有更多数据 ")])])):Vue.createCommentVNode("",!0)],16)),[[Vue.unref(ElementPlus.ElInfiniteScroll),p]])],16),n.pager?(Vue.openBlock(),Vue.createElementBlock("div",vo,[Vue.createVNode(Vue.unref(ElementPlus.ElPagination),Vue.mergeProps({small:"",background:"",layout:"prev, pager, next",total:Vue.unref(s).total,"default-page-size":n.pageSize,"default-current-page":n.page,"current-page":r.page,"onUpdate:currentPage":x[0]||(x[0]=v=>r.page=v),"page-size":r.pageSize,"onUpdate:pageSize":x[1]||(x[1]=v=>r.pageSize=v)},f.value),null,16,["total","default-page-size","default-current-page","current-page","page-size"])])):Vue.createCommentVNode("",!0)],6))}}),zt={name:{type:String,default:"VTJ.PRO"},tagline:{type:String,default:"基于 Vue3 + TypeScript 快速打造高生产力的低代码研发平台"},actionText:{type:String,default:"开始设计"},actionLink:{type:String,default:"/@vtj/pro/"}},yo={class:"x-startup"},wo={class:"x-startup__wrapper"},ko={class:"x-startup__name"},Co={class:"clip"},bo={class:"x-startup__tagline"},_o={class:"x-startup__actions"},Tt=Vue.defineComponent({__name:"Startup",props:zt,setup(o){const e=o,t=()=>{if(typeof window<"u"){let u=(window.__VTJ_LINK__||{}).href||window.location.pathname+"@vtj/pro/#/";window.location.href=u}};return(n,u)=>(Vue.openBlock(),Vue.createElementBlock("div",yo,[Vue.createElementVNode("div",wo,[Vue.createElementVNode("div",ko,[Vue.createElementVNode("span",Co,Vue.toDisplayString(e.name),1)]),Vue.createElementVNode("div",bo,Vue.toDisplayString(e.tagline),1),Vue.createElementVNode("div",_o,[Vue.createVNode(Vue.unref(ElementPlus.ElButton),{type:"primary",size:"large",round:"",icon:Vue.unref(VtjIcons.EditPen),onClick:t},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(e.actionText),1)]),_:1},8,["icon"])])])]))}}),It={stringProp:{type:String},booleanProp:{type:Boolean},numberProp:{type:Number},selectProp:{type:String},objectProp:{type:Object},arrayProp:{type:Array},iconProp:{type:String},colorProp:{type:String},modelValue:{type:String},syncProp:{type:String}},Bo={class:"x-test__slot"},Eo={class:"x-test__slot"},Dt=Vue.defineComponent({name:"XTest",__name:"Test",props:It,emits:["click","submit","change","update:modelValue","update:syncProp"],setup(o,{expose:e,emit:t}){const n=o,u=t,r=Vue.computed(()=>Object.entries(n)),s=Vue.computed({get(){return n.modelValue},set(m){u("update:modelValue",m)}}),a=Vue.computed({get(){return n.syncProp},set(m){u("update:syncProp",m)}}),l=Vue.ref("default inner data"),c=()=>{ElementPlus.ElMessage.info({message:"触发click事件"}),u("click",n)},i=()=>{ElementPlus.ElMessage.info({message:"触发submit事件"}),u("submit",n)},d=m=>{l.value=m,u("change",l.value)},V=()=>{d("user click change:"+Date.now())};return e({click:c,submit:i,data:l,change:d}),(m,f)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(Y),{class:"x-test",header:"VTJ 低代码测试组件",border:""},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElDivider),null,{default:Vue.withCtx(()=>[Vue.createTextVNode("内部数据")]),_:1}),Vue.createVNode(Vue.unref(N),null,{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(l.value),1)]),_:1}),Vue.createVNode(Vue.unref(ElementPlus.ElDivider),null,{default:Vue.withCtx(()=>[Vue.createTextVNode("属性")]),_:1}),Vue.createVNode(Vue.unref(ElementPlus.ElDescriptions),{column:3,border:""},{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(r.value,([g,b])=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDescriptionsItem),{label:g},{default:Vue.withCtx(()=>[Vue.createElementVNode("pre",null,Vue.toDisplayString(JSON.stringify(b,null,2)),1)]),_:2},1032,["label"]))),256))]),_:1}),Vue.createVNode(Vue.unref(ElementPlus.ElDivider),null,{default:Vue.withCtx(()=>[Vue.createTextVNode("插槽")]),_:1}),Vue.createVNode(Vue.unref(N),{justify:"space-around",flex:"",gap:""},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(Y),{header:"default",grow:"",card:""},{default:Vue.withCtx(()=>[Vue.createElementVNode("div",Bo,[Vue.renderSlot(m.$slots,"default",{props:n,data:l.value},()=>[Vue.createElementVNode("pre",null,Vue.toDisplayString(JSON.stringify({props:n,data:l.value},null,2)),1)])])]),_:3}),Vue.createVNode(Vue.unref(Y),{header:"extra",grow:"",card:""},{default:Vue.withCtx(()=>[Vue.createElementVNode("div",Eo,[Vue.renderSlot(m.$slots,"extra",{props:n,data:l.value},()=>[Vue.createElementVNode("pre",null,Vue.toDisplayString(JSON.stringify({props:n,data:l.value},null,2)),1)])])]),_:3})]),_:3}),Vue.createVNode(Vue.unref(ElementPlus.ElDivider),null,{default:Vue.withCtx(()=>[Vue.createTextVNode("双向绑定")]),_:1}),Vue.createVNode(Vue.unref(N),null,{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElDescriptions),{column:2,border:""},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElDescriptionsItem),{label:"modelValue"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElInput),{modelValue:s.value,"onUpdate:modelValue":f[0]||(f[0]=g=>s.value=g)},null,8,["modelValue"])]),_:1}),Vue.createVNode(Vue.unref(ElementPlus.ElDescriptionsItem),{label:"syncProp"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElInput),{modelValue:a.value,"onUpdate:modelValue":f[1]||(f[1]=g=>a.value=g)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),Vue.createVNode(Vue.unref(ElementPlus.ElDivider),null,{default:Vue.withCtx(()=>[Vue.createTextVNode("事件和方法")]),_:1}),Vue.createVNode(Vue.unref(N),null,{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElButton),{onClick:c},{default:Vue.withCtx(()=>[Vue.createTextVNode("click")]),_:1}),Vue.createVNode(Vue.unref(ElementPlus.ElButton),{onClick:i},{default:Vue.withCtx(()=>[Vue.createTextVNode("submit")]),_:1}),Vue.createVNode(Vue.unref(ElementPlus.ElButton),{onClick:V},{default:Vue.withCtx(()=>[Vue.createTextVNode("change")]),_:1})]),_:1})]),_:3}))}}),Mt={units:{type:[String,Object,Array]},unit:{type:String},appendWidth:{type:Number,default:100},withUnit:{type:Boolean,default:!0},format:{type:String},modelValue:{type:[String,Number]},selectProps:{type:Object}},$t=Vue.defineComponent({name:"XInputUnit",__name:"InputUnit",props:Mt,emits:["update:modelValue","update:unit","change","unit-change"],setup(o,{expose:e,emit:t}){const n=o,u=t,r=Vue.computed(()=>VtjUtils.toArray(n.units).map(g=>typeof g=="string"?{label:g,value:g}:g)),s=Vue.computed(()=>{const f=r.value.map(g=>g.value);return n.unit&&f.push(n.unit),VtjUtils.dedupArray(f)}),a=Vue.ref(),l=Vue.ref(),c=f=>n.format&&f?VtjUtils.numberFormat(Number(f)||0,n.format):f,i=f=>{if(!n.withUnit||typeof f!="string")return{value:c(f),unit:n.unit};for(const g of s.value){const b=new RegExp(`${g}$`);if(b.test(f))return{value:c(f.toString().replace(b,"")),unit:g}}return{value:c(f),unit:n.unit}},d=()=>{const f=c(l.value),g=a.value;return n.withUnit&&f&&g?`${f}${g}`:f};Vue.watch(()=>n.modelValue,f=>{const{value:g,unit:b}=i(f);a.value=b,l.value=g},{immediate:!0}),Vue.watch(l,f=>{u("change",f)});const V=async()=>{const{value:f,unit:g}=i(d());l.value=f,a.value=g,u("update:modelValue",d())},m=()=>{u("unit-change",a.value),V()};return e({parser:i,formatValue:c}),(f,g)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElInput),{modelValue:l.value,"onUpdate:modelValue":g[1]||(g[1]=b=>l.value=b),modelModifiers:{trim:!0},class:"x-input-unit",onChange:V},Vue.createSlots({_:2},[r.value.length?{name:"append",fn:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElSelect),Vue.mergeProps({class:"x-input-unit__unit",modelValue:a.value,"onUpdate:modelValue":g[0]||(g[0]=b=>a.value=b),size:f.$attrs.size,style:{width:`${n.appendWidth}px`}},f.$props.selectProps,{onChange:m}),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(r.value,b=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElOption),{key:b.value,label:b.label,value:b.value},null,8,["label","value"]))),128))]),_:1},16,["modelValue","size","style"])]),key:"0"}:{name:"suffix",fn:Vue.withCtx(()=>[a.value?(Vue.openBlock(),Vue.createElementBlock("div",{key:0,class:"x-input-unit__unit"},[Vue.createElementVNode("span",null,Vue.toDisplayString(a.value),1)])):Vue.createCommentVNode("",!0)]),key:"1"}]),1032,["modelValue"]))}}),At={image:{type:Function},maxLength:{type:Number,default:4},placeholder:{type:String,default:"请输入图形验证码"},validate:{type:Function}},xo=["src"],Rt=Vue.defineComponent({name:"XImageCodeInput",__name:"ImageCodeInput",props:At,setup(o){const e=o,t=Vue.useAttrs(),n=Vue.ref(),u=Vue.ref(),r=async()=>{typeof e.image=="function"&&(u.value=await e.image())};r();const s=Vue.ref(),a=Vue.computed(()=>{const V=t.size||"default",m={small:22,default:30,large:38};return s.value=m[V],console.log(s.value),{[`is-${V}`]:!!V}}),l=Vue.ref(""),c=Vue.ref(e.maxLength);let i;typeof e.validate=="function"&&(i=e.validate);const d=()=>{r(),l.value=""};return Vue.watch(l,async()=>{l.value.length===c.value?await i(l.value)?n.value="success":n.value="error":n.value=""},{immediate:!0}),(V,m)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElInput),{modelValue:l.value,"onUpdate:modelValue":m[0]||(m[0]=f=>l.value=f),class:"x-image-code-input",maxlength:c.value,placeholder:e.placeholder},{prepend:Vue.withCtx(()=>[Vue.createElementVNode("img",{class:Vue.normalizeClass(["x-image-code-input__image",a.value]),onClick:d,src:u.value},null,10,xo)]),suffix:Vue.withCtx(()=>[n.value==="success"?(Vue.openBlock(),Vue.createBlock(Vue.unref(A),{key:0,class:"x-image-code-input__iconSuccess",icon:Vue.unref(VtjIcons.SuccessFilled),size:s.value},null,8,["icon","size"])):Vue.createCommentVNode("",!0),n.value==="error"?(Vue.openBlock(),Vue.createBlock(Vue.unref(A),{key:1,class:"x-image-code-input__iconError",icon:Vue.unref(VtjIcons.CircleCloseFilled),size:s.value},null,8,["icon","size"])):Vue.createCommentVNode("",!0)]),_:1},8,["modelValue","maxlength","placeholder"]))}}),So=["image/png","image/jpeg","image/webp"],jt={margin:{type:Number},scale:{type:Number},width:{type:Number,default:200},color:{type:Object},darkColor:{type:String,default:"#000000ff"},lightColor:{type:String,default:"#ffffffff"},quality:{type:Number,default:.92},value:{type:[String,Function],default:""},timeout:{type:Number,default:0},tip:{type:String,default:"二维码已失效请刷新后重试"}};var oe={},No=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Ft={},$={};let Re;const Po=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];$.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},$.getSymbolTotalCodewords=function(e){return Po[e]},$.getBCHDigit=function(o){let e=0;for(;o!==0;)e++,o>>>=1;return e},$.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Re=e},$.isKanjiModeEnabled=function(){return typeof Re<"u"},$.toSJIS=function(e){return Re(e)};var pe={};(function(o){o.L={bit:1},o.M={bit:0},o.Q={bit:3},o.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return o.L;case"m":case"medium":return o.M;case"q":case"quartile":return o.Q;case"h":case"high":return o.H;default:throw new Error("Unknown EC Level: "+t)}}o.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},o.from=function(n,u){if(o.isValid(n))return n;try{return e(n)}catch{return u}}})(pe);function Lt(){this.buffer=[],this.length=0}Lt.prototype={get:function(o){const e=Math.floor(o/8);return(this.buffer[e]>>>7-o%8&1)===1},put:function(o,e){for(let t=0;t<e;t++)this.putBit((o>>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(o){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),o&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var zo=Lt;function ue(o){if(!o||o<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=o,this.data=new Uint8Array(o*o),this.reservedBit=new Uint8Array(o*o)}ue.prototype.set=function(o,e,t,n){const u=o*this.size+e;this.data[u]=t,n&&(this.reservedBit[u]=!0)},ue.prototype.get=function(o,e){return this.data[o*this.size+e]},ue.prototype.xor=function(o,e,t){this.data[o*this.size+e]^=t},ue.prototype.isReserved=function(o,e){return this.reservedBit[o*this.size+e]};var To=ue,Ut={};(function(o){const e=$.getSymbolSize;o.getRowColCoords=function(n){if(n===1)return[];const u=Math.floor(n/7)+2,r=e(n),s=r===145?26:Math.ceil((r-13)/(2*u-2))*2,a=[r-7];for(let l=1;l<u-1;l++)a[l]=a[l-1]-s;return a.push(6),a.reverse()},o.getPositions=function(n){const u=[],r=o.getRowColCoords(n),s=r.length;for(let a=0;a<s;a++)for(let l=0;l<s;l++)a===0&&l===0||a===0&&l===s-1||a===s-1&&l===0||u.push([r[a],r[l]]);return u}})(Ut);var Ht={};const Io=$.getSymbolSize,Ot=7;Ht.getPositions=function(e){const t=Io(e);return[[0,0],[t-Ot,0],[0,t-Ot]]};var Kt={};(function(o){o.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};o.isValid=function(u){return u!=null&&u!==""&&!isNaN(u)&&u>=0&&u<=7},o.from=function(u){return o.isValid(u)?parseInt(u,10):void 0},o.getPenaltyN1=function(u){const r=u.size;let s=0,a=0,l=0,c=null,i=null;for(let d=0;d<r;d++){a=l=0,c=i=null;for(let V=0;V<r;V++){let m=u.get(d,V);m===c?a++:(a>=5&&(s+=e.N1+(a-5)),c=m,a=1),m=u.get(V,d),m===i?l++:(l>=5&&(s+=e.N1+(l-5)),i=m,l=1)}a>=5&&(s+=e.N1+(a-5)),l>=5&&(s+=e.N1+(l-5))}return s},o.getPenaltyN2=function(u){const r=u.size;let s=0;for(let a=0;a<r-1;a++)for(let l=0;l<r-1;l++){const c=u.get(a,l)+u.get(a,l+1)+u.get(a+1,l)+u.get(a+1,l+1);(c===4||c===0)&&s++}return s*e.N2},o.getPenaltyN3=function(u){const r=u.size;let s=0,a=0,l=0;for(let c=0;c<r;c++){a=l=0;for(let i=0;i<r;i++)a=a<<1&2047|u.get(c,i),i>=10&&(a===1488||a===93)&&s++,l=l<<1&2047|u.get(i,c),i>=10&&(l===1488||l===93)&&s++}return s*e.N3},o.getPenaltyN4=function(u){let r=0;const s=u.data.length;for(let l=0;l<s;l++)r+=u.data[l];return Math.abs(Math.ceil(r*100/s/5)-10)*e.N4};function t(n,u,r){switch(n){case o.Patterns.PATTERN000:return(u+r)%2===0;case o.Patterns.PATTERN001:return u%2===0;case o.Patterns.PATTERN010:return r%3===0;case o.Patterns.PATTERN011:return(u+r)%3===0;case o.Patterns.PATTERN100:return(Math.floor(u/2)+Math.floor(r/3))%2===0;case o.Patterns.PATTERN101:return u*r%2+u*r%3===0;case o.Patterns.PATTERN110:return(u*r%2+u*r%3)%2===0;case o.Patterns.PATTERN111:return(u*r%3+(u+r)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}o.applyMask=function(u,r){const s=r.size;for(let a=0;a<s;a++)for(let l=0;l<s;l++)r.isReserved(l,a)||r.xor(l,a,t(u,l,a))},o.getBestMask=function(u,r){const s=Object.keys(o.Patterns).length;let a=0,l=1/0;for(let c=0;c<s;c++){r(c),o.applyMask(c,u);const i=o.getPenaltyN1(u)+o.getPenaltyN2(u)+o.getPenaltyN3(u)+o.getPenaltyN4(u);o.applyMask(c,u),i<l&&(l=i,a=c)}return a}})(Kt);var ge={};const O=pe,he=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],ve=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];ge.getBlocksCount=function(e,t){switch(t){case O.L:return he[(e-1)*4+0];case O.M:return he[(e-1)*4+1];case O.Q:return he[(e-1)*4+2];case O.H:return he[(e-1)*4+3];default:return}},ge.getTotalCodewordsCount=function(e,t){switch(t){case O.L:return ve[(e-1)*4+0];case O.M:return ve[(e-1)*4+1];case O.Q:return ve[(e-1)*4+2];case O.H:return ve[(e-1)*4+3];default:return}};var Xt={},ye={};const re=new Uint8Array(512),we=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)re[t]=e,we[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t++)re[t]=re[t-255]})(),ye.log=function(e){if(e<1)throw new Error("log("+e+")");return we[e]},ye.exp=function(e){return re[e]},ye.mul=function(e,t){return e===0||t===0?0:re[we[e]+we[t]]},function(o){const e=ye;o.mul=function(n,u){const r=new Uint8Array(n.length+u.length-1);for(let s=0;s<n.length;s++)for(let a=0;a<u.length;a++)r[s+a]^=e.mul(n[s],u[a]);return r},o.mod=function(n,u){let r=new Uint8Array(n);for(;r.length-u.length>=0;){const s=r[0];for(let l=0;l<u.length;l++)r[l]^=e.mul(u[l],s);let a=0;for(;a<r.length&&r[a]===0;)a++;r=r.slice(a)}return r},o.generateECPolynomial=function(n){let u=new Uint8Array([1]);for(let r=0;r<n;r++)u=o.mul(u,new Uint8Array([1,e.exp(r)]));return u}}(Xt);const Yt=Xt;function je(o){this.genPoly=void 0,this.degree=o,this.degree&&this.initialize(this.degree)}je.prototype.initialize=function(e){this.degree=e,this.genPoly=Yt.generateECPolynomial(this.degree)},je.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=Yt.mod(t,this.genPoly),u=this.degree-n.length;if(u>0){const r=new Uint8Array(this.degree);return r.set(n,u),r}return n};var Do=je,Gt={},K={},Fe={};Fe.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var F={};const Wt="[0-9]+",Mo="[A-Z $%*+\\-./:]+";let le="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";le=le.replace(/u/g,"\\u");const $o="(?:(?![A-Z0-9 $%*+\\-./:]|"+le+`)(?:.|[\r
|
|
8
8
|
]))+`;F.KANJI=new RegExp(le,"g"),F.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),F.BYTE=new RegExp($o,"g"),F.NUMERIC=new RegExp(Wt,"g"),F.ALPHANUMERIC=new RegExp(Mo,"g");const Ao=new RegExp("^"+le+"$"),Ro=new RegExp("^"+Wt+"$"),jo=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");F.testKanji=function(e){return Ao.test(e)},F.testNumeric=function(e){return Ro.test(e)},F.testAlphanumeric=function(e){return jo.test(e)},function(o){const e=Fe,t=F;o.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},o.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},o.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},o.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},o.MIXED={bit:-1},o.getCharCountIndicator=function(r,s){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?r.ccBits[0]:s<27?r.ccBits[1]:r.ccBits[2]},o.getBestModeForData=function(r){return t.testNumeric(r)?o.NUMERIC:t.testAlphanumeric(r)?o.ALPHANUMERIC:t.testKanji(r)?o.KANJI:o.BYTE},o.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},o.isValid=function(r){return r&&r.bit&&r.ccBits};function n(u){if(typeof u!="string")throw new Error("Param is not a string");switch(u.toLowerCase()){case"numeric":return o.NUMERIC;case"alphanumeric":return o.ALPHANUMERIC;case"kanji":return o.KANJI;case"byte":return o.BYTE;default:throw new Error("Unknown mode: "+u)}}o.from=function(r,s){if(o.isValid(r))return r;try{return n(r)}catch{return s}}}(K),function(o){const e=$,t=ge,n=pe,u=K,r=Fe,s=7973,a=e.getBCHDigit(s);function l(V,m,f){for(let g=1;g<=40;g++)if(m<=o.getCapacity(g,f,V))return g}function c(V,m){return u.getCharCountIndicator(V,m)+4}function i(V,m){let f=0;return V.forEach(function(g){const b=c(g.mode,m);f+=b+g.getBitsLength()}),f}function d(V,m){for(let f=1;f<=40;f++)if(i(V,f)<=o.getCapacity(f,m,u.MIXED))return f}o.from=function(m,f){return r.isValid(m)?parseInt(m,10):f},o.getCapacity=function(m,f,g){if(!r.isValid(m))throw new Error("Invalid QR Code version");typeof g>"u"&&(g=u.BYTE);const b=e.getSymbolTotalCodewords(m),w=t.getTotalCodewordsCount(m,f),C=(b-w)*8;if(g===u.MIXED)return C;const p=C-c(g,m);switch(g){case u.NUMERIC:return Math.floor(p/10*3);case u.ALPHANUMERIC:return Math.floor(p/11*2);case u.KANJI:return Math.floor(p/13);case u.BYTE:default:return Math.floor(p/8)}},o.getBestVersionForData=function(m,f){let g;const b=n.from(f,n.M);if(Array.isArray(m)){if(m.length>1)return d(m,b);if(m.length===0)return 1;g=m[0]}else g=m;return l(g.mode,g.getLength(),b)},o.getEncodedBits=function(m){if(!r.isValid(m)||m<7)throw new Error("Invalid QR Code version");let f=m<<12;for(;e.getBCHDigit(f)-a>=0;)f^=s<<e.getBCHDigit(f)-a;return m<<12|f}}(Gt);var Jt={};const Le=$,qt=1335,Fo=21522,Qt=Le.getBCHDigit(qt);Jt.getEncodedBits=function(e,t){const n=e.bit<<3|t;let u=n<<10;for(;Le.getBCHDigit(u)-Qt>=0;)u^=qt<<Le.getBCHDigit(u)-Qt;return(n<<10|u)^Fo};var Zt={};const Lo=K;function W(o){this.mode=Lo.NUMERIC,this.data=o.toString()}W.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},W.prototype.getLength=function(){return this.data.length},W.prototype.getBitsLength=function(){return W.getBitsLength(this.data.length)},W.prototype.write=function(e){let t,n,u;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),u=parseInt(n,10),e.put(u,10);const r=this.data.length-t;r>0&&(n=this.data.substr(t),u=parseInt(n,10),e.put(u,r*3+1))};var Uo=W;const Ho=K,Ue=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function J(o){this.mode=Ho.ALPHANUMERIC,this.data=o}J.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},J.prototype.getLength=function(){return this.data.length},J.prototype.getBitsLength=function(){return J.getBitsLength(this.data.length)},J.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=Ue.indexOf(this.data[t])*45;n+=Ue.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(Ue.indexOf(this.data[t]),6)};var Oo=J,Ko=function(e){for(var t=[],n=e.length,u=0;u<n;u++){var r=e.charCodeAt(u);if(r>=55296&&r<=56319&&n>u+1){var s=e.charCodeAt(u+1);s>=56320&&s<=57343&&(r=(r-55296)*1024+s-56320+65536,u+=1)}if(r<128){t.push(r);continue}if(r<2048){t.push(r>>6|192),t.push(r&63|128);continue}if(r<55296||r>=57344&&r<65536){t.push(r>>12|224),t.push(r>>6&63|128),t.push(r&63|128);continue}if(r>=65536&&r<=1114111){t.push(r>>18|240),t.push(r>>12&63|128),t.push(r>>6&63|128),t.push(r&63|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer};const Xo=Ko,Yo=K;function q(o){this.mode=Yo.BYTE,typeof o=="string"&&(o=Xo(o)),this.data=new Uint8Array(o)}q.getBitsLength=function(e){return e*8},q.prototype.getLength=function(){return this.data.length},q.prototype.getBitsLength=function(){return q.getBitsLength(this.data.length)},q.prototype.write=function(o){for(let e=0,t=this.data.length;e<t;e++)o.put(this.data[e],8)};var Go=q;const Wo=K,Jo=$;function Q(o){this.mode=Wo.KANJI,this.data=o}Q.getBitsLength=function(e){return e*13},Q.prototype.getLength=function(){return this.data.length},Q.prototype.getBitsLength=function(){return Q.getBitsLength(this.data.length)},Q.prototype.write=function(o){let e;for(e=0;e<this.data.length;e++){let t=Jo.toSJIS(this.data[e]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
|
|
9
9
|
Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),o.put(t,13)}};var qo=Q,en={exports:{}};(function(o){var e={single_source_shortest_paths:function(t,n,u){var r={},s={};s[n]=0;var a=e.PriorityQueue.make();a.push(n,0);for(var l,c,i,d,V,m,f,g,b;!a.empty();){l=a.pop(),c=l.value,d=l.cost,V=t[c]||{};for(i in V)V.hasOwnProperty(i)&&(m=V[i],f=d+m,g=s[i],b=typeof s[i]>"u",(b||g>f)&&(s[i]=f,a.push(i,f),r[i]=c))}if(typeof u<"u"&&typeof s[u]>"u"){var w=["Could not find a path from ",n," to ",u,"."].join("");throw new Error(w)}return r},extract_shortest_path_from_predecessor_list:function(t,n){for(var u=[],r=n;r;)u.push(r),t[r],r=t[r];return u.reverse(),u},find_path:function(t,n,u){var r=e.single_source_shortest_paths(t,n,u);return e.extract_shortest_path_from_predecessor_list(r,u)},PriorityQueue:{make:function(t){var n=e.PriorityQueue,u={},r;t=t||{};for(r in n)n.hasOwnProperty(r)&&(u[r]=n[r]);return u.queue=[],u.sorter=t.sorter||n.default_sorter,u},default_sorter:function(t,n){return t.cost-n.cost},push:function(t,n){var u={value:t,cost:n};this.queue.push(u),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};o.exports=e})(en);var Qo=en.exports;(function(o){const e=K,t=Uo,n=Oo,u=Go,r=qo,s=F,a=$,l=Qo;function c(w){return unescape(encodeURIComponent(w)).length}function i(w,C,p){const h=[];let y;for(;(y=w.exec(p))!==null;)h.push({data:y[0],index:y.index,mode:C,length:y[0].length});return h}function d(w){const C=i(s.NUMERIC,e.NUMERIC,w),p=i(s.ALPHANUMERIC,e.ALPHANUMERIC,w);let h,y;return a.isKanjiModeEnabled()?(h=i(s.BYTE,e.BYTE,w),y=i(s.KANJI,e.KANJI,w)):(h=i(s.BYTE_KANJI,e.BYTE,w),y=[]),C.concat(p,h,y).sort(function(v,P){return v.index-P.index}).map(function(v){return{data:v.data,mode:v.mode,length:v.length}})}function V(w,C){switch(C){case e.NUMERIC:return t.getBitsLength(w);case e.ALPHANUMERIC:return n.getBitsLength(w);case e.KANJI:return r.getBitsLength(w);case e.BYTE:return u.getBitsLength(w)}}function m(w){return w.reduce(function(C,p){const h=C.length-1>=0?C[C.length-1]:null;return h&&h.mode===p.mode?(C[C.length-1].data+=p.data,C):(C.push(p),C)},[])}function f(w){const C=[];for(let p=0;p<w.length;p++){const h=w[p];switch(h.mode){case e.NUMERIC:C.push([h,{data:h.data,mode:e.ALPHANUMERIC,length:h.length},{data:h.data,mode:e.BYTE,length:h.length}]);break;case e.ALPHANUMERIC:C.push([h,{data:h.data,mode:e.BYTE,length:h.length}]);break;case e.KANJI:C.push([h,{data:h.data,mode:e.BYTE,length:c(h.data)}]);break;case e.BYTE:C.push([{data:h.data,mode:e.BYTE,length:c(h.data)}])}}return C}function g(w,C){const p={},h={start:{}};let y=["start"];for(let x=0;x<w.length;x++){const v=w[x],P=[];for(let z=0;z<v.length;z++){const I=v[z],T=""+x+z;P.push(T),p[T]={node:I,lastCount:0},h[T]={};for(let M=0;M<y.length;M++){const B=y[M];p[B]&&p[B].node.mode===I.mode?(h[B][T]=V(p[B].lastCount+I.length,I.mode)-V(p[B].lastCount,I.mode),p[B].lastCount+=I.length):(p[B]&&(p[B].lastCount=I.length),h[B][T]=V(I.length,I.mode)+4+e.getCharCountIndicator(I.mode,C))}}y=P}for(let x=0;x<y.length;x++)h[y[x]].end=0;return{map:h,table:p}}function b(w,C){let p;const h=e.getBestModeForData(w);if(p=e.from(C,h),p!==e.BYTE&&p.bit<h.bit)throw new Error('"'+w+'" cannot be encoded with mode '+e.toString(p)+`.
|
|
10
10
|
Suggested mode is: `+e.toString(h));switch(p===e.KANJI&&!a.isKanjiModeEnabled()&&(p=e.BYTE),p){case e.NUMERIC:return new t(w);case e.ALPHANUMERIC:return new n(w);case e.KANJI:return new r(w);case e.BYTE:return new u(w)}}o.fromArray=function(C){return C.reduce(function(p,h){return typeof h=="string"?p.push(b(h,null)):h.data&&p.push(b(h.data,h.mode)),p},[])},o.fromString=function(C,p){const h=d(C,a.isKanjiModeEnabled()),y=f(h),x=g(y,p),v=l.find_path(x.map,"start","end"),P=[];for(let z=1;z<v.length-1;z++)P.push(x.table[v[z]].node);return o.fromArray(m(P))},o.rawSplit=function(C){return o.fromArray(d(C,a.isKanjiModeEnabled()))}})(Zt);const ke=$,He=pe,Zo=zo,e0=To,t0=Ut,n0=Ht,Oe=Kt,Ke=ge,o0=Do,Ce=Gt,u0=Jt,r0=K,Xe=Zt;function l0(o,e){const t=o.size,n=n0.getPositions(e);for(let u=0;u<n.length;u++){const r=n[u][0],s=n[u][1];for(let a=-1;a<=7;a++)if(!(r+a<=-1||t<=r+a))for(let l=-1;l<=7;l++)s+l<=-1||t<=s+l||(a>=0&&a<=6&&(l===0||l===6)||l>=0&&l<=6&&(a===0||a===6)||a>=2&&a<=4&&l>=2&&l<=4?o.set(r+a,s+l,!0,!0):o.set(r+a,s+l,!1,!0))}}function a0(o){const e=o.size;for(let t=8;t<e-8;t++){const n=t%2===0;o.set(t,6,n,!0),o.set(6,t,n,!0)}}function s0(o,e){const t=t0.getPositions(e);for(let n=0;n<t.length;n++){const u=t[n][0],r=t[n][1];for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s===-2||s===2||a===-2||a===2||s===0&&a===0?o.set(u+s,r+a,!0,!0):o.set(u+s,r+a,!1,!0)}}function i0(o,e){const t=o.size,n=Ce.getEncodedBits(e);let u,r,s;for(let a=0;a<18;a++)u=Math.floor(a/3),r=a%3+t-8-3,s=(n>>a&1)===1,o.set(u,r,s,!0),o.set(r,u,s,!0)}function Ye(o,e,t){const n=o.size,u=u0.getEncodedBits(e,t);let r,s;for(r=0;r<15;r++)s=(u>>r&1)===1,r<6?o.set(r,8,s,!0):r<8?o.set(r+1,8,s,!0):o.set(n-15+r,8,s,!0),r<8?o.set(8,n-r-1,s,!0):r<9?o.set(8,15-r-1+1,s,!0):o.set(8,15-r-1,s,!0);o.set(n-8,8,1,!0)}function c0(o,e){const t=o.size;let n=-1,u=t-1,r=7,s=0;for(let a=t-1;a>0;a-=2)for(a===6&&a--;;){for(let l=0;l<2;l++)if(!o.isReserved(u,a-l)){let c=!1;s<e.length&&(c=(e[s]>>>r&1)===1),o.set(u,a-l,c),r--,r===-1&&(s++,r=7)}if(u+=n,u<0||t<=u){u-=n,n=-n;break}}}function d0(o,e,t){const n=new Zo;t.forEach(function(l){n.put(l.mode.bit,4),n.put(l.getLength(),r0.getCharCountIndicator(l.mode,o)),l.write(n)});const u=ke.getSymbolTotalCodewords(o),r=Ke.getTotalCodewordsCount(o,e),s=(u-r)*8;for(n.getLengthInBits()+4<=s&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const a=(s-n.getLengthInBits())/8;for(let l=0;l<a;l++)n.put(l%2?17:236,8);return m0(n,o,e)}function m0(o,e,t){const n=ke.getSymbolTotalCodewords(e),u=Ke.getTotalCodewordsCount(e,t),r=n-u,s=Ke.getBlocksCount(e,t),a=n%s,l=s-a,c=Math.floor(n/s),i=Math.floor(r/s),d=i+1,V=c-i,m=new o0(V);let f=0;const g=new Array(s),b=new Array(s);let w=0;const C=new Uint8Array(o.buffer);for(let v=0;v<s;v++){const P=v<l?i:d;g[v]=C.slice(f,f+P),b[v]=m.encode(g[v]),f+=P,w=Math.max(w,P)}const p=new Uint8Array(n);let h=0,y,x;for(y=0;y<w;y++)for(x=0;x<s;x++)y<g[x].length&&(p[h++]=g[x][y]);for(y=0;y<V;y++)for(x=0;x<s;x++)p[h++]=b[x][y];return p}function f0(o,e,t,n){let u;if(Array.isArray(o))u=Xe.fromArray(o);else if(typeof o=="string"){let c=e;if(!c){const i=Xe.rawSplit(o);c=Ce.getBestVersionForData(i,t)}u=Xe.fromString(o,c||40)}else throw new Error("Invalid data");const r=Ce.getBestVersionForData(u,t);if(!r)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=r;else if(e<r)throw new Error(`
|