@a2simcode/ui 0.0.22 → 0.0.24

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.
@@ -1,4 +1,4 @@
1
- (function(N,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@iconify/vue"),require("dayjs"),require("crypto-js/aes"),require("crypto-js/enc-utf8"),require("crypto-js/pad-pkcs7"),require("crypto-js/enc-base64"),require("crypto-js/md5"),require("crypto-js/sha256"),require("crypto-js/sha512"),require("sortablejs"),require("@visactor/vtable"),require("echarts"),require("@bwip-js/browser"),require("countup.js"),require("sql-formatter"),require("codemirror"),require("@codemirror/view"),require("@codemirror/state"),require("@codemirror/lang-javascript"),require("@codemirror/lang-css"),require("@codemirror/lang-html"),require("@codemirror/lang-json"),require("@codemirror/lang-sql"),require("@codemirror/lang-xml"),require("@codemirror/lang-python"),require("@codemirror/lang-markdown"),require("@codemirror/lang-java"),require("@codemirror/autocomplete"),require("@codemirror/commands"),require("@codemirror/language"),require("async-validator"),require("@wangeditor/editor")):typeof define=="function"&&define.amd?define(["exports","vue","@iconify/vue","dayjs","crypto-js/aes","crypto-js/enc-utf8","crypto-js/pad-pkcs7","crypto-js/enc-base64","crypto-js/md5","crypto-js/sha256","crypto-js/sha512","sortablejs","@visactor/vtable","echarts","@bwip-js/browser","countup.js","sql-formatter","codemirror","@codemirror/view","@codemirror/state","@codemirror/lang-javascript","@codemirror/lang-css","@codemirror/lang-html","@codemirror/lang-json","@codemirror/lang-sql","@codemirror/lang-xml","@codemirror/lang-python","@codemirror/lang-markdown","@codemirror/lang-java","@codemirror/autocomplete","@codemirror/commands","@codemirror/language","async-validator","@wangeditor/editor"],e):(N=typeof globalThis<"u"?globalThis:N||self,e(N.SimCodeUI={},N.Vue,N.IconifyVue,N.dayjs,N.CryptoJS.AES,N.CryptoJS.enc.Utf8,N.CryptoJS.pad.Pkcs7,N.CryptoJS.enc.Base64,N.CryptoJS.MD5,N.CryptoJS.SHA256,N.CryptoJS.SHA512,N.Sortable,N.VTable,N.echarts,N.bwipjs,N.CountUp,N.SqlFormatter,N.CodeMirror,N.CodeMirrorView,N.CodeMirrorState,N.CodeMirrorLangJavaScript,N.CodeMirrorLangCSS,N.CodeMirrorLangHTML,N.CodeMirrorLangJSON,N.CodeMirrorLangSQL,N.CodeMirrorLangXML,N.CodeMirrorLangPython,N.CodeMirrorLangMarkdown,N.CodeMirrorLangJava,N.CodeMirrorAutocomplete,N.CodeMirrorCommands,N.CodeMirrorLanguage,N.AsyncValidator,N.WangEditor))})(this,(function(N,e,Le,jt,mn,Nt,pn,vt,hn,gn,yn,bn,Cn,kn,wn,Bn,Sn,Vn,Te,mt,Pe,xn,jn,Nn,vn,$n,En,Tn,zn,pt,ht,Oe,Mn,$t){"use strict";function Et(t){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(l,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return l.default=t,Object.freeze(l)}const gt=Et(Cn),Fn=Et(kn),K=t=>(t.install=l=>{l.component(t.name,t)},t);function nt(t){return t&&Array.isArray(t)}function Tt(t,l){return toString.call(t)===`[object ${l}]`}function Ln(t){return t!==null&&Tt(t,"Object")}const Me=t=>!!(t==null||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0||typeof t=="object"&&Object.keys(t).length===0),Ie=e.defineComponent({name:"JIcon",inheritAttrs:!1,__name:"icon",props:{icon:{},size:{default:16},color:{default:void 0},rotate:{default:void 0},isDiv:{type:Boolean,default:!0}},setup(t){const l=t,n=e.computed(()=>{const a=l.icon;if(a.indexOf(":")===-1)return Le.getIcon(`jcode:${l.icon}`)==null,`jcode:${l.icon}`;const r=`jcode:${a.split(":")[1]}`;return Le.getIcon(r)!=null?r:a}),o=e.computed(()=>({size:l.size,color:l.color,icon:n.value}));return(a,i)=>t.isDiv?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:0},a.$attrs,{class:"j-icon jicon",style:{height:`${t.size}px`}}),[e.createVNode(e.unref(Le.Icon),e.mergeProps(o.value,{height:`${t.size}px`,width:`${t.size}px`,mode:"svg",style:`transform:rotate(${t.rotate||0}deg)`}),null,16,["height","width","style"])],16)):(e.openBlock(),e.createElementBlock("span",e.mergeProps({key:1},a.$attrs,{class:"jicon"}),[e.createVNode(e.unref(Le.Icon),e.mergeProps(o.value,{height:`${t.size}px`,width:`${t.size}px`,mode:"svg",style:`transform:rotate(${t.rotate||0}deg)`}),null,16,["height","width","style"])],16))}}),Dn=["disabled"],In={key:2},zt=K(e.defineComponent({name:"JButton",__name:"button",props:{type:{type:String,default:"default"},size:{type:String,default:"default"},shape:{type:String,default:"default"},ghost:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},danger:{type:Boolean,default:!1},block:{type:Boolean,default:!1},loading:{type:[Boolean,Object],default:()=>!1},icon:{type:String,default:""},href:{type:String,default:""},target:{type:String,default:"_self"},label:{type:String,default:""},notLabel:{type:Boolean,default:!1},compact:Boolean,lastCompactItem:Boolean,firstCompactItem:Boolean},emits:["click"],setup(t,{expose:l,emit:n}){const o=t,a=n,i=m=>{!d.value&&!o.disabled&&(a("click",m),o.href&&window.open(o.href,o.target?o.target:"_self"))},r=e.shallowRef(null),c=()=>{r.value?.focus()},g=()=>{r.value?.blur()},u=e.computed(()=>o.notLabel||!o.label),d=e.ref(!1);e.watch(()=>o.loading,m=>{if(typeof m=="boolean")d.value=m;else if(Me(m?.delay))d.value=!1;else{const h=setTimeout(()=>{d.value=!0},m.delay);return()=>clearTimeout(h)}},{immediate:!0});const s=e.computed(()=>o.label||"");return l({focus:c,blur:g}),(m,h)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"buttonNodeRef",ref:r,type:"button",class:e.normalizeClass(["j-button",{"j-button-primary":t.type=="primary","j-button-default":t.type=="default","j-button-dashed":t.type=="dashed","j-button-link":t.type=="link","j-button-text":t.type=="text","j-button-ghost":t.ghost==!0,"j-button-danger":t.danger==!0,"j-button-lg":t.size=="large","j-button-sm":t.size=="small","j-button-circle":t.shape=="circle","j-button-round":t.shape=="round","j-button-block":t.block==!0,"j-button-loading":d.value==!0,"j-button-icon-only":u.value==!0,"j-button-compact":t.compact==!0,"j-button-last-compact-item":t.lastCompactItem==!0,"j-button-first-compact-item":t.firstCompactItem==!0}]),disabled:t.disabled,onClick:e.withModifiers(i,["stop"])},[d.value?(e.openBlock(),e.createBlock(Ie,{key:0,icon:"mdi:loading",size:t.size=="large"?14:12,class:"loading-spin j-button-loading-icon"},null,8,["size"])):e.createCommentVNode("",!0),t.icon?(e.openBlock(),e.createBlock(Ie,{key:1,icon:t.icon},null,8,["icon"])):e.createCommentVNode("",!0),t.notLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",In,e.toDisplayString(s.value),1)),e.renderSlot(m.$slots,"iconAfter")],10,Dn))}}));function Xe(t){Object.keys(t||{}).forEach(l=>{delete t[l]})}function Mt(t){const{toString:l}=Object.prototype,n={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"};return typeof Element<"u"&&t instanceof Element?"element":n[l.call(t)]}function De(t){const l=Mt(t);let n;if(l==="array")n=[];else if(l==="object")n={};else return t;if(l==="array")for(let o=0,a=t.length;o<a;o++)t[o]=(t[o]===0,t[o]),t[o]&&delete t[o].$parent,n.push(De(t[o]));else l==="object"&&Object.keys(t).forEach(o=>{t&&delete t.$parent,n[o]=De(t[o])});return n}function lt(t,l,n=[]){Object.keys(l).forEach(o=>{n.indexOf(o)===-1&&(t[o]=l[o])})}const Qe=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,l=>{const n=Math.random()*16|0;return(l==="x"?n:n&3|8).toString(16)});let yt=0;function at(t=""){const l=Date.now(),n=Math.floor(Math.random()*1e9);return yt++,t?t+"_"+n+yt+String(l):n+yt+String(l)}const bt=t=>{if(t)try{const l=new Function("return "+t)();return typeof l=="function"?{res:!0,msg:"ok",fn:l}:(console.warn("此方法不是一个函数",t),{res:!1,msg:"此方法不是一个函数"})}catch(l){return console.warn(l,t),{res:!1,msg:l}}else return{res:!1,msg:"没设置脚本函数"}};function Ft(t,l,n){if(!t||typeof t!="object")return t;const o=Array.isArray(l)?l:l.replace(/\[(\d+)\]/g,".$1").split(".").filter(Boolean);if(o.length===0)return t;let a=t;for(let i=0;i<o.length-1;i++){const r=o[i],c=o[i+1];(!(r in a)||typeof a[r]!="object"||a[r]===null)&&(a[r]=/^\d+$/.test(c)?[]:{}),a=a[r]}return a[o[o.length-1]]=n,t}const Ze=t=>{let l=parseFloat(t);return isNaN(l)?0:(l=Math.round(t*100)/100,l)},An=function(t,l,n){const o=(t-1)*l;return o+l>=n.length?n.slice(o,n.length):n.slice(o,o+l)},Pn=function(t,l){const n=(t.page-1)*t.rows,o=n+t.rows>=l.length?l.slice(n,l.length):l.slice(n,n+t.rows);return{rows:o,total:l.length,page:t.page,records:o.length}},On=function(t){return t.filter((l,n,o)=>o.indexOf(l,0)===n)},Lt=t=>{if(!/^\d*(\.\d*)?$/.test(t))return"Number is wrong!";const l=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],n=["","十","百","千","万","亿","点",""],o=(""+t).replace(/(^0*)/g,"").split(".");let a=0,i="";for(let r=o[0].length-1;r>=0;r--){switch(a){case 0:i=n[7]+i;break;case 4:new RegExp("0{4}\\d{"+(o[0].length-r-1)+"}$").test(o[0])||(i=n[4]+i);break;case 8:i=n[5]+i,n[7]=n[5],a=0;break}a%4===2&&o[0].charAt(r+2)!=="0"&&o[0].charAt(r+1)==="0"&&(i=l[0]+i),o[0].charAt(r)!=="0"&&(i=l[Number(o[0].charAt(r))]+n[a%4]+i),a++}if(o.length>1){i+=n[6];for(let r=0;r<o[1].length;r++)i+=l[Number(o[1].charAt(r))]}return i},Dt=t=>{const l=(t+"").split("."),n=l[0]+"",o=l[1]||"",a=n.length%3;let i=n.substring(0,a);for(let r=0;r<Math.floor(n.length/3);r++)i+=","+n.substring(a+r*3,a+(r+1)*3);return a===0&&(i=i.substring(1)),t=i+(o?"."+o:""),t},et=t=>{if(!t)return;if(typeof document>"u"||!document.body)return t.length*7;const l=document.createElement("span");l.style.fontSize="14px",l.style.visibility="hidden",l.style.position="absolute",l.innerText=t,document.body.appendChild(l);const n=l.offsetWidth;return document.body.removeChild(l),n};function It(t){return t==null||t===void 0||t===""?"":t===t.toUpperCase()?t.split("_").map(o=>(o=o.toLowerCase(),o.slice(0,1).toUpperCase()+o.slice(1))).join(""):t.slice(0,1).toUpperCase()+t.slice(1)}function Rn(t,l=!0){if(t==null||t===void 0||t==="")return"";l&&(t=It(t));let n="";for(let o=0,a=t.length;o<a&&(n+=t[o].toLowerCase(),!(o<a-1&&t[o+1]===t[o+1].toLowerCase()||o<a-2&&t[o+2]===t[o+2].toLowerCase()));o++);if(n.length<t.length)for(let o=n.length,a=t.length;o<a;o++)n+=t[o];return n}function At(t,l,n){const o={},a={};return t.forEach(i=>{o[i[n]]=o[i[n]]||[],o[i[n]].push(i),a[i[l]]=i}),{group:o,map:a}}function Ct(t,l,n,o,a,i){const r=[];return t==null?Object.keys(l.group).forEach(c=>{(!i||i.indexOf(c)===-1)&&(l.map[c]||l.group[c].forEach(u=>{(!i||i.indexOf(u[n])===-1)&&(o&&(u.value=u[o]),a&&(u.label=u[a]),l.group[u[n]]&&l.group[u[n]].length>0&&(u.children=Ct(l.group[u[n]],l,n,o,a,i)),r.push(u))}))}):t.forEach(c=>{(!i||i.indexOf(c[n])===-1)&&(o&&(c.value=c[o]),a&&(c.label=c[a]),l.group[c[n]]&&l.group[c[n]].length>0&&(c.children=Ct(l.group[c[n]],l,n,o,a,i)),r.push(c))}),r}function Jn(t,l,n,o,a,i){if(t.length===0||!l&&!t[0]._id)return t;const r=l||"_id";n=n||"_pid";let c=[],g={};if(o?t.forEach(d=>{g[d[o]]||(g[d[o]]=!0,c.push(De(d)))}):c=t,g={},r===n){const d=[];return c.forEach(s=>{(!i||i.indexOf(s[r])===-1)&&(o&&(s.value=s[o]),a&&(s.label=s[a]),d.push(s))}),d}const u=At(c,r,n);return Ct(null,u,r,o,a,i)}const Pt=(t,l,n,o)=>{n=n||[];for(let a=0,i=n.length;a<i;a++){const r=n[a],c={};c._id=r.prop||`${l}_${a}`,c._pid=l,Object.keys(r).forEach(u=>{(!o||o.indexOf(u)===-1)&&(c[u]=r[u])}),t.push(c);const g=r.children||[];g.length>0&&(c._hasChildren=!0,Pt(t,c._id,g))}},Ot=(t,l)=>{const n=[];return Pt(n,"0",t,l),n},Rt=(t,l,n,o)=>{l=l||[];for(let a=0,i=l.length;a<i;a++){const r=l[a],c={value:r[n],label:r[o]};t.push(c);const g=r.children||[];g.length>0&&(c.children=[],Rt(c.children,g,n,o))}},Un=(t,l,n)=>{const o=[];return Rt(o,t,l||"value",n||"label"),o},Jt=(t,l,n,o="",a)=>{l=l||[];for(let i=0,r=l.length;i<r;i++){const c=l[i],g=n(c),u=o?`${o}.${g}`:g,d=c.children||[];if(d.length>0)Jt(t,d,n,u,a);else{const s={};Object.keys(c).forEach(m=>{(!a||a.indexOf(m)===-1)&&(s[m]=c[m])}),s.label=u,t.push(s)}}},Ut=(t,l,n)=>{const o=[];return Jt(o,t,l,"",n),o},it=t=>["j-input","j-textarea","j-select","j-radio","j-checkbox","j-switch","j-number","j-slider-captcha","j-cascader-select","j-autocomplete","j-rate","j-slider"].includes(t)||t.indexOf("j-input")!=-1,Wt=t=>["j-input","j-textarea","j-select","j-radio","j-checkbox","j-switch","j-number","j-cascader-select","j-autocomplete","j-rate","j-slider"].includes(t)||t.indexOf("j-input")!=-1,Ae=t=>{const l=t.config||{};if(t.getCompConfig){const n=t.getCompConfig({config:l,formData:t.formData,row:t.row,tableData:t.tableData,pRowData:t.pRowData})||{};for(const o in l)n[o]=l[o];return n}return l},kt=t=>t.getCompType?t.getCompType({config:t.config,formData:t.formData,row:t.row,tableData:t.tableData}):t.type,Ht=(t,l,n)=>{const o=Ae(n),a=kt({...n,config:o});if(a==="j-autocomplete")return t;if(o&&o.options){if(t?.split){const i=t.split(","),r=Ot(o.options);return i.map(c=>r.find(g=>g.value===c)?.label).join(a==="j-cascader-select"?"/":",")}return o.options.find(i=>i.value===t)?.label}else if(l)return l(t,a,o);return t},Wn="YYYY-MM-DD HH:mm:ss",Hn="YYYY-MM-DD";function qt(t,l=Wn){return jt(t).format(l)}function tt(t,l=Hn){return jt(t).format(l)}function Yt(t){const l="j-loading-spin",n=document.querySelector(`.${l}`);if(t){if(!n){document.body.style.overflow="hidden";const o=new DocumentFragment,a=document.createElement("div");a.className=l;const i=document.createElement("span");i.className="j-loading-spin-dot";for(let r=0;r<4;r++){const c=document.createElement("i");i.appendChild(c)}a.appendChild(i),o.appendChild(a),document.body.appendChild(o)}}else n&&n.parentNode&&(document.body.style.overflow="",n.parentNode.removeChild(n))}const qn=(()=>{let t=null,l=0;return n=>{n?(l++,t&&clearTimeout(t),Yt(!0),t=null):(l=Math.max(0,l-1),l===0&&(t&&clearTimeout(t),t=setTimeout(()=>{Yt(!1),t=null},400)))}})();function Re(t){qn(t)}const{decrypt:_t,encrypt:Yn}=mn,st=Nt,Kt=Nt.parse,Gt=(t,l=32)=>{const{length:n}=t;if(n<l){for(let o=0,a=l-n;o<a;o++)t+="0";return t}return n>l?t.substring(0,l):t};class _n{key;iv;constructor({key:l,iv:n}){this.key=Kt(Gt(l)),this.iv=Kt(Gt(n||"1234567890000000",16))}get getOptions(){return{padding:pn,iv:this.iv}}encrypt(l){return Yn(l,this.key,this.getOptions).toString()}decrypt(l){return _t(l,this.key,this.getOptions).toString(st)}}class Je{static instance;constructor(){}static getInstance(){return Je.instance||(Je.instance=new Je),Je.instance}encrypt(l){return st.parse(l).toString(vt)}decrypt(l){return vt.parse(l).toString(st)}}class Ue{static instance;constructor(){}static getInstance(){return Ue.instance||(Ue.instance=new Ue),Ue.instance}hash(l){return hn(l).toString()}}class We{static instance;constructor(){}static getInstance(){return We.instance||(We.instance=new We),We.instance}hash(l){return gn(l).toString()}}class He{static instance;constructor(){}static getInstance(){return He.instance||(He.instance=new He),He.instance}hash(l){return yn(l).toString()}}class Xt{static createAesEncryption(l){return new _n(l)}static createBase64Encryption(){return Je.getInstance()}}class Kn{static createMD5Hashing(){return Ue.getInstance()}static createSHA256Hashing(){return We.getInstance()}static createSHA512Hashing(){return He.getInstance()}}const Gn=(t,l)=>_t(t,l).toString(st);function Qt(t,l){function n(){e.nextTick(()=>{t=e.unref(t),t&&bn.create(t,{animation:100,delay:400,delayOnTouchOnly:!0,...l})})}return{initSortable:n}}const Zt=async t=>new Promise((l,n)=>{if(typeof window.BMap<"u"){l(window.BMap);return}window.onBMapCallback=function(){l(window.BMap)};const o=document.createElement("script");o.type="text/javascript",o.src=`https://api.map.baidu.com/api?v=3.0&ak=${t||"dPHQKHyFl1GmMBjGVbVCSs6GSrswTuPQ"}&callback=onBMapCallback`,o.onerror=n,document.head.appendChild(o)});function Xn(t){const l=o=>{t.value.open(o)};return{handleClick:o=>{if(!o.disabled){if(o.layerName){o.layerGetParam&&(o.layerParam=o.layerGetParam()),l({title:o.layerTitle,name:o.layerName,width:o.layerWidth||1e3,height:o.layerHeight||600,afterOk:o.afterOk||null,afterClose:o.afterClose||null,formConfig:o.layerFormConfig||{},param:o.layerParam||{},type:o.layerType,hasBtns:o.layerHasBtns});return}o.click&&o.click({handleOpenForm:l})}}}}const eo=K(e.defineComponent({name:"JButtons",__name:"index",props:{list:{type:Array,default:()=>[]},group:{type:Object,default:()=>({})},isLink:Boolean,size:{type:String,default:"default"},readonly:Boolean},setup(t){const l=t,n=e.computed(()=>{if(Object.keys(l.group).length>0)return l.group;const i={},r=De(l.list),c=r.length;for(let g=0;g<c;g++){const u=r[g];u.groupId=u.groupId||at(),i[u.groupId]=i[u.groupId]||[],i[u.groupId].push(u)}return i}),o=e.ref(),{handleClick:a}=Xn(o);return(i,r)=>{const c=e.resolveComponent("j-button"),g=e.resolveComponent("el-space"),u=e.resolveComponent("el-dropdown"),d=e.resolveComponent("j-dynamic-layer");return e.openBlock(),e.createBlock(g,{style:e.normalizeStyle({display:t.readonly?"none":""}),size:t.isLink?0:8},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(s,m)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:m},{ref_for:!0},i.$attrs),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s,(h,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f},[h.children?.length&&h.children?.length>0?(e.openBlock(),e.createBlock(u,{key:0},{dropdown:e.withCtx(()=>[e.createVNode(g,{direction:"vertical"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.children||[],p=>(e.openBlock(),e.createBlock(c,{key:p.prop,label:p.label,type:"text",danger:p.danger,size:t.size,disabled:p.disabled,icon:p.icon,onClick:e.withModifiers(C=>e.unref(a)(p),["stop"])},null,8,["label","danger","size","disabled","icon","onClick"]))),128))]),_:2},1024)]),default:e.withCtx(()=>[e.createVNode(c,{label:h.label,type:t.isLink?"link":h.type,danger:h.danger,size:t.size,icon:h.icon,onClick:e.withModifiers(p=>e.unref(a)(h),["stop"])},null,8,["label","type","danger","size","icon","onClick"])]),_:2},1024)):(e.openBlock(),e.createBlock(c,{key:1,label:h.label,type:t.isLink?"link":h.type,danger:h.danger,size:t.size,icon:h.icon,compact:!0,"last-compact-item":f===s.length-1,"first-compact-item":f===0,onClick:e.withModifiers(p=>e.unref(a)(h),["stop"])},null,8,["label","type","danger","size","icon","last-compact-item","first-compact-item","onClick"]))],64))),128))],16))),128)),e.createVNode(d,{ref_key:"layerRef",ref:o},null,512)]),_:1},8,["style","size"])}}})),to=K(e.defineComponent({name:"JInput",__name:"input",props:{modelValue:{default:""},type:{default:"text"},modelModifiers:{},maxlength:{},minlength:{},showWordLimit:{type:Boolean,default:!1},wordLimitPosition:{default:"inside"},placeholder:{default:""},clearable:{type:Boolean,default:!1},clearIcon:{},formatter:{},parser:{},showPassword:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{default:"default"},prefixIcon:{},suffixIcon:{},rows:{default:2},autosize:{type:[Boolean,Object],default:!1},autocomplete:{default:"off"},name:{},readonly:{type:Boolean,default:!1},max:{},min:{},step:{},resize:{},autofocus:{type:Boolean,default:!1},form:{},ariaLabel:{},tabindex:{},validateEvent:{type:Boolean,default:!0},inputStyle:{default:()=>({})},label:{},inputmode:{},autoFocus:{type:Boolean}},emits:["update:modelValue","input","focus","blur","clear","change"],setup(t,{emit:l}){const n=t,o=l,a=e.ref(),i=e.computed({get(){return n.modelValue},set(s){o("update:modelValue",s)}}),r=s=>{o("input",s)},c=s=>{o("focus",s)},g=s=>{o("blur",s)},u=()=>{o("clear")},d=s=>{o("change",s)};return e.onMounted(()=>{n.autoFocus&&a.value.focus()}),(s,m)=>{const h=e.resolveComponent("j-icon"),f=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(f,e.mergeProps({ref_key:"inputRef",ref:a,modelValue:i.value,"onUpdate:modelValue":m[0]||(m[0]=p=>i.value=p),type:t.type,"model-modifiers":t.modelModifiers,maxlength:t.maxlength,minlength:t.minlength,"show-word-limit":t.showWordLimit,"word-limit-position":t.wordLimitPosition,placeholder:t.placeholder,clearable:t.clearable,"clear-icon":t.clearIcon,formatter:t.formatter,parser:t.parser,"show-password":t.showPassword,disabled:t.disabled,size:t.size,rows:t.rows,autosize:t.autosize,autocomplete:t.autocomplete,name:t.name,readonly:t.readonly,max:t.max,min:t.min,step:t.step,resize:t.resize,autofocus:t.autofocus,form:t.form,"aria-label":t.ariaLabel,tabindex:t.tabindex,"validate-event":t.validateEvent,"input-style":t.inputStyle,label:t.label,inputmode:t.inputmode},s.$attrs,{onInput:r,onFocus:c,onBlur:g,onClear:u,onChange:d}),e.createSlots({_:2},[t.prefixIcon?{name:"prefix",fn:e.withCtx(()=>[e.createVNode(h,{icon:t.prefixIcon},null,8,["icon"])]),key:"0"}:void 0,t.suffixIcon?{name:"suffix",fn:e.withCtx(()=>[e.createVNode(h,{icon:t.suffixIcon},null,8,["icon"])]),key:"1"}:void 0]),1040,["modelValue","type","model-modifiers","maxlength","minlength","show-word-limit","word-limit-position","placeholder","clearable","clear-icon","formatter","parser","show-password","disabled","size","rows","autosize","autocomplete","name","readonly","max","min","step","resize","autofocus","form","aria-label","tabindex","validate-event","input-style","label","inputmode"])}}})),oo=K(Ie),Qn={key:1},no=K(e.defineComponent({name:"JRadio",__name:"radio",props:{modelValue:{type:[String],default:void 0},options:{type:Array,default:()=>[]},size:{type:String,default:"default"},isButton:{type:Boolean,default:!1},isColor:{type:Boolean,default:!1},colors:{type:Array,default:()=>[]},readonly:Boolean},emits:["update:modelValue"],setup(t,{emit:l}){const n=t,o=l,a=e.computed({get(){let i=n.options;if(!Me(n.modelValue)&&i&&i.length>0){let r=n.modelValue+"",c=n.options.find(g=>g.value+""===r);if(c)return c.value}return n.modelValue},set(i){o("update:modelValue",i)}});return(i,r)=>{const c=e.resolveComponent("el-radio-button"),g=e.resolveComponent("el-tag"),u=e.resolveComponent("el-radio"),d=e.resolveComponent("el-radio-group");return e.openBlock(),e.createBlock(d,{modelValue:a.value,"onUpdate:modelValue":r[0]||(r[0]=s=>a.value=s),disabled:t.readonly},{default:e.withCtx(()=>[t.isButton?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,s=>(e.openBlock(),e.createBlock(c,{key:s.value,value:s.value,size:t.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.label),1)]),_:2},1032,["value","size"]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.options,(s,m)=>(e.openBlock(),e.createBlock(u,{key:s.value,value:s.value,size:t.size},{default:e.withCtx(()=>[t.isColor?(e.openBlock(),e.createBlock(g,{key:0,color:t.colors[m]||s.color||"",size:t.size,hit:!1,effect:"dark",style:{"border-width":"0"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.label),1)]),_:2},1032,["color","size"])):(e.openBlock(),e.createElementBlock("span",Qn,e.toDisplayString(s.label),1))]),_:2},1032,["value","size"]))),128))]),_:1},8,["modelValue","disabled"])}}})),Zn={class:"j-select-input-label-wrapper"},el={class:"j-select-option-wrapper"},tl={class:"j-select-option-wrapper"},lo=K(e.defineComponent({name:"JSelect",inheritAttrs:!1,__name:"select",props:{modelValue:{},options:{default:()=>[]},size:{default:"default"},placeholder:{default:"请选择"},teleported:{type:Boolean,default:!0},noBorder:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},isShowTooltip:{type:Boolean,default:!1},isSelectOnlyone:{type:Boolean,default:!1},selectData:{default:""},clearable:{type:Boolean,default:!1},isRows:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},collapseTagsTooltip:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},isGroup:{type:Boolean,default:!1},groupKey:{default:""},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,a=e.ref(),i=e.computed({get(){return n.multiple&&typeof n.modelValue=="string"?n.modelValue?.split(",")||[]:n.modelValue},set(s){n.multiple&&Array.isArray(s)&&(s=s?.join(",")||[]),o("update:modelValue",s)}}),r=e.computed(()=>!Me(i.value)&&!n.multiple&&n.options.filter(s=>i.value==s.value).map(s=>s.label).join(",")||""),c=e.computed(()=>!Me(i.value)&&!n.multiple?n.options.find(s=>s.value===i.value)?.icon:""),g=e.computed(()=>typeof n.selectData=="string"?n.selectData?.split(",")||[]:[]),u=e.computed(()=>{let s=[];if(n.isSelectOnlyone?s=n.options.map(m=>({...m,disabled:g.value.includes(m.value)})):s=n.options,n.isGroup){const m=[],h={};return s.forEach(f=>{let p={};const C=f[n.groupKey||""]||"";h[C]||(p.value=C,p.label=C,h[C]=[],p.children=h[C],m.push(p));const k={value:f.value,label:f.label,icon:f.icon,disabled:f.disabled};h[C].push(k)}),m}return s}),d=s=>{if(n.multiple){if(s.length==0){o("change",void 0);return}const m=[];s.forEach(h=>{const f=n.options.find(p=>p.value==h);f&&m.push(f)}),o("change",m)}else{if(s==""||s==null||s==null){o("change",void 0);return}const m=n.options.find(h=>h.value==s);o("change",m)}};return e.onMounted(()=>{n.autoFocus&&setTimeout(()=>{a.value.toggleMenu()},50)}),(s,m)=>{const h=e.resolveComponent("el-tooltip"),f=e.resolveComponent("el-option"),p=e.resolveComponent("el-option-group"),C=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(C,e.mergeProps({ref_key:"selectRef",ref:a},s.$attrs,{modelValue:i.value,"onUpdate:modelValue":m[0]||(m[0]=k=>i.value=k),class:[{"no-border":t.noBorder,"rows-background":t.isRows}],teleported:t.teleported,size:t.size,disabled:t.disabled||t.readonly,multiple:t.multiple,clearable:t.clearable,filterable:t.filterable,"collapse-tags":t.collapseTags,"collapse-tags-tooltip":t.collapseTagsTooltip,placeholder:t.placeholder,onChange:d}),e.createSlots({default:e.withCtx(()=>[t.isGroup?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(u.value,k=>(e.openBlock(),e.createBlock(p,{key:k.label,label:k.label},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.children,b=>(e.openBlock(),e.createBlock(f,{key:b.value,label:b.label,value:b.value||" ",disabled:!!b.disabled},{default:e.withCtx(()=>[e.createElementVNode("div",el,[b.icon?(e.openBlock(),e.createBlock(Ie,{key:0,class:"j-select-option-icon",icon:b.icon},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(b.label),1)])]),_:2},1032,["label","value","disabled"]))),128))]),_:2},1032,["label"]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(u.value,k=>(e.openBlock(),e.createBlock(f,{key:k.value,label:k.label,value:k.value+"",disabled:!!k.disabled},{default:e.withCtx(()=>[e.createElementVNode("div",tl,[k.icon?(e.openBlock(),e.createBlock(Ie,{key:0,class:"j-select-option-icon",icon:k.icon},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(k.label),1)])]),_:2},1032,["label","value","disabled"]))),128))]),_:2},[t.multiple?void 0:{name:"label",fn:e.withCtx(()=>[e.createElementVNode("div",Zn,[c.value?(e.openBlock(),e.createBlock(Ie,{key:0,class:"j-select-option-icon",icon:c.value},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[t.isShowTooltip?(e.openBlock(),e.createBlock(h,{key:0,content:r.value,placement:"top"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1},8,["content"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(r.value),1)],64))])])]),key:"0"}]),1040,["modelValue","class","teleported","size","disabled","multiple","clearable","filterable","collapse-tags","collapse-tags-tooltip","placeholder"])}}})),ao=K(e.defineComponent({name:"JCascaderSelect",__name:"cascader-select",props:{modelValue:{},options:{default:()=>[]},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"default"},separator:{default:"/"},showAllLevels:{type:Boolean,default:!0},checkStrictly:{type:Boolean,default:!1},expandTrigger:{default:"click"},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!1},maxCollapseTags:{default:1},collapseTagsTooltip:{type:Boolean},filterable:{type:[Boolean,Object],default:!1},multiple:{type:Boolean,default:!1},emitPath:{type:Boolean,default:!0},lazy:{type:Boolean,default:!1},lazyLoad:{type:Function,default:()=>Function},hoverThreshold:{default:500},checkOnClickNode:{type:Boolean,default:!1},checkOnClickLeaf:{type:Boolean,default:!0},showPrefix:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{expose:l,emit:n}){const o=t,a=e.ref(null),i=n;l({getCheckedNodes:(s=!1)=>a.value?.getCheckedNodes(s),clearCheckedNodes:()=>{a.value?.cascaderPanelRef?.value?.clearCheckedNodes()}});const g=e.computed({get(){return Me(o.modelValue)?[]:o.modelValue?.split(",")||[]},set(s){i("update:modelValue",Me(s)?"":s.join(","))}}),u=(s,m)=>{g.value=s,i("change",{value:Me(s)?"":s.join(","),data:m})},d=e.computed(()=>({checkStrictly:o.checkStrictly,expandTrigger:o.expandTrigger,multiple:o.multiple,emitPath:o.emitPath,lazy:o.lazy,lazyLoad:o.lazyLoad,hoverThreshold:o.hoverThreshold,checkOnClickNode:o.checkOnClickNode,checkOnClickLeaf:o.checkOnClickLeaf,showPrefix:o.showPrefix,value:"value",label:"label",children:"children",disabled:"disabled",leaf:"leaf"}));return e.onMounted(()=>{o.autoFocus&&setTimeout(()=>{a.value.togglePopperVisible()},50)}),(s,m)=>{const h=e.resolveComponent("el-cascader");return e.openBlock(),e.createBlock(h,{ref_key:"cascaderRef",ref:a,modelValue:g.value,"onUpdate:modelValue":m[0]||(m[0]=f=>g.value=f),props:d.value,options:t.options,placeholder:t.placeholder,disabled:t.disabled||t.readonly,clearable:t.clearable,"collapse-tags":t.collapseTags,"max-collapse-tags":t.maxCollapseTags,"collapse-tags-tooltip":t.collapseTagsTooltip,filterable:t.filterable,"show-all-levels":t.showAllLevels,separator:t.separator,size:t.size,onChange:u},null,8,["modelValue","props","options","placeholder","disabled","clearable","collapse-tags","max-collapse-tags","collapse-tags-tooltip","filterable","show-all-levels","separator","size"])}}})),io=K(e.defineComponent({name:"JCheckbox",__name:"checkbox",props:{modelValue:{default:()=>[]},options:{default:()=>[]},size:{default:"default"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},min:{default:void 0},max:{default:void 0},textColor:{default:"var(--j-color-primary)"},fill:{default:"var(--j-color-bg-container)"},tag:{default:"div"},validateEvent:{type:Boolean,default:!0},label:{default:void 0},type:{default:"checkbox"}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,a=e.computed({get(){return n.modelValue},set(r){o("update:modelValue",r)}}),i=r=>{o("change",r)};return(r,c)=>{const g=e.resolveComponent("el-checkbox"),u=e.resolveComponent("el-checkbox-button"),d=e.resolveComponent("el-checkbox-group");return e.openBlock(),e.createBlock(d,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=s=>a.value=s),disabled:t.disabled||t.readonly,size:t.size,min:t.min,max:t.max,"text-color":t.textColor,fill:t.fill,tag:t.tag,"validate-event":t.validateEvent,label:t.label,type:t.type,onChange:i},{default:e.withCtx(()=>[t.type==="checkbox"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.options,s=>(e.openBlock(),e.createBlock(g,{key:s.value,value:s.value,disabled:s.disabled,size:t.size,label:s.label},null,8,["value","disabled","size","label"]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.options,s=>(e.openBlock(),e.createBlock(u,{key:s.value,class:e.normalizeClass({"j-checkbox-notFillOrColor":!t.fill&&!t.textColor}),value:s.value,disabled:s.disabled,size:t.size,label:s.label},null,8,["class","value","disabled","size","label"]))),128))]),_:1},8,["modelValue","disabled","size","min","max","text-color","fill","tag","validate-event","label","type"])}}})),so=K(e.defineComponent({name:"JNumber",__name:"number",props:{modelValue:{},min:{},max:{},step:{default:1},stepStrictly:{type:Boolean,default:!1},precision:{},size:{default:"default"},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},controls:{type:Boolean,default:!1},controlsPosition:{default:"right"},ariaLabel:{},placeholder:{default:"请输入数字"},id:{},valueOnClear:{},label:{},inputmode:{},align:{default:"left"},disabledScientific:{type:Boolean,default:!1},prefix:{},suffix:{},decreaseIcon:{},increaseIcon:{},autoFocus:{type:Boolean}},emits:["update:modelValue","change","blur","focus"],setup(t,{expose:l,emit:n}){const o=t,a=e.ref(),i=n,r=e.computed({get(){return o.modelValue},set(m){i("update:modelValue",m)}}),c=m=>{i("change",m)},g=()=>{i("blur")},u=()=>{i("focus")};return l({blur:()=>{a.value?.blur()},focus:()=>{a.value?.focus()}}),e.onMounted(()=>{o.autoFocus&&a.value?.focus()}),(m,h)=>{const f=e.resolveComponent("j-icon"),p=e.resolveComponent("el-input-number");return e.openBlock(),e.createBlock(p,{id:t.id,ref_key:"inputNumberRef",ref:a,modelValue:r.value,"onUpdate:modelValue":h[0]||(h[0]=C=>r.value=C),min:t.min,max:t.max,step:t.step,"step-strictly":t.stepStrictly,precision:t.precision,size:t.size,readonly:t.readonly||t.disabled,disabled:t.disabled||t.readonly,controls:t.controls,"controls-position":t.controlsPosition,"aria-label":t.ariaLabel,placeholder:t.placeholder,"value-on-clear":t.valueOnClear,label:t.label,inputmode:t.inputmode,align:t.align,"disabled-scientific":t.disabledScientific,onChange:c,onBlur:g,onFocus:u},e.createSlots({"decrease-icon":e.withCtx(()=>[t.decreaseIcon?(e.openBlock(),e.createBlock(f,{key:0,icon:t.decreaseIcon},null,8,["icon"])):e.createCommentVNode("",!0)]),"increase-icon":e.withCtx(()=>[t.increaseIcon?(e.openBlock(),e.createBlock(f,{key:0,icon:t.increaseIcon},null,8,["icon"])):e.createCommentVNode("",!0)]),_:2},[t.prefix?{name:"prefix",fn:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.prefix),1)]),key:"0"}:void 0,t.suffix?{name:"suffix",fn:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.suffix),1)]),key:"1"}:void 0]),1032,["id","modelValue","min","max","step","step-strictly","precision","size","readonly","disabled","controls","controls-position","aria-label","placeholder","value-on-clear","label","inputmode","align","disabled-scientific"])}}})),ro=K(e.defineComponent({name:"JAutocomplete",__name:"autocomplete",props:{modelValue:{},placeholder:{default:"请输入内容"},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},valueKey:{default:"value"},debounce:{default:300},placement:{default:"bottom-start"},options:{default:()=>[]},fetchSuggestions:{},triggerOnFocus:{type:Boolean,default:!0},selectWhenUnmatched:{type:Boolean,default:!1},ariaLabel:{},hideLoading:{type:Boolean,default:!1},popperClass:{},popperStyle:{},teleported:{type:Boolean,default:!0},appendTo:{},highlightFirstItem:{type:Boolean,default:!1},fitInputWidth:{type:Boolean,default:!1},loopNavigation:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","select","change","focus","blur"],setup(t,{expose:l,emit:n}){const o=t,a=e.ref(null),i=n,r=e.computed({get(){return o.modelValue||""},set(p){i("update:modelValue",p)}}),c=(p,C)=>{if(o.fetchSuggestions){o.fetchSuggestions(p,C);return}const k=p?o.options.filter(g(p)):o.options;C(k)},g=p=>C=>C?.[o.valueKey]?.toLowerCase().indexOf(p.toLowerCase())===0,u=p=>{i("select",p)},d=p=>{i("change",p)},s=()=>{i("focus")},m=()=>{i("blur")};return l({focus:()=>{a.value?.focus()},blur:()=>{a.value?.blur()}}),e.onMounted(()=>{o.autoFocus&&setTimeout(()=>{a.value.focus()},50)}),(p,C)=>{const k=e.resolveComponent("el-autocomplete");return e.openBlock(),e.createBlock(k,{ref_key:"autocompleteRef",ref:a,modelValue:r.value,"onUpdate:modelValue":C[0]||(C[0]=b=>r.value=b),"fetch-suggestions":c,placeholder:t.placeholder,clearable:t.clearable,disabled:t.disabled||t.readonly,"value-key":t.valueKey,debounce:t.debounce,placement:t.placement,"trigger-on-focus":t.triggerOnFocus,"select-when-unmatched":t.selectWhenUnmatched,"aria-label":t.ariaLabel,"hide-loading":t.hideLoading,"popper-class":t.popperClass,"popper-style":t.popperStyle,teleported:t.teleported,"append-to":t.appendTo,"highlight-first-item":t.highlightFirstItem,"fit-input-width":t.fitInputWidth,"loop-navigation":t.loopNavigation,onSelect:u,onChange:d,onFocus:s,onBlur:m},e.createSlots({default:e.withCtx(({item:b})=>[e.renderSlot(p.$slots,"default",{item:b},()=>[e.createElementVNode("div",null,e.toDisplayString(b[t.valueKey]||""),1)])]),_:2},[p.$slots.prefix?{name:"prefix",fn:e.withCtx(()=>[e.renderSlot(p.$slots,"prefix")]),key:"0"}:void 0,p.$slots.suffix?{name:"suffix",fn:e.withCtx(()=>[e.renderSlot(p.$slots,"suffix")]),key:"1"}:void 0,p.$slots.header?{name:"header",fn:e.withCtx(()=>[e.renderSlot(p.$slots,"header")]),key:"2"}:void 0,p.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(p.$slots,"footer")]),key:"3"}:void 0,p.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(p.$slots,"prepend")]),key:"4"}:void 0,p.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(p.$slots,"append")]),key:"5"}:void 0,p.$slots.loading?{name:"loading",fn:e.withCtx(()=>[e.renderSlot(p.$slots,"loading")]),key:"6"}:void 0]),1032,["modelValue","placeholder","clearable","disabled","value-key","debounce","placement","trigger-on-focus","select-when-unmatched","aria-label","hide-loading","popper-class","popper-style","teleported","append-to","highlight-first-item","fit-input-width","loop-navigation"])}}})),ol={class:"j-block"},nl={key:1,class:"j-layout--container"},ll={class:"j-block"},al={class:"j-block"},il={class:"j-block"},co=K(e.defineComponent({name:"JLayout",__name:"layout",props:{left:{type:[Number,String],default:240},right:{type:[Number,String],default:240},top:{type:[Number,String],default:60},bottom:{type:[Number,String],default:60},leftMove:{type:Boolean,default:!0},rightMove:{type:Boolean,default:!0},topMove:{type:Boolean,default:!0},bottomMove:{type:Boolean,default:!0},notHidden:{type:Boolean,default:!1},midMinWidth:{type:Number,default:0},midMinHeight:{type:Number,default:0},hideMidWhenNarrow:{type:Boolean,default:!1}},setup(t){const l=t,n=e.useSlots(),o=e.ref(),a=e.ref(),i=e.ref(-1),r=e.ref(-1),c=e.ref(-1),g=e.ref(-1),u=e.ref(0),d=e.ref(!1),s=e.reactive({type:"",isMove:!1,pageX:0,pageY:0,size:0,h:0,w:0}),m=e.computed({get(){return i.value!==-1?i.value:l.left},set(D){i.value=D}}),h=e.computed({get(){return r.value!==-1?r.value:l.right},set(D){r.value=D}}),f=e.computed({get(){return c.value!==-1?c.value:l.top},set(D){c.value=D}}),p=e.computed({get(){return g.value!==-1?g.value:l.bottom},set(D){g.value=D}}),C=e.computed(()=>n.left),k=e.computed(()=>n.right),b=e.computed(()=>n.top),S=e.computed(()=>n.bottom),V=e.computed(()=>C.value?d.value&&l.hideMidWhenNarrow&&k.value?"50%":d.value&&l.hideMidWhenNarrow&&!k.value?"100%":typeof m.value=="number"?m.value+"px":m.value:"0"),j=e.computed(()=>k.value?d.value&&l.hideMidWhenNarrow&&C.value?"50%":d.value&&l.hideMidWhenNarrow&&!C.value?"100%":typeof h.value=="number"?h.value+"px":h.value:"0"),y=e.computed(()=>b.value?typeof f.value=="number"?f.value+"px":f.value:"0"),w=e.computed(()=>S.value?typeof p.value=="number"?p.value+"px":p.value:"0"),v=e.computed(()=>({minWidth:l.midMinWidth+"px",minHeight:l.midMinHeight+"px"})),E=(D,W)=>{s.type=D,s.isMove=!0,s.pageX=W.pageX,s.pageY=W.pageY,s.h=a.value.clientHeight,s.w=a.value.clientWidth;const H=o.value.clientWidth,Q=o.value.clientHeight;switch(D){case"left":{const X=m.value;s.size=typeof X=="string"&&X.includes("%")?parseFloat(X)/100*H:Number(X);break}case"right":{const X=h.value;s.size=typeof X=="string"&&X.includes("%")?parseFloat(X)/100*H:Number(X);break}case"top":{const X=f.value;s.size=typeof X=="string"&&X.includes("%")?parseFloat(X)/100*Q:Number(X);break}case"bottom":{const X=p.value;s.size=typeof X=="string"&&X.includes("%")?parseFloat(X)/100*Q:Number(X);break}}document.onmouseup=$,document.onmousemove=R},R=D=>{if(s.isMove)switch(s.type){case"left":{const W=D.pageX-s.pageX;let H=s.size+W;H<0?H=4:H>s.size+s.w-l.midMinWidth&&(H=s.size+s.w-l.midMinWidth),m.value=H;break}case"right":{const W=D.pageX-s.pageX;let H=s.size-W;H<0?H=4:H>s.size+s.w-l.midMinWidth&&(H=s.size+s.w-l.midMinWidth),h.value=H;break}case"top":{const W=D.pageY-s.pageY;let H=s.size+W;H<0?H=4:H>s.size+s.h-l.midMinHeight&&(H=s.size+s.h-l.midMinHeight),f.value=H;break}case"bottom":{const W=D.pageY-s.pageY;let H=s.size-W;H<0?H=4:H>s.size+s.h-l.midMinHeight&&(H=s.size+s.h-l.midMinHeight),p.value=H;break}}},$=()=>{s.isMove=!1,document.onmouseup=null,document.onmousemove=null},_=()=>{if(!l.hideMidWhenNarrow||!o.value){d.value=!1;return}u.value=o.value.clientWidth;let D=0,W=0;if(C.value){const Q=m.value;D=typeof Q=="string"&&Q.includes("%")?parseFloat(Q)/100*u.value:Number(Q)}if(k.value){const Q=h.value;W=typeof Q=="string"&&Q.includes("%")?parseFloat(Q)/100*u.value:Number(Q)}const H=u.value-D-W;d.value=H<l.midMinWidth};let L=null;return e.onMounted(()=>{l.hideMidWhenNarrow&&o.value&&typeof window<"u"&&window.ResizeObserver&&(_(),L=new ResizeObserver(()=>{_()}),L.observe(o.value))}),e.onUnmounted(()=>{L&&L.disconnect()}),(D,W)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"layout",ref:o,class:e.normalizeClass(["j-layout",{"j-layout-not-hidden":t.notHidden}])},[C.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"j-layout--left",style:e.normalizeStyle({width:V.value})},[e.createElementVNode("div",ol,[e.renderSlot(D.$slots,"left")]),t.leftMove?(e.openBlock(),e.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:W[0]||(W[0]=H=>E("left",H))},null,32)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",nl,[b.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"j-layout--top",style:e.normalizeStyle({height:y.value})},[e.createElementVNode("div",ll,[e.renderSlot(D.$slots,"top")]),t.topMove?(e.openBlock(),e.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:W[1]||(W[1]=H=>E("top",H))},null,32)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"mid",ref:a,class:"j-layout--wrapper",style:e.normalizeStyle(v.value)},[e.renderSlot(D.$slots,"default")],4),S.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"j-layout--bottom",style:e.normalizeStyle({height:w.value})},[e.createElementVNode("div",al,[e.renderSlot(D.$slots,"bottom")]),t.bottomMove?(e.openBlock(),e.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:W[2]||(W[2]=H=>E("bottom",H))},null,32)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)])),k.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"j-layout--right",style:e.normalizeStyle({width:j.value})},[e.createElementVNode("div",il,[e.renderSlot(D.$slots,"right")]),t.rightMove?(e.openBlock(),e.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:W[3]||(W[3]=H=>E("right",H))},null,32)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],2))}})),wt={cellInnerBorder:!1,defaultStyle:{bgColor:"#fff",borderColor:"#e5e6eb",color:"#1d2129",fontSize:14,fontFamily:"Inter, -apple-system, BlinkMacSystemFont, PingFang SC, Hiragino Sans GB, noto sans, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif"},headerStyle:{bgColor:"#f2f3f5",fontWeight:500,padding:[0,8,0,8],lineHeight:14},bodyStyle:{padding:[0,8,0,8],lineHeight:14},frameStyle:{},scrollStyle:{barToSide:!0,width:10,visible:"always",hoverOn:!1}},Ee={APP_PROVIDE:"jcode_app_provide",FORM_PROVIDE:"jcode_form_provide",TABLE_PROVIDE:"jcode_table_provide",MENU_PROVIDE:"jcode_menu_provide",H_MENU_PROVIDE:"jianda_h_menu_provide",AUTH_PAGE_PROVIDE:"jcode_auth_page_provide",LAYER_PROVIDE:"jcode_layer_provide"};function qe(t,l){return e.inject(t,l)}function Ye(t,l){e.provide(t,l)}function we(){return qe(Ee.APP_PROVIDE,{t:(t,...l)=>{if(!t)return"";if(typeof t!="string")return t;let n=t||"";return l.length>0&&l.forEach((o,a)=>{n=n.replace(new RegExp(`\\{${a}\\}`,"g"),o)}),n.replace(/\$.\[^\$\$]*\$/,"")},useFile:()=>({}),useData:()=>({})})}function _e(){return qe(Ee.FORM_PROVIDE,{})}function uo(t){Ye(Ee.FORM_PROVIDE,t)}function sl(){return qe(Ee.TABLE_PROVIDE,{})}function Bt(t){Ye(Ee.TABLE_PROVIDE,t)}function rt(){return qe(Ee.MENU_PROVIDE,{})}function rl(t){Ye(Ee.MENU_PROVIDE,t)}function cl(){return qe(Ee.H_MENU_PROVIDE,{})}function dl(t){Ye(Ee.H_MENU_PROVIDE,t)}function ul(){return qe(Ee.AUTH_PAGE_PROVIDE,{getPageName:()=>""})}function fl(t){Ye(Ee.AUTH_PAGE_PROVIDE,t)}function ml(t){Ye(Ee.LAYER_PROVIDE,t)}const fo=e.defineComponent({name:"JComp",__name:"comp",props:{modelValue:{type:[String,Number,Boolean,Array,Object],default:void 0},id:{type:String,default:""},type:{type:String,default:""},getCompType:{type:Function,default:void 0},config:{type:Object,default:()=>{}},getCompConfig:{type:Function,default:void 0},children:{type:Array,default:()=>[]},row:{type:Object,default:void 0},isTableCell:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,{formData:a,formChange:i}=_e(),{tableData:r,row:c,rowChange:g}=sl(),u=n.row||c;Bt({tableData:r,row:u,rowChange:g});const d=e.computed(()=>it(f.value)&&!m.value?.notInput||m.value?.isInput||f.value==="j-tabs"||f.value==="j-collapse"),s=e.computed({get(){let b;if(u?b=u[n.id]:a?b=a[n.id]:b=n.modelValue,b===void 0&&f.value==="j-tabs"){if(m.value?.defaultValue)return m.value.defaultValue;const S=n.children.findIndex(V=>V.config?.active);return S>-1?"_tab"+S:"_tab0"}if(b===void 0&&f.value==="j-collapse"){if(m.value?.defaultValue)return m.value.defaultValue;const S=n.children.map((V,j)=>({item:V,index:j})).filter(({item:V})=>V.config?.active);return m.value?.accordion?S.length>0?"_collapse"+S[0].index:"":S.map(({index:V})=>"_collapse"+V)}return b},set(b){u?u[n.id]=b:a&&(a[n.id]=b),o("update:modelValue",b)}}),m=e.computed(()=>Ae({config:n.config,getCompConfig:n.getCompConfig,formData:a||{},row:u,tableData:r})),h=e.computed(()=>kt({type:n.type,getCompType:n.getCompType,config:m.value,formData:a||{},row:u,tableData:r})),f=e.computed(()=>n.isTableCell&&(h.value==="j-radio"||h.value==="j-checkbox")?"j-select":h.value==="j-textarea"?"j-input":h.value),p=e.computed(()=>{const b={...m.value};return f.value==="j-layer-form"&&(b.schema=n.children),f.value==="el-collapse-item"&&b.label&&(b.title=b.label,delete b.label),n.isTableCell&&(h.value==="j-checkbox"&&(b.multiple=!0),h.value==="j-select"&&b.multiple&&(b.collapseTags=!0,b.collapseTagsTooltip=!0),h.value==="j-switch"&&(b.size="small"),h.value==="j-textarea"&&(b.type="textarea")),b}),C=e.computed(()=>{if(f.value==="j-layer-form")return{};const b={};return n.children.forEach((S,V)=>{let j=S;f.value==="j-tabs"&&(j={...S,config:{...S.config||{},name:"_tab"+V}}),f.value==="j-collapse"&&(j={...S,config:{...S.config||{},name:"_collapse"+V}}),j.slot?(b[j.slot]=b[j.slot]||[],b[j.slot].push(j)):(b.default=b.default||[],b.default.push(j))}),b}),k=b=>{const S={...b,id:n.id,formData:a,row:u,tableData:r,config:m.value,type:"change"};console.log(S,"changeData"),m.value?.change&&m.value?.change(S),g&&g(S),i&&i(S),o("change",S)};return(b,S)=>{const V=e.resolveComponent("JComp");return p.value.display!=!1&&d.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.value),e.mergeProps({key:0},p.value,{modelValue:s.value,"onUpdate:modelValue":S[0]||(S[0]=j=>s.value=j),onChange:k}),e.createSlots({_:2},[e.renderList(C.value,(j,y)=>({name:y,fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j,w=>(e.openBlock(),e.createBlock(V,e.mergeProps({key:w.id},{ref_for:!0},w),null,16))),128))])}))]),1040,["modelValue"])):p.value.display!=!1?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.value),e.mergeProps({key:1},p.value,{onChange:k}),e.createSlots({_:2},[e.renderList(C.value,(j,y)=>({name:y,fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j,w=>(e.openBlock(),e.createBlock(V,e.mergeProps({key:w.id},{ref_for:!0},w),null,16))),128))])}))]),1040)):e.createCommentVNode("",!0)}}});class pl{wrapContainer=null;container=null;currentValue=null;async onStart(l){const{value:n}=l;await this.createElement(l)&&n!=null&&this.setValue(n)}findColumnByField(l,n){for(const o of l){if(o.field===n)return o;if(o.columns){const a=this.findColumnByField(o.columns,n);if(a)return a}}return null}async createElement(l){return await this.createEditor(l)}async createEditor(l){const{container:n,referencePosition:o,col:a,row:i,table:r}=l,c=r.getBodyField(a,i),g=r.options?.columns||[],u=this.findColumnByField(g,c),d=u?._compConfig||{},s=r.getCellOriginRecord(a,i)||{};if(!n)return!1;const m=document.createElement("div");m.style.position="absolute",m.style.width="100%",m.style.height="100%",m.style.boxSizing="border-box";const{bgColor:h}=r.getCellStyle(a,i)||{};m.style.backgroundColor=h||"#FFFFFF",this.wrapContainer=m,this.container=n,this.container&&this.container.appendChild(m),d.autoFocus=!0;const f=e.h(fo,{id:c,type:u._compType,config:d,getCompConfig:u._getCompConfig,getCompType:u._getCompType,row:s||{},isTableCell:!0,class:"j-comp-editor","onUpdate:modelValue":p=>{this.currentValue=p,console.log("onUpdate:modelValue triggered with:",p)}});return f.appContext=r._getAppContext(),e.render(f,m),o?.rect&&this.adjustPosition(o.rect),!0}getValue(){return this.currentValue}setValue(l){this.currentValue=l}adjustPosition(l){console.log("Adjusting position:",l),this.wrapContainer&&(this.wrapContainer.style.top=`${l.top}px`,this.wrapContainer.style.left=`${l.left}px`,this.wrapContainer.style.width=`${l.width-1}px`,this.wrapContainer.style.height=`${l.height-1}px`)}onEnd(){this.wrapContainer&&this.container&&(e.render(null,this.wrapContainer),this.container.removeChild(this.wrapContainer),this.wrapContainer=null)}isEditorElement(l){return this.wrapContainer?.contains(l)?!0:this.isClickPopUp(l)}isClickPopUp(l){let n=l;for(;n;){if(n.classList){const o=["el-select-dropdown","el-popper","el-picker-panel","el-cascader-panel","el-autocomplete-suggestion","el-date-picker","el-time-picker"];for(const a of o)if(n.classList.contains(a))return!0}n=n.parentNode}return!1}}const mo=new Map;function hl(){if(!mo.has("j-comp-editor")){const t=new pl;gt.register.editor("j-comp-editor",t),mo.set("j-comp-editor",t)}}function gl(t){if(Wt(t))return"j-comp-editor"}function yl(t){if(t)return gl(t)}function bl(){hl()}const Cl={class:"j-table-footer"},kl={key:0,class:"j-table-pagination"},wl=["onClick"],po=K(e.defineComponent({name:"JTable",__name:"table",props:{columns:{type:Array,required:!0,default:()=>[]},records:{type:Array,required:!0,default:()=>[]},isTree:{type:Boolean,default:!1},isShowNumber:{type:Boolean,default:!0},isMultiple:{type:Boolean,default:!1},isPage:{type:Boolean,default:!1},pageLayoutSimple:{type:Boolean,default:!1},pageSizes:Array,pageTotal:{type:Number,default:0},tablePage:{type:Number,default:1},pageSize:{type:Number,default:100},selectField:{type:String,default:""},rowKey:{type:String,default:"id"},actions:{type:Array,default:()=>[]},actionsMaxCount:{type:Number,default:3},actionsLabel:{type:String,default:"操作"},isAnimationAppear:{type:Boolean,default:!1},heightMode:{type:String,default:"full"},maxHeight:{type:[String,Number],default:void 0}},emits:["ready","selectionChanged","update:tablePage","update:pageSize","loadPageData","rowChange"],setup(t,{expose:l,emit:n}){const o=e.getCurrentInstance(),a=t,i=n,{formData:r}=_e(),{useData:c}=we(),{getLabel:g}=c(),u=e.computed(()=>a.heightMode==="auto"?{height:"auto"}:{}),d=e.ref(40),s=e.computed(()=>{const B={};return a.heightMode==="auto"&&(B.height=d.value+"px",B.flex="none",a.maxHeight&&(B.maxHeight=typeof a.maxHeight=="number"?`${a.maxHeight}px`:a.maxHeight)),B}),m=e.ref(null);let h=null,f=0,p=0,C=!1;const k=e.ref(!1),b=e.ref({}),S=e.ref([]),V=e.ref(null),j=e.ref(0);let y=null,w=!1,v=!1;const E=(B,x,I,P,Y)=>{S.value=B,V.value=x,j.value=I,b.value={left:`${P}px`,top:`${Y}px`},k.value=!0,w=!1,document.addEventListener("wheel",W,{passive:!1})},R=()=>{k.value=!1,w=!1,v=!1,_(),document.removeEventListener("wheel",W)},$=()=>{_(),y=setTimeout(()=>{!w&&!v&&R()},100)},_=()=>{y&&(clearTimeout(y),y=null)},L=()=>{w=!0,_()},D=()=>{w=!1,$()},W=B=>{B.preventDefault()},H=B=>{V.value&&B.click(V.value,j.value),R()},Q=()=>{const{Group:B,Text:x}=gt.CustomLayout,I=a.actionsMaxCount,P=a.actions.length>I,Y=P?a.actions.slice(0,I-1):a.actions,F=P?a.actions.slice(I-1):[];let z=0;if(Y.forEach((de,O)=>{const G=et(de.label)||0;z+=G+(O===0?24:12)}),P){const de=(et("更多")||0)+12;z+=de}const le=Math.max(80,z)+"px";return{field:"__actions__",title:a.actionsLabel,width:le,maxWidth:le,minWidth:le,disableColumnResize:!0,disableSelect:!0,customLayout:de=>{const{table:O,row:G,col:se}=de,ae=O.getCellOriginRecord(se,G),ge=O.getRecordIndexByCell(se,G),te=new B({height:40,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",flexWrap:"nowrap"});if(Y.forEach((re,Ce)=>{const ke=re.isDanger?"#f53f3f":"#165dff",ue=new x({text:re.label,fontSize:14,fill:ke,boundsPadding:[0,12,0,Ce==0?12:0],cursor:"pointer"});ue.addEventListener("click",()=>{re.click(ae,ge)}),ue.addEventListener("mouseenter",$e=>{$e.target.setAttribute("fill",J(ke,-20)),O.scenegraph.stage.renderNextFrame()}),ue.addEventListener("mouseleave",$e=>{$e.target.setAttribute("fill",ke),O.scenegraph.stage.renderNextFrame()}),te.add(ue)}),P){const re="#1677ff",Ce=new x({text:"更多",fontSize:14,fill:re,boundsPadding:[0,0,0,0],cursor:"pointer"});Ce.addEventListener("mouseenter",ke=>{ke.target.setAttribute("fill",J(re,-20)),O.scenegraph.stage.renderNextFrame();const ue=m.value?.getBoundingClientRect();if(ue){const $e=ke.canvasX+ue.left-64,Vt=ke.canvasY+ue.top+8;E(F,ae,ge,$e,Vt)}v=!0,_()}),Ce.addEventListener("mouseleave",ke=>{ke.target.setAttribute("fill",re),O.scenegraph.stage.renderNextFrame(),v=!1,$()}),te.add(Ce)}return{rootContainer:te,renderDefault:!1}}}},X=(B,x)=>{for(const I of B){if(I.field===x)return I;if(I.columns){const P=X(I.columns,x);if(P)return P}}return null},ye=(B,x,I,P)=>{const Y=P.getBodyField(x,I),F=P.options?.columns||[],z=X(F,Y);return z._fieldFormat?z._fieldFormat(B,x,I,P):Ht(B[Y],g,{type:z._compType,getCompType:z._getCompType,getCompConfig:z._getCompConfig,config:z._compConfig,formData:r,tableData:a.records,row:B})},Z=B=>{const{dataValue:x,rect:I}=B;let P="mdi:toggle-switch",Y="#165dff";x||(P="mdi:toggle-switch-off",Y="#e5e6eb");const F=Le.getIcon(P),z=F?.body?.replace(/currentColor/g,Y),le=[];return le.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 ${F?.width} ${F?.height}" >${z}</svg>`,x:8,y:(I.height-40)/2,width:40,height:40}),{elements:le}},fe=B=>{const{dataValue:x,rect:I}=B,P=Number(x)||0,Y=5,F=20,z=4,le=8,de=(I.height-F)/2,O=[],G=Le.getIcon("mdi:star"),se=Le.getIcon("mdi:star-half-full"),ae=Le.getIcon("mdi:star-outline"),ge="#f7ba2a",te="#e5e6eb";for(let re=0;re<Y;re++){const Ce=le+re*(F+z),ke=de;if(P>=re+1){const ue=G?.body?.replace(/currentColor/g,ge);O.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${F}" height="${F}" viewBox="0 0 ${G?.width} ${G?.height}">${ue}</svg>`,x:Ce,y:ke,width:F,height:F})}else if(P>re&&P<re+1){const ue=se?.body?.replace(/currentColor/g,ge);O.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${F}" height="${F}" viewBox="0 0 ${se?.width} ${se?.height}">${ue}</svg>`,x:Ce,y:ke,width:F,height:F})}else{const ue=ae?.body?.replace(/currentColor/g,te);O.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${F}" height="${F}" viewBox="0 0 ${ae?.width} ${ae?.height}">${ue}</svg>`,x:Ce,y:ke,width:F,height:F})}}return{elements:O}},Ve=B=>{const{dataValue:x,rect:I,table:P,col:Y,row:F}=B,z=P.getBodyField(Y,F),le=P.options?.columns||[],O=X(le,z)?._compConfig||{},G=Number(O.min)||0,se=Number(O.max)||100,ae=Number(x)||0,ge=se-G,te=ge===0?0:Math.max(0,Math.min(100,(ae-G)/ge*100)),re=4,Ce=8,ke=8,ue=(I.height-re)/2,$e=String(ae),Vt=et($e)||0,xt=Ce,un=ue,Ge=I.width-Ce*2-Vt-ke,ot=Ge*te/100,ut=[],fn=(Ne,xe,ft)=>{const je=Math.min(ft,xe/2,Ne/2);return`M ${je} 0 L ${Ne-je} 0 Q ${Ne} 0 ${Ne} ${je} L ${Ne} ${xe-je} Q ${Ne} ${xe} ${Ne-je} ${xe} L ${je} ${xe} Q 0 ${xe} 0 ${xe-je} L 0 ${je} Q 0 0 ${je} 0 Z`},Li=(Ne,xe,ft)=>{const je=Math.min(ft,xe/2,Ne/2);return Ne<=je*2?fn(Ne,xe,ft):`M ${je} 0 L ${Ne} 0 L ${Ne} ${xe} L ${je} ${xe} Q 0 ${xe} 0 ${xe-je} L 0 ${je} Q 0 0 ${je} 0 Z`},Di=re/2,Ii=fn(Ge,re,Di);if(ut.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${Ge}" height="${re}" viewBox="0 0 ${Ge} ${re}"><path d="${Ii}" fill="#e5e6eb"/></svg>`,x:xt,y:un,width:Ge,height:re}),ot>0){const Ne=re/2,xe=Li(ot,re,Ne);ut.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${ot}" height="${re}" viewBox="0 0 ${ot} ${re}"><path d="${xe}" fill="#165dff"/></svg>`,x:xt,y:un,width:ot,height:re})}const Ai=xt+Ge+ke,Pi=I.height/2;return ut.push({type:"text",text:$e,x:Ai,y:Pi,fontSize:14,fill:"#333333",textAlign:"left",textBaseline:"middle"}),{elements:ut}},me=B=>{const x=B.filter(I=>I.config?.display!==!1).map(I=>{const{id:P,type:Y,config:F,getCompConfig:z,getCompType:le,children:de}=I,{label:O,width:G,minWidth:se,maxWidth:ae,align:ge,fieldFormat:te,editor:re,frozen:Ce,...ke}=F||{},ue={field:P,title:O,width:G,minWidth:se,maxWidth:ae,style:{textAlign:ge},_fieldFormat:te,_compType:Y,_compConfig:{...ke},_getCompConfig:z,_getCompType:le,frozen:Ce},$e=yl(Y);return $e&&(ue.editor=$e,Y==="j-switch"&&(ue.customRender=Z),C=!0),Y==="j-rate"&&(ue.customRender=fe),Y==="j-slider"&&(ue.customRender=Ve),ue.fieldFormat=ye,de&&(ue.columns=me(de)),ue});return a.isTree&&x.length>0&&(x[0].tree=!0),x},J=(B,x)=>{const I=B.replace("#",""),P=parseInt(I,16),Y=Math.min(255,Math.max(0,(P>>16)+x)),F=Math.min(255,Math.max(0,(P>>8&255)+x)),z=Math.min(255,Math.max(0,(P&255)+x));return`#${(Y<<16|F<<8|z).toString(16).padStart(6,"0")}`},pe=()=>({field:"__sequence__",title:"序号",width:"auto",minWidth:44,disableColumnResize:!0,headerStyle:{textAlign:"center"},style:{textAlign:"center"},fieldFormat:(B,x,I,P)=>{const Y=P.getRecordIndexByCell(x,I);return a.isPage?ie.value+Y+1:Y+1},_getCompConfig:void 0,_getCompType:void 0}),oe=()=>{f=0,p=0,C=!1;const B={};let x=me(a.columns);const I=G=>{if(G.frozen)return G.frozen;if(G.columns)for(const se of G.columns){const ae=I(se);if(ae)return ae}},P=G=>{const se=[];return G.forEach(ae=>{if(ae.frozen){se.push(ae);return}if(!ae.columns||ae.columns.length===0){se.push(ae);return}const ge=P(ae.columns),te=[],re=[],Ce=[];if(ge.forEach(ue=>{const $e=I(ue);$e==="left"?te.push(ue):$e==="right"?re.push(ue):Ce.push(ue)}),(te.length>0?1:0)+(re.length>0?1:0)+(Ce.length>0?1:0)<=1){ae.columns=ge,se.push(ae);return}te.length&&se.push({...ae,columns:te}),Ce.length&&se.push({...ae,columns:Ce}),re.length&&se.push({...ae,columns:re})}),se};x=P(x);const Y=G=>{let se=0,ae=0;return G.forEach(ge=>{if(ge.columns&&ge.columns.length>0){const te=Y(ge.columns);se+=te.left,ae+=te.right}else ge.frozen==="left"?se++:ge.frozen==="right"&&ae++}),{left:se,right:ae}},F=[],z=[],le=[];x.forEach(G=>{const se=I(G);se==="left"?F.push(G):se==="right"?z.push(G):le.push(G)});const de=Y(F),O=Y(z);return p+=de.left,f+=O.right,x=[...F,...le,...z],a.isShowNumber&&(x.unshift(pe()),p++),a.actions.length>0&&(x.push(Q()),f++),C&&(B.editCellTrigger="click",B.keyboardOptions={copySelected:!0,cutSelected:!0,pasteValueToCell:!0,selectAllOnCtrlA:!0}),{columns:x,option:B}},ne=()=>{const B=oe();a.isMultiple&&p++;const x={records:[],columns:B.columns,autoFillWidth:!0,enableCheckboxCascade:a.isMultiple,enableHeaderCheckboxCascade:a.isMultiple,rightFrozenColCount:f,frozenColCount:p,emptyTip:{text:"暂无数据"},tooltip:{isShowOverflowTextTooltip:!0},...B.option};return a.isAnimationAppear&&(x.animationAppear={duration:100,delay:0,type:"one-by-one",direction:"row"}),a.isMultiple&&(x.rowSeriesNumber={width:40,minWidth:40,maxWidth:40,disableColumnResize:!0,format:()=>"",cellType:"checkbox",headerType:"checkbox",headerStyle:{textAlign:"center"},style:{textAlign:"center"}},a.selectField&&(x.rowSeriesNumber.field=a.selectField)),x.theme=wt,a.heightMode==="auto"&&(x.theme={...wt,scrollStyle:{...wt.scrollStyle,hoverOn:!0,width:8}}),x},he=()=>{if(!m.value)return;bl();const B=ne();h=new gt.ListTable(m.value,B),h._getAppContext=()=>o?.appContext,h.on("click_cell",({col:x,cellType:I})=>{if(I==="checkbox"&&x==0){const P=Fe();i("selectionChanged",P)}}),A(),d.value=h.getAllRowsHeight(),i("ready",h)},Be=()=>{h&&(h.release(),h=null)},A=()=>{ee(a.records)},q=()=>h,ee=B=>{h&&(h.setScrollTop(0),h.setRecords(B))};e.onMounted(()=>{he()}),e.onBeforeUnmount(()=>{Be(),_(),document.removeEventListener("wheel",W)});const ce=e.computed({get(){return a.tablePage},set(B){i("update:tablePage",B)}}),be=e.ref(0),Se=e.computed({get(){return be.value!==0?be.value:a.pageSize},set(B){be.value=B,i("update:pageSize",B)}}),ie=e.computed(()=>(ce.value-1)*Se.value),ve=(B,x)=>{i("loadPageData",{rows:x,page:B})},Fe=()=>{if(!h)return[];if(h.stateManager&&h.stateManager.checkedState){const B=h.stateManager.checkedState,x=[];return B.forEach((I,P)=>{if(Object.values(I).some(F=>F===!0)){const F=Number(P);!isNaN(F)&&h.records[F]&&x.push(h.records[F])}}),x}return[]},ze=B=>a.rowKey?a.rowKey.split(",").map(I=>B[I.trim()]).join("::"):"",T=B=>{if(!h||!a.isMultiple)return;const x=h.records;if(a.rowKey){const I=new Set(B.map(ze));x.forEach((P,Y)=>{const F=I.has(ze(P)),z=h.getTableIndexByRecordIndex(Y);h.setCellCheckboxState(0,z,F)})}else console.warn("Warning: rowKey is not defined. Please set rowKey to enable row selection.")},U=B=>{i("rowChange",B)},M=()=>{if(!h)return;const B=Fe(),x=ne();x.records=h.records,h.updateOption(x,{clearColWidthCache:!1,clearRowHeightCache:!1}),a.heightMode==="auto"&&(d.value=h.getAllRowsHeight()),B.length>0&&T(B)};return e.watch(()=>a.columns,()=>{M()}),e.watch(()=>[a.isTree,a.isMultiple,a.isShowNumber,a.isPage,a.isAnimationAppear,a.actionsMaxCount,a.actionsLabel,a.selectField,a.heightMode],()=>{M()}),e.watch(()=>a.actions,()=>{M()},{deep:!0}),Bt({tableData:a.records,rowChange:U}),l({getInstance:q,setRecords:ee,getSelection:Fe,setSelection:T}),(B,x)=>{const I=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["j-table",{"j-table-auto":t.heightMode==="auto"}]),style:e.normalizeStyle(u.value)},[e.createElementVNode("div",{class:"j-table-wrapper",style:e.normalizeStyle(s.value)},[e.createElementVNode("div",{class:e.normalizeClass("j-block"),ref_key:"tableContainer",ref:m},null,512)],4),e.createElementVNode("div",Cl,[t.isPage?(e.openBlock(),e.createElementBlock("div",kl,[x[2]||(x[2]=e.createElementVNode("div",null,null,-1)),t.isPage?(e.openBlock(),e.createBlock(I,{key:0,"current-page":ce.value,"onUpdate:currentPage":x[0]||(x[0]=P=>ce.value=P),"page-size":Se.value,"onUpdate:pageSize":x[1]||(x[1]=P=>Se.value=P),"page-sizes":t.pageSizes||[100,200,500,1e3],total:t.pageTotal,layout:"total, prev, pager, next,sizes",onChange:ve},null,8,["current-page","page-size","page-sizes","total"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),k.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"j-table-dropdown",style:e.normalizeStyle(b.value),onMouseenter:L,onMouseleave:D},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,P=>(e.openBlock(),e.createElementBlock("div",{key:P.id,class:"j-table-dropdown-item",style:e.normalizeStyle({color:P.isDanger?"var(--j-color-danger)":"var(--j-color-primary)"}),onClick:Y=>H(P)},e.toDisplayString(P.label),13,wl))),128))],36)):e.createCommentVNode("",!0)],6)}}})),Bl=["title"],Sl={key:0,style:{"margin-left":"8px"}},Vl={key:0,class:"j-dialog-steps"},xl={key:1,class:"j-dialog-btns"},ho=K(e.defineComponent({name:"JDialog",__name:"index",props:{visible:{type:Boolean},title:{type:String,default:""},subtitle:{type:Function,default:void 0},width:{type:Number,default:600},height:{type:Number,default:400},minWidth:{type:Number,default:300},minHeight:{type:Number,default:200},mask:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},showCloseBtn:{type:Boolean,default:!0},autoHeight:{type:Boolean,default:!1},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},zoomControls:{type:Boolean,default:!0},beforeClose:{type:Function,default:void 0},buttons:{type:Array,default:()=>[]}},emits:["update:visible","update:stepActive","cancel","ok","closed"],setup(t,{expose:l,emit:n}){const o=t,a=n,{t:i}=we(),r=e.ref(!1),c=e.ref(!1),g=e.ref(""),u=e.ref(!1),d=e.ref(!0),s=e.ref(!1),m=e.ref(!0),h=e.ref(-1),f=e.reactive({isMove:!1,pageX:0,pageY:0,left:0,top:0,_left:0,_top:0}),p=e.ref(0),C=e.ref(),k=e.ref(48),b=e.ref(0),S=e.ref(0);e.watch(()=>o.visible,J=>{p.value=1,p.value=0,r.value=J,J===!0&&o.zoomControls&&e.nextTick(()=>{typeof document<"u"&&(C.value=document.querySelector(".j-dialog"),C.value&&(C.value.onmousemove=Ve))})},{immediate:!0});const V=e.computed(()=>{let J=o.height+p.value;return typeof window<"u"&&J+40>window.innerHeight&&(J=window.innerHeight-32-40),J}),j=e.computed(()=>{let J=0+p.value;return typeof document<"u"&&document.body&&(J=(document.body.clientWidth-w.value)/2),J}),y=e.computed(()=>{let J=0+p.value;return typeof window<"u"&&(J=(window.innerHeight-V.value-40)/2),J}),w=e.computed(()=>{let J=0+p.value;return J=o.width,typeof document<"u"&&document.body&&J>document.body.clientWidth&&(J=document.body.clientWidth-32),J}),v=J=>{g.value=J||"保存数据中...",c.value=!0},E=()=>{c.value=!1},R=()=>{o.beforeClose&&o.beforeClose()===!1||(r.value=!1,a("update:visible",!1),a("cancel"))},$=()=>{a("ok",v,E)},_=()=>{f.left=0,f.top=0,S.value=0,b.value=0,o.isStep&&(L.value=0,e.nextTick(()=>{Q()})),a("closed")},L=e.computed({get(){return h.value!==-1?h.value:o.stepActive},set(J){h.value=J,a("update:stepActive",J)}}),D=()=>{L.value>0&&L.value--,e.nextTick(()=>{Q()})},W=async()=>{await H()&&(L.value<o.steps.length-1&&(L.value+=1),e.nextTick(()=>{Q()}))},H=async()=>{if(u.value=!0,o.validateSteps){const J=await o.validateSteps(o.stepActive,v,E);return u.value=!1,J}return u.value=!1,!0},Q=()=>{switch(m.value=!0,s.value=!0,d.value=!0,L.value){case 0:s.value=!1;break;case o.steps.length-1:d.value=!1,m.value=!1;break;default:d.value=!1,s.value=!1;break}},X=e.computed(()=>o.steps.map(J=>({title:J,disabled:!0}))),ye=function(J){o.autoHeight||(f.pageX=J.pageX,f.pageY=J.pageY,f._left=f.left,f._top=f.top,f.isMove=!0,typeof document<"u"&&(document.onmouseup=Z,document.onmousemove=fe))},Z=()=>{f.isMove=!1,typeof document<"u"&&(document.onmouseup=null,document.onmousemove=null)},fe=J=>{if(f.isMove){const pe=J.pageX-f.pageX,oe=J.pageY-f.pageY;let ne=f._left+pe,he=f._top+oe;ne+j.value<0&&(ne=-j.value),typeof document<"u"&&document.body&&(b.value?ne+b.value+j.value>document.body.clientWidth&&(ne=document.body.clientWidth-b.value-j.value):ne+w.value+j.value>document.body.clientWidth&&(ne=document.body.clientWidth-w.value-j.value)),he+y.value<0&&(he=-y.value),typeof window<"u"&&(S.value?he+S.value+y.value+40>window.innerHeight&&(he=window.innerHeight-S.value-y.value-40):he+V.value+y.value+40>window.innerHeight&&(he=window.innerHeight-V.value-y.value-40)),f.left=ne,f.top=he}},Ve=J=>{const pe=C.value.offsetLeft,oe=C.value.offsetTop,ne=C.value.clientWidth,he=C.value.clientHeight,Be=he-k.value,A=C.value.scrollTop;if(J.clientX>pe+ne-10&&A+J.clientY>oe+he-10||A+J.clientY<oe+5&&pe+10>J.clientX)C.value.style.cursor="se-resize";else if(pe+10>J.clientX&&A+J.clientY>oe+he-10||J.clientX>pe+ne-10&&A+J.clientY<oe+5)C.value.style.cursor="sw-resize";else if(J.clientX>pe+ne-10||pe+10>J.clientX)C.value.style.cursor="w-resize";else if(A+J.clientY>oe+he-10||A+J.clientY<oe+5)C.value.style.cursor="s-resize";else{C.value.style.cursor="default",C.value.onmousedown=null;return}C.value.onmousedown=q=>{const{clientX:ee}=q,{clientY:ce}=q,be=f.left+j.value,Se=f.top+y.value;f._left=f.left,f._top=f.top,S.value||(S.value=Be),b.value||(b.value=ne),ee>be+10&&ee<be+ne-10&&ce>Se+5&&ce<Se+47||(typeof document<"u"&&(document.onmousemove=function(ie){ie.preventDefault(),ee>be&&ee<be+10&&(ee>ie.clientX&&(b.value=ne+(ee-ie.clientX),f.left=f._left-(ee-ie.clientX)),ee<ie.clientX&&b.value>o.minWidth&&(b.value=ne-(ie.clientX-ee),f.left=f._left+ie.clientX-ee)),ee>be+ne-10&&ee<be+ne&&(ee>ie.clientX&&b.value>o.minWidth&&(b.value=ne-(ee-ie.clientX)),ee<ie.clientX&&typeof document<"u"&&document.body&&j.value+f.left+b.value<document.body.clientWidth&&(b.value=ne+(ie.clientX-ee))),ce>Se&&ce<Se+5&&(ce>ie.clientY&&(S.value=Be+ce-ie.clientY,f.top=f._top-(ce-ie.clientY)),ce<ie.clientY&&S.value>o.minHeight&&(S.value=Be-(ie.clientY-ce),f.top=f._top+ie.clientY-ce)),A+ce>Se+Be+38&&A+ce<Se+Be+48&&(ce>ie.clientY&&S.value>o.minHeight&&(S.value=Be-(ce-ie.clientY)),ce<ie.clientY&&typeof window<"u"&&y.value+f.top+S.value+48<window.innerHeight&&(S.value=Be+ie.clientY-ce))}),typeof document<"u"&&(document.onmouseup=function(){typeof document<"u"&&(document.onmousemove=null,document.onmouseup=null)}))}},me=async J=>{J.click&&await J.click()};return l({showLoading:v,hideLoading:E}),(J,pe)=>{const oe=e.resolveComponent("j-button"),ne=e.resolveComponent("el-space"),he=e.resolveComponent("el-step"),Be=e.resolveComponent("el-steps"),A=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(A,{modelValue:r.value,"onUpdate:modelValue":pe[0]||(pe[0]=q=>r.value=q),class:"j-dialog","align-center":"","append-to-body":!0,"destroy-on-close":t.destroyOnClose,"show-close":!1,modal:t.mask,"modal-penetrable":!t.mask,"close-on-click-modal":!1,width:`${b.value||w.value}px`,style:e.normalizeStyle({position:"fixed",left:`${j.value+f.left}px`,top:`${y.value+f.top}px`,"pointer-events":t.mask?"":"none"}),onClosed:_},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"j-dialog-header",onMousedown:ye},[e.createElementVNode("div",{class:"j-dialog-header-left",title:e.unref(i)(t.title||""),style:e.normalizeStyle({cursor:t.autoHeight?"":"move"})},[e.createElementVNode("span",null,e.toDisplayString(e.unref(i)(t.title||"")),1),t.subtitle?(e.openBlock(),e.createElementBlock("span",Sl,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.subtitle())))])):e.createCommentVNode("",!0)],12,Bl),t.showCloseBtn?(e.openBlock(),e.createBlock(ne,{key:0,size:0},{default:e.withCtx(()=>[e.createVNode(oe,{type:"text",icon:"mdi:close",onClick:R})]),_:1})):e.createCommentVNode("",!0)],32),e.createElementVNode("div",{class:e.normalizeClass(["j-dialog-window",{"j-dialog-window-hasBtns":t.hasBtns},{"j-dialog-window-hasSteps":t.isStep}]),style:e.normalizeStyle({height:t.autoHeight?"auto":(S.value>0?S.value:V.value)+"px"})},[t.isStep?(e.openBlock(),e.createElementBlock("div",Vl,[e.createElementVNode("div",{style:e.normalizeStyle({maxWidth:`${200*X.value.length}px`,width:"100%"})},[e.createVNode(Be,{simple:"",active:L.value,space:160,"finish-status":"success"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,(q,ee)=>(e.openBlock(),e.createBlock(he,{key:ee,title:e.unref(i)(q.title)},null,8,["title"]))),128))]),_:1},8,["active"])],4)])):e.createCommentVNode("",!0),e.renderSlot(J.$slots,"default"),t.hasBtns?(e.openBlock(),e.createElementBlock("div",xl,[e.createVNode(ne,{size:8},{default:e.withCtx(()=>[t.isStep?(e.openBlock(),e.createBlock(oe,{key:0,size:"mini",disabled:d.value,label:e.unref(i)("上一步"),onClick:D},null,8,["disabled","label"])):e.createCommentVNode("",!0),t.isStep?(e.openBlock(),e.createBlock(oe,{key:1,size:"mini",disabled:s.value,loading:u.value,label:e.unref(i)("下一步"),onClick:W},null,8,["disabled","loading","label"])):e.createCommentVNode("",!0),!t.isStep&&t.showCloseBtn?(e.openBlock(),e.createBlock(oe,{key:2,size:"mini",label:e.unref(i)("取消"),onClick:R},null,8,["label"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.buttons,q=>(e.openBlock(),e.createBlock(oe,{key:q.prop,label:q.label,danger:q.danger,ghost:q.ghost,type:q.type,icon:q.icon,onClick:ee=>me(q)},null,8,["label","danger","ghost","type","icon","onClick"]))),128)),t.hasSaveBtn?(e.openBlock(),e.createBlock(oe,{key:3,size:"mini",type:"primary",disabled:m.value&&t.isStep,label:e.unref(i)(t.btnText),onClick:$},null,8,["disabled","label"])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)],6)]),_:3},8,["modelValue","destroy-on-close","modal","modal-penetrable","width","style"])}}})),jl=["element-loading-text"],Nl={class:"j-dialog-full-header"},vl={class:"j-dialog-full-header-left"},$l=["src"],El={class:"j-dialog-full-title-text"},Tl={style:{height:"28px","line-height":"32px","margin-left":"8px"}},zl={class:"j-dialog-full-header-right"},Ml={class:"j-dialog-full-body"},go=K(e.defineComponent({name:"JDialogFull",__name:"index",props:{visible:{type:Boolean},title:{type:String,default:""},destroyOnClose:{type:Boolean,default:!1},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},showCloseBtn:{type:Boolean,default:!0},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},beforeClose:{type:Function,default:void 0},buttons:{type:Array,default:()=>[]},subtitle:{type:Function,default:void 0}},emits:["update:stepActive","update:visible","cancel","ok","closed"],setup(t,{expose:l,emit:n}){const o=t,a=n,{logoImg:i,t:r}=we(),c=e.ref(!1),g=e.ref(!1),u=e.ref(""),d=e.ref(!1),s=e.ref(!0),m=e.ref(!1),h=e.ref(!0),f=e.ref(-1);e.watch(()=>o.visible,$=>{c.value=$},{immediate:!0});const p=e.computed({get(){return f.value!==-1?f.value:o.stepActive},set($){f.value=$,a("update:stepActive",$)}}),C=()=>{o.beforeClose&&o.beforeClose()===!1||(c.value=!1,a("update:visible",!1),a("cancel"))},k=()=>{a("ok",S,V)},b=()=>{o.isStep&&(p.value=0,e.nextTick(()=>{v()})),a("closed")},S=$=>{u.value=$||"保存数据中...",g.value=!0},V=()=>{g.value=!1},j=()=>{p.value>0&&p.value--,e.nextTick(()=>{v()})},y=async()=>{await w()&&(p.value<o.steps.length-1&&(p.value+=1),e.nextTick(()=>{v()}))},w=async()=>{if(d.value=!0,o.validateSteps){const $=await o.validateSteps(o.stepActive,S,V);return d.value=!1,$}return d.value=!1,!0},v=()=>{switch(h.value=!0,m.value=!0,s.value=!0,p.value){case 0:m.value=!1;break;case o.steps.length-1:s.value=!1,h.value=!1;break;default:s.value=!1,m.value=!1;break}},E=e.computed(()=>o.steps.map($=>({title:$,disabled:!0}))),R=async $=>{$.click&&await $.click()};return l({showLoading:S,hideLoading:V}),($,_)=>{const L=e.resolveComponent("el-step"),D=e.resolveComponent("el-steps"),W=e.resolveComponent("j-button"),H=e.resolveComponent("el-space"),Q=e.resolveComponent("el-divider"),X=e.resolveComponent("el-dialog"),ye=e.resolveDirective("loading");return e.openBlock(),e.createBlock(X,{modelValue:c.value,"onUpdate:modelValue":_[0]||(_[0]=Z=>c.value=Z),class:"j-dialog-full",width:"100%","append-to-body":!0,fullscreen:!0,"show-close":!1,modal:!0,"destroy-on-close":t.destroyOnClose,onClosed:b},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"j-block j-dialog-full-window","element-loading-text":e.unref(r)(u.value)},[e.createElementVNode("div",Nl,[e.createElementVNode("div",vl,[e.unref(i)?(e.openBlock(),e.createElementBlock("img",{key:0,class:"j-dialog-full-header-logo",src:e.unref(i)},null,8,$l)):e.createCommentVNode("",!0),e.createElementVNode("span",El,e.toDisplayString(e.unref(r)(t.title)),1),e.createElementVNode("span",Tl,[t.subtitle?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.subtitle()),{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:"j-dialog-full-header-mid",style:e.normalizeStyle({maxWidth:`${200*E.value.length}px`})},[t.isStep?(e.openBlock(),e.createBlock(D,{key:0,simple:"",active:p.value,space:160,"finish-status":"success"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,(Z,fe)=>(e.openBlock(),e.createBlock(L,{key:fe,title:e.unref(r)(Z.title)},null,8,["title"]))),128))]),_:1},8,["active"])):e.createCommentVNode("",!0)],4),e.createElementVNode("div",zl,[e.createVNode(H,{size:0},{default:e.withCtx(()=>[t.hasBtns?(e.openBlock(),e.createBlock(H,{key:0},{default:e.withCtx(()=>[t.isStep?(e.openBlock(),e.createBlock(W,{key:0,size:"mini",disabled:s.value,label:e.unref(r)("上一步"),onClick:j},null,8,["disabled","label"])):e.createCommentVNode("",!0),t.isStep?(e.openBlock(),e.createBlock(W,{key:1,size:"mini",disabled:m.value,loading:d.value,label:e.unref(r)("下一步"),onClick:y},null,8,["disabled","loading","label"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.buttons,Z=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Z.prop},[Z.display!==!1?(e.openBlock(),e.createBlock(W,{key:0,label:Z.label,danger:Z.danger,ghost:Z.ghost,type:Z.type,disabled:Z.disabled,icon:Z.icon?Z.icon:"",onClick:fe=>R(Z)},null,8,["label","danger","ghost","type","disabled","icon","onClick"])):e.createCommentVNode("",!0)],64))),128)),t.hasSaveBtn?(e.openBlock(),e.createBlock(W,{key:2,size:"mini",type:"primary",disabled:h.value&&t.isStep,label:e.unref(r)(t.btnText),onClick:k},null,8,["disabled","label"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),t.showCloseBtn&&t.hasBtns?(e.openBlock(),e.createBlock(Q,{key:1,type:"vertical",style:{margin:"0 8px"}})):e.createCommentVNode("",!0),t.showCloseBtn?(e.openBlock(),e.createBlock(W,{key:2,type:"text",icon:"mdi:close",onClick:C})):e.createCommentVNode("",!0)]),_:1})])]),e.createElementVNode("div",Ml,[e.renderSlot($.$slots,"default")])],8,jl)),[[ye,g.value]])]),_:3},8,["modelValue","destroy-on-close"])}}})),Fl=["element-loading-text"],Ll={class:"j-block"},Dl={key:0,class:"j-drawer-bottom-btns"},Il={class:"j-drawer--header"},Al={class:"j-drawer--title"},Pl={style:{height:"28px","line-height":"32px","margin-left":"8px"}},Ol={key:0,class:"j-drawer--btns"},Rl={key:0,class:"j-drawer-steps"},yo=K(e.defineComponent({name:"JDrawer",__name:"drawer",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},direction:{type:String,default:"rtl"},height:{type:Number,default:400},width:{type:Number,default:600},mask:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},beforeClose:{type:Function,default:void 0},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},showCloseBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},buttons:{type:Array,default:()=>[]},subtitle:{type:Function,default:void 0}},emits:["update:visible","update:stepActive","closed","ok","cancel"],setup(t,{expose:l,emit:n}){const o=t,{t:a}=we(),i=n,r=e.ref(!1),c=e.ref(""),g=e.computed(()=>["ltr","rtl"].indexOf(o.direction)!==-1?`${o.width}px`:`${o.height}px`),u=e.computed({get(){return o.visible},set($){i("update:visible",!!$)}}),d=$=>{c.value=$||"保存数据中...",r.value=!0},s=()=>{r.value=!1},m=()=>{o.isStep&&(j.value=0,e.nextTick(()=>{E()})),i("closed")},h=()=>{i("ok",d,s)},f=()=>{o.beforeClose&&o.beforeClose()===!1||(u.value=!1,i("update:visible",!1),i("cancel"))},p=async $=>{$.click&&await $.click()},C=e.ref(!1),k=e.ref(!0),b=e.ref(!1),S=e.ref(!0),V=e.ref(-1),j=e.computed({get(){return V.value!==-1?V.value:o.stepActive},set($){V.value=$,i("update:stepActive",$)}}),y=()=>{j.value>0&&j.value--,e.nextTick(()=>{E()})},w=async()=>{await v()&&(j.value<o.steps.length-1&&(j.value+=1),e.nextTick(()=>{E()}))},v=async()=>{if(C.value=!0,o.validateSteps){const $=await o.validateSteps(o.stepActive,d,s);return C.value=!1,$}return C.value=!1,!0},E=()=>{switch(S.value=!0,b.value=!0,k.value=!0,j.value){case 0:b.value=!1;break;case o.steps.length-1:k.value=!1,S.value=!1;break;default:k.value=!1,b.value=!1;break}},R=e.computed(()=>o.steps.map($=>({title:$,disabled:!0})));return l({showLoading:d,hideLoading:s}),($,_)=>{const L=e.resolveComponent("el-input"),D=e.resolveComponent("j-button"),W=e.resolveComponent("el-space"),H=e.resolveComponent("el-step"),Q=e.resolveComponent("el-steps"),X=e.resolveComponent("el-drawer"),ye=e.resolveDirective("loading");return e.openBlock(),e.createBlock(X,{modelValue:u.value,"onUpdate:modelValue":_[0]||(_[0]=Z=>u.value=Z),class:"j-drawer","append-to-body":!0,direction:t.direction,size:g.value,"with-header":!1,"wrapper-closable":!0,"destroy-on-close":t.destroyOnClose,modal:t.mask,"before-close":t.beforeClose,"close-on-click-modal":!0,onClosed:m},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["j-drawer--warpper",{"j-drawer--warpper-hasSteps":t.isStep}]),"element-loading-text":c.value},[e.createElementVNode("div",{class:"j-drawer--body",style:e.normalizeStyle({"padding-bottom":t.showCloseBtn||t.hasSaveBtn||t.buttons.length>0?"48px":"0"})},[e.createVNode(L,{style:{position:"absolute",top:"-200px"}}),e.createElementVNode("div",Ll,[e.renderSlot($.$slots,"default")]),t.hasBtns?(e.openBlock(),e.createElementBlock("div",Dl,[e.createVNode(W,{size:8},{default:e.withCtx(()=>[t.isStep?(e.openBlock(),e.createBlock(D,{key:0,size:"mini",disabled:k.value,label:e.unref(a)("上一步"),onClick:y},null,8,["disabled","label"])):e.createCommentVNode("",!0),t.isStep?(e.openBlock(),e.createBlock(D,{key:1,size:"mini",disabled:b.value,loading:C.value,label:e.unref(a)("下一步"),onClick:w},null,8,["disabled","loading","label"])):e.createCommentVNode("",!0),!t.isStep&&t.showCloseBtn?(e.openBlock(),e.createBlock(D,{key:2,size:"mini",label:e.unref(a)("取消"),onClick:f},null,8,["label"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.buttons,Z=>(e.openBlock(),e.createBlock(D,{key:Z.prop,label:Z.label,danger:Z.danger,ghost:Z.ghost,type:Z.type,icon:Z.icon,onClick:fe=>p(Z)},null,8,["label","danger","ghost","type","icon","onClick"]))),128)),t.hasSaveBtn?(e.openBlock(),e.createBlock(D,{key:3,size:"mini",type:"primary",disabled:S.value&&t.isStep,label:e.unref(a)(t.btnText),onClick:h},null,8,["disabled","label"])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)],4),e.createElementVNode("div",Il,[e.createElementVNode("div",Al,[e.createElementVNode("span",null,e.toDisplayString(e.unref(a)(t.title)),1),e.createElementVNode("span",Pl,[t.subtitle?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.subtitle()),{key:0})):e.createCommentVNode("",!0)])]),t.showCloseBtn?(e.openBlock(),e.createElementBlock("div",Ol,[e.createVNode(D,{type:"text",icon:"mdi:close",onClick:f})])):e.createCommentVNode("",!0)]),t.isStep?(e.openBlock(),e.createElementBlock("div",Rl,[e.createElementVNode("div",{style:e.normalizeStyle({maxWidth:`${200*R.value.length}px`,width:"100%"})},[e.createVNode(Q,{simple:"",active:j.value,space:160,"finish-status":"success"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(Z,fe)=>(e.openBlock(),e.createBlock(H,{key:fe,title:e.unref(a)(Z.title)},null,8,["title"]))),128))]),_:1},8,["active"])],4)])):e.createCommentVNode("",!0)],10,Fl)),[[ye,r.value]])]),_:3},8,["modelValue","direction","size","destroy-on-close","modal","before-close"])}}})),bo=K(e.defineComponent({name:"JLayer",__name:"layer",props:{width:{type:Number,default:600},height:{type:Number,default:400},isStep:{type:Boolean,default:!1},steps:{type:Array,default:()=>[]},hasHeader:{type:Boolean,default:!0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},buttons:{type:Array,default:()=>[]},destroyOnClose:{type:Boolean,default:!0},validateSteps:{type:Function,default:void 0},beforeClose:{type:Function,default:void 0}},emits:["ok","closed","cancel"],setup(t,{expose:l,emit:n}){const o=n,a=e.ref(!1),i=e.ref(""),r=e.ref(),c=e.ref(0),g=e.ref(""),u=e.ref(),d=(k,b,S)=>{i.value=k,u.value=S,g.value=b||"modal",a.value=!0},s=()=>{a.value=!1},m=(k,b)=>{o("ok",k,b)},h=()=>{c.value=0,o("closed")},f=()=>{o("cancel")},p=k=>{r.value&&r.value.showLoading(k)},C=()=>{r.value&&r.value.hideLoading()};return ml({stepActive:c}),l({open:d,close:s,showLoading:p,hideLoading:C}),(k,b)=>{const S=e.resolveComponent("j-dialog-full"),V=e.resolveComponent("j-drawer"),j=e.resolveComponent("j-dialog");return g.value==="full"?(e.openBlock(),e.createBlock(S,{key:0,ref_key:"modalRef",ref:r,visible:a.value,"onUpdate:visible":b[0]||(b[0]=y=>a.value=y),"step-active":c.value,"onUpdate:stepActive":b[1]||(b[1]=y=>c.value=y),title:i.value,"before-close":t.beforeClose,"is-step":t.isStep,steps:t.steps,"validate-steps":t.validateSteps,"has-btns":t.hasBtns,"btn-text":t.btnText,"destroy-on-close":t.destroyOnClose,buttons:t.buttons,"has-save-btn":t.hasSaveBtn,"has-header":t.hasHeader,subtitle:u.value,onOk:m,onClosed:h,onCancel:f},{default:e.withCtx(()=>[e.renderSlot(k.$slots,"default")]),_:3},8,["visible","step-active","title","before-close","is-step","steps","validate-steps","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","has-header","subtitle"])):g.value==="drawer"?(e.openBlock(),e.createBlock(V,{key:1,ref_key:"modalRef",ref:r,visible:a.value,"onUpdate:visible":b[2]||(b[2]=y=>a.value=y),"step-active":c.value,"onUpdate:stepActive":b[3]||(b[3]=y=>c.value=y),"is-step":t.isStep,steps:t.steps,"validate-steps":t.validateSteps,"has-btns":t.hasBtns,"btn-text":t.btnText,"destroy-on-close":t.destroyOnClose,buttons:t.buttons,"has-save-btn":t.hasSaveBtn,"has-header":t.hasHeader,subtitle:u.value,onOk:m,onClosed:h,onCancel:f},{default:e.withCtx(()=>[e.renderSlot(k.$slots,"default")]),_:3},8,["visible","step-active","is-step","steps","validate-steps","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","has-header","subtitle"])):(e.openBlock(),e.createBlock(j,{key:2,ref_key:"modalRef",ref:r,visible:a.value,"onUpdate:visible":b[4]||(b[4]=y=>a.value=y),"step-active":c.value,"onUpdate:stepActive":b[5]||(b[5]=y=>c.value=y),width:t.width,height:t.height,title:i.value,"before-close":t.beforeClose,"has-btns":t.hasBtns,"btn-text":t.btnText,"destroy-on-close":t.destroyOnClose,buttons:t.buttons,"has-save-btn":t.hasSaveBtn,"is-step":t.isStep,steps:t.steps,"validate-steps":t.validateSteps,subtitle:u.value,onOk:m,onClosed:h,onCancel:f},{default:e.withCtx(()=>[e.renderSlot(k.$slots,"default")]),_:3},8,["visible","step-active","width","height","title","before-close","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","is-step","steps","validate-steps","subtitle"]))}}})),Co=K(e.defineComponent({name:"JDynamicLayer",__name:"dynamic-layer",setup(t,{expose:l}){const n=e.ref(),o=e.ref(600),a=e.ref(400),i=e.ref(!0),r=e.ref(!0),c=e.ref(!0),g=e.ref(""),u=e.ref([]),d=e.ref(!0),s=e.ref(),m=e.shallowRef(),h=e.ref(),{getPageName:f}=ul(),p=()=>{const L=f();return L||(typeof m.value=="string"?m.value:"")},C=e.ref(!1),k=e.ref([]),b=async L=>{if(s.value?.validateSteps){Re(!0);const D=s.value.validateSteps(L);return Re(!1),D}return!0},S=()=>s.value?.beforeClose?s.value.beforeClose():!0;let V,j,y,w=0;const v=async L=>{if(s.value){if(w=0,s.value.getConfig){const D=s.value.getConfig();u.value=D.buttons||[],C.value=D.isStep,k.value=D.steps||[]}else u.value=[],C.value=!1,k.value=[];if(s.value.open)try{const{buttons:D}=await s.value.open(L,n.value,()=>{V&&V()})||{};if(D&&D.length>0){const W=[];W.push(...u.value),W.push(...D),u.value=W}}catch(D){n.value.close(),console.error(D)}n.value.hideLoading()}else{if(w>600){console.warn("表单组件加载超时"),n.value.hideLoading();return}w++,setTimeout(async()=>{await v(L)},100)}},E=L=>{m.value=L?.name,o.value=L?.width||600,a.value=L?.height||400,i.value=L?.hasBtns!==!1,r.value=L?.hasSaveBtn!==!1,c.value=L?.hasHeader!==!1,L?.destroyOnClose!==!1&&(d.value=!0),h.value=L?.config||{},g.value=L?.btnText||"保存",V=L?.afterOk||null,j=L?.afterClose||null,y=L?.afterCancel||null,n.value.open(L.title,L.type,L.subtitle),e.nextTick(async()=>{n.value.showLoading("加载中"),await v(L.param||{})})},R=async()=>{if(s.value?.ok){Re(!0);const L=await s.value.ok();L&&(n.value.close(),V&&await V(L)),Re(!1)}},$=()=>{s.value?.closed&&s.value.closed(),j&&j()},_=()=>{y&&y()};return fl({getPageName:p}),l({open:E}),(L,D)=>{const W=e.resolveComponent("j-layer");return e.openBlock(),e.createBlock(W,{ref_key:"layerRef",ref:n,width:o.value,height:a.value,"before-close":S,"validate-steps":b,"is-step":C.value,steps:k.value,"has-btns":i.value,buttons:u.value,"btn-text":g.value,"destroy-on-close":d.value,"has-save-btn":r.value,"has-header":c.value,onOk:R,onClosed:$,onCancel:_},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m.value),e.mergeProps({ref_key:"componentRef",ref:s},h.value),null,16))]),_:1},8,["width","height","is-step","steps","has-btns","buttons","btn-text","destroy-on-close","has-save-btn","has-header"])}}})),ko=K(e.defineComponent({name:"JInputTag",__name:"input-tag",props:{modelValue:{default:void 0},options:{default:()=>[]},placeholder:{default:"请输入标签,回车完成标签填写"},readonly:{type:Boolean,default:!1},colors:{default:()=>[]},isStyleLoop:{type:Boolean,default:!0},size:{default:"default"}},emits:["update:modelValue","change","select","search"],setup(t,{emit:l}){const n=t,o=l,a=e.ref(),i=e.computed(()=>Me(n.modelValue)?[]:n.modelValue?.split(",")||[]),r=e.computed(()=>n.isStyleLoop?i.value?.map((s,m)=>{let h=n.colors[m%n.colors.length]||{};return h={...h,borderWidth:(h.borderWidth||0)+"px"},h})||[]:n.colors),c=s=>{u(),o("select",s)},g=s=>{s.preventDefault(),s.stopPropagation()},u=()=>{if(a.value){const s=[...i.value,a.value];a.value="",o("update:modelValue",s.join(",")),o("change",{value:s.join(",")})}},d=s=>{const m=[...i.value];m.splice(s,1),o("update:modelValue",m.join(",")),o("change",{value:m.join(",")})};return(s,m)=>{const h=e.resolveComponent("el-tag"),f=e.resolveComponent("el-space"),p=e.resolveComponent("j-autocomplete");return e.openBlock(),e.createBlock(p,{modelValue:a.value,"onUpdate:modelValue":m[0]||(m[0]=C=>a.value=C),class:"j-input-tag",options:t.options,style:{width:"100%"},readonly:t.readonly,placeholder:t.placeholder,size:t.size,onSelect:c,onKeyup:e.withKeys(e.withModifiers(u,["stop"]),["enter"]),onKeydown:e.withKeys(e.withModifiers(g,["stop"]),["enter"])},{prefix:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(C,k)=>(e.openBlock(),e.createBlock(h,{key:k,type:"info",closable:!t.readonly,style:e.normalizeStyle(r.value[k]||{}),size:t.size,onClose:e.withModifiers(b=>d(k),["prevent"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C),1)]),_:2},1032,["closable","style","size","onClose"]))),128))]),_:1})]),_:1},8,["modelValue","options","readonly","placeholder","size","onKeyup","onKeydown"])}}})),wo=K(e.defineComponent({name:"JRate",__name:"rate",props:{modelValue:{default:0},max:{default:5},allowClear:{type:Boolean,default:!1},allowHalf:{type:Boolean,default:!1},showText:{type:Boolean,default:!1},showScore:{type:Boolean,default:!1},texts:{default:()=>[]},readonly:{type:Boolean,default:!1},size:{default:"default"}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,a=e.computed({get(){return Number(n.modelValue)},set(g){o("update:modelValue",g),o("change",{value:g})}}),i=e.computed(()=>n.texts?.map(g=>g.value)||[]),r=e.ref(0),c=g=>{r.value=g};return(g,u)=>{const d=e.resolveComponent("el-rate");return e.openBlock(),e.createBlock(d,{modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=s=>a.value=s),size:t.size,max:t.max,"allow-half":t.allowHalf,clearable:t.allowClear,disabled:t.readonly,"show-text":t.showText,texts:i.value,"show-score":t.showScore,onHoverChange:c},null,8,["modelValue","size","max","allow-half","clearable","disabled","show-text","texts","show-score"])}}})),Bo=K(e.defineComponent({name:"JSlider",__name:"slider",props:{modelValue:{default:0},min:{default:0},max:{default:100},readonly:{type:Boolean,default:!1},step:{default:1},showInput:{type:Boolean,default:!1},showInputControls:{type:Boolean,default:!0},size:{default:"default"},showStops:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},formatTooltip:{},range:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1},height:{},ariaLabel:{},rangeStartLabel:{},rangeEndLabel:{},formatValueText:{},tooltipClass:{},placement:{default:"top"},marks:{},validateEvent:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,a=e.computed({get(){return Number(n.modelValue)},set(i){o("update:modelValue",i),o("change",{value:i})}});return(i,r)=>{const c=e.resolveComponent("el-slider");return e.openBlock(),e.createBlock(c,{modelValue:a.value,"onUpdate:modelValue":r[0]||(r[0]=g=>a.value=g),min:t.min,max:t.max,disabled:t.readonly,step:t.step,"show-input":t.showInput,"show-input-controls":t.showInputControls,size:t.size,"input-size":t.size,"show-stops":t.showStops,"show-tooltip":t.showTooltip,"format-tooltip":t.formatTooltip,range:t.range,vertical:t.vertical,height:t.height,"aria-label":t.ariaLabel,"range-start-label":t.rangeStartLabel,"range-end-label":t.rangeEndLabel,"format-value-text":t.formatValueText,"tooltip-class":t.tooltipClass,placement:t.placement,marks:t.marks,"validate-event":t.validateEvent,persistent:t.persistent},null,8,["modelValue","min","max","disabled","step","show-input","show-input-controls","size","input-size","show-stops","show-tooltip","format-tooltip","range","vertical","height","aria-label","range-start-label","range-end-label","format-value-text","tooltip-class","placement","marks","validate-event","persistent"])}}})),ct=t=>t<1024?Ze(t)+" B":t>=1024&&t<1048576?Ze(t/1024)+" KB":t>=1048576&&t<1073741824?Ze(t/1024/1024)+" MB":t>=1073741824?Ze(t/1024/1024/1024)+" GB":"",Jl=t=>{const l=window.open("_blank");l&&(l.location=t)},Ul={key:1,style:{position:"relative",width:"72px",height:"72px",overflow:"hidden"}},Wl=["src"],Hl={class:"j-upload-dragItem-content"},ql={class:"j-upload-dragItem-mask"},Yl=["src"],_l={class:"j-upload-imgItem-mask"},Kl={class:"j-upload-item-content"},So=e.defineComponent({__name:"list",props:{isUploadImg:{type:Boolean,default:!1},drag:{type:Boolean,default:!1},showFileList:{type:Boolean,default:!0},list:{type:Array,default:()=>[]},previewFile:{type:Function,required:!0},deleteFile:{type:Function,required:!0},readonly:{type:Boolean,default:!1},isShowSuccessIcon:{type:Boolean,default:!0}},setup(t){const{t:l}=we();return(n,o)=>{const a=e.resolveComponent("j-icon"),i=e.resolveComponent("el-text"),r=e.resolveComponent("j-button"),c=e.resolveComponent("el-progress"),g=e.resolveComponent("el-link");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["j-upload-list",{"j-upload-image-list":t.isUploadImg,"j-upload-drag-list":t.drag}])},[t.drag?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.showFileList?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.list,u=>(e.openBlock(),e.createElementBlock("div",{key:u.id,class:"j-upload-dragItem"},[t.isUploadImg?(e.openBlock(),e.createElementBlock("div",Ul,[e.createElementVNode("img",{src:u.url,style:{width:"100%"},alt:""},null,8,Wl)])):(e.openBlock(),e.createBlock(a,{key:0,icon:"file-text",style:e.normalizeStyle({color:u.color?`var(${u.color})`:void 0}),size:72},null,8,["style"])),e.createElementVNode("div",Hl,[e.createVNode(i,{ellipsis:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(`${e.unref(l)(u.name)}${u.status==="unUpload"?"("+e.unref(l)("未传")+")":""}`),1)]),_:2},1024),e.createElementVNode("div",null,[u.status==="uploading"?(e.openBlock(),e.createBlock(i,{key:0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(ct)(u.uploadSize))+"/",1)]),_:2},1024)):e.createCommentVNode("",!0),e.createVNode(i,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(ct)(u.size)),1)]),_:2},1024)])]),e.withDirectives(e.createElementVNode("div",ql,[u.status==="done"||u.status==="unUpload"?(e.openBlock(),e.createBlock(r,{key:0,icon:"mdi:eye",type:"link",onClick:e.withModifiers(d=>t.previewFile(u),["stop"])},null,8,["onClick"])):e.createCommentVNode("",!0),!t.readonly&&(u.status==="done"||u.status==="unUpload")?(e.openBlock(),e.createBlock(r,{key:1,icon:"mdi:delete",type:"link",danger:"",onClick:e.withModifiers(d=>t.deleteFile(u),["stop","prevent"])},null,8,["onClick"])):e.createCommentVNode("",!0)],512),[[e.vShow,u.status==="error"]]),u.status==="uploading"?(e.openBlock(),e.createBlock(c,{key:2,"stroke-width":4,style:{position:"absolute",bottom:"-4px",left:"0",margin:"0 !important"},percent:u.percent,"show-text":!1},null,8,["percent"])):e.createCommentVNode("",!0)]))),128)):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"default")],64)):t.isUploadImg?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.list,u=>(e.openBlock(),e.createElementBlock("div",{key:u.id,class:"j-upload-imgItem"},[u.status==="done"||u.status==="unUpload"?(e.openBlock(),e.createElementBlock("img",{key:0,src:u.url,style:{width:"100%"},alt:""},null,8,Yl)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",_l,[u.status==="done"||u.status==="unUpload"?(e.openBlock(),e.createBlock(r,{key:0,type:"link",icon:"mdi:eye",onClick:e.withModifiers(d=>t.previewFile(u),["stop"])},null,8,["onClick"])):e.createCommentVNode("",!0),!t.readonly&&(u.status==="done"||u.status==="unUpload")?(e.openBlock(),e.createBlock(r,{key:1,type:"link",danger:"",icon:"mdi:delete",onClick:e.withModifiers(d=>t.deleteFile(u),["stop","prevent"])},null,8,["onClick"])):e.createCommentVNode("",!0)],512),[[e.vShow,u.status==="error"]]),u.status==="uploading"?(e.openBlock(),e.createBlock(c,{key:1,"stroke-width":4,percent:u.percent,"show-text":!1},null,8,["percent"])):e.createCommentVNode("",!0)]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(t.list,u=>(e.openBlock(),e.createElementBlock("div",{key:u.id,class:"j-upload-item"},[e.createVNode(a,{icon:"file-text",style:e.normalizeStyle({color:u.color?`var(${u.color})`:void 0}),size:16},null,8,["style"]),e.createElementVNode("div",Kl,[e.createVNode(g,{type:"primary",underline:"never",onClick:e.withModifiers(d=>t.previewFile(u),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(`${e.unref(l)(u.name)}${u.status==="unUpload"?"("+e.unref(l)("未传")+")":""}`),1)]),_:2},1032,["onClick"])]),u.status==="uploading"?(e.openBlock(),e.createBlock(i,{key:0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(ct)(u.uploadSize))+"/",1)]),_:2},1024)):e.createCommentVNode("",!0),e.createVNode(i,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(ct)(u.size)),1)]),_:2},1024),u.status==="done"&&t.isShowSuccessIcon?(e.openBlock(),e.createBlock(a,{key:1,class:"j-upload-item-success",icon:"check-circle",size:24})):e.createCommentVNode("",!0),t.readonly?e.createCommentVNode("",!0):e.withDirectives((e.openBlock(),e.createBlock(a,{key:2,class:"j-upload-item-error",icon:"delete",size:24,onClick:e.withModifiers(d=>t.deleteFile(u),["stop","prevent"])},null,8,["onClick"])),[[e.vShow,u.status==="error"]]),u.status==="uploading"?(e.openBlock(),e.createBlock(c,{key:3,style:{position:"absolute",bottom:"-4px",left:"0",margin:"0 !important"},"stroke-width":4,percent:u.percent,"show-text":!1},null,8,["percent"])):e.createCommentVNode("",!0)]))),128))],2)}}}),Gl={class:"j-upload"},Xl={key:0},Ql={style:{"margin-top":"8px"}},Zl={key:0,style:{"margin-top":"4px"}},ea={key:0,class:"j-block",style:{display:"flex","align-items":"center","justify-content":"center",overflow:"auto","overflow-x":"hidden"}},ta=["src"],oa={key:1,class:"j-block"},na=["src"],Vo=K(e.defineComponent({name:"JUpload",__name:"upload",props:{modelValue:{type:String,default:void 0},readonly:{type:Boolean,default:!1},limit:{type:Number,default:1},multiple:{type:Boolean,default:!1},maxSize:{type:Number,default:void 0},sizeType:{type:String,default:void 0},accept:{type:String,default:void 0},showFileList:{type:Boolean,default:!0},drag:{type:Boolean,default:!1},onlyName:{type:Boolean,default:!1},isTip:Boolean,placeholder:{type:String,default:"点击上传"},btnType:{type:String,default:"primary"},btnSize:{type:String,default:"default"},btnText:{type:String,default:"查看"},isNotApi:{type:Boolean,default:!1},autoUpload:{type:Boolean,default:!0},isUploadImg:{type:Boolean,default:!1},isLayer:{type:Boolean,default:!1},upload:{type:Function,default:void 0},uploadCallback:{type:Function,default:void 0},isSaveLast:{type:Boolean,default:!1},isShowSuccessIcon:{type:Boolean,default:!0}},emits:["update:modelValue","change","start","success","error","delete","load","notUploadChange"],setup(t,{emit:l}){const n=t,o=l,{warning:a,error:i,createConfirm:r,t:c,apiUrl:g,token:u,useFile:d}=we(),{fileChunkedUpload:s,deleteFile:m}=d(),h=e.computed(()=>n.isUploadImg?n.accept||"image/*":n.accept),f=e.computed(()=>{if(n.limit!==-1)return n.limit}),p=e.computed(()=>n.limit===-1?"":`,${c("上传数量")}${n.limit}`),C=e.ref(""),k=e.computed(()=>({folderId:n.modelValue||C.value,maxSize:n.maxSize,sizeType:n.sizeType})),b=e.ref([]),S=()=>{b.value=[...b.value]},V=A=>{if(n.maxSize&&n.sizeType){let q=A;switch(n.sizeType){case"GB":q=1024*1024*1024*n.maxSize;break;case"MB":q=1024*1024*n.maxSize;break;case"KB":q=1024*n.maxSize;break;default:q=n.maxSize;break}if(q<A)return!1}return!0},j={doc:"file-word",docx:"file-word",xls:"file-excel",xlsx:"file-excel",pdf:"file-pdf",image:"file-image",txt:"file-txt",json:"file-json"},y=A=>{if(A){const q=A.split(".");return q[q.length-1]}return""},w=(A,q)=>{if(q&&q.indexOf("image")>-1)return"file-image";const ee=y(A);return["webp","bmp","jpg","jpge","png","tif","gif","svg"].includes(ee)?"file-image":j[ee]||"file-ufo"},v=A=>{A.status=n.autoUpload?"uploading":"unUpload",A.uploadSize=0,A.icon=w(A.name,A.type),s||(A.icon="file-text"),A.id=A.uid,A.url=window.URL.createObjectURL(A),A.date=tt(),A.param=k.value},E=A=>{o("start",{file:A,list:b.value})},R=(A,q,ee)=>{A.percent=ee,A.uploadSize=q,S()},$=A=>{A.status="done",A.id+="1",A.uid+="1",S(),o("success",{file:A,list:b.value}),n.modelValue||(o("update:modelValue",C.value),o("change",{value:C.value}))},_=(A,q)=>{console.error(q,"简搭提醒您:文件上传错误!"),A.status="error",S(),o("error",{file:A,list:b.value})},L=A=>{if(b.value.push(A),A.status==="unUpload"){o("notUploadChange",{value:A.url});return}!n.isNotApi&&n.upload?n.upload(A):!n.isNotApi&&s?s(A,{onStart:E,onProgress:R,onSuccess:$,onError:_,uploadCallback:n.uploadCallback}):$(A)},D=A=>{if(!V(A.size))return i&&i("上传文件超出大小了"),!1},W=A=>{v(A.file),L(A.file)},H=A=>new Promise(q=>{r?r({title:"提示",iconType:"warning",content:`您确定删除【${A.name}】?`,onOk:()=>{q(!0)},onCancel:()=>{q(!1)}}):(Q(A),q(!0))}),Q=A=>{if(!n.isNotApi){const q=A.response?.fileId||A.id;m&&m(q)}b.value=b.value.filter(q=>q.id!==A.id),b.value.length===0&&(o("update:modelValue",""),o("change",{value:""})),o("delete",{file:A,list:b.value})},X=async A=>{await H(A)&&Q(A)},ye=e.ref(!1),Z=e.ref(""),fe=e.ref(""),Ve=e.ref(!1),me=e.ref(!1);let J=null;const pe=e.ref(tt(new Date,"YYYY-MM-DD")),oe=A=>{if(A.isPreview===!1&&!n.isUploadImg){a&&a("无权限预览!");return}const q=A.name.split(".")[A.name.split(".").length-1];switch(J=A,ye.value=!1,Z.value=A.name,q.toLowerCase()){case"jpg":case"gif":case"png":case"bmp":case"jpeg":case"svg":ye.value=!0,fe.value=A.url,me.value=!1,Ve.value=!0;break;default:if(n.isNotApi){a&&a("预览表单中,不支持预览!");return}if(A.status!=="done"){a&&a("当前文件还没上传成功,不支持预览!");return}if(fe.value=ne(A),fe.value===""){a&&a("当前文件不支持预览!");return}me.value=!0,Ve.value=!0;break}pe.value=tt(new Date,"YYYY-MM-DD HH:mm:ss")},ne=A=>{const q=A.response?.fileId||A.id;if(!g)return"";const ee=tt(new Date,"YYYY-MM-DD HH:mm:ss")+"|"+q,ce=Xt.createAesEncryption({key:"jianda"}).encrypt(ee).replace(/\//g,"|");return`${g}/system/annexesfile/preview/${ce}?token=${u?.value}`},he=()=>{J.isDown===!1&&a&&a("无权限下载!");const A=J.response?.fileId||J.id,q=`${g}/system/annexesfile/${A}?token=${u?.value}`;Jl(q)},Be=()=>{if(n.limit!==-1&&n.limit<=b.value.length)return a&&a(`当前限制选择${n.limit}个文件`),!1};return(A,q)=>{const ee=e.resolveComponent("j-icon"),ce=e.resolveComponent("j-button"),be=e.resolveComponent("el-popover"),Se=e.resolveComponent("el-upload"),ie=e.resolveComponent("el-text"),ve=e.resolveComponent("j-dialog-full"),Fe=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Gl,[e.createVNode(Se,{action:"",drag:t.drag,disabled:t.readonly,"show-file-list":t.isUploadImg&&!t.isLayer&&t.showFileList,"list-type":t.isUploadImg&&!t.isLayer?"picture-card":void 0,accept:h.value,limit:f.value,multiple:t.multiple,"before-upload":D,"http-request":W,"file-list":b.value,"before-remove":H,"on-remove":Q,"on-preview":oe,"on-exceed":Be},{default:e.withCtx(()=>[t.isUploadImg&&!t.isLayer&&!t.readonly?(e.openBlock(),e.createElementBlock("div",Xl,[e.createVNode(ee,{icon:"mdi:add"}),e.createElementVNode("div",Ql,e.toDisplayString(e.unref(c)(t.placeholder)),1)])):t.isLayer&&t.showFileList&&b.value.length>0&&!Ve.value?(e.openBlock(),e.createBlock(be,{key:1,placement:"bottom",title:t.isUploadImg?e.unref(c)("图片列表"):e.unref(c)("文件列表")},{content:e.withCtx(()=>[e.createVNode(So,{style:e.normalizeStyle({width:t.isUploadImg?void 0:"400px"}),list:b.value,"preview-file":oe,"delete-file":X,"is-upload-img":t.isUploadImg,readonly:t.readonly},null,8,["style","list","is-upload-img","readonly"])]),default:e.withCtx(()=>[e.createVNode(ce,{type:t.btnType,size:t.btnSize,icon:"mdi:tray-upload",label:t.readonly?e.unref(c)(t.btnText):t.placeholder},null,8,["type","size","label"])]),_:1},8,["title"])):t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ce,{key:2,type:t.btnType,size:t.btnSize,icon:"mdi:tray-upload",label:t.placeholder},null,8,["type","size","label"]))]),_:1},8,["drag","disabled","show-file-list","list-type","accept","limit","multiple","file-list"]),t.isTip?(e.openBlock(),e.createElementBlock("div",Zl,[e.createVNode(ie,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(`${e.unref(c)("只能上传不超过{0}的{1}文件",`${t.maxSize}${t.sizeType}`,`${h.value||""}`)},${p.value}`),1)]),_:1})])):e.createCommentVNode("",!0),!t.isLayer&&!t.isUploadImg&&t.showFileList&&b.value.length>0?(e.openBlock(),e.createBlock(So,{key:1,style:{"margin-top":"4px"},list:b.value,"preview-file":oe,"delete-file":X,readonly:t.readonly,"is-show-success-icon":t.isShowSuccessIcon},null,8,["list","readonly","is-show-success-icon"])):e.createCommentVNode("",!0),e.createVNode(ve,{visible:Ve.value,"onUpdate:visible":q[1]||(q[1]=ze=>Ve.value=ze),"btn-text":"下载",title:`${e.unref(c)("文件预览")}【${Z.value}】`,"destroy-on-close":!0,"has-btns":!!e.unref(g),onOk:he},{default:e.withCtx(()=>[ye.value&&fe.value?(e.openBlock(),e.createElementBlock("div",ea,[e.createElementVNode("img",{width:"100%",style:{"max-width":"1024px"},src:fe.value,alt:""},null,8,ta)])):fe.value!=""?e.withDirectives((e.openBlock(),e.createElementBlock("div",oa,[e.createElementVNode("iframe",{ref:"iframe",src:fe.value,style:{width:"100%",height:"100%"},frameborder:"0",onLoad:q[0]||(q[0]=ze=>me.value=!1)},null,40,na)])),[[Fe,me.value]]):e.createCommentVNode("",!0)]),_:1},8,["visible","title","has-btns"])])}}})),la=e.defineComponent({name:"JEcharts",__name:"echarts",props:{option:{type:Object,required:!0},theme:{type:[String,Object],default:""},initOptions:{type:Object,default:()=>({})},notMerge:{type:Boolean,default:!1},updateDelay:{type:Number,default:0}},emits:["click","ready"],setup(t,{expose:l,emit:n}){const o=t,a=n,i=e.ref(),r=e.shallowRef();let c=null,g=null;const u=async()=>{i.value&&(r.value=Fn.init(i.value,o.theme,o.initOptions),d(o.option),r.value&&r.value.on("click",f=>{a("click",f)}),typeof window<"u"&&window.ResizeObserver&&(c=new ResizeObserver(()=>{r.value?.resize()}),c.observe(i.value)),r.value&&a("ready",r.value))},d=f=>{r.value&&(g&&clearTimeout(g),o.updateDelay>0?g=setTimeout(()=>{r.value?.setOption(f,o.notMerge)},o.updateDelay):r.value.setOption(f,o.notMerge))};return e.watch(()=>o.option,f=>{d(f)},{deep:!0}),e.onMounted(()=>{u()}),e.onUnmounted(()=>{g&&clearTimeout(g),c&&i.value&&(c.unobserve(i.value),c.disconnect(),c=null),r.value&&(r.value.dispose(),r.value=void 0)}),l({getInstance:()=>r.value,resize:f=>{r.value?.resize(f)},clear:()=>{r.value?.clear()}}),(f,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"chartRef",ref:i,class:"j-echarts"},null,512))}}),xo=(t,l)=>{const n=t.__vccOpts||t;for(const[o,a]of l)n[o]=a;return n},jo=K(xo(la,[["__scopeId","data-v-69ad659b"]])),aa=["innerHTML"],ia={key:1,class:"j-barcode-error"},No=K(e.defineComponent({name:"JBarcode",__name:"barcode",props:{bcid:{type:String,required:!0},modelValue:{type:String,required:!0},scale:{type:Number,default:2},scaleX:{type:Number,default:null},scaleY:{type:Number,default:null},height:{type:Number,default:10},width:{type:Number,default:void 0},rotate:{type:String,default:"N"},barcolor:{type:String,default:"000000"},backgroundcolor:{type:String,default:""},padding:{type:Number,default:0},paddingwidth:{type:Number,default:null},paddingheight:{type:Number,default:null},inkspread:{type:Number,default:0},includetext:{type:Boolean,default:!0},alttext:{type:String,default:""},textfont:{type:String,default:"OCR-B"},textsize:{type:Number,default:10},textxalign:{type:String,default:"center"},textyalign:{type:String,default:void 0},textxoffset:{type:Number,default:0},textyoffset:{type:Number,default:0},textcolor:{type:String,default:""},includecheck:{type:Boolean,default:!1},includecheckintext:{type:Boolean,default:!1},parse:{type:Boolean,default:!1},parsefnc:{type:Boolean,default:!1},guardwhitespace:{type:Boolean,default:!1},guardwidth:{type:Number,default:null},eclevel:{type:[String,Number],default:"M"},version:{type:[Number,String],default:""},format:{type:String,default:""},columns:{type:Number,default:null},rows:{type:Number,default:null},errorlevel:{type:Number,default:null}},setup(t){const l=t,n=e.ref(""),o=e.ref(""),a=d=>{if(d.length!==13)throw new Error("GTIN must be 13 digits for checksum calculation");let s=0;for(let h=12;h>=0;h--){const f=parseInt(d[h]),C=(13-h)%2===1?3:1;s+=f*C}return(10-s%10)%10},i=d=>{const s=/\(01\)(\d{14})/,m=d.match(s);if(!m)return d;const h=m[1],f=h.substring(0,13),p=parseInt(h[13]),C=a(f);if(p!==C){const k=f+C;return d.replace(s,`(01)${k}`)}return d},r=d=>{if(!/^\d+$/.test(d))return d;const s={11:10,45:18,59:18,62:25},m=Object.keys(s);let h=null;for(const k of m)if(d.startsWith(k)){h=k;break}let f=d,p=!1;if(!h){const k=d.length;if(k<=8)f="11"+d.substring(0,8),p=!0,h="11";else if(k<=16){const b=d.substring(0,8),S=d.substring(8,16);f="59"+b+S,p=!0,h="59"}else{const S=d.substring(0,23),V=S.substring(0,8),j=S.substring(8,23);f="62"+V+j,f.length!==25&&(f=f.substring(0,25)),p=!0,h="62"}}if(h&&!p){const k=s[h];f.length>k&&(f=f.substring(0,k))}let C=null;for(const k of m)if(f.startsWith(k)){C=k;break}if(C){const k=s[C];f.length>k&&(f=f.substring(0,k))}else console.error("AUSPOST: 无法检测到有效的FCC,结果:",f);return/^\d+$/.test(f)?(f.length>25&&(console.error("AUSPOST: 返回值长度超过25位:",f.length,f),f=f.substring(0,25)),f):(console.error("AUSPOST: 返回值不是纯数字:",f),d)},c=d=>{if(!/^\d+$/.test(d))throw new Error("PZN must contain only digits");if(d.length===7){const s=d.substring(0,6);let m=0;for(let f=0;f<6;f++){const p=parseInt(s[f]),C=f+2;m+=p*C}const h=m%11;return h===10?null:h}else if(d.length===8){const s=d.substring(0,7);let m=0;for(let f=0;f<7;f++){const p=parseInt(s[f]),C=f+1;m+=p*C}const h=m%11;return h===10?null:h}else throw new Error("PZN must be 7 or 8 digits")},g=d=>{if(!/^\d+$/.test(d)||d.length!==7&&d.length!==8)return d;try{const s=c(d);if(s===null)return d;if(d.length===7){const m=d.substring(0,6);if(parseInt(d[6])!==s)return m+s}else if(d.length===8){const m=d.substring(0,7);if(parseInt(d[7])!==s)return m+s}}catch(s){console.warn("PZN checksum calculation failed:",s.message)}return d},u=()=>{try{o.value="";const d={...l};Object.keys(d).forEach(f=>{(d[f]===null||d[f]===""||d[f]===void 0)&&delete d[f]}),d.bcid==="codabar"&&(d.bcid="rationalizedCodabar"),d.bcid==="uspsonecode"&&(d.bcid="onecode"),d.bcid==="datamatrixrect"&&(d.bcid="datamatrix",d.format||(d.format="rectangle")),d.bcid==="datamatrix"&&d.format==="rect"&&(d.format="rectangle");const s=["offleft","left","center","right","offright"];if(d.textxalign&&!s.includes(d.textxalign)&&(console.warn(`Invalid textxalign value: ${d.textxalign}. Using default 'center'. Valid values: ${s.join(", ")}`),d.textxalign="center"),(d.bcid==="pdf417"||d.bcid==="micropdf417")&&delete d.eclevel,(d.bcid==="qrcode"||d.bcid==="microqrcode")&&delete d.errorlevel,d.bcid==="azteccode"&&(delete d.errorlevel,d.eclevel&&typeof d.eclevel=="string"&&/^[LMQH]$/i.test(d.eclevel)&&delete d.eclevel),d.bcid==="hanxin")if(delete d.errorlevel,d.eclevel&&typeof d.eclevel=="string"){const f={L:"L1",M:"L2",Q:"L3",H:"L4"},p=d.eclevel.toUpperCase();f[p]?d.eclevel=f[p]:/^L[1-4]$/i.test(d.eclevel)||(d.eclevel="L1")}else d.eclevel||(d.eclevel="L1");let m=d.modelValue;if(l.bcid==="gs1-128"&&typeof m=="string")try{m=i(m),m!==d.modelValue&&console.warn(`GS1-128 AI 01 checksum corrected: ${d.modelValue} -> ${m}`)}catch(f){console.warn("GS1 checksum validation failed:",f.message)}if(l.bcid==="auspost"&&typeof m=="string")try{const f=m;if(m=r(m),m!==f){const p=f.length>m.length,C=m.match(/^(11|45|59|62)/),k=C?C[1]:"unknown";console.warn(p?`AUSPOST 值已调整: ${f} -> ${m} (长度: ${f.length} -> ${m.length}, FCC: ${k})`:`AUSPOST FCC 已添加: ${f} -> ${m} (FCC: ${k}, 长度: ${m.length})`)}}catch(f){console.error("[AUSPOST] FCC validation failed:",f),console.warn("AUSPOST FCC validation failed:",f.message)}if(l.bcid==="pzn"&&typeof m=="string")try{const f=m;m=g(m),m!==f&&console.warn(`PZN checksum corrected: ${f} -> ${m}`)}catch(f){console.warn("PZN checksum validation failed:",f.message)}d.text=m,delete d.modelValue,l.bcid==="auspost"&&typeof m=="string"&&m.match(/^(11|45|59|62)/)&&(m.length>20?(d.custinfoenc="numeric",console.log(`[AUSPOST] 值长度 ${m.length} > 20,使用数字编码 (custinfoenc=numeric)`)):/^\d+$/.test(m)&&(d.custinfoenc="numeric",console.log("[AUSPOST] 值全是数字,使用数字编码 (custinfoenc=numeric)"))),l.scaleX||(d.scaleX=l.scale),l.scaleY||(d.scaleY=d.scaleX),["qrcode","microqrcode","datamatrix","datamatrixrect","pdf417","micropdf417","azteccode","hanxin"].includes(d.bcid)&&(d.width||(d.width=d.height));const h=wn.toSVG(d);n.value=h}catch(d){console.error("BWIP-JS Render Error:",d);let s=d.message||"条码数据或参数错误";d.message&&d.message.includes("Bad checksum")&&l.bcid==="gs1-128"?s=`GS1-128 校验位错误: ${d.message}。请确保 AI 01 的14位数字包含正确的校验位。`:d.message&&d.message.includes("GS1badChecksum")?s=`GS1 校验位错误: ${d.message}。请检查应用标识符 (AI) 的数据格式和校验位是否正确。`:d.message&&d.message.includes("auspostBadFCC")&&l.bcid==="auspost"?s=`AUSPOST FCC 错误: ${d.message}。AUSPOST 条码必须以有效的 FCC (Format Control Code) 开头:11, 45, 59 或 62。如果值未以有效的 FCC 开头,系统会自动添加合适的 FCC。`:d.message&&d.message.includes("auspostTooLong")&&l.bcid==="auspost"?s=`AUSPOST 长度错误: ${d.message}。AUSPOST 条码长度限制:FCC 11 (10位), FCC 59 (18位), FCC 62 (25位,最大容量)。如果值超过限制,系统会自动截断并使用合适的 FCC。`:d.message&&d.message.includes("pznBadCheckDigit")&&l.bcid==="pzn"&&(s=`PZN 校验位错误: ${d.message}。PZN (德国医药产品编号) 必须是7位或8位数字,包含正确的校验位。如果校验位不正确,系统会自动修复。`),o.value=s,n.value=""}};return e.watchEffect(u),(d,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"j-barcode",innerHTML:n.value},null,8,aa)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",ia,e.toDisplayString(o.value),1)):e.createCommentVNode("",!0)],64))}})),vo=K(e.defineComponent({name:"JCount",__name:"count",props:{modelValue:{default:void 0},formatJson:{default:void 0},decimal:{default:void 0},thousandSeparator:{type:Boolean,default:!1},isChinese:{type:Boolean,default:!1},tableIndex:{default:void 0},getData:{type:Function,default:void 0},size:{default:"default"}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=(...y)=>{y=y.flat();let w=0;for(let v=0;v<y.length;v++)w+=y[v];return w/y.length},a=(y,w)=>w<0?-Math.ceil(y/Math.abs(w))*w||0:Math.ceil(y/w)*w||0,i=(...y)=>(y=y.flat(),y.length),r=(y,w)=>{let v=0;if(Array.isArray(y))if(/[><=]/.test(w)){const E=w.match(/^([><=]+)(.+)$/);if(E){const R=E[1],$=Number(E[2]);for(let _=0;_<y.length;_++)try{const L=Number(y[_]);let D=!1;switch(R){case">":D=L>$;break;case"<":D=L<$;break;case">=":D=L>=$;break;case"<=":D=L<=$;break;case"==":case"===":D=L===$;break;case"!=":case"!==":D=L!==$;break}D&&v++}catch{console.log("计算失败");break}}}else for(let E=0;E<y.length;E++)y[E]===w&&v++;return v},c=(y,w)=>y.toFixed(w),g=(y,w)=>w<0?-Math.floor(y/Math.abs(w))*w||0:Math.floor(y/w)*w||0,u=(y,w)=>{if(Array.isArray(y))return y.sort((v,E)=>E-v),y[w-1]},d=(y,w)=>{if(Array.isArray(y))return y.sort((v,E)=>v-E),y[w-1]},s=(y,w)=>Math.log(y)/Math.log(w),m=(y,w)=>y%w,h=(...y)=>{y=y.flat();let w=1;for(let v=0;v<y.length;v++)w*=y[v];return w},f=(y,w)=>{const v=y.toFixed(w);return Number(v)},p=(...y)=>{y=y.flat();let w=0;for(let v=0;v<y.length;v++)w+=Number(y[v]);return w},C=(...y)=>y[0].map((E,R)=>{let $=E;for(let _=1;_<y.length;_++)$*=y[_][R]||0;return $}).reduce((E,R)=>E+R,0),k=l,{getValue:b}=_e(),S=y=>{const w=b({id:y});if(nt(w)){const E=[];return w.forEach(R=>{const $=Number(R);Number.isNaN($)?E.push(0):E.push($)}),E}const v=Number(w);return Number.isNaN(v)?0:v},V=e.computed(()=>{if(!b)return"";const y=JSON.parse(n.formatJson||"[]");let w="";for(let R=0;R<y.length;R++){const $=y[R];if($.type==="fun"&&$.value!=="("&&$.value!==")")if(["abs","max","min","sqrt"].includes($.value))w+=`Math.${$.value}`;else if(["int","power","rand"].includes($.value))switch($.value){case"int":w+="Math.floor";break;case"power":w+="Math.pow";break;case"rand":w+="Math.random";break}else w+=`${$.value}Fun`;else $.type==="comp"?w+=`getCompValue('${$.value}')`:$.value==="i"&&n.tableIndex!==void 0?w+=n.tableIndex:w+=$.value}if(!w)return"";w=`(
1
+ (function(M,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@iconify/vue"),require("dayjs"),require("crypto-js/aes"),require("crypto-js/enc-utf8"),require("crypto-js/pad-pkcs7"),require("crypto-js/enc-base64"),require("crypto-js/md5"),require("crypto-js/sha256"),require("crypto-js/sha512"),require("sortablejs"),require("@visactor/vtable"),require("echarts"),require("@bwip-js/browser"),require("countup.js"),require("sql-formatter"),require("codemirror"),require("@codemirror/view"),require("@codemirror/state"),require("@codemirror/lang-javascript"),require("@codemirror/lang-css"),require("@codemirror/lang-html"),require("@codemirror/lang-json"),require("@codemirror/lang-sql"),require("@codemirror/lang-xml"),require("@codemirror/lang-python"),require("@codemirror/lang-markdown"),require("@codemirror/lang-java"),require("@codemirror/autocomplete"),require("@codemirror/commands"),require("@codemirror/language"),require("async-validator"),require("@wangeditor/editor")):typeof define=="function"&&define.amd?define(["exports","vue","@iconify/vue","dayjs","crypto-js/aes","crypto-js/enc-utf8","crypto-js/pad-pkcs7","crypto-js/enc-base64","crypto-js/md5","crypto-js/sha256","crypto-js/sha512","sortablejs","@visactor/vtable","echarts","@bwip-js/browser","countup.js","sql-formatter","codemirror","@codemirror/view","@codemirror/state","@codemirror/lang-javascript","@codemirror/lang-css","@codemirror/lang-html","@codemirror/lang-json","@codemirror/lang-sql","@codemirror/lang-xml","@codemirror/lang-python","@codemirror/lang-markdown","@codemirror/lang-java","@codemirror/autocomplete","@codemirror/commands","@codemirror/language","async-validator","@wangeditor/editor"],n):(M=typeof globalThis<"u"?globalThis:M||self,n(M.SimCodeUI={},M.Vue,M.IconifyVue,M.dayjs,M.CryptoJS.AES,M.CryptoJS.enc.Utf8,M.CryptoJS.pad.Pkcs7,M.CryptoJS.enc.Base64,M.CryptoJS.MD5,M.CryptoJS.SHA256,M.CryptoJS.SHA512,M.Sortable,M.VTable,M.echarts,M.bwipjs,M.CountUp,M.SqlFormatter,M.CodeMirror,M.CodeMirrorView,M.CodeMirrorState,M.CodeMirrorLangJavaScript,M.CodeMirrorLangCSS,M.CodeMirrorLangHTML,M.CodeMirrorLangJSON,M.CodeMirrorLangSQL,M.CodeMirrorLangXML,M.CodeMirrorLangPython,M.CodeMirrorLangMarkdown,M.CodeMirrorLangJava,M.CodeMirrorAutocomplete,M.CodeMirrorCommands,M.CodeMirrorLanguage,M.AsyncValidator,M.WangEditor))})(this,(function(M,n,ft,ji,vs,Vi,Cs,Ti,ks,xs,Ss,Bs,Es,_s,js,Vs,Ts,Ns,Ze,So,zt,$s,Ms,Ls,Ps,Rs,As,Os,Fs,Bo,Eo,Dt,Is,Ni){"use strict";function $i(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const _o=$i(Es),zs=$i(_s),te=e=>(e.install=t=>{t.component(e.name,e)},e);function Mn(e){return e&&Array.isArray(e)}function Mi(e,t){return toString.call(e)===`[object ${t}]`}function Ds(e){return e!==null&&Mi(e,"Object")}const it=e=>!!(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0||typeof e=="object"&&Object.keys(e).length===0),Nt=n.defineComponent({name:"JIcon",inheritAttrs:!1,__name:"icon",props:{icon:{},size:{default:16},color:{default:void 0},rotate:{default:void 0},isDiv:{type:Boolean,default:!0}},setup(e){const t=e,o=n.computed(()=>{const a=t.icon;if(a.indexOf(":")===-1)return ft.getIcon(`jcode:${t.icon}`)==null,`jcode:${t.icon}`;const r=`jcode:${a.split(":")[1]}`;return ft.getIcon(r)!=null?r:a}),i=n.computed(()=>({size:t.size,color:t.color,icon:o.value}));return(a,l)=>e.isDiv?(n.openBlock(),n.createElementBlock("div",n.mergeProps({key:0},a.$attrs,{class:"j-icon jicon",style:{height:`${e.size}px`}}),[n.createVNode(n.unref(ft.Icon),n.mergeProps(i.value,{height:`${e.size}px`,width:`${e.size}px`,mode:"svg",style:`transform:rotate(${e.rotate||0}deg)`}),null,16,["height","width","style"])],16)):(n.openBlock(),n.createElementBlock("span",n.mergeProps({key:1},a.$attrs,{class:"jicon"}),[n.createVNode(n.unref(ft.Icon),n.mergeProps(i.value,{height:`${e.size}px`,width:`${e.size}px`,mode:"svg",style:`transform:rotate(${e.rotate||0}deg)`}),null,16,["height","width","style"])],16))}}),Hs=["disabled"],Ws={key:2},Li=te(n.defineComponent({name:"JButton",__name:"button",props:{type:{type:String,default:"default"},size:{type:String,default:"default"},shape:{type:String,default:"default"},ghost:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},danger:{type:Boolean,default:!1},block:{type:Boolean,default:!1},loading:{type:[Boolean,Object],default:()=>!1},icon:{type:String,default:""},href:{type:String,default:""},target:{type:String,default:"_self"},label:{type:String,default:""},notLabel:{type:Boolean,default:!1},compact:Boolean,lastCompactItem:Boolean,firstCompactItem:Boolean},emits:["click"],setup(e,{expose:t,emit:o}){const i=e,a=o,l=p=>{!f.value&&!i.disabled&&(a("click",p),i.href&&window.open(i.href,i.target?i.target:"_self"))},r=n.shallowRef(null),s=()=>{r.value?.focus()},d=()=>{r.value?.blur()},c=n.computed(()=>i.notLabel||!i.label),f=n.ref(!1);n.watch(()=>i.loading,p=>{if(typeof p=="boolean")f.value=p;else if(it(p?.delay))f.value=!1;else{const h=setTimeout(()=>{f.value=!0},p.delay);return()=>clearTimeout(h)}},{immediate:!0});const u=n.computed(()=>i.label||"");return t({focus:s,blur:d}),(p,h)=>(n.openBlock(),n.createElementBlock("button",{ref_key:"buttonNodeRef",ref:r,type:"button",class:n.normalizeClass(["j-button",{"j-button-primary":e.type=="primary","j-button-default":e.type=="default","j-button-dashed":e.type=="dashed","j-button-link":e.type=="link","j-button-text":e.type=="text","j-button-ghost":e.ghost==!0,"j-button-danger":e.danger==!0,"j-button-lg":e.size=="large","j-button-sm":e.size=="small","j-button-circle":e.shape=="circle","j-button-round":e.shape=="round","j-button-block":e.block==!0,"j-button-loading":f.value==!0,"j-button-icon-only":c.value==!0,"j-button-compact":e.compact==!0,"j-button-last-compact-item":e.lastCompactItem==!0,"j-button-first-compact-item":e.firstCompactItem==!0}]),disabled:e.disabled,onClick:n.withModifiers(l,["stop"])},[f.value?(n.openBlock(),n.createBlock(Nt,{key:0,icon:"mdi:loading",size:e.size=="large"?14:12,class:"loading-spin j-button-loading-icon"},null,8,["size"])):n.createCommentVNode("",!0),e.icon?(n.openBlock(),n.createBlock(Nt,{key:1,icon:e.icon},null,8,["icon"])):n.createCommentVNode("",!0),e.notLabel?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Ws,n.toDisplayString(u.value),1)),n.renderSlot(p.$slots,"iconAfter")],10,Hs))}}));function cn(e){Object.keys(e||{}).forEach(t=>{delete e[t]})}function Pi(e){const{toString:t}=Object.prototype,o={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"};return typeof Element<"u"&&e instanceof Element?"element":o[t.call(e)]}function pt(e){const t=Pi(e);let o;if(t==="array")o=[];else if(t==="object")o={};else return e;if(t==="array")for(let i=0,a=e.length;i<a;i++)e[i]=(e[i]===0,e[i]),e[i]&&delete e[i].$parent,o.push(pt(e[i]));else t==="object"&&Object.keys(e).forEach(i=>{e&&delete e.$parent,o[i]=pt(e[i])});return o}function Ln(e,t,o=[]){Object.keys(t).forEach(i=>{o.indexOf(i)===-1&&(e[i]=t[i])})}const dn=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const o=Math.random()*16|0;return(t==="x"?o:o&3|8).toString(16)});let jo=0;function Pn(e=""){const t=Date.now(),o=Math.floor(Math.random()*1e9);return jo++,e?e+"_"+o+jo+String(t):o+jo+String(t)}const Vo=e=>{if(e)try{const t=new Function("return "+e)();return typeof t=="function"?{res:!0,msg:"ok",fn:t}:(console.warn("此方法不是一个函数",e),{res:!1,msg:"此方法不是一个函数"})}catch(t){return console.warn(t,e),{res:!1,msg:t}}else return{res:!1,msg:"没设置脚本函数"}};function Ri(e,t,o){if(!e||typeof e!="object")return e;const i=Array.isArray(t)?t:t.replace(/\[(\d+)\]/g,".$1").split(".").filter(Boolean);if(i.length===0)return e;let a=e;for(let l=0;l<i.length-1;l++){const r=i[l],s=i[l+1];(!(r in a)||typeof a[r]!="object"||a[r]===null)&&(a[r]=/^\d+$/.test(s)?[]:{}),a=a[r]}return a[i[i.length-1]]=o,e}const un=e=>{let t=parseFloat(e);return isNaN(t)?0:(t=Math.round(e*100)/100,t)},Us=function(e,t,o){const i=(e-1)*t;return i+t>=o.length?o.slice(i,o.length):o.slice(i,i+t)},Js=function(e,t){const o=(e.page-1)*e.rows,i=o+e.rows>=t.length?t.slice(o,t.length):t.slice(o,o+e.rows);return{rows:i,total:t.length,page:e.page,records:i.length}},Ys=function(e){return e.filter((t,o,i)=>i.indexOf(t,0)===o)},Ai=e=>{if(!/^\d*(\.\d*)?$/.test(e))return"Number is wrong!";const t=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],o=["","十","百","千","万","亿","点",""],i=(""+e).replace(/(^0*)/g,"").split(".");let a=0,l="";for(let r=i[0].length-1;r>=0;r--){switch(a){case 0:l=o[7]+l;break;case 4:new RegExp("0{4}\\d{"+(i[0].length-r-1)+"}$").test(i[0])||(l=o[4]+l);break;case 8:l=o[5]+l,o[7]=o[5],a=0;break}a%4===2&&i[0].charAt(r+2)!=="0"&&i[0].charAt(r+1)==="0"&&(l=t[0]+l),i[0].charAt(r)!=="0"&&(l=t[Number(i[0].charAt(r))]+o[a%4]+l),a++}if(i.length>1){l+=o[6];for(let r=0;r<i[1].length;r++)l+=t[Number(i[1].charAt(r))]}return l},Oi=e=>{const t=(e+"").split("."),o=t[0]+"",i=t[1]||"",a=o.length%3;let l=o.substring(0,a);for(let r=0;r<Math.floor(o.length/3);r++)l+=","+o.substring(a+r*3,a+(r+1)*3);return a===0&&(l=l.substring(1)),e=l+(i?"."+i:""),e},fn=e=>{if(!e)return;if(typeof document>"u"||!document.body)return e.length*7;const t=document.createElement("span");t.style.fontSize="14px",t.style.visibility="hidden",t.style.position="absolute",t.innerText=e,document.body.appendChild(t);const o=t.offsetWidth;return document.body.removeChild(t),o};function Fi(e){return e==null||e===void 0||e===""?"":e===e.toUpperCase()?e.split("_").map(i=>(i=i.toLowerCase(),i.slice(0,1).toUpperCase()+i.slice(1))).join(""):e.slice(0,1).toUpperCase()+e.slice(1)}function qs(e,t=!0){if(e==null||e===void 0||e==="")return"";t&&(e=Fi(e));let o="";for(let i=0,a=e.length;i<a&&(o+=e[i].toLowerCase(),!(i<a-1&&e[i+1]===e[i+1].toLowerCase()||i<a-2&&e[i+2]===e[i+2].toLowerCase()));i++);if(o.length<e.length)for(let i=o.length,a=e.length;i<a;i++)o+=e[i];return o}function Ii(e,t,o){const i={},a={};return e.forEach(l=>{i[l[o]]=i[l[o]]||[],i[l[o]].push(l),a[l[t]]=l}),{group:i,map:a}}function To(e,t,o,i,a,l){const r=[];return e==null?Object.keys(t.group).forEach(s=>{(!l||l.indexOf(s)===-1)&&(t.map[s]||t.group[s].forEach(c=>{(!l||l.indexOf(c[o])===-1)&&(i&&(c.value=c[i]),a&&(c.label=c[a]),t.group[c[o]]&&t.group[c[o]].length>0&&(c.children=To(t.group[c[o]],t,o,i,a,l)),r.push(c))}))}):e.forEach(s=>{(!l||l.indexOf(s[o])===-1)&&(i&&(s.value=s[i]),a&&(s.label=s[a]),t.group[s[o]]&&t.group[s[o]].length>0&&(s.children=To(t.group[s[o]],t,o,i,a,l)),r.push(s))}),r}function Gs(e,t,o,i,a,l){if(e.length===0||!t&&!e[0]._id)return e;const r=t||"_id";o=o||"_pid";let s=[],d={};if(i?e.forEach(f=>{d[f[i]]||(d[f[i]]=!0,s.push(pt(f)))}):s=e,d={},r===o){const f=[];return s.forEach(u=>{(!l||l.indexOf(u[r])===-1)&&(i&&(u.value=u[i]),a&&(u.label=u[a]),f.push(u))}),f}const c=Ii(s,r,o);return To(null,c,r,i,a,l)}const zi=(e,t,o,i)=>{o=o||[];for(let a=0,l=o.length;a<l;a++){const r=o[a],s={};s._id=r.prop||`${t}_${a}`,s._pid=t,Object.keys(r).forEach(c=>{(!i||i.indexOf(c)===-1)&&(s[c]=r[c])}),e.push(s);const d=r.children||[];d.length>0&&(s._hasChildren=!0,zi(e,s._id,d))}},Di=(e,t)=>{const o=[];return zi(o,"0",e,t),o},Hi=(e,t,o,i)=>{t=t||[];for(let a=0,l=t.length;a<l;a++){const r=t[a],s={value:r[o],label:r[i]};e.push(s);const d=r.children||[];d.length>0&&(s.children=[],Hi(s.children,d,o,i))}},Ks=(e,t,o)=>{const i=[];return Hi(i,e,t||"value",o||"label"),i},Wi=(e,t,o,i="",a)=>{t=t||[];for(let l=0,r=t.length;l<r;l++){const s=t[l],d=o(s),c=i?`${i}.${d}`:d,f=s.children||[];if(f.length>0)Wi(e,f,o,c,a);else{const u={};Object.keys(s).forEach(p=>{(!a||a.indexOf(p)===-1)&&(u[p]=s[p])}),u.label=c,e.push(u)}}},Ui=(e,t,o)=>{const i=[];return Wi(i,e,t,"",o),i},Rn=e=>["j-input","j-textarea","j-select","j-radio","j-checkbox","j-switch","j-number","j-slider-captcha","j-cascader-select","j-autocomplete","j-rate","j-slider"].includes(e)||e.indexOf("j-input")!=-1,Ji=e=>["j-input","j-textarea","j-select","j-radio","j-checkbox","j-switch","j-number","j-cascader-select","j-autocomplete","j-rate","j-slider"].includes(e)||e.indexOf("j-input")!=-1,$t=e=>{const t=e.config||{};if(e.getCompConfig){const o=e.getCompConfig({config:t,formData:e.formData,row:e.row,tableData:e.tableData,pRowData:e.pRowData})||{};for(const i in t)o[i]=t[i];return o}return t},No=e=>e.getCompType?e.getCompType({config:e.config,formData:e.formData,row:e.row,tableData:e.tableData}):e.type,Yi=(e,t,o)=>{const i=$t(o),a=No({...o,config:i});if(a==="j-autocomplete")return e;if(i&&i.options){if(e?.split){const l=e.split(","),r=Di(i.options);return l.map(s=>r.find(d=>d.value===s)?.label).join(a==="j-cascader-select"?"/":",")}return i.options.find(l=>l.value===e)?.label}else if(t)return t(e,a,i);return e},Xs="YYYY-MM-DD HH:mm:ss",Zs="YYYY-MM-DD";function qi(e,t=Xs){return ji(e).format(t)}function pn(e,t=Zs){return ji(e).format(t)}function Gi(e){const t="j-loading-spin",o=document.querySelector(`.${t}`);if(e){if(!o){document.body.style.overflow="hidden";const i=new DocumentFragment,a=document.createElement("div");a.className=t;const l=document.createElement("span");l.className="j-loading-spin-dot";for(let r=0;r<4;r++){const s=document.createElement("i");l.appendChild(s)}a.appendChild(l),i.appendChild(a),document.body.appendChild(i)}}else o&&o.parentNode&&(document.body.style.overflow="",o.parentNode.removeChild(o))}const Qs=(()=>{let e=null,t=0;return o=>{o?(t++,e&&clearTimeout(e),Gi(!0),e=null):(t=Math.max(0,t-1),t===0&&(e&&clearTimeout(e),e=setTimeout(()=>{Gi(!1),e=null},400)))}})();function Ht(e){Qs(e)}const{decrypt:Ki,encrypt:ec}=vs,An=Vi,Xi=Vi.parse,Zi=(e,t=32)=>{const{length:o}=e;if(o<t){for(let i=0,a=t-o;i<a;i++)e+="0";return e}return o>t?e.substring(0,t):e};class tc{key;iv;constructor({key:t,iv:o}){this.key=Xi(Zi(t)),this.iv=Xi(Zi(o||"1234567890000000",16))}get getOptions(){return{padding:Cs,iv:this.iv}}encrypt(t){return ec(t,this.key,this.getOptions).toString()}decrypt(t){return Ki(t,this.key,this.getOptions).toString(An)}}class Wt{static instance;constructor(){}static getInstance(){return Wt.instance||(Wt.instance=new Wt),Wt.instance}encrypt(t){return An.parse(t).toString(Ti)}decrypt(t){return Ti.parse(t).toString(An)}}class Ut{static instance;constructor(){}static getInstance(){return Ut.instance||(Ut.instance=new Ut),Ut.instance}hash(t){return ks(t).toString()}}class Jt{static instance;constructor(){}static getInstance(){return Jt.instance||(Jt.instance=new Jt),Jt.instance}hash(t){return xs(t).toString()}}class Yt{static instance;constructor(){}static getInstance(){return Yt.instance||(Yt.instance=new Yt),Yt.instance}hash(t){return Ss(t).toString()}}class Qi{static createAesEncryption(t){return new tc(t)}static createBase64Encryption(){return Wt.getInstance()}}class nc{static createMD5Hashing(){return Ut.getInstance()}static createSHA256Hashing(){return Jt.getInstance()}static createSHA512Hashing(){return Yt.getInstance()}}const oc=(e,t)=>Ki(e,t).toString(An);function ea(e,t){function o(){n.nextTick(()=>{e=n.unref(e),e&&Bs.create(e,{animation:100,delay:400,delayOnTouchOnly:!0,...t})})}return{initSortable:o}}const ta=async e=>new Promise((t,o)=>{if(typeof window.BMap<"u"){t(window.BMap);return}window.onBMapCallback=function(){t(window.BMap)};const i=document.createElement("script");i.type="text/javascript",i.src=`https://api.map.baidu.com/api?v=3.0&ak=${e||"dPHQKHyFl1GmMBjGVbVCSs6GSrswTuPQ"}&callback=onBMapCallback`,i.onerror=o,document.head.appendChild(i)});function ic(e){const t=i=>{e.value.open(i)};return{handleClick:i=>{if(!i.disabled){if(i.layerName){i.layerGetParam&&(i.layerParam=i.layerGetParam()),t({title:i.layerTitle,name:i.layerName,width:i.layerWidth||1e3,height:i.layerHeight||600,afterOk:i.afterOk||null,afterClose:i.afterClose||null,formConfig:i.layerFormConfig||{},param:i.layerParam||{},type:i.layerType,hasBtns:i.layerHasBtns});return}i.click&&i.click({handleOpenForm:t})}}}}const na=te(n.defineComponent({name:"JButtons",__name:"index",props:{list:{type:Array,default:()=>[]},group:{type:Object,default:()=>({})},isLink:Boolean,size:{type:String,default:"default"},readonly:Boolean},setup(e){const t=e,o=n.computed(()=>{if(Object.keys(t.group).length>0)return t.group;const l={},r=pt(t.list),s=r.length;for(let d=0;d<s;d++){const c=r[d];c.groupId=c.groupId||Pn(),l[c.groupId]=l[c.groupId]||[],l[c.groupId].push(c)}return l}),i=n.ref(),{handleClick:a}=ic(i);return(l,r)=>{const s=n.resolveComponent("j-button"),d=n.resolveComponent("el-space"),c=n.resolveComponent("el-dropdown"),f=n.resolveComponent("j-dynamic-layer");return n.openBlock(),n.createBlock(d,{style:n.normalizeStyle({display:e.readonly?"none":""}),size:e.isLink?0:8},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.value,(u,p)=>(n.openBlock(),n.createElementBlock("div",n.mergeProps({key:p},{ref_for:!0},l.$attrs),[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u,(h,m)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:m},[h.children?.length&&h.children?.length>0?(n.openBlock(),n.createBlock(c,{key:0},{dropdown:n.withCtx(()=>[n.createVNode(d,{direction:"vertical"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h.children||[],g=>(n.openBlock(),n.createBlock(s,{key:g.prop,label:g.label,type:"text",danger:g.danger,size:e.size,disabled:g.disabled,icon:g.icon,onClick:n.withModifiers(b=>n.unref(a)(g),["stop"])},null,8,["label","danger","size","disabled","icon","onClick"]))),128))]),_:2},1024)]),default:n.withCtx(()=>[n.createVNode(s,{label:h.label,type:e.isLink?"link":h.type,danger:h.danger,size:e.size,icon:h.icon,onClick:n.withModifiers(g=>n.unref(a)(h),["stop"])},null,8,["label","type","danger","size","icon","onClick"])]),_:2},1024)):(n.openBlock(),n.createBlock(s,{key:1,label:h.label,type:e.isLink?"link":h.type,danger:h.danger,size:e.size,icon:h.icon,compact:!0,"last-compact-item":m===u.length-1,"first-compact-item":m===0,onClick:n.withModifiers(g=>n.unref(a)(h),["stop"])},null,8,["label","type","danger","size","icon","last-compact-item","first-compact-item","onClick"]))],64))),128))],16))),128)),n.createVNode(f,{ref_key:"layerRef",ref:i},null,512)]),_:1},8,["style","size"])}}})),oa=te(n.defineComponent({name:"JInput",__name:"input",props:{modelValue:{default:""},type:{default:"text"},modelModifiers:{},maxlength:{},minlength:{},showWordLimit:{type:Boolean,default:!1},wordLimitPosition:{default:"inside"},placeholder:{default:""},clearable:{type:Boolean,default:!1},clearIcon:{},formatter:{},parser:{},showPassword:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{default:"default"},prefixIcon:{},suffixIcon:{},rows:{default:2},autosize:{type:[Boolean,Object],default:!1},autocomplete:{default:"off"},name:{},readonly:{type:Boolean,default:!1},max:{},min:{},step:{},resize:{},autofocus:{type:Boolean,default:!1},form:{},ariaLabel:{},tabindex:{},validateEvent:{type:Boolean,default:!0},inputStyle:{default:()=>({})},label:{},inputmode:{},autoFocus:{type:Boolean}},emits:["update:modelValue","input","focus","blur","clear","change"],setup(e,{emit:t}){const o=e,i=t,a=n.ref(),l=n.computed({get(){return o.modelValue},set(u){i("update:modelValue",u)}}),r=u=>{i("input",u)},s=u=>{i("focus",u)},d=u=>{i("blur",u)},c=()=>{i("clear")},f=u=>{i("change",u)};return n.onMounted(()=>{o.autoFocus&&a.value.focus()}),(u,p)=>{const h=n.resolveComponent("j-icon"),m=n.resolveComponent("el-input");return n.openBlock(),n.createBlock(m,n.mergeProps({ref_key:"inputRef",ref:a,modelValue:l.value,"onUpdate:modelValue":p[0]||(p[0]=g=>l.value=g),type:e.type,"model-modifiers":e.modelModifiers,maxlength:e.maxlength,minlength:e.minlength,"show-word-limit":e.showWordLimit,"word-limit-position":e.wordLimitPosition,placeholder:e.placeholder,clearable:e.clearable,"clear-icon":e.clearIcon,formatter:e.formatter,parser:e.parser,"show-password":e.showPassword,disabled:e.disabled,size:e.size,rows:e.rows,autosize:e.autosize,autocomplete:e.autocomplete,name:e.name,readonly:e.readonly,max:e.max,min:e.min,step:e.step,resize:e.resize,autofocus:e.autofocus,form:e.form,"aria-label":e.ariaLabel,tabindex:e.tabindex,"validate-event":e.validateEvent,"input-style":e.inputStyle,label:e.label,inputmode:e.inputmode},u.$attrs,{onInput:r,onFocus:s,onBlur:d,onClear:c,onChange:f}),n.createSlots({_:2},[e.prefixIcon?{name:"prefix",fn:n.withCtx(()=>[n.createVNode(h,{icon:e.prefixIcon},null,8,["icon"])]),key:"0"}:void 0,e.suffixIcon?{name:"suffix",fn:n.withCtx(()=>[n.createVNode(h,{icon:e.suffixIcon},null,8,["icon"])]),key:"1"}:void 0]),1040,["modelValue","type","model-modifiers","maxlength","minlength","show-word-limit","word-limit-position","placeholder","clearable","clear-icon","formatter","parser","show-password","disabled","size","rows","autosize","autocomplete","name","readonly","max","min","step","resize","autofocus","form","aria-label","tabindex","validate-event","input-style","label","inputmode"])}}})),ia=te(Nt),ac={key:1},aa=te(n.defineComponent({name:"JRadio",__name:"radio",props:{modelValue:{type:[String],default:void 0},options:{type:Array,default:()=>[]},size:{type:String,default:"default"},isButton:{type:Boolean,default:!1},isColor:{type:Boolean,default:!1},colors:{type:Array,default:()=>[]},readonly:Boolean},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,i=t,a=n.computed({get(){let l=o.options;if(!it(o.modelValue)&&l&&l.length>0){let r=o.modelValue+"",s=o.options.find(d=>d.value+""===r);if(s)return s.value}return o.modelValue},set(l){i("update:modelValue",l)}});return(l,r)=>{const s=n.resolveComponent("el-radio-button"),d=n.resolveComponent("el-tag"),c=n.resolveComponent("el-radio"),f=n.resolveComponent("el-radio-group");return n.openBlock(),n.createBlock(f,{modelValue:a.value,"onUpdate:modelValue":r[0]||(r[0]=u=>a.value=u),disabled:e.readonly},{default:n.withCtx(()=>[e.isButton?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(e.options,u=>(n.openBlock(),n.createBlock(s,{key:u.value,value:u.value,size:e.size},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(u.label),1)]),_:2},1032,["value","size"]))),128)):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(e.options,(u,p)=>(n.openBlock(),n.createBlock(c,{key:u.value,value:u.value,size:e.size},{default:n.withCtx(()=>[e.isColor?(n.openBlock(),n.createBlock(d,{key:0,color:e.colors[p]||u.color||"",size:e.size,hit:!1,effect:"dark",style:{"border-width":"0"}},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(u.label),1)]),_:2},1032,["color","size"])):(n.openBlock(),n.createElementBlock("span",ac,n.toDisplayString(u.label),1))]),_:2},1032,["value","size"]))),128))]),_:1},8,["modelValue","disabled"])}}})),lc={class:"j-select-input-label-wrapper"},rc={class:"j-select-option-wrapper"},sc={class:"j-select-option-wrapper"},la=te(n.defineComponent({name:"JSelect",inheritAttrs:!1,__name:"select",props:{modelValue:{},options:{default:()=>[]},size:{default:"default"},placeholder:{default:"请选择"},teleported:{type:Boolean,default:!0},noBorder:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},isShowTooltip:{type:Boolean,default:!1},isSelectOnlyone:{type:Boolean,default:!1},selectData:{default:""},clearable:{type:Boolean,default:!1},isRows:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},collapseTagsTooltip:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},isGroup:{type:Boolean,default:!1},groupKey:{default:""},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,a=n.ref(),l=n.computed({get(){return o.multiple&&typeof o.modelValue=="string"?o.modelValue?.split(",")||[]:o.modelValue},set(u){o.multiple&&Array.isArray(u)&&(u=u?.join(",")||[]),i("update:modelValue",u)}}),r=n.computed(()=>!it(l.value)&&!o.multiple&&o.options.filter(u=>l.value==u.value).map(u=>u.label).join(",")||""),s=n.computed(()=>!it(l.value)&&!o.multiple?o.options.find(u=>u.value===l.value)?.icon:""),d=n.computed(()=>typeof o.selectData=="string"?o.selectData?.split(",")||[]:[]),c=n.computed(()=>{let u=[];if(o.isSelectOnlyone?u=o.options.map(p=>({...p,disabled:d.value.includes(p.value)})):u=o.options,o.isGroup){const p=[],h={};return u.forEach(m=>{let g={};const b=m[o.groupKey||""]||"";h[b]||(g.value=b,g.label=b,h[b]=[],g.children=h[b],p.push(g));const k={value:m.value,label:m.label,icon:m.icon,disabled:m.disabled};h[b].push(k)}),p}return u}),f=u=>{if(o.multiple){if(u.length==0){i("change",void 0);return}const p=[];u.forEach(h=>{const m=o.options.find(g=>g.value==h);m&&p.push(m)}),i("change",p)}else{if(u==""||u==null||u==null){i("change",void 0);return}const p=o.options.find(h=>h.value==u);i("change",p)}};return n.onMounted(()=>{o.autoFocus&&setTimeout(()=>{a.value.toggleMenu()},50)}),(u,p)=>{const h=n.resolveComponent("el-tooltip"),m=n.resolveComponent("el-option"),g=n.resolveComponent("el-option-group"),b=n.resolveComponent("el-select");return n.openBlock(),n.createBlock(b,n.mergeProps({ref_key:"selectRef",ref:a},u.$attrs,{modelValue:l.value,"onUpdate:modelValue":p[0]||(p[0]=k=>l.value=k),class:[{"no-border":e.noBorder,"rows-background":e.isRows}],teleported:e.teleported,size:e.size,disabled:e.disabled||e.readonly,multiple:e.multiple,clearable:e.clearable,filterable:e.filterable,"collapse-tags":e.collapseTags,"collapse-tags-tooltip":e.collapseTagsTooltip,placeholder:e.placeholder,onChange:f}),n.createSlots({default:n.withCtx(()=>[e.isGroup?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(c.value,k=>(n.openBlock(),n.createBlock(g,{key:k.label,label:k.label},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(k.children,v=>(n.openBlock(),n.createBlock(m,{key:v.value,label:v.label,value:v.value||" ",disabled:!!v.disabled},{default:n.withCtx(()=>[n.createElementVNode("div",rc,[v.icon?(n.openBlock(),n.createBlock(Nt,{key:0,class:"j-select-option-icon",icon:v.icon},null,8,["icon"])):n.createCommentVNode("",!0),n.createElementVNode("div",null,n.toDisplayString(v.label),1)])]),_:2},1032,["label","value","disabled"]))),128))]),_:2},1032,["label"]))),128)):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(c.value,k=>(n.openBlock(),n.createBlock(m,{key:k.value,label:k.label,value:k.value+"",disabled:!!k.disabled},{default:n.withCtx(()=>[n.createElementVNode("div",sc,[k.icon?(n.openBlock(),n.createBlock(Nt,{key:0,class:"j-select-option-icon",icon:k.icon},null,8,["icon"])):n.createCommentVNode("",!0),n.createElementVNode("div",null,n.toDisplayString(k.label),1)])]),_:2},1032,["label","value","disabled"]))),128))]),_:2},[e.multiple?void 0:{name:"label",fn:n.withCtx(()=>[n.createElementVNode("div",lc,[s.value?(n.openBlock(),n.createBlock(Nt,{key:0,class:"j-select-option-icon",icon:s.value},null,8,["icon"])):n.createCommentVNode("",!0),n.createElementVNode("div",null,[e.isShowTooltip?(n.openBlock(),n.createBlock(h,{key:0,content:r.value,placement:"top"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(r.value),1)]),_:1},8,["content"])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(r.value),1)],64))])])]),key:"0"}]),1040,["modelValue","class","teleported","size","disabled","multiple","clearable","filterable","collapse-tags","collapse-tags-tooltip","placeholder"])}}})),ra=te(n.defineComponent({name:"JCascaderSelect",__name:"cascader-select",props:{modelValue:{},options:{default:()=>[]},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"default"},separator:{default:"/"},showAllLevels:{type:Boolean,default:!0},checkStrictly:{type:Boolean,default:!1},expandTrigger:{default:"click"},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!1},maxCollapseTags:{default:1},collapseTagsTooltip:{type:Boolean},filterable:{type:[Boolean,Object],default:!1},multiple:{type:Boolean,default:!1},emitPath:{type:Boolean,default:!0},lazy:{type:Boolean,default:!1},lazyLoad:{type:Function,default:()=>Function},hoverThreshold:{default:500},checkOnClickNode:{type:Boolean,default:!1},checkOnClickLeaf:{type:Boolean,default:!0},showPrefix:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{expose:t,emit:o}){const i=e,a=n.ref(null),l=o;t({getCheckedNodes:(u=!1)=>a.value?.getCheckedNodes(u),clearCheckedNodes:()=>{a.value?.cascaderPanelRef?.value?.clearCheckedNodes()}});const d=n.computed({get(){return it(i.modelValue)?[]:i.modelValue?.split(",")||[]},set(u){l("update:modelValue",it(u)?"":u.join(","))}}),c=(u,p)=>{d.value=u,l("change",{value:it(u)?"":u.join(","),data:p})},f=n.computed(()=>({checkStrictly:i.checkStrictly,expandTrigger:i.expandTrigger,multiple:i.multiple,emitPath:i.emitPath,lazy:i.lazy,lazyLoad:i.lazyLoad,hoverThreshold:i.hoverThreshold,checkOnClickNode:i.checkOnClickNode,checkOnClickLeaf:i.checkOnClickLeaf,showPrefix:i.showPrefix,value:"value",label:"label",children:"children",disabled:"disabled",leaf:"leaf"}));return n.onMounted(()=>{i.autoFocus&&setTimeout(()=>{a.value.togglePopperVisible()},50)}),(u,p)=>{const h=n.resolveComponent("el-cascader");return n.openBlock(),n.createBlock(h,{ref_key:"cascaderRef",ref:a,modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=m=>d.value=m),props:f.value,options:e.options,placeholder:e.placeholder,disabled:e.disabled||e.readonly,clearable:e.clearable,"collapse-tags":e.collapseTags,"max-collapse-tags":e.maxCollapseTags,"collapse-tags-tooltip":e.collapseTagsTooltip,filterable:e.filterable,"show-all-levels":e.showAllLevels,separator:e.separator,size:e.size,onChange:c},null,8,["modelValue","props","options","placeholder","disabled","clearable","collapse-tags","max-collapse-tags","collapse-tags-tooltip","filterable","show-all-levels","separator","size"])}}})),sa=te(n.defineComponent({name:"JCheckbox",__name:"checkbox",props:{modelValue:{default:()=>[]},options:{default:()=>[]},size:{default:"default"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},min:{default:void 0},max:{default:void 0},textColor:{default:"var(--j-color-primary)"},fill:{default:"var(--j-color-bg-container)"},tag:{default:"div"},validateEvent:{type:Boolean,default:!0},label:{default:void 0},type:{default:"checkbox"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,a=n.computed({get(){return o.modelValue},set(r){i("update:modelValue",r)}}),l=r=>{i("change",r)};return(r,s)=>{const d=n.resolveComponent("el-checkbox"),c=n.resolveComponent("el-checkbox-button"),f=n.resolveComponent("el-checkbox-group");return n.openBlock(),n.createBlock(f,{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=u=>a.value=u),disabled:e.disabled||e.readonly,size:e.size,min:e.min,max:e.max,"text-color":e.textColor,fill:e.fill,tag:e.tag,"validate-event":e.validateEvent,label:e.label,type:e.type,onChange:l},{default:n.withCtx(()=>[e.type==="checkbox"?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(e.options,u=>(n.openBlock(),n.createBlock(d,{key:u.value,value:u.value,disabled:u.disabled,size:e.size,label:u.label},null,8,["value","disabled","size","label"]))),128)):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(e.options,u=>(n.openBlock(),n.createBlock(c,{key:u.value,class:n.normalizeClass({"j-checkbox-notFillOrColor":!e.fill&&!e.textColor}),value:u.value,disabled:u.disabled,size:e.size,label:u.label},null,8,["class","value","disabled","size","label"]))),128))]),_:1},8,["modelValue","disabled","size","min","max","text-color","fill","tag","validate-event","label","type"])}}})),ca=te(n.defineComponent({name:"JNumber",__name:"number",props:{modelValue:{},min:{},max:{},step:{default:1},stepStrictly:{type:Boolean,default:!1},precision:{},size:{default:"default"},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},controls:{type:Boolean,default:!1},controlsPosition:{default:"right"},ariaLabel:{},placeholder:{default:"请输入数字"},id:{},valueOnClear:{},label:{},inputmode:{},align:{default:"left"},disabledScientific:{type:Boolean,default:!1},prefix:{},suffix:{},decreaseIcon:{},increaseIcon:{},autoFocus:{type:Boolean}},emits:["update:modelValue","change","blur","focus"],setup(e,{expose:t,emit:o}){const i=e,a=n.ref(),l=o,r=n.computed({get(){return i.modelValue},set(p){l("update:modelValue",p)}}),s=p=>{l("change",p)},d=()=>{l("blur")},c=()=>{l("focus")};return t({blur:()=>{a.value?.blur()},focus:()=>{a.value?.focus()}}),n.onMounted(()=>{i.autoFocus&&a.value?.focus()}),(p,h)=>{const m=n.resolveComponent("j-icon"),g=n.resolveComponent("el-input-number");return n.openBlock(),n.createBlock(g,{id:e.id,ref_key:"inputNumberRef",ref:a,modelValue:r.value,"onUpdate:modelValue":h[0]||(h[0]=b=>r.value=b),min:e.min,max:e.max,step:e.step,"step-strictly":e.stepStrictly,precision:e.precision,size:e.size,readonly:e.readonly||e.disabled,disabled:e.disabled||e.readonly,controls:e.controls,"controls-position":e.controlsPosition,"aria-label":e.ariaLabel,placeholder:e.placeholder,"value-on-clear":e.valueOnClear,label:e.label,inputmode:e.inputmode,align:e.align,"disabled-scientific":e.disabledScientific,onChange:s,onBlur:d,onFocus:c},n.createSlots({"decrease-icon":n.withCtx(()=>[e.decreaseIcon?(n.openBlock(),n.createBlock(m,{key:0,icon:e.decreaseIcon},null,8,["icon"])):n.createCommentVNode("",!0)]),"increase-icon":n.withCtx(()=>[e.increaseIcon?(n.openBlock(),n.createBlock(m,{key:0,icon:e.increaseIcon},null,8,["icon"])):n.createCommentVNode("",!0)]),_:2},[e.prefix?{name:"prefix",fn:n.withCtx(()=>[n.createElementVNode("span",null,n.toDisplayString(e.prefix),1)]),key:"0"}:void 0,e.suffix?{name:"suffix",fn:n.withCtx(()=>[n.createElementVNode("span",null,n.toDisplayString(e.suffix),1)]),key:"1"}:void 0]),1032,["id","modelValue","min","max","step","step-strictly","precision","size","readonly","disabled","controls","controls-position","aria-label","placeholder","value-on-clear","label","inputmode","align","disabled-scientific"])}}})),da=te(n.defineComponent({name:"JAutocomplete",__name:"autocomplete",props:{modelValue:{},placeholder:{default:"请输入内容"},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},valueKey:{default:"value"},debounce:{default:300},placement:{default:"bottom-start"},options:{default:()=>[]},fetchSuggestions:{},triggerOnFocus:{type:Boolean,default:!0},selectWhenUnmatched:{type:Boolean,default:!1},ariaLabel:{},hideLoading:{type:Boolean,default:!1},popperClass:{},popperStyle:{},teleported:{type:Boolean,default:!0},appendTo:{},highlightFirstItem:{type:Boolean,default:!1},fitInputWidth:{type:Boolean,default:!1},loopNavigation:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","select","change","focus","blur"],setup(e,{expose:t,emit:o}){const i=e,a=n.ref(null),l=o,r=n.computed({get(){return i.modelValue||""},set(g){l("update:modelValue",g)}}),s=(g,b)=>{if(i.fetchSuggestions){i.fetchSuggestions(g,b);return}const k=g?i.options.filter(d(g)):i.options;b(k)},d=g=>b=>b?.[i.valueKey]?.toLowerCase().indexOf(g.toLowerCase())===0,c=g=>{l("select",g)},f=g=>{l("change",g)},u=()=>{l("focus")},p=()=>{l("blur")};return t({focus:()=>{a.value?.focus()},blur:()=>{a.value?.blur()}}),n.onMounted(()=>{i.autoFocus&&setTimeout(()=>{a.value.focus()},50)}),(g,b)=>{const k=n.resolveComponent("el-autocomplete");return n.openBlock(),n.createBlock(k,{ref_key:"autocompleteRef",ref:a,modelValue:r.value,"onUpdate:modelValue":b[0]||(b[0]=v=>r.value=v),"fetch-suggestions":s,placeholder:e.placeholder,clearable:e.clearable,disabled:e.disabled||e.readonly,"value-key":e.valueKey,debounce:e.debounce,placement:e.placement,"trigger-on-focus":e.triggerOnFocus,"select-when-unmatched":e.selectWhenUnmatched,"aria-label":e.ariaLabel,"hide-loading":e.hideLoading,"popper-class":e.popperClass,"popper-style":e.popperStyle,teleported:e.teleported,"append-to":e.appendTo,"highlight-first-item":e.highlightFirstItem,"fit-input-width":e.fitInputWidth,"loop-navigation":e.loopNavigation,onSelect:c,onChange:f,onFocus:u,onBlur:p},n.createSlots({default:n.withCtx(({item:v})=>[n.renderSlot(g.$slots,"default",{item:v},()=>[n.createElementVNode("div",null,n.toDisplayString(v[e.valueKey]||""),1)])]),_:2},[g.$slots.prefix?{name:"prefix",fn:n.withCtx(()=>[n.renderSlot(g.$slots,"prefix")]),key:"0"}:void 0,g.$slots.suffix?{name:"suffix",fn:n.withCtx(()=>[n.renderSlot(g.$slots,"suffix")]),key:"1"}:void 0,g.$slots.header?{name:"header",fn:n.withCtx(()=>[n.renderSlot(g.$slots,"header")]),key:"2"}:void 0,g.$slots.footer?{name:"footer",fn:n.withCtx(()=>[n.renderSlot(g.$slots,"footer")]),key:"3"}:void 0,g.$slots.prepend?{name:"prepend",fn:n.withCtx(()=>[n.renderSlot(g.$slots,"prepend")]),key:"4"}:void 0,g.$slots.append?{name:"append",fn:n.withCtx(()=>[n.renderSlot(g.$slots,"append")]),key:"5"}:void 0,g.$slots.loading?{name:"loading",fn:n.withCtx(()=>[n.renderSlot(g.$slots,"loading")]),key:"6"}:void 0]),1032,["modelValue","placeholder","clearable","disabled","value-key","debounce","placement","trigger-on-focus","select-when-unmatched","aria-label","hide-loading","popper-class","popper-style","teleported","append-to","highlight-first-item","fit-input-width","loop-navigation"])}}})),cc={class:"j-block"},dc={key:1,class:"j-layout--container"},uc={class:"j-block"},fc={class:"j-block"},pc={class:"j-block"},ua=te(n.defineComponent({name:"JLayout",__name:"layout",props:{left:{type:[Number,String],default:240},right:{type:[Number,String],default:240},top:{type:[Number,String],default:60},bottom:{type:[Number,String],default:60},leftMove:{type:Boolean,default:!0},rightMove:{type:Boolean,default:!0},topMove:{type:Boolean,default:!0},bottomMove:{type:Boolean,default:!0},notHidden:{type:Boolean,default:!1},midMinWidth:{type:Number,default:0},midMinHeight:{type:Number,default:0},hideMidWhenNarrow:{type:Boolean,default:!1}},setup(e){const t=e,o=n.useSlots(),i=n.ref(),a=n.ref(),l=n.ref(-1),r=n.ref(-1),s=n.ref(-1),d=n.ref(-1),c=n.ref(0),f=n.ref(!1),u=n.reactive({type:"",isMove:!1,pageX:0,pageY:0,size:0,h:0,w:0}),p=n.computed({get(){return l.value!==-1?l.value:t.left},set(R){l.value=R}}),h=n.computed({get(){return r.value!==-1?r.value:t.right},set(R){r.value=R}}),m=n.computed({get(){return s.value!==-1?s.value:t.top},set(R){s.value=R}}),g=n.computed({get(){return d.value!==-1?d.value:t.bottom},set(R){d.value=R}}),b=n.computed(()=>o.left),k=n.computed(()=>o.right),v=n.computed(()=>o.top),w=n.computed(()=>o.bottom),C=n.computed(()=>b.value?f.value&&t.hideMidWhenNarrow&&k.value?"50%":f.value&&t.hideMidWhenNarrow&&!k.value?"100%":typeof p.value=="number"?p.value+"px":p.value:"0"),S=n.computed(()=>k.value?f.value&&t.hideMidWhenNarrow&&b.value?"50%":f.value&&t.hideMidWhenNarrow&&!b.value?"100%":typeof h.value=="number"?h.value+"px":h.value:"0"),y=n.computed(()=>v.value?typeof m.value=="number"?m.value+"px":m.value:"0"),E=n.computed(()=>w.value?typeof g.value=="number"?g.value+"px":g.value:"0"),B=n.computed(()=>({minWidth:t.midMinWidth+"px",minHeight:t.midMinHeight+"px"})),_=(R,V)=>{u.type=R,u.isMove=!0,u.pageX=V.pageX,u.pageY=V.pageY,u.h=a.value.clientHeight,u.w=a.value.clientWidth;const x=i.value.clientWidth,L=i.value.clientHeight;switch(R){case"left":{const P=p.value;u.size=typeof P=="string"&&P.includes("%")?parseFloat(P)/100*x:Number(P);break}case"right":{const P=h.value;u.size=typeof P=="string"&&P.includes("%")?parseFloat(P)/100*x:Number(P);break}case"top":{const P=m.value;u.size=typeof P=="string"&&P.includes("%")?parseFloat(P)/100*L:Number(P);break}case"bottom":{const P=g.value;u.size=typeof P=="string"&&P.includes("%")?parseFloat(P)/100*L:Number(P);break}}document.onmouseup=j,document.onmousemove=T},T=R=>{if(u.isMove)switch(u.type){case"left":{const V=R.pageX-u.pageX;let x=u.size+V;x<0?x=4:x>u.size+u.w-t.midMinWidth&&(x=u.size+u.w-t.midMinWidth),p.value=x;break}case"right":{const V=R.pageX-u.pageX;let x=u.size-V;x<0?x=4:x>u.size+u.w-t.midMinWidth&&(x=u.size+u.w-t.midMinWidth),h.value=x;break}case"top":{const V=R.pageY-u.pageY;let x=u.size+V;x<0?x=4:x>u.size+u.h-t.midMinHeight&&(x=u.size+u.h-t.midMinHeight),m.value=x;break}case"bottom":{const V=R.pageY-u.pageY;let x=u.size-V;x<0?x=4:x>u.size+u.h-t.midMinHeight&&(x=u.size+u.h-t.midMinHeight),g.value=x;break}}},j=()=>{u.isMove=!1,document.onmouseup=null,document.onmousemove=null},D=()=>{if(!t.hideMidWhenNarrow||!i.value){f.value=!1;return}c.value=i.value.clientWidth;let R=0,V=0;if(b.value){const L=p.value;R=typeof L=="string"&&L.includes("%")?parseFloat(L)/100*c.value:Number(L)}if(k.value){const L=h.value;V=typeof L=="string"&&L.includes("%")?parseFloat(L)/100*c.value:Number(L)}const x=c.value-R-V;f.value=x<t.midMinWidth};let A=null;return n.onMounted(()=>{t.hideMidWhenNarrow&&i.value&&typeof window<"u"&&window.ResizeObserver&&(D(),A=new ResizeObserver(()=>{D()}),A.observe(i.value))}),n.onUnmounted(()=>{A&&A.disconnect()}),(R,V)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"layout",ref:i,class:n.normalizeClass(["j-layout",{"j-layout-not-hidden":e.notHidden}])},[b.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-layout--left",style:n.normalizeStyle({width:C.value})},[n.createElementVNode("div",cc,[n.renderSlot(R.$slots,"left")]),e.leftMove?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:V[0]||(V[0]=x=>_("left",x))},null,32)):n.createCommentVNode("",!0)],4)):n.createCommentVNode("",!0),f.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",dc,[v.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-layout--top",style:n.normalizeStyle({height:y.value})},[n.createElementVNode("div",uc,[n.renderSlot(R.$slots,"top")]),e.topMove?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:V[1]||(V[1]=x=>_("top",x))},null,32)):n.createCommentVNode("",!0)],4)):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"mid",ref:a,class:"j-layout--wrapper",style:n.normalizeStyle(B.value)},[n.renderSlot(R.$slots,"default")],4),w.value?(n.openBlock(),n.createElementBlock("div",{key:1,class:"j-layout--bottom",style:n.normalizeStyle({height:E.value})},[n.createElementVNode("div",fc,[n.renderSlot(R.$slots,"bottom")]),e.bottomMove?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:V[2]||(V[2]=x=>_("bottom",x))},null,32)):n.createCommentVNode("",!0)],4)):n.createCommentVNode("",!0)])),k.value?(n.openBlock(),n.createElementBlock("div",{key:2,class:"j-layout--right",style:n.normalizeStyle({width:S.value})},[n.createElementVNode("div",pc,[n.renderSlot(R.$slots,"right")]),e.rightMove?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-layout--move",onMousedown:V[3]||(V[3]=x=>_("right",x))},null,32)):n.createCommentVNode("",!0)],4)):n.createCommentVNode("",!0)],2))}})),$o={cellInnerBorder:!1,defaultStyle:{bgColor:"#fff",borderColor:"#e5e6eb",color:"#1d2129",fontSize:14,fontFamily:"Inter, -apple-system, BlinkMacSystemFont, PingFang SC, Hiragino Sans GB, noto sans, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif"},headerStyle:{bgColor:"#f2f3f5",fontWeight:500,padding:[0,8,0,8],lineHeight:14},bodyStyle:{padding:[0,8,0,8],lineHeight:14},frameStyle:{},scrollStyle:{barToSide:!0,width:10,visible:"always",hoverOn:!1}},Ye={APP_PROVIDE:"jcode_app_provide",FORM_PROVIDE:"jcode_form_provide",TABLE_PROVIDE:"jcode_table_provide",MENU_PROVIDE:"jcode_menu_provide",H_MENU_PROVIDE:"jianda_h_menu_provide",AUTH_PAGE_PROVIDE:"jcode_auth_page_provide",LAYER_PROVIDE:"jcode_layer_provide"};function qt(e,t){return n.inject(e,t)}function Gt(e,t){n.provide(e,t)}function Pe(){return qt(Ye.APP_PROVIDE,{t:(e,...t)=>{if(!e)return"";if(typeof e!="string")return e;let o=e||"";return t.length>0&&t.forEach((i,a)=>{o=o.replace(new RegExp(`\\{${a}\\}`,"g"),i)}),o.replace(/\$.\[^\$\$]*\$/,"")},useFile:()=>({}),useData:()=>({})})}function Kt(){return qt(Ye.FORM_PROVIDE,{})}function fa(e){Gt(Ye.FORM_PROVIDE,e)}function hc(){return qt(Ye.TABLE_PROVIDE,{})}function Mo(e){Gt(Ye.TABLE_PROVIDE,e)}function On(){return qt(Ye.MENU_PROVIDE,{})}function mc(e){Gt(Ye.MENU_PROVIDE,e)}function gc(){return qt(Ye.H_MENU_PROVIDE,{})}function yc(e){Gt(Ye.H_MENU_PROVIDE,e)}function bc(){return qt(Ye.AUTH_PAGE_PROVIDE,{getPageName:()=>""})}function wc(e){Gt(Ye.AUTH_PAGE_PROVIDE,e)}function vc(e){Gt(Ye.LAYER_PROVIDE,e)}const pa=n.defineComponent({name:"JComp",__name:"comp",props:{modelValue:{type:[String,Number,Boolean,Array,Object],default:void 0},id:{type:String,default:""},type:{type:String,default:""},getCompType:{type:Function,default:void 0},config:{type:Object,default:()=>{}},getCompConfig:{type:Function,default:void 0},children:{type:Array,default:()=>[]},row:{type:Object,default:void 0},isTableCell:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,{formData:a,formChange:l}=Kt(),{tableData:r,row:s,rowChange:d}=hc(),c=o.row||s;Mo({tableData:r,row:c,rowChange:d});const f=n.computed(()=>Rn(m.value)&&!p.value?.notInput||p.value?.isInput||m.value==="j-tabs"||m.value==="j-collapse"),u=n.computed({get(){let v;if(c?v=c[o.id]:a?v=a[o.id]:v=o.modelValue,v===void 0&&m.value==="j-tabs"){if(p.value?.defaultValue)return p.value.defaultValue;const w=o.children.findIndex(C=>C.config?.active);return w>-1?"_tab"+w:"_tab0"}if(v===void 0&&m.value==="j-collapse"){if(p.value?.defaultValue)return p.value.defaultValue;const w=o.children.map((C,S)=>({item:C,index:S})).filter(({item:C})=>C.config?.active);return p.value?.accordion?w.length>0?"_collapse"+w[0].index:"":w.map(({index:C})=>"_collapse"+C)}return v},set(v){c?c[o.id]=v:a&&(a[o.id]=v),i("update:modelValue",v)}}),p=n.computed(()=>$t({config:o.config,getCompConfig:o.getCompConfig,formData:a||{},row:c,tableData:r})),h=n.computed(()=>No({type:o.type,getCompType:o.getCompType,config:p.value,formData:a||{},row:c,tableData:r})),m=n.computed(()=>o.isTableCell&&(h.value==="j-radio"||h.value==="j-checkbox")?"j-select":h.value==="j-textarea"?"j-input":h.value),g=n.computed(()=>{const v={...p.value};return m.value==="j-layer-form"&&(v.schema=o.children),m.value==="el-collapse-item"&&v.label&&(v.title=v.label,delete v.label),o.isTableCell&&(h.value==="j-checkbox"&&(v.multiple=!0),h.value==="j-select"&&v.multiple&&(v.collapseTags=!0,v.collapseTagsTooltip=!0),h.value==="j-switch"&&(v.size="small"),h.value==="j-textarea"&&(v.type="textarea")),v}),b=n.computed(()=>{if(m.value==="j-layer-form")return{};const v={};return o.children.forEach((w,C)=>{let S=w;m.value==="j-tabs"&&(S={...w,config:{...w.config||{},name:"_tab"+C}}),m.value==="j-collapse"&&(S={...w,config:{...w.config||{},name:"_collapse"+C}}),S.slot?(v[S.slot]=v[S.slot]||[],v[S.slot].push(S)):(v.default=v.default||[],v.default.push(S))}),v}),k=v=>{const w={...v,id:o.id,formData:a,row:c,tableData:r,config:p.value,type:"change"};console.log(w,"changeData"),p.value?.change&&p.value?.change(w),d&&d(w),l&&l(w),i("change",w)};return(v,w)=>{const C=n.resolveComponent("JComp");return g.value.display!=!1&&f.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(m.value),n.mergeProps({key:0},g.value,{modelValue:u.value,"onUpdate:modelValue":w[0]||(w[0]=S=>u.value=S),onChange:k}),n.createSlots({_:2},[n.renderList(b.value,(S,y)=>({name:y,fn:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(S,E=>(n.openBlock(),n.createBlock(C,n.mergeProps({key:E.id},{ref_for:!0},E),null,16))),128))])}))]),1040,["modelValue"])):g.value.display!=!1?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(m.value),n.mergeProps({key:1},g.value,{onChange:k}),n.createSlots({_:2},[n.renderList(b.value,(S,y)=>({name:y,fn:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(S,E=>(n.openBlock(),n.createBlock(C,n.mergeProps({key:E.id},{ref_for:!0},E),null,16))),128))])}))]),1040)):n.createCommentVNode("",!0)}}});class Cc{wrapContainer=null;container=null;currentValue=null;async onStart(t){const{value:o}=t;await this.createElement(t)&&o!=null&&this.setValue(o)}findColumnByField(t,o){for(const i of t){if(i.field===o)return i;if(i.columns){const a=this.findColumnByField(i.columns,o);if(a)return a}}return null}async createElement(t){return await this.createEditor(t)}async createEditor(t){const{container:o,referencePosition:i,col:a,row:l,table:r}=t,s=r.getBodyField(a,l),d=r.options?.columns||[],c=this.findColumnByField(d,s),f=c?._compConfig||{},u=r.getCellOriginRecord(a,l)||{};if(!o)return!1;const p=document.createElement("div");p.style.position="absolute",p.style.width="100%",p.style.height="100%",p.style.boxSizing="border-box";const{bgColor:h}=r.getCellStyle(a,l)||{};p.style.backgroundColor=h||"#FFFFFF",this.wrapContainer=p,this.container=o,this.container&&this.container.appendChild(p),f.autoFocus=!0;const m=n.h(pa,{id:s,type:c._compType,config:f,getCompConfig:c._getCompConfig,getCompType:c._getCompType,row:u||{},isTableCell:!0,class:"j-comp-editor","onUpdate:modelValue":g=>{this.currentValue=g,console.log("onUpdate:modelValue triggered with:",g)}});return m.appContext=r._getAppContext(),n.render(m,p),i?.rect&&this.adjustPosition(i.rect),!0}getValue(){return this.currentValue}setValue(t){this.currentValue=t}adjustPosition(t){console.log("Adjusting position:",t),this.wrapContainer&&(this.wrapContainer.style.top=`${t.top}px`,this.wrapContainer.style.left=`${t.left}px`,this.wrapContainer.style.width=`${t.width-1}px`,this.wrapContainer.style.height=`${t.height-1}px`)}onEnd(){this.wrapContainer&&this.container&&(n.render(null,this.wrapContainer),this.container.removeChild(this.wrapContainer),this.wrapContainer=null)}isEditorElement(t){return this.wrapContainer?.contains(t)?!0:this.isClickPopUp(t)}isClickPopUp(t){let o=t;for(;o;){if(o.classList){const i=["el-select-dropdown","el-popper","el-picker-panel","el-cascader-panel","el-autocomplete-suggestion","el-date-picker","el-time-picker"];for(const a of i)if(o.classList.contains(a))return!0}o=o.parentNode}return!1}}const ha=new Map;function kc(){if(!ha.has("j-comp-editor")){const e=new Cc;_o.register.editor("j-comp-editor",e),ha.set("j-comp-editor",e)}}function xc(e){if(Ji(e))return"j-comp-editor"}function Sc(e){if(e)return xc(e)}function Bc(){kc()}const Ec={class:"j-table-footer"},_c={key:0,class:"j-table-pagination"},jc=["onClick"],ma=te(n.defineComponent({name:"JTable",__name:"table",props:{columns:{type:Array,required:!0,default:()=>[]},records:{type:Array,required:!0,default:()=>[]},isTree:{type:Boolean,default:!1},isShowNumber:{type:Boolean,default:!0},isMultiple:{type:Boolean,default:!1},isPage:{type:Boolean,default:!1},pageLayoutSimple:{type:Boolean,default:!1},pageSizes:Array,pageTotal:{type:Number,default:0},tablePage:{type:Number,default:1},pageSize:{type:Number,default:100},selectField:{type:String,default:""},rowKey:{type:String,default:"id"},actions:{type:Array,default:()=>[]},actionsMaxCount:{type:Number,default:3},actionsLabel:{type:String,default:"操作"},isAnimationAppear:{type:Boolean,default:!1},heightMode:{type:String,default:"full"},maxHeight:{type:[String,Number],default:void 0}},emits:["ready","selectionChanged","update:tablePage","update:pageSize","loadPageData","rowChange"],setup(e,{expose:t,emit:o}){const i=n.getCurrentInstance(),a=e,l=o,{formData:r}=Kt(),{useData:s}=Pe(),{getLabel:d}=s(),c=n.computed(()=>a.heightMode==="auto"?{height:"auto"}:{}),f=n.ref(40),u=n.computed(()=>{const N={};return a.heightMode==="auto"&&(N.height=f.value+"px",N.flex="none",a.maxHeight&&(N.maxHeight=typeof a.maxHeight=="number"?`${a.maxHeight}px`:a.maxHeight)),N}),p=n.ref(null);let h=null,m=0,g=0,b=!1;const k=n.ref(!1),v=n.ref({}),w=n.ref([]),C=n.ref(null),S=n.ref(0);let y=null,E=!1,B=!1;const _=(N,$,W,U,Q)=>{w.value=N,C.value=$,S.value=W,v.value={left:`${U}px`,top:`${Q}px`},k.value=!0,E=!1,document.addEventListener("wheel",V,{passive:!1})},T=()=>{k.value=!1,E=!1,B=!1,D(),document.removeEventListener("wheel",V)},j=()=>{D(),y=setTimeout(()=>{!E&&!B&&T()},100)},D=()=>{y&&(clearTimeout(y),y=null)},A=()=>{E=!0,D()},R=()=>{E=!1,j()},V=N=>{N.preventDefault()},x=N=>{C.value&&N.click(C.value,S.value),T()},L=()=>{const{Group:N,Text:$}=_o.CustomLayout,W=a.actionsMaxCount,U=a.actions.length>W,Q=U?a.actions.slice(0,W-1):a.actions,z=U?a.actions.slice(W-1):[];let F=0;if(Q.forEach((ve,J)=>{const oe=fn(ve.label)||0;F+=oe+(J===0?24:12)}),U){const ve=(fn("更多")||0)+12;F+=ve}const de=Math.max(80,F)+"px";return{field:"__actions__",title:a.actionsLabel,width:de,maxWidth:de,minWidth:de,disableColumnResize:!0,disableSelect:!0,customLayout:ve=>{const{table:J,row:oe,col:ge}=ve,ue=J.getCellOriginRecord(ge,oe),Te=J.getRecordIndexByCell(ge,oe),re=new N({height:40,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",flexWrap:"nowrap"});if(Q.forEach((ye,Me)=>{const Le=ye.isDanger?"#f53f3f":"#165dff",Ce=new $({text:ye.label,fontSize:14,fill:Le,boundsPadding:[0,12,0,Me==0?12:0],cursor:"pointer"});Ce.addEventListener("click",()=>{ye.click(ue,Te)}),Ce.addEventListener("mouseenter",He=>{He.target.setAttribute("fill",Y(Le,-20)),J.scenegraph.stage.renderNextFrame()}),Ce.addEventListener("mouseleave",He=>{He.target.setAttribute("fill",Le),J.scenegraph.stage.renderNextFrame()}),re.add(Ce)}),U){const ye="#1677ff",Me=new $({text:"更多",fontSize:14,fill:ye,boundsPadding:[0,0,0,0],cursor:"pointer"});Me.addEventListener("mouseenter",Le=>{Le.target.setAttribute("fill",Y(ye,-20)),J.scenegraph.stage.renderNextFrame();const Ce=p.value?.getBoundingClientRect();if(Ce){const He=Le.canvasX+Ce.left-64,Ei=Le.canvasY+Ce.top+8;_(z,ue,Te,He,Ei)}B=!0,D()}),Me.addEventListener("mouseleave",Le=>{Le.target.setAttribute("fill",ye),J.scenegraph.stage.renderNextFrame(),B=!1,j()}),re.add(Me)}return{rootContainer:re,renderDefault:!1}}}},P=(N,$)=>{for(const W of N){if(W.field===$)return W;if(W.columns){const U=P(W.columns,$);if(U)return U}}return null},G=(N,$,W,U)=>{const Q=U.getBodyField($,W),z=U.options?.columns||[],F=P(z,Q);return F._fieldFormat?F._fieldFormat(N,$,W,U):Yi(N[Q],d,{type:F._compType,getCompType:F._getCompType,getCompConfig:F._getCompConfig,config:F._compConfig,formData:r,tableData:a.records,row:N})},K=N=>{const{dataValue:$,rect:W}=N;let U="mdi:toggle-switch",Q="#165dff";$||(U="mdi:toggle-switch-off",Q="#e5e6eb");const z=ft.getIcon(U),F=z?.body?.replace(/currentColor/g,Q),de=[];return de.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 ${z?.width} ${z?.height}" >${F}</svg>`,x:8,y:(W.height-40)/2,width:40,height:40}),{elements:de}},ne=N=>{const{dataValue:$,rect:W}=N,U=Number($)||0,Q=5,z=20,F=4,de=8,ve=(W.height-z)/2,J=[],oe=ft.getIcon("mdi:star"),ge=ft.getIcon("mdi:star-half-full"),ue=ft.getIcon("mdi:star-outline"),Te="#f7ba2a",re="#e5e6eb";for(let ye=0;ye<Q;ye++){const Me=de+ye*(z+F),Le=ve;if(U>=ye+1){const Ce=oe?.body?.replace(/currentColor/g,Te);J.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${z}" height="${z}" viewBox="0 0 ${oe?.width} ${oe?.height}">${Ce}</svg>`,x:Me,y:Le,width:z,height:z})}else if(U>ye&&U<ye+1){const Ce=ge?.body?.replace(/currentColor/g,Te);J.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${z}" height="${z}" viewBox="0 0 ${ge?.width} ${ge?.height}">${Ce}</svg>`,x:Me,y:Le,width:z,height:z})}else{const Ce=ue?.body?.replace(/currentColor/g,re);J.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${z}" height="${z}" viewBox="0 0 ${ue?.width} ${ue?.height}">${Ce}</svg>`,x:Me,y:Le,width:z,height:z})}}return{elements:J}},pe=N=>{const{dataValue:$,rect:W,table:U,col:Q,row:z}=N,F=U.getBodyField(Q,z),de=U.options?.columns||[],J=P(de,F)?._compConfig||{},oe=Number(J.min)||0,ge=Number(J.max)||100,ue=Number($)||0,Te=ge-oe,re=Te===0?0:Math.max(0,Math.min(100,(ue-oe)/Te*100)),ye=4,Me=8,Le=8,Ce=(W.height-ye)/2,He=String(ue),Ei=fn(He)||0,_i=Me,bs=Ce,sn=W.width-Me*2-Ei-Le,$n=sn*re/100,ko=[],ws=(Ie,Ae,xo)=>{const Oe=Math.min(xo,Ae/2,Ie/2);return`M ${Oe} 0 L ${Ie-Oe} 0 Q ${Ie} 0 ${Ie} ${Oe} L ${Ie} ${Ae-Oe} Q ${Ie} ${Ae} ${Ie-Oe} ${Ae} L ${Oe} ${Ae} Q 0 ${Ae} 0 ${Ae-Oe} L 0 ${Oe} Q 0 0 ${Oe} 0 Z`},$m=(Ie,Ae,xo)=>{const Oe=Math.min(xo,Ae/2,Ie/2);return Ie<=Oe*2?ws(Ie,Ae,xo):`M ${Oe} 0 L ${Ie} 0 L ${Ie} ${Ae} L ${Oe} ${Ae} Q 0 ${Ae} 0 ${Ae-Oe} L 0 ${Oe} Q 0 0 ${Oe} 0 Z`},Mm=ye/2,Lm=ws(sn,ye,Mm);if(ko.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${sn}" height="${ye}" viewBox="0 0 ${sn} ${ye}"><path d="${Lm}" fill="#e5e6eb"/></svg>`,x:_i,y:bs,width:sn,height:ye}),$n>0){const Ie=ye/2,Ae=$m($n,ye,Ie);ko.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${$n}" height="${ye}" viewBox="0 0 ${$n} ${ye}"><path d="${Ae}" fill="#165dff"/></svg>`,x:_i,y:bs,width:$n,height:ye})}const Pm=_i+sn+Le,Rm=W.height/2;return ko.push({type:"text",text:He,x:Pm,y:Rm,fontSize:14,fill:"#333333",textAlign:"left",textBaseline:"middle"}),{elements:ko}},fe=N=>{const $=N.filter(W=>W.config?.display!==!1).map(W=>{const{id:U,type:Q,config:z,getCompConfig:F,getCompType:de,children:ve}=W,{label:J,width:oe,minWidth:ge,maxWidth:ue,align:Te,fieldFormat:re,editor:ye,frozen:Me,...Le}=z||{},Ce={field:U,title:J,width:oe,minWidth:ge,maxWidth:ue,style:{textAlign:Te},_fieldFormat:re,_compType:Q,_compConfig:{...Le},_getCompConfig:F,_getCompType:de,frozen:Me},He=Sc(Q);return He&&(Ce.editor=He,Q==="j-switch"&&(Ce.customRender=K),b=!0),Q==="j-rate"&&(Ce.customRender=ne),Q==="j-slider"&&(Ce.customRender=pe),Ce.fieldFormat=G,ve&&(Ce.columns=fe(ve)),Ce});return a.isTree&&$.length>0&&($[0].tree=!0),$},Y=(N,$)=>{const W=N.replace("#",""),U=parseInt(W,16),Q=Math.min(255,Math.max(0,(U>>16)+$)),z=Math.min(255,Math.max(0,(U>>8&255)+$)),F=Math.min(255,Math.max(0,(U&255)+$));return`#${(Q<<16|z<<8|F).toString(16).padStart(6,"0")}`},he=()=>({field:"__sequence__",title:"序号",width:"auto",minWidth:44,disableColumnResize:!0,headerStyle:{textAlign:"center"},style:{textAlign:"center"},fieldFormat:(N,$,W,U)=>{const Q=U.getRecordIndexByCell($,W);return a.isPage?me.value+Q+1:Q+1},_getCompConfig:void 0,_getCompType:void 0}),ae=()=>{m=0,g=0,b=!1;const N={};let $=fe(a.columns);const W=oe=>{if(oe.frozen)return oe.frozen;if(oe.columns)for(const ge of oe.columns){const ue=W(ge);if(ue)return ue}},U=oe=>{const ge=[];return oe.forEach(ue=>{if(ue.frozen){ge.push(ue);return}if(!ue.columns||ue.columns.length===0){ge.push(ue);return}const Te=U(ue.columns),re=[],ye=[],Me=[];if(Te.forEach(Ce=>{const He=W(Ce);He==="left"?re.push(Ce):He==="right"?ye.push(Ce):Me.push(Ce)}),(re.length>0?1:0)+(ye.length>0?1:0)+(Me.length>0?1:0)<=1){ue.columns=Te,ge.push(ue);return}re.length&&ge.push({...ue,columns:re}),Me.length&&ge.push({...ue,columns:Me}),ye.length&&ge.push({...ue,columns:ye})}),ge};$=U($);const Q=oe=>{let ge=0,ue=0;return oe.forEach(Te=>{if(Te.columns&&Te.columns.length>0){const re=Q(Te.columns);ge+=re.left,ue+=re.right}else Te.frozen==="left"?ge++:Te.frozen==="right"&&ue++}),{left:ge,right:ue}},z=[],F=[],de=[];$.forEach(oe=>{const ge=W(oe);ge==="left"?z.push(oe):ge==="right"?F.push(oe):de.push(oe)});const ve=Q(z),J=Q(F);return g+=ve.left,m+=J.right,$=[...z,...de,...F],a.isShowNumber&&($.unshift(he()),g++),a.actions.length>0&&($.push(L()),m++),b&&(N.editCellTrigger="click",N.keyboardOptions={copySelected:!0,cutSelected:!0,pasteValueToCell:!0,selectAllOnCtrlA:!0}),{columns:$,option:N}},se=()=>{const N=ae();a.isMultiple&&g++;const $={records:[],columns:N.columns,autoFillWidth:!0,enableCheckboxCascade:a.isMultiple,enableHeaderCheckboxCascade:a.isMultiple,rightFrozenColCount:m,frozenColCount:g,emptyTip:{text:"暂无数据"},tooltip:{isShowOverflowTextTooltip:!0},...N.option};return a.isAnimationAppear&&($.animationAppear={duration:100,delay:0,type:"one-by-one",direction:"row"}),a.isMultiple&&($.rowSeriesNumber={width:40,minWidth:40,maxWidth:40,disableColumnResize:!0,format:()=>"",cellType:"checkbox",headerType:"checkbox",headerStyle:{textAlign:"center"},style:{textAlign:"center"}},a.selectField&&($.rowSeriesNumber.field=a.selectField)),$.theme=$o,a.heightMode==="auto"&&($.theme={...$o,scrollStyle:{...$o.scrollStyle,hoverOn:!0,width:8}}),$},xe=()=>{if(!p.value)return;Bc();const N=se();h=new _o.ListTable(p.value,N),h._getAppContext=()=>i?.appContext,h.on("click_cell",({col:$,cellType:W})=>{if(W==="checkbox"&&$==0){const U=ut();l("selectionChanged",U)}}),H(),f.value=h.getAllRowsHeight(),l("ready",h)},Ve=()=>{h&&(h.release(),h=null)},H=()=>{le(a.records)},X=()=>h,le=N=>{h&&(h.setScrollTop(0),h.setRecords(N))};n.onMounted(()=>{xe()}),n.onBeforeUnmount(()=>{Ve(),D(),document.removeEventListener("wheel",V)});const we=n.computed({get(){return a.tablePage},set(N){l("update:tablePage",N)}}),$e=n.ref(0),Re=n.computed({get(){return $e.value!==0?$e.value:a.pageSize},set(N){$e.value=N,l("update:pageSize",N)}}),me=n.computed(()=>(we.value-1)*Re.value),De=(N,$)=>{l("loadPageData",{rows:$,page:N})},ut=()=>{if(!h)return[];if(h.stateManager&&h.stateManager.checkedState){const N=h.stateManager.checkedState,$=[];return N.forEach((W,U)=>{if(Object.values(W).some(z=>z===!0)){const z=Number(U);!isNaN(z)&&h.records[z]&&$.push(h.records[z])}}),$}return[]},ot=N=>a.rowKey?a.rowKey.split(",").map(W=>N[W.trim()]).join("::"):"",O=N=>{if(!h||!a.isMultiple)return;const $=h.records;if(a.rowKey){const W=new Set(N.map(ot));$.forEach((U,Q)=>{const z=W.has(ot(U)),F=h.getTableIndexByRecordIndex(Q);h.setCellCheckboxState(0,F,z)})}else console.warn("Warning: rowKey is not defined. Please set rowKey to enable row selection.")},q=N=>{l("rowChange",N)},I=()=>{if(!h)return;const N=ut(),$=se();$.records=h.records,h.updateOption($,{clearColWidthCache:!1,clearRowHeightCache:!1}),a.heightMode==="auto"&&(f.value=h.getAllRowsHeight()),N.length>0&&O(N)};return n.watch(()=>a.columns,()=>{I()}),n.watch(()=>[a.isTree,a.isMultiple,a.isShowNumber,a.isPage,a.isAnimationAppear,a.actionsMaxCount,a.actionsLabel,a.selectField,a.heightMode],()=>{I()}),n.watch(()=>a.actions,()=>{I()},{deep:!0}),Mo({tableData:a.records,rowChange:q}),t({getInstance:X,setRecords:le,getSelection:ut,setSelection:O}),(N,$)=>{const W=n.resolveComponent("el-pagination");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-table",{"j-table-auto":e.heightMode==="auto"}]),style:n.normalizeStyle(c.value)},[n.createElementVNode("div",{class:"j-table-wrapper",style:n.normalizeStyle(u.value)},[n.createElementVNode("div",{class:n.normalizeClass("j-block"),ref_key:"tableContainer",ref:p},null,512)],4),n.createElementVNode("div",Ec,[e.isPage?(n.openBlock(),n.createElementBlock("div",_c,[$[2]||($[2]=n.createElementVNode("div",null,null,-1)),e.isPage?(n.openBlock(),n.createBlock(W,{key:0,"current-page":we.value,"onUpdate:currentPage":$[0]||($[0]=U=>we.value=U),"page-size":Re.value,"onUpdate:pageSize":$[1]||($[1]=U=>Re.value=U),"page-sizes":e.pageSizes||[100,200,500,1e3],total:e.pageTotal,layout:"total, prev, pager, next,sizes",onChange:De},null,8,["current-page","page-size","page-sizes","total"])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),k.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-table-dropdown",style:n.normalizeStyle(v.value),onMouseenter:A,onMouseleave:R},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(w.value,U=>(n.openBlock(),n.createElementBlock("div",{key:U.id,class:"j-table-dropdown-item",style:n.normalizeStyle({color:U.isDanger?"var(--j-color-danger)":"var(--j-color-primary)"}),onClick:Q=>x(U)},n.toDisplayString(U.label),13,jc))),128))],36)):n.createCommentVNode("",!0)],6)}}})),Vc=["title"],Tc={key:0,style:{"margin-left":"8px"}},Nc={key:0,class:"j-dialog-steps"},$c={key:1,class:"j-dialog-btns"},ga=te(n.defineComponent({name:"JDialog",__name:"index",props:{visible:{type:Boolean},title:{type:String,default:""},subtitle:{type:Function,default:void 0},width:{type:Number,default:600},height:{type:Number,default:400},minWidth:{type:Number,default:300},minHeight:{type:Number,default:200},mask:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},showCloseBtn:{type:Boolean,default:!0},autoHeight:{type:Boolean,default:!1},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},zoomControls:{type:Boolean,default:!0},beforeClose:{type:Function,default:void 0},buttons:{type:Array,default:()=>[]}},emits:["update:visible","update:stepActive","cancel","ok","closed"],setup(e,{expose:t,emit:o}){const i=e,a=o,{t:l}=Pe(),r=n.ref(!1),s=n.ref(!1),d=n.ref(""),c=n.ref(!1),f=n.ref(!0),u=n.ref(!1),p=n.ref(!0),h=n.ref(-1),m=n.reactive({isMove:!1,pageX:0,pageY:0,left:0,top:0,_left:0,_top:0}),g=n.ref(0),b=n.ref(),k=n.ref(48),v=n.ref(0),w=n.ref(0);n.watch(()=>i.visible,Y=>{g.value=1,g.value=0,r.value=Y,Y===!0&&i.zoomControls&&n.nextTick(()=>{typeof document<"u"&&(b.value=document.querySelector(".j-dialog"),b.value&&(b.value.onmousemove=pe))})},{immediate:!0});const C=n.computed(()=>{let Y=i.height+g.value;return typeof window<"u"&&Y+40>window.innerHeight&&(Y=window.innerHeight-32-40),Y}),S=n.computed(()=>{let Y=0+g.value;return typeof document<"u"&&document.body&&(Y=(document.body.clientWidth-E.value)/2),Y}),y=n.computed(()=>{let Y=0+g.value;return typeof window<"u"&&(Y=(window.innerHeight-C.value-40)/2),Y}),E=n.computed(()=>{let Y=0+g.value;return Y=i.width,typeof document<"u"&&document.body&&Y>document.body.clientWidth&&(Y=document.body.clientWidth-32),Y}),B=Y=>{d.value=Y||"保存数据中...",s.value=!0},_=()=>{s.value=!1},T=()=>{i.beforeClose&&i.beforeClose()===!1||(r.value=!1,a("update:visible",!1),a("cancel"))},j=()=>{a("ok",B,_)},D=()=>{m.left=0,m.top=0,w.value=0,v.value=0,i.isStep&&(A.value=0,n.nextTick(()=>{L()})),a("closed")},A=n.computed({get(){return h.value!==-1?h.value:i.stepActive},set(Y){h.value=Y,a("update:stepActive",Y)}}),R=()=>{A.value>0&&A.value--,n.nextTick(()=>{L()})},V=async()=>{await x()&&(A.value<i.steps.length-1&&(A.value+=1),n.nextTick(()=>{L()}))},x=async()=>{if(c.value=!0,i.validateSteps){const Y=await i.validateSteps(i.stepActive,B,_);return c.value=!1,Y}return c.value=!1,!0},L=()=>{switch(p.value=!0,u.value=!0,f.value=!0,A.value){case 0:u.value=!1;break;case i.steps.length-1:f.value=!1,p.value=!1;break;default:f.value=!1,u.value=!1;break}},P=n.computed(()=>i.steps.map(Y=>({title:Y,disabled:!0}))),G=function(Y){i.autoHeight||(m.pageX=Y.pageX,m.pageY=Y.pageY,m._left=m.left,m._top=m.top,m.isMove=!0,typeof document<"u"&&(document.onmouseup=K,document.onmousemove=ne))},K=()=>{m.isMove=!1,typeof document<"u"&&(document.onmouseup=null,document.onmousemove=null)},ne=Y=>{if(m.isMove){const he=Y.pageX-m.pageX,ae=Y.pageY-m.pageY;let se=m._left+he,xe=m._top+ae;se+S.value<0&&(se=-S.value),typeof document<"u"&&document.body&&(v.value?se+v.value+S.value>document.body.clientWidth&&(se=document.body.clientWidth-v.value-S.value):se+E.value+S.value>document.body.clientWidth&&(se=document.body.clientWidth-E.value-S.value)),xe+y.value<0&&(xe=-y.value),typeof window<"u"&&(w.value?xe+w.value+y.value+40>window.innerHeight&&(xe=window.innerHeight-w.value-y.value-40):xe+C.value+y.value+40>window.innerHeight&&(xe=window.innerHeight-C.value-y.value-40)),m.left=se,m.top=xe}},pe=Y=>{const he=b.value.offsetLeft,ae=b.value.offsetTop,se=b.value.clientWidth,xe=b.value.clientHeight,Ve=xe-k.value,H=b.value.scrollTop;if(Y.clientX>he+se-10&&H+Y.clientY>ae+xe-10||H+Y.clientY<ae+5&&he+10>Y.clientX)b.value.style.cursor="se-resize";else if(he+10>Y.clientX&&H+Y.clientY>ae+xe-10||Y.clientX>he+se-10&&H+Y.clientY<ae+5)b.value.style.cursor="sw-resize";else if(Y.clientX>he+se-10||he+10>Y.clientX)b.value.style.cursor="w-resize";else if(H+Y.clientY>ae+xe-10||H+Y.clientY<ae+5)b.value.style.cursor="s-resize";else{b.value.style.cursor="default",b.value.onmousedown=null;return}b.value.onmousedown=X=>{const{clientX:le}=X,{clientY:we}=X,$e=m.left+S.value,Re=m.top+y.value;m._left=m.left,m._top=m.top,w.value||(w.value=Ve),v.value||(v.value=se),le>$e+10&&le<$e+se-10&&we>Re+5&&we<Re+47||(typeof document<"u"&&(document.onmousemove=function(me){me.preventDefault(),le>$e&&le<$e+10&&(le>me.clientX&&(v.value=se+(le-me.clientX),m.left=m._left-(le-me.clientX)),le<me.clientX&&v.value>i.minWidth&&(v.value=se-(me.clientX-le),m.left=m._left+me.clientX-le)),le>$e+se-10&&le<$e+se&&(le>me.clientX&&v.value>i.minWidth&&(v.value=se-(le-me.clientX)),le<me.clientX&&typeof document<"u"&&document.body&&S.value+m.left+v.value<document.body.clientWidth&&(v.value=se+(me.clientX-le))),we>Re&&we<Re+5&&(we>me.clientY&&(w.value=Ve+we-me.clientY,m.top=m._top-(we-me.clientY)),we<me.clientY&&w.value>i.minHeight&&(w.value=Ve-(me.clientY-we),m.top=m._top+me.clientY-we)),H+we>Re+Ve+38&&H+we<Re+Ve+48&&(we>me.clientY&&w.value>i.minHeight&&(w.value=Ve-(we-me.clientY)),we<me.clientY&&typeof window<"u"&&y.value+m.top+w.value+48<window.innerHeight&&(w.value=Ve+me.clientY-we))}),typeof document<"u"&&(document.onmouseup=function(){typeof document<"u"&&(document.onmousemove=null,document.onmouseup=null)}))}},fe=async Y=>{Y.click&&await Y.click()};return t({showLoading:B,hideLoading:_}),(Y,he)=>{const ae=n.resolveComponent("j-button"),se=n.resolveComponent("el-space"),xe=n.resolveComponent("el-step"),Ve=n.resolveComponent("el-steps"),H=n.resolveComponent("el-dialog");return n.openBlock(),n.createBlock(H,{modelValue:r.value,"onUpdate:modelValue":he[0]||(he[0]=X=>r.value=X),class:"j-dialog","align-center":"","append-to-body":!0,"destroy-on-close":e.destroyOnClose,"show-close":!1,modal:e.mask,"modal-penetrable":!e.mask,"close-on-click-modal":!1,width:`${v.value||E.value}px`,style:n.normalizeStyle({position:"fixed",left:`${S.value+m.left}px`,top:`${y.value+m.top}px`,"pointer-events":e.mask?"":"none"}),onClosed:D},{default:n.withCtx(()=>[n.createElementVNode("div",{class:"j-dialog-header",onMousedown:G},[n.createElementVNode("div",{class:"j-dialog-header-left",title:n.unref(l)(e.title||""),style:n.normalizeStyle({cursor:e.autoHeight?"":"move"})},[n.createElementVNode("span",null,n.toDisplayString(n.unref(l)(e.title||"")),1),e.subtitle?(n.openBlock(),n.createElementBlock("span",Tc,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.subtitle())))])):n.createCommentVNode("",!0)],12,Vc),e.showCloseBtn?(n.openBlock(),n.createBlock(se,{key:0,size:0},{default:n.withCtx(()=>[n.createVNode(ae,{type:"text",icon:"mdi:close",onClick:T})]),_:1})):n.createCommentVNode("",!0)],32),n.createElementVNode("div",{class:n.normalizeClass(["j-dialog-window",{"j-dialog-window-hasBtns":e.hasBtns},{"j-dialog-window-hasSteps":e.isStep}]),style:n.normalizeStyle({height:e.autoHeight?"auto":(w.value>0?w.value:C.value)+"px"})},[e.isStep?(n.openBlock(),n.createElementBlock("div",Nc,[n.createElementVNode("div",{style:n.normalizeStyle({maxWidth:`${200*P.value.length}px`,width:"100%"})},[n.createVNode(Ve,{simple:"",active:A.value,space:160,"finish-status":"success"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(P.value,(X,le)=>(n.openBlock(),n.createBlock(xe,{key:le,title:n.unref(l)(X.title)},null,8,["title"]))),128))]),_:1},8,["active"])],4)])):n.createCommentVNode("",!0),n.renderSlot(Y.$slots,"default"),e.hasBtns?(n.openBlock(),n.createElementBlock("div",$c,[n.createVNode(se,{size:8},{default:n.withCtx(()=>[e.isStep?(n.openBlock(),n.createBlock(ae,{key:0,size:"mini",disabled:f.value,label:n.unref(l)("上一步"),onClick:R},null,8,["disabled","label"])):n.createCommentVNode("",!0),e.isStep?(n.openBlock(),n.createBlock(ae,{key:1,size:"mini",disabled:u.value,loading:c.value,label:n.unref(l)("下一步"),onClick:V},null,8,["disabled","loading","label"])):n.createCommentVNode("",!0),!e.isStep&&e.showCloseBtn?(n.openBlock(),n.createBlock(ae,{key:2,size:"mini",label:n.unref(l)("取消"),onClick:T},null,8,["label"])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.buttons,X=>(n.openBlock(),n.createBlock(ae,{key:X.prop,label:X.label,danger:X.danger,ghost:X.ghost,type:X.type,icon:X.icon,onClick:le=>fe(X)},null,8,["label","danger","ghost","type","icon","onClick"]))),128)),e.hasSaveBtn?(n.openBlock(),n.createBlock(ae,{key:3,size:"mini",type:"primary",disabled:p.value&&e.isStep,label:n.unref(l)(e.btnText),onClick:j},null,8,["disabled","label"])):n.createCommentVNode("",!0)]),_:1})])):n.createCommentVNode("",!0)],6)]),_:3},8,["modelValue","destroy-on-close","modal","modal-penetrable","width","style"])}}})),Mc=["element-loading-text"],Lc={class:"j-dialog-full-header"},Pc={class:"j-dialog-full-header-left"},Rc=["src"],Ac={class:"j-dialog-full-title-text"},Oc={style:{height:"28px","line-height":"32px","margin-left":"8px"}},Fc={class:"j-dialog-full-header-right"},Ic={class:"j-dialog-full-body"},ya=te(n.defineComponent({name:"JDialogFull",__name:"index",props:{visible:{type:Boolean},title:{type:String,default:""},destroyOnClose:{type:Boolean,default:!1},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},showCloseBtn:{type:Boolean,default:!0},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},beforeClose:{type:Function,default:void 0},buttons:{type:Array,default:()=>[]},subtitle:{type:Function,default:void 0}},emits:["update:stepActive","update:visible","cancel","ok","closed"],setup(e,{expose:t,emit:o}){const i=e,a=o,{logoImg:l,t:r}=Pe(),s=n.ref(!1),d=n.ref(!1),c=n.ref(""),f=n.ref(!1),u=n.ref(!0),p=n.ref(!1),h=n.ref(!0),m=n.ref(-1);n.watch(()=>i.visible,j=>{s.value=j},{immediate:!0});const g=n.computed({get(){return m.value!==-1?m.value:i.stepActive},set(j){m.value=j,a("update:stepActive",j)}}),b=()=>{i.beforeClose&&i.beforeClose()===!1||(s.value=!1,a("update:visible",!1),a("cancel"))},k=()=>{a("ok",w,C)},v=()=>{i.isStep&&(g.value=0,n.nextTick(()=>{B()})),a("closed")},w=j=>{c.value=j||"保存数据中...",d.value=!0},C=()=>{d.value=!1},S=()=>{g.value>0&&g.value--,n.nextTick(()=>{B()})},y=async()=>{await E()&&(g.value<i.steps.length-1&&(g.value+=1),n.nextTick(()=>{B()}))},E=async()=>{if(f.value=!0,i.validateSteps){const j=await i.validateSteps(i.stepActive,w,C);return f.value=!1,j}return f.value=!1,!0},B=()=>{switch(h.value=!0,p.value=!0,u.value=!0,g.value){case 0:p.value=!1;break;case i.steps.length-1:u.value=!1,h.value=!1;break;default:u.value=!1,p.value=!1;break}},_=n.computed(()=>i.steps.map(j=>({title:j,disabled:!0}))),T=async j=>{j.click&&await j.click()};return t({showLoading:w,hideLoading:C}),(j,D)=>{const A=n.resolveComponent("el-step"),R=n.resolveComponent("el-steps"),V=n.resolveComponent("j-button"),x=n.resolveComponent("el-space"),L=n.resolveComponent("el-divider"),P=n.resolveComponent("el-dialog"),G=n.resolveDirective("loading");return n.openBlock(),n.createBlock(P,{modelValue:s.value,"onUpdate:modelValue":D[0]||(D[0]=K=>s.value=K),class:"j-dialog-full",width:"100%","append-to-body":!0,fullscreen:!0,"show-close":!1,modal:!0,"destroy-on-close":e.destroyOnClose,onClosed:v},{default:n.withCtx(()=>[n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:"j-block j-dialog-full-window","element-loading-text":n.unref(r)(c.value)},[n.createElementVNode("div",Lc,[n.createElementVNode("div",Pc,[n.unref(l)?(n.openBlock(),n.createElementBlock("img",{key:0,class:"j-dialog-full-header-logo",src:n.unref(l)},null,8,Rc)):n.createCommentVNode("",!0),n.createElementVNode("span",Ac,n.toDisplayString(n.unref(r)(e.title)),1),n.createElementVNode("span",Oc,[e.subtitle?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.subtitle()),{key:0})):n.createCommentVNode("",!0)])]),n.createElementVNode("div",{class:"j-dialog-full-header-mid",style:n.normalizeStyle({maxWidth:`${200*_.value.length}px`})},[e.isStep?(n.openBlock(),n.createBlock(R,{key:0,simple:"",active:g.value,space:160,"finish-status":"success"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(_.value,(K,ne)=>(n.openBlock(),n.createBlock(A,{key:ne,title:n.unref(r)(K.title)},null,8,["title"]))),128))]),_:1},8,["active"])):n.createCommentVNode("",!0)],4),n.createElementVNode("div",Fc,[n.createVNode(x,{size:0},{default:n.withCtx(()=>[e.hasBtns?(n.openBlock(),n.createBlock(x,{key:0},{default:n.withCtx(()=>[e.isStep?(n.openBlock(),n.createBlock(V,{key:0,size:"mini",disabled:u.value,label:n.unref(r)("上一步"),onClick:S},null,8,["disabled","label"])):n.createCommentVNode("",!0),e.isStep?(n.openBlock(),n.createBlock(V,{key:1,size:"mini",disabled:p.value,loading:f.value,label:n.unref(r)("下一步"),onClick:y},null,8,["disabled","loading","label"])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.buttons,K=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:K.prop},[K.display!==!1?(n.openBlock(),n.createBlock(V,{key:0,label:K.label,danger:K.danger,ghost:K.ghost,type:K.type,disabled:K.disabled,icon:K.icon?K.icon:"",onClick:ne=>T(K)},null,8,["label","danger","ghost","type","disabled","icon","onClick"])):n.createCommentVNode("",!0)],64))),128)),e.hasSaveBtn?(n.openBlock(),n.createBlock(V,{key:2,size:"mini",type:"primary",disabled:h.value&&e.isStep,label:n.unref(r)(e.btnText),onClick:k},null,8,["disabled","label"])):n.createCommentVNode("",!0)]),_:1})):n.createCommentVNode("",!0),e.showCloseBtn&&e.hasBtns?(n.openBlock(),n.createBlock(L,{key:1,type:"vertical",style:{margin:"0 8px"}})):n.createCommentVNode("",!0),e.showCloseBtn?(n.openBlock(),n.createBlock(V,{key:2,type:"text",icon:"mdi:close",onClick:b})):n.createCommentVNode("",!0)]),_:1})])]),n.createElementVNode("div",Ic,[n.renderSlot(j.$slots,"default")])],8,Mc)),[[G,d.value]])]),_:3},8,["modelValue","destroy-on-close"])}}})),zc=["element-loading-text"],Dc={class:"j-block"},Hc={key:0,class:"j-drawer-bottom-btns"},Wc={class:"j-drawer--header"},Uc={class:"j-drawer--title"},Jc={style:{height:"28px","line-height":"32px","margin-left":"8px"}},Yc={key:0,class:"j-drawer--btns"},qc={key:0,class:"j-drawer-steps"},ba=te(n.defineComponent({name:"JDrawer",__name:"drawer",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},direction:{type:String,default:"rtl"},height:{type:Number,default:400},width:{type:Number,default:600},mask:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},beforeClose:{type:Function,default:void 0},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},showCloseBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},buttons:{type:Array,default:()=>[]},subtitle:{type:Function,default:void 0}},emits:["update:visible","update:stepActive","closed","ok","cancel"],setup(e,{expose:t,emit:o}){const i=e,{t:a}=Pe(),l=o,r=n.ref(!1),s=n.ref(""),d=n.computed(()=>["ltr","rtl"].indexOf(i.direction)!==-1?`${i.width}px`:`${i.height}px`),c=n.computed({get(){return i.visible},set(j){l("update:visible",!!j)}}),f=j=>{s.value=j||"保存数据中...",r.value=!0},u=()=>{r.value=!1},p=()=>{i.isStep&&(S.value=0,n.nextTick(()=>{_()})),l("closed")},h=()=>{l("ok",f,u)},m=()=>{i.beforeClose&&i.beforeClose()===!1||(c.value=!1,l("update:visible",!1),l("cancel"))},g=async j=>{j.click&&await j.click()},b=n.ref(!1),k=n.ref(!0),v=n.ref(!1),w=n.ref(!0),C=n.ref(-1),S=n.computed({get(){return C.value!==-1?C.value:i.stepActive},set(j){C.value=j,l("update:stepActive",j)}}),y=()=>{S.value>0&&S.value--,n.nextTick(()=>{_()})},E=async()=>{await B()&&(S.value<i.steps.length-1&&(S.value+=1),n.nextTick(()=>{_()}))},B=async()=>{if(b.value=!0,i.validateSteps){const j=await i.validateSteps(i.stepActive,f,u);return b.value=!1,j}return b.value=!1,!0},_=()=>{switch(w.value=!0,v.value=!0,k.value=!0,S.value){case 0:v.value=!1;break;case i.steps.length-1:k.value=!1,w.value=!1;break;default:k.value=!1,v.value=!1;break}},T=n.computed(()=>i.steps.map(j=>({title:j,disabled:!0})));return t({showLoading:f,hideLoading:u}),(j,D)=>{const A=n.resolveComponent("el-input"),R=n.resolveComponent("j-button"),V=n.resolveComponent("el-space"),x=n.resolveComponent("el-step"),L=n.resolveComponent("el-steps"),P=n.resolveComponent("el-drawer"),G=n.resolveDirective("loading");return n.openBlock(),n.createBlock(P,{modelValue:c.value,"onUpdate:modelValue":D[0]||(D[0]=K=>c.value=K),class:"j-drawer","append-to-body":!0,direction:e.direction,size:d.value,"with-header":!1,"wrapper-closable":!0,"destroy-on-close":e.destroyOnClose,modal:e.mask,"before-close":e.beforeClose,"close-on-click-modal":!0,onClosed:p},{default:n.withCtx(()=>[n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-drawer--warpper",{"j-drawer--warpper-hasSteps":e.isStep}]),"element-loading-text":s.value},[n.createElementVNode("div",{class:"j-drawer--body",style:n.normalizeStyle({"padding-bottom":e.showCloseBtn||e.hasSaveBtn||e.buttons.length>0?"48px":"0"})},[n.createVNode(A,{style:{position:"absolute",top:"-200px"}}),n.createElementVNode("div",Dc,[n.renderSlot(j.$slots,"default")]),e.hasBtns?(n.openBlock(),n.createElementBlock("div",Hc,[n.createVNode(V,{size:8},{default:n.withCtx(()=>[e.isStep?(n.openBlock(),n.createBlock(R,{key:0,size:"mini",disabled:k.value,label:n.unref(a)("上一步"),onClick:y},null,8,["disabled","label"])):n.createCommentVNode("",!0),e.isStep?(n.openBlock(),n.createBlock(R,{key:1,size:"mini",disabled:v.value,loading:b.value,label:n.unref(a)("下一步"),onClick:E},null,8,["disabled","loading","label"])):n.createCommentVNode("",!0),!e.isStep&&e.showCloseBtn?(n.openBlock(),n.createBlock(R,{key:2,size:"mini",label:n.unref(a)("取消"),onClick:m},null,8,["label"])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.buttons,K=>(n.openBlock(),n.createBlock(R,{key:K.prop,label:K.label,danger:K.danger,ghost:K.ghost,type:K.type,icon:K.icon,onClick:ne=>g(K)},null,8,["label","danger","ghost","type","icon","onClick"]))),128)),e.hasSaveBtn?(n.openBlock(),n.createBlock(R,{key:3,size:"mini",type:"primary",disabled:w.value&&e.isStep,label:n.unref(a)(e.btnText),onClick:h},null,8,["disabled","label"])):n.createCommentVNode("",!0)]),_:1})])):n.createCommentVNode("",!0)],4),n.createElementVNode("div",Wc,[n.createElementVNode("div",Uc,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a)(e.title)),1),n.createElementVNode("span",Jc,[e.subtitle?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.subtitle()),{key:0})):n.createCommentVNode("",!0)])]),e.showCloseBtn?(n.openBlock(),n.createElementBlock("div",Yc,[n.createVNode(R,{type:"text",icon:"mdi:close",onClick:m})])):n.createCommentVNode("",!0)]),e.isStep?(n.openBlock(),n.createElementBlock("div",qc,[n.createElementVNode("div",{style:n.normalizeStyle({maxWidth:`${200*T.value.length}px`,width:"100%"})},[n.createVNode(L,{simple:"",active:S.value,space:160,"finish-status":"success"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(T.value,(K,ne)=>(n.openBlock(),n.createBlock(x,{key:ne,title:n.unref(a)(K.title)},null,8,["title"]))),128))]),_:1},8,["active"])],4)])):n.createCommentVNode("",!0)],10,zc)),[[G,r.value]])]),_:3},8,["modelValue","direction","size","destroy-on-close","modal","before-close"])}}})),wa=te(n.defineComponent({name:"JLayer",__name:"layer",props:{width:{type:Number,default:600},height:{type:Number,default:400},isStep:{type:Boolean,default:!1},steps:{type:Array,default:()=>[]},hasHeader:{type:Boolean,default:!0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},buttons:{type:Array,default:()=>[]},destroyOnClose:{type:Boolean,default:!0},validateSteps:{type:Function,default:void 0},beforeClose:{type:Function,default:void 0}},emits:["ok","closed","cancel"],setup(e,{expose:t,emit:o}){const i=o,a=n.ref(!1),l=n.ref(""),r=n.ref(),s=n.ref(0),d=n.ref(""),c=n.ref(),f=(k,v,w)=>{l.value=k,c.value=w,d.value=v||"modal",a.value=!0},u=()=>{a.value=!1},p=(k,v)=>{i("ok",k,v)},h=()=>{s.value=0,i("closed")},m=()=>{i("cancel")},g=k=>{r.value&&r.value.showLoading(k)},b=()=>{r.value&&r.value.hideLoading()};return vc({stepActive:s}),t({open:f,close:u,showLoading:g,hideLoading:b}),(k,v)=>{const w=n.resolveComponent("j-dialog-full"),C=n.resolveComponent("j-drawer"),S=n.resolveComponent("j-dialog");return d.value==="full"?(n.openBlock(),n.createBlock(w,{key:0,ref_key:"modalRef",ref:r,visible:a.value,"onUpdate:visible":v[0]||(v[0]=y=>a.value=y),"step-active":s.value,"onUpdate:stepActive":v[1]||(v[1]=y=>s.value=y),title:l.value,"before-close":e.beforeClose,"is-step":e.isStep,steps:e.steps,"validate-steps":e.validateSteps,"has-btns":e.hasBtns,"btn-text":e.btnText,"destroy-on-close":e.destroyOnClose,buttons:e.buttons,"has-save-btn":e.hasSaveBtn,"has-header":e.hasHeader,subtitle:c.value,onOk:p,onClosed:h,onCancel:m},{default:n.withCtx(()=>[n.renderSlot(k.$slots,"default")]),_:3},8,["visible","step-active","title","before-close","is-step","steps","validate-steps","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","has-header","subtitle"])):d.value==="drawer"?(n.openBlock(),n.createBlock(C,{key:1,ref_key:"modalRef",ref:r,visible:a.value,"onUpdate:visible":v[2]||(v[2]=y=>a.value=y),"step-active":s.value,"onUpdate:stepActive":v[3]||(v[3]=y=>s.value=y),"is-step":e.isStep,steps:e.steps,"validate-steps":e.validateSteps,"has-btns":e.hasBtns,"btn-text":e.btnText,"destroy-on-close":e.destroyOnClose,buttons:e.buttons,"has-save-btn":e.hasSaveBtn,"has-header":e.hasHeader,subtitle:c.value,onOk:p,onClosed:h,onCancel:m},{default:n.withCtx(()=>[n.renderSlot(k.$slots,"default")]),_:3},8,["visible","step-active","is-step","steps","validate-steps","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","has-header","subtitle"])):(n.openBlock(),n.createBlock(S,{key:2,ref_key:"modalRef",ref:r,visible:a.value,"onUpdate:visible":v[4]||(v[4]=y=>a.value=y),"step-active":s.value,"onUpdate:stepActive":v[5]||(v[5]=y=>s.value=y),width:e.width,height:e.height,title:l.value,"before-close":e.beforeClose,"has-btns":e.hasBtns,"btn-text":e.btnText,"destroy-on-close":e.destroyOnClose,buttons:e.buttons,"has-save-btn":e.hasSaveBtn,"is-step":e.isStep,steps:e.steps,"validate-steps":e.validateSteps,subtitle:c.value,onOk:p,onClosed:h,onCancel:m},{default:n.withCtx(()=>[n.renderSlot(k.$slots,"default")]),_:3},8,["visible","step-active","width","height","title","before-close","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","is-step","steps","validate-steps","subtitle"]))}}})),va=te(n.defineComponent({name:"JDynamicLayer",__name:"dynamic-layer",setup(e,{expose:t}){const o=n.ref(),i=n.ref(600),a=n.ref(400),l=n.ref(!0),r=n.ref(!0),s=n.ref(!0),d=n.ref(""),c=n.ref([]),f=n.ref(!0),u=n.ref(),p=n.shallowRef(),h=n.ref(),{getPageName:m}=bc(),g=()=>{const A=m();return A||(typeof p.value=="string"?p.value:"")},b=n.ref(!1),k=n.ref([]),v=async A=>{if(u.value?.validateSteps){Ht(!0);const R=u.value.validateSteps(A);return Ht(!1),R}return!0},w=()=>u.value?.beforeClose?u.value.beforeClose():!0;let C,S,y,E=0;const B=async A=>{if(u.value){if(E=0,u.value.getConfig){const R=u.value.getConfig();c.value=R.buttons||[],b.value=R.isStep,k.value=R.steps||[]}else c.value=[],b.value=!1,k.value=[];if(u.value.open)try{const{buttons:R}=await u.value.open(A,o.value,()=>{C&&C()})||{};if(R&&R.length>0){const V=[];V.push(...c.value),V.push(...R),c.value=V}}catch(R){o.value.close(),console.error(R)}o.value.hideLoading()}else{if(E>600){console.warn("表单组件加载超时"),o.value.hideLoading();return}E++,setTimeout(async()=>{await B(A)},100)}},_=A=>{p.value=A?.name,i.value=A?.width||600,a.value=A?.height||400,l.value=A?.hasBtns!==!1,r.value=A?.hasSaveBtn!==!1,s.value=A?.hasHeader!==!1,A?.destroyOnClose!==!1&&(f.value=!0),h.value=A?.config||{},d.value=A?.btnText||"保存",C=A?.afterOk||null,S=A?.afterClose||null,y=A?.afterCancel||null,o.value.open(A.title,A.type,A.subtitle),n.nextTick(async()=>{o.value.showLoading("加载中"),await B(A.param||{})})},T=async()=>{if(u.value?.ok){Ht(!0);const A=await u.value.ok();A&&(o.value.close(),C&&await C(A)),Ht(!1)}},j=()=>{u.value?.closed&&u.value.closed(),S&&S()},D=()=>{y&&y()};return wc({getPageName:g}),t({open:_}),(A,R)=>{const V=n.resolveComponent("j-layer");return n.openBlock(),n.createBlock(V,{ref_key:"layerRef",ref:o,width:i.value,height:a.value,"before-close":w,"validate-steps":v,"is-step":b.value,steps:k.value,"has-btns":l.value,buttons:c.value,"btn-text":d.value,"destroy-on-close":f.value,"has-save-btn":r.value,"has-header":s.value,onOk:T,onClosed:j,onCancel:D},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(p.value),n.mergeProps({ref_key:"componentRef",ref:u},h.value),null,16))]),_:1},8,["width","height","is-step","steps","has-btns","buttons","btn-text","destroy-on-close","has-save-btn","has-header"])}}})),Ca=te(n.defineComponent({name:"JInputTag",__name:"input-tag",props:{modelValue:{default:void 0},options:{default:()=>[]},placeholder:{default:"请输入标签,回车完成标签填写"},readonly:{type:Boolean,default:!1},colors:{default:()=>[]},isStyleLoop:{type:Boolean,default:!0},size:{default:"default"}},emits:["update:modelValue","change","select","search"],setup(e,{emit:t}){const o=e,i=t,a=n.ref(),l=n.computed(()=>it(o.modelValue)?[]:o.modelValue?.split(",")||[]),r=n.computed(()=>o.isStyleLoop?l.value?.map((u,p)=>{let h=o.colors[p%o.colors.length]||{};return h={...h,borderWidth:(h.borderWidth||0)+"px"},h})||[]:o.colors),s=u=>{c(),i("select",u)},d=u=>{u.preventDefault(),u.stopPropagation()},c=()=>{if(a.value){const u=[...l.value,a.value];a.value="",i("update:modelValue",u.join(",")),i("change",{value:u.join(",")})}},f=u=>{const p=[...l.value];p.splice(u,1),i("update:modelValue",p.join(",")),i("change",{value:p.join(",")})};return(u,p)=>{const h=n.resolveComponent("el-tag"),m=n.resolveComponent("el-space"),g=n.resolveComponent("j-autocomplete");return n.openBlock(),n.createBlock(g,{modelValue:a.value,"onUpdate:modelValue":p[0]||(p[0]=b=>a.value=b),class:"j-input-tag",options:e.options,style:{width:"100%"},readonly:e.readonly,placeholder:e.placeholder,size:e.size,onSelect:s,onKeyup:n.withKeys(n.withModifiers(c,["stop"]),["enter"]),onKeydown:n.withKeys(n.withModifiers(d,["stop"]),["enter"])},{prefix:n.withCtx(()=>[n.createVNode(m,null,{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,(b,k)=>(n.openBlock(),n.createBlock(h,{key:k,type:"info",closable:!e.readonly,style:n.normalizeStyle(r.value[k]||{}),size:e.size,onClose:n.withModifiers(v=>f(k),["prevent"])},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(b),1)]),_:2},1032,["closable","style","size","onClose"]))),128))]),_:1})]),_:1},8,["modelValue","options","readonly","placeholder","size","onKeyup","onKeydown"])}}})),ka=te(n.defineComponent({name:"JRate",__name:"rate",props:{modelValue:{default:0},max:{default:5},allowClear:{type:Boolean,default:!1},allowHalf:{type:Boolean,default:!1},showText:{type:Boolean,default:!1},showScore:{type:Boolean,default:!1},texts:{default:()=>[]},readonly:{type:Boolean,default:!1},size:{default:"default"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,a=n.computed({get(){return Number(o.modelValue)},set(d){i("update:modelValue",d),i("change",{value:d})}}),l=n.computed(()=>o.texts?.map(d=>d.value)||[]),r=n.ref(0),s=d=>{r.value=d};return(d,c)=>{const f=n.resolveComponent("el-rate");return n.openBlock(),n.createBlock(f,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=u=>a.value=u),size:e.size,max:e.max,"allow-half":e.allowHalf,clearable:e.allowClear,disabled:e.readonly,"show-text":e.showText,texts:l.value,"show-score":e.showScore,onHoverChange:s},null,8,["modelValue","size","max","allow-half","clearable","disabled","show-text","texts","show-score"])}}})),xa=te(n.defineComponent({name:"JSlider",__name:"slider",props:{modelValue:{default:0},min:{default:0},max:{default:100},readonly:{type:Boolean,default:!1},step:{default:1},showInput:{type:Boolean,default:!1},showInputControls:{type:Boolean,default:!0},size:{default:"default"},showStops:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},formatTooltip:{},range:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1},height:{},ariaLabel:{},rangeStartLabel:{},rangeEndLabel:{},formatValueText:{},tooltipClass:{},placement:{default:"top"},marks:{},validateEvent:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,a=n.computed({get(){return Number(o.modelValue)},set(l){i("update:modelValue",l),i("change",{value:l})}});return(l,r)=>{const s=n.resolveComponent("el-slider");return n.openBlock(),n.createBlock(s,{modelValue:a.value,"onUpdate:modelValue":r[0]||(r[0]=d=>a.value=d),min:e.min,max:e.max,disabled:e.readonly,step:e.step,"show-input":e.showInput,"show-input-controls":e.showInputControls,size:e.size,"input-size":e.size,"show-stops":e.showStops,"show-tooltip":e.showTooltip,"format-tooltip":e.formatTooltip,range:e.range,vertical:e.vertical,height:e.height,"aria-label":e.ariaLabel,"range-start-label":e.rangeStartLabel,"range-end-label":e.rangeEndLabel,"format-value-text":e.formatValueText,"tooltip-class":e.tooltipClass,placement:e.placement,marks:e.marks,"validate-event":e.validateEvent,persistent:e.persistent},null,8,["modelValue","min","max","disabled","step","show-input","show-input-controls","size","input-size","show-stops","show-tooltip","format-tooltip","range","vertical","height","aria-label","range-start-label","range-end-label","format-value-text","tooltip-class","placement","marks","validate-event","persistent"])}}})),Fn=e=>e<1024?un(e)+" B":e>=1024&&e<1048576?un(e/1024)+" KB":e>=1048576&&e<1073741824?un(e/1024/1024)+" MB":e>=1073741824?un(e/1024/1024/1024)+" GB":"",Gc=e=>{const t=window.open("_blank");t&&(t.location=e)},Kc={key:1,style:{position:"relative",width:"72px",height:"72px",overflow:"hidden"}},Xc=["src"],Zc={class:"j-upload-dragItem-content"},Qc={class:"j-upload-dragItem-mask"},ed=["src"],td={class:"j-upload-imgItem-mask"},nd={class:"j-upload-item-content"},Sa=n.defineComponent({__name:"list",props:{isUploadImg:{type:Boolean,default:!1},drag:{type:Boolean,default:!1},showFileList:{type:Boolean,default:!0},list:{type:Array,default:()=>[]},previewFile:{type:Function,required:!0},deleteFile:{type:Function,required:!0},readonly:{type:Boolean,default:!1},isShowSuccessIcon:{type:Boolean,default:!0}},setup(e){const{t}=Pe();return(o,i)=>{const a=n.resolveComponent("j-icon"),l=n.resolveComponent("el-text"),r=n.resolveComponent("j-button"),s=n.resolveComponent("el-progress"),d=n.resolveComponent("el-link");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-upload-list",{"j-upload-image-list":e.isUploadImg,"j-upload-drag-list":e.drag}])},[e.drag?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.showFileList?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(e.list,c=>(n.openBlock(),n.createElementBlock("div",{key:c.id,class:"j-upload-dragItem"},[e.isUploadImg?(n.openBlock(),n.createElementBlock("div",Kc,[n.createElementVNode("img",{src:c.url,style:{width:"100%"},alt:""},null,8,Xc)])):(n.openBlock(),n.createBlock(a,{key:0,icon:"file-text",style:n.normalizeStyle({color:c.color?`var(${c.color})`:void 0}),size:72},null,8,["style"])),n.createElementVNode("div",Zc,[n.createVNode(l,{ellipsis:""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(`${n.unref(t)(c.name)}${c.status==="unUpload"?"("+n.unref(t)("未传")+")":""}`),1)]),_:2},1024),n.createElementVNode("div",null,[c.status==="uploading"?(n.openBlock(),n.createBlock(l,{key:0},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(Fn)(c.uploadSize))+"/",1)]),_:2},1024)):n.createCommentVNode("",!0),n.createVNode(l,null,{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(Fn)(c.size)),1)]),_:2},1024)])]),n.withDirectives(n.createElementVNode("div",Qc,[c.status==="done"||c.status==="unUpload"?(n.openBlock(),n.createBlock(r,{key:0,icon:"mdi:eye",type:"link",onClick:n.withModifiers(f=>e.previewFile(c),["stop"])},null,8,["onClick"])):n.createCommentVNode("",!0),!e.readonly&&(c.status==="done"||c.status==="unUpload")?(n.openBlock(),n.createBlock(r,{key:1,icon:"mdi:delete",type:"link",danger:"",onClick:n.withModifiers(f=>e.deleteFile(c),["stop","prevent"])},null,8,["onClick"])):n.createCommentVNode("",!0)],512),[[n.vShow,c.status==="error"]]),c.status==="uploading"?(n.openBlock(),n.createBlock(s,{key:2,"stroke-width":4,style:{position:"absolute",bottom:"-4px",left:"0",margin:"0 !important"},percent:c.percent,"show-text":!1},null,8,["percent"])):n.createCommentVNode("",!0)]))),128)):n.createCommentVNode("",!0),n.renderSlot(o.$slots,"default")],64)):e.isUploadImg?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(e.list,c=>(n.openBlock(),n.createElementBlock("div",{key:c.id,class:"j-upload-imgItem"},[c.status==="done"||c.status==="unUpload"?(n.openBlock(),n.createElementBlock("img",{key:0,src:c.url,style:{width:"100%"},alt:""},null,8,ed)):n.createCommentVNode("",!0),n.withDirectives(n.createElementVNode("div",td,[c.status==="done"||c.status==="unUpload"?(n.openBlock(),n.createBlock(r,{key:0,type:"link",icon:"mdi:eye",onClick:n.withModifiers(f=>e.previewFile(c),["stop"])},null,8,["onClick"])):n.createCommentVNode("",!0),!e.readonly&&(c.status==="done"||c.status==="unUpload")?(n.openBlock(),n.createBlock(r,{key:1,type:"link",danger:"",icon:"mdi:delete",onClick:n.withModifiers(f=>e.deleteFile(c),["stop","prevent"])},null,8,["onClick"])):n.createCommentVNode("",!0)],512),[[n.vShow,c.status==="error"]]),c.status==="uploading"?(n.openBlock(),n.createBlock(s,{key:1,"stroke-width":4,percent:c.percent,"show-text":!1},null,8,["percent"])):n.createCommentVNode("",!0)]))),128)):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:2},n.renderList(e.list,c=>(n.openBlock(),n.createElementBlock("div",{key:c.id,class:"j-upload-item"},[n.createVNode(a,{icon:"file-text",style:n.normalizeStyle({color:c.color?`var(${c.color})`:void 0}),size:16},null,8,["style"]),n.createElementVNode("div",nd,[n.createVNode(d,{type:"primary",underline:"never",onClick:n.withModifiers(f=>e.previewFile(c),["stop"])},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(`${n.unref(t)(c.name)}${c.status==="unUpload"?"("+n.unref(t)("未传")+")":""}`),1)]),_:2},1032,["onClick"])]),c.status==="uploading"?(n.openBlock(),n.createBlock(l,{key:0},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(Fn)(c.uploadSize))+"/",1)]),_:2},1024)):n.createCommentVNode("",!0),n.createVNode(l,null,{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(Fn)(c.size)),1)]),_:2},1024),c.status==="done"&&e.isShowSuccessIcon?(n.openBlock(),n.createBlock(a,{key:1,class:"j-upload-item-success",icon:"check-circle",size:24})):n.createCommentVNode("",!0),e.readonly?n.createCommentVNode("",!0):n.withDirectives((n.openBlock(),n.createBlock(a,{key:2,class:"j-upload-item-error",icon:"delete",size:24,onClick:n.withModifiers(f=>e.deleteFile(c),["stop","prevent"])},null,8,["onClick"])),[[n.vShow,c.status==="error"]]),c.status==="uploading"?(n.openBlock(),n.createBlock(s,{key:3,style:{position:"absolute",bottom:"-4px",left:"0",margin:"0 !important"},"stroke-width":4,percent:c.percent,"show-text":!1},null,8,["percent"])):n.createCommentVNode("",!0)]))),128))],2)}}}),od={class:"j-upload"},id={key:0},ad={style:{"margin-top":"8px"}},ld={key:0,style:{"margin-top":"4px"}},rd={key:0,class:"j-block",style:{display:"flex","align-items":"center","justify-content":"center",overflow:"auto","overflow-x":"hidden"}},sd=["src"],cd={key:1,class:"j-block"},dd=["src"],Ba=te(n.defineComponent({name:"JUpload",__name:"upload",props:{modelValue:{type:String,default:void 0},readonly:{type:Boolean,default:!1},limit:{type:Number,default:1},multiple:{type:Boolean,default:!1},maxSize:{type:Number,default:void 0},sizeType:{type:String,default:void 0},accept:{type:String,default:void 0},showFileList:{type:Boolean,default:!0},drag:{type:Boolean,default:!1},onlyName:{type:Boolean,default:!1},isTip:Boolean,placeholder:{type:String,default:"点击上传"},btnType:{type:String,default:"primary"},btnSize:{type:String,default:"default"},btnText:{type:String,default:"查看"},isNotApi:{type:Boolean,default:!1},autoUpload:{type:Boolean,default:!0},isUploadImg:{type:Boolean,default:!1},isLayer:{type:Boolean,default:!1},upload:{type:Function,default:void 0},uploadCallback:{type:Function,default:void 0},isSaveLast:{type:Boolean,default:!1},isShowSuccessIcon:{type:Boolean,default:!0}},emits:["update:modelValue","change","start","success","error","delete","load","notUploadChange"],setup(e,{emit:t}){const o=e,i=t,{warning:a,error:l,createConfirm:r,t:s,apiUrl:d,token:c,useFile:f}=Pe(),{fileChunkedUpload:u,deleteFile:p}=f(),h=n.computed(()=>o.isUploadImg?o.accept||"image/*":o.accept),m=n.computed(()=>{if(o.limit!==-1)return o.limit}),g=n.computed(()=>o.limit===-1?"":`,${s("上传数量")}${o.limit}`),b=n.ref(""),k=n.computed(()=>({folderId:o.modelValue||b.value,maxSize:o.maxSize,sizeType:o.sizeType})),v=n.ref([]),w=()=>{v.value=[...v.value]},C=H=>{if(o.maxSize&&o.sizeType){let X=H;switch(o.sizeType){case"GB":X=1024*1024*1024*o.maxSize;break;case"MB":X=1024*1024*o.maxSize;break;case"KB":X=1024*o.maxSize;break;default:X=o.maxSize;break}if(X<H)return!1}return!0},S={doc:"file-word",docx:"file-word",xls:"file-excel",xlsx:"file-excel",pdf:"file-pdf",image:"file-image",txt:"file-txt",json:"file-json"},y=H=>{if(H){const X=H.split(".");return X[X.length-1]}return""},E=(H,X)=>{if(X&&X.indexOf("image")>-1)return"file-image";const le=y(H);return["webp","bmp","jpg","jpge","png","tif","gif","svg"].includes(le)?"file-image":S[le]||"file-ufo"},B=H=>{H.status=o.autoUpload?"uploading":"unUpload",H.uploadSize=0,H.icon=E(H.name,H.type),u||(H.icon="file-text"),H.id=H.uid,H.url=window.URL.createObjectURL(H),H.date=pn(),H.param=k.value},_=H=>{i("start",{file:H,list:v.value})},T=(H,X,le)=>{H.percent=le,H.uploadSize=X,w()},j=H=>{H.status="done",H.id+="1",H.uid+="1",w(),i("success",{file:H,list:v.value}),o.modelValue||(i("update:modelValue",b.value),i("change",{value:b.value}))},D=(H,X)=>{console.error(X,"简搭提醒您:文件上传错误!"),H.status="error",w(),i("error",{file:H,list:v.value})},A=H=>{if(v.value.push(H),H.status==="unUpload"){i("notUploadChange",{value:H.url});return}!o.isNotApi&&o.upload?o.upload(H):!o.isNotApi&&u?u(H,{onStart:_,onProgress:T,onSuccess:j,onError:D,uploadCallback:o.uploadCallback}):j(H)},R=H=>{if(!C(H.size))return l&&l("上传文件超出大小了"),!1},V=H=>{B(H.file),A(H.file)},x=H=>new Promise(X=>{r?r({title:"提示",iconType:"warning",content:`您确定删除【${H.name}】?`,onOk:()=>{X(!0)},onCancel:()=>{X(!1)}}):(L(H),X(!0))}),L=H=>{if(!o.isNotApi){const X=H.response?.fileId||H.id;p&&p(X)}v.value=v.value.filter(X=>X.id!==H.id),v.value.length===0&&(i("update:modelValue",""),i("change",{value:""})),i("delete",{file:H,list:v.value})},P=async H=>{await x(H)&&L(H)},G=n.ref(!1),K=n.ref(""),ne=n.ref(""),pe=n.ref(!1),fe=n.ref(!1);let Y=null;const he=n.ref(pn(new Date,"YYYY-MM-DD")),ae=H=>{if(H.isPreview===!1&&!o.isUploadImg){a&&a("无权限预览!");return}const X=H.name.split(".")[H.name.split(".").length-1];switch(Y=H,G.value=!1,K.value=H.name,X.toLowerCase()){case"jpg":case"gif":case"png":case"bmp":case"jpeg":case"svg":G.value=!0,ne.value=H.url,fe.value=!1,pe.value=!0;break;default:if(o.isNotApi){a&&a("预览表单中,不支持预览!");return}if(H.status!=="done"){a&&a("当前文件还没上传成功,不支持预览!");return}if(ne.value=se(H),ne.value===""){a&&a("当前文件不支持预览!");return}fe.value=!0,pe.value=!0;break}he.value=pn(new Date,"YYYY-MM-DD HH:mm:ss")},se=H=>{const X=H.response?.fileId||H.id;if(!d)return"";const le=pn(new Date,"YYYY-MM-DD HH:mm:ss")+"|"+X,we=Qi.createAesEncryption({key:"jianda"}).encrypt(le).replace(/\//g,"|");return`${d}/system/annexesfile/preview/${we}?token=${c?.value}`},xe=()=>{Y.isDown===!1&&a&&a("无权限下载!");const H=Y.response?.fileId||Y.id,X=`${d}/system/annexesfile/${H}?token=${c?.value}`;Gc(X)},Ve=()=>{if(o.limit!==-1&&o.limit<=v.value.length)return a&&a(`当前限制选择${o.limit}个文件`),!1};return(H,X)=>{const le=n.resolveComponent("j-icon"),we=n.resolveComponent("j-button"),$e=n.resolveComponent("el-popover"),Re=n.resolveComponent("el-upload"),me=n.resolveComponent("el-text"),De=n.resolveComponent("j-dialog-full"),ut=n.resolveDirective("loading");return n.openBlock(),n.createElementBlock("div",od,[n.createVNode(Re,{action:"",drag:e.drag,disabled:e.readonly,"show-file-list":e.isUploadImg&&!e.isLayer&&e.showFileList,"list-type":e.isUploadImg&&!e.isLayer?"picture-card":void 0,accept:h.value,limit:m.value,multiple:e.multiple,"before-upload":R,"http-request":V,"file-list":v.value,"before-remove":x,"on-remove":L,"on-preview":ae,"on-exceed":Ve},{default:n.withCtx(()=>[e.isUploadImg&&!e.isLayer&&!e.readonly?(n.openBlock(),n.createElementBlock("div",id,[n.createVNode(le,{icon:"mdi:add"}),n.createElementVNode("div",ad,n.toDisplayString(n.unref(s)(e.placeholder)),1)])):e.isLayer&&e.showFileList&&v.value.length>0&&!pe.value?(n.openBlock(),n.createBlock($e,{key:1,placement:"bottom",title:e.isUploadImg?n.unref(s)("图片列表"):n.unref(s)("文件列表")},{content:n.withCtx(()=>[n.createVNode(Sa,{style:n.normalizeStyle({width:e.isUploadImg?void 0:"400px"}),list:v.value,"preview-file":ae,"delete-file":P,"is-upload-img":e.isUploadImg,readonly:e.readonly},null,8,["style","list","is-upload-img","readonly"])]),default:n.withCtx(()=>[n.createVNode(we,{type:e.btnType,size:e.btnSize,icon:"mdi:tray-upload",label:e.readonly?n.unref(s)(e.btnText):e.placeholder},null,8,["type","size","label"])]),_:1},8,["title"])):e.readonly?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(we,{key:2,type:e.btnType,size:e.btnSize,icon:"mdi:tray-upload",label:e.placeholder},null,8,["type","size","label"]))]),_:1},8,["drag","disabled","show-file-list","list-type","accept","limit","multiple","file-list"]),e.isTip?(n.openBlock(),n.createElementBlock("div",ld,[n.createVNode(me,null,{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(`${n.unref(s)("只能上传不超过{0}的{1}文件",`${e.maxSize}${e.sizeType}`,`${h.value||""}`)},${g.value}`),1)]),_:1})])):n.createCommentVNode("",!0),!e.isLayer&&!e.isUploadImg&&e.showFileList&&v.value.length>0?(n.openBlock(),n.createBlock(Sa,{key:1,style:{"margin-top":"4px"},list:v.value,"preview-file":ae,"delete-file":P,readonly:e.readonly,"is-show-success-icon":e.isShowSuccessIcon},null,8,["list","readonly","is-show-success-icon"])):n.createCommentVNode("",!0),n.createVNode(De,{visible:pe.value,"onUpdate:visible":X[1]||(X[1]=ot=>pe.value=ot),"btn-text":"下载",title:`${n.unref(s)("文件预览")}【${K.value}】`,"destroy-on-close":!0,"has-btns":!!n.unref(d),onOk:xe},{default:n.withCtx(()=>[G.value&&ne.value?(n.openBlock(),n.createElementBlock("div",rd,[n.createElementVNode("img",{width:"100%",style:{"max-width":"1024px"},src:ne.value,alt:""},null,8,sd)])):ne.value!=""?n.withDirectives((n.openBlock(),n.createElementBlock("div",cd,[n.createElementVNode("iframe",{ref:"iframe",src:ne.value,style:{width:"100%",height:"100%"},frameborder:"0",onLoad:X[0]||(X[0]=ot=>fe.value=!1)},null,40,dd)])),[[ut,fe.value]]):n.createCommentVNode("",!0)]),_:1},8,["visible","title","has-btns"])])}}})),ud=n.defineComponent({name:"JEcharts",__name:"echarts",props:{option:{type:Object,required:!0},theme:{type:[String,Object],default:""},initOptions:{type:Object,default:()=>({})},notMerge:{type:Boolean,default:!1},updateDelay:{type:Number,default:0}},emits:["click","ready"],setup(e,{expose:t,emit:o}){const i=e,a=o,l=n.ref(),r=n.shallowRef();let s=null,d=null;const c=async()=>{l.value&&(r.value=zs.init(l.value,i.theme,i.initOptions),f(i.option),r.value&&r.value.on("click",m=>{a("click",m)}),typeof window<"u"&&window.ResizeObserver&&(s=new ResizeObserver(()=>{r.value?.resize()}),s.observe(l.value)),r.value&&a("ready",r.value))},f=m=>{r.value&&(d&&clearTimeout(d),i.updateDelay>0?d=setTimeout(()=>{r.value?.setOption(m,i.notMerge)},i.updateDelay):r.value.setOption(m,i.notMerge))};return n.watch(()=>i.option,m=>{f(m)},{deep:!0}),n.onMounted(()=>{c()}),n.onUnmounted(()=>{d&&clearTimeout(d),s&&l.value&&(s.unobserve(l.value),s.disconnect(),s=null),r.value&&(r.value.dispose(),r.value=void 0)}),t({getInstance:()=>r.value,resize:m=>{r.value?.resize(m)},clear:()=>{r.value?.clear()}}),(m,g)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"chartRef",ref:l,class:"j-echarts"},null,512))}}),Ea=(e,t)=>{const o=e.__vccOpts||e;for(const[i,a]of t)o[i]=a;return o},_a=te(Ea(ud,[["__scopeId","data-v-69ad659b"]])),fd=["innerHTML"],pd={key:1,class:"j-barcode-error"},ja=te(n.defineComponent({name:"JBarcode",__name:"barcode",props:{bcid:{type:String,required:!0},modelValue:{type:String,required:!0},scale:{type:Number,default:2},scaleX:{type:Number,default:null},scaleY:{type:Number,default:null},height:{type:Number,default:10},width:{type:Number,default:void 0},rotate:{type:String,default:"N"},barcolor:{type:String,default:"000000"},backgroundcolor:{type:String,default:""},padding:{type:Number,default:0},paddingwidth:{type:Number,default:null},paddingheight:{type:Number,default:null},inkspread:{type:Number,default:0},includetext:{type:Boolean,default:!0},alttext:{type:String,default:""},textfont:{type:String,default:"OCR-B"},textsize:{type:Number,default:10},textxalign:{type:String,default:"center"},textyalign:{type:String,default:void 0},textxoffset:{type:Number,default:0},textyoffset:{type:Number,default:0},textcolor:{type:String,default:""},includecheck:{type:Boolean,default:!1},includecheckintext:{type:Boolean,default:!1},parse:{type:Boolean,default:!1},parsefnc:{type:Boolean,default:!1},guardwhitespace:{type:Boolean,default:!1},guardwidth:{type:Number,default:null},eclevel:{type:[String,Number],default:"M"},version:{type:[Number,String],default:""},format:{type:String,default:""},columns:{type:Number,default:null},rows:{type:Number,default:null},errorlevel:{type:Number,default:null}},setup(e){const t=e,o=n.ref(""),i=n.ref(""),a=f=>{if(f.length!==13)throw new Error("GTIN must be 13 digits for checksum calculation");let u=0;for(let h=12;h>=0;h--){const m=parseInt(f[h]),b=(13-h)%2===1?3:1;u+=m*b}return(10-u%10)%10},l=f=>{const u=/\(01\)(\d{14})/,p=f.match(u);if(!p)return f;const h=p[1],m=h.substring(0,13),g=parseInt(h[13]),b=a(m);if(g!==b){const k=m+b;return f.replace(u,`(01)${k}`)}return f},r=f=>{if(!/^\d+$/.test(f))return f;const u={11:10,45:18,59:18,62:25},p=Object.keys(u);let h=null;for(const k of p)if(f.startsWith(k)){h=k;break}let m=f,g=!1;if(!h){const k=f.length;if(k<=8)m="11"+f.substring(0,8),g=!0,h="11";else if(k<=16){const v=f.substring(0,8),w=f.substring(8,16);m="59"+v+w,g=!0,h="59"}else{const w=f.substring(0,23),C=w.substring(0,8),S=w.substring(8,23);m="62"+C+S,m.length!==25&&(m=m.substring(0,25)),g=!0,h="62"}}if(h&&!g){const k=u[h];m.length>k&&(m=m.substring(0,k))}let b=null;for(const k of p)if(m.startsWith(k)){b=k;break}if(b){const k=u[b];m.length>k&&(m=m.substring(0,k))}else console.error("AUSPOST: 无法检测到有效的FCC,结果:",m);return/^\d+$/.test(m)?(m.length>25&&(console.error("AUSPOST: 返回值长度超过25位:",m.length,m),m=m.substring(0,25)),m):(console.error("AUSPOST: 返回值不是纯数字:",m),f)},s=f=>{if(!/^\d+$/.test(f))throw new Error("PZN must contain only digits");if(f.length===7){const u=f.substring(0,6);let p=0;for(let m=0;m<6;m++){const g=parseInt(u[m]),b=m+2;p+=g*b}const h=p%11;return h===10?null:h}else if(f.length===8){const u=f.substring(0,7);let p=0;for(let m=0;m<7;m++){const g=parseInt(u[m]),b=m+1;p+=g*b}const h=p%11;return h===10?null:h}else throw new Error("PZN must be 7 or 8 digits")},d=f=>{if(!/^\d+$/.test(f)||f.length!==7&&f.length!==8)return f;try{const u=s(f);if(u===null)return f;if(f.length===7){const p=f.substring(0,6);if(parseInt(f[6])!==u)return p+u}else if(f.length===8){const p=f.substring(0,7);if(parseInt(f[7])!==u)return p+u}}catch(u){console.warn("PZN checksum calculation failed:",u.message)}return f},c=()=>{try{i.value="";const f={...t};Object.keys(f).forEach(m=>{(f[m]===null||f[m]===""||f[m]===void 0)&&delete f[m]}),f.bcid==="codabar"&&(f.bcid="rationalizedCodabar"),f.bcid==="uspsonecode"&&(f.bcid="onecode"),f.bcid==="datamatrixrect"&&(f.bcid="datamatrix",f.format||(f.format="rectangle")),f.bcid==="datamatrix"&&f.format==="rect"&&(f.format="rectangle");const u=["offleft","left","center","right","offright"];if(f.textxalign&&!u.includes(f.textxalign)&&(console.warn(`Invalid textxalign value: ${f.textxalign}. Using default 'center'. Valid values: ${u.join(", ")}`),f.textxalign="center"),(f.bcid==="pdf417"||f.bcid==="micropdf417")&&delete f.eclevel,(f.bcid==="qrcode"||f.bcid==="microqrcode")&&delete f.errorlevel,f.bcid==="azteccode"&&(delete f.errorlevel,f.eclevel&&typeof f.eclevel=="string"&&/^[LMQH]$/i.test(f.eclevel)&&delete f.eclevel),f.bcid==="hanxin")if(delete f.errorlevel,f.eclevel&&typeof f.eclevel=="string"){const m={L:"L1",M:"L2",Q:"L3",H:"L4"},g=f.eclevel.toUpperCase();m[g]?f.eclevel=m[g]:/^L[1-4]$/i.test(f.eclevel)||(f.eclevel="L1")}else f.eclevel||(f.eclevel="L1");let p=f.modelValue;if(t.bcid==="gs1-128"&&typeof p=="string")try{p=l(p),p!==f.modelValue&&console.warn(`GS1-128 AI 01 checksum corrected: ${f.modelValue} -> ${p}`)}catch(m){console.warn("GS1 checksum validation failed:",m.message)}if(t.bcid==="auspost"&&typeof p=="string")try{const m=p;if(p=r(p),p!==m){const g=m.length>p.length,b=p.match(/^(11|45|59|62)/),k=b?b[1]:"unknown";console.warn(g?`AUSPOST 值已调整: ${m} -> ${p} (长度: ${m.length} -> ${p.length}, FCC: ${k})`:`AUSPOST FCC 已添加: ${m} -> ${p} (FCC: ${k}, 长度: ${p.length})`)}}catch(m){console.error("[AUSPOST] FCC validation failed:",m),console.warn("AUSPOST FCC validation failed:",m.message)}if(t.bcid==="pzn"&&typeof p=="string")try{const m=p;p=d(p),p!==m&&console.warn(`PZN checksum corrected: ${m} -> ${p}`)}catch(m){console.warn("PZN checksum validation failed:",m.message)}f.text=p,delete f.modelValue,t.bcid==="auspost"&&typeof p=="string"&&p.match(/^(11|45|59|62)/)&&(p.length>20?(f.custinfoenc="numeric",console.log(`[AUSPOST] 值长度 ${p.length} > 20,使用数字编码 (custinfoenc=numeric)`)):/^\d+$/.test(p)&&(f.custinfoenc="numeric",console.log("[AUSPOST] 值全是数字,使用数字编码 (custinfoenc=numeric)"))),t.scaleX||(f.scaleX=t.scale),t.scaleY||(f.scaleY=f.scaleX),["qrcode","microqrcode","datamatrix","datamatrixrect","pdf417","micropdf417","azteccode","hanxin"].includes(f.bcid)&&(f.width||(f.width=f.height));const h=js.toSVG(f);o.value=h}catch(f){console.error("BWIP-JS Render Error:",f);let u=f.message||"条码数据或参数错误";f.message&&f.message.includes("Bad checksum")&&t.bcid==="gs1-128"?u=`GS1-128 校验位错误: ${f.message}。请确保 AI 01 的14位数字包含正确的校验位。`:f.message&&f.message.includes("GS1badChecksum")?u=`GS1 校验位错误: ${f.message}。请检查应用标识符 (AI) 的数据格式和校验位是否正确。`:f.message&&f.message.includes("auspostBadFCC")&&t.bcid==="auspost"?u=`AUSPOST FCC 错误: ${f.message}。AUSPOST 条码必须以有效的 FCC (Format Control Code) 开头:11, 45, 59 或 62。如果值未以有效的 FCC 开头,系统会自动添加合适的 FCC。`:f.message&&f.message.includes("auspostTooLong")&&t.bcid==="auspost"?u=`AUSPOST 长度错误: ${f.message}。AUSPOST 条码长度限制:FCC 11 (10位), FCC 59 (18位), FCC 62 (25位,最大容量)。如果值超过限制,系统会自动截断并使用合适的 FCC。`:f.message&&f.message.includes("pznBadCheckDigit")&&t.bcid==="pzn"&&(u=`PZN 校验位错误: ${f.message}。PZN (德国医药产品编号) 必须是7位或8位数字,包含正确的校验位。如果校验位不正确,系统会自动修复。`),i.value=u,o.value=""}};return n.watchEffect(c),(f,u)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[o.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"j-barcode",innerHTML:o.value},null,8,fd)):n.createCommentVNode("",!0),i.value?(n.openBlock(),n.createElementBlock("div",pd,n.toDisplayString(i.value),1)):n.createCommentVNode("",!0)],64))}})),Va=te(n.defineComponent({name:"JCount",__name:"count",props:{modelValue:{default:void 0},formatJson:{default:void 0},decimal:{default:void 0},thousandSeparator:{type:Boolean,default:!1},isChinese:{type:Boolean,default:!1},tableIndex:{default:void 0},getData:{type:Function,default:void 0},size:{default:"default"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=(...y)=>{y=y.flat();let E=0;for(let B=0;B<y.length;B++)E+=y[B];return E/y.length},a=(y,E)=>E<0?-Math.ceil(y/Math.abs(E))*E||0:Math.ceil(y/E)*E||0,l=(...y)=>(y=y.flat(),y.length),r=(y,E)=>{let B=0;if(Array.isArray(y))if(/[><=]/.test(E)){const _=E.match(/^([><=]+)(.+)$/);if(_){const T=_[1],j=Number(_[2]);for(let D=0;D<y.length;D++)try{const A=Number(y[D]);let R=!1;switch(T){case">":R=A>j;break;case"<":R=A<j;break;case">=":R=A>=j;break;case"<=":R=A<=j;break;case"==":case"===":R=A===j;break;case"!=":case"!==":R=A!==j;break}R&&B++}catch{console.log("计算失败");break}}}else for(let _=0;_<y.length;_++)y[_]===E&&B++;return B},s=(y,E)=>y.toFixed(E),d=(y,E)=>E<0?-Math.floor(y/Math.abs(E))*E||0:Math.floor(y/E)*E||0,c=(y,E)=>{if(Array.isArray(y))return y.sort((B,_)=>_-B),y[E-1]},f=(y,E)=>{if(Array.isArray(y))return y.sort((B,_)=>B-_),y[E-1]},u=(y,E)=>Math.log(y)/Math.log(E),p=(y,E)=>y%E,h=(...y)=>{y=y.flat();let E=1;for(let B=0;B<y.length;B++)E*=y[B];return E},m=(y,E)=>{const B=y.toFixed(E);return Number(B)},g=(...y)=>{y=y.flat();let E=0;for(let B=0;B<y.length;B++)E+=Number(y[B]);return E},b=(...y)=>y[0].map((_,T)=>{let j=_;for(let D=1;D<y.length;D++)j*=y[D][T]||0;return j}).reduce((_,T)=>_+T,0),k=t,{getValue:v}=Kt(),w=y=>{const E=v({id:y});if(Mn(E)){const _=[];return E.forEach(T=>{const j=Number(T);Number.isNaN(j)?_.push(0):_.push(j)}),_}const B=Number(E);return Number.isNaN(B)?0:B},C=n.computed(()=>{if(!v)return"";const y=JSON.parse(o.formatJson||"[]");let E="";for(let T=0;T<y.length;T++){const j=y[T];if(j.type==="fun"&&j.value!=="("&&j.value!==")")if(["abs","max","min","sqrt"].includes(j.value))E+=`Math.${j.value}`;else if(["int","power","rand"].includes(j.value))switch(j.value){case"int":E+="Math.floor";break;case"power":E+="Math.pow";break;case"rand":E+="Math.random";break}else E+=`${j.value}Fun`;else j.type==="comp"?E+=`getCompValue('${j.value}')`:j.value==="i"&&o.tableIndex!==void 0?E+=o.tableIndex:E+=j.value}if(!E)return"";E=`(
2
2
  averageFun,
3
3
  ceilingFun,
4
4
  countFun,
@@ -13,4 +13,4 @@
13
13
  roundFun,
14
14
  sumFun,
15
15
  sumproductFun,
16
- getCompValue)=>{ return ${w} }`;let v;const E=bt(w);if(E.res)try{v=E.fn(o,a,i,r,c,g,u,d,s,m,h,f,p,C,S)}catch(R){console.log(R,"计算组件公式运行错误")}else return console.log(E.msg),"";return Number.isNaN(v)?"":(n.decimal!==void 0&&(v=v.toFixed(n.decimal)),v)}),j=e.computed(()=>{let y=V.value;return n.thousandSeparator&&(y=Dt(y)),n.isChinese&&(y=Lt(y)),y});return e.watch(V,y=>{k("update:modelValue",y),k("change",{value:y,data:j.value})}),(y,w)=>{const v=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(v,{modelValue:j.value,"onUpdate:modelValue":w[0]||(w[0]=E=>j.value=E),readonly:"",size:t.size},null,8,["modelValue","size"])}}})),sa={key:0},$o=K(e.defineComponent({name:"JCountUp",__name:"count-up",props:{animation:{type:Boolean,default:!0},startValue:{default:0},endValue:{},decimals:{default:0},duration:{default:2},options:{default:()=>({})},callback:{type:Function,default:void 0}},setup(t,{expose:l}){const n=t,o=e.computed(()=>({...n})),a=e.ref(),i=e.ref(null),r=e.computed(()=>n.options);e.onMounted(()=>{n.animation&&c()}),e.watch(()=>n.decimals,()=>{i.value&&i.value.update&&(i.value.options.decimalPlaces=n.decimals,i.value.reset(),i.value.update(n.endValue))},{deep:!0}),e.watch(()=>n.endValue,m=>{i.value&&i.value.update&&i.value.update(m)});const c=()=>{i.value||(r.value.startVal=n.startValue,r.value.decimalPlaces=n.decimals,r.value.duration=n.duration,i.value=new Bn.CountUp(a.value,Number(n.endValue),r.value),i.value.start(()=>{n.callback?.(i.value)}))};return e.onUnmounted(()=>{i.value=null}),e.onBeforeUnmount(()=>{i.value=null}),l({myProps:o,el:a,init:c,start:m=>{i.value&&i.value.start&&i.value.start(()=>{m?.(i.value)})},pauseResume:()=>{i.value&&i.value.pauseResume&&i.value.pauseResume()},reset:()=>{i.value&&i.value.reset&&i.value.reset()},update:m=>{i.value&&i.value.update&&i.value.update(m)}}),(m,h)=>(e.openBlock(),e.createElementBlock("span",{ref_key:"el",ref:a},[t.animation?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",sa,e.toDisplayString(t.endValue),1))],512))}})),ra={class:"j-block j-data-panel"},ca={key:0,class:"j-data-panel-header"},da={style:{color:"var(--j-color-text)","font-size":"14px","font-weight":"bold"}},ua={class:"j-data-panel-header-right"},fa={class:"j-data-panel-body"},Eo=K(e.defineComponent({name:"JDataPanel",__name:"data-panel",props:{title:{default:void 0}},setup(t){return(l,n)=>(e.openBlock(),e.createElementBlock("div",ra,[t.title?(e.openBlock(),e.createElementBlock("div",ca,[e.createElementVNode("div",da,e.toDisplayString(t.title),1),e.createElementVNode("div",ua,[e.renderSlot(l.$slots,"titleRight")])])):e.createCommentVNode("",!0),e.createElementVNode("div",fa,[e.renderSlot(l.$slots,"default")])]))}})),ma={class:"j-divider-content"},To=K(e.defineComponent({name:"JDivider",__name:"divider",props:{content:{},borderStyle:{default:"solid"},size:{},color:{},contentPosition:{default:"center"}},setup(t){const l=t,n=e.computed(()=>{const a={color:l.color};return l.size&&Number(l.size)&&(a.fontSize=`${l.size}px`),a}),o=e.computed(()=>({borderTopStyle:l.borderStyle}));return(a,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`j-divider-container j-divider-${t.contentPosition}`),style:e.normalizeStyle(n.value)},[e.createElementVNode("div",{class:"j-divider-line j-divider-line-left",style:e.normalizeStyle(o.value)},null,4),e.createElementVNode("div",ma,[e.createElementVNode("span",null,e.toDisplayString(t.content||""),1)]),e.createElementVNode("div",{class:"j-divider-line j-divider-line-right",style:e.normalizeStyle(o.value)},null,4)],6))}})),pa={class:"j-hpanel"},ha={class:"j-hpanel-main"},zo=K(e.defineComponent({name:"JHpanel",__name:"hpanel",setup(t){return(l,n)=>(e.openBlock(),e.createElementBlock("div",pa,[e.renderSlot(l.$slots,"left"),e.createElementVNode("div",ha,[e.renderSlot(l.$slots,"default")]),e.renderSlot(l.$slots,"right")]))}})),Mo=K(e.defineComponent({name:"JInputButton",__name:"input-button",props:{modelValue:{},type:{},layerType:{},btnText:{default:"设置"},title:{},size:{default:"default"},width:{default:1e3},height:{default:600},destroyOnClose:{type:Boolean,default:!1},open:{},ok:{},beforeClose:{},closed:{}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,a=e.ref(),i=e.ref(),r=async(d,s)=>{n.ok&&(d("保存数据中..."),i.value=await n.ok(),o("update:modelValue",i.value),o("change",{value:i.value}),s(),a.value.close())},c=()=>n.beforeClose?n.beforeClose(i.value):!0,g=()=>{n.closed?.()},u=()=>{a.value.open(n.title||n.btnText,n.layerType),setTimeout(()=>{n.open?.(i.value)},200)};return e.watch(()=>n.modelValue,d=>{i.value=d},{immediate:!0}),(d,s)=>{const m=e.resolveComponent("j-button"),h=e.resolveComponent("j-layer");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(m,e.mergeProps({style:{width:"auto"}},d.$attrs,{type:t.type,label:t.btnText,size:t.size,onClick:u}),null,16,["type","label","size"]),e.createVNode(h,{ref_key:"layerRef",ref:a,height:t.height,width:t.width,"destroy-on-close":t.destroyOnClose,"btn-text":"确定","before-close":c,onOk:r,onClosed:g},{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default")]),_:3},8,["height","width","destroy-on-close"])],64)}}})),Fo=K(e.defineComponent({name:"JInputCode",__name:"input-code",props:{modelValue:{},type:{},mode:{default:"application/json"},btnText:{default:"设置脚本"},title:{},size:{},width:{default:1200},height:{default:600},example:{default:""},beforeClose:{},isHint:{type:Boolean,default:!1},handleHint:{}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,a=e.computed({get:()=>n.modelValue,set:s=>{o("update:modelValue",s)}}),i=e.ref(""),r=s=>{i.value=s},c=()=>i.value,g=s=>n.beforeClose?n.beforeClose(s):!0,u=s=>{o("change",s)},d=e.computed(()=>n.modelValue&&n.modelValue.trim()?`${n.btnText}(已设置)`:n.btnText);return(s,m)=>{const h=e.resolveComponent("j-code-mirror"),f=e.resolveComponent("j-layout"),p=e.resolveComponent("j-input-button");return e.openBlock(),e.createBlock(p,{modelValue:a.value,"onUpdate:modelValue":m[1]||(m[1]=C=>a.value=C),type:t.type,"btn-text":d.value,title:t.title,size:t.size,width:t.width,height:t.height,"before-close":g,ok:c,open:r,onChange:u},{default:e.withCtx(()=>[e.createVNode(f,{"right-move":!1,right:560},e.createSlots({default:e.withCtx(()=>[e.createVNode(h,{value:i.value,"onUpdate:value":m[0]||(m[0]=C=>i.value=C),mode:t.mode,"is-hint":t.isHint,"handle-hint":t.handleHint},null,8,["value","mode","is-hint","handle-hint"])]),_:2},[t.example?{name:"right",fn:e.withCtx(()=>[e.createVNode(h,{value:t.example,mode:t.mode,"read-only":""},null,8,["value","mode"])]),key:"0"}:void 0]),1024)]),_:1},8,["modelValue","type","btn-text","title","size","width","height"])}}})),Lo=K(e.defineComponent({name:"JInputColor",__name:"input-color",props:{modelValue:{},placeholder:{default:"请选择颜色"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"default"},clearable:{type:Boolean,default:!0},onlyButton:{type:Boolean,default:!1},inputType:{default:"append"},showAlpha:{type:Boolean,default:!0},predefineColors:{default:()=>["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","rgba(255, 69, 0, 0.68)","rgb(255, 120, 0)","hsv(51, 100, 98)","hsva(120, 40, 94, 0.5)","hsl(181, 100%, 37%)","hsla(209, 100%, 56%, 0.73)","#c7158577"]},colorFormat:{default:"hex"},name:{},autofocus:{type:Boolean},tabindex:{},validateEvent:{type:Boolean,default:!0},inputStyle:{default:()=>({})}},emits:["update:modelValue","input","focus","blur","clear","change","color-change","active-change"],setup(t,{expose:l,emit:n}){const o=t,a=n,i=e.ref(),r=e.ref(),c=e.computed({get(){return o.modelValue===null||o.modelValue===void 0?r.value:o.modelValue},set(p){r.value=p,a("update:modelValue",p),a("input",p)}}),g=p=>{a("input",p)},u=p=>{a("focus",p)},d=p=>{a("blur",p)},s=()=>{a("clear"),a("update:modelValue","")},m=p=>{a("change",p)},h=p=>{a("color-change",p)},f=p=>{a("active-change",p)};return l({focus:()=>{i.value?.focus()},blur:()=>{i.value?.blur()},select:()=>{i.value?.select()}}),(p,C)=>{const k=e.resolveComponent("el-color-picker"),b=e.resolveComponent("el-input");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["j-input-color",{"j-input-color-only-button":t.onlyButton},{"j-input-color-disabled":t.disabled}])},[e.createVNode(b,e.mergeProps({placeholder:t.placeholder,modelValue:c.value,"onUpdate:modelValue":C[1]||(C[1]=S=>c.value=S),size:t.size,ref_key:"inputRef",ref:i,readonly:t.readonly||t.onlyButton,clearable:t.readonly||t.onlyButton?!1:t.clearable,disabled:t.disabled,name:t.name,autofocus:t.autofocus,tabindex:t.tabindex,"validate-event":t.validateEvent,"input-style":t.inputStyle},p.$attrs,{onInput:g,onFocus:u,onBlur:d,onClear:s,onChange:m}),{[t.inputType]:e.withCtx(()=>[e.createVNode(k,{size:t.size,modelValue:c.value,"onUpdate:modelValue":C[0]||(C[0]=S=>c.value=S),disabled:t.disabled||t.readonly,"show-alpha":t.showAlpha,predefine:t.predefineColors,"color-format":t.colorFormat,onChange:h,onActiveChange:f},null,8,["size","modelValue","disabled","show-alpha","predefine","color-format"])]),_:2},1040,["placeholder","modelValue","size","readonly","clearable","disabled","name","autofocus","tabindex","validate-event","input-style"])],2)}}})),Do=K(e.defineComponent({name:"JTitle",__name:"title",props:{title:{default:""},style:{default:void 0},class:{default:void 0},color:{default:void 0},size:{default:void 0},weight:{default:"normal"}},setup(t){const l=t,n=e.computed(()=>l.class||""),o=e.computed(()=>{const a={...l.style};return l.color&&(a.color=l.color),l.size&&(typeof l.size=="number"?a.fontSize=`${l.size}px`:a.fontSize=l.size),l.weight&&(a.fontWeight=l.weight),a});return(a,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["j-title",n.value]),style:e.normalizeStyle(o.value)},e.toDisplayString(t.title),7))}})),Io=K(e.defineComponent({name:"JCodeMirror",__name:"code-mirror",props:{value:{default:""},mode:{default:"javascript"},readonly:{type:Boolean,default:!1},height:{default:void 0},isHint:{type:Boolean,default:!1},handleHint:{type:Function,default:void 0},isScrollToBottom:{type:Boolean,default:!1}},emits:["update:value","change"],setup(t,{expose:l,emit:n}){const o=t,a=n,i=e.ref(),r=e.ref("");let c=null;const g=p=>{switch(p){case"application/javascript":case"javascript":case"text/javascript":return Pe.javascript();case"css":case"text/css":return xn.css();case"html":case"text/html":return jn.html();case"json":case"application/json":return Nn.json();case"sql":case"text/x-sql":return vn.sql();case"xml":case"text/xml":return $n.xml();case"python":case"text/x-python":return En.python();case"markdown":case"text/markdown":return Tn.markdown();case"java":case"text/x-java":return zn.java();case"vue":case"text/x-vue":return Pe.javascript({jsx:!0,typescript:!1});case"typescript":case"application/typescript":return Pe.javascript({jsx:!1,typescript:!0});case"jsx":return Pe.javascript({jsx:!0,typescript:!1});case"tsx":return Pe.javascript({jsx:!0,typescript:!0});default:return Pe.javascript()}},u=()=>{const p=[Vn.basicSetup,Te.lineNumbers(),Te.highlightActiveLineGutter(),Te.highlightSpecialChars(),ht.history(),Te.drawSelection(),Te.dropCursor(),Oe.indentOnInput(),Oe.bracketMatching(),pt.closeBrackets(),Te.rectangularSelection(),Oe.foldGutter(),Te.keymap.of([...pt.closeBracketsKeymap,...ht.defaultKeymap,...ht.historyKeymap,...Oe.foldKeymap]),Oe.syntaxHighlighting(Oe.defaultHighlightStyle)];return p.push(g(o.mode)),o.readonly&&p.push(mt.EditorState.readOnly.of(!0)),o.isHint&&o.handleHint&&p.push(pt.autocompletion({override:[C=>{const k=C.matchBefore(/\w*/);if(!k||k.from===k.to)return null;const b=o.handleHint(k.text);return b.length===0?null:{from:k.from,options:b.map(S=>({label:typeof S=="string"?S:S.label||S.name||"",detail:typeof S=="string"?"":S.detail||"",type:typeof S=="string"?"variable":S.type||"variable",apply:typeof S=="string"?S:S.apply||S.name||S.label||""}))}}]})),p.push(Te.EditorView.updateListener.of(C=>{if(C.docChanged){const k=C.state.doc.toString();r.value=k,a("update:value",k),a("change",{value:k})}})),p},d=async()=>{if(!i.value)return;const p=mt.EditorState.create({doc:o.value,extensions:u()});c=new Te.EditorView({state:p,parent:i.value}),r.value=o.value},s=()=>{if(!c)return;const p=c.state.doc.toString();c&&c.destroy();const C=mt.EditorState.create({doc:p,extensions:u()});i.value&&(c=new Te.EditorView({state:C,parent:i.value}));const k=c.state.doc.toString();k!==o.value&&c.dispatch({changes:{from:0,to:k.length,insert:o.value}})},m=()=>{if(!c)return;const p=c.state.doc.length;c.dispatch({selection:{anchor:p,head:p},scrollIntoView:!0}),setTimeout(()=>{if(c){const C=c.state.doc.length;c.dispatch({selection:{anchor:C,head:C},scrollIntoView:!0})}},100)},h=()=>{let p=Sn.format(o.value);p=p.replace(/{ JCODE_SASSID }/g,"{JCODE_SASSID}").replace(/{ JCODE_SASSID_NOTT }/g,"{JCODE_SASSID_NOTT}").replace(/{ JCODE_SASSID_NOTA }/g,"{JCODE_SASSID_NOTA}").replace(/@ /g,"@"),a("update:value",p),a("change",{value:p})};let f=null;return e.watch(()=>o.value,p=>{p!==r.value&&(r.value=p,c&&s(),setTimeout(()=>{c&&o.isScrollToBottom&&m()}))}),e.watch(()=>o.mode,()=>{c&&s()}),e.onMounted(async()=>{await e.nextTick(),await d(),typeof window<"u"&&window.ResizeObserver&&i.value&&(f=new ResizeObserver(()=>{c&&c.dispatch({scrollIntoView:!0})}),f.observe(i.value))}),e.onUnmounted(()=>{f&&i.value&&(f.unobserve(i.value),f.disconnect(),f=null),c&&(c.destroy(),c=null)}),l({sqlFormatter:h}),(p,C)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"codeWraperRef",ref:i,class:"j-code-mirror",style:e.normalizeStyle({height:t.height?`${t.height}px`:""})},null,4))}})),ga=e.defineComponent({__name:"slider-captcha-action",props:{actionStyle:{},isPassing:{type:Boolean},toLeft:{type:Boolean}},setup(t,{expose:l}){const n=t,o=e.useTemplateRef("actionRef"),a=e.ref("0"),i=e.computed(()=>{const{actionStyle:c,toLeft:g}=n;return{...c,left:g?"0":a.value,backgroundColor:"var(--j-color-bg-container)",borderRadius:r.value?"6px":void 0,transition:g?"all 300ms cubic-bezier(0.4, 0, 0.2, 1)":void 0}}),r=e.computed(()=>Number.parseInt(a.value)>10&&!n.isPassing);return l({getEl:()=>o.value,getStyle:()=>o?.value?.style,setLeft:c=>{a.value=c}}),(c,g)=>{const u=e.resolveComponent("j-icon");return e.openBlock(),e.createElementBlock("div",{ref_key:"actionRef",ref:o,style:e.normalizeStyle(i.value),class:"j-slider-captcha-action",name:"captcha-action"},[t.isPassing?(e.openBlock(),e.createBlock(u,{key:0,color:"var(--j-color-text-2)",class:"nav-checked",icon:"mdi:check-circle-outline"})):(e.openBlock(),e.createBlock(u,{key:1,color:"var(--j-color-text-2)",class:"nav-checked",icon:"mdi:chevron-double-right"}))],4)}}}),ya=e.defineComponent({__name:"slider-captcha-bar",props:{barStyle:{},toLeft:{type:Boolean}},setup(t,{expose:l}){const n=t,o=e.useTemplateRef("barRef"),a=e.ref("0"),i=e.computed(()=>{const{barStyle:r,toLeft:c}=n;return{...r,width:c?"0":a.value,transition:c?"width 300ms cubic-bezier(0.4, 0, 0.2, 1)":void 0,backgroundColor:"var(--j-color-success)",position:"absolute",height:"100%"}});return l({getEl:()=>o.value,setWidth:r=>{a.value=r}}),(r,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"barRef",ref:o,style:e.normalizeStyle(i.value)},null,4))}}),ba=e.defineComponent({__name:"slider-captcha-content",props:{contentStyle:{type:Object,default:()=>({})},isPassing:{type:Boolean,default:!1},animationDuration:{type:[String,Number],default:2},animationIterationCount:{type:[String,Number],default:"infinite"}},setup(t,{expose:l}){const n=t,o=e.useTemplateRef("contentRef"),a=e.computed(()=>{const{contentStyle:r}=n;return{...r,fontSize:"12px"}});l({getEl:()=>o.value});const i=e.computed(()=>({animation:`shine ${n.animationDuration}s linear ${n.animationIterationCount}`}));return(r,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contentRef",ref:o,class:e.normalizeClass([{success:t.isPassing},"j-slider-captcha-content"]),style:e.normalizeStyle(a.value)},[e.createElementVNode("div",{style:e.normalizeStyle(i.value),class:"j-spine-text"},e.toDisplayString(t.isPassing?"验证成功":"请按住滑块拖动"),5)],6))}}),Ao=K(e.defineComponent({name:"JSliderCaptcha",__name:"slider-captcha",props:e.mergeModels({class:{},actionStyle:{default:()=>({})},barStyle:{default:()=>({})},contentStyle:{default:()=>({})},wrapperStyle:{default:()=>({})},successText:{default:""},text:{default:""}},{modelValue:{type:Boolean,default:void 0},modelModifiers:{}}),emits:e.mergeModels(["end","move","start","success"],["update:modelValue"]),setup(t,{emit:l}){const n=t,o=l,a=e.useModel(t,"modelValue"),i=e.reactive({endTime:0,isMoving:!1,isPassing:!1,moveDistance:0,startTime:0,toLeft:!1}),r=e.useTemplateRef("wrapperRef"),c=e.useTemplateRef("barRef"),g=e.useTemplateRef("contentRef"),u=e.useTemplateRef("actionRef");e.watch(()=>i.isPassing,k=>{if(k){const{endTime:b,startTime:S}=i,V=(b-S)/1e3;o("success",{isPassing:k,time:V.toFixed(1)}),a.value=k}}),e.watchEffect(()=>{i.isPassing=!!a.value});function d(k){return"pageX"in k?k.pageX:"touches"in k&&k.touches[0]?k.touches[0].pageX:0}function s(k){i.isPassing||u.value&&(o("start",k),i.moveDistance=d(k)-Number.parseInt(u.value.getStyle().left.replace("px","")||"0",10),i.startTime=Date.now(),i.isMoving=!0)}function m(k){const b=r.value?.offsetWidth??220,S=k?.offsetWidth??40,V=b-S-6;return{actionWidth:S,offset:V,wrapperWidth:b}}function h(k){const{isMoving:b,moveDistance:S}=i;if(b){const V=e.unref(u),j=e.unref(c);if(!V||!j)return;const{actionWidth:y,offset:w,wrapperWidth:v}=m(V.getEl()),E=d(k)-S;o("move",{event:k,moveDistance:S,moveX:E}),E>0&&E<=w?(V.setLeft(`${E}px`),j.setWidth(`${E+y/2}px`)):E>w&&(V.setLeft(`${v-y}px`),j.setWidth(`${v-y/2}px`),p())}}function f(k){const{isMoving:b,isPassing:S,moveDistance:V}=i;if(b&&!S){o("end",k);const j=u.value,y=e.unref(c);if(!j||!y)return;const w=d(k)-V,{actionWidth:v,offset:E,wrapperWidth:R}=m(j.getEl());w<E?C():(j.setLeft(`${R-v}px`),y.setWidth(`${R-v/2}px`),p()),i.isMoving=!1}}function p(){i.endTime=Date.now(),i.isPassing=!0,i.isMoving=!1}function C(){i.isMoving=!1,i.isPassing=!1,i.moveDistance=0,i.toLeft=!1,i.startTime=0,i.endTime=0;const k=e.unref(u),b=e.unref(c),S=e.unref(g);!k||!b||!S||(S.getEl().style.width="100%",i.toLeft=!0,setTimeout(()=>{i.toLeft=!1,k.setLeft("0"),b.setWidth("0")},300))}return(k,b)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:r,class:e.normalizeClass(["j-slider-captcha slider-border",n.class]),style:e.normalizeStyle([{"background-color":"var(--j-color-bg)"},t.wrapperStyle]),onMouseleave:f,onMousemove:h,onMouseup:f,onTouchend:f,onTouchmove:h},[e.createVNode(ya,{ref_key:"barRef",ref:c,"bar-style":t.barStyle,"to-left":i.toLeft},null,8,["bar-style","to-left"]),e.createVNode(ba,{ref_key:"contentRef",ref:g,"content-style":t.contentStyle,"is-passing":i.isPassing},null,8,["content-style","is-passing"]),e.createVNode(ga,{ref_key:"actionRef",ref:u,"action-style":t.actionStyle,"is-passing":i.isPassing,"to-left":i.toLeft,onMousedown:s,onTouchstart:s},null,8,["action-style","is-passing","to-left"])],38))}}));function Ca(t,l){return e.getCurrentScope()?(e.onScopeDispose(t,l),!0):!1}const ka=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function wa(t){return Array.isArray(t)?t:[t]}function Ba(t){return e.getCurrentInstance()}function Sa(t,l=!0,n){Ba()?e.onMounted(t,n):l?t():e.nextTick(t)}const Po=ka?window:void 0;function Ke(t){var l;const n=e.toValue(t);return(l=n?.$el)!==null&&l!==void 0?l:n}function Va(){const t=e.shallowRef(!1),l=e.getCurrentInstance();return l&&e.onMounted(()=>{t.value=!0},l),t}function xa(t){const l=Va();return e.computed(()=>(l.value,!!t()))}function ja(t,l,n={}){const{window:o=Po,...a}=n;let i;const r=xa(()=>o&&"ResizeObserver"in o),c=()=>{i&&(i.disconnect(),i=void 0)},g=e.watch(e.computed(()=>{const d=e.toValue(t);return Array.isArray(d)?d.map(s=>Ke(s)):[Ke(d)]}),d=>{if(c(),r.value&&o){i=new ResizeObserver(l);for(const s of d)s&&i.observe(s,a)}},{immediate:!0,flush:"post"}),u=()=>{c(),g()};return Ca(u),{isSupported:r,stop:u}}function Na(t,l={width:0,height:0},n={}){const{window:o=Po,box:a="content-box"}=n,i=e.computed(()=>{var s;return(s=Ke(t))===null||s===void 0||(s=s.namespaceURI)===null||s===void 0?void 0:s.includes("svg")}),r=e.shallowRef(l.width),c=e.shallowRef(l.height),{stop:g}=ja(t,([s])=>{const m=a==="border-box"?s.borderBoxSize:a==="content-box"?s.contentBoxSize:s.devicePixelContentBoxSize;if(o&&i.value){const h=Ke(t);if(h){const f=h.getBoundingClientRect();r.value=f.width,c.value=f.height}}else if(m){const h=wa(m);r.value=h.reduce((f,{inlineSize:p})=>f+p,0),c.value=h.reduce((f,{blockSize:p})=>f+p,0)}else r.value=s.contentRect.width,c.value=s.contentRect.height},n);Sa(()=>{const s=Ke(t);s&&(r.value="offsetWidth"in s?s.offsetWidth:l.width,c.value="offsetHeight"in s?s.offsetHeight:l.height)});const u=e.watch(()=>Ke(t),s=>{r.value=s?l.width:0,c.value=s?l.height:0});function d(){g(),u()}return{width:r,height:c,stop:d}}function St(t,l){const{containerStyle:n,wrapperProps:o,scrollTo:a,calculateRange:i,currentList:r,containerRef:c}="itemHeight"in l?Ea(l,t):$a(l,t);return{list:r,scrollTo:a,containerProps:{ref:c,onScroll:()=>{i()},style:n},wrapperProps:o}}function Oo(t){const l=e.shallowRef(null),n=Na(l),o=e.ref([]),a=e.shallowRef(t);return{state:e.ref({start:0,end:10}),source:a,currentList:o,size:n,containerRef:l}}function Ro(t,l,n){return o=>{if(typeof n=="number")return Math.ceil(o/n);const{start:a=0}=t.value;let i=0,r=0;for(let c=a;c<l.value.length;c++){const g=n(c);if(i+=g,r=c,i>o)break}return r-a}}function Jo(t,l){return n=>{if(typeof l=="number")return Math.floor(n/l)+1;let o=0,a=0;for(let i=0;i<t.value.length;i++){const r=l(i);if(o+=r,o>=n){a=i;break}}return a+1}}function Uo(t,l,n,o,{containerRef:a,state:i,currentList:r,source:c}){return()=>{const g=a.value;if(g){const u=n(t==="vertical"?g.scrollTop:g.scrollLeft),d=o(t==="vertical"?g.clientHeight:g.clientWidth),s=u-l,m=u+d+l;i.value={start:s<0?0:s,end:m>c.value.length?c.value.length:m},r.value=c.value.slice(i.value.start,i.value.end).map((h,f)=>({data:h,index:f+i.value.start}))}}}function Wo(t,l){return n=>typeof t=="number"?n*t:l.value.slice(0,n).reduce((o,a,i)=>o+t(i),0)}function Ho(t,l,n,o){e.watch([t.width,t.height,()=>e.toValue(l),n],()=>{o()})}function qo(t,l){return e.computed(()=>typeof t=="number"?l.value.length*t:l.value.reduce((n,o,a)=>n+t(a),0))}const va={horizontal:"scrollLeft",vertical:"scrollTop"};function Yo(t,l,n,o){return a=>{o.value&&(o.value[va[t]]=n(a),l())}}function $a(t,l){const n=Oo(l),{state:o,source:a,currentList:i,size:r,containerRef:c}=n,g={overflowX:"auto"},{itemWidth:u,overscan:d=5}=t,s=Ro(o,a,u),m=Uo("horizontal",d,Jo(a,u),s,n),h=Wo(u,a),f=e.computed(()=>h(o.value.start)),p=qo(u,a);return Ho(r,l,c,m),{scrollTo:Yo("horizontal",m,h,c),calculateRange:m,wrapperProps:e.computed(()=>({style:{height:"100%",width:`${p.value-f.value}px`,marginLeft:`${f.value}px`,display:"flex"}})),containerStyle:g,currentList:i,containerRef:c}}function Ea(t,l){const n=Oo(l),{state:o,source:a,currentList:i,size:r,containerRef:c}=n,g={overflowY:"auto"},{itemHeight:u,overscan:d=5}=t,s=Ro(o,a,u),m=Uo("vertical",d,Jo(a,u),s,n),h=Wo(u,a),f=e.computed(()=>h(o.value.start)),p=qo(u,a);return Ho(r,l,c,m),{calculateRange:m,scrollTo:Yo("vertical",m,h,c),containerStyle:g,wrapperProps:e.computed(()=>({style:{width:"100%",height:`${p.value-f.value}px`,marginTop:`${f.value}px`}})),currentList:i,containerRef:c}}const Ta=e.defineComponent({name:"JSubMenu",__name:"index",props:{pId:{type:String}},emits:["click"],setup(t,{emit:l}){const n=t,o=l,{getMenuMap:a,toArray:i,activeMenu:r,theme:c}=rt(),{getHMoreMenus:g}=cl(),u=e.ref([]);n.pId==="moreId"?u.value=g.value:u.value=i(a()[n.pId||""]||[],[]);const d=f=>{const p=u.value.find(C=>C.active);p?.value!==f.value&&(p&&(p.active=!1),o("click",f))},{list:s,containerProps:m,wrapperProps:h}=St(u,{itemHeight:44});return(f,p)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["j-sub-menu-content",{"j-menu-dark":e.unref(c)==="dark"}],style:{"max-height":"calc(100vh - 80px)","border-radius":"8px"}},e.unref(m)),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(h))),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),C=>(e.openBlock(),e.createBlock(dt,{key:C.data.value,"parent-actives":e.unref(r)?.pid?.split(".")||[],item:C.data,"is-sub":"",onClick:d},null,8,["parent-actives","item"]))),128))],16)],16))}}),za={class:"j-menu-item-label"},Ma={class:"j-menu-item-label"},Fa={key:1,class:e.normalizeClass(["j-menu-item-arrow","sub"])},La={class:"j-menu-item-label"},dt=e.defineComponent({name:"JMenuItem",__name:"index",props:{item:{type:Object,default:()=>({})},parentActives:{type:Array,default:()=>[]},collapsed:Boolean,isSub:Boolean,isHorizontal:Boolean,isVertical:Boolean},emits:["click"],setup(t,{emit:l}){const{t:n}=we(),o=l,a=i=>{o("click",i)};return(i,r)=>{const c=e.resolveComponent("j-icon"),g=e.resolveComponent("el-tooltip"),u=e.resolveComponent("el-popover");return t.collapsed&&!t.item.hasChildren?(e.openBlock(),e.createBlock(g,{key:0,placement:"right"},{content:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(e.unref(n)(t.item.label)),1)]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["j-menu-item",{collapsed:t.collapsed}]),onClick:r[0]||(r[0]=e.withModifiers(d=>a(t.item),["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["j-menu-item-content",{active:t.item.active,"p-active":t.parentActives.includes(t.item.value)}]),style:e.normalizeStyle({"padding-left":`${t.item.indent*24+16}px`})},[t.item.icon?(e.openBlock(),e.createBlock(c,{key:0,icon:t.item.icon,class:"j-menu-item-icon",size:18},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",za,e.toDisplayString(e.unref(n)(t.item.label)),1),t.item.hasChildren?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["j-menu-item-arrow",{open:t.item.open}])},null,2)):e.createCommentVNode("",!0)],6)],2)]),_:1})):(t.collapsed||t.isSub||t.isHorizontal||t.isVertical)&&t.item.hasChildren?(e.openBlock(),e.createBlock(u,{key:1,placement:t.isHorizontal?"bottom-start":"right-start","show-arrow":!1,"popper-class":"j-sub-menu"},{reference:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["j-menu-item",{collapsed:t.collapsed}])},[e.createElementVNode("div",{class:e.normalizeClass(["j-menu-item-content",{active:t.item.active,"p-active":t.parentActives.includes(t.item.value)}]),style:e.normalizeStyle({"padding-left":`${t.item.indent*34+16}px`})},[t.item.icon?(e.openBlock(),e.createBlock(c,{key:0,icon:t.item.icon,style:e.normalizeStyle({"margin-right":t.item.label&&(t.isSub||!t.isVertical)?"8px":0,"background-color":t.isVertical?t.item.color:"transparent"}),class:"j-menu-item-icon",size:18},null,8,["icon","style"])):e.createCommentVNode("",!0),e.createElementVNode("div",Ma,e.toDisplayString(e.unref(n)(t.item.label)),1),t.item.hasChildren&&!t.isHorizontal&&!t.isVertical?(e.openBlock(),e.createElementBlock("div",Fa)):e.createCommentVNode("",!0)],6)],2)]),default:e.withCtx(()=>[e.createVNode(Ta,{"p-id":t.item.value,onClick:a},null,8,["p-id"])]),_:1},8,["placement"])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["j-menu-item",{collapsed:t.collapsed,sub:t.item.indent>0}]),onClick:r[1]||(r[1]=e.withModifiers(d=>a(t.item),["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["j-menu-item-content",{active:t.item.active,"p-active":t.parentActives.includes(t.item.value)}]),style:e.normalizeStyle({"padding-left":`${t.item.indent*24+16}px`})},[t.item.icon?(e.openBlock(),e.createBlock(c,{key:0,icon:t.item.icon,class:"j-menu-item-icon",style:e.normalizeStyle({"margin-right":t.item.label&&(t.isSub||!t.isVertical)?"8px":0,"background-color":t.isVertical?t.item.color:"transparent"}),size:18},null,8,["icon","style"])):e.createCommentVNode("",!0),e.createElementVNode("div",La,e.toDisplayString(e.unref(n)(t.item.label)),1),t.item.hasChildren?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["j-menu-item-arrow",{open:t.item.open}])},null,2)):e.createCommentVNode("",!0)],6)],2))}}}),Da=e.defineComponent({name:"JIMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]},collapsed:Boolean},emits:["click"],setup(t,{emit:l}){const n=t,o=l,{activeMenu:a,theme:i}=rt(),r=s=>{o("click",s)},c=e.computed(()=>n.menuList),{list:g,containerProps:u,wrapperProps:d}=St(c,{itemHeight:44});return(s,m)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["j-menu",{collapsed:t.collapsed,"j-menu-dark":e.unref(i)==="dark"}]},e.unref(u)),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(d))),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),h=>(e.openBlock(),e.createBlock(dt,{key:h.data.value,"parent-actives":e.unref(a)?.pid?.split(".")||[],item:h.data,collapsed:t.collapsed,class:e.normalizeClass({"menu-item-entering":h.data.entering,"menu-item-leaving":h.data.leaving}),onClick:r},null,8,["parent-actives","item","collapsed","class"]))),128))],16)],16))}}),Ia=e.defineComponent({name:"JHMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]}},emits:["click"],setup(t,{emit:l}){const n=t,o=l,{activeMenu:a,theme:i}=rt(),r=e.ref(),c=e.ref(0);let g=null;e.onMounted(()=>{typeof window<"u"&&window.ResizeObserver&&r.value&&(g=new ResizeObserver(()=>{r.value&&(c.value=r.value.offsetWidth)}),g.observe(r.value))});const u=e.computed(()=>{const h=[];let f=0,p=0;const C=n.menuList.length;return n.menuList.forEach(k=>{p++;const b=(et(k.label)||0)+32+16+4+8;f+=b,(p===C&&f<=c.value||p<C&&f+56<=c.value)&&h.push(k)}),h.length<n.menuList.length&&h.push({value:"moreId",icon:"more-outlined",label:"",hasChildren:!0,indent:0,open:!1,active:!1}),h}),d=e.computed(()=>{const h=[];let f=0;const p=u.value.length;return n.menuList.forEach(C=>{f++,f>=p&&h.push(C)}),h}),s=e.computed(()=>{const h=a.value?.pid?.split(".")||[];return(h.length>1&&d.value.findIndex(f=>f.value===h[1])>-1||d.value.findIndex(f=>f.value===a.value?.value)>-1)&&h.push("moreId"),h}),m=h=>{o("click",h)};return dl({getHMoreMenus:d}),e.onUnmounted(()=>{g&&r.value&&(g.unobserve(r.value),g.disconnect(),g=null)}),(h,f)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"menuRef",ref:r,class:e.normalizeClass(["j-menu-horizontal",{"j-menu-dark":e.unref(i)==="dark"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,p=>(e.openBlock(),e.createBlock(dt,{key:p.value,"parent-actives":s.value,item:p,"is-horizontal":"",onClick:m},null,8,["parent-actives","item"]))),128))],2))}}),Aa=e.defineComponent({name:"JVMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]}},emits:["click"],setup(t,{emit:l}){const n=t,o=l,{activeMenu:a,theme:i}=rt(),r=["var(--j-color-primary)","var(--j-color-success)","var(--j-color-warning)","var(--j-color-error)","#16c2c0","#9154de"],c=e.computed(()=>(n.menuList.forEach((h,f)=>{h.color=r[f%r.length]}),n.menuList)),g=e.computed(()=>a.value?.pid?.split(".")||[]),u=h=>{o("click",h)},{list:d,containerProps:s,wrapperProps:m}=St(c,{itemHeight:96});return(h,f)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["j-menu-vertical",{"j-menu-dark":e.unref(i)==="dark"}]},e.unref(s)),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(m))),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),p=>(e.openBlock(),e.createBlock(dt,{key:p.data.value,"parent-actives":g.value,item:p.data,"is-vertical":"",onClick:u},null,8,["parent-actives","item"]))),128))],16)],16))}}),_o=K(e.defineComponent({name:"JMenu",__name:"menu",props:{menus:{type:Array,default:()=>[]},activeId:{type:String,default:void 0},collapsed:Boolean,theme:{type:String,default:"light"},mode:{type:String,default:"inline"}},emits:["click"],setup(t,{emit:l}){const n=t,o=l;let a={};const i=e.ref("");i.value=n.activeId||"";const r=(p,C,k,b,S)=>{k=k||[];for(let V=0,j=k.length;V<j;V++){const y=k[V],w={};w.pid=C,w.indent=b,i.value===y.value&&(w.active=!0),Object.keys(y).forEach(E=>{E!=="children"&&(w[E]=y[E])}),S&&S.includes(y.value)&&(w.open=!0),p.push(w);const v=y.children||[];v.length>0&&(w.hasChildren=!0,S||(a[w.value]=v),(!S||w.open&&!n.collapsed)&&r(p,`${C}.${w.value}`,v,b+1,S))}},c=(p,C)=>{const k=[];return r(k,"0",p,0,C),k},g=e.ref([]);let u=[];const d=()=>{a={},u=c(n.menus);const p=[];if(i.value&&n.mode==="inline"){const C=u.find(k=>k.value===i.value);C&&p.push(...C.pid.split("."))}g.value=c(n.menus,p),console.log("showMenuList",g.value)};e.watch(()=>n.menus,()=>{d()},{immediate:!0}),e.watch(()=>n.mode,()=>{d()});const s=()=>{if(g.value.find(C=>C.active)?.value!==i.value){const C=u.find(k=>k.value===i.value);if(C){const k=[];n.mode==="inline"&&k.push(...C.pid.split(".")),g.value=c(n.menus,k)}}},m=e.computed(()=>u.find(p=>p.value===i.value));e.watch(()=>n.activeId,()=>{i.value=n.activeId||"",s()}),e.watch(()=>n.collapsed,()=>{if(n.collapsed)g.value=c(n.menus,[]);else{const p=[];if(i.value){const C=u.find(k=>k.value===i.value);C&&p.push(...C.pid.split("."))}g.value=c(n.menus,p)}});const h=e.computed(()=>n.theme),f=p=>{if(p.hasChildren){if(n.collapsed)return;const C=[];C.push(...p.pid.split(".")),p.open||C.push(p.value);const k=c(n.menus,C),b=new Set(g.value.map(V=>V.value)),S=new Set(k.map(V=>V.value));k.forEach(V=>{b.has(V.value)||(V.entering=!0)}),g.value.forEach(V=>{S.has(V.value)||(V.leaving=!0)}),g.value=k,setTimeout(()=>{g.value.forEach(V=>{V.entering=!1,V.leaving=!1})},300)}else{const C=g.value.find(k=>k.active);if(C?.value===p.value)return;C&&(C.active=!1),p.active=!0,i.value=p.value,o("click",p)}};return rl({getMenuMap:()=>a,toArray:c,activeMenu:m,theme:h}),(p,C)=>t.mode==="inline"?(e.openBlock(),e.createBlock(Da,{key:0,"menu-list":g.value,collapsed:t.collapsed,onClick:f},null,8,["menu-list","collapsed"])):t.mode==="horizontal"?(e.openBlock(),e.createBlock(Ia,{key:1,"menu-list":g.value,onClick:f},null,8,["menu-list"])):(e.openBlock(),e.createBlock(Aa,{key:2,"menu-list":g.value,onClick:f},null,8,["menu-list"]))}})),Pa={class:"j-keyword-panel"},Oa={key:0},Ra={key:1,class:"columns-wrapper"},Ja=e.defineComponent({name:"JKeywordPanel",__name:"keyword-panel",props:e.mergeModels({columns:{type:Array,default:()=>[]}},{checkAll:{default:!0},checkAllModifiers:{},checkFields:{default:()=>[]},checkFieldsModifiers:{}}),emits:["update:checkAll","update:checkFields"],setup(t,{expose:l}){const{t:n}=we(),o=t,a=e.useModel(t,"checkAll"),i=e.useModel(t,"checkFields"),r=e.ref(!1),c=e.ref(""),g=e.computed(()=>o.columns.filter(m=>m.config?.filter?.isSearchKeyword?c.value?m.config?.label?.indexOf(c.value)!=-1:!0:!1).map(m=>({label:m.config?.label,value:m.id}))),u=()=>{a.value||(a.value=!0,r.value=!1,i.value=[])},d=m=>{m.length>0?a.value=!1:a.value=!0};return l({init:()=>{a.value?r.value=!1:r.value=!0}}),(m,h)=>{const f=e.resolveComponent("j-icon"),p=e.resolveComponent("el-input"),C=e.resolveComponent("j-checkbox");return e.openBlock(),e.createElementBlock("div",Pa,[e.createElementVNode("div",{class:e.normalizeClass(["range-item",{active:a.value}]),onClick:u},[e.createElementVNode("div",null,e.toDisplayString(e.unref(n)("搜索全部")),1),a.value?(e.openBlock(),e.createBlock(f,{key:0,icon:"mdi:check"})):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:"range-item",onClick:h[0]||(h[0]=k=>r.value=!r.value)},[e.createElementVNode("div",null,e.toDisplayString(e.unref(n)("搜索特定字段")),1),e.createVNode(f,{icon:r.value?"mdi:keyboard-arrow-up":"mdi:keyboard-arrow-down"},null,8,["icon"])]),r.value?(e.openBlock(),e.createElementBlock("div",Oa,[e.createVNode(p,{class:"no-border background",modelValue:c.value,"onUpdate:modelValue":h[1]||(h[1]=k=>c.value=k),modelModifiers:{trim:!0},placeholder:e.unref(n)("搜索"),clearable:""},{prefix:e.withCtx(()=>[e.createVNode(f,{icon:"mdi:search"})]),_:1},8,["modelValue","placeholder"])])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",Ra,[e.createVNode(C,{options:g.value,modelValue:i.value,"onUpdate:modelValue":h[2]||(h[2]=k=>i.value=k),onChange:d,style:{display:"flex","flex-direction":"column"}},null,8,["options","modelValue"])])):e.createCommentVNode("",!0)])}}}),Ua={key:0,class:"title"},Wa={class:"content"},Ha={class:"relation"},qa={style:{width:"72px"}},Ya={class:"btn-wrapper"},_a={class:"field-wrapper"},Ka={class:"buttons"},Ko=e.defineComponent({name:"JFilterPanel",__name:"filter-panel",props:e.mergeModels({columns:{type:Array,default:()=>[]},searchFieldList:{type:Array,default:()=>[]}},{relation:{default:"and"},relationModifiers:{},isPin:{default:!1},isPinModifiers:{}}),emits:e.mergeModels(["filter","close"],["update:relation","update:isPin"]),setup(t,{expose:l,emit:n}){const{t:o}=we(),a=t,i=e.useModel(t,"relation"),r=e.useModel(t,"isPin"),c=e.ref([]),g=()=>{r.value=!r.value},u=[{id:"field",type:"j-select",getCompConfig:()=>({selectData:s.value.join(","),options:d.value}),config:{appendTo:r.value?void 0:".j-filter-panel",persistent:!1,dataType:"options",isShowTooltip:!0,isSelectOnlyone:!0,width:r.value?132:160,change:({value:b,row:S})=>{const j=a.columns.find(v=>v.id===b)?.config||{};let y="eq",w="text";["options"].includes(j.dataType||"")?y="in":["dateTime"].includes(j.dataType||"")&&(y="range",w="dateTime"),S.method=y,S.type=j.valueType||w}}},{id:"method",type:"j-select",getCompConfig:({row:b})=>{const V=a.columns.find(j=>j.id===b.field)?.config||{};return["options","switch"].includes(V.dataType||"")?{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"in",label:"等于任意一个"},{value:"nin",label:"不等于任意一个"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}:["dateTime"].includes(V.dataType||"")?{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"gte",label:"大于等于"},{value:"lte",label:"小于等于"},{value:"range",label:"选择范围"},{value:"formula",label:"动态筛选"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}:{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"like",label:"包含"},{value:"unlike",label:"不包含"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}},config:{width:r.value?120:144,appendTo:r.value?void 0:".j-filter-panel",persistent:!1,dataType:"options",noBorder:!0,change:({row:b})=>{b.value=void 0}}},{id:"value",type:"input",getCompType:({row:b})=>{const V=a.columns.find(j=>j.id===b.field)?.config||{};if(["options","dataItem","switch"].includes(V.dataType||"")){if(["in","nin"].includes(b.method)||["eq","ne"].includes(b.method))return"j-select"}else if(["dateTime"].includes(V.dataType||""))return["range"].includes(b.method)?"j-date-range":["formula"].includes(b.method)?"j-select":"j-date";return"j-input"},getCompConfig:({row:b})=>{if(["empty","not_empty"].includes(b.method||""))return{display:!1};const V=a.columns.find(y=>y.id===b.field)?.config||{},j={display:!0,placeholder:"",clearable:!0,filterable:!0};return["options","dataItem"].includes(V.dataType||"")?(j.collapseTags=!0,j.collapseTagsTooltip=!0,j.dataType=V.dataType,j.dataCode=V.dataCode,j.options=V.options):["switch"].includes(V.dataType||"")?(j.options=[],j.dataType="options",V.activeValue==null?j.options.push({label:"是",value:"1"}):j.options.push({label:"是",value:V.activeValue}),V.inactiveValue==null?j.options.push({label:"否",value:"0"}):j.options.push({label:"否",value:V.inactiveValue})):["dateTime"].includes(V.dataType||"")&&(["formula"].includes(b.method)?(j.placeholder="",j.options=[{label:"今天",value:"today"},{label:"昨天",value:"yesterday"},{label:"明天",value:"tomorrow"},{label:"最近7天",value:"last7days"},{label:"最近30天",value:"last30days"},{label:"本周",value:"thisWeek"},{label:"上周",value:"lastWeek"},{label:"下周",value:"nextWeek"},{label:"本月",value:"thisMonth"},{label:"上月",value:"lastMonth"},{label:"下月",value:"nextMonth"},{label:"本季度",value:"thisQuarter"},{label:"上季度",value:"lastQuarter"},{label:"下季度",value:"nextQuarter"},{label:"今年",value:"thisYear"},{label:"去年",value:"lastYear"},{label:"明年",value:"nextYear"}],j.dataType="options"):(j.type="datetime",["range"].includes(b.method)?(j.startPlaceholder="开始时间",j.endPlaceholder="结束时间",j.defaultTime=[new Date(2e3,1,1,0,0,0),new Date(2e3,2,1,23,59,59)]):j.placeholder="")),j},config:{width:r.value?234:296,appendTo:r.value?void 0:".j-filter-panel"}}];e.onMounted(()=>{c.value=a.searchFieldList});const d=e.computed(()=>a.columns.filter(b=>!b.children?.length).map(b=>({label:b.config?.label,value:b.id,dataType:b.config?.dataType,options:b.config?.options}))),s=e.computed(()=>c.value.map(b=>b.field)),m=({data:b})=>{if(s.value.includes(b.value))return;const V=a.columns.find(w=>w.id===b.value)?.config||{};let j="eq",y="text";["options","dataItem"].includes(V.dataType||"")?j="in":["dateTime"].includes(V.dataType||"")&&(j="range",y="dateTime"),c.value.push({field:b.value,method:j,type:V.valueType||y})},h=n,f=()=>{c.value.length=0},p=()=>{r.value?h("filter"):h("close",!0)},C=()=>{c.value.forEach(b=>{b.value=void 0}),h("filter")};return l({getSearchFields:()=>c.value}),(b,S)=>{const V=e.resolveComponent("j-icon"),j=e.resolveComponent("j-select"),y=e.resolveComponent("j-button-select"),w=e.resolveComponent("j-button"),v=e.resolveComponent("j-input-rows"),E=e.resolveComponent("el-tooltip");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["j-filter-panel",{"is-pin":r.value}])},[r.value?(e.openBlock(),e.createElementBlock("div",Ua,[e.createVNode(V,{icon:"mdi:filter-outline"}),e.createElementVNode("div",null,e.toDisplayString(e.unref(o)("筛选")),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Wa,[e.createElementVNode("div",Ha,[e.createElementVNode("div",null,e.toDisplayString(e.unref(o)("筛选出符合以下")),1),e.createElementVNode("div",qa,[e.createVNode(j,{teleported:!1,noBorder:!0,modelValue:i.value,"onUpdate:modelValue":S[0]||(S[0]=R=>i.value=R),options:[{value:"and",label:"所有"},{value:"or",label:"任一"}]},null,8,["modelValue"])]),e.createElementVNode("div",null,e.toDisplayString(e.unref(o)("条件的数据")),1)]),e.createElementVNode("div",Ya,[e.createVNode(y,{label:"添加过滤条件",options:d.value,modelValue:s.value.join(","),onChange:m},null,8,["options","modelValue"]),c.value.length>0?(e.openBlock(),e.createBlock(w,{key:0,type:"text",danger:"",label:"删除全部",onClick:f})):e.createCommentVNode("",!0)]),e.createElementVNode("div",_a,[e.createVNode(v,{modelValue:c.value,"onUpdate:modelValue":S[1]||(S[1]=R=>c.value=R),columns:u,editConfig:{isAddBtn:!1},isWrap:r.value},null,8,["modelValue","isWrap"])]),e.createVNode(E,{placement:"bottom",content:r.value?e.unref(o)("取消固定"):e.unref(o)("固定显示")},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"pin-btn",onClick:g},[e.createVNode(V,{rotate:45,icon:r.value?"mdi:keep-off":"mdi:keep"},null,8,["icon"])])]),_:1},8,["content"])]),e.createElementVNode("div",Ka,[e.createVNode(w,{label:e.unref(o)("筛选"),type:"primary",onClick:p},null,8,["label"]),e.createVNode(w,{label:e.unref(o)("清空"),icon:"mdi:delete-sweep-outline",type:"text",onClick:C},null,8,["label"])])],2)}}}),Ga={class:"j-order-panel"},Xa={class:"content"},Qa={class:"btn-wrapper"},Za={class:"field-wrapper"},ei={class:"buttons"},ti=e.defineComponent({name:"JOrderPanel",__name:"order-panel",props:{columns:{type:Array,default:()=>[]}},emits:["save","clear"],setup(t,{expose:l,emit:n}){const{t:o}=we(),a=t,i=n,r=e.computed(()=>a.columns.filter(f=>!f.children?.length&&f.config?.sorter?.isNot!==!0).map(f=>({label:f.config?.label,value:f.id}))),c=e.ref([]),g=e.computed(()=>c.value.map(f=>f.value)),u=[{id:"label",type:"j-title",getCompConfig:({row:f})=>({title:f.label}),config:{style:{width:"180px"}}},{id:"sord",type:"j-radio",config:{dataType:"options",options:[{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}],isButton:!0}}],d=({data:f})=>{g.value.includes(f.value)||c.value.push({label:f.label,value:f.value,sord:"ASC"})},s=f=>{c.value=JSON.parse(JSON.stringify(f))},m=()=>{i("save",JSON.parse(JSON.stringify(c.value)))},h=()=>{c.value=[],i("clear")};return l({init:s}),(f,p)=>{const C=e.resolveComponent("j-button-select"),k=e.resolveComponent("j-input-rows"),b=e.resolveComponent("j-button");return e.openBlock(),e.createElementBlock("div",Ga,[e.createElementVNode("div",Xa,[e.createElementVNode("div",Qa,[e.createVNode(C,{label:"添加排序规则",options:r.value,modelValue:g.value.join(","),onChange:d},null,8,["options","modelValue"])]),e.createElementVNode("div",Za,[e.createVNode(k,{modelValue:c.value,"onUpdate:modelValue":p[0]||(p[0]=S=>c.value=S),columns:u,editConfig:{isAddBtn:!1,drag:!0}},null,8,["modelValue"])])]),e.createElementVNode("div",ei,[e.createVNode(b,{label:e.unref(o)("排序"),type:"primary",onClick:m},null,8,["label"]),c.value.length>0?(e.openBlock(),e.createBlock(b,{key:0,label:e.unref(o)("清空排序"),icon:"mdi:delete-sweep",type:"text",onClick:h},null,8,["label"])):e.createCommentVNode("",!0)])])}}}),oi={class:"j-column-panel"},ni={class:"content"},li={class:"search-wrapper"},ai={class:"tree-wrapper"},ii={class:"buttons"},si=e.defineComponent({name:"JColumnPanel",__name:"column-panel",props:{columns:{type:Array,default:()=>[]},columnConfig:{type:Array}},emits:["save"],setup(t,{expose:l,emit:n}){const{t:o}=we(),a=t,i=n,r=e.ref(),c=e.ref(""),g={},u=e.ref([]),d=e.ref([]),s=(y,w)=>{const v=[],E=new Map;y.forEach($=>{E.set($.id,$),g[$.id]=$});const R=new Set;return w&&w.length>0&&w.forEach($=>{const _=E.get($.id);if(_){R.add(_.id);const L={id:_.id,label:_.config?.label||_.id,type:_.type,display:_.config?.display!==!1};_.children&&_.children.length>0&&(L.children=s(_.children,$.children)),v.push(L)}}),y.forEach($=>{if(!R.has($.id)){const _={id:$.id,label:$.config?.label||$.id,type:$.type,display:$.config?.display!==!1};$.children&&$.children.length>0&&(_.children=s($.children)),v.push(_)}}),v},m=(y,w)=>w.length===0?y:y.map(v=>{const E=w.some($=>v.label.toLowerCase().includes($.toLowerCase())),R=v.children?m(v.children,w):[];return E||R.length>0?{...v,children:R.length>0?R:v.children}:null}).filter(Boolean),h=e.computed(()=>{if(!c.value)return d.value;const y=c.value.split(/\s+/).filter(Boolean);return m(d.value,y)}),f=e.ref([]),p=e.computed(()=>{const y=new Map;if(a.columnConfig&&a.columnConfig.length>0){const w=v=>{v.forEach(E=>{y.set(E.id,E),E.children&&w(E.children)})};w(a.columnConfig)}return y}),C=()=>{const y=w=>{const v=[];return w.forEach(E=>{let R=!0;if(p.value.size>0){const $=p.value.get(E.id);$?R=$.display:R=E.config?.display!==!1}else R=E.config?.display!==!1;R&&(v.push(E.id),E.children&&v.push(...y(E.children)))}),v};f.value=y(a.columns)},k=(y,{node:w})=>{y.includes(w.id)?f.value.push(w.id):f.value=f.value.filter(E=>E!==w.id)},b=(y,w,v)=>v==="inner"?!1:y.parent===w.parent,S=()=>{const y=w=>w.map(v=>{const E={...v,display:f.value.includes(v.id)};return v.children&&(E.children=y(v.children)),E});i("save",y(d.value))},V=()=>{if(C(),d.value=JSON.parse(JSON.stringify(u.value)),c.value="",r.value){const y=r.value;y.setCheck&&y.setCheck(f.value);const w=y.$refs?.treeRef||y;w?.setCheckedKeys&&w.setCheckedKeys(f.value)}};return l({init:()=>{C(),u.value=s(a.columns,a.columnConfig),d.value=JSON.parse(JSON.stringify(u.value))}}),(y,w)=>{const v=e.resolveComponent("j-icon"),E=e.resolveComponent("el-input"),R=e.resolveComponent("j-tree"),$=e.resolveComponent("j-button");return e.openBlock(),e.createElementBlock("div",oi,[e.createElementVNode("div",ni,[e.createElementVNode("div",li,[e.createVNode(E,{modelValue:c.value,"onUpdate:modelValue":w[0]||(w[0]=_=>c.value=_),modelModifiers:{trim:!0},placeholder:e.unref(o)("搜索 (多个关键词用空格隔开)"),clearable:""},{prefix:e.withCtx(()=>[e.createVNode(v,{icon:"mdi:search"})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",ai,[e.createVNode(R,{ref_key:"treeRef",ref:r,list:h.value,"is-tree-data":!0,"default-checked-keys":f.value,"default-expand-all":!0,checkable:"","id-key":"id",draggable:!c.value,"allow-drop":b,check:k},null,8,["list","default-checked-keys","draggable"])])]),e.createElementVNode("div",ii,[e.createVNode($,{label:e.unref(o)("确定"),type:"primary",onClick:S},null,8,["label"]),e.createVNode($,{label:e.unref(o)("重置"),icon:"mdi:restore",type:"text",onClick:V},null,8,["label"])])])}}}),ri={class:"j-table-panel-left"},ci={class:"j-table-panel-top"},di={class:"j-table-panel-top-left"},ui={class:"j-table-panel-top-right"},fi={key:0,style:{width:"200px"}},mi={class:"j-table-panel-main"},pi={key:0,class:"j-table-panel-filter-panel"},Go=K(e.defineComponent({name:"JTablePanel",__name:"table-panel",props:{columns:{type:Array,required:!0,default:()=>[]},isTree:{type:Boolean,default:!1},isShowNumber:{type:Boolean,default:!0},isMultiple:{type:Boolean,default:!1},isPage:{type:Boolean,default:!1},pageSizes:Array,pageSize:{type:Number,default:100},rowKey:{type:String,default:void 0},sort:String,buttons:{type:Array,default:()=>[]},batchButtons:{type:Array,default:()=>[]},actions:{type:Array,default:()=>[]},actionsMaxCount:{type:Number,default:3},actionsLabel:{type:String,default:"操作"},loadData:Function,immediate:{type:Boolean,default:!0},noPadding:Boolean},emits:["select","ready"],setup(t,{expose:l,emit:n}){const{t:o}=we(),a=t,i=n;a.isMultiple&&!a.rowKey&&console.warn("rowKey is required when isMultiple is true");const r=e.ref();let c=[];const g=e.ref(0),u=e.ref(1);let d=a.pageSize||100,s="";const m=e.ref([]),h=e.ref(!1),f=e.computed(()=>a.batchButtons&&a.batchButtons.length>0),p=e.computed(()=>m.value.length>0),C=e.computed(()=>f.value&&p.value||h.value),k=e.computed(()=>a.isPage&&!C.value);f.value&&!a.isMultiple&&console.warn("batchButtons is only valid when isMultiple is true");const b=F=>a.rowKey?a.rowKey.split(",").map(le=>F[le.trim()]).join("::"):"",S=(F,z)=>{if(!z||z.length===0)return F.filter(O=>O.config?.display!==!1).map(O=>O.children&&O.children.length>0?{...O,children:S(O.children)}:O);const le=new Map(F.map(O=>[O.id,O])),de=[];return z.forEach(O=>{const G=le.get(O.id);if(G){if(O.display){let se=G;G.children&&G.children.length>0&&(se={...G,children:S(G.children,O.children)}),de.push(se)}le.delete(O.id)}}),F.forEach(O=>{if(le.has(O.id)&&O.config?.display!==!1){let G=O;O.children&&O.children.length>0&&(G={...O,children:S(O.children)}),de.push(G)}}),de},V=e.computed(()=>S(a.columns,ne.value)),j=e.computed(()=>Ut(a.columns,F=>F.config.label)),y=e.ref(""),w=e.computed(()=>j.value.some(F=>F.config?.filter?.isSearchKeyword)),v=e.ref(),E=e.ref(!0),R=e.ref([]),$=e.computed(()=>E.value?"搜索全部":`搜索范围:${j.value.filter(F=>R.value.includes(F.id)).map(F=>F.config?.label).join("、")}`),_=()=>{v.value.init()},L=e.ref(),D=e.ref(!1),W=e.ref(!1),H=e.ref(!1),Q=e.ref([]),X=e.ref("and"),ye=e.ref(),Z=e.ref(!1),fe=e.ref([]),Ve=()=>{ye.value.init(fe.value)},me=F=>{fe.value=F,Z.value=!1,ve()},J=()=>{fe.value=[],ve()},pe=e.ref(),oe=e.ref(!1),ne=e.ref(),he=e.computed(()=>ne.value!=null),Be=()=>{pe.value?.init()},A=F=>{console.log("handleColumnSave:",F),ne.value=F,oe.value=!1},q=e.ref(!1),ee=()=>{q.value=!q.value},ce=()=>{m.value=[],r.value&&(r.value.setSelection?.([]),h.value&&(h.value=!1,r.value.setRecords(c)))},be=()=>{h.value=!h.value,h.value?r.value?.setRecords(m.value):r.value?.setRecords(c),r.value?.setSelection?.(m.value)},Se=e.computed(()=>{if(m.value.length>0){const F=[{label:`已选${m.value.length}条`,type:"text"},{label:h.value?"全部":"仅选中",type:"text",click:be},{label:"清空选中",type:"text",click:ce}],z=a.batchButtons.map(le=>({...le,click:()=>{le.click&&le.click(m.value)}}));return[...F,...z]}return a.buttons}),ie=async()=>{const F={},z={};z.rel=X.value;const le=L.value?.getSearchFields?.()||Q.value;z.cond=le.filter(O=>O.value!==void 0&&O.value!==null&&O.value!=="").map(O=>({field:O.field,method:O.method,value:O.value,type:O.type})),z.cond.length>0?H.value=!0:H.value=!1,F.filter=z;const de=fe.value.map(O=>O.value+" "+O.sord).join(",");if(y.value&&(F.keyword={value:y.value,fields:E.value?j.value.filter(O=>O.config?.filter?.isSearchKeyword).map(O=>O.id):e.unref(R)}),a.loadData){if(a.isPage){F.pagination={rows:d,page:u.value,sort:de||s||a.sort||a.rowKey};const O=await a.loadData(F)||{};c=O.rows||[],g.value=O.records||0}else F.sort=de,c=await a.loadData(F)||[],g.value=c.length;r.value.setRecords(c),f.value?(m.value=[],h.value=!1):a.rowKey&&m.value.length>0&&r.value?.setSelection?.(m.value)}},ve=async()=>{u.value=1,await ie()},Fe=({rows:F,page:z})=>{d=F,u.value=z,ie()},ze=async()=>{u.value=1,await ie()},T=async()=>{await ie()},U=async()=>{await ze()},M=F=>{i("ready",F)},B=F=>{let z=[];if(f.value)z=F;else if(!a.rowKey)z=F;else{const le=new Map(F.map(O=>[b(O),O])),de=new Map(m.value.map(O=>[b(O),O]));c.forEach(O=>{const G=b(O);le.has(G)?de.set(G,le.get(G)):de.delete(G)}),z=Array.from(de.values())}m.value=z,i("select",z),h.value&&z.length===0?(h.value=!1,r.value&&r.value.setRecords(c)):h.value&&z.length>0&&r.value&&(r.value.setRecords(z),r.value.setSelection?.(z))},x=()=>m.value||[],I=F=>{m.value=F,r.value?.setSelection?.(F)},P=()=>r.value?.getInstance?.();return e.onMounted(async()=>{a.immediate&&await T()}),l({refreshData:T,resetData:ze,getSelection:x,setSelection:I,clearSelection:()=>{ce()},getInstance:P}),(F,z)=>{const le=e.resolveComponent("j-buttons"),de=e.resolveComponent("j-icon"),O=e.resolveComponent("el-popover"),G=e.resolveComponent("el-tooltip"),se=e.resolveComponent("el-input"),ae=e.resolveComponent("j-button"),ge=e.resolveComponent("j-table");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["j-table-panel-wrapper",{fullscreen:q.value,"no-padding":t.noPadding||q.value}])},[e.createElementVNode("div",{class:e.normalizeClass(["j-table-panel",{"j-table-panel-fullscreen":q.value}])},[e.createElementVNode("div",ri,[e.createElementVNode("div",ci,[e.createElementVNode("div",di,[e.createVNode(le,{list:Se.value},null,8,["list"])]),e.createElementVNode("div",ui,[w.value&&!C.value?(e.openBlock(),e.createElementBlock("div",fi,[e.createVNode(se,{modelValue:y.value,"onUpdate:modelValue":z[2]||(z[2]=te=>y.value=te),modelModifiers:{trim:!0},placeholder:e.unref(o)("搜索数据"),onKeyup:e.withKeys(ve,["enter"]),onClear:ve,clearable:"",class:"j-suffix"},{prefix:e.withCtx(()=>[e.createVNode(de,{icon:"mdi:search"})]),suffix:e.withCtx(()=>[e.createVNode(G,{placement:"bottom",content:$.value},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(O,{placement:"bottom-end","popper-style":"padding: 0",width:200,trigger:"click","show-arrow":!1,onShow:_,onHide:ve},{reference:e.withCtx(()=>[e.createVNode(de,{icon:"mdi:keyboard-arrow-down",style:{cursor:"pointer"}})]),default:e.withCtx(()=>[e.createVNode(Ja,{ref_key:"keywordPanelRef",ref:v,columns:j.value,"check-all":E.value,"onUpdate:checkAll":z[0]||(z[0]=te=>E.value=te),"check-fields":R.value,"onUpdate:checkFields":z[1]||(z[1]=te=>R.value=te)},null,8,["columns","check-all","check-fields"])]),_:1})])]),_:1},8,["content"])]),_:1},8,["modelValue","placeholder"])])):e.createCommentVNode("",!0),!D.value&&!C.value?(e.openBlock(),e.createBlock(O,{key:1,placement:"bottom","popper-style":"padding: 0",width:644,trigger:"click",persistent:!1,visible:W.value,"onUpdate:visible":z[6]||(z[6]=te=>W.value=te),onHide:ve},{reference:e.withCtx(()=>[e.createVNode(ae,{icon:"mdi:filter-outline",label:"筛选",type:"text",class:e.normalizeClass({active:H.value})},null,8,["class"])]),default:e.withCtx(()=>[e.createVNode(Ko,{ref_key:"filterPanelRef",ref:L,"is-pin":D.value,"onUpdate:isPin":z[3]||(z[3]=te=>D.value=te),relation:X.value,"onUpdate:relation":z[4]||(z[4]=te=>X.value=te),searchFieldList:Q.value,columns:j.value,onFilter:ve,onClose:z[5]||(z[5]=te=>W.value=!1)},null,8,["is-pin","relation","searchFieldList","columns"])]),_:1},8,["visible"])):e.createCommentVNode("",!0),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(G,{key:2,placement:"bottom",content:e.unref(o)("排序")},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(O,{placement:"bottom","popper-style":"padding: 0",width:380,trigger:"click",onShow:Ve,visible:Z.value,"onUpdate:visible":z[7]||(z[7]=te=>Z.value=te)},{reference:e.withCtx(()=>[e.createVNode(ae,{class:e.normalizeClass({active:fe.value.length>0}),type:"text",icon:"mdi:sort"},null,8,["class"])]),default:e.withCtx(()=>[e.createVNode(ti,{ref_key:"orderPanelRef",ref:ye,columns:j.value,onSave:me,onClear:J},null,8,["columns"])]),_:1},8,["visible"])])]),_:1},8,["content"])),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(G,{key:3,placement:"bottom",content:e.unref(o)("显示字段")},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(O,{placement:"bottom","popper-style":"padding: 0",width:400,trigger:"click",onShow:Be,visible:oe.value,"onUpdate:visible":z[8]||(z[8]=te=>oe.value=te)},{reference:e.withCtx(()=>[e.createVNode(ae,{class:e.normalizeClass({active:he.value}),type:"text",icon:"mdi:table-headers-eye"},null,8,["class"])]),default:e.withCtx(()=>[e.createVNode(si,{ref_key:"columnPanelRef",ref:pe,columns:t.columns,"column-config":ne.value,onSave:A},null,8,["columns","column-config"])]),_:1},8,["visible"])])]),_:1},8,["content"])),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(G,{key:4,placement:"bottom",content:e.unref(o)("刷新")},{default:e.withCtx(()=>[e.createVNode(ae,{onClick:U,type:"text",icon:"mdi:refresh"})]),_:1},8,["content"])),e.createVNode(G,{placement:"bottom",content:q.value?e.unref(o)("退出全屏"):e.unref(o)("全屏")},{default:e.withCtx(()=>[e.createVNode(ae,{onClick:ee,type:"text",icon:q.value?"mdi:fullscreen-exit":"mdi:fullscreen"},null,8,["icon"])]),_:1},8,["content"])])]),e.createElementVNode("div",mi,[e.createVNode(ge,{ref_key:"tableRef",ref:r,columns:V.value,records:e.unref(c),"is-tree":t.isTree,"is-show-number":t.isShowNumber,"is-multiple":t.isMultiple&&!!t.rowKey,"is-page":k.value,"page-sizes":t.pageSizes,"page-size":t.pageSize,"page-total":g.value,"row-key":t.rowKey,actions:t.actions,"actions-max-count":t.actionsMaxCount,"actions-label":t.actionsLabel,"table-page":u.value,"onUpdate:tablePage":z[9]||(z[9]=te=>u.value=te),onLoadPageData:Fe,onReady:M,onSelectionChanged:B},null,8,["columns","records","is-tree","is-show-number","is-multiple","is-page","page-sizes","page-size","page-total","row-key","actions","actions-max-count","actions-label","table-page"])])]),D.value&&!C.value?(e.openBlock(),e.createElementBlock("div",pi,[e.createVNode(Ko,{ref_key:"filterPanelRef",ref:L,"is-pin":D.value,"onUpdate:isPin":z[10]||(z[10]=te=>D.value=te),relation:X.value,"onUpdate:relation":z[11]||(z[11]=te=>X.value=te),searchFieldList:Q.value,columns:j.value,onFilter:ve},null,8,["is-pin","relation","searchFieldList","columns"])])):e.createCommentVNode("",!0)],2)],2)}}})),hi={class:"j-button-select"},gi={class:"search-wraper"},yi={class:"options-wraper"},bi=["onClick"],Xo=K(e.defineComponent({name:"JButtonSelect",__name:"button-select",props:{modelValue:{default:void 0},label:{default:"添加"},popoverWidth:{default:240},options:{default:()=>[]}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,{t:a}=we(),i=e.ref(""),r=e.computed(()=>i.value===""?n.options:n.options.filter(u=>(u.label||"").includes(i.value))),c=e.computed(()=>n.modelValue?(n.modelValue+"").split(",").filter(Boolean):[]),g=u=>{if(u.disabled||c.value.includes(u.value))return;const s=[...c.value,u.value].join(",");o("update:modelValue",s),o("change",{value:s,data:u})};return(u,d)=>{const s=e.resolveComponent("j-button"),m=e.resolveComponent("j-icon"),h=e.resolveComponent("el-input"),f=e.resolveComponent("el-popover");return e.openBlock(),e.createBlock(f,{teleported:!1,placement:"bottom-start","popper-style":"padding: 0",width:t.popoverWidth,trigger:"click","show-arrow":!1,offset:4},{reference:e.withCtx(()=>[e.createVNode(s,{style:{"justify-content":"flex-start",padding:"4px 0",border:"0"},icon:"mdi:add",label:t.label,type:"link"},null,8,["label"])]),default:e.withCtx(()=>[e.createElementVNode("div",hi,[e.createElementVNode("div",gi,[e.createVNode(h,{modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=p=>i.value=p),modelModifiers:{trim:!0},placeholder:e.unref(a)("搜索"),class:"no-border",clearable:""},{prefix:e.withCtx(()=>[e.createVNode(m,{icon:"mdi:search"})]),_:1},8,["modelValue","placeholder"])]),e.createElementVNode("div",yi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,p=>(e.openBlock(),e.createElementBlock("div",{key:p.value,class:e.normalizeClass(["option-item",{active:c.value.includes(p.value)||p.disabled}]),onClick:e.withModifiers(C=>g(p),["stop"])},[p.icon?(e.openBlock(),e.createBlock(m,{key:0,class:"j-button-select-icon",icon:p.icon},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(e.unref(a)(p.label)),1)],10,bi))),128))])])]),_:1},8,["width"])}}})),Ci={class:"j-tree-item-text"},ki={key:2,class:"j-tree-item-button-group"},wi={key:1,class:"j-block",style:{display:"flex","align-items":"center","justify-content":"center"}},Qo=K(e.defineComponent({name:"JTree",__name:"tree",props:{loadData:Function,afterLoadData:Function,click:Function,immediate:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean,default:!0},defaultCheckedKeys:{type:Array,default:()=>[]},defaultExpandedKeys:{type:Array,default:()=>[]},accordion:{type:Boolean,default:!1},highlightCurrent:{type:Boolean,default:!0},filterNode:Function,renderAfterExpand:{type:Boolean,default:!0},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},pidKey:{type:String,default:"pid"},idKey:{type:String},iconKey:{type:String,default:"nodeIcon"},iconColorKey:{type:String,default:"nodeIconColor"},list:{type:Array},dataType:String,dataCode:String,checkable:Boolean,check:Function,emptyDes:{type:String,default:"暂无数据"},defaultIcon:{type:String,default:""},defaultIconColor:{type:String,default:""},treeButtons:{type:Array,default:()=>[]},filterButton:Function,buttonDefaultIcon:{type:String,default:""},buttonIconColor:{type:String,default:""},runFlow:{type:Function},nodeClickFlow:{type:String},isHeightAuto:{type:Boolean,default:!1},theme:{type:String,default:"default"},draggable:{type:Boolean,default:!1},expandOnClickNode:{type:Boolean,default:!1},allowDrop:Function},emits:["node-drop"],setup(t,{expose:l,emit:n}){const o=t,a=n,{useData:i,t:r}=we(),{getTreeData:c,loadData:g}=i(),u=e.ref(),d=e.ref(!1),s=e.ref(""),m=e.ref([]),h={children:"children",label:"label",disabled:"disabled"},f=e.computed(()=>c?c({dataType:o.dataType,dataCode:o.dataCode,labelKey:o.labelKey,valueKey:o.valueKey,pidKey:o.pidKey,idKey:o.idKey,notLoad:!0})||[]:[]),p=e.computed(()=>o.dataCode||o.dataType?f.value:o.list?e.unref(o.list):m.value),C=async()=>{d.value=!0,o.loadData&&(m.value=await o.loadData()||[]),g&&await g(o.dataType,o.dataCode),d.value=!1,e.nextTick(()=>{o.afterLoadData&&o.afterLoadData(p.value||[])})},k=(L,D=!0)=>{u.value?.setCurrentKey(L,D)},b=()=>u.value?.getCurrentKey(),S=(L,D=!1)=>{u.value?.setCheckedKeys(L,D)},V=(L=!1)=>u.value?.getCheckedKeys(L),j=async(L,D,W,H)=>{if(s.value=L.value,o.nodeClickFlow&&o.runFlow){const Q=JSON.parse(o.nodeClickFlow);await o.runFlow(Q,{value:L.value})}o.click&&o.click(L.value,L,H)},y=(L,{checkedKeys:D,checkedNodes:W,halfCheckedKeys:H,halfCheckedNodes:Q})=>{o.check&&o.check(D,{node:L,checkedNodes:W,halfCheckedKeys:H,halfCheckedNodes:Q})},w=(L,D,W,H)=>{a("node-drop",L,D,W,H)},v=L=>{const D=De(o.treeButtons);return L&&o.filterButton?o.filterButton({buttons:D,node:L}):D},E=(L,D)=>{L.disabled||L.click&&L.click(D)},R=e.ref(""),$=(L,D)=>{R.value=L?D.value:"",console.log(R.value,"row")},_=(L,D,W)=>o.allowDrop?o.allowDrop(L,D,W):!(W=="inner"&&!D.data.canInner);return e.onMounted(async()=>{(o.immediate&&o.loadData||o.dataType||o.dataCode)&&await C()}),e.watch(()=>o.list,()=>{d.value=!0,e.nextTick(()=>{d.value=!1})}),e.watch(()=>o.dataCode||o.dataType,()=>{C()}),l({refreshData:C,setValue:k,getValue:b,setCheck:S,getCheck:V}),(L,D)=>{const W=e.resolveComponent("j-icon"),H=e.resolveComponent("j-button"),Q=e.resolveComponent("el-dropdown-item"),X=e.resolveComponent("el-dropdown-menu"),ye=e.resolveComponent("el-dropdown"),Z=e.resolveComponent("el-tree"),fe=e.resolveComponent("el-empty"),Ve=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["j-block","j-tree",{"j-tree-menu":t.theme==="menu"}]),style:{"min-height":"60px"}},[!d.value&&p.value.length>0?(e.openBlock(),e.createBlock(Z,{key:0,"node-key":t.idKey||t.valueKey,"default-checked-keys":t.defaultCheckedKeys,"default-expanded-keys":t.defaultExpandedKeys,"current-node-key":s.value,data:p.value,"default-expand-all":t.defaultExpandAll,"show-checkbox":t.checkable,onNodeClick:j,onCheck:y,onNodeDrop:w,props:h,"highlight-current":t.highlightCurrent,accordion:t.accordion,"filter-node-method":t.filterNode,"render-after-expand":t.renderAfterExpand,draggable:t.draggable,"allow-drop":_,"expand-on-click-node":t.expandOnClickNode,ref_key:"treeRef",ref:u},{default:e.withCtx(({node:me})=>[e.createElementVNode("div",{class:e.normalizeClass(["j-tree-item-wraper",{"is-focus":R.value===me.data.value}])},[me.data.openIcon?(e.openBlock(),e.createBlock(W,{key:0,class:"j-tree-item-open-icon",size:18,icon:me.data.openIcon,color:me.data[t.iconColorKey]||t.defaultIconColor||""},null,8,["icon","color"])):e.createCommentVNode("",!0),me.data[t.iconKey]||t.defaultIcon?(e.openBlock(),e.createBlock(W,{key:1,class:"j-tree-item-default-icon",size:18,icon:me.data[t.iconKey]||t.defaultIcon||"",color:me.data[t.iconColorKey]||t.defaultIconColor||""},null,8,["icon","color"])):e.createCommentVNode("",!0),e.createElementVNode("div",Ci,e.toDisplayString(me.label),1),v(me.data).length?(e.openBlock(),e.createElementBlock("div",ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v(me.data),(J,pe)=>(e.openBlock(),e.createBlock(ye,{key:pe,trigger:"click",onVisibleChange:oe=>$(oe,me.data)},{dropdown:e.withCtx(()=>[e.createVNode(X,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.children,(oe,ne)=>(e.openBlock(),e.createBlock(Q,{key:ne,disabled:oe.disabled,divided:oe.divided,onClick:e.withModifiers(he=>E(oe,me.data),["stop"])},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"j-flex-item",style:e.normalizeStyle({color:oe.danger?"var(--j-color-danger)":oe.color||t.buttonIconColor||"var(--j-color-text-2)"})},[oe.icon||t.buttonDefaultIcon?(e.openBlock(),e.createBlock(W,{key:0,icon:oe.icon||t.buttonDefaultIcon},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",null,e.toDisplayString(e.unref(r)(oe.label)),1)],4)]),_:2},1032,["disabled","divided","onClick"]))),128))]),_:2},1024)]),default:e.withCtx(()=>[e.createVNode(H,{icon:J.icon,type:"text"},null,8,["icon"])]),_:2},1032,["onVisibleChange"]))),128))])):e.createCommentVNode("",!0)],2)]),_:1},8,["node-key","default-checked-keys","default-expanded-keys","current-node-key","data","default-expand-all","show-checkbox","highlight-current","accordion","filter-node-method","render-after-expand","draggable","expand-on-click-node"])):(e.openBlock(),e.createElementBlock("div",wi,[e.createVNode(fe,{description:e.unref(r)(t.emptyDes)},null,8,["description"])]))],2)),[[Ve,d.value]])}}})),Zo=K(fo),Bi=Mn;async function Si(t,l,n){const o={...n};delete o.ruleIndex,delete o.trigger;const a=new Bi({[t]:[o]});let i=[];try{await a.validate({[t]:l})}catch(r){r.errors?i=r.errors.map(({message:c})=>c):i=[o.message||"校验错误"]}return i.length>0?i[0]:""}async function Vi(t,l,n){const o=n.map((a,i)=>({...a,ruleIndex:i})).sort(({warningOnly:a,ruleIndex:i},{warningOnly:r,ruleIndex:c})=>!!a==!!r?i-c:a?1:-1);for(let a=0;a<o.length;a+=1){const i=o[a];"pattern"in i&&(l+="");const r=await Si(t,l,i);if(r!=="")return{name:t,errors:r}}}function xi(t,l){const n=(i,r,c,g,u)=>{Object.keys(r).forEach(d=>{let s=d;c&&(s=`${c}.${d}`);const m=r[d],{rules:h,myGridtableId:f}=l(s,c?r:void 0,g,u);if(h.length){const p=o(s,m,h);i.push(p)}f&&m.forEach(p=>{n(i,p,f,m,c?r:void 0)})})},o=(i,r,c)=>Vi(i,r,c);return{validateForm:async()=>{const i=e.unref(t),r=[];n(r,i,"");const c=await Promise.all(r),g={};return c.forEach(u=>{u&&(g[u.name]={msg:u.errors})}),g},validateField:o}}const en=K(e.defineComponent({name:"JForm",__name:"form",props:{config:{type:Object,default:()=>({})},isAutoSize:{type:Boolean,default:!0},schema:{type:Array,default:()=>[]},readonly:{type:Boolean,default:!1}},emits:["change"],setup(t,{expose:l,emit:n}){const o=t,a=n,{useData:i,existField:r,httpGet:c,httpPost:g,success:u,warning:d,error:s,info:m,t:h}=we();let f;i&&(f=i());const p=T=>{s&&s(T)},C=e.ref(!1),k=e.computed(()=>o.config?.gutter||16),b=e.computed(()=>o.config?.span||24),S=e.computed(()=>o.config?.labelWidth),V=e.computed(()=>o.config?.labelPosition||"right"),j=e.computed(()=>v.length===1&&(v[0].type==="j-tabs"||v[0].type==="j-layout"||v[0].config?.isAutoWindow)),y=e.reactive({}),w=e.ref({}),v=[],E={},R=e.ref({});let $={},_={},L=[],D={};const W=T=>{a("change",T)},H=T=>it(E[T]?.type||"")&&!E[T]?.config?.notInput||E[T]?.config?.isInput,Q=T=>["j-table","j-input-rows","j-input-cards"].includes(E[T]?.type||"");let X;const ye=(T,U)=>{Object.keys(T).forEach(M=>{const B=T[M];U&&(M=U+"."+M),B!=null&&typeof B=="object"&&!nt(B)&&ye(B,M),y[M]=B})},Z=(T,U)=>{let M=T.id;return M||(T.config?.table&&T.config?.field?M=`${T.config.table}.${T.config.field}`:T.config?.table?M=T.config?.table:T.config?.field&&(M=T.config?.field),U&&Q(U)&&(M=`${U}.${M}`)),M||at("j")},fe=(T,U,M,B="")=>{T.forEach(x=>{x.id=Z(x,B);const I={id:x.id,slot:x.slot,type:x.type,getCompType:x.getCompType,getCompConfig:x.getCompConfig,config:{},children:[]};U.push(I);const{children:P}=x;lt(I,x,["children","config"]),lt(I.config,x.config||{},[]),E[x.id]&&console.warn("有重复的组件id:"+x.id),E[x.id]=I,o.readonly===!0&&(I.config.readonly=!0);let Y=!1,F;B!==""&&Q(B)&&(Y=!0,I.config=x.config||{},I.config.parentTableId=B,F=E[B]?.config?.table);const z=I.config||{};if(H(x.id))!M&&Y===!1&&(z?.defaultValue===0?y[x.id]=z?.defaultValue:y[x.id]=z?.defaultValue||void 0),z.table&&z.field?$[`${z.table}_${z.field}`.toLowerCase()]=x.id:z.field&&(Y?$[`${F}_${z.field}`.toLowerCase()]=x.id:$[`${z.field}`.toLowerCase()]=x.id);else if(Y&&z.field)$[`${F}_${z.field}`.toLowerCase()]=x.id;else if(Q(x.id))!M&&!z.isSubTable&&(y[x.id]=[]),z.table&&($[z.table.toLowerCase()||""]=x.id),z.isSubTable||L.push(I);else if(z?.defaultValue)y[x.id]=z?.defaultValue;else if(x.type==="collapse"&&z?.isExpand){const le=[];(z?.groups||[]).forEach(de=>{le.push(de.i)}),y[x.id]=le}P&&P.length>0&&fe(P,I.children,M,I.id)})},Ve=async(T,U)=>{C.value=!1;const M=!!U;v.splice(0,v.length),$={},_={},L=[],X=U,Xe(y),R.value={},M&&ye(U,""),fe(T,v,M),D=De(y),e.nextTick(()=>{C.value=!0,e.nextTick(()=>{Fe(o.config?.codeInit,{})})})},me=(T,U,M)=>{const B=[];return U.forEach(x=>{const I={};Object.keys(x).forEach(P=>{if(!M||M(P,x[P],T)){const Y=ee(P);if(Y?.type==="j-table")I[Y?.id||""]=me(P,x[P],M);else{let F=$[`${T}_${P}`.toLowerCase()]||P;F=F.indexOf(".")!==-1?F.split(".")[1]:F,I[F]=x[P]}}}),B.push(I)}),B},J=(T,U)=>{Object.keys(T||{}).forEach(M=>{let B=T[M];const x=ee(M);if(x===void 0)B&&(nt(B)&&(B=B[0]||{}),typeof B=="object"?Object.keys(B).forEach(I=>{if(!U||U(M,B[I],M)){let P=I;M!=="main"&&(P=`${M}_${I}`),_[P]=M,y[$[P.toLowerCase()]||I]=B[I]}}):y[M]=B);else if(Q(x.id||"")){if(!Array.isArray(B)){console.warn("表格数据不是数组:"+M);return}B?.length>0?y[$[M.toLowerCase()]||M]=me(M,B,U):y[$[M.toLowerCase()]||M]=[]}else(!U||U(M,B,M))&&(y[$[M.toLowerCase()]||M]=B)}),X&&Object.keys(y).forEach(M=>{const B=ee(M);(B===void 0||!["tabs","collapse"].includes(B.type||""))&&Ft(X,M,y[M])})},pe=(T,U=!1)=>{const M={};return Object.keys(T).forEach(B=>{if(B==="parentRow")return;const x=E[B];if(x){const I=x.config?.table,P=x.config?.field;if(U)P?M[P]=T[B]:M[B]=T[B];else if(Q(B)){const Y=[];T[B].forEach(F=>{Y.push(pe(F,!0))}),M[I||B]=Y}else I&&P?(M[I]=M[I]||{},M[I][P]=T[B]):P&&(M[P]=T[B])}else U?B!=="_X_ROW_KEY"&&B!=="_isHover"&&(M[B]=T[B]):_[B]?(M[_[B]]=M[_[B]]||{},M[_[B]][B.replace(`${_[B]}_`,"")]=T[B]):M[B]=T[B]}),M},oe=(T=!0)=>T?pe(y):y,ne=(T,U,M,B)=>{let x=E[T];if(x==null){const P=T.split(".");x=E[P[P.length-1]]||{}}if(!x)return{};const I=Ae({config:{...x.config||{},...R.value[x.id]||{}},getCompConfig:x.getCompConfig,formData:y,tableData:M,row:U,pRowData:B});return I._componentId=x?.id,I},he=(T,U,M,B)=>{const x=ne(T,U,M,B);if(x.isNotRule!==!0&&x.display!==!1){const I=x.rule||[],P=I.find(Y=>Y.type==="only");return P&&(P.validator=async(Y,F)=>{if(F){const z={table:Y.table,key:Y.key,keyName:Y.keyName,field:Y.field,keyValue:Y.getKeyValue?Y.getKeyValue():"",value:F,paramNames:Y.paramNames,getParams:Y.getParams,withProjectId:Y.withProjectId,getValue:Y.getValue,formData:y};if(!await r(z))throw h(Y.message)||h("数据值重复")}}),{rules:I,myGridtableId:Q(x._componentId)?x._componentId:""}}return{rules:[],myGridtableId:""}},{validateForm:Be}=xi(y,he),A=async()=>{w.value={};const T=await Be();return Object.keys(T).length>0?(w.value=T,p(`${h(E[Object.keys(T)[0]]?.config?.label)}:${h(T[Object.keys(T)[0]].msg)}`),!1):!0},q=()=>{w.value={},Xe(y),Object.keys(D||{}).forEach(T=>{y[T]=D[T]})},ee=T=>{let U=E[T];return U===void 0&&$[T.toLowerCase()]&&(U=E[$[T.toLowerCase()]]),U},ce=({id:T,i:U,value:M,type:B})=>{if(B==="add")y[T].push(M);else if(B==="delete")y[T].splice(U,1);else{const x=ee(T);x&&(x.config.parentTableId?y[x.config.parentTableId][U][T]=M:y[T]=M)}},be=({id:T,i:U})=>{const M=ee(T);if(M){if(M.config.parentTableId){const B=y[M.config.parentTableId],x=M.id?M.id.replace(`${M.config.parentTableId}.`,""):"";if(U!=null)return(B[U]||{})[x||""];const I=[];return B&&B.forEach(P=>{I.push(P[x||""])}),I}if(Q(M.id||"")){const B=[];return y[M.id||""].forEach(x=>{B.push(pe(x,!0))}),B}return y[M.id||""]}if(y[T])return y[T]},Se=async({id:T,i:U})=>{const M=be({id:T,i:U}),B=ee(T);if(B&&f?.getLabel)if(U!==void 0){const x=M[U],I=y[B.config.parentTableId||""][U],P=Ae({config:B.config,getCompConfig:B.getCompConfig,formData:y,tableData:y[B.config.parentTableId||""],row:I});return await f?.getLabel({value:x,config:P,formData:y,tableData:y[B.config.parentTableId||""],row:I})}else{const x=Ae({config:B.config,getCompConfig:B.getCompConfig,formData:y});return await f?.getLabel({value:M,config:x,formData:y})}return M},ie=async(T,U)=>f?.loadViewDataList?await f?.loadViewDataList(T,U,!1):[],ve=T=>(T.set=ce,T.get=be,T.setFormData=J,T.getFormData=oe,T.getLabel=Se,T.getViewData=ie,T.getDateNow=U=>qt(new Date,U||"YYYY-MM-DD HH:mm:ss"),T.httpGet=c||(()=>{console.log("当前状态不支持")}),T.httpPost=g||(()=>{console.log("当前状态不支持")}),T.loading=U=>{Re(U)},T.showMsg=({text:U,type:M})=>{switch(M){case"success":u&&u(U);break;case"warning":d&&d(U);break;case"error":s&&s(U);break;case"info":m&&m(U);break;default:m&&m(U);break}console.log("showMsg",U,M)},T),Fe=async(T,U)=>{if(T&&T.trim()){T=`async (jcode) => {${T}}`;const{res:M,fn:B}=bt(T);M&&await B(ve(U))}},ze=(T,U)=>{R.value[T]={...R.value[T]||{},...U}};return o.schema&&Ve(o.schema),uo({formData:y,compsConfig:R,errorFields:w,isAutoWindow:j,gutter:k,span:b,labelWidth:S,labelPosition:V,getValue:be,formChange:W}),l({init:Ve,reset:q,validate:A,setValue:ce,getValue:be,getLabel:Se,setFormData:J,getFormData:oe,setCompConfig:ze}),(T,U)=>{const M=e.resolveComponent("j-form-item"),B=e.resolveComponent("el-row"),x=e.resolveComponent("el-form");return C.value?(e.openBlock(),e.createBlock(x,{key:0,class:e.normalizeClass([{"j-block":t.isAutoSize},"j-form"]),"label-position":V.value,"label-width":S.value,size:t.config?.size,onSubmit:U[0]||(U[0]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[j.value?(e.openBlock(),e.createBlock(M,e.normalizeProps(e.mergeProps({key:0},v[0])),null,16)):(e.openBlock(),e.createBlock(B,{key:1,gutter:k.value},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(v,I=>e.createVNode(M,e.mergeProps({key:I.id,ref_for:!0},I),null,16)),64))]),_:1},8,["gutter"]))]),_:1},8,["class","label-position","label-width","size"])):e.createCommentVNode("",!0)}}})),tn=K(e.defineComponent({name:"JFormItem",__name:"form-item",props:{id:{type:String,default:""},type:{type:String,default:""},getCompType:{type:Function,default:void 0},config:{type:Object,default:()=>{}},getCompConfig:{type:Function,default:void 0},children:{type:Array,default:()=>[]}},setup(t){const l=t,{formData:n,compsConfig:o,errorFields:a,isAutoWindow:i,span:r,labelWidth:c}=_e(),{t:g}=we(),u=e.computed(()=>Ae({config:{...l.config||{},...o?.value?.[l.id]||{}},getCompConfig:l.getCompConfig,formData:n})),d=e.computed(()=>l.getCompType?l.getCompType({config:l.config,formData:n}):l.type),s=e.computed(()=>it(d.value)&&!u.value?.notInput||u.value?.isInput),m=e.computed(()=>u.value?.labelWidth||c.value),h=e.computed(()=>(u.value?.rule||[]).some(C=>C.required===!0)),f=e.computed(()=>{const p=a?.value?.[l.id];return p?p.msg:""});return(p,C)=>{const k=e.resolveComponent("j-comp"),b=e.resolveComponent("el-form-item"),S=e.resolveComponent("el-col");return u.value.display!==!1&&!e.unref(i)?(e.openBlock(),e.createBlock(S,{key:0,span:u.value.span||e.unref(r),style:e.normalizeStyle({...u.value.colStyle||{}}),class:e.normalizeClass(u.value.colClass||{})},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createBlock(b,{key:0,label:e.unref(g)(u.value.notShowLabel?"":u.value.label||""),"label-position":u.value.labelPosition,"label-width":m.value,required:h.value,error:e.unref(g)(f.value)},{default:e.withCtx(()=>[e.createVNode(k,{id:t.id,type:d.value,config:u.value,children:t.children},null,8,["id","type","config","children"])]),_:1},8,["label","label-position","label-width","required","error"])):(e.openBlock(),e.createBlock(k,{key:1,id:t.id,type:d.value,config:u.value,children:t.children},null,8,["id","type","config","children"]))]),_:1},8,["span","style","class"])):u.value.display!==!1?(e.openBlock(),e.createBlock(k,{key:1,id:t.id,type:d.value,config:u.value,children:t.children},null,8,["id","type","config","children"])):e.createCommentVNode("",!0)}}})),ji={class:"j-page"},on=K(e.defineComponent({name:"JPage",__name:"page",props:{schema:{type:Array,default:()=>[]},noPadding:{type:Boolean,deflaut:!1},actions:{type:Object,default:()=>({})}},setup(t){const l=t,n=e.ref(!1),o=[],a={},i=e.reactive({}),r=(g,u)=>{g.forEach(d=>{d.id=d.id||at("c");const s={id:d.id,slot:d.slot,type:d.type,config:{},children:[]},{children:m}=d;a[d.id]=s,lt(s.config,d.config||{},["defaultValue"]),d?.config?.defaultValue!==void 0&&(i.value[d.id]=d.config.defaultValue),u.push(s),m&&m.length>0&&r(m,s.children)})},c=g=>{n.value=!1,o.splice(0,o.length),Xe(a),Xe(i),r(g,o),e.nextTick(()=>{n.value=!0})};return l.schema&&c(l.schema),(g,u)=>{const d=e.resolveComponent("j-comp");return e.openBlock(),e.createElementBlock("div",ji,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,s=>e.createVNode(d,{key:s.id,id:s.id,type:s.type,config:s.config,children:s.children},null,8,["id","type","config","children"])),64))])}}})),nn=K(e.defineComponent({name:"JGuid",__name:"guid",props:{modelValue:{default:void 0},size:{default:"default"}},emits:["update:modelValue"],setup(t,{emit:l}){const n=t,o=l,a=e.ref("");return e.watch(()=>n.modelValue,i=>{i?a.value=i:(a.value=Qe(),o("update:modelValue",a.value))},{immediate:!0}),(i,r)=>{const c=e.resolveComponent("el-input");return e.openBlock(),e.createBlock(c,{modelValue:a.value,"onUpdate:modelValue":r[0]||(r[0]=g=>a.value=g),readonly:"",size:t.size},null,8,["modelValue","size"])}}})),Ni={class:"j-input-rows"},vi={key:0,class:"j-input-rows-num"},$i={key:1,class:"j-input-rows-char"},ln=K(e.defineComponent({name:"JInputRows",__name:"input-rows",props:{modelValue:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},editConfig:{type:Object,default:()=>({})},isCompact:{type:Boolean,default:!1},showNum:{type:Boolean,default:!1},showChar:{type:Boolean,default:!1},isWrap:{type:Boolean,default:!1},id:{type:String,default:""}},emits:["update:modelValue","change","rowChange"],setup(t,{emit:l}){const n=V=>V==null,o=t,a=l,{formData:i}=_e(),r=e.computed(()=>o.editConfig.isAddBtn!==!1),c=e.computed(()=>o.editConfig.addBtnText||"添加"),g=e.computed(()=>o.editConfig.buttonsAlign||"left"),u=e.computed(()=>o.editConfig.isRemoveBtn!==!1),d=e.computed(()=>o.editConfig.readonly),s=e.computed(()=>o.editConfig.drag),m=e.computed(()=>o.editConfig.isNullValue!==!1),h=e.ref(),f=["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"],p=e.ref([]);o.modelValue&&o.modelValue.length>0?(p.value=o.modelValue||[],p.value.forEach(V=>{V.i||(V.i=Qe())})):(p.value=[],a("update:modelValue",p.value)),e.watch(()=>o.modelValue,V=>{p.value=o.modelValue||[],p.value=V||[],p.value.forEach(j=>{j.i||(j.i=Qe())})},{deep:!0});const k=()=>{const V={i:Qe()};o.columns.forEach(j=>{const y=j.config?.valueRowKey||j.id||"";y&&(V[y]=De(j.config?.defaultValue))}),p.value.push(V),a("change",{id:o.id,value:V,data:V,formData:i,tableData:p.value,type:"add"})},b=V=>{const j=p.value[V];p.value.splice(V,1),a("change",{id:o.id,value:j,data:j,formData:i,tableData:p.value,type:"delete"})},S=V=>{a("rowChange",V)};return e.onMounted(()=>{if(!s.value||!h.value)return;const V=h.value,{initSortable:j}=Qt(V,{handle:".j-input-rows-drag",onEnd:y=>{const{oldIndex:w,newIndex:v}=y;if(n(w)||n(v)||w===v||w<0||v<0)return;const E=p.value.splice(w,1)[0];p.value.splice(v,0,E),a("change",{id:o.id,value:E,data:E,formData:i,tableData:p.value,type:"sort"})}});j()}),Bt({tableData:p.value,rowChange:S}),(V,j)=>{const y=e.resolveComponent("j-comp"),w=e.resolveComponent("j-icon"),v=e.resolveComponent("j-button");return e.openBlock(),e.createElementBlock("div",Ni,[e.createElementVNode("div",{ref_key:"inputRowsRef",ref:h,class:"j-input-rows-container"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(E,R)=>(e.openBlock(),e.createElementBlock("div",{key:E.i+R,class:e.normalizeClass([t.isCompact?"j-space-compact":"j-space",{"j-space-wrap":t.isWrap}])},[t.showNum?(e.openBlock(),e.createElementBlock("div",vi,e.toDisplayString(R+1),1)):e.createCommentVNode("",!0),t.showChar?(e.openBlock(),e.createElementBlock("div",$i,e.toDisplayString(f[R%26]),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,$=>(e.openBlock(),e.createBlock(y,e.mergeProps({key:$.id,ref_for:!0},$,{row:E}),null,16,["row"]))),128)),s.value?(e.openBlock(),e.createBlock(w,{key:2,class:"j-input-rows-drag",icon:"mdi:drag"})):e.createCommentVNode("",!0),u.value&&(m.value||p.value.length>1)&&!d.value?(e.openBlock(),e.createBlock(w,{key:3,icon:"mdi:delete-outline",class:"j-input-rows-delete",onClick:$=>b(R)},null,8,["onClick"])):e.createCommentVNode("",!0)],2))),128))],512),!d.value&&r.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({"text-align":g.value}),class:"j-input-rows-actions"},[r.value?(e.openBlock(),e.createBlock(v,{key:0,type:"link",style:{"margin-right":"8px"},label:c.value,icon:"mdi:add",onClick:k},null,8,["label"])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)])}}})),an=K(e.defineComponent({name:"JLayerForm",__name:"layer-form",props:{icon:{type:String,default:"mdi:form-outline"},type:{type:String,default:"default"},size:{type:String,default:"default"},layerLabel:{type:String,default:"设置"},layerHeight:{type:Number,default:400},layerWidth:{type:Number,default:600},formConfig:{type:Object,default:()=>({})},schema:{type:Array,default:()=>[]}},setup(t){const l=t,n=_e(),{t:o}=we(),a=e.computed(()=>l.formConfig?.gutter||16),i=e.computed(()=>l.formConfig?.span||24),r=e.computed(()=>l.formConfig?.labelWidth||n.labelWidth?.value),c=e.computed(()=>l.formConfig?.labelPosition||n.labelPosition?.value||"right"),g=e.computed(()=>l.schema?.length===1&&(l.schema?.[0]?.type==="j-tabs"||l.schema?.[0]?.type==="j-layout"||l.schema?.[0]?.config?.isAutoWindow)),u=e.ref(!1),d=()=>{u.value=!0};return uo({...n,isAutoWindow:g,gutter:a,span:i,labelWidth:r}),(s,m)=>{const h=e.resolveComponent("j-button"),f=e.resolveComponent("j-form-item"),p=e.resolveComponent("el-row"),C=e.resolveComponent("el-form"),k=e.resolveComponent("j-dialog");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(h,e.mergeProps(s.$attrs,{type:t.type,size:t.size,icon:t.icon,onClick:d}),null,16,["type","size","icon"]),e.createVNode(k,{visible:u.value,"onUpdate:visible":m[1]||(m[1]=b=>u.value=b),title:e.unref(o)(t.layerLabel||"设置"),height:t.layerHeight||400,width:t.layerWidth||600,"has-btns":!1},{default:e.withCtx(()=>[e.createVNode(C,{class:e.normalizeClass(["j-block","j-layer-form"]),"label-position":c.value,"label-width":r.value,size:t.formConfig?.size,onSubmit:m[0]||(m[0]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[g.value?(e.openBlock(),e.createBlock(f,e.normalizeProps(e.mergeProps({key:0},t.schema[0])),null,16)):(e.openBlock(),e.createBlock(p,{key:1,gutter:a.value},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.schema,b=>(e.openBlock(),e.createBlock(f,e.mergeProps({key:b.id,ref_for:!0},b),null,16))),128))]),_:1},8,["gutter"]))]),_:1},8,["label-position","label-width","size"])]),_:1},8,["visible","title","height","width"])])}}})),sn=K(e.defineComponent({name:"JSwitch",inheritAttrs:!1,__name:"switch",props:{modelValue:{type:[Boolean,String,Number],default:!1},size:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},activeText:{},inactiveText:{},activeIcon:{},inactiveIcon:{},activeActionIcon:{},inactiveActionIcon:{},width:{default:40},inlinePrompt:{type:Boolean,default:!1},name:{},validateEvent:{type:Boolean,default:!0},beforeChange:{},id:{},tabindex:{},ariaLabel:{},loading:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,a=e.computed({get(){return n.modelValue},set(r){o("update:modelValue",r)}}),i=r=>{o("change",r)};return e.onMounted(()=>{n.autoFocus&&setTimeout(()=>{a.value=!a.value,i(a.value)},100)}),(r,c)=>{const g=e.resolveComponent("el-switch");return e.openBlock(),e.createBlock(g,e.mergeProps(r.$attrs,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=u=>a.value=u),size:t.size,width:t.width,"inline-prompt":t.inlinePrompt,"active-icon":t.activeIcon,"inactive-icon":t.inactiveIcon,"active-action-icon":t.activeActionIcon,"inactive-action-icon":t.inactiveActionIcon,"active-text":t.activeText,"inactive-text":t.inactiveText,"active-value":t.activeValue,"inactive-value":t.inactiveValue,name:t.name,"validate-event":t.validateEvent,"before-change":t.beforeChange,id:t.id,tabindex:t.tabindex,"aria-label":t.ariaLabel,loading:t.loading,disabled:t.disabled||t.readonly,onChange:i}),e.createSlots({_:2},[r.$slots["active-action"]?{name:"active-action",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"active-action")]),key:"0"}:void 0,r.$slots["inactive-action"]?{name:"inactive-action",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"inactive-action")]),key:"1"}:void 0,r.$slots.active?{name:"active",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"active")]),key:"2"}:void 0,r.$slots.inactive?{name:"inactive",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"inactive")]),key:"3"}:void 0]),1040,["modelValue","size","width","inline-prompt","active-icon","inactive-icon","active-action-icon","inactive-action-icon","active-text","inactive-text","active-value","inactive-value","name","validate-event","before-change","id","tabindex","aria-label","loading","disabled"])}}})),rn=K(e.defineComponent({name:"JTabs",__name:"tabs",props:{modelValue:{},type:{default:""},closable:{type:Boolean,default:!1},addable:{type:Boolean,default:!1},editable:{type:Boolean,default:!1},tabPosition:{default:"top"},stretch:{type:Boolean,default:!1},beforeLeave:{}},emits:["update:modelValue","tab-click","tab-change","tab-remove","tab-add","edit"],setup(t,{emit:l}){const n=l,o=u=>{n("update:modelValue",u)},a=(u,d)=>{n("tab-click",u,d)},i=u=>{n("tab-change",u)},r=u=>{n("tab-remove",u)},c=()=>{n("tab-add")},g=(u,d)=>{n("edit",u,d)};return(u,d)=>{const s=e.resolveComponent("el-tabs");return e.openBlock(),e.createBlock(s,e.mergeProps(u.$attrs,{"model-value":t.modelValue,type:t.type,closable:t.closable,addable:t.addable,editable:t.editable,"tab-position":t.tabPosition,stretch:t.stretch,"before-leave":t.beforeLeave,"onUpdate:modelValue":o,onTabClick:a,onTabChange:i,onTabRemove:r,onTabAdd:c,onEdit:g}),{default:e.withCtx(()=>[e.renderSlot(u.$slots,"default")]),_:3},16,["model-value","type","closable","addable","editable","tab-position","stretch","before-leave"])}}})),cn=K(e.defineComponent({name:"JCollapse",__name:"collapse",props:{modelValue:{default:()=>[]},accordion:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=l,o=i=>{n("update:modelValue",i)},a=i=>{n("change",i)};return(i,r)=>{const c=e.resolveComponent("el-collapse");return e.openBlock(),e.createBlock(c,e.mergeProps(i.$attrs,{"model-value":t.modelValue,accordion:t.accordion,onChange:a,"onUpdate:modelValue":o}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["model-value","accordion"])}}})),Ei={class:"j-editor"},dn=K(xo(e.defineComponent({name:"JEditor",__name:"editor",props:{value:{type:String,default:""},height:{type:[String,Number],default:300},options:{type:Object,default:()=>({})},placeholder:{type:String,default:void 0},readonly:{type:Boolean,default:!1},isUploadImg:{type:Boolean,default:!0},token:{type:String,default:""},apiUrl:{type:String,default:""}},emits:["update:value","change"],setup(t,{emit:l}){const n=t,o=l,a=e.ref(),i=e.ref(),r=e.shallowRef(),c=e.computed(()=>({height:typeof n.height=="number"?`${n.height}px`:n.height,overflowY:"hidden"}));let g=!1;const u=s=>{if(!s)return"";let m=s;return n.apiUrl&&n.token&&(m=m.replace(/{learun_img_api}/g,`${n.apiUrl}/system/annexesfile/`).replace(/{learun_img_token}/g,`token=${n.token}`)),m},d=s=>{if(!s)return"";let m=s;if(n.apiUrl){const h=`${n.apiUrl}/system/annexesfile/`;m=m.split(h).join("{learun_img_api}"),n.token&&(m=m.split(`token=${n.token}`).join("{learun_img_token}"))}return m};return e.onMounted(()=>{const s={placeholder:n.placeholder||"请输入内容...",readOnly:n.readonly,MENU_CONF:{},...n.options};s.onChange=h=>{if(g)return;const f=h.getHtml(),p=d(f);o("update:value",p),o("change",{value:p})};const m=$t.createEditor({selector:a.value,html:u(n.value),config:s,mode:"default"});r.value=m,$t.createToolbar({editor:m,selector:i.value,mode:"default"})}),e.watch(()=>n.value,s=>{const m=r.value;if(m){const h=m.getHtml(),f=u(s);d(h)!==s&&(g=!0,m.setHtml(f),g=!1)}}),e.watch(()=>n.readonly,s=>{const m=r.value;m&&(s?m.disable():m.enable())}),e.onBeforeUnmount(()=>{const s=r.value;s?.destroy()}),(s,m)=>(e.openBlock(),e.createElementBlock("div",Ei,[e.createElementVNode("div",{ref_key:"toolbarRef",ref:i,class:"j-editor-toolbar"},null,512),e.createElementVNode("div",{ref_key:"editorRef",ref:a,class:"j-editor-content",style:e.normalizeStyle(c.value)},null,4)]))}}),[["__scopeId","data-v-60cd5d0b"]])),Ti={key:0,class:"j-map-loading"},zi=K(e.defineComponent({name:"JMap",__name:"map",props:{address:String,lng:Number,lat:Number,height:{type:String,default:"300px"},mapKey:{type:String,default:""}},emits:["update:address","update:lng","update:lat","change"],setup(t,{expose:l,emit:n}){const o=t,a=n,i=e.ref(!0),r=e.ref();let c=null,g=null,u=null,d=null;const s=async()=>{i.value=!0;try{c=await Zt(o.mapKey)}catch(k){console.error("Failed to load Baidu Map:",k),i.value=!1;return}if(g!=null){h(o.lng,o.lat),i.value=!1;return}if(!r.value)return;g=new c.Map(r.value,{enableMapClick:!1});const C=new c.Point(121.480248,31.236276);g.centerAndZoom(C,17),u=new c.Marker(C,{enableDragging:!0}),g.addOverlay(u),u.addEventListener("dragend",k=>{m(k.point)}),g.addControl(new c.NavigationControl({anchor:window.BMAP_ANCHOR_TOP_RIGHT,type:window.BMAP_NAVIGATION_CONTROL_SMALL})),d=new c.GeolocationControl({anchor:window.BMAP_ANCHOR_BOTTOM_LEFT}),d.addEventListener("locationSuccess",k=>{m(k.point)}),d.addEventListener("locationError",k=>{alert(k.message)}),g.addControl(d),g.addEventListener("click",k=>{m(k.point)}),g.enableScrollWheelZoom(!0),h(o.lng,o.lat),i.value=!1},m=C=>{new c.Geocoder().getLocation(C,b=>{u.setPosition(C),g.panTo(C),a("update:address",b.address),a("update:lng",C.lng),a("update:lat",C.lat),a("change",{value:{address:b.address,lng:C.lng,lat:C.lat}})})},h=(C,k)=>{if(C&&k&&c){const b=new c.Point(C,k);u&&u.setPosition(b),g&&g.panTo(b)}};let f=null;return l({setPoint:h,querySearchAsync:(C,k)=>{!g||!c||(f||(f=new c.LocalSearch(g,{onSearchComplete:b=>{const S=[];if(b){const V=b.getCurrentNumPois();for(let j=0;j<V;j++)S.push(b.getPoi(j))}k(S)}})),f.search(C))}}),e.onMounted(()=>{s()}),(C,k)=>(e.openBlock(),e.createElementBlock("div",{class:"j-map",style:e.normalizeStyle({height:t.height})},[i.value?(e.openBlock(),e.createElementBlock("div",Ti,[e.createVNode(Ie,{icon:"mdi:loading",class:"is-loading",size:30})])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"j-map-container",ref_key:"mapRef",ref:r},null,512)],4))}})),Mi=[zt,eo,to,oo,no,lo,ao,io,so,ro,co,po,ho,go,yo,bo,Co,ko,wo,Bo,Vo,jo,No,Io,vo,$o,Eo,To,zo,Mo,Fo,Lo,Do,Xo,Qo,Zo,en,tn,on,nn,Ao,_o,Go,ln,an,sn,rn,cn,dn,zi],Fi={install:t=>{Mi.forEach(l=>{t.component(l.name,l)})}};N.EncryptionFactory=Xt,N.HashingFactory=Kn,N.JAutoComplete=ro,N.JBarcode=No,N.JButton=zt,N.JButtonSelect=Xo,N.JButtons=eo,N.JCascaderSelect=ao,N.JCheckbox=io,N.JCodeMirror=Io,N.JCollapse=cn,N.JComp=Zo,N.JCount=vo,N.JCountUp=$o,N.JDataPanel=Eo,N.JDialog=ho,N.JDialogFull=go,N.JDivider=To,N.JDrawer=yo,N.JDynamicLayer=Co,N.JEcharts=jo,N.JEditor=dn,N.JForm=en,N.JFormItem=tn,N.JGuid=nn,N.JHpanel=zo,N.JIcon=oo,N.JInput=to,N.JInputButton=Mo,N.JInputCode=Fo,N.JInputColor=Lo,N.JInputRows=ln,N.JInputTag=ko,N.JLayer=bo,N.JLayerForm=an,N.JLayout=co,N.JMenu=_o,N.JNumber=so,N.JPage=on,N.JRadio=no,N.JRate=wo,N.JSelect=lo,N.JSlider=Bo,N.JSliderCaptcha=Ao,N.JSwitch=sn,N.JTable=po,N.JTablePanel=Go,N.JTabs=rn,N.JTitle=Do,N.JTree=Qo,N.JUpload=Vo,N.buildShortUUID=at,N.buildUUID=Qe,N.clearJson=Xe,N.clone=lt,N.deepClone=De,N.default=Fi,N.formatToDate=tt,N.formatToDateTime=qt,N.fullScreenLoading=Re,N.getCompConfig=Ae,N.getCompType=kt,N.getFunction=bt,N.getIsInputComp=it,N.getIsTableInputComp=Wt,N.getLabel=Ht,N.getObjType=Mt,N.getTextWidth=et,N.is=Tt,N.isArray=nt,N.isNullOrEmpty=Me,N.isObject=Ln,N.loadBMap=Zt,N.lowerFirst=Rn,N.myAesDecrypt=Gn,N.numberToChinese=Lt,N.numberToThousandSeparator=Dt,N.pagination=An,N.paginationEx=Pn,N.set=Ft,N.setGroupMap=At,N.toArray=Ot,N.toDecimal=Ze,N.toLeafArray=Ut,N.toSimpleTree=Un,N.toTree=Jn,N.uniqueArray=On,N.upFirst=It,N.useSortable=Qt,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
16
+ getCompValue)=>{ return ${E} }`;let B;const _=Vo(E);if(_.res)try{B=_.fn(i,a,l,r,s,d,c,f,u,p,h,m,g,b,w)}catch(T){console.log(T,"计算组件公式运行错误")}else return console.log(_.msg),"";return Number.isNaN(B)?"":(o.decimal!==void 0&&(B=B.toFixed(o.decimal)),B)}),S=n.computed(()=>{let y=C.value;return o.thousandSeparator&&(y=Oi(y)),o.isChinese&&(y=Ai(y)),y});return n.watch(C,y=>{k("update:modelValue",y),k("change",{value:y,data:S.value})}),(y,E)=>{const B=n.resolveComponent("el-input");return n.openBlock(),n.createBlock(B,{modelValue:S.value,"onUpdate:modelValue":E[0]||(E[0]=_=>S.value=_),readonly:"",size:e.size},null,8,["modelValue","size"])}}})),hd={key:0},Ta=te(n.defineComponent({name:"JCountUp",__name:"count-up",props:{animation:{type:Boolean,default:!0},startValue:{default:0},endValue:{},decimals:{default:0},duration:{default:2},options:{default:()=>({})},callback:{type:Function,default:void 0}},setup(e,{expose:t}){const o=e,i=n.computed(()=>({...o})),a=n.ref(),l=n.ref(null),r=n.computed(()=>o.options);n.onMounted(()=>{o.animation&&s()}),n.watch(()=>o.decimals,()=>{l.value&&l.value.update&&(l.value.options.decimalPlaces=o.decimals,l.value.reset(),l.value.update(o.endValue))},{deep:!0}),n.watch(()=>o.endValue,p=>{l.value&&l.value.update&&l.value.update(p)});const s=()=>{l.value||(r.value.startVal=o.startValue,r.value.decimalPlaces=o.decimals,r.value.duration=o.duration,l.value=new Vs.CountUp(a.value,Number(o.endValue),r.value),l.value.start(()=>{o.callback?.(l.value)}))};return n.onUnmounted(()=>{l.value=null}),n.onBeforeUnmount(()=>{l.value=null}),t({myProps:i,el:a,init:s,start:p=>{l.value&&l.value.start&&l.value.start(()=>{p?.(l.value)})},pauseResume:()=>{l.value&&l.value.pauseResume&&l.value.pauseResume()},reset:()=>{l.value&&l.value.reset&&l.value.reset()},update:p=>{l.value&&l.value.update&&l.value.update(p)}}),(p,h)=>(n.openBlock(),n.createElementBlock("span",{ref_key:"el",ref:a},[e.animation?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("span",hd,n.toDisplayString(e.endValue),1))],512))}})),md={class:"j-block j-data-panel"},gd={key:0,class:"j-data-panel-header"},yd={style:{color:"var(--j-color-text)","font-size":"14px","font-weight":"bold"}},bd={class:"j-data-panel-header-right"},wd={class:"j-data-panel-body"},Na=te(n.defineComponent({name:"JDataPanel",__name:"data-panel",props:{title:{default:void 0}},setup(e){return(t,o)=>(n.openBlock(),n.createElementBlock("div",md,[e.title?(n.openBlock(),n.createElementBlock("div",gd,[n.createElementVNode("div",yd,n.toDisplayString(e.title),1),n.createElementVNode("div",bd,[n.renderSlot(t.$slots,"titleRight")])])):n.createCommentVNode("",!0),n.createElementVNode("div",wd,[n.renderSlot(t.$slots,"default")])]))}})),vd={class:"j-divider-content"},$a=te(n.defineComponent({name:"JDivider",__name:"divider",props:{content:{},borderStyle:{default:"solid"},size:{},color:{},contentPosition:{default:"center"}},setup(e){const t=e,o=n.computed(()=>{const a={color:t.color};return t.size&&Number(t.size)&&(a.fontSize=`${t.size}px`),a}),i=n.computed(()=>({borderTopStyle:t.borderStyle}));return(a,l)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(`j-divider-container j-divider-${e.contentPosition}`),style:n.normalizeStyle(o.value)},[n.createElementVNode("div",{class:"j-divider-line j-divider-line-left",style:n.normalizeStyle(i.value)},null,4),n.createElementVNode("div",vd,[n.createElementVNode("span",null,n.toDisplayString(e.content||""),1)]),n.createElementVNode("div",{class:"j-divider-line j-divider-line-right",style:n.normalizeStyle(i.value)},null,4)],6))}})),Cd={class:"j-hpanel"},kd={class:"j-hpanel-main"},Ma=te(n.defineComponent({name:"JHpanel",__name:"hpanel",setup(e){return(t,o)=>(n.openBlock(),n.createElementBlock("div",Cd,[n.renderSlot(t.$slots,"left"),n.createElementVNode("div",kd,[n.renderSlot(t.$slots,"default")]),n.renderSlot(t.$slots,"right")]))}})),La=te(n.defineComponent({name:"JInputButton",__name:"input-button",props:{modelValue:{},type:{},layerType:{},btnText:{default:"设置"},title:{},size:{default:"default"},width:{default:1e3},height:{default:600},destroyOnClose:{type:Boolean,default:!1},open:{},ok:{},beforeClose:{},closed:{}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,a=n.ref(),l=n.ref(),r=async(f,u)=>{o.ok&&(f("保存数据中..."),l.value=await o.ok(),i("update:modelValue",l.value),i("change",{value:l.value}),u(),a.value.close())},s=()=>o.beforeClose?o.beforeClose(l.value):!0,d=()=>{o.closed?.()},c=()=>{a.value.open(o.title||o.btnText,o.layerType),setTimeout(()=>{o.open?.(l.value)},200)};return n.watch(()=>o.modelValue,f=>{l.value=f},{immediate:!0}),(f,u)=>{const p=n.resolveComponent("j-button"),h=n.resolveComponent("j-layer");return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(p,n.mergeProps({style:{width:"auto"}},f.$attrs,{type:e.type,label:e.btnText,size:e.size,onClick:c}),null,16,["type","label","size"]),n.createVNode(h,{ref_key:"layerRef",ref:a,height:e.height,width:e.width,"destroy-on-close":e.destroyOnClose,"btn-text":"确定","before-close":s,onOk:r,onClosed:d},{default:n.withCtx(()=>[n.renderSlot(f.$slots,"default")]),_:3},8,["height","width","destroy-on-close"])],64)}}})),Pa=te(n.defineComponent({name:"JInputCode",__name:"input-code",props:{modelValue:{},type:{},mode:{default:"application/json"},btnText:{default:"设置脚本"},title:{},size:{},width:{default:1200},height:{default:600},example:{default:""},beforeClose:{},isHint:{type:Boolean,default:!1},handleHint:{}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,a=n.computed({get:()=>o.modelValue,set:u=>{i("update:modelValue",u)}}),l=n.ref(""),r=u=>{l.value=u},s=()=>l.value,d=u=>o.beforeClose?o.beforeClose(u):!0,c=u=>{i("change",u)},f=n.computed(()=>o.modelValue&&o.modelValue.trim()?`${o.btnText}(已设置)`:o.btnText);return(u,p)=>{const h=n.resolveComponent("j-code-mirror"),m=n.resolveComponent("j-layout"),g=n.resolveComponent("j-input-button");return n.openBlock(),n.createBlock(g,{modelValue:a.value,"onUpdate:modelValue":p[1]||(p[1]=b=>a.value=b),type:e.type,"btn-text":f.value,title:e.title,size:e.size,width:e.width,height:e.height,"before-close":d,ok:s,open:r,onChange:c},{default:n.withCtx(()=>[n.createVNode(m,{"right-move":!1,right:560},n.createSlots({default:n.withCtx(()=>[n.createVNode(h,{value:l.value,"onUpdate:value":p[0]||(p[0]=b=>l.value=b),mode:e.mode,"is-hint":e.isHint,"handle-hint":e.handleHint},null,8,["value","mode","is-hint","handle-hint"])]),_:2},[e.example?{name:"right",fn:n.withCtx(()=>[n.createVNode(h,{value:e.example,mode:e.mode,"read-only":""},null,8,["value","mode"])]),key:"0"}:void 0]),1024)]),_:1},8,["modelValue","type","btn-text","title","size","width","height"])}}})),Ra=te(n.defineComponent({name:"JInputColor",__name:"input-color",props:{modelValue:{},placeholder:{default:"请选择颜色"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"default"},clearable:{type:Boolean,default:!0},onlyButton:{type:Boolean,default:!1},inputType:{default:"append"},showAlpha:{type:Boolean,default:!0},predefineColors:{default:()=>["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","rgba(255, 69, 0, 0.68)","rgb(255, 120, 0)","hsv(51, 100, 98)","hsva(120, 40, 94, 0.5)","hsl(181, 100%, 37%)","hsla(209, 100%, 56%, 0.73)","#c7158577"]},colorFormat:{default:"hex"},name:{},autofocus:{type:Boolean},tabindex:{},validateEvent:{type:Boolean,default:!0},inputStyle:{default:()=>({})}},emits:["update:modelValue","input","focus","blur","clear","change","color-change","active-change"],setup(e,{expose:t,emit:o}){const i=e,a=o,l=n.ref(),r=n.ref(),s=n.computed({get(){return i.modelValue===null||i.modelValue===void 0?r.value:i.modelValue},set(g){r.value=g,a("update:modelValue",g),a("input",g)}}),d=g=>{a("input",g)},c=g=>{a("focus",g)},f=g=>{a("blur",g)},u=()=>{a("clear"),a("update:modelValue","")},p=g=>{a("change",g)},h=g=>{a("color-change",g)},m=g=>{a("active-change",g)};return t({focus:()=>{l.value?.focus()},blur:()=>{l.value?.blur()},select:()=>{l.value?.select()}}),(g,b)=>{const k=n.resolveComponent("el-color-picker"),v=n.resolveComponent("el-input");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-input-color",{"j-input-color-only-button":e.onlyButton},{"j-input-color-disabled":e.disabled}])},[n.createVNode(v,n.mergeProps({placeholder:e.placeholder,modelValue:s.value,"onUpdate:modelValue":b[1]||(b[1]=w=>s.value=w),size:e.size,ref_key:"inputRef",ref:l,readonly:e.readonly||e.onlyButton,clearable:e.readonly||e.onlyButton?!1:e.clearable,disabled:e.disabled,name:e.name,autofocus:e.autofocus,tabindex:e.tabindex,"validate-event":e.validateEvent,"input-style":e.inputStyle},g.$attrs,{onInput:d,onFocus:c,onBlur:f,onClear:u,onChange:p}),{[e.inputType]:n.withCtx(()=>[n.createVNode(k,{size:e.size,modelValue:s.value,"onUpdate:modelValue":b[0]||(b[0]=w=>s.value=w),disabled:e.disabled||e.readonly,"show-alpha":e.showAlpha,predefine:e.predefineColors,"color-format":e.colorFormat,onChange:h,onActiveChange:m},null,8,["size","modelValue","disabled","show-alpha","predefine","color-format"])]),_:2},1040,["placeholder","modelValue","size","readonly","clearable","disabled","name","autofocus","tabindex","validate-event","input-style"])],2)}}})),Aa=te(n.defineComponent({name:"JTitle",__name:"title",props:{title:{default:""},style:{default:void 0},class:{default:void 0},color:{default:void 0},size:{default:void 0},weight:{default:"normal"}},setup(e){const t=e,o=n.computed(()=>t.class||""),i=n.computed(()=>{const a={...t.style};return t.color&&(a.color=t.color),t.size&&(typeof t.size=="number"?a.fontSize=`${t.size}px`:a.fontSize=t.size),t.weight&&(a.fontWeight=t.weight),a});return(a,l)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-title",o.value]),style:n.normalizeStyle(i.value)},n.toDisplayString(e.title),7))}})),Oa=te(n.defineComponent({name:"JCodeMirror",__name:"code-mirror",props:{value:{default:""},mode:{default:"javascript"},readonly:{type:Boolean,default:!1},height:{default:void 0},isHint:{type:Boolean,default:!1},handleHint:{type:Function,default:void 0},isScrollToBottom:{type:Boolean,default:!1}},emits:["update:value","change"],setup(e,{expose:t,emit:o}){const i=e,a=o,l=n.ref(),r=n.ref("");let s=null;const d=g=>{switch(g){case"application/javascript":case"javascript":case"text/javascript":return zt.javascript();case"css":case"text/css":return $s.css();case"html":case"text/html":return Ms.html();case"json":case"application/json":return Ls.json();case"sql":case"text/x-sql":return Ps.sql();case"xml":case"text/xml":return Rs.xml();case"python":case"text/x-python":return As.python();case"markdown":case"text/markdown":return Os.markdown();case"java":case"text/x-java":return Fs.java();case"vue":case"text/x-vue":return zt.javascript({jsx:!0,typescript:!1});case"typescript":case"application/typescript":return zt.javascript({jsx:!1,typescript:!0});case"jsx":return zt.javascript({jsx:!0,typescript:!1});case"tsx":return zt.javascript({jsx:!0,typescript:!0});default:return zt.javascript()}},c=()=>{const g=[Ns.basicSetup,Ze.lineNumbers(),Ze.highlightActiveLineGutter(),Ze.highlightSpecialChars(),Eo.history(),Ze.drawSelection(),Ze.dropCursor(),Dt.indentOnInput(),Dt.bracketMatching(),Bo.closeBrackets(),Ze.rectangularSelection(),Dt.foldGutter(),Ze.keymap.of([...Bo.closeBracketsKeymap,...Eo.defaultKeymap,...Eo.historyKeymap,...Dt.foldKeymap]),Dt.syntaxHighlighting(Dt.defaultHighlightStyle)];return g.push(d(i.mode)),i.readonly&&g.push(So.EditorState.readOnly.of(!0)),i.isHint&&i.handleHint&&g.push(Bo.autocompletion({override:[b=>{const k=b.matchBefore(/\w*/);if(!k||k.from===k.to)return null;const v=i.handleHint(k.text);return v.length===0?null:{from:k.from,options:v.map(w=>({label:typeof w=="string"?w:w.label||w.name||"",detail:typeof w=="string"?"":w.detail||"",type:typeof w=="string"?"variable":w.type||"variable",apply:typeof w=="string"?w:w.apply||w.name||w.label||""}))}}]})),g.push(Ze.EditorView.updateListener.of(b=>{if(b.docChanged){const k=b.state.doc.toString();r.value=k,a("update:value",k),a("change",{value:k})}})),g},f=async()=>{if(!l.value)return;const g=So.EditorState.create({doc:i.value,extensions:c()});s=new Ze.EditorView({state:g,parent:l.value}),r.value=i.value},u=()=>{if(!s)return;const g=s.state.doc.toString();s&&s.destroy();const b=So.EditorState.create({doc:g,extensions:c()});l.value&&(s=new Ze.EditorView({state:b,parent:l.value}));const k=s.state.doc.toString();k!==i.value&&s.dispatch({changes:{from:0,to:k.length,insert:i.value}})},p=()=>{if(!s)return;const g=s.state.doc.length;s.dispatch({selection:{anchor:g,head:g},scrollIntoView:!0}),setTimeout(()=>{if(s){const b=s.state.doc.length;s.dispatch({selection:{anchor:b,head:b},scrollIntoView:!0})}},100)},h=()=>{let g=Ts.format(i.value);g=g.replace(/{ JCODE_SASSID }/g,"{JCODE_SASSID}").replace(/{ JCODE_SASSID_NOTT }/g,"{JCODE_SASSID_NOTT}").replace(/{ JCODE_SASSID_NOTA }/g,"{JCODE_SASSID_NOTA}").replace(/@ /g,"@"),a("update:value",g),a("change",{value:g})};let m=null;return n.watch(()=>i.value,g=>{g!==r.value&&(r.value=g,s&&u(),setTimeout(()=>{s&&i.isScrollToBottom&&p()}))}),n.watch(()=>i.mode,()=>{s&&u()}),n.onMounted(async()=>{await n.nextTick(),await f(),typeof window<"u"&&window.ResizeObserver&&l.value&&(m=new ResizeObserver(()=>{s&&s.dispatch({scrollIntoView:!0})}),m.observe(l.value))}),n.onUnmounted(()=>{m&&l.value&&(m.unobserve(l.value),m.disconnect(),m=null),s&&(s.destroy(),s=null)}),t({sqlFormatter:h}),(g,b)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"codeWraperRef",ref:l,class:"j-code-mirror",style:n.normalizeStyle({height:e.height?`${e.height}px`:""})},null,4))}})),xd=n.defineComponent({__name:"slider-captcha-action",props:{actionStyle:{},isPassing:{type:Boolean},toLeft:{type:Boolean}},setup(e,{expose:t}){const o=e,i=n.useTemplateRef("actionRef"),a=n.ref("0"),l=n.computed(()=>{const{actionStyle:s,toLeft:d}=o;return{...s,left:d?"0":a.value,backgroundColor:"var(--j-color-bg-container)",borderRadius:r.value?"6px":void 0,transition:d?"all 300ms cubic-bezier(0.4, 0, 0.2, 1)":void 0}}),r=n.computed(()=>Number.parseInt(a.value)>10&&!o.isPassing);return t({getEl:()=>i.value,getStyle:()=>i?.value?.style,setLeft:s=>{a.value=s}}),(s,d)=>{const c=n.resolveComponent("j-icon");return n.openBlock(),n.createElementBlock("div",{ref_key:"actionRef",ref:i,style:n.normalizeStyle(l.value),class:"j-slider-captcha-action",name:"captcha-action"},[e.isPassing?(n.openBlock(),n.createBlock(c,{key:0,color:"var(--j-color-text-2)",class:"nav-checked",icon:"mdi:check-circle-outline"})):(n.openBlock(),n.createBlock(c,{key:1,color:"var(--j-color-text-2)",class:"nav-checked",icon:"mdi:chevron-double-right"}))],4)}}}),Sd=n.defineComponent({__name:"slider-captcha-bar",props:{barStyle:{},toLeft:{type:Boolean}},setup(e,{expose:t}){const o=e,i=n.useTemplateRef("barRef"),a=n.ref("0"),l=n.computed(()=>{const{barStyle:r,toLeft:s}=o;return{...r,width:s?"0":a.value,transition:s?"width 300ms cubic-bezier(0.4, 0, 0.2, 1)":void 0,backgroundColor:"var(--j-color-success)",position:"absolute",height:"100%"}});return t({getEl:()=>i.value,setWidth:r=>{a.value=r}}),(r,s)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"barRef",ref:i,style:n.normalizeStyle(l.value)},null,4))}}),Bd=n.defineComponent({__name:"slider-captcha-content",props:{contentStyle:{type:Object,default:()=>({})},isPassing:{type:Boolean,default:!1},animationDuration:{type:[String,Number],default:2},animationIterationCount:{type:[String,Number],default:"infinite"}},setup(e,{expose:t}){const o=e,i=n.useTemplateRef("contentRef"),a=n.computed(()=>{const{contentStyle:r}=o;return{...r,fontSize:"12px"}});t({getEl:()=>i.value});const l=n.computed(()=>({animation:`shine ${o.animationDuration}s linear ${o.animationIterationCount}`}));return(r,s)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"contentRef",ref:i,class:n.normalizeClass([{success:e.isPassing},"j-slider-captcha-content"]),style:n.normalizeStyle(a.value)},[n.createElementVNode("div",{style:n.normalizeStyle(l.value),class:"j-spine-text"},n.toDisplayString(e.isPassing?"验证成功":"请按住滑块拖动"),5)],6))}}),Fa=te(n.defineComponent({name:"JSliderCaptcha",__name:"slider-captcha",props:n.mergeModels({class:{},actionStyle:{default:()=>({})},barStyle:{default:()=>({})},contentStyle:{default:()=>({})},wrapperStyle:{default:()=>({})},successText:{default:""},text:{default:""}},{modelValue:{type:Boolean,default:void 0},modelModifiers:{}}),emits:n.mergeModels(["end","move","start","success"],["update:modelValue"]),setup(e,{emit:t}){const o=e,i=t,a=n.useModel(e,"modelValue"),l=n.reactive({endTime:0,isMoving:!1,isPassing:!1,moveDistance:0,startTime:0,toLeft:!1}),r=n.useTemplateRef("wrapperRef"),s=n.useTemplateRef("barRef"),d=n.useTemplateRef("contentRef"),c=n.useTemplateRef("actionRef");n.watch(()=>l.isPassing,k=>{if(k){const{endTime:v,startTime:w}=l,C=(v-w)/1e3;i("success",{isPassing:k,time:C.toFixed(1)}),a.value=k}}),n.watchEffect(()=>{l.isPassing=!!a.value});function f(k){return"pageX"in k?k.pageX:"touches"in k&&k.touches[0]?k.touches[0].pageX:0}function u(k){l.isPassing||c.value&&(i("start",k),l.moveDistance=f(k)-Number.parseInt(c.value.getStyle().left.replace("px","")||"0",10),l.startTime=Date.now(),l.isMoving=!0)}function p(k){const v=r.value?.offsetWidth??220,w=k?.offsetWidth??40,C=v-w-6;return{actionWidth:w,offset:C,wrapperWidth:v}}function h(k){const{isMoving:v,moveDistance:w}=l;if(v){const C=n.unref(c),S=n.unref(s);if(!C||!S)return;const{actionWidth:y,offset:E,wrapperWidth:B}=p(C.getEl()),_=f(k)-w;i("move",{event:k,moveDistance:w,moveX:_}),_>0&&_<=E?(C.setLeft(`${_}px`),S.setWidth(`${_+y/2}px`)):_>E&&(C.setLeft(`${B-y}px`),S.setWidth(`${B-y/2}px`),g())}}function m(k){const{isMoving:v,isPassing:w,moveDistance:C}=l;if(v&&!w){i("end",k);const S=c.value,y=n.unref(s);if(!S||!y)return;const E=f(k)-C,{actionWidth:B,offset:_,wrapperWidth:T}=p(S.getEl());E<_?b():(S.setLeft(`${T-B}px`),y.setWidth(`${T-B/2}px`),g()),l.isMoving=!1}}function g(){l.endTime=Date.now(),l.isPassing=!0,l.isMoving=!1}function b(){l.isMoving=!1,l.isPassing=!1,l.moveDistance=0,l.toLeft=!1,l.startTime=0,l.endTime=0;const k=n.unref(c),v=n.unref(s),w=n.unref(d);!k||!v||!w||(w.getEl().style.width="100%",l.toLeft=!0,setTimeout(()=>{l.toLeft=!1,k.setLeft("0"),v.setWidth("0")},300))}return(k,v)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"wrapperRef",ref:r,class:n.normalizeClass(["j-slider-captcha slider-border",o.class]),style:n.normalizeStyle([{"background-color":"var(--j-color-bg)"},e.wrapperStyle]),onMouseleave:m,onMousemove:h,onMouseup:m,onTouchend:m,onTouchmove:h},[n.createVNode(Sd,{ref_key:"barRef",ref:s,"bar-style":e.barStyle,"to-left":l.toLeft},null,8,["bar-style","to-left"]),n.createVNode(Bd,{ref_key:"contentRef",ref:d,"content-style":e.contentStyle,"is-passing":l.isPassing},null,8,["content-style","is-passing"]),n.createVNode(xd,{ref_key:"actionRef",ref:c,"action-style":e.actionStyle,"is-passing":l.isPassing,"to-left":l.toLeft,onMousedown:u,onTouchstart:u},null,8,["action-style","is-passing","to-left"])],38))}}));function Ed(e,t){return n.getCurrentScope()?(n.onScopeDispose(e,t),!0):!1}const _d=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function jd(e){return Array.isArray(e)?e:[e]}function Vd(e){return n.getCurrentInstance()}function Td(e,t=!0,o){Vd()?n.onMounted(e,o):t?e():n.nextTick(e)}const Ia=_d?window:void 0;function Xt(e){var t;const o=n.toValue(e);return(t=o?.$el)!==null&&t!==void 0?t:o}function Nd(){const e=n.shallowRef(!1),t=n.getCurrentInstance();return t&&n.onMounted(()=>{e.value=!0},t),e}function $d(e){const t=Nd();return n.computed(()=>(t.value,!!e()))}function Md(e,t,o={}){const{window:i=Ia,...a}=o;let l;const r=$d(()=>i&&"ResizeObserver"in i),s=()=>{l&&(l.disconnect(),l=void 0)},d=n.watch(n.computed(()=>{const f=n.toValue(e);return Array.isArray(f)?f.map(u=>Xt(u)):[Xt(f)]}),f=>{if(s(),r.value&&i){l=new ResizeObserver(t);for(const u of f)u&&l.observe(u,a)}},{immediate:!0,flush:"post"}),c=()=>{s(),d()};return Ed(c),{isSupported:r,stop:c}}function Ld(e,t={width:0,height:0},o={}){const{window:i=Ia,box:a="content-box"}=o,l=n.computed(()=>{var u;return(u=Xt(e))===null||u===void 0||(u=u.namespaceURI)===null||u===void 0?void 0:u.includes("svg")}),r=n.shallowRef(t.width),s=n.shallowRef(t.height),{stop:d}=Md(e,([u])=>{const p=a==="border-box"?u.borderBoxSize:a==="content-box"?u.contentBoxSize:u.devicePixelContentBoxSize;if(i&&l.value){const h=Xt(e);if(h){const m=h.getBoundingClientRect();r.value=m.width,s.value=m.height}}else if(p){const h=jd(p);r.value=h.reduce((m,{inlineSize:g})=>m+g,0),s.value=h.reduce((m,{blockSize:g})=>m+g,0)}else r.value=u.contentRect.width,s.value=u.contentRect.height},o);Td(()=>{const u=Xt(e);u&&(r.value="offsetWidth"in u?u.offsetWidth:t.width,s.value="offsetHeight"in u?u.offsetHeight:t.height)});const c=n.watch(()=>Xt(e),u=>{r.value=u?t.width:0,s.value=u?t.height:0});function f(){d(),c()}return{width:r,height:s,stop:f}}function Lo(e,t){const{containerStyle:o,wrapperProps:i,scrollTo:a,calculateRange:l,currentList:r,containerRef:s}="itemHeight"in t?Ad(t,e):Rd(t,e);return{list:r,scrollTo:a,containerProps:{ref:s,onScroll:()=>{l()},style:o},wrapperProps:i}}function za(e){const t=n.shallowRef(null),o=Ld(t),i=n.ref([]),a=n.shallowRef(e);return{state:n.ref({start:0,end:10}),source:a,currentList:i,size:o,containerRef:t}}function Da(e,t,o){return i=>{if(typeof o=="number")return Math.ceil(i/o);const{start:a=0}=e.value;let l=0,r=0;for(let s=a;s<t.value.length;s++){const d=o(s);if(l+=d,r=s,l>i)break}return r-a}}function Ha(e,t){return o=>{if(typeof t=="number")return Math.floor(o/t)+1;let i=0,a=0;for(let l=0;l<e.value.length;l++){const r=t(l);if(i+=r,i>=o){a=l;break}}return a+1}}function Wa(e,t,o,i,{containerRef:a,state:l,currentList:r,source:s}){return()=>{const d=a.value;if(d){const c=o(e==="vertical"?d.scrollTop:d.scrollLeft),f=i(e==="vertical"?d.clientHeight:d.clientWidth),u=c-t,p=c+f+t;l.value={start:u<0?0:u,end:p>s.value.length?s.value.length:p},r.value=s.value.slice(l.value.start,l.value.end).map((h,m)=>({data:h,index:m+l.value.start}))}}}function Ua(e,t){return o=>typeof e=="number"?o*e:t.value.slice(0,o).reduce((i,a,l)=>i+e(l),0)}function Ja(e,t,o,i){n.watch([e.width,e.height,()=>n.toValue(t),o],()=>{i()})}function Ya(e,t){return n.computed(()=>typeof e=="number"?t.value.length*e:t.value.reduce((o,i,a)=>o+e(a),0))}const Pd={horizontal:"scrollLeft",vertical:"scrollTop"};function qa(e,t,o,i){return a=>{i.value&&(i.value[Pd[e]]=o(a),t())}}function Rd(e,t){const o=za(t),{state:i,source:a,currentList:l,size:r,containerRef:s}=o,d={overflowX:"auto"},{itemWidth:c,overscan:f=5}=e,u=Da(i,a,c),p=Wa("horizontal",f,Ha(a,c),u,o),h=Ua(c,a),m=n.computed(()=>h(i.value.start)),g=Ya(c,a);return Ja(r,t,s,p),{scrollTo:qa("horizontal",p,h,s),calculateRange:p,wrapperProps:n.computed(()=>({style:{height:"100%",width:`${g.value-m.value}px`,marginLeft:`${m.value}px`,display:"flex"}})),containerStyle:d,currentList:l,containerRef:s}}function Ad(e,t){const o=za(t),{state:i,source:a,currentList:l,size:r,containerRef:s}=o,d={overflowY:"auto"},{itemHeight:c,overscan:f=5}=e,u=Da(i,a,c),p=Wa("vertical",f,Ha(a,c),u,o),h=Ua(c,a),m=n.computed(()=>h(i.value.start)),g=Ya(c,a);return Ja(r,t,s,p),{calculateRange:p,scrollTo:qa("vertical",p,h,s),containerStyle:d,wrapperProps:n.computed(()=>({style:{width:"100%",height:`${g.value-m.value}px`,marginTop:`${m.value}px`}})),currentList:l,containerRef:s}}const Od=n.defineComponent({name:"JSubMenu",__name:"index",props:{pId:{type:String}},emits:["click"],setup(e,{emit:t}){const o=e,i=t,{getMenuMap:a,toArray:l,activeMenu:r,theme:s}=On(),{getHMoreMenus:d}=gc(),c=n.ref([]);o.pId==="moreId"?c.value=d.value:c.value=l(a()[o.pId||""]||[],[]);const f=m=>{const g=c.value.find(b=>b.active);g?.value!==m.value&&(g&&(g.active=!1),i("click",m))},{list:u,containerProps:p,wrapperProps:h}=Lo(c,{itemHeight:44});return(m,g)=>(n.openBlock(),n.createElementBlock("div",n.mergeProps({class:["j-sub-menu-content",{"j-menu-dark":n.unref(s)==="dark"}],style:{"max-height":"calc(100vh - 80px)","border-radius":"8px"}},n.unref(p)),[n.createElementVNode("div",n.normalizeProps(n.guardReactiveProps(n.unref(h))),[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(u),b=>(n.openBlock(),n.createBlock(In,{key:b.data.value,"parent-actives":n.unref(r)?.pid?.split(".")||[],item:b.data,"is-sub":"",onClick:f},null,8,["parent-actives","item"]))),128))],16)],16))}}),Fd={class:"j-menu-item-label"},Id={class:"j-menu-item-label"},zd={key:1,class:n.normalizeClass(["j-menu-item-arrow","sub"])},Dd={class:"j-menu-item-label"},In=n.defineComponent({name:"JMenuItem",__name:"index",props:{item:{type:Object,default:()=>({})},parentActives:{type:Array,default:()=>[]},collapsed:Boolean,isSub:Boolean,isHorizontal:Boolean,isVertical:Boolean},emits:["click"],setup(e,{emit:t}){const{t:o}=Pe(),i=t,a=l=>{i("click",l)};return(l,r)=>{const s=n.resolveComponent("j-icon"),d=n.resolveComponent("el-tooltip"),c=n.resolveComponent("el-popover");return e.collapsed&&!e.item.hasChildren?(n.openBlock(),n.createBlock(d,{key:0,placement:"right"},{content:n.withCtx(()=>[n.createElementVNode("span",null,n.toDisplayString(n.unref(o)(e.item.label)),1)]),default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["j-menu-item",{collapsed:e.collapsed}]),onClick:r[0]||(r[0]=n.withModifiers(f=>a(e.item),["stop"]))},[n.createElementVNode("div",{class:n.normalizeClass(["j-menu-item-content",{active:e.item.active,"p-active":e.parentActives.includes(e.item.value)}]),style:n.normalizeStyle({"padding-left":`${e.item.indent*24+16}px`})},[e.item.icon?(n.openBlock(),n.createBlock(s,{key:0,icon:e.item.icon,class:"j-menu-item-icon",size:18},null,8,["icon"])):n.createCommentVNode("",!0),n.createElementVNode("div",Fd,n.toDisplayString(n.unref(o)(e.item.label)),1),e.item.hasChildren?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["j-menu-item-arrow",{open:e.item.open}])},null,2)):n.createCommentVNode("",!0)],6)],2)]),_:1})):(e.collapsed||e.isSub||e.isHorizontal||e.isVertical)&&e.item.hasChildren?(n.openBlock(),n.createBlock(c,{key:1,placement:e.isHorizontal?"bottom-start":"right-start","show-arrow":!1,"popper-class":"j-sub-menu"},{reference:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["j-menu-item",{collapsed:e.collapsed}])},[n.createElementVNode("div",{class:n.normalizeClass(["j-menu-item-content",{active:e.item.active,"p-active":e.parentActives.includes(e.item.value)}]),style:n.normalizeStyle({"padding-left":`${e.item.indent*34+16}px`})},[e.item.icon?(n.openBlock(),n.createBlock(s,{key:0,icon:e.item.icon,style:n.normalizeStyle({"margin-right":e.item.label&&(e.isSub||!e.isVertical)?"8px":0,"background-color":e.isVertical?e.item.color:"transparent"}),class:"j-menu-item-icon",size:18},null,8,["icon","style"])):n.createCommentVNode("",!0),n.createElementVNode("div",Id,n.toDisplayString(n.unref(o)(e.item.label)),1),e.item.hasChildren&&!e.isHorizontal&&!e.isVertical?(n.openBlock(),n.createElementBlock("div",zd)):n.createCommentVNode("",!0)],6)],2)]),default:n.withCtx(()=>[n.createVNode(Od,{"p-id":e.item.value,onClick:a},null,8,["p-id"])]),_:1},8,["placement"])):(n.openBlock(),n.createElementBlock("div",{key:2,class:n.normalizeClass(["j-menu-item",{collapsed:e.collapsed,sub:e.item.indent>0}]),onClick:r[1]||(r[1]=n.withModifiers(f=>a(e.item),["stop"]))},[n.createElementVNode("div",{class:n.normalizeClass(["j-menu-item-content",{active:e.item.active,"p-active":e.parentActives.includes(e.item.value)}]),style:n.normalizeStyle({"padding-left":`${e.item.indent*24+16}px`})},[e.item.icon?(n.openBlock(),n.createBlock(s,{key:0,icon:e.item.icon,class:"j-menu-item-icon",style:n.normalizeStyle({"margin-right":e.item.label&&(e.isSub||!e.isVertical)?"8px":0,"background-color":e.isVertical?e.item.color:"transparent"}),size:18},null,8,["icon","style"])):n.createCommentVNode("",!0),n.createElementVNode("div",Dd,n.toDisplayString(n.unref(o)(e.item.label)),1),e.item.hasChildren?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["j-menu-item-arrow",{open:e.item.open}])},null,2)):n.createCommentVNode("",!0)],6)],2))}}}),Hd=n.defineComponent({name:"JIMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]},collapsed:Boolean},emits:["click"],setup(e,{emit:t}){const o=e,i=t,{activeMenu:a,theme:l}=On(),r=u=>{i("click",u)},s=n.computed(()=>o.menuList),{list:d,containerProps:c,wrapperProps:f}=Lo(s,{itemHeight:44});return(u,p)=>(n.openBlock(),n.createElementBlock("div",n.mergeProps({class:["j-menu",{collapsed:e.collapsed,"j-menu-dark":n.unref(l)==="dark"}]},n.unref(c)),[n.createElementVNode("div",n.normalizeProps(n.guardReactiveProps(n.unref(f))),[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(d),h=>(n.openBlock(),n.createBlock(In,{key:h.data.value,"parent-actives":n.unref(a)?.pid?.split(".")||[],item:h.data,collapsed:e.collapsed,class:n.normalizeClass({"menu-item-entering":h.data.entering,"menu-item-leaving":h.data.leaving}),onClick:r},null,8,["parent-actives","item","collapsed","class"]))),128))],16)],16))}}),Wd=n.defineComponent({name:"JHMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]}},emits:["click"],setup(e,{emit:t}){const o=e,i=t,{activeMenu:a,theme:l}=On(),r=n.ref(),s=n.ref(0);let d=null;n.onMounted(()=>{typeof window<"u"&&window.ResizeObserver&&r.value&&(d=new ResizeObserver(()=>{r.value&&(s.value=r.value.offsetWidth)}),d.observe(r.value))});const c=n.computed(()=>{const h=[];let m=0,g=0;const b=o.menuList.length;return o.menuList.forEach(k=>{g++;const v=(fn(k.label)||0)+32+16+4+8;m+=v,(g===b&&m<=s.value||g<b&&m+56<=s.value)&&h.push(k)}),h.length<o.menuList.length&&h.push({value:"moreId",icon:"more-outlined",label:"",hasChildren:!0,indent:0,open:!1,active:!1}),h}),f=n.computed(()=>{const h=[];let m=0;const g=c.value.length;return o.menuList.forEach(b=>{m++,m>=g&&h.push(b)}),h}),u=n.computed(()=>{const h=a.value?.pid?.split(".")||[];return(h.length>1&&f.value.findIndex(m=>m.value===h[1])>-1||f.value.findIndex(m=>m.value===a.value?.value)>-1)&&h.push("moreId"),h}),p=h=>{i("click",h)};return yc({getHMoreMenus:f}),n.onUnmounted(()=>{d&&r.value&&(d.unobserve(r.value),d.disconnect(),d=null)}),(h,m)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"menuRef",ref:r,class:n.normalizeClass(["j-menu-horizontal",{"j-menu-dark":n.unref(l)==="dark"}])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,g=>(n.openBlock(),n.createBlock(In,{key:g.value,"parent-actives":u.value,item:g,"is-horizontal":"",onClick:p},null,8,["parent-actives","item"]))),128))],2))}}),Ud=n.defineComponent({name:"JVMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]}},emits:["click"],setup(e,{emit:t}){const o=e,i=t,{activeMenu:a,theme:l}=On(),r=["var(--j-color-primary)","var(--j-color-success)","var(--j-color-warning)","var(--j-color-error)","#16c2c0","#9154de"],s=n.computed(()=>(o.menuList.forEach((h,m)=>{h.color=r[m%r.length]}),o.menuList)),d=n.computed(()=>a.value?.pid?.split(".")||[]),c=h=>{i("click",h)},{list:f,containerProps:u,wrapperProps:p}=Lo(s,{itemHeight:96});return(h,m)=>(n.openBlock(),n.createElementBlock("div",n.mergeProps({class:["j-menu-vertical",{"j-menu-dark":n.unref(l)==="dark"}]},n.unref(u)),[n.createElementVNode("div",n.normalizeProps(n.guardReactiveProps(n.unref(p))),[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(f),g=>(n.openBlock(),n.createBlock(In,{key:g.data.value,"parent-actives":d.value,item:g.data,"is-vertical":"",onClick:c},null,8,["parent-actives","item"]))),128))],16)],16))}}),Ga=te(n.defineComponent({name:"JMenu",__name:"menu",props:{menus:{type:Array,default:()=>[]},activeId:{type:String,default:void 0},collapsed:Boolean,theme:{type:String,default:"light"},mode:{type:String,default:"inline"}},emits:["click"],setup(e,{emit:t}){const o=e,i=t;let a={};const l=n.ref("");l.value=o.activeId||"";const r=(g,b,k,v,w)=>{k=k||[];for(let C=0,S=k.length;C<S;C++){const y=k[C],E={};E.pid=b,E.indent=v,l.value===y.value&&(E.active=!0),Object.keys(y).forEach(_=>{_!=="children"&&(E[_]=y[_])}),w&&w.includes(y.value)&&(E.open=!0),g.push(E);const B=y.children||[];B.length>0&&(E.hasChildren=!0,w||(a[E.value]=B),(!w||E.open&&!o.collapsed)&&r(g,`${b}.${E.value}`,B,v+1,w))}},s=(g,b)=>{const k=[];return r(k,"0",g,0,b),k},d=n.ref([]);let c=[];const f=()=>{a={},c=s(o.menus);const g=[];if(l.value&&o.mode==="inline"){const b=c.find(k=>k.value===l.value);b&&g.push(...b.pid.split("."))}d.value=s(o.menus,g),console.log("showMenuList",d.value)};n.watch(()=>o.menus,()=>{f()},{immediate:!0}),n.watch(()=>o.mode,()=>{f()});const u=()=>{if(d.value.find(b=>b.active)?.value!==l.value){const b=c.find(k=>k.value===l.value);if(b){const k=[];o.mode==="inline"&&k.push(...b.pid.split(".")),d.value=s(o.menus,k)}}},p=n.computed(()=>c.find(g=>g.value===l.value));n.watch(()=>o.activeId,()=>{l.value=o.activeId||"",u()}),n.watch(()=>o.collapsed,()=>{if(o.collapsed)d.value=s(o.menus,[]);else{const g=[];if(l.value){const b=c.find(k=>k.value===l.value);b&&g.push(...b.pid.split("."))}d.value=s(o.menus,g)}});const h=n.computed(()=>o.theme),m=g=>{if(g.hasChildren){if(o.collapsed)return;const b=[];b.push(...g.pid.split(".")),g.open||b.push(g.value);const k=s(o.menus,b),v=new Set(d.value.map(C=>C.value)),w=new Set(k.map(C=>C.value));k.forEach(C=>{v.has(C.value)||(C.entering=!0)}),d.value.forEach(C=>{w.has(C.value)||(C.leaving=!0)}),d.value=k,setTimeout(()=>{d.value.forEach(C=>{C.entering=!1,C.leaving=!1})},300)}else{const b=d.value.find(k=>k.active);if(b?.value===g.value)return;b&&(b.active=!1),g.active=!0,l.value=g.value,i("click",g)}};return mc({getMenuMap:()=>a,toArray:s,activeMenu:p,theme:h}),(g,b)=>e.mode==="inline"?(n.openBlock(),n.createBlock(Hd,{key:0,"menu-list":d.value,collapsed:e.collapsed,onClick:m},null,8,["menu-list","collapsed"])):e.mode==="horizontal"?(n.openBlock(),n.createBlock(Wd,{key:1,"menu-list":d.value,onClick:m},null,8,["menu-list"])):(n.openBlock(),n.createBlock(Ud,{key:2,"menu-list":d.value,onClick:m},null,8,["menu-list"]))}})),Jd={class:"j-keyword-panel"},Yd={key:0},qd={key:1,class:"columns-wrapper"},Gd=n.defineComponent({name:"JKeywordPanel",__name:"keyword-panel",props:n.mergeModels({columns:{type:Array,default:()=>[]}},{checkAll:{default:!0},checkAllModifiers:{},checkFields:{default:()=>[]},checkFieldsModifiers:{}}),emits:["update:checkAll","update:checkFields"],setup(e,{expose:t}){const{t:o}=Pe(),i=e,a=n.useModel(e,"checkAll"),l=n.useModel(e,"checkFields"),r=n.ref(!1),s=n.ref(""),d=n.computed(()=>i.columns.filter(p=>p.config?.filter?.isSearchKeyword?s.value?p.config?.label?.indexOf(s.value)!=-1:!0:!1).map(p=>({label:p.config?.label,value:p.id}))),c=()=>{a.value||(a.value=!0,r.value=!1,l.value=[])},f=p=>{p.length>0?a.value=!1:a.value=!0};return t({init:()=>{a.value?r.value=!1:r.value=!0}}),(p,h)=>{const m=n.resolveComponent("j-icon"),g=n.resolveComponent("el-input"),b=n.resolveComponent("j-checkbox");return n.openBlock(),n.createElementBlock("div",Jd,[n.createElementVNode("div",{class:n.normalizeClass(["range-item",{active:a.value}]),onClick:c},[n.createElementVNode("div",null,n.toDisplayString(n.unref(o)("搜索全部")),1),a.value?(n.openBlock(),n.createBlock(m,{key:0,icon:"mdi:check"})):n.createCommentVNode("",!0)],2),n.createElementVNode("div",{class:"range-item",onClick:h[0]||(h[0]=k=>r.value=!r.value)},[n.createElementVNode("div",null,n.toDisplayString(n.unref(o)("搜索特定字段")),1),n.createVNode(m,{icon:r.value?"mdi:keyboard-arrow-up":"mdi:keyboard-arrow-down"},null,8,["icon"])]),r.value?(n.openBlock(),n.createElementBlock("div",Yd,[n.createVNode(g,{class:"no-border background",modelValue:s.value,"onUpdate:modelValue":h[1]||(h[1]=k=>s.value=k),modelModifiers:{trim:!0},placeholder:n.unref(o)("搜索"),clearable:""},{prefix:n.withCtx(()=>[n.createVNode(m,{icon:"mdi:search"})]),_:1},8,["modelValue","placeholder"])])):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createElementBlock("div",qd,[n.createVNode(b,{options:d.value,modelValue:l.value,"onUpdate:modelValue":h[2]||(h[2]=k=>l.value=k),onChange:f,style:{display:"flex","flex-direction":"column"}},null,8,["options","modelValue"])])):n.createCommentVNode("",!0)])}}}),Kd={key:0,class:"title"},Xd={class:"content"},Zd={class:"relation"},Qd={style:{width:"72px"}},eu={class:"btn-wrapper"},tu={class:"field-wrapper"},nu={class:"buttons"},Ka=n.defineComponent({name:"JFilterPanel",__name:"filter-panel",props:n.mergeModels({columns:{type:Array,default:()=>[]},searchFieldList:{type:Array,default:()=>[]}},{relation:{default:"and"},relationModifiers:{},isPin:{default:!1},isPinModifiers:{}}),emits:n.mergeModels(["filter","close"],["update:relation","update:isPin"]),setup(e,{expose:t,emit:o}){const{t:i}=Pe(),a=e,l=n.useModel(e,"relation"),r=n.useModel(e,"isPin"),s=n.ref([]),d=()=>{r.value=!r.value},c=[{id:"field",type:"j-select",getCompConfig:()=>({selectData:u.value.join(","),options:f.value}),config:{appendTo:r.value?void 0:".j-filter-panel",persistent:!1,dataType:"options",isShowTooltip:!0,isSelectOnlyone:!0,width:r.value?132:160,change:({value:v,row:w})=>{const S=a.columns.find(B=>B.id===v)?.config||{};let y="eq",E="text";["options"].includes(S.dataType||"")?y="in":["dateTime"].includes(S.dataType||"")&&(y="range",E="dateTime"),w.method=y,w.type=S.valueType||E}}},{id:"method",type:"j-select",getCompConfig:({row:v})=>{const C=a.columns.find(S=>S.id===v.field)?.config||{};return["options","switch"].includes(C.dataType||"")?{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"in",label:"等于任意一个"},{value:"nin",label:"不等于任意一个"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}:["dateTime"].includes(C.dataType||"")?{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"gte",label:"大于等于"},{value:"lte",label:"小于等于"},{value:"range",label:"选择范围"},{value:"formula",label:"动态筛选"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}:{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"like",label:"包含"},{value:"unlike",label:"不包含"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}},config:{width:r.value?120:144,appendTo:r.value?void 0:".j-filter-panel",persistent:!1,dataType:"options",noBorder:!0,change:({row:v})=>{v.value=void 0}}},{id:"value",type:"input",getCompType:({row:v})=>{const C=a.columns.find(S=>S.id===v.field)?.config||{};if(["options","dataItem","switch"].includes(C.dataType||"")){if(["in","nin"].includes(v.method)||["eq","ne"].includes(v.method))return"j-select"}else if(["dateTime"].includes(C.dataType||""))return["range"].includes(v.method)?"j-date-range":["formula"].includes(v.method)?"j-select":"j-date";return"j-input"},getCompConfig:({row:v})=>{if(["empty","not_empty"].includes(v.method||""))return{display:!1};const C=a.columns.find(y=>y.id===v.field)?.config||{},S={display:!0,placeholder:"",clearable:!0,filterable:!0};return["options","dataItem"].includes(C.dataType||"")?(S.collapseTags=!0,S.collapseTagsTooltip=!0,S.dataType=C.dataType,S.dataCode=C.dataCode,S.options=C.options):["switch"].includes(C.dataType||"")?(S.options=[],S.dataType="options",C.activeValue==null?S.options.push({label:"是",value:"1"}):S.options.push({label:"是",value:C.activeValue}),C.inactiveValue==null?S.options.push({label:"否",value:"0"}):S.options.push({label:"否",value:C.inactiveValue})):["dateTime"].includes(C.dataType||"")&&(["formula"].includes(v.method)?(S.placeholder="",S.options=[{label:"今天",value:"today"},{label:"昨天",value:"yesterday"},{label:"明天",value:"tomorrow"},{label:"最近7天",value:"last7days"},{label:"最近30天",value:"last30days"},{label:"本周",value:"thisWeek"},{label:"上周",value:"lastWeek"},{label:"下周",value:"nextWeek"},{label:"本月",value:"thisMonth"},{label:"上月",value:"lastMonth"},{label:"下月",value:"nextMonth"},{label:"本季度",value:"thisQuarter"},{label:"上季度",value:"lastQuarter"},{label:"下季度",value:"nextQuarter"},{label:"今年",value:"thisYear"},{label:"去年",value:"lastYear"},{label:"明年",value:"nextYear"}],S.dataType="options"):(S.type="datetime",["range"].includes(v.method)?(S.startPlaceholder="开始时间",S.endPlaceholder="结束时间",S.defaultTime=[new Date(2e3,1,1,0,0,0),new Date(2e3,2,1,23,59,59)]):S.placeholder="")),S},config:{width:r.value?234:296,appendTo:r.value?void 0:".j-filter-panel"}}];n.onMounted(()=>{s.value=a.searchFieldList});const f=n.computed(()=>a.columns.filter(v=>!v.children?.length).map(v=>({label:v.config?.label,value:v.id,dataType:v.config?.dataType,options:v.config?.options}))),u=n.computed(()=>s.value.map(v=>v.field)),p=({data:v})=>{if(u.value.includes(v.value))return;const C=a.columns.find(E=>E.id===v.value)?.config||{};let S="eq",y="text";["options","dataItem"].includes(C.dataType||"")?S="in":["dateTime"].includes(C.dataType||"")&&(S="range",y="dateTime"),s.value.push({field:v.value,method:S,type:C.valueType||y})},h=o,m=()=>{s.value.length=0},g=()=>{r.value?h("filter"):h("close",!0)},b=()=>{s.value.forEach(v=>{v.value=void 0}),h("filter")};return t({getSearchFields:()=>s.value}),(v,w)=>{const C=n.resolveComponent("j-icon"),S=n.resolveComponent("j-select"),y=n.resolveComponent("j-button-select"),E=n.resolveComponent("j-button"),B=n.resolveComponent("j-input-rows"),_=n.resolveComponent("el-tooltip");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-filter-panel",{"is-pin":r.value}])},[r.value?(n.openBlock(),n.createElementBlock("div",Kd,[n.createVNode(C,{icon:"mdi:filter-outline"}),n.createElementVNode("div",null,n.toDisplayString(n.unref(i)("筛选")),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",Xd,[n.createElementVNode("div",Zd,[n.createElementVNode("div",null,n.toDisplayString(n.unref(i)("筛选出符合以下")),1),n.createElementVNode("div",Qd,[n.createVNode(S,{teleported:!1,noBorder:!0,modelValue:l.value,"onUpdate:modelValue":w[0]||(w[0]=T=>l.value=T),options:[{value:"and",label:"所有"},{value:"or",label:"任一"}]},null,8,["modelValue"])]),n.createElementVNode("div",null,n.toDisplayString(n.unref(i)("条件的数据")),1)]),n.createElementVNode("div",eu,[n.createVNode(y,{label:"添加过滤条件",options:f.value,modelValue:u.value.join(","),onChange:p},null,8,["options","modelValue"]),s.value.length>0?(n.openBlock(),n.createBlock(E,{key:0,type:"text",danger:"",label:"删除全部",onClick:m})):n.createCommentVNode("",!0)]),n.createElementVNode("div",tu,[n.createVNode(B,{modelValue:s.value,"onUpdate:modelValue":w[1]||(w[1]=T=>s.value=T),columns:c,editConfig:{isAddBtn:!1},isWrap:r.value},null,8,["modelValue","isWrap"])]),n.createVNode(_,{placement:"bottom",content:r.value?n.unref(i)("取消固定"):n.unref(i)("固定显示")},{default:n.withCtx(()=>[n.createElementVNode("div",{class:"pin-btn",onClick:d},[n.createVNode(C,{rotate:45,icon:r.value?"mdi:keep-off":"mdi:keep"},null,8,["icon"])])]),_:1},8,["content"])]),n.createElementVNode("div",nu,[n.createVNode(E,{label:n.unref(i)("筛选"),type:"primary",onClick:g},null,8,["label"]),n.createVNode(E,{label:n.unref(i)("清空"),icon:"mdi:delete-sweep-outline",type:"text",onClick:b},null,8,["label"])])],2)}}}),ou={class:"j-order-panel"},iu={class:"content"},au={class:"btn-wrapper"},lu={class:"field-wrapper"},ru={class:"buttons"},su=n.defineComponent({name:"JOrderPanel",__name:"order-panel",props:{columns:{type:Array,default:()=>[]}},emits:["save","clear"],setup(e,{expose:t,emit:o}){const{t:i}=Pe(),a=e,l=o,r=n.computed(()=>a.columns.filter(m=>!m.children?.length&&m.config?.sorter?.isNot!==!0).map(m=>({label:m.config?.label,value:m.id}))),s=n.ref([]),d=n.computed(()=>s.value.map(m=>m.value)),c=[{id:"label",type:"j-title",getCompConfig:({row:m})=>({title:m.label}),config:{style:{width:"180px"}}},{id:"sord",type:"j-radio",config:{dataType:"options",options:[{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}],isButton:!0}}],f=({data:m})=>{d.value.includes(m.value)||s.value.push({label:m.label,value:m.value,sord:"ASC"})},u=m=>{s.value=JSON.parse(JSON.stringify(m))},p=()=>{l("save",JSON.parse(JSON.stringify(s.value)))},h=()=>{s.value=[],l("clear")};return t({init:u}),(m,g)=>{const b=n.resolveComponent("j-button-select"),k=n.resolveComponent("j-input-rows"),v=n.resolveComponent("j-button");return n.openBlock(),n.createElementBlock("div",ou,[n.createElementVNode("div",iu,[n.createElementVNode("div",au,[n.createVNode(b,{label:"添加排序规则",options:r.value,modelValue:d.value.join(","),onChange:f},null,8,["options","modelValue"])]),n.createElementVNode("div",lu,[n.createVNode(k,{modelValue:s.value,"onUpdate:modelValue":g[0]||(g[0]=w=>s.value=w),columns:c,editConfig:{isAddBtn:!1,drag:!0}},null,8,["modelValue"])])]),n.createElementVNode("div",ru,[n.createVNode(v,{label:n.unref(i)("排序"),type:"primary",onClick:p},null,8,["label"]),s.value.length>0?(n.openBlock(),n.createBlock(v,{key:0,label:n.unref(i)("清空排序"),icon:"mdi:delete-sweep",type:"text",onClick:h},null,8,["label"])):n.createCommentVNode("",!0)])])}}}),cu={class:"j-column-panel"},du={class:"content"},uu={class:"search-wrapper"},fu={class:"tree-wrapper"},pu={class:"buttons"},hu=n.defineComponent({name:"JColumnPanel",__name:"column-panel",props:{columns:{type:Array,default:()=>[]},columnConfig:{type:Array}},emits:["save"],setup(e,{expose:t,emit:o}){const{t:i}=Pe(),a=e,l=o,r=n.ref(),s=n.ref(""),d={},c=n.ref([]),f=n.ref([]),u=(y,E)=>{const B=[],_=new Map;y.forEach(j=>{_.set(j.id,j),d[j.id]=j});const T=new Set;return E&&E.length>0&&E.forEach(j=>{const D=_.get(j.id);if(D){T.add(D.id);const A={id:D.id,label:D.config?.label||D.id,type:D.type,display:D.config?.display!==!1};D.children&&D.children.length>0&&(A.children=u(D.children,j.children)),B.push(A)}}),y.forEach(j=>{if(!T.has(j.id)){const D={id:j.id,label:j.config?.label||j.id,type:j.type,display:j.config?.display!==!1};j.children&&j.children.length>0&&(D.children=u(j.children)),B.push(D)}}),B},p=(y,E)=>E.length===0?y:y.map(B=>{const _=E.some(j=>B.label.toLowerCase().includes(j.toLowerCase())),T=B.children?p(B.children,E):[];return _||T.length>0?{...B,children:T.length>0?T:B.children}:null}).filter(Boolean),h=n.computed(()=>{if(!s.value)return f.value;const y=s.value.split(/\s+/).filter(Boolean);return p(f.value,y)}),m=n.ref([]),g=n.computed(()=>{const y=new Map;if(a.columnConfig&&a.columnConfig.length>0){const E=B=>{B.forEach(_=>{y.set(_.id,_),_.children&&E(_.children)})};E(a.columnConfig)}return y}),b=()=>{const y=E=>{const B=[];return E.forEach(_=>{let T=!0;if(g.value.size>0){const j=g.value.get(_.id);j?T=j.display:T=_.config?.display!==!1}else T=_.config?.display!==!1;T&&(B.push(_.id),_.children&&B.push(...y(_.children)))}),B};m.value=y(a.columns)},k=(y,{node:E})=>{y.includes(E.id)?m.value.push(E.id):m.value=m.value.filter(_=>_!==E.id)},v=(y,E,B)=>B==="inner"?!1:y.parent===E.parent,w=()=>{const y=E=>E.map(B=>{const _={...B,display:m.value.includes(B.id)};return B.children&&(_.children=y(B.children)),_});l("save",y(f.value))},C=()=>{if(b(),f.value=JSON.parse(JSON.stringify(c.value)),s.value="",r.value){const y=r.value;y.setCheck&&y.setCheck(m.value);const E=y.$refs?.treeRef||y;E?.setCheckedKeys&&E.setCheckedKeys(m.value)}};return t({init:()=>{b(),c.value=u(a.columns,a.columnConfig),f.value=JSON.parse(JSON.stringify(c.value))}}),(y,E)=>{const B=n.resolveComponent("j-icon"),_=n.resolveComponent("el-input"),T=n.resolveComponent("j-tree"),j=n.resolveComponent("j-button");return n.openBlock(),n.createElementBlock("div",cu,[n.createElementVNode("div",du,[n.createElementVNode("div",uu,[n.createVNode(_,{modelValue:s.value,"onUpdate:modelValue":E[0]||(E[0]=D=>s.value=D),modelModifiers:{trim:!0},placeholder:n.unref(i)("搜索 (多个关键词用空格隔开)"),clearable:""},{prefix:n.withCtx(()=>[n.createVNode(B,{icon:"mdi:search"})]),_:1},8,["modelValue","placeholder"])]),n.createElementVNode("div",fu,[n.createVNode(T,{ref_key:"treeRef",ref:r,list:h.value,"is-tree-data":!0,"default-checked-keys":m.value,"default-expand-all":!0,checkable:"","id-key":"id",draggable:!s.value,"allow-drop":v,check:k},null,8,["list","default-checked-keys","draggable"])])]),n.createElementVNode("div",pu,[n.createVNode(j,{label:n.unref(i)("确定"),type:"primary",onClick:w},null,8,["label"]),n.createVNode(j,{label:n.unref(i)("重置"),icon:"mdi:restore",type:"text",onClick:C},null,8,["label"])])])}}}),mu={class:"j-table-panel-left"},gu={class:"j-table-panel-top"},yu={class:"j-table-panel-top-left"},bu={class:"j-table-panel-top-right"},wu={key:0,style:{width:"200px"}},vu={class:"j-table-panel-main"},Cu={key:0,class:"j-table-panel-filter-panel"},Xa=te(n.defineComponent({name:"JTablePanel",__name:"table-panel",props:{columns:{type:Array,required:!0,default:()=>[]},isTree:{type:Boolean,default:!1},isShowNumber:{type:Boolean,default:!0},isMultiple:{type:Boolean,default:!1},isPage:{type:Boolean,default:!1},pageSizes:Array,pageSize:{type:Number,default:100},rowKey:{type:String,default:void 0},sort:String,buttons:{type:Array,default:()=>[]},batchButtons:{type:Array,default:()=>[]},actions:{type:Array,default:()=>[]},actionsMaxCount:{type:Number,default:3},actionsLabel:{type:String,default:"操作"},loadData:Function,immediate:{type:Boolean,default:!0},noPadding:Boolean},emits:["select","ready"],setup(e,{expose:t,emit:o}){const{t:i}=Pe(),a=e,l=o;a.isMultiple&&!a.rowKey&&console.warn("rowKey is required when isMultiple is true");const r=n.ref();let s=[];const d=n.ref(0),c=n.ref(1);let f=a.pageSize||100,u="";const p=n.ref([]),h=n.ref(!1),m=n.computed(()=>a.batchButtons&&a.batchButtons.length>0),g=n.computed(()=>p.value.length>0),b=n.computed(()=>m.value&&g.value||h.value),k=n.computed(()=>a.isPage&&!b.value);m.value&&!a.isMultiple&&console.warn("batchButtons is only valid when isMultiple is true");const v=z=>a.rowKey?a.rowKey.split(",").map(de=>z[de.trim()]).join("::"):"",w=(z,F)=>{if(!F||F.length===0)return z.filter(J=>J.config?.display!==!1).map(J=>J.children&&J.children.length>0?{...J,children:w(J.children)}:J);const de=new Map(z.map(J=>[J.id,J])),ve=[];return F.forEach(J=>{const oe=de.get(J.id);if(oe){if(J.display){let ge=oe;oe.children&&oe.children.length>0&&(ge={...oe,children:w(oe.children,J.children)}),ve.push(ge)}de.delete(J.id)}}),z.forEach(J=>{if(de.has(J.id)&&J.config?.display!==!1){let oe=J;J.children&&J.children.length>0&&(oe={...J,children:w(J.children)}),ve.push(oe)}}),ve},C=n.computed(()=>w(a.columns,se.value)),S=n.computed(()=>Ui(a.columns,z=>z.config.label)),y=n.ref(""),E=n.computed(()=>S.value.some(z=>z.config?.filter?.isSearchKeyword)),B=n.ref(),_=n.ref(!0),T=n.ref([]),j=n.computed(()=>_.value?"搜索全部":`搜索范围:${S.value.filter(z=>T.value.includes(z.id)).map(z=>z.config?.label).join("、")}`),D=()=>{B.value.init()},A=n.ref(),R=n.ref(!1),V=n.ref(!1),x=n.ref(!1),L=n.ref([]),P=n.ref("and"),G=n.ref(),K=n.ref(!1),ne=n.ref([]),pe=()=>{G.value.init(ne.value)},fe=z=>{ne.value=z,K.value=!1,De()},Y=()=>{ne.value=[],De()},he=n.ref(),ae=n.ref(!1),se=n.ref(),xe=n.computed(()=>se.value!=null),Ve=()=>{he.value?.init()},H=z=>{console.log("handleColumnSave:",z),se.value=z,ae.value=!1},X=n.ref(!1),le=()=>{X.value=!X.value},we=()=>{p.value=[],r.value&&(r.value.setSelection?.([]),h.value&&(h.value=!1,r.value.setRecords(s)))},$e=()=>{h.value=!h.value,h.value?r.value?.setRecords(p.value):r.value?.setRecords(s),r.value?.setSelection?.(p.value)},Re=n.computed(()=>{if(p.value.length>0){const z=[{label:`已选${p.value.length}条`,type:"text"},{label:h.value?"全部":"仅选中",type:"text",click:$e},{label:"清空选中",type:"text",click:we}],F=a.batchButtons.map(de=>({...de,click:()=>{de.click&&de.click(p.value)}}));return[...z,...F]}return a.buttons}),me=async()=>{const z={},F={};F.rel=P.value;const de=A.value?.getSearchFields?.()||L.value;F.cond=de.filter(J=>J.value!==void 0&&J.value!==null&&J.value!=="").map(J=>({field:J.field,method:J.method,value:J.value,type:J.type})),F.cond.length>0?x.value=!0:x.value=!1,z.filter=F;const ve=ne.value.map(J=>J.value+" "+J.sord).join(",");if(y.value&&(z.keyword={value:y.value,fields:_.value?S.value.filter(J=>J.config?.filter?.isSearchKeyword).map(J=>J.id):n.unref(T)}),a.loadData){if(a.isPage){z.pagination={rows:f,page:c.value,sort:ve||u||a.sort||a.rowKey};const J=await a.loadData(z)||{};s=J.rows||[],d.value=J.records||0}else z.sort=ve,s=await a.loadData(z)||[],d.value=s.length;r.value.setRecords(s),m.value?(p.value=[],h.value=!1):a.rowKey&&p.value.length>0&&r.value?.setSelection?.(p.value)}},De=async()=>{c.value=1,await me()},ut=({rows:z,page:F})=>{f=z,c.value=F,me()},ot=async()=>{c.value=1,await me()},O=async()=>{await me()},q=async()=>{await ot()},I=z=>{l("ready",z)},N=z=>{let F=[];if(m.value)F=z;else if(!a.rowKey)F=z;else{const de=new Map(z.map(J=>[v(J),J])),ve=new Map(p.value.map(J=>[v(J),J]));s.forEach(J=>{const oe=v(J);de.has(oe)?ve.set(oe,de.get(oe)):ve.delete(oe)}),F=Array.from(ve.values())}p.value=F,l("select",F),h.value&&F.length===0?(h.value=!1,r.value&&r.value.setRecords(s)):h.value&&F.length>0&&r.value&&(r.value.setRecords(F),r.value.setSelection?.(F))},$=()=>p.value||[],W=z=>{p.value=z,r.value?.setSelection?.(z)},U=()=>r.value?.getInstance?.();return n.onMounted(async()=>{a.immediate&&await O()}),t({refreshData:O,resetData:ot,getSelection:$,setSelection:W,clearSelection:()=>{we()},getInstance:U}),(z,F)=>{const de=n.resolveComponent("j-buttons"),ve=n.resolveComponent("j-icon"),J=n.resolveComponent("el-popover"),oe=n.resolveComponent("el-tooltip"),ge=n.resolveComponent("el-input"),ue=n.resolveComponent("j-button"),Te=n.resolveComponent("j-table");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-table-panel-wrapper",{fullscreen:X.value,"no-padding":e.noPadding||X.value}])},[n.createElementVNode("div",{class:n.normalizeClass(["j-table-panel",{"j-table-panel-fullscreen":X.value}])},[n.createElementVNode("div",mu,[n.createElementVNode("div",gu,[n.createElementVNode("div",yu,[n.createVNode(de,{list:Re.value},null,8,["list"])]),n.createElementVNode("div",bu,[E.value&&!b.value?(n.openBlock(),n.createElementBlock("div",wu,[n.createVNode(ge,{modelValue:y.value,"onUpdate:modelValue":F[2]||(F[2]=re=>y.value=re),modelModifiers:{trim:!0},placeholder:n.unref(i)("搜索数据"),onKeyup:n.withKeys(De,["enter"]),onClear:De,clearable:"",class:"j-suffix"},{prefix:n.withCtx(()=>[n.createVNode(ve,{icon:"mdi:search"})]),suffix:n.withCtx(()=>[n.createVNode(oe,{placement:"bottom",content:j.value},{default:n.withCtx(()=>[n.createElementVNode("div",null,[n.createVNode(J,{placement:"bottom-end","popper-style":"padding: 0",width:200,trigger:"click","show-arrow":!1,onShow:D,onHide:De},{reference:n.withCtx(()=>[n.createVNode(ve,{icon:"mdi:keyboard-arrow-down",style:{cursor:"pointer"}})]),default:n.withCtx(()=>[n.createVNode(Gd,{ref_key:"keywordPanelRef",ref:B,columns:S.value,"check-all":_.value,"onUpdate:checkAll":F[0]||(F[0]=re=>_.value=re),"check-fields":T.value,"onUpdate:checkFields":F[1]||(F[1]=re=>T.value=re)},null,8,["columns","check-all","check-fields"])]),_:1})])]),_:1},8,["content"])]),_:1},8,["modelValue","placeholder"])])):n.createCommentVNode("",!0),!R.value&&!b.value?(n.openBlock(),n.createBlock(J,{key:1,placement:"bottom","popper-style":"padding: 0",width:644,trigger:"click",persistent:!1,visible:V.value,"onUpdate:visible":F[6]||(F[6]=re=>V.value=re),onHide:De},{reference:n.withCtx(()=>[n.createVNode(ue,{icon:"mdi:filter-outline",label:"筛选",type:"text",class:n.normalizeClass({active:x.value})},null,8,["class"])]),default:n.withCtx(()=>[n.createVNode(Ka,{ref_key:"filterPanelRef",ref:A,"is-pin":R.value,"onUpdate:isPin":F[3]||(F[3]=re=>R.value=re),relation:P.value,"onUpdate:relation":F[4]||(F[4]=re=>P.value=re),searchFieldList:L.value,columns:S.value,onFilter:De,onClose:F[5]||(F[5]=re=>V.value=!1)},null,8,["is-pin","relation","searchFieldList","columns"])]),_:1},8,["visible"])):n.createCommentVNode("",!0),b.value?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(oe,{key:2,placement:"bottom",content:n.unref(i)("排序")},{default:n.withCtx(()=>[n.createElementVNode("div",null,[n.createVNode(J,{placement:"bottom","popper-style":"padding: 0",width:380,trigger:"click",onShow:pe,visible:K.value,"onUpdate:visible":F[7]||(F[7]=re=>K.value=re)},{reference:n.withCtx(()=>[n.createVNode(ue,{class:n.normalizeClass({active:ne.value.length>0}),type:"text",icon:"mdi:sort"},null,8,["class"])]),default:n.withCtx(()=>[n.createVNode(su,{ref_key:"orderPanelRef",ref:G,columns:S.value,onSave:fe,onClear:Y},null,8,["columns"])]),_:1},8,["visible"])])]),_:1},8,["content"])),b.value?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(oe,{key:3,placement:"bottom",content:n.unref(i)("显示字段")},{default:n.withCtx(()=>[n.createElementVNode("div",null,[n.createVNode(J,{placement:"bottom","popper-style":"padding: 0",width:400,trigger:"click",onShow:Ve,visible:ae.value,"onUpdate:visible":F[8]||(F[8]=re=>ae.value=re)},{reference:n.withCtx(()=>[n.createVNode(ue,{class:n.normalizeClass({active:xe.value}),type:"text",icon:"mdi:table-headers-eye"},null,8,["class"])]),default:n.withCtx(()=>[n.createVNode(hu,{ref_key:"columnPanelRef",ref:he,columns:e.columns,"column-config":se.value,onSave:H},null,8,["columns","column-config"])]),_:1},8,["visible"])])]),_:1},8,["content"])),b.value?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(oe,{key:4,placement:"bottom",content:n.unref(i)("刷新")},{default:n.withCtx(()=>[n.createVNode(ue,{onClick:q,type:"text",icon:"mdi:refresh"})]),_:1},8,["content"])),n.createVNode(oe,{placement:"bottom",content:X.value?n.unref(i)("退出全屏"):n.unref(i)("全屏")},{default:n.withCtx(()=>[n.createVNode(ue,{onClick:le,type:"text",icon:X.value?"mdi:fullscreen-exit":"mdi:fullscreen"},null,8,["icon"])]),_:1},8,["content"])])]),n.createElementVNode("div",vu,[n.createVNode(Te,{ref_key:"tableRef",ref:r,columns:C.value,records:n.unref(s),"is-tree":e.isTree,"is-show-number":e.isShowNumber,"is-multiple":e.isMultiple&&!!e.rowKey,"is-page":k.value,"page-sizes":e.pageSizes,"page-size":e.pageSize,"page-total":d.value,"row-key":e.rowKey,actions:e.actions,"actions-max-count":e.actionsMaxCount,"actions-label":e.actionsLabel,"table-page":c.value,"onUpdate:tablePage":F[9]||(F[9]=re=>c.value=re),onLoadPageData:ut,onReady:I,onSelectionChanged:N},null,8,["columns","records","is-tree","is-show-number","is-multiple","is-page","page-sizes","page-size","page-total","row-key","actions","actions-max-count","actions-label","table-page"])])]),R.value&&!b.value?(n.openBlock(),n.createElementBlock("div",Cu,[n.createVNode(Ka,{ref_key:"filterPanelRef",ref:A,"is-pin":R.value,"onUpdate:isPin":F[10]||(F[10]=re=>R.value=re),relation:P.value,"onUpdate:relation":F[11]||(F[11]=re=>P.value=re),searchFieldList:L.value,columns:S.value,onFilter:De},null,8,["is-pin","relation","searchFieldList","columns"])])):n.createCommentVNode("",!0)],2)],2)}}})),ku={class:"j-button-select"},xu={class:"search-wraper"},Su={class:"options-wraper"},Bu=["onClick"],Za=te(n.defineComponent({name:"JButtonSelect",__name:"button-select",props:{modelValue:{default:void 0},label:{default:"添加"},popoverWidth:{default:240},options:{default:()=>[]}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,{t:a}=Pe(),l=n.ref(""),r=n.computed(()=>l.value===""?o.options:o.options.filter(c=>(c.label||"").includes(l.value))),s=n.computed(()=>o.modelValue?(o.modelValue+"").split(",").filter(Boolean):[]),d=c=>{if(c.disabled||s.value.includes(c.value))return;const u=[...s.value,c.value].join(",");i("update:modelValue",u),i("change",{value:u,data:c})};return(c,f)=>{const u=n.resolveComponent("j-button"),p=n.resolveComponent("j-icon"),h=n.resolveComponent("el-input"),m=n.resolveComponent("el-popover");return n.openBlock(),n.createBlock(m,{teleported:!1,placement:"bottom-start","popper-style":"padding: 0",width:e.popoverWidth,trigger:"click","show-arrow":!1,offset:4},{reference:n.withCtx(()=>[n.createVNode(u,{style:{"justify-content":"flex-start",padding:"4px 0",border:"0"},icon:"mdi:add",label:e.label,type:"link"},null,8,["label"])]),default:n.withCtx(()=>[n.createElementVNode("div",ku,[n.createElementVNode("div",xu,[n.createVNode(h,{modelValue:l.value,"onUpdate:modelValue":f[0]||(f[0]=g=>l.value=g),modelModifiers:{trim:!0},placeholder:n.unref(a)("搜索"),class:"no-border",clearable:""},{prefix:n.withCtx(()=>[n.createVNode(p,{icon:"mdi:search"})]),_:1},8,["modelValue","placeholder"])]),n.createElementVNode("div",Su,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,g=>(n.openBlock(),n.createElementBlock("div",{key:g.value,class:n.normalizeClass(["option-item",{active:s.value.includes(g.value)||g.disabled}]),onClick:n.withModifiers(b=>d(g),["stop"])},[g.icon?(n.openBlock(),n.createBlock(p,{key:0,class:"j-button-select-icon",icon:g.icon},null,8,["icon"])):n.createCommentVNode("",!0),n.createElementVNode("div",null,n.toDisplayString(n.unref(a)(g.label)),1)],10,Bu))),128))])])]),_:1},8,["width"])}}})),Eu={class:"j-tree-item-text"},_u={key:2,class:"j-tree-item-button-group"},ju={key:1,class:"j-block",style:{display:"flex","align-items":"center","justify-content":"center"}},Qa=te(n.defineComponent({name:"JTree",__name:"tree",props:{loadData:Function,afterLoadData:Function,click:Function,immediate:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean,default:!0},defaultCheckedKeys:{type:Array,default:()=>[]},defaultExpandedKeys:{type:Array,default:()=>[]},accordion:{type:Boolean,default:!1},highlightCurrent:{type:Boolean,default:!0},filterNode:Function,renderAfterExpand:{type:Boolean,default:!0},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},pidKey:{type:String,default:"pid"},idKey:{type:String},iconKey:{type:String,default:"nodeIcon"},iconColorKey:{type:String,default:"nodeIconColor"},list:{type:Array},dataType:String,dataCode:String,checkable:Boolean,check:Function,emptyDes:{type:String,default:"暂无数据"},defaultIcon:{type:String,default:""},defaultIconColor:{type:String,default:""},treeButtons:{type:Array,default:()=>[]},filterButton:Function,buttonDefaultIcon:{type:String,default:""},buttonIconColor:{type:String,default:""},runFlow:{type:Function},nodeClickFlow:{type:String},isHeightAuto:{type:Boolean,default:!1},theme:{type:String,default:"default"},draggable:{type:Boolean,default:!1},expandOnClickNode:{type:Boolean,default:!1},allowDrop:Function},emits:["node-drop"],setup(e,{expose:t,emit:o}){const i=e,a=o,{useData:l,t:r}=Pe(),{getTreeData:s,loadData:d}=l(),c=n.ref(),f=n.ref(!1),u=n.ref(""),p=n.ref([]),h={children:"children",label:"label",disabled:"disabled"},m=n.computed(()=>s?s({dataType:i.dataType,dataCode:i.dataCode,labelKey:i.labelKey,valueKey:i.valueKey,pidKey:i.pidKey,idKey:i.idKey,notLoad:!0})||[]:[]),g=n.computed(()=>i.dataCode||i.dataType?m.value:i.list?n.unref(i.list):p.value),b=async()=>{f.value=!0,i.loadData&&(p.value=await i.loadData()||[]),d&&await d(i.dataType,i.dataCode),f.value=!1,n.nextTick(()=>{i.afterLoadData&&i.afterLoadData(g.value||[])})},k=(A,R=!0)=>{c.value?.setCurrentKey(A,R)},v=()=>c.value?.getCurrentKey(),w=(A,R=!1)=>{c.value?.setCheckedKeys(A,R)},C=(A=!1)=>c.value?.getCheckedKeys(A),S=async(A,R,V,x)=>{if(u.value=A.value,i.nodeClickFlow&&i.runFlow){const L=JSON.parse(i.nodeClickFlow);await i.runFlow(L,{value:A.value})}i.click&&i.click(A.value,A,x)},y=(A,{checkedKeys:R,checkedNodes:V,halfCheckedKeys:x,halfCheckedNodes:L})=>{i.check&&i.check(R,{node:A,checkedNodes:V,halfCheckedKeys:x,halfCheckedNodes:L})},E=(A,R,V,x)=>{a("node-drop",A,R,V,x)},B=A=>{const R=pt(i.treeButtons);return A&&i.filterButton?i.filterButton({buttons:R,node:A}):R},_=(A,R)=>{A.disabled||A.click&&A.click(R)},T=n.ref(""),j=(A,R)=>{T.value=A?R.value:"",console.log(T.value,"row")},D=(A,R,V)=>i.allowDrop?i.allowDrop(A,R,V):!(V=="inner"&&!R.data.canInner);return n.onMounted(async()=>{(i.immediate&&i.loadData||i.dataType||i.dataCode)&&await b()}),n.watch(()=>i.list,()=>{f.value=!0,n.nextTick(()=>{f.value=!1})}),n.watch(()=>i.dataCode||i.dataType,()=>{b()}),t({refreshData:b,setValue:k,getValue:v,setCheck:w,getCheck:C}),(A,R)=>{const V=n.resolveComponent("j-icon"),x=n.resolveComponent("j-button"),L=n.resolveComponent("el-dropdown-item"),P=n.resolveComponent("el-dropdown-menu"),G=n.resolveComponent("el-dropdown"),K=n.resolveComponent("el-tree"),ne=n.resolveComponent("el-empty"),pe=n.resolveDirective("loading");return n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["j-block","j-tree",{"j-tree-menu":e.theme==="menu"}]),style:{"min-height":"60px"}},[!f.value&&g.value.length>0?(n.openBlock(),n.createBlock(K,{key:0,"node-key":e.idKey||e.valueKey,"default-checked-keys":e.defaultCheckedKeys,"default-expanded-keys":e.defaultExpandedKeys,"current-node-key":u.value,data:g.value,"default-expand-all":e.defaultExpandAll,"show-checkbox":e.checkable,onNodeClick:S,onCheck:y,onNodeDrop:E,props:h,"highlight-current":e.highlightCurrent,accordion:e.accordion,"filter-node-method":e.filterNode,"render-after-expand":e.renderAfterExpand,draggable:e.draggable,"allow-drop":D,"expand-on-click-node":e.expandOnClickNode,ref_key:"treeRef",ref:c},{default:n.withCtx(({node:fe})=>[n.createElementVNode("div",{class:n.normalizeClass(["j-tree-item-wraper",{"is-focus":T.value===fe.data.value}])},[fe.data.openIcon?(n.openBlock(),n.createBlock(V,{key:0,class:"j-tree-item-open-icon",size:18,icon:fe.data.openIcon,color:fe.data[e.iconColorKey]||e.defaultIconColor||""},null,8,["icon","color"])):n.createCommentVNode("",!0),fe.data[e.iconKey]||e.defaultIcon?(n.openBlock(),n.createBlock(V,{key:1,class:"j-tree-item-default-icon",size:18,icon:fe.data[e.iconKey]||e.defaultIcon||"",color:fe.data[e.iconColorKey]||e.defaultIconColor||""},null,8,["icon","color"])):n.createCommentVNode("",!0),n.createElementVNode("div",Eu,n.toDisplayString(fe.label),1),B(fe.data).length?(n.openBlock(),n.createElementBlock("div",_u,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(B(fe.data),(Y,he)=>(n.openBlock(),n.createBlock(G,{key:he,trigger:"click",onVisibleChange:ae=>j(ae,fe.data)},{dropdown:n.withCtx(()=>[n.createVNode(P,null,{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Y.children,(ae,se)=>(n.openBlock(),n.createBlock(L,{key:se,disabled:ae.disabled,divided:ae.divided,onClick:n.withModifiers(xe=>_(ae,fe.data),["stop"])},{default:n.withCtx(()=>[n.createElementVNode("div",{class:"j-flex-item",style:n.normalizeStyle({color:ae.danger?"var(--j-color-danger)":ae.color||e.buttonIconColor||"var(--j-color-text-2)"})},[ae.icon||e.buttonDefaultIcon?(n.openBlock(),n.createBlock(V,{key:0,icon:ae.icon||e.buttonDefaultIcon},null,8,["icon"])):n.createCommentVNode("",!0),n.createElementVNode("div",null,n.toDisplayString(n.unref(r)(ae.label)),1)],4)]),_:2},1032,["disabled","divided","onClick"]))),128))]),_:2},1024)]),default:n.withCtx(()=>[n.createVNode(x,{icon:Y.icon,type:"text"},null,8,["icon"])]),_:2},1032,["onVisibleChange"]))),128))])):n.createCommentVNode("",!0)],2)]),_:1},8,["node-key","default-checked-keys","default-expanded-keys","current-node-key","data","default-expand-all","show-checkbox","highlight-current","accordion","filter-node-method","render-after-expand","draggable","expand-on-click-node"])):(n.openBlock(),n.createElementBlock("div",ju,[n.createVNode(ne,{description:n.unref(r)(e.emptyDes)},null,8,["description"])]))],2)),[[pe,f.value]])}}})),el=te(pa),Vu=Is;async function Tu(e,t,o){const i={...o};delete i.ruleIndex,delete i.trigger;const a=new Vu({[e]:[i]});let l=[];try{await a.validate({[e]:t})}catch(r){r.errors?l=r.errors.map(({message:s})=>s):l=[i.message||"校验错误"]}return l.length>0?l[0]:""}async function Nu(e,t,o){const i=o.map((a,l)=>({...a,ruleIndex:l})).sort(({warningOnly:a,ruleIndex:l},{warningOnly:r,ruleIndex:s})=>!!a==!!r?l-s:a?1:-1);for(let a=0;a<i.length;a+=1){const l=i[a];"pattern"in l&&(t+="");const r=await Tu(e,t,l);if(r!=="")return{name:e,errors:r}}}function $u(e,t){const o=(l,r,s,d,c)=>{Object.keys(r).forEach(f=>{let u=f;s&&(u=`${s}.${f}`);const p=r[f],{rules:h,myGridtableId:m}=t(u,s?r:void 0,d,c);if(h.length){const g=i(u,p,h);l.push(g)}m&&p.forEach(g=>{o(l,g,m,p,s?r:void 0)})})},i=(l,r,s)=>Nu(l,r,s);return{validateForm:async()=>{const l=n.unref(e),r=[];o(r,l,"");const s=await Promise.all(r),d={};return s.forEach(c=>{c&&(d[c.name]={msg:c.errors})}),d},validateField:i}}const tl=te(n.defineComponent({name:"JForm",__name:"form",props:{config:{type:Object,default:()=>({})},isAutoSize:{type:Boolean,default:!0},schema:{type:Array,default:()=>[]},readonly:{type:Boolean,default:!1}},emits:["change"],setup(e,{expose:t,emit:o}){const i=e,a=o,{useData:l,existField:r,httpGet:s,httpPost:d,success:c,warning:f,error:u,info:p,t:h}=Pe();let m;l&&(m=l());const g=O=>{u&&u(O)},b=n.ref(!1),k=n.computed(()=>i.config?.gutter||16),v=n.computed(()=>i.config?.span||24),w=n.computed(()=>i.config?.labelWidth),C=n.computed(()=>i.config?.labelPosition||"right"),S=n.computed(()=>B.length===1&&(B[0].type==="j-tabs"||B[0].type==="j-layout"||B[0].config?.isAutoWindow)),y=n.reactive({}),E=n.ref({}),B=[],_={},T=n.ref({});let j={},D={},A=[],R={};const V=O=>{a("change",O)},x=O=>Rn(_[O]?.type||"")&&!_[O]?.config?.notInput||_[O]?.config?.isInput,L=O=>["j-table","j-input-rows","j-input-cards"].includes(_[O]?.type||"");let P;const G=(O,q)=>{Object.keys(O).forEach(I=>{const N=O[I];q&&(I=q+"."+I),N!=null&&typeof N=="object"&&!Mn(N)&&G(N,I),y[I]=N})},K=(O,q)=>{let I=O.id;return I||(O.config?.table&&O.config?.field?I=`${O.config.table}.${O.config.field}`:O.config?.table?I=O.config?.table:O.config?.field&&(I=O.config?.field),q&&L(q)&&(I=`${q}.${I}`)),I||Pn("j")},ne=(O,q,I,N="")=>{O.forEach($=>{$.id=K($,N);const W={id:$.id,slot:$.slot,type:$.type,getCompType:$.getCompType,getCompConfig:$.getCompConfig,config:{},children:[]};q.push(W);const{children:U}=$;Ln(W,$,["children","config"]),Ln(W.config,$.config||{},[]),_[$.id]&&console.warn("有重复的组件id:"+$.id),_[$.id]=W,i.readonly===!0&&(W.config.readonly=!0);let Q=!1,z;N!==""&&L(N)&&(Q=!0,W.config=$.config||{},W.config.parentTableId=N,z=_[N]?.config?.table);const F=W.config||{};if(x($.id))!I&&Q===!1&&(F?.defaultValue===0?y[$.id]=F?.defaultValue:y[$.id]=F?.defaultValue||void 0),F.table&&F.field?j[`${F.table}_${F.field}`.toLowerCase()]=$.id:F.field&&(Q?j[`${z}_${F.field}`.toLowerCase()]=$.id:j[`${F.field}`.toLowerCase()]=$.id);else if(Q&&F.field)j[`${z}_${F.field}`.toLowerCase()]=$.id;else if(L($.id))!I&&!F.isSubTable&&(y[$.id]=[]),F.table&&(j[F.table.toLowerCase()||""]=$.id),F.isSubTable||A.push(W);else if(F?.defaultValue)y[$.id]=F?.defaultValue;else if($.type==="collapse"&&F?.isExpand){const de=[];(F?.groups||[]).forEach(ve=>{de.push(ve.i)}),y[$.id]=de}U&&U.length>0&&ne(U,W.children,I,W.id)})},pe=async(O,q)=>{b.value=!1;const I=!!q;B.splice(0,B.length),j={},D={},A=[],P=q,cn(y),T.value={},I&&G(q,""),ne(O,B,I),R=pt(y),n.nextTick(()=>{b.value=!0,n.nextTick(()=>{ut(i.config?.codeInit,{})})})},fe=(O,q,I)=>{const N=[];return q.forEach($=>{const W={};Object.keys($).forEach(U=>{if(!I||I(U,$[U],O)){const Q=le(U);if(Q?.type==="j-table")W[Q?.id||""]=fe(U,$[U],I);else{let z=j[`${O}_${U}`.toLowerCase()]||U;z=z.indexOf(".")!==-1?z.split(".")[1]:z,W[z]=$[U]}}}),N.push(W)}),N},Y=(O,q)=>{Object.keys(O||{}).forEach(I=>{let N=O[I];const $=le(I);if($===void 0)N&&(Mn(N)&&(N=N[0]||{}),typeof N=="object"?Object.keys(N).forEach(W=>{if(!q||q(I,N[W],I)){let U=W;I!=="main"&&(U=`${I}_${W}`),D[U]=I,y[j[U.toLowerCase()]||W]=N[W]}}):y[I]=N);else if(L($.id||"")){if(!Array.isArray(N)){console.warn("表格数据不是数组:"+I);return}N?.length>0?y[j[I.toLowerCase()]||I]=fe(I,N,q):y[j[I.toLowerCase()]||I]=[]}else(!q||q(I,N,I))&&(y[j[I.toLowerCase()]||I]=N)}),P&&Object.keys(y).forEach(I=>{const N=le(I);(N===void 0||!["tabs","collapse"].includes(N.type||""))&&Ri(P,I,y[I])})},he=(O,q=!1)=>{const I={};return Object.keys(O).forEach(N=>{if(N==="parentRow")return;const $=_[N];if($){const W=$.config?.table,U=$.config?.field;if(q)U?I[U]=O[N]:I[N]=O[N];else if(L(N)){const Q=[];O[N].forEach(z=>{Q.push(he(z,!0))}),I[W||N]=Q}else W&&U?(I[W]=I[W]||{},I[W][U]=O[N]):U&&(I[U]=O[N])}else q?N!=="_X_ROW_KEY"&&N!=="_isHover"&&(I[N]=O[N]):D[N]?(I[D[N]]=I[D[N]]||{},I[D[N]][N.replace(`${D[N]}_`,"")]=O[N]):I[N]=O[N]}),I},ae=(O=!0)=>O?he(y):y,se=(O,q,I,N)=>{let $=_[O];if($==null){const U=O.split(".");$=_[U[U.length-1]]||{}}if(!$)return{};const W=$t({config:{...$.config||{},...T.value[$.id]||{}},getCompConfig:$.getCompConfig,formData:y,tableData:I,row:q,pRowData:N});return W._componentId=$?.id,W},xe=(O,q,I,N)=>{const $=se(O,q,I,N);if($.isNotRule!==!0&&$.display!==!1){const W=$.rule||[],U=W.find(Q=>Q.type==="only");return U&&(U.validator=async(Q,z)=>{if(z){const F={table:Q.table,key:Q.key,keyName:Q.keyName,field:Q.field,keyValue:Q.getKeyValue?Q.getKeyValue():"",value:z,paramNames:Q.paramNames,getParams:Q.getParams,withProjectId:Q.withProjectId,getValue:Q.getValue,formData:y};if(!await r(F))throw h(Q.message)||h("数据值重复")}}),{rules:W,myGridtableId:L($._componentId)?$._componentId:""}}return{rules:[],myGridtableId:""}},{validateForm:Ve}=$u(y,xe),H=async()=>{E.value={};const O=await Ve();return Object.keys(O).length>0?(E.value=O,g(`${h(_[Object.keys(O)[0]]?.config?.label)}:${h(O[Object.keys(O)[0]].msg)}`),!1):!0},X=()=>{E.value={},cn(y),Object.keys(R||{}).forEach(O=>{y[O]=R[O]})},le=O=>{let q=_[O];return q===void 0&&j[O.toLowerCase()]&&(q=_[j[O.toLowerCase()]]),q},we=({id:O,i:q,value:I,type:N})=>{if(N==="add")y[O].push(I);else if(N==="delete")y[O].splice(q,1);else{const $=le(O);$&&($.config.parentTableId?y[$.config.parentTableId][q][O]=I:y[O]=I)}},$e=({id:O,i:q})=>{const I=le(O);if(I){if(I.config.parentTableId){const N=y[I.config.parentTableId],$=I.id?I.id.replace(`${I.config.parentTableId}.`,""):"";if(q!=null)return(N[q]||{})[$||""];const W=[];return N&&N.forEach(U=>{W.push(U[$||""])}),W}if(L(I.id||"")){const N=[];return y[I.id||""].forEach($=>{N.push(he($,!0))}),N}return y[I.id||""]}if(y[O])return y[O]},Re=async({id:O,i:q})=>{const I=$e({id:O,i:q}),N=le(O);if(N&&m?.getLabel)if(q!==void 0){const $=I[q],W=y[N.config.parentTableId||""][q],U=$t({config:N.config,getCompConfig:N.getCompConfig,formData:y,tableData:y[N.config.parentTableId||""],row:W});return await m?.getLabel({value:$,config:U,formData:y,tableData:y[N.config.parentTableId||""],row:W})}else{const $=$t({config:N.config,getCompConfig:N.getCompConfig,formData:y});return await m?.getLabel({value:I,config:$,formData:y})}return I},me=async(O,q)=>m?.loadViewDataList?await m?.loadViewDataList(O,q,!1):[],De=O=>(O.set=we,O.get=$e,O.setFormData=Y,O.getFormData=ae,O.getLabel=Re,O.getViewData=me,O.getDateNow=q=>qi(new Date,q||"YYYY-MM-DD HH:mm:ss"),O.httpGet=s||(()=>{console.log("当前状态不支持")}),O.httpPost=d||(()=>{console.log("当前状态不支持")}),O.loading=q=>{Ht(q)},O.showMsg=({text:q,type:I})=>{switch(I){case"success":c&&c(q);break;case"warning":f&&f(q);break;case"error":u&&u(q);break;case"info":p&&p(q);break;default:p&&p(q);break}console.log("showMsg",q,I)},O),ut=async(O,q)=>{if(O&&O.trim()){O=`async (jcode) => {${O}}`;const{res:I,fn:N}=Vo(O);I&&await N(De(q))}},ot=(O,q)=>{T.value[O]={...T.value[O]||{},...q}};return i.schema&&pe(i.schema),fa({formData:y,compsConfig:T,errorFields:E,isAutoWindow:S,gutter:k,span:v,labelWidth:w,labelPosition:C,getValue:$e,formChange:V}),t({init:pe,reset:X,validate:H,setValue:we,getValue:$e,getLabel:Re,setFormData:Y,getFormData:ae,setCompConfig:ot}),(O,q)=>{const I=n.resolveComponent("j-form-item"),N=n.resolveComponent("el-row"),$=n.resolveComponent("el-form");return b.value?(n.openBlock(),n.createBlock($,{key:0,class:n.normalizeClass([{"j-block":e.isAutoSize},"j-form"]),"label-position":C.value,"label-width":w.value,size:e.config?.size,onSubmit:q[0]||(q[0]=n.withModifiers(()=>{},["prevent"]))},{default:n.withCtx(()=>[S.value?(n.openBlock(),n.createBlock(I,n.normalizeProps(n.mergeProps({key:0},B[0])),null,16)):(n.openBlock(),n.createBlock(N,{key:1,gutter:k.value},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(B,W=>n.createVNode(I,n.mergeProps({key:W.id,ref_for:!0},W),null,16)),64))]),_:1},8,["gutter"]))]),_:1},8,["class","label-position","label-width","size"])):n.createCommentVNode("",!0)}}})),nl=te(n.defineComponent({name:"JFormItem",__name:"form-item",props:{id:{type:String,default:""},type:{type:String,default:""},getCompType:{type:Function,default:void 0},config:{type:Object,default:()=>{}},getCompConfig:{type:Function,default:void 0},children:{type:Array,default:()=>[]}},setup(e){const t=e,{formData:o,compsConfig:i,errorFields:a,isAutoWindow:l,span:r,labelWidth:s}=Kt(),{t:d}=Pe(),c=n.computed(()=>$t({config:{...t.config||{},...i?.value?.[t.id]||{}},getCompConfig:t.getCompConfig,formData:o})),f=n.computed(()=>t.getCompType?t.getCompType({config:t.config,formData:o}):t.type),u=n.computed(()=>Rn(f.value)&&!c.value?.notInput||c.value?.isInput),p=n.computed(()=>c.value?.labelWidth||s.value),h=n.computed(()=>(c.value?.rule||[]).some(b=>b.required===!0)),m=n.computed(()=>{const g=a?.value?.[t.id];return g?g.msg:""});return(g,b)=>{const k=n.resolveComponent("j-comp"),v=n.resolveComponent("el-form-item"),w=n.resolveComponent("el-col");return c.value.display!==!1&&!n.unref(l)?(n.openBlock(),n.createBlock(w,{key:0,span:c.value.span||n.unref(r),style:n.normalizeStyle({...c.value.colStyle||{}}),class:n.normalizeClass(c.value.colClass||{})},{default:n.withCtx(()=>[u.value?(n.openBlock(),n.createBlock(v,{key:0,label:n.unref(d)(c.value.notShowLabel?"":c.value.label||""),"label-position":c.value.labelPosition,"label-width":p.value,required:h.value,error:n.unref(d)(m.value)},{default:n.withCtx(()=>[n.createVNode(k,{id:e.id,type:f.value,config:c.value,children:e.children},null,8,["id","type","config","children"])]),_:1},8,["label","label-position","label-width","required","error"])):(n.openBlock(),n.createBlock(k,{key:1,id:e.id,type:f.value,config:c.value,children:e.children},null,8,["id","type","config","children"]))]),_:1},8,["span","style","class"])):c.value.display!==!1?(n.openBlock(),n.createBlock(k,{key:1,id:e.id,type:f.value,config:c.value,children:e.children},null,8,["id","type","config","children"])):n.createCommentVNode("",!0)}}})),Mu={class:"j-page"},ol=te(n.defineComponent({name:"JPage",__name:"page",props:{schema:{type:Array,default:()=>[]},noPadding:{type:Boolean,deflaut:!1},actions:{type:Object,default:()=>({})}},setup(e,{expose:t}){const o=e,i=n.ref(!1),a=n.reactive([]),l={},r=n.reactive({}),s=(c,f)=>{c.forEach(u=>{u.id=u.id||Pn("c");const p={id:u.id,slot:u.slot,type:u.type,config:{},children:[]},{children:h}=u;l[u.id]=p,Ln(p.config,u.config||{},["defaultValue"]),u?.config?.defaultValue!==void 0&&(r.value[u.id]=u.config.defaultValue),f.push(p),h&&h.length>0&&s(h,p.children)})},d=c=>{i.value=!1,a.splice(0,a.length),cn(l),cn(r),s(c,a),n.nextTick(()=>{i.value=!0})};return o.schema&&d(o.schema),t({init:d}),(c,f)=>{const u=n.resolveComponent("j-comp");return n.openBlock(),n.createElementBlock("div",Mu,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a,p=>(n.openBlock(),n.createBlock(u,{key:p.id,id:p.id,type:p.type,config:p.config,children:p.children},null,8,["id","type","config","children"]))),128))])}}})),il=te(n.defineComponent({name:"JGuid",__name:"guid",props:{modelValue:{default:void 0},size:{default:"default"}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,i=t,a=n.ref("");return n.watch(()=>o.modelValue,l=>{l?a.value=l:(a.value=dn(),i("update:modelValue",a.value))},{immediate:!0}),(l,r)=>{const s=n.resolveComponent("el-input");return n.openBlock(),n.createBlock(s,{modelValue:a.value,"onUpdate:modelValue":r[0]||(r[0]=d=>a.value=d),readonly:"",size:e.size},null,8,["modelValue","size"])}}})),Lu={class:"j-input-rows"},Pu={key:0,class:"j-input-rows-num"},Ru={key:1,class:"j-input-rows-char"},al=te(n.defineComponent({name:"JInputRows",__name:"input-rows",props:{modelValue:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},editConfig:{type:Object,default:()=>({})},isCompact:{type:Boolean,default:!1},showNum:{type:Boolean,default:!1},showChar:{type:Boolean,default:!1},isWrap:{type:Boolean,default:!1},id:{type:String,default:""}},emits:["update:modelValue","change","rowChange"],setup(e,{emit:t}){const o=C=>C==null,i=e,a=t,{formData:l}=Kt(),r=n.computed(()=>i.editConfig.isAddBtn!==!1),s=n.computed(()=>i.editConfig.addBtnText||"添加"),d=n.computed(()=>i.editConfig.buttonsAlign||"left"),c=n.computed(()=>i.editConfig.isRemoveBtn!==!1),f=n.computed(()=>i.editConfig.readonly),u=n.computed(()=>i.editConfig.drag),p=n.computed(()=>i.editConfig.isNullValue!==!1),h=n.ref(),m=["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"],g=n.ref([]);i.modelValue&&i.modelValue.length>0?(g.value=i.modelValue||[],g.value.forEach(C=>{C.i||(C.i=dn())})):(g.value=[],a("update:modelValue",g.value)),n.watch(()=>i.modelValue,C=>{g.value=i.modelValue||[],g.value=C||[],g.value.forEach(S=>{S.i||(S.i=dn())})},{deep:!0});const k=()=>{const C={i:dn()};i.columns.forEach(S=>{const y=S.config?.valueRowKey||S.id||"";y&&(C[y]=pt(S.config?.defaultValue))}),g.value.push(C),a("change",{id:i.id,value:C,data:C,formData:l,tableData:g.value,type:"add"})},v=C=>{const S=g.value[C];g.value.splice(C,1),a("change",{id:i.id,value:S,data:S,formData:l,tableData:g.value,type:"delete"})},w=C=>{a("rowChange",C)};return n.onMounted(()=>{if(!u.value||!h.value)return;const C=h.value,{initSortable:S}=ea(C,{handle:".j-input-rows-drag",onEnd:y=>{const{oldIndex:E,newIndex:B}=y;if(o(E)||o(B)||E===B||E<0||B<0)return;const _=g.value.splice(E,1)[0];g.value.splice(B,0,_),a("change",{id:i.id,value:_,data:_,formData:l,tableData:g.value,type:"sort"})}});S()}),Mo({tableData:g.value,rowChange:w}),(C,S)=>{const y=n.resolveComponent("j-comp"),E=n.resolveComponent("j-icon"),B=n.resolveComponent("j-button");return n.openBlock(),n.createElementBlock("div",Lu,[n.createElementVNode("div",{ref_key:"inputRowsRef",ref:h,class:"j-input-rows-container"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.value,(_,T)=>(n.openBlock(),n.createElementBlock("div",{key:_.i+T,class:n.normalizeClass([e.isCompact?"j-space-compact":"j-space",{"j-space-wrap":e.isWrap}])},[e.showNum?(n.openBlock(),n.createElementBlock("div",Pu,n.toDisplayString(T+1),1)):n.createCommentVNode("",!0),e.showChar?(n.openBlock(),n.createElementBlock("div",Ru,n.toDisplayString(m[T%26]),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.columns,j=>(n.openBlock(),n.createBlock(y,n.mergeProps({key:j.id,ref_for:!0},j,{row:_}),null,16,["row"]))),128)),u.value?(n.openBlock(),n.createBlock(E,{key:2,class:"j-input-rows-drag",icon:"mdi:drag"})):n.createCommentVNode("",!0),c.value&&(p.value||g.value.length>1)&&!f.value?(n.openBlock(),n.createBlock(E,{key:3,icon:"mdi:delete-outline",class:"j-input-rows-delete",onClick:j=>v(T)},null,8,["onClick"])):n.createCommentVNode("",!0)],2))),128))],512),!f.value&&r.value?(n.openBlock(),n.createElementBlock("div",{key:0,style:n.normalizeStyle({"text-align":d.value}),class:"j-input-rows-actions"},[r.value?(n.openBlock(),n.createBlock(B,{key:0,type:"link",style:{"margin-right":"8px"},label:s.value,icon:"mdi:add",onClick:k},null,8,["label"])):n.createCommentVNode("",!0)],4)):n.createCommentVNode("",!0)])}}})),ll=te(n.defineComponent({name:"JLayerForm",__name:"layer-form",props:{icon:{type:String,default:"mdi:form-outline"},type:{type:String,default:"default"},size:{type:String,default:"default"},layerLabel:{type:String,default:"设置"},layerHeight:{type:Number,default:400},layerWidth:{type:Number,default:600},formConfig:{type:Object,default:()=>({})},schema:{type:Array,default:()=>[]}},setup(e){const t=e,o=Kt(),{t:i}=Pe(),a=n.computed(()=>t.formConfig?.gutter||16),l=n.computed(()=>t.formConfig?.span||24),r=n.computed(()=>t.formConfig?.labelWidth||o.labelWidth?.value),s=n.computed(()=>t.formConfig?.labelPosition||o.labelPosition?.value||"right"),d=n.computed(()=>t.schema?.length===1&&(t.schema?.[0]?.type==="j-tabs"||t.schema?.[0]?.type==="j-layout"||t.schema?.[0]?.config?.isAutoWindow)),c=n.ref(!1),f=()=>{c.value=!0};return fa({...o,isAutoWindow:d,gutter:a,span:l,labelWidth:r}),(u,p)=>{const h=n.resolveComponent("j-button"),m=n.resolveComponent("j-form-item"),g=n.resolveComponent("el-row"),b=n.resolveComponent("el-form"),k=n.resolveComponent("j-dialog");return n.openBlock(),n.createElementBlock("div",null,[n.createVNode(h,n.mergeProps(u.$attrs,{type:e.type,size:e.size,icon:e.icon,onClick:f}),null,16,["type","size","icon"]),n.createVNode(k,{visible:c.value,"onUpdate:visible":p[1]||(p[1]=v=>c.value=v),title:n.unref(i)(e.layerLabel||"设置"),height:e.layerHeight||400,width:e.layerWidth||600,"has-btns":!1},{default:n.withCtx(()=>[n.createVNode(b,{class:n.normalizeClass(["j-block","j-layer-form"]),"label-position":s.value,"label-width":r.value,size:e.formConfig?.size,onSubmit:p[0]||(p[0]=n.withModifiers(()=>{},["prevent"]))},{default:n.withCtx(()=>[d.value?(n.openBlock(),n.createBlock(m,n.normalizeProps(n.mergeProps({key:0},e.schema[0])),null,16)):(n.openBlock(),n.createBlock(g,{key:1,gutter:a.value},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.schema,v=>(n.openBlock(),n.createBlock(m,n.mergeProps({key:v.id,ref_for:!0},v),null,16))),128))]),_:1},8,["gutter"]))]),_:1},8,["label-position","label-width","size"])]),_:1},8,["visible","title","height","width"])])}}})),rl=te(n.defineComponent({name:"JSwitch",inheritAttrs:!1,__name:"switch",props:{modelValue:{type:[Boolean,String,Number],default:!1},size:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},activeText:{},inactiveText:{},activeIcon:{},inactiveIcon:{},activeActionIcon:{},inactiveActionIcon:{},width:{default:40},inlinePrompt:{type:Boolean,default:!1},name:{},validateEvent:{type:Boolean,default:!0},beforeChange:{},id:{},tabindex:{},ariaLabel:{},loading:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,i=t,a=n.computed({get(){return o.modelValue},set(r){i("update:modelValue",r)}}),l=r=>{i("change",r)};return n.onMounted(()=>{o.autoFocus&&setTimeout(()=>{a.value=!a.value,l(a.value)},100)}),(r,s)=>{const d=n.resolveComponent("el-switch");return n.openBlock(),n.createBlock(d,n.mergeProps(r.$attrs,{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=c=>a.value=c),size:e.size,width:e.width,"inline-prompt":e.inlinePrompt,"active-icon":e.activeIcon,"inactive-icon":e.inactiveIcon,"active-action-icon":e.activeActionIcon,"inactive-action-icon":e.inactiveActionIcon,"active-text":e.activeText,"inactive-text":e.inactiveText,"active-value":e.activeValue,"inactive-value":e.inactiveValue,name:e.name,"validate-event":e.validateEvent,"before-change":e.beforeChange,id:e.id,tabindex:e.tabindex,"aria-label":e.ariaLabel,loading:e.loading,disabled:e.disabled||e.readonly,onChange:l}),n.createSlots({_:2},[r.$slots["active-action"]?{name:"active-action",fn:n.withCtx(()=>[n.renderSlot(r.$slots,"active-action")]),key:"0"}:void 0,r.$slots["inactive-action"]?{name:"inactive-action",fn:n.withCtx(()=>[n.renderSlot(r.$slots,"inactive-action")]),key:"1"}:void 0,r.$slots.active?{name:"active",fn:n.withCtx(()=>[n.renderSlot(r.$slots,"active")]),key:"2"}:void 0,r.$slots.inactive?{name:"inactive",fn:n.withCtx(()=>[n.renderSlot(r.$slots,"inactive")]),key:"3"}:void 0]),1040,["modelValue","size","width","inline-prompt","active-icon","inactive-icon","active-action-icon","inactive-action-icon","active-text","inactive-text","active-value","inactive-value","name","validate-event","before-change","id","tabindex","aria-label","loading","disabled"])}}})),sl=te(n.defineComponent({name:"JTabs",__name:"tabs",props:{modelValue:{},type:{default:""},closable:{type:Boolean,default:!1},addable:{type:Boolean,default:!1},editable:{type:Boolean,default:!1},tabPosition:{default:"top"},stretch:{type:Boolean,default:!1},beforeLeave:{}},emits:["update:modelValue","tab-click","tab-change","tab-remove","tab-add","edit"],setup(e,{emit:t}){const o=t,i=c=>{o("update:modelValue",c)},a=(c,f)=>{o("tab-click",c,f)},l=c=>{o("tab-change",c)},r=c=>{o("tab-remove",c)},s=()=>{o("tab-add")},d=(c,f)=>{o("edit",c,f)};return(c,f)=>{const u=n.resolveComponent("el-tabs");return n.openBlock(),n.createBlock(u,n.mergeProps(c.$attrs,{"model-value":e.modelValue,type:e.type,closable:e.closable,addable:e.addable,editable:e.editable,"tab-position":e.tabPosition,stretch:e.stretch,"before-leave":e.beforeLeave,"onUpdate:modelValue":i,onTabClick:a,onTabChange:l,onTabRemove:r,onTabAdd:s,onEdit:d}),{default:n.withCtx(()=>[n.renderSlot(c.$slots,"default")]),_:3},16,["model-value","type","closable","addable","editable","tab-position","stretch","before-leave"])}}})),cl=te(n.defineComponent({name:"JCollapse",__name:"collapse",props:{modelValue:{default:()=>[]},accordion:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=t,i=l=>{o("update:modelValue",l)},a=l=>{o("change",l)};return(l,r)=>{const s=n.resolveComponent("el-collapse");return n.openBlock(),n.createBlock(s,n.mergeProps(l.$attrs,{"model-value":e.modelValue,accordion:e.accordion,onChange:a,"onUpdate:modelValue":i}),{default:n.withCtx(()=>[n.renderSlot(l.$slots,"default")]),_:3},16,["model-value","accordion"])}}})),Au={class:"j-editor"},dl=te(Ea(n.defineComponent({name:"JEditor",__name:"editor",props:{value:{type:String,default:""},height:{type:[String,Number],default:300},options:{type:Object,default:()=>({})},placeholder:{type:String,default:void 0},readonly:{type:Boolean,default:!1},isUploadImg:{type:Boolean,default:!0},token:{type:String,default:""},apiUrl:{type:String,default:""}},emits:["update:value","change"],setup(e,{emit:t}){const o=e,i=t,a=n.ref(),l=n.ref(),r=n.shallowRef(),s=n.computed(()=>({height:typeof o.height=="number"?`${o.height}px`:o.height,overflowY:"hidden"}));let d=!1;const c=u=>{if(!u)return"";let p=u;return o.apiUrl&&o.token&&(p=p.replace(/{learun_img_api}/g,`${o.apiUrl}/system/annexesfile/`).replace(/{learun_img_token}/g,`token=${o.token}`)),p},f=u=>{if(!u)return"";let p=u;if(o.apiUrl){const h=`${o.apiUrl}/system/annexesfile/`;p=p.split(h).join("{learun_img_api}"),o.token&&(p=p.split(`token=${o.token}`).join("{learun_img_token}"))}return p};return n.onMounted(()=>{const u={placeholder:o.placeholder||"请输入内容...",readOnly:o.readonly,MENU_CONF:{},...o.options};u.onChange=h=>{if(d)return;const m=h.getHtml(),g=f(m);i("update:value",g),i("change",{value:g})};const p=Ni.createEditor({selector:a.value,html:c(o.value),config:u,mode:"default"});r.value=p,Ni.createToolbar({editor:p,selector:l.value,mode:"default"})}),n.watch(()=>o.value,u=>{const p=r.value;if(p){const h=p.getHtml(),m=c(u);f(h)!==u&&(d=!0,p.setHtml(m),d=!1)}}),n.watch(()=>o.readonly,u=>{const p=r.value;p&&(u?p.disable():p.enable())}),n.onBeforeUnmount(()=>{const u=r.value;u?.destroy()}),(u,p)=>(n.openBlock(),n.createElementBlock("div",Au,[n.createElementVNode("div",{ref_key:"toolbarRef",ref:l,class:"j-editor-toolbar"},null,512),n.createElementVNode("div",{ref_key:"editorRef",ref:a,class:"j-editor-content",style:n.normalizeStyle(s.value)},null,4)]))}}),[["__scopeId","data-v-60cd5d0b"]])),Ou={key:0,class:"j-map-loading"},Fu=te(n.defineComponent({name:"JMap",__name:"map",props:{address:String,lng:Number,lat:Number,height:{type:String,default:"300px"},mapKey:{type:String,default:""}},emits:["update:address","update:lng","update:lat","change"],setup(e,{expose:t,emit:o}){const i=e,a=o,l=n.ref(!0),r=n.ref();let s=null,d=null,c=null,f=null;const u=async()=>{l.value=!0;try{s=await ta(i.mapKey)}catch(k){console.error("Failed to load Baidu Map:",k),l.value=!1;return}if(d!=null){h(i.lng,i.lat),l.value=!1;return}if(!r.value)return;d=new s.Map(r.value,{enableMapClick:!1});const b=new s.Point(121.480248,31.236276);d.centerAndZoom(b,17),c=new s.Marker(b,{enableDragging:!0}),d.addOverlay(c),c.addEventListener("dragend",k=>{p(k.point)}),d.addControl(new s.NavigationControl({anchor:window.BMAP_ANCHOR_TOP_RIGHT,type:window.BMAP_NAVIGATION_CONTROL_SMALL})),f=new s.GeolocationControl({anchor:window.BMAP_ANCHOR_BOTTOM_LEFT}),f.addEventListener("locationSuccess",k=>{p(k.point)}),f.addEventListener("locationError",k=>{alert(k.message)}),d.addControl(f),d.addEventListener("click",k=>{p(k.point)}),d.enableScrollWheelZoom(!0),h(i.lng,i.lat),l.value=!1},p=b=>{new s.Geocoder().getLocation(b,v=>{c.setPosition(b),d.panTo(b),a("update:address",v.address),a("update:lng",b.lng),a("update:lat",b.lat),a("change",{value:{address:v.address,lng:b.lng,lat:b.lat}})})},h=(b,k)=>{if(b&&k&&s){const v=new s.Point(b,k);c&&c.setPosition(v),d&&d.panTo(v)}};let m=null;return t({setPoint:h,querySearchAsync:(b,k)=>{!d||!s||(m||(m=new s.LocalSearch(d,{onSearchComplete:v=>{const w=[];if(v){const C=v.getCurrentNumPois();for(let S=0;S<C;S++)w.push(v.getPoi(S))}k(w)}})),m.search(b))}}),n.onMounted(()=>{u()}),(b,k)=>(n.openBlock(),n.createElementBlock("div",{class:"j-map",style:n.normalizeStyle({height:e.height})},[l.value?(n.openBlock(),n.createElementBlock("div",Ou,[n.createVNode(Nt,{icon:"mdi:loading",class:"is-loading",size:30})])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"j-map-container",ref_key:"mapRef",ref:r},null,512)],4))}})),Iu=/^class[ {]/;function zu(e){return Iu.test(e.toString())}function Po(e){return Array.isArray(e)}function Ro(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function zn(...e){e.length===1&&Po(e[0])&&(e=e[0]),e=[...e];const t=e.pop();return t.$inject=e,t}const Du=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Hu=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,Wu=/\/\*([^*]*)\*\//m;function Uu(e){if(typeof e!="function")throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(zu(e)?Du:Hu);if(!t)return[];const o=t[1]||t[2];return o&&o.split(",").map(i=>{const a=i.match(Wu);return(a&&a[1]||i).trim()})||[]}function ul(e,t){const o=t||{get:function(w,C){if(i.push(w),C===!1)return null;throw s(`No provider for "${w}"!`)}},i=[],a=this._providers=Object.create(o._providers||null),l=this._instances=Object.create(null),r=l.injector=this,s=function(w){const C=i.join(" -> ");return i.length=0,new Error(C?`${w} (Resolving: ${C})`:w)};function d(w,C){if(!a[w]&&w.includes(".")){const S=w.split(".");let y=d(S.shift());for(;S.length;)y=y[S.shift()];return y}if(Ro(l,w))return l[w];if(Ro(a,w)){if(i.indexOf(w)!==-1)throw i.push(w),s("Cannot resolve circular dependency!");return i.push(w),l[w]=a[w][0](a[w][1]),i.pop(),l[w]}return o.get(w,C)}function c(w,C){if(typeof C>"u"&&(C={}),typeof w!="function")if(Po(w))w=zn(w.slice());else throw s(`Cannot invoke "${w}". Expected a function!`);const y=(w.$inject||Uu(w)).map(E=>Ro(C,E)?C[E]:d(E));return{fn:w,dependencies:y}}function f(w){const{fn:C,dependencies:S}=c(w),y=Function.prototype.bind.call(C,null,...S);return new y}function u(w,C,S){const{fn:y,dependencies:E}=c(w,S);return y.apply(C,E)}function p(w){return zn(C=>w.get(C))}function h(w,C){if(C&&C.length){const S=Object.create(null),y=Object.create(null),E=[],B=[],_=[];let T,j,D,A;for(let R in a)T=a[R],C.indexOf(R)!==-1&&(T[2]==="private"?(j=E.indexOf(T[3]),j===-1?(D=T[3].createChild([],C),A=p(D),E.push(T[3]),B.push(D),_.push(A),S[R]=[A,R,"private",D]):S[R]=[_[j],R,"private",B[j]]):S[R]=[T[2],T[1]],y[R]=!0),(T[2]==="factory"||T[2]==="type")&&T[1].$scope&&C.forEach(V=>{T[1].$scope.indexOf(V)!==-1&&(S[R]=[T[2],T[1]],y[V]=!0)});C.forEach(R=>{if(!y[R])throw new Error('No provider for "'+R+'". Cannot use provider from the parent!')}),w.unshift(S)}return new ul(w,r)}const m={factory:u,type:f,value:function(w){return w}};function g(w,C){const S=w.__init__||[];return function(){S.forEach(y=>{typeof y=="string"?C.get(y):C.invoke(y)})}}function b(w){const C=w.__exports__;if(C){const S=w.__modules__,y=Object.keys(w).reduce((j,D)=>(D!=="__exports__"&&D!=="__modules__"&&D!=="__init__"&&D!=="__depends__"&&(j[D]=w[D]),j),Object.create(null)),E=(S||[]).concat(y),B=h(E),_=zn(function(j){return B.get(j)});C.forEach(function(j){a[j]=[_,j,"private",B]});const T=(w.__init__||[]).slice();return T.unshift(function(){B.init()}),w=Object.assign({},w,{__init__:T}),g(w,B)}return Object.keys(w).forEach(function(S){if(S==="__init__"||S==="__depends__")return;const y=w[S];if(y[2]==="private"){a[S]=y;return}const E=y[0],B=y[1];a[S]=[m[E],Ju(E,B),E]}),g(w,r)}function k(w,C){return w.indexOf(C)!==-1||(w=(C.__depends__||[]).reduce(k,w),w.indexOf(C)!==-1)?w:w.concat(C)}function v(w){const C=w.reduce(k,[]).map(b);let S=!1;return function(){S||(S=!0,C.forEach(y=>y()))}}this.get=d,this.invoke=u,this.instantiate=f,this.createChild=h,this.init=v(e)}function Ju(e,t){return e!=="value"&&Po(t)&&(t=zn(t.slice())),t}function Mt(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}var Yu=1e3;function at(e,t){var o=this;t=t||Yu,e.on(["render.shape","render.connection"],t,function(i,a){var l=i.type,r=a.element,s=a.gfx,d=a.attrs;if(o.canRender(r))return l==="render.shape"?o.drawShape(s,r,d):o.drawConnection(s,r,d)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(i,a){if(o.canRender(a))return i.type==="render.getShapePath"?o.getShapePath(a):o.getConnectionPath(a)})}at.prototype.canRender=function(e){},at.prototype.drawShape=function(e,t){},at.prototype.drawConnection=function(e,t){},at.prototype.getShapePath=function(e){},at.prototype.getConnectionPath=function(e){};const Dn=Object.prototype.toString,qu=Object.prototype.hasOwnProperty;function Ao(e){return e===void 0}function Zt(e){return e!==void 0}function Oo(e){return e==null}function Ne(e){return Dn.call(e)==="[object Array]"}function ht(e){return Dn.call(e)==="[object Object]"}function We(e){return Dn.call(e)==="[object Number]"}function mt(e){const t=Dn.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function Gu(e){if(!Ne(e))throw new Error("must supply array")}function Fo(e,t){return!Oo(e)&&qu.call(e,t)}function gt(e,t){const o=zo(t);let i;return Z(e,function(a,l){if(o(a,l))return i=a,!1}),i}function Qt(e,t){const o=zo(t);let i=[];return Z(e,function(a,l){o(a,l)&&i.push(a)}),i}function Z(e,t){let o,i;if(Ao(e))return;const a=Ne(e)?tf:ef;for(let l in e)if(Fo(e,l)&&(o=e[l],i=t(o,a(l)),i===!1))return o}function Ku(e,t){if(Ao(e))return[];Gu(e);const o=zo(t);return e.filter(function(i,a){return!o(i,a)})}function en(e,t,o){return Z(e,function(i,a){o=t(o,i,a)}),o}function fl(e,t){return!!en(e,function(o,i,a){return o&&t(i,a)},!0)}function Xu(e,t){return!!gt(e,t)}function yt(e,t){let o=[];return Z(e,function(i,a){o.push(t(i,a))}),o}function Zu(e){return yt(e,t=>t)}function pl(e,t,o={}){return t=Io(t),Z(e,function(i){let a=t(i)||"_",l=o[a];l||(l=o[a]=[]),l.push(i)}),o}function Qu(e,...t){e=Io(e);let o={};return Z(t,a=>pl(a,e,o)),yt(o,function(a,l){return a[0]})}function hl(e,t){t=Io(t);let o=[];return Z(e,function(i,a){let l=t(i,a),r={d:l,v:i};for(var s=0;s<o.length;s++){let{d}=o[s];if(l<d){o.splice(s,0,r);return}}o.push(r)}),yt(o,i=>i.v)}function Io(e){return mt(e)?e:t=>t[e]}function zo(e){return mt(e)?e:t=>t===e}function ef(e){return e}function tf(e){return Number(e)}function nf(e,t){let o,i,a,l;function r(u){let p=Date.now(),h=u?0:l+t-p;if(h>0)return s(h);e.apply(a,i),d()}function s(u){o=setTimeout(r,u)}function d(){o&&clearTimeout(o),o=l=i=a=void 0}function c(){o&&r(!0),d()}function f(...u){l=Date.now(),i=u,a=this,o||s(t)}return f.flush=c,f.cancel=d,f}function Do(e,t){return e.bind(t)}function ie(e,...t){return Object.assign(e,...t)}function Ho(e,t){let o={},i=Object(e);return Z(t,function(a){a in i&&(o[a]=e[a])}),o}function of(e,t){let o={},i=Object(e);return Z(i,function(a,l){t.indexOf(l)===-1&&(o[l]=a)}),o}function af(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch{}return e}function lf(e,t){return t.appendChild(af(e,t))}function Ee(e,t){return lf(t,e),e}var Wo=2,ml={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":Wo,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":Wo,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function rf(e,t){return ml[t]?e.style[t]:e.getAttributeNS(null,t)}function gl(e,t,o){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),a=ml[i];a?(a===Wo&&typeof o=="number"&&(o=String(o)+"px"),e.style[i]=o):e.setAttributeNS(null,t,o)}function sf(e,t){var o=Object.keys(t),i,a;for(i=0,a;a=o[i];i++)gl(e,a,t[a])}function ce(e,t,o){if(typeof t=="string")if(o!==void 0)gl(e,t,o);else return rf(e,t);else sf(e,t);return e}const cf=Object.prototype.toString;function Ge(e){return new bt(e)}function bt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}bt.prototype.add=function(e){return this.list.add(e),this},bt.prototype.remove=function(e){return cf.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},bt.prototype.removeMatching=function(e){const t=this.array();for(let o=0;o<t.length;o++)e.test(t[o])&&this.remove(t[o]);return this},bt.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},bt.prototype.array=function(){return Array.from(this.list)},bt.prototype.has=bt.prototype.contains=function(e){return this.list.contains(e)};function yl(e){return e.cloneNode(!0)}var Uo={svg:"http://www.w3.org/2000/svg"},bl='<svg xmlns="'+Uo.svg+'"';function df(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(Uo.svg)===-1&&(e=bl+e.substring(4)):(e=bl+">"+e+"</svg>",t=!0);var o=uf(e);if(!t)return o;for(var i=document.createDocumentFragment(),a=o.firstChild;a.firstChild;)i.appendChild(a.firstChild);return i}function uf(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}function Se(e,t){var o;return e=e.trim(),e.charAt(0)==="<"?(o=df(e).firstChild,o=document.importNode(o,!0)):o=document.createElementNS(Uo.svg,e),t&&ce(o,t),o}var Jo=null;function wl(){return Jo===null&&(Jo=Se("svg")),Jo}function vl(e,t){var o,i,a=Object.keys(t);for(o=0;i=a[o];o++)e[i]=t[i];return e}function ff(e,t,o,i,a,l){var r=wl().createSVGMatrix();switch(arguments.length){case 0:return r;case 1:return vl(r,e);case 6:return vl(r,{a:e,b:t,c:o,d:i,e:a,f:l})}}function pf(e){return wl().createSVGTransform()}function Lt(e){var t=e.parentNode;return t&&t.removeChild(e),e}function hf(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function mf(e,t){var o,i;for(e.clear(),o=0;i=t[o];o++)e.appendItem(hf(e,i))}function Yo(e,t){var o=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),mf(o,t)),o.consolidate()}function Pt(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function gf(e){return["M",e.x,e.y]}function qo(e){return["L",e.x,e.y]}function yf(e,t,o){return["C",e.x,e.y,t.x,t.y,o.x,o.y]}function bf(e,t){const o=e.length,i=[gf(e[0])];for(let a=1;a<o;a++){const l=e[a-1],r=e[a],s=e[a+1];if(!s||!t){i.push(qo(r));continue}const d=Math.min(t,Go(r.x-l.x,r.y-l.y),Go(s.x-r.x,s.y-r.y));if(!d){i.push(qo(r));continue}const c=Hn(r,l,d),f=Hn(r,l,d*.5),u=Hn(r,s,d),p=Hn(r,s,d*.5);i.push(qo(c)),i.push(yf(f,p,u))}return i}function Hn(e,t,o){const i=t.x-e.x,a=t.y-e.y,l=Go(i,a),r=o/l;return{x:e.x+i*r,y:e.y+a*r}}function Go(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function Ko(e,t,o){We(t)&&(o=t,t=null),t||(t={});const i=Se("path",t);return We(o)&&(i.dataset.cornerRadius=String(o)),Cl(i,e)}function Cl(e,t){const o=parseInt(e.dataset.cornerRadius,10)||0;return ce(e,{d:Pt(bf(t,o))}),e}function wf(e){return Qt(e,function(t){return!gt(e,function(o){return o!==t&&kl(t,o)})})}function kl(e,t){if(t){if(e===t)return t;if(e.parent)return kl(e.parent,t)}}function xl(e,t,o){o=o||0,Ne(e)||(e=[e]),Z(e,function(i,a){var l=t(i,a,o);Ne(l)&&l.length&&xl(l,t,o+1)})}function vf(e,t,o){Ao(t)&&(t=!0),ht(t)&&(o=t,t=!0),o=o||{};var i=hn(o.allShapes),a=hn(o.allConnections),l=hn(o.enclosedElements),r=hn(o.enclosedConnections),s=hn(o.topLevel,t&&pl(e,function(f){return f.id}));function d(f){s[f.source.id]&&s[f.target.id]&&(s[f.id]=[f]),i[f.source.id]&&i[f.target.id]&&(r[f.id]=l[f.id]=f),a[f.id]=f}function c(f){if(l[f.id]=f,f.waypoints)r[f.id]=a[f.id]=f;else return i[f.id]=f,Z(f.incoming,d),Z(f.outgoing,d),f.children}return xl(e,c),{allShapes:i,allConnections:a,topLevel:s,enclosedConnections:r,enclosedElements:l}}function Wn(e,t){t=!!t,Ne(e)||(e=[e]);var o,i,a,l;return Z(e,function(r){var s=r;r.waypoints&&!t&&(s=Wn(r.waypoints,!0));var d=s.x,c=s.y,f=s.height||0,u=s.width||0;(d<o||o===void 0)&&(o=d),(c<i||i===void 0)&&(i=c),(d+u>a||a===void 0)&&(a=d+u),(c+f>l||l===void 0)&&(l=c+f)}),{x:o,y:i,height:l-i,width:a-o}}function Cf(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function Sl(e){return!!(e&&e.isFrame)}function hn(e,t){return ie({},e||{},t||{})}var kf=1;function wt(e,t){at.call(this,e,kf),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}Mt(wt,at),wt.prototype.canRender=function(){return!0},wt.prototype.drawShape=function(t,o,i){var a=Se("rect");return ce(a,{x:0,y:0,width:o.width||0,height:o.height||0}),Sl(o)?ce(a,ie({},this.FRAME_STYLE,i||{})):ce(a,ie({},this.SHAPE_STYLE,i||{})),Ee(t,a),a},wt.prototype.drawConnection=function(t,o,i){var a=Ko(o.waypoints,ie({},this.CONNECTION_STYLE,i||{}));return Ee(t,a),a},wt.prototype.getShapePath=function(t){var o=t.x,i=t.y,a=t.width,l=t.height,r=[["M",o,i],["l",a,0],["l",0,l],["l",-a,0],["z"]];return Pt(r)},wt.prototype.getConnectionPath=function(t){var o=t.waypoints,i,a,l=[];for(i=0;a=o[i];i++)a=a.original||a,l.push([i===0?"M":"L",a.x,a.y]);return Pt(l)},wt.$inject=["eventBus","styles"];function xf(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(o,i,a){var l=this.style(i,a);return ie(l,{class:o})},this.style=function(o,i){!Ne(o)&&!i&&(i=o,o=[]);var a=en(o,function(l,r){return ie(l,e[r]||{})},{});return i?ie(a,i):a},this.computeStyle=function(o,i,a){return Ne(i)||(a=i,i=[]),t.style(i||[],ie({},a,o||{}))}}const Sf={__init__:["defaultRenderer"],defaultRenderer:["type",wt],styles:["type",xf]};function Bf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ef(e,t){return t.forEach(function(o){o&&typeof o!="string"&&!Array.isArray(o)&&Object.keys(o).forEach(function(i){if(i!=="default"&&!(i in e)){var a=Object.getOwnPropertyDescriptor(o,i);Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:function(){return o[i]}})}})}),Object.freeze(e)}function Bl(e,...t){const o=e.style;return Z(t,function(i){i&&Z(i,function(a,l){o[l]=a})}),e}function _f(e,t,o){return arguments.length==2?e.getAttribute(t):(e.setAttribute(t,o),e)}const jf=Object.prototype.toString;function Vf(e){return new vt(e)}function vt(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}vt.prototype.add=function(e){return this.list.add(e),this},vt.prototype.remove=function(e){return jf.call(e)=="[object RegExp]"?this.removeMatching(e):(this.list.remove(e),this)},vt.prototype.removeMatching=function(e){const t=this.array();for(let o=0;o<t.length;o++)e.test(t[o])&&this.remove(t[o]);return this},vt.prototype.toggle=function(e,t){return typeof t<"u"?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},vt.prototype.array=function(){return Array.from(this.list)},vt.prototype.has=vt.prototype.contains=function(e){return this.list.contains(e)};function Tf(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function Xo(e,t,o){var i=o?e:e.parentNode;return i&&typeof i.closest=="function"&&i.closest(t)||null}function Nf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Un={},El;function $f(){if(El)return Un;El=1;var e,t,o;function i(){e=window.addEventListener?"addEventListener":"attachEvent",t=window.removeEventListener?"removeEventListener":"detachEvent",o=e!=="addEventListener"?"on":""}return Un.bind=function(a,l,r,s){return e||i(),a[e](o+l,r,s||!1),r},Un.unbind=function(a,l,r,s){return t||i(),a[t](o+l,r,s||!1),r},Un}var _l=$f(),Mf=Nf(_l),ke=Ef({__proto__:null,default:Mf},[_l]),jl=["focus","blur"];function Lf(e,t,o,i,a){return jl.indexOf(o)!==-1&&(a=!0),ke.bind(e,o,function(l){var r=l.target||l.srcElement;l.delegateTarget=Xo(r,t,!0),l.delegateTarget&&i.call(e,l)},a)}function Pf(e,t,o,i){return jl.indexOf(t)!==-1&&(i=!0),ke.unbind(e,t,o,i)}var Vl={bind:Lf,unbind:Pf};function mn(e,t){return t=t||document,t.querySelector(e)}function Rf(e,t){return t=t||document,t.querySelectorAll(e)}function gn(e,t){if(!e||!t)return-1;var o=e.indexOf(t);return o!==-1&&e.splice(o,1),o}function lt(e,t,o){if(!(!e||!t)){typeof o!="number"&&(o=-1);var i=e.indexOf(t);if(i!==-1){if(i===o)return;if(o!==-1)e.splice(i,1);else return}o!==-1?e.splice(o,0,t):e.push(t)}}function Zo(e,t){return!e||!t?-1:e.indexOf(t)}function Qo(e,t){return!e||!t?-1:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Af(e,t,o,i){if(!e||!t||!o)return!1;var a=(t.x-e.x)*(o.y-e.y)-(t.y-e.y)*(o.x-e.x),l=Qo(e,t);return Math.abs(a/l)<=i}var Of=2;function Tl(e,t){var o=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[a,l]of Object.entries(i))if(Ff(a,o))return l;return!1}function Ff(e,t){const o=t[0];return fl(t,function(i){return Math.abs(o[e]-i[e])<=Of})}function Nl(e,t,o){return o=o||0,e.x>t.x-o&&e.y>t.y-o&&e.x<t.x+t.width+o&&e.y<t.y+t.height+o}var If=/,?([a-z]),?/gi,$l=parseFloat,je=Math,Ct=je.PI,Qe=je.min,et=je.max,Ml=je.pow,kt=je.abs,zf=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/ig,Df=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/ig,Ll=Array.isArray||function(e){return e instanceof Array};function Hf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Wf(e,t){for(var o=0,i=e.length;o<i;o++)if(e[o]===t)return e.push(e.splice(o,1)[0])}function Uf(e){function t(){var o=Array.prototype.slice.call(arguments,0),i=o.join("␀"),a=t.cache=t.cache||{},l=t.count=t.count||[];return Hf(a,i)?(Wf(l,i),a[i]):(l.length>=1e3&&delete a[l.shift()],l.push(i),a[i]=e(...arguments),a[i])}return t}function Jf(e){if(!e)return null;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},o=[];return String(e).replace(zf,function(i,a,l){var r=[],s=a.toLowerCase();for(l.replace(Df,function(d,c){c&&r.push(+c)}),s=="m"&&r.length>2&&(o.push([a,...r.splice(0,2)]),s="l",a=a=="m"?"l":"L");r.length>=t[s]&&(o.push([a,...r.splice(0,t[s])]),!!t[s]););}),o.toString=ti,o}function Yf(e){for(var t=0,o=e.length;t<o;t++){var i=e[t][0];if(typeof i=="string"&&i!==i.toUpperCase())return!1}return!0}function qf(e){for(var t=0,o=e.length;t<o;t++){var i=e[t][0];if(i!=="M"&&i!=="C")return!1}return!0}function ei(e,t,o,i){return arguments.length===1&&(t=e.y,o=e.width,i=e.height,e=e.x),{x:e,y:t,width:o,height:i,x2:e+o,y2:t+i}}function ti(){return this.join(",").replace(If,"$1")}function Gf(e){for(var t=new Array(e.length),o=0,i=e.length;o<i;o++)for(var a=e[o],l=t[o]=new Array(a.length),r=0,s=a.length;r<s;r++)l[r]=a[r];return t.toString=ti,t}function Pl(e,t,o,i,a,l,r,s,d){var c=1-d,f=Ml(c,3),u=Ml(c,2),p=d*d,h=p*d,m=f*e+u*3*d*o+c*3*d*d*a+h*r,g=f*t+u*3*d*i+c*3*d*d*l+h*s;return{x:Jn(m),y:Jn(g)}}function Rl(e){var t=np(...e);return ei(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function xt(e,t,o){return t>=e.x&&t<=e.x+e.width&&o>=e.y&&o<=e.y+e.height}function Kf(e,t){return e=ei(e),t=ei(t),xt(t,e.x,e.y)||xt(t,e.x2,e.y)||xt(t,e.x,e.y2)||xt(t,e.x2,e.y2)||xt(e,t.x,t.y)||xt(e,t.x2,t.y)||xt(e,t.x,t.y2)||xt(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}function Al(e,t,o,i,a){var l=-3*t+9*o-9*i+3*a,r=e*l+6*t-12*o+6*i;return e*r-3*t+3*o}function Ol(e,t,o,i,a,l,r,s,d){d==null&&(d=1),d=d>1?1:d<0?0:d;for(var c=d/2,f=12,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,m=0;m<f;m++){var g=c*u[m]+c,b=Al(g,e,o,a,r),k=Al(g,t,i,l,s),v=b*b+k*k;h+=p[m]*je.sqrt(v)}return c*h}function Xf(e,t,o,i,a,l,r,s){if(!(et(e,o)<Qe(a,r)||Qe(e,o)>et(a,r)||et(t,i)<Qe(l,s)||Qe(t,i)>et(l,s))){var d=(e*i-t*o)*(a-r)-(e-o)*(a*s-l*r),c=(e*i-t*o)*(l-s)-(t-i)*(a*s-l*r),f=(e-o)*(l-s)-(t-i)*(a-r);if(f){var u=Jn(d/f),p=Jn(c/f),h=+u.toFixed(2),m=+p.toFixed(2);if(!(h<+Qe(e,o).toFixed(2)||h>+et(e,o).toFixed(2)||h<+Qe(a,r).toFixed(2)||h>+et(a,r).toFixed(2)||m<+Qe(t,i).toFixed(2)||m>+et(t,i).toFixed(2)||m<+Qe(l,s).toFixed(2)||m>+et(l,s).toFixed(2)))return{x:u,y:p}}}}function Jn(e){return Math.round(e*1e11)/1e11}function Zf(e,t,o){var i=Rl(e),a=Rl(t);if(!Kf(i,a))return[];var l=Ol(...e),r=Ol(...t),s=Fl(e)?1:~~(l/5)||1,d=Fl(t)?1:~~(r/5)||1,c=new Array(s+1),f=new Array(d+1),u={},p=[],h,m;for(h=0;h<s+1;h++){var g=Pl(...e,h/s);c[h]={x:g.x,y:g.y,t:h/s}}for(h=0;h<d+1;h++)g=Pl(...t,h/d),f[h]={x:g.x,y:g.y,t:h/d};for(h=0;h<s;h++)for(m=0;m<d;m++){var b=c[h],k=c[h+1],v=f[m],w=f[m+1],C=kt(k.x-b.x)<.01?"y":"x",S=kt(w.x-v.x)<.01?"y":"x",y=Xf(b.x,b.y,k.x,k.y,v.x,v.y,w.x,w.y),E;if(y){if(E=y.x.toFixed(9)+"#"+y.y.toFixed(9),u[E])continue;u[E]=!0;var B=b.t+kt((y[C]-b[C])/(k[C]-b[C]))*(k.t-b.t),_=v.t+kt((y[S]-v[S])/(w[S]-v[S]))*(w.t-v.t);B>=0&&B<=1&&_>=0&&_<=1&&p.push({x:y.x,y:y.y,t1:B,t2:_})}}return p}function Qf(e,t,o){e=Dl(e),t=Dl(t);for(var i,a,l,r,s,d,c,f,u,p,h=[],m=0,g=e.length;m<g;m++){var b=e[m];if(b[0]=="M")i=s=b[1],a=d=b[2];else{b[0]=="C"?(u=[i,a,...b.slice(1)],i=u[6],a=u[7]):(u=[i,a,i,a,s,d,s,d],i=s,a=d);for(var k=0,v=t.length;k<v;k++){var w=t[k];if(w[0]=="M")l=c=w[1],r=f=w[2];else{w[0]=="C"?(p=[l,r,...w.slice(1)],l=p[6],r=p[7]):(p=[l,r,l,r,c,f,c,f],l=c,r=f);var C=Zf(u,p);{for(var S=0,y=C.length;S<y;S++)C[S].segment1=m,C[S].segment2=k,C[S].bez1=u,C[S].bez2=p;h=h.concat(C)}}}}}return h}function ep(e){return Ll(e)&&Ll(e[0])}function tp(e){if(Yf(e))return e;var t=new Array(e.length),o=0,i=0,a=0,l=0,r=0,s;e[0][0]=="M"&&(o=+e[0][1],i=+e[0][2],a=o,l=i,r++,t[0]=["M",o,i]);for(var d,c,f=r,u=e.length;f<u;f++){if(c=e[f],s=c[0],t[f]=d=new Array(c.length),s!=s.toUpperCase())switch(d[0]=s.toUpperCase(),d[0]){case"A":d[1]=c[1],d[2]=c[2],d[3]=c[3],d[4]=c[4],d[5]=c[5],d[6]=+c[6]+o,d[7]=+c[7]+i;break;case"V":d[1]=+c[1]+i;break;case"H":d[1]=+c[1]+o;break;case"M":a=+c[1]+o,l=+c[2]+i;default:for(var p=1,h=c.length;p<h;p++)d[p]=+c[p]+(p%2?o:i)}else for(var m=0,g=c.length;m<g;m++)d[m]=c[m];switch(s=s.toUpperCase(),d[0]){case"Z":o=+a,i=+l;break;case"H":o=d[1];break;case"V":i=d[1];break;case"M":a=d[d.length-2],l=d[d.length-1];default:o=d[d.length-2],i=d[d.length-1]}}return t.toString=ti,t}function Fl(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function Yn(e,t,o,i){return[e,t,o,i,o,i]}function Il(e,t,o,i,a,l){var r=.3333333333333333,s=2/3;return[r*e+s*o,r*t+s*i,r*a+s*o,r*l+s*i,a,l]}function zl(e,t,o,i,a,l,r,s,d,c){var f=Ct*120/180,u=Ct/180*(+a||0),p=[],h,m=Uf(function(se,xe,Ve){var H=se*je.cos(Ve)-xe*je.sin(Ve),X=se*je.sin(Ve)+xe*je.cos(Ve);return{x:H,y:X}});if(c)E=c[0],B=c[1],S=c[2],y=c[3];else{h=m(e,t,-u),e=h.x,t=h.y,h=m(s,d,-u),s=h.x,d=h.y;var g=(e-s)/2,b=(t-d)/2,k=g*g/(o*o)+b*b/(i*i);k>1&&(k=je.sqrt(k),o=k*o,i=k*i);var v=o*o,w=i*i,C=(l==r?-1:1)*je.sqrt(kt((v*w-v*b*b-w*g*g)/(v*b*b+w*g*g))),S=C*o*b/i+(e+s)/2,y=C*-i*g/o+(t+d)/2,E=je.asin(((t-y)/i).toFixed(9)),B=je.asin(((d-y)/i).toFixed(9));E=e<S?Ct-E:E,B=s<S?Ct-B:B,E<0&&(E=Ct*2+E),B<0&&(B=Ct*2+B),r&&E>B&&(E=E-Ct*2),!r&&B>E&&(B=B-Ct*2)}var _=B-E;if(kt(_)>f){var T=B,j=s,D=d;B=E+f*(r&&B>E?1:-1),s=S+o*je.cos(B),d=y+i*je.sin(B),p=zl(s,d,o,i,a,0,r,j,D,[B,T,S,y])}_=B-E;var A=je.cos(E),R=je.sin(E),V=je.cos(B),x=je.sin(B),L=je.tan(_/4),P=4/3*o*L,G=4/3*i*L,K=[e,t],ne=[e+P*R,t-G*A],pe=[s+P*x,d-G*V],fe=[s,d];if(ne[0]=2*K[0]-ne[0],ne[1]=2*K[1]-ne[1],c)return[ne,pe,fe].concat(p);p=[ne,pe,fe].concat(p).join().split(",");for(var Y=[],he=0,ae=p.length;he<ae;he++)Y[he]=he%2?m(p[he-1],p[he],u).y:m(p[he],p[he+1],u).x;return Y}function np(e,t,o,i,a,l,r,s){for(var d=[],c=[[],[]],f,u,p,h,m,g,b,k,v=0;v<2;++v){if(v==0?(u=6*e-12*o+6*a,f=-3*e+9*o-9*a+3*r,p=3*o-3*e):(u=6*t-12*i+6*l,f=-3*t+9*i-9*l+3*s,p=3*i-3*t),kt(f)<1e-12){if(kt(u)<1e-12)continue;h=-p/u,0<h&&h<1&&d.push(h);continue}b=u*u-4*p*f,k=je.sqrt(b),!(b<0)&&(m=(-u+k)/(2*f),0<m&&m<1&&d.push(m),g=(-u-k)/(2*f),0<g&&g<1&&d.push(g))}for(var w=d.length,C=w,S;w--;)h=d[w],S=1-h,c[0][w]=S*S*S*e+3*S*S*h*o+3*S*h*h*a+h*h*h*r,c[1][w]=S*S*S*t+3*S*S*h*i+3*S*h*h*l+h*h*h*s;return c[0][C]=e,c[1][C]=t,c[0][C+1]=r,c[1][C+1]=s,c[0].length=c[1].length=C+2,{x0:Qe(...c[0]),y0:Qe(...c[1]),x1:et(...c[0]),y1:et(...c[1])}}function Dl(e){if(ep(e)||(e=Jf(e)),qf(e))return e;for(var t=Gf(tp(e)),o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=function(p,h,m){var g,b;if(!p)return["C",h.x,h.y,h.x,h.y,h.x,h.y];switch(!(p[0]in{T:1,Q:1})&&(h.qx=h.qy=null),p[0]){case"M":h.X=p[1],h.Y=p[2];break;case"A":p=["C",...zl(h.x,h.y,...p.slice(1))];break;case"S":m=="C"||m=="S"?(g=h.x*2-h.bx,b=h.y*2-h.by):(g=h.x,b=h.y),p=["C",g,b,...p.slice(1)];break;case"T":m=="Q"||m=="T"?(h.qx=h.x*2-h.qx,h.qy=h.y*2-h.qy):(h.qx=h.x,h.qy=h.y),p=["C",...Il(h.x,h.y,h.qx,h.qy,p[1],p[2])];break;case"Q":h.qx=p[1],h.qy=p[2],p=["C",...Il(h.x,h.y,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...Yn(h.x,h.y,p[1],p[2])];break;case"H":p=["C",...Yn(h.x,h.y,p[1],h.y)];break;case"V":p=["C",...Yn(h.x,h.y,h.x,p[1])];break;case"Z":p=["C",...Yn(h.x,h.y,h.X,h.Y)];break}return p},a=function(p,h){if(p[h].length>7){p[h].shift();for(var m=p[h];m.length;)l[h]="A",p.splice(h++,0,["C",...m.splice(0,6)]);p.splice(h,1),c=t.length}},l=[],r="",s="",d=0,c=t.length;d<c;d++){t[d]&&(r=t[d][0]),r!="C"&&(l[d]=r,d&&(s=l[d-1])),t[d]=i(t[d],o,s),l[d]!="A"&&r=="C"&&(l[d]="C"),a(t,d);var f=t[d],u=f.length;o.x=f[u-2],o.y=f[u-1],o.bx=$l(f[u-4])||o.x,o.by=$l(f[u-3])||o.y}return t}function rt(e){return ht(e)&&Fo(e,"waypoints")}function Hl(e){return ht(e)&&Fo(e,"labelTarget")}function yn(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function qn(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function op(e){return yn({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function ip(e){for(var t=e.waypoints,o=t.reduce(function(c,f,u){var p=t[u-1];if(p){var h=c[c.length-1],m=h&&h.endLength||0,g=rp(p,f);c.push({start:p,end:f,startLength:m,endLength:m+g,length:g})}return c},[]),i=o.reduce(function(c,f){return c+f.length},0),a=i/2,l=0,r=o[l];r.endLength<a;)r=o[++l];var s=(a-r.startLength)/r.length,d={x:r.start.x+(r.end.x-r.start.x)*s,y:r.start.y+(r.end.y-r.start.y)*s};return d}function tt(e){return rt(e)?ip(e):op(e)}function bn(e,t,o){o=o||0,ht(o)||(o={x:o,y:o});var i=qn(e),a=qn(t),l=i.bottom+o.y<=a.top,r=i.left-o.x>=a.right,s=i.top-o.y>=a.bottom,d=i.right+o.x<=a.left,c=l?"top":s?"bottom":null,f=d?"left":r?"right":null;return f&&c?c+"-"+f:f||c||"intersect"}function ap(e,t,o){var i=lp(e,t);return i.length===1||i.length===2&&Qo(i[0],i[1])<1?yn(i[0]):i.length>1?(i=hl(i,function(a){var l=Math.floor(a.t2*100)||1;return l=100-l,l=(l<10?"0":"")+l,a.segment2+"#"+l}),yn(i[o?0:i.length-1])):null}function lp(e,t){return Qf(e,t)}function rp(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Gn(e,t){return Math.round(e*t)/t}function Wl(e){return We(e)?e+"px":e}function sp(e){for(;e.parent;)e=e.parent;return e}function cp(e){e=ie({},{width:"100%",height:"100%"},e);const t=e.container||document.body,o=document.createElement("div");return o.setAttribute("class","djs-container djs-parent"),Bl(o,{position:"relative",overflow:"hidden",width:Wl(e.width),height:Wl(e.height)}),t.appendChild(o),o}function Ul(e,t,o){const i=Se("g");Ge(i).add(t);const a=o!==void 0?o:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[a]||null),i}const dp="base",Jl=0,up=1,fp={shape:["x","y","width","height"],connection:["waypoints"]};function ee(e,t,o,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=o,this._rootsIdx=0,this._layers={},this._planes=[],this._rootElement=null,this._focused=!1,this._init(e||{})}ee.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],ee.prototype._init=function(e){const t=this._eventBus,o=this._container=cp(e),i=this._svg=Se("svg");ce(i,{width:"100%",height:"100%"}),_f(i,"tabindex",0),e.autoFocus&&t.on("element.hover",()=>{this.restoreFocus()}),t.on("element.mousedown",500,l=>{this.focus()}),i.addEventListener("focusin",()=>{this._setFocused(!0)}),i.addEventListener("focusout",()=>{this._setFocused(!1)}),Ee(o,i);const a=this._viewport=Ul(i,"viewport");e.deferUpdate&&(this._viewboxChanged=nf(Do(this._viewboxChanged,this),300)),t.on("diagram.init",()=>{t.fire("canvas.init",{svg:i,viewport:a})}),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","root.set"],()=>{delete this._cachedViewbox}),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},ee.prototype._destroy=function(){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});const e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._rootElement,delete this._viewport},ee.prototype._setFocused=function(e){e!=this._focused&&(this._focused=e,this._eventBus.fire("canvas.focus.changed",{focused:e}))},ee.prototype._clear=function(){this._elementRegistry.getAll().forEach(t=>{const o=Cf(t);o==="root"?this.removeRootElement(t):this._removeElement(t,o)}),this._planes=[],this._rootElement=null,delete this._cachedViewbox},ee.prototype.focus=function(){this._svg.focus({preventScroll:!0}),this._setFocused(!0)},ee.prototype.restoreFocus=function(){document.activeElement===document.body&&this.focus()},ee.prototype.isFocused=function(){return this._focused},ee.prototype.getDefaultLayer=function(){return this.getLayer(dp,Jl)},ee.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");let o=this._layers[e];if(o||(o=this._layers[e]=this._createLayer(e,t)),typeof t<"u"&&o.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return o.group},ee.prototype._getChildIndex=function(e){return en(this._layers,function(t,o){return o.visible&&e>=o.index&&t++,t},0)},ee.prototype._createLayer=function(e,t){typeof t>"u"&&(t=up);const o=this._getChildIndex(t);return{group:Ul(this._viewport,"layer-"+e,o),index:t,visible:!0}},ee.prototype.showLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const o=this._viewport,i=t.group,a=t.index;if(t.visible)return i;const l=this._getChildIndex(a);return o.insertBefore(i,o.childNodes[l]||null),t.visible=!0,i},ee.prototype.hideLayer=function(e){if(!e)throw new Error("must specify a name");const t=this._layers[e];if(!t)throw new Error("layer <"+e+"> does not exist");const o=t.group;return t.visible&&(Lt(o),t.visible=!1),o},ee.prototype._removeLayer=function(e){const t=this._layers[e];t&&(delete this._layers[e],Lt(t.group))},ee.prototype.getActiveLayer=function(){const e=this._findPlaneForRoot(this.getRootElement());return e?e.layer:null},ee.prototype.findRoot=function(e){return typeof e=="string"&&(e=this._elementRegistry.get(e)),e?(this._findPlaneForRoot(sp(e))||{}).rootElement:void 0},ee.prototype.getRootElements=function(){return this._planes.map(function(e){return e.rootElement})},ee.prototype._findPlaneForRoot=function(e){return gt(this._planes,function(t){return t.rootElement===e})},ee.prototype.getContainer=function(){return this._container},ee.prototype._updateMarker=function(e,t,o){let i;e.id||(e=this._elementRegistry.get(e)),e.markers=e.markers||new Set,i=this._elementRegistry._elements[e.id],i&&(Z([i.gfx,i.secondaryGfx],function(a){a&&(o?(e.markers.add(t),Ge(a).add(t)):(e.markers.delete(t),Ge(a).remove(t)))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!o}))},ee.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},ee.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},ee.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),e.markers?e.markers.has(t):!1},ee.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},ee.prototype.getRootElement=function(){const e=this._rootElement;return e||this._planes.length?e:this.setRootElement(this.addRootElement(null))},ee.prototype.addRootElement=function(e){const t=this._rootsIdx++;e||(e={id:"__implicitroot_"+t,children:[],isImplicit:!0});const o=e.layer="root-"+t;this._ensureValid("root",e);const i=this.getLayer(o,Jl);return this.hideLayer(o),this._addRoot(e,i),this._planes.push({rootElement:e,layer:i}),e},ee.prototype.removeRootElement=function(e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),!!this._findPlaneForRoot(e))return this._removeRoot(e),this._removeLayer(e.layer),this._planes=this._planes.filter(function(o){return o.rootElement!==e}),this._rootElement===e&&(this._rootElement=null),e},ee.prototype.setRootElement=function(e){if(e===this._rootElement)return e;let t;if(!e)throw new Error("rootElement required");return t=this._findPlaneForRoot(e),t||(e=this.addRootElement(e)),this._setRoot(e),e},ee.prototype._removeRoot=function(e){const t=this._elementRegistry,o=this._eventBus;o.fire("root.remove",{element:e}),o.fire("root.removed",{element:e}),t.remove(e)},ee.prototype._addRoot=function(e,t){const o=this._elementRegistry,i=this._eventBus;i.fire("root.add",{element:e}),o.add(e,t),i.fire("root.added",{element:e,gfx:t})},ee.prototype._setRoot=function(e,t){const o=this._rootElement;o&&(this._elementRegistry.updateGraphics(o,null,!0),this.hideLayer(o.layer)),e&&(t||(t=this._findPlaneForRoot(e).layer),this._elementRegistry.updateGraphics(e,this._svg,!0),this.showLayer(e.layer)),this._rootElement=e,this._eventBus.fire("root.set",{element:e})},ee.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element <"+t.id+"> already exists");const o=fp[e];if(!fl(o,function(a){return typeof t[a]<"u"}))throw new Error("must supply { "+o.join(", ")+" } with "+e)},ee.prototype._setParent=function(e,t,o){lt(t.children,e,o),e.parent=t},ee.prototype._addElement=function(e,t,o,i){o=o||this.getRootElement();const a=this._eventBus,l=this._graphicsFactory;this._ensureValid(e,t),a.fire(e+".add",{element:t,parent:o}),this._setParent(t,o,i);const r=l.create(e,t,i);return this._elementRegistry.add(t,r),l.update(e,t,r),a.fire(e+".added",{element:t,gfx:r}),t},ee.prototype.addShape=function(e,t,o){return this._addElement("shape",e,t,o)},ee.prototype.addConnection=function(e,t,o){return this._addElement("connection",e,t,o)},ee.prototype._removeElement=function(e,t){const o=this._elementRegistry,i=this._graphicsFactory,a=this._eventBus;if(e=o.get(e.id||e),!!e)return a.fire(t+".remove",{element:e}),i.remove(e),gn(e.parent&&e.parent.children,e),e.parent=null,a.fire(t+".removed",{element:e}),o.remove(e),e},ee.prototype.removeShape=function(e){return this._removeElement(e,"shape")},ee.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},ee.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},ee.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},ee.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},ee.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return structuredClone(this._cachedViewbox);const t=this._viewport,o=this.getSize();let i,a,l,r,s,d,c;if(e)this._changeViewbox(function(){s=Math.min(o.width/e.width,o.height/e.height);const f=this._svg.createSVGMatrix().scale(s).translate(-e.x,-e.y);Yo(t,f)});else return l=this._rootElement?this.getActiveLayer():null,i=l&&l.getBBox()||{},r=Yo(t),a=r?r.matrix:ff(),s=Gn(a.a,1e3),d=Gn(-a.e||0,1e3),c=Gn(-a.f||0,1e3),e=this._cachedViewbox={x:d?d/s:0,y:c?c/s:0,width:o.width/s,height:o.height/s,scale:s,inner:{width:i.width||0,height:i.height||0,x:i.x||0,y:i.y||0},outer:o},e;return e},ee.prototype.scroll=function(e){const t=this._viewport;let o=t.getCTM();return e&&this._changeViewbox(function(){e=ie({dx:0,dy:0},e||{}),o=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(o),Yl(t,o)}),{x:o.e,y:o.f}},ee.prototype.scrollToElement=function(e,t){let o=100;typeof e=="string"&&(e=this._elementRegistry.get(e));const i=this.findRoot(e);if(i!==this.getRootElement()&&this.setRootElement(i),i===e)return;t||(t={}),typeof t=="number"&&(o=t),t={top:t.top||o,right:t.right||o,bottom:t.bottom||o,left:t.left||o};const a=Wn(e),l=qn(a),r=this.viewbox(),s=this.zoom();let d,c;r.y+=t.top/s,r.x+=t.left/s,r.width-=(t.right+t.left)/s,r.height-=(t.bottom+t.top)/s;const f=qn(r);if(!(a.width<r.width&&a.height<r.height))d=a.x-r.x,c=a.y-r.y;else{const p=Math.max(0,l.right-f.right),h=Math.min(0,l.left-f.left),m=Math.max(0,l.bottom-f.bottom),g=Math.min(0,l.top-f.top);d=p||h,c=m||g}this.scroll({dx:-d*s,dy:-c*s})},ee.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if(e==="fit-viewport")return this._fitViewport(t);let o,i;return this._changeViewbox(function(){typeof t!="object"&&(o=this.viewbox().outer,t={x:o.width/2,y:o.height/2}),i=this._setZoom(e,t)}),Gn(i.a,1e3)};function Yl(e,t){const o="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",o)}ee.prototype._fitViewport=function(e){const t=this.viewbox(),o=t.outer,i=t.inner;let a,l;return i.x>=0&&i.y>=0&&i.x+i.width<=o.width&&i.y+i.height<=o.height&&!e?l={x:0,y:0,width:Math.max(i.width+i.x,o.width),height:Math.max(i.height+i.y,o.height)}:(a=Math.min(1,o.width/i.width,o.height/i.height),l={x:i.x+(e?i.width/2-o.width/a/2:0),y:i.y+(e?i.height/2-o.height/a/2:0),width:o.width/a,height:o.height/a}),this.viewbox(l),this.viewbox(!1).scale},ee.prototype._setZoom=function(e,t){const o=this._svg,i=this._viewport,a=o.createSVGMatrix(),l=o.createSVGPoint();let r,s,d,c,f;d=i.getCTM();const u=d.a;return t?(r=ie(l,t),s=r.matrixTransform(d.inverse()),c=a.translate(s.x,s.y).scale(1/u*e).translate(-s.x,-s.y),f=d.multiply(c)):f=a.scale(e),Yl(this._viewport,f),f},ee.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},ee.prototype.getAbsoluteBBox=function(e){const t=this.viewbox();let o;e.waypoints?o=this.getGraphics(e).getBBox():o=e;const i=o.x*t.scale-t.x*t.scale,a=o.y*t.scale-t.y*t.scale,l=o.width*t.scale,r=o.height*t.scale;return{x:i,y:a,width:l,height:r}},ee.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var tn="data-element-id";function Ue(e){this._elements={},this._eventBus=e}Ue.$inject=["eventBus"],Ue.prototype.add=function(e,t,o){var i=e.id;this._validateId(i),ce(t,tn,i),o&&ce(o,tn,i),this._elements[i]={element:e,gfx:t,secondaryGfx:o}},Ue.prototype.remove=function(e){var t=this._elements,o=e.id||e,i=o&&t[o];i&&(ce(i.gfx,tn,""),i.secondaryGfx&&ce(i.secondaryGfx,tn,""),delete t[o])},Ue.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var o=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,o,i)},Ue.prototype.updateGraphics=function(e,t,o){var i=e.id||e,a=this._elements[i];return o?a.secondaryGfx=t:a.gfx=t,t&&ce(t,tn,i),t},Ue.prototype.get=function(e){var t;typeof e=="string"?t=e:t=e&&ce(e,tn);var o=this._elements[t];return o&&o.element},Ue.prototype.filter=function(e){var t=[];return this.forEach(function(o,i){e(o,i)&&t.push(o)}),t},Ue.prototype.find=function(e){for(var t=this._elements,o=Object.keys(t),i=0;i<o.length;i++){var a=o[i],l=t[a],r=l.element,s=l.gfx;if(e(r,s))return r}},Ue.prototype.getAll=function(){return this.filter(function(e){return e})},Ue.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(o){var i=t[o],a=i.element,l=i.gfx;return e(a,l)})},Ue.prototype.getGraphics=function(e,t){var o=e.id||e,i=this._elements[o];return i&&(t?i.secondaryGfx:i.gfx)},Ue.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};function pp(e,t,o,i){var a=o.inverse;return Object.defineProperty(e,"remove",{value:function(l){var r=this.indexOf(l);return r!==-1&&(this.splice(r,1),t.unset(l,a,i)),l}}),Object.defineProperty(e,"contains",{value:function(l){return this.indexOf(l)!==-1}}),Object.defineProperty(e,"add",{value:function(l,r){var s=this.indexOf(l);if(typeof r>"u"){if(s!==-1)return;r=this.length}s!==-1&&this.splice(s,1),this.splice(r,0,l),s===-1&&t.set(l,a,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function hp(e){return e.__refs_collection===!0}function mp(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function ql(e,t,o){var i=pp(o[t.name]||[],e,t,o);Object.defineProperty(o,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach(function(a){e.set(a,t.inverse,o)})}function gp(e,t,o){var i=t.inverse,a=o[t.name];Object.defineProperty(o,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return a},set:function(l){if(l!==a){var r=a;a=null,r&&e.unset(r,i,o),a=l,e.set(a,i,o)}}})}function qe(e,t){if(!(this instanceof qe))return new qe(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}qe.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?ql(this,t,e):gp(this,t,e)},qe.prototype.ensureRefsCollection=function(e,t){var o=e[t.name];return hp(o)||ql(this,t,e),o},qe.prototype.ensureBound=function(e,t){mp(e,t)||this.bind(e,t)},qe.prototype.unset=function(e,t,o){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(o):e[t.name]=void 0)},qe.prototype.set=function(e,t,o){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(o):e[t.name]=o)};var ni=new qe({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Gl=new qe({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Kl=new qe({name:"attachers",collection:!0},{name:"host"}),Xl=new qe({name:"outgoing",collection:!0},{name:"source"}),Zl=new qe({name:"incoming",collection:!0},{name:"target"});function nn(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,o=this.labels;!e&&t?o.remove(t):o.add(e,0)}}),ni.bind(this,"parent"),Gl.bind(this,"labels"),Xl.bind(this,"outgoing"),Zl.bind(this,"incoming")}function wn(){nn.call(this),ni.bind(this,"children"),Kl.bind(this,"host"),Kl.bind(this,"attachers")}Mt(wn,nn);function Ql(){nn.call(this),ni.bind(this,"children")}Mt(Ql,wn);function er(){wn.call(this),Gl.bind(this,"labelTarget")}Mt(er,wn);function tr(){nn.call(this),Xl.bind(this,"source"),Zl.bind(this,"target")}Mt(tr,nn);var yp={connection:tr,shape:wn,label:er,root:Ql};function bp(e,t){var o=yp[e];if(!o)throw new Error("unknown type: <"+e+">");return ie(new o,t)}function wp(e){return e instanceof nn}function st(){this._uid=12}st.prototype.createRoot=function(e){return this.create("root",e)},st.prototype.createLabel=function(e){return this.create("label",e)},st.prototype.createShape=function(e){return this.create("shape",e)},st.prototype.createConnection=function(e){return this.create("connection",e)},st.prototype.create=function(e,t){return t=ie({},t||{}),t.id||(t.id=e+"_"+this._uid++),bp(e,t)};var Kn="__fn",nr=1e3,vp=Array.prototype.slice;function ze(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}ze.prototype.on=function(e,t,o,i){if(e=Ne(e)?e:[e],mt(t)&&(i=o,o=t,t=nr),!We(t))throw new Error("priority must be a number");var a=o;i&&(a=Do(o,i),a[Kn]=o[Kn]||o);var l=this;e.forEach(function(r){l._addListener(r,{priority:t,callback:a,next:null})})},ze.prototype.once=function(e,t,o,i){var a=this;if(mt(t)&&(i=o,o=t,t=nr),!We(t))throw new Error("priority must be a number");function l(){l.__isTomb=!0;var r=o.apply(i,arguments);return a.off(e,l),r}l[Kn]=o,this.on(e,t,l)},ze.prototype.off=function(e,t){e=Ne(e)?e:[e];var o=this;e.forEach(function(i){o._removeListener(i,t)})},ze.prototype.createEvent=function(e){var t=new vn;return t.init(e),t},ze.prototype.fire=function(e,t){var o,i,a,l;if(l=vp.call(arguments),typeof e=="object"&&(t=e,e=t.type),!e)throw new Error("no event type specified");if(i=this._listeners[e],!!i){t instanceof vn?o=t:o=this.createEvent(t),l[0]=o;var r=o.type;e!==r&&(o.type=e);try{a=this._invokeListeners(o,l,i)}finally{e!==r&&(o.type=r)}return a===void 0&&o.defaultPrevented&&(a=!1),a}},ze.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},ze.prototype._destroy=function(){this._listeners={}},ze.prototype._invokeListeners=function(e,t,o){for(var i;o&&!e.cancelBubble;)i=this._invokeListener(e,t,o),o=o.next;return i},ze.prototype._invokeListener=function(e,t,o){var i;if(o.callback.__isTomb)return i;try{i=Cp(o.callback,t),i!==void 0&&(e.returnValue=i,e.stopPropagation()),i===!1&&e.preventDefault()}catch(a){if(!this.handleError(a))throw console.error("unhandled error in event listener",a),a}return i},ze.prototype._addListener=function(e,t){var o=this._getListeners(e),i;if(!o){this._setListeners(e,t);return}for(;o;){if(o.priority<t.priority){t.next=o,i?i.next=t:this._setListeners(e,t);return}i=o,o=o.next}i.next=t},ze.prototype._getListeners=function(e){return this._listeners[e]},ze.prototype._setListeners=function(e,t){this._listeners[e]=t},ze.prototype._removeListener=function(e,t){var o=this._getListeners(e),i,a,l;if(!t){this._setListeners(e,null);return}for(;o;)i=o.next,l=o.callback,(l===t||l[Kn]===t)&&(a?a.next=i:this._setListeners(e,i)),a=o,o=i};function vn(){}vn.prototype.stopPropagation=function(){this.cancelBubble=!0},vn.prototype.preventDefault=function(){this.defaultPrevented=!0},vn.prototype.init=function(e){ie(this,e||{})};function Cp(e,t){return e.apply(null,t)}function Xn(e){return e.childNodes[0]}function kp(e){return e.parentNode.childNodes[1]}function Zn(e,t,o){var i=pf();i.setTranslate(t,o),Yo(e,i)}function Je(e,t){this._eventBus=e,this._elementRegistry=t}Je.$inject=["eventBus","elementRegistry"],Je.prototype._getChildrenContainer=function(e){var t=this._elementRegistry.getGraphics(e),o;return e.parent?(o=kp(t),o||(o=Se("g"),Ge(o).add("djs-children"),Ee(t.parentNode,o))):o=t,o},Je.prototype._clear=function(e){var t=Xn(e);return Tf(t),t},Je.prototype._createContainer=function(e,t,o,i){var a=Se("g");Ge(a).add("djs-group"),typeof o<"u"?or(a,t,t.childNodes[o]):Ee(t,a);var l=Se("g");Ge(l).add("djs-element"),Ge(l).add("djs-"+e),i&&Ge(l).add("djs-frame"),Ee(a,l);var r=Se("g");return Ge(r).add("djs-visual"),Ee(l,r),l},Je.prototype.create=function(e,t,o){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,o,Sl(t))},Je.prototype.updateContainments=function(e){var t=this,o=this._elementRegistry,i;i=en(e,function(a,l){return l.parent&&(a[l.parent.id]=l.parent),a},{}),Z(i,function(a){var l=a.children;if(l){var r=t._getChildrenContainer(a);Z(l.slice().reverse(),function(s){var d=o.getGraphics(s);or(d.parentNode,r)})}})},Je.prototype.drawShape=function(e,t,o={}){var i=this._eventBus;return i.fire("render.shape",{gfx:e,element:t,attrs:o})},Je.prototype.getShapePath=function(e){var t=this._eventBus;return t.fire("render.getShapePath",e)},Je.prototype.drawConnection=function(e,t,o={}){var i=this._eventBus;return i.fire("render.connection",{gfx:e,element:t,attrs:o})},Je.prototype.getConnectionPath=function(e){var t=this._eventBus;return t.fire("render.getConnectionPath",e)},Je.prototype.update=function(e,t,o){if(t.parent){var i=this._clear(o);if(e==="shape")this.drawShape(i,t),Zn(o,t.x,t.y);else if(e==="connection")this.drawConnection(i,t);else throw new Error("unknown type: "+e);t.hidden?ce(o,"display","none"):ce(o,"display","block")}},Je.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);Lt(t.parentNode)};function or(e,t,o){var i=o||t.firstChild;e!==i&&t.insertBefore(e,i)}const xp={__depends__:[Sf],__init__:["canvas"],canvas:["type",ee],elementRegistry:["type",Ue],elementFactory:["type",st],eventBus:["type",ze],graphicsFactory:["type",Je]};function Sp(e){var t=new ul(e);return t.init(),t}function Bp(e){e=e||{};var t={config:["value",e]},o=[t,xp].concat(e.modules||[]);return Sp(o)}function Cn(e,t){this._injector=t||Bp(e),this.get("eventBus").fire("diagram.init")}Cn.prototype.get=function(e,t){return this._injector.get(e,t)},Cn.prototype.invoke=function(e,t,o){return this._injector.invoke(e,t,o)},Cn.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Cn.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};function ir(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function Qn(e){return e.originalEvent||e.srcEvent}function oi(e){ir(e),ir(Qn(e))}function kn(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}var ar=1500;function lr(e,t,o){var i=this,a=o.get("dragging",!1);function l(r){if(!r.hover){var s=r.originalEvent,d=i._findTargetGfx(s),c=d&&e.get(d);d&&c&&(r.stopPropagation(),a.hover({element:c,gfx:d}),a.move(s))}}a&&t.on("drag.start",function(r){t.once("drag.move",ar,function(s){l(s)})}),(function(){var r,s;t.on("element.hover",function(d){r=d.gfx,s=d.element}),t.on("element.hover",ar,function(d){s&&t.fire("element.out",{element:s,gfx:r})}),t.on("element.out",function(){r=null,s=null})})(),this._findTargetGfx=function(r){var s,d;if(r instanceof MouseEvent)return s=kn(r),d=document.elementFromPoint(s.x,s.y),Ep(d)}}lr.$inject=["elementRegistry","eventBus","injector"];function Ep(e){return Xo(e,"svg, .djs-element",!0)}const _p={__init__:["hoverFix"],hoverFix:["type",lr]};function jp(){return/mac/i.test(navigator.platform)}function rr(e,t){return(Qn(e)||e).button===t}function eo(e){return rr(e,0)}function Vp(e){return rr(e,1)}function Tp(e){var t=Qn(e)||e;return eo(e)&&t.shiftKey}function Np(e){return!0}function to(e){return eo(e)||Vp(e)}var sr=500;function cr(e,t,o){var i=this;function a(B,_,T){if(!s(B,_)){var j,D,A;T?D=t.getGraphics(T):(j=_.delegateTarget||_.target,j&&(D=j,T=t.get(D))),!(!D||!T)&&(A=e.fire(B,{element:T,gfx:D,originalEvent:_}),A===!1&&(_.stopPropagation(),_.preventDefault()))}}var l={};function r(B){return l[B]}function s(B,_){var T=c[B]||eo;return!T(_)}var d={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},c={"element.contextmenu":Np,"element.mousedown":to,"element.mouseup":to,"element.click":to,"element.dblclick":to};function f(B,_,T){var j=d[B];if(!j)throw new Error("unmapped DOM event name <"+B+">");return a(j,_,T)}var u="svg, .djs-element";function p(B,_,T,j){var D=l[T]=function(A){a(T,A)};j&&(c[T]=j),D.$delegate=Vl.bind(B,u,_,D)}function h(B,_,T){var j=r(T);j&&Vl.unbind(B,_,j.$delegate)}function m(B){Z(d,function(_,T){p(B,T,_)})}function g(B){Z(d,function(_,T){h(B,T,_)})}e.on("canvas.destroy",function(B){g(B.svg)}),e.on("canvas.init",function(B){m(B.svg)}),e.on(["shape.added","connection.added"],function(B){var _=B.element,T=B.gfx;e.fire("interactionEvents.createHit",{element:_,gfx:T})}),e.on(["shape.changed","connection.changed"],sr,function(B){var _=B.element,T=B.gfx;e.fire("interactionEvents.updateHit",{element:_,gfx:T})}),e.on("interactionEvents.createHit",sr,function(B){var _=B.element,T=B.gfx;i.createDefaultHit(_,T)}),e.on("interactionEvents.updateHit",function(B){var _=B.element,T=B.gfx;i.updateDefaultHit(_,T)});var b=S("djs-hit djs-hit-stroke"),k=S("djs-hit djs-hit-click-stroke"),v=S("djs-hit djs-hit-all"),w=S("djs-hit djs-hit-no-move"),C={all:v,"click-stroke":k,stroke:b,"no-move":w};function S(B,_){return _=ie({stroke:"white",strokeWidth:15},_||{}),o.cls(B,["no-fill","no-border"],_)}function y(B,_){var T=C[_];if(!T)throw new Error("invalid hit type <"+_+">");return ce(B,T),B}function E(B,_){Ee(B,_)}this.removeHits=function(B){var _=Rf(".djs-hit",B);Z(_,Lt)},this.createDefaultHit=function(B,_){var T=B.waypoints,j=B.isFrame,D;return T?this.createWaypointsHit(_,T):(D=j?"stroke":"all",this.createBoxHit(_,D,{width:B.width,height:B.height}))},this.createWaypointsHit=function(B,_){var T=Ko(_);return y(T,"stroke"),E(B,T),T},this.createBoxHit=function(B,_,T){T=ie({x:0,y:0},T);var j=Se("rect");return y(j,_),ce(j,T),E(B,j),j},this.updateDefaultHit=function(B,_){var T=mn(".djs-hit",_);if(T)return B.waypoints?Cl(T,B.waypoints):ce(T,{width:B.width,height:B.height}),T},this.fire=a,this.triggerMouseEvent=f,this.mouseHandler=r,this.registerEvent=p,this.unregisterEvent=h}cr.$inject=["eventBus","elementRegistry","styles"];const $p={__init__:["interactionEvents"],interactionEvents:["type",cr]};function on(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var o=this;e.on(["shape.remove","connection.remove"],function(i){var a=i.element;o.deselect(a)}),e.on(["diagram.clear","root.set"],function(i){o.select(null)})}on.$inject=["eventBus","canvas"],on.prototype.deselect=function(e){var t=this._selectedElements,o=t.indexOf(e);if(o!==-1){var i=t.slice();t.splice(o,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},on.prototype.get=function(){return this._selectedElements},on.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1},on.prototype.select=function(e,t){var o=this._selectedElements,i=o.slice();Ne(e)||(e=e?[e]:[]);var a=this._canvas,l=a.getRootElement();e=e.filter(function(r){var s=a.findRoot(r);return l===s}),t?Z(e,function(r){o.indexOf(r)===-1&&o.push(r)}):this._selectedElements=o=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:o})};var dr="hover",ur="selected";function fr(e,t){this._canvas=e;function o(a,l){e.addMarker(a,l)}function i(a,l){e.removeMarker(a,l)}t.on("element.hover",function(a){o(a.element,dr)}),t.on("element.out",function(a){i(a.element,dr)}),t.on("selection.changed",function(a){function l(c){i(c,ur)}function r(c){o(c,ur)}var s=a.oldSelection,d=a.newSelection;Z(s,function(c){d.indexOf(c)===-1&&l(c)}),Z(d,function(c){s.indexOf(c)===-1&&r(c)})})}fr.$inject=["canvas","eventBus"];function pr(e,t,o,i){e.on("create.end",500,function(a){var l=a.context,r=l.canExecute,s=l.elements,d=l.hints||{},c=d.autoSelect;if(r){if(c===!1)return;Ne(c)?t.select(c):t.select(s.filter(Mp))}}),e.on("connect.end",500,function(a){var l=a.context,r=l.connection;r&&t.select(r)}),e.on("shape.move.end",500,function(a){var l=a.previousSelection||[],r=i.get(a.context.shape.id),s=gt(l,function(d){return r.id===d.id});s||t.select(r)}),e.on("element.click",function(a){if(eo(a)){var l=a.element;l===o.getRootElement()&&(l=null);var r=t.isSelected(l),s=t.get().length>1,d=Tp(a);if(r&&s)return d?t.deselect(l):t.select(l);r?t.deselect(l):t.select(l,d)}})}pr.$inject=["eventBus","selection","canvas","elementRegistry"];function Mp(e){return!e.hidden}const no={__init__:["selectionVisuals","selectionBehavior"],__depends__:[$p],selection:["type",on],selectionVisuals:["type",fr],selectionBehavior:["type",pr]};var Lp=/^djs-cursor-.*$/;function ii(e){var t=Vf(document.body);t.removeMatching(Lp),e&&t.add("djs-cursor-"+e)}function hr(){ii(null)}var Pp=5e3;function mr(e,t){t=t||"element.click";function o(){return!1}return e.once(t,Pp,o),function(){e.off(t,o)}}function gr(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function an(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Rp(e,t){return e=Ne(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}var ln=Math.round,yr="djs-drag-active";function Rt(e){e.preventDefault()}function Ap(e){return typeof TouchEvent<"u"&&e instanceof TouchEvent}function Op(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function br(e,t,o,i){var a={threshold:5,trapClick:!0},l;function r(w){var C=t.viewbox(),S=t._container.getBoundingClientRect();return{x:C.x+(w.x-S.left)/C.scale,y:C.y+(w.y-S.top)/C.scale}}function s(w,C){C=C||l;var S=e.createEvent(ie({},C.payload,C.data,{isTouch:C.isTouch}));return e.fire("drag."+w,S)===!1?!1:e.fire(C.prefix+"."+w,S)}function d(w){var C=w.filter(function(S){return i.get(S.id)});C.length&&o.select(C)}function c(w,C){var S=l.payload,y=l.displacement,E=l.globalStart,B=kn(w),_=an(B,E),T=l.localStart,j=r(B),D=an(j,T);if(!l.active&&(C||Op(_)>l.threshold)){if(ie(S,{x:ln(T.x+y.x),y:ln(T.y+y.y),dx:0,dy:0},{originalEvent:w}),s("start")===!1)return b();l.active=!0,l.keepSelection||(S.previousSelection=o.get(),o.select(null)),l.cursor&&ii(l.cursor),t.addMarker(t.getRootElement(),yr)}oi(w),l.active&&(ie(S,{x:ln(j.x+y.x),y:ln(j.y+y.y),dx:ln(D.x),dy:ln(D.y)},{originalEvent:w}),s("move"))}function f(w){var C,S=!0;l.active&&(w&&(l.payload.originalEvent=w,oi(w)),S=s("end")),S===!1&&s("rejected"),C=k(S!==!0),s("ended",C)}function u(w){Rp("Escape",w)&&(Rt(w),b())}function p(w){var C;l.active&&(C=mr(e),setTimeout(C,400),Rt(w)),f(w)}function h(w){c(w)}function m(w){var C=l.payload;C.hoverGfx=w.gfx,C.hover=w.element,s("hover")}function g(w){s("out");var C=l.payload;C.hoverGfx=null,C.hover=null}function b(w){var C;if(l){var S=l.active;S&&s("cancel"),C=k(w),S&&s("canceled",C)}}function k(w){var C,S;s("cleanup"),hr(),l.trapClick?S=p:S=f,ke.unbind(document,"mousemove",c),ke.unbind(document,"dragstart",Rt),ke.unbind(document,"selectstart",Rt),ke.unbind(document,"mousedown",S,!0),ke.unbind(document,"mouseup",S,!0),ke.unbind(document,"keyup",u),ke.unbind(document,"touchstart",h,!0),ke.unbind(document,"touchcancel",b,!0),ke.unbind(document,"touchmove",c,!0),ke.unbind(document,"touchend",f,!0),e.off("element.hover",m),e.off("element.out",g),t.removeMarker(t.getRootElement(),yr);var y=l.payload.previousSelection;return w!==!1&&y&&!o.get().length&&d(y),C=l,l=null,C}function v(w,C,S,y){l&&b(!1),typeof C=="string"&&(y=S,S=C,C=null),y=ie({},a,y||{});var E=y.data||{},B,_,T,j,D;y.trapClick?j=p:j=f,w?(B=Qn(w)||w,_=kn(w),oi(w),B.type==="dragstart"&&Rt(B)):(B=null,_={x:0,y:0}),T=r(_),C||(C=T),D=Ap(B),l=ie({prefix:S,data:E,payload:{},globalStart:_,displacement:an(C,T),localStart:T,isTouch:D},y),y.manual||(D?(ke.bind(document,"touchstart",h,!0),ke.bind(document,"touchcancel",b,!0),ke.bind(document,"touchmove",c,!0),ke.bind(document,"touchend",f,!0)):(ke.bind(document,"mousemove",c),ke.bind(document,"dragstart",Rt),ke.bind(document,"selectstart",Rt),ke.bind(document,"mousedown",j,!0),ke.bind(document,"mouseup",j,!0)),ke.bind(document,"keyup",u),e.on("element.hover",m),e.on("element.out",g)),s("init"),y.autoActivate&&c(w,!0)}e.on("diagram.destroy",b),this.init=v,this.move=c,this.hover=m,this.out=g,this.end=f,this.cancel=b,this.context=function(){return l},this.setOptions=function(w){ie(a,w)}}br.$inject=["eventBus","canvas","selection","elementRegistry"];const wr={__depends__:[_p,no],dragging:["type",br]};function vr(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}vr.prototype.next=function(){return this._prefix+ ++this._counter};const Fp=new vr("ps");var Ip=["marker-start","marker-mid","marker-end"],zp=["circle","ellipse","line","path","polygon","polyline","path","rect"];function St(e,t,o,i){this._elementRegistry=e,this._canvas=o,this._styles=i}St.$inject=["elementRegistry","eventBus","canvas","styles"],St.prototype.cleanUp=function(){console.warn("PreviewSupport#cleanUp is deprecated and will be removed in future versions. You do not need to manually clean up previews anymore. cf. https://github.com/bpmn-io/diagram-js/pull/906")},St.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},St.prototype.addDragger=function(e,t,o,i="djs-dragger"){o=o||this.getGfx(e);var a=yl(o),l=o.getBoundingClientRect();return this._cloneMarkers(Xn(a),i),ce(a,this._styles.cls(i,[],{x:l.top,y:l.left})),Ee(t,a),ce(a,"data-preview-support-element-id",e.id),a},St.prototype.addFrame=function(e,t){var o=Se("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return Ee(t,o),ce(o,"data-preview-support-element-id",e.id),o},St.prototype._cloneMarkers=function(e,t="djs-dragger",o=e){var i=this;e.childNodes&&e.childNodes.forEach(a=>{i._cloneMarkers(a,t,o)}),Up(e)&&Ip.forEach(function(a){if(ce(e,a)){var l=Dp(e,a,i._canvas.getContainer());l&&i._cloneMarker(o,e,l,a,t)}})},St.prototype._cloneMarker=function(e,t,o,i,a="djs-dragger"){var l=[o.id,a,Fp.next()].join("-"),r=mn("marker#"+o.id,e);e=e||this._canvas._svg;var s=r||yl(o);s.id=l,Ge(s).add(a);var d=mn(":scope > defs",e);d||(d=Se("defs"),Ee(e,d)),Ee(d,s);var c=Wp(s.id);ce(t,i,c)};function Dp(e,t,o){var i=Hp(ce(e,t));return mn("marker#"+i,o||document)}function Hp(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function Wp(e){return"url(#"+e+")"}function Up(e){return zp.indexOf(e.nodeName)!==-1}const Jp={__init__:["previewSupport"],previewSupport:["type",St]};function ai(e){this._commandStack=e.get("commandStack",!1)}ai.$inject=["injector"],ai.prototype.allowed=function(e,t){var o=!0,i=this._commandStack;return i&&(o=i.canExecute(e,t)),o===void 0?!0:o};const Cr={__init__:["rules"],rules:["type",ai]};var Yp="drop-ok",kr="drop-not-ok",xr="attach-ok",Sr="new-parent",Br="create",qp=2e3;function Er(e,t,o,i,a){function l(d,c,f,u,p){if(!c)return!1;d=Qt(d,function(v){var w=v.labelTarget;return!v.parent&&!(Hl(v)&&d.indexOf(w)!==-1)});var h=gt(d,function(v){return!rt(v)}),m=!1,g=!1,b=!1;jr(d)&&(m=a.allowed("shape.attach",{position:f,shape:h,target:c})),m||(jr(d)?b=a.allowed("shape.create",{position:f,shape:h,source:u,target:c}):b=a.allowed("elements.create",{elements:d,position:f,target:c}));var k=p.connectionTarget;return b||m?(h&&u&&(g=a.allowed("connection.create",{source:k===u?h:u,target:k===u?u:h,hints:{targetParent:c,targetAttach:m}})),{attach:m,connect:g}):b===null||m===null?null:!1}function r(d,c){[xr,Yp,kr,Sr].forEach(function(f){f===c?e.addMarker(d,f):e.removeMarker(d,f)})}o.on(["create.move","create.hover"],function(d){var c=d.context,f=c.elements,u=d.hover,p=c.source,h=c.hints||{};if(!u){c.canExecute=!1,c.target=null;return}_r(d);var m={x:d.x,y:d.y},g=c.canExecute=u&&l(f,u,m,p,h);u&&g!==null&&(c.target=u,g&&g.attach?r(u,xr):r(u,g?Sr:kr))}),o.on(["create.end","create.out","create.cleanup"],function(d){var c=d.hover;c&&r(c,null)}),o.on("create.end",function(d){var c=d.context,f=c.source,u=c.shape,p=c.elements,h=c.target,m=c.canExecute,g=m&&m.attach,b=m&&m.connect,k=c.hints||{};if(m===!1||!h)return!1;_r(d);var v={x:d.x,y:d.y};b?u=i.appendShape(f,u,v,h,{attach:g,connection:b===!0?{}:b,connectionTarget:k.connectionTarget}):(p=i.createElements(p,v,h,ie({},k,{attach:g})),u=gt(p,function(w){return!rt(w)})),ie(c,{elements:p,shape:u}),ie(d,{elements:p,shape:u})});function s(){var d=t.context();d&&d.prefix===Br&&t.cancel()}o.on("create.init",function(){o.on("elements.changed",s),o.once(["create.cancel","create.end"],qp,function(){o.off("elements.changed",s)})}),this.start=function(d,c,f){Ne(c)||(c=[c]);var u=gt(c,function(m){return!rt(m)});if(u){f=ie({elements:c,hints:{},shape:u},f||{}),Z(c,function(m){We(m.x)||(m.x=0),We(m.y)||(m.y=0)});var p=Qt(c,function(m){return!m.hidden}),h=Wn(p);Z(c,function(m){rt(m)&&(m.waypoints=yt(m.waypoints,function(g){return{x:g.x-h.x-h.width/2,y:g.y-h.y-h.height/2}})),ie(m,{x:m.x-h.x-h.width/2,y:m.y-h.y-h.height/2})}),t.init(d,Br,{cursor:"grabbing",autoActivate:!0,data:{shape:u,elements:c,context:f}})}}}Er.$inject=["canvas","dragging","eventBus","modeling","rules"];function _r(e){var t=e.context,o=t.createConstraints;o&&(o.left&&(e.x=Math.max(e.x,o.left)),o.right&&(e.x=Math.min(e.x,o.right)),o.top&&(e.y=Math.max(e.y,o.top)),o.bottom&&(e.y=Math.min(e.y,o.bottom)))}function jr(e){return e&&e.length===1&&!rt(e[0])}var Gp=750;function Vr(e,t,o,i,a){function l(r){var s=Se("g");ce(s,a.cls("djs-drag-group",["no-events"]));var d=Se("g");return r.forEach(function(c){var f;c.hidden||(c.waypoints?(f=o._createContainer("connection",d),o.drawConnection(Xn(f),c)):(f=o._createContainer("shape",d),o.drawShape(Xn(f),c),Zn(f,c.x,c.y)),i.addDragger(c,s,f))}),s}t.on("create.move",Gp,function(r){var s=r.hover,d=r.context,c=d.elements,f=d.dragGroup;f||(f=d.dragGroup=l(c));var u;s?(f.parentNode||(u=e.getActiveLayer(),Ee(u,f)),Zn(f,r.x,r.y)):Lt(f)}),t.on("create.cleanup",function(r){var s=r.context,d=s.dragGroup;d&&Lt(d)})}Vr.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];const Kp={__depends__:[wr,Jp,Cr,no],__init__:["create","createPreview"],create:["type",Er],createPreview:["type",Vr]};function Tr(e,t,o,i){function a(r,s){return i.allowed("connection.create",{source:r,target:s})}function l(r,s){return a(s,r)}e.on("connect.hover",function(r){var s=r.context,d=s.start,c=r.hover,f;if(s.hover=c,f=s.canExecute=a(d,c),!Oo(f)){if(f!==!1){s.source=d,s.target=c;return}f=s.canExecute=l(d,c),!Oo(f)&&f!==!1&&(s.source=c,s.target=d)}}),e.on(["connect.out","connect.cleanup"],function(r){var s=r.context;s.hover=null,s.source=null,s.target=null,s.canExecute=!1}),e.on("connect.end",function(r){var s=r.context,d=s.canExecute,c=s.connectionStart,f={x:r.x,y:r.y},u=s.source,p=s.target;if(!d)return!1;var h=null,m={connectionStart:li(s)?f:c,connectionEnd:li(s)?c:f};ht(d)&&(h=d),s.connection=o.connect(u,p,h,m)}),this.start=function(r,s,d,c){ht(d)||(c=d,d=tt(s)),t.init(r,"connect",{autoActivate:c,data:{shape:s,context:{start:s,connectionStart:d}}})}}Tr.$inject=["eventBus","dragging","modeling","rules"];function li(e){var t=e.hover,o=e.source,i=e.target;return t&&o&&t===o&&o!==i}var Xp=1100,Zp=900,Nr="connect-ok",$r="connect-not-ok";function Mr(e,t,o){var i=e.get("connectionPreview",!1);i&&t.on("connect.move",function(a){var l=a.context,r=l.canExecute,s=l.hover,d=l.source,c=l.start,f=l.startPosition,u=l.target,p=l.connectionStart||f,h=l.connectionEnd||{x:a.x,y:a.y},m=p,g=h;li(l)&&(m=h,g=p),i.drawPreview(l,r,{source:d||c,target:u||s,connectionStart:m,connectionEnd:g})}),t.on("connect.hover",Zp,function(a){var l=a.context,r=a.hover,s=l.canExecute;s!==null&&o.addMarker(r,s?Nr:$r)}),t.on(["connect.out","connect.cleanup"],Xp,function(a){var l=a.hover;l&&(o.removeMarker(l,Nr),o.removeMarker(l,$r))}),i&&t.on("connect.cleanup",function(a){i.cleanUp(a.context)})}Mr.$inject=["injector","eventBus","canvas"];const Qp={__depends__:[no,Cr,wr],__init__:["connectPreview"],connect:["type",Tr],connectPreview:["type",Mr]};var eh=15;function Lr(e,t){var o;function i(s){return r(s.originalEvent)}e.on("canvas.focus.changed",function(s){s.focused?e.on("element.mousedown",500,i):e.off("element.mousedown",i)});function a(s){var d=o.start,c=o.button,f=kn(s),u=an(f,d);if(!o.dragging&&th(u)>eh&&(o.dragging=!0,c===0&&mr(e),ii("grab")),o.dragging){var p=o.last||o.start;u=an(f,p),t.scroll({dx:u.x,dy:u.y}),o.last=f}s.preventDefault()}function l(s){ke.unbind(document,"mousemove",a),ke.unbind(document,"mouseup",l),o=null,hr()}function r(s){if(!Xo(s.target,".djs-draggable")){var d=s.button;if(!(d>=2||s.ctrlKey||s.shiftKey||s.altKey))return o={button:d,start:kn(s)},ke.bind(document,"mousemove",a),ke.bind(document,"mouseup",l),!0}}this.isActive=function(){return!!o}}Lr.$inject=["eventBus","canvas"];function th(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}const nh={__init__:["moveCanvas"],moveCanvas:["type",Lr]};function ri(e){return Math.log(e)/Math.log(10)}function Pr(e,t){var o=ri(e.min),i=ri(e.max),a=Math.abs(o)+Math.abs(i);return a/t}function oh(e,t){return Math.max(e.min,Math.min(e.max,t))}var ih=Math.sign||function(e){return e>=0?1:-1},si={min:.2,max:4},Rr=10,ah=.1,lh=.75;function nt(e,t,o){e=e||{},this._enabled=!1,this._canvas=o,this._container=o._container,this._handleWheel=Do(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||lh;var i=this;t.on("canvas.focus.changed",function(a){i._init(a.focused&&e.enabled!==!1)})}nt.$inject=["config.zoomScroll","eventBus","canvas"],nt.prototype.scroll=function(t){this._canvas.scroll(t)},nt.prototype.reset=function(){this._canvas.zoom("fit-viewport")},nt.prototype.zoom=function(t,o){var i=Pr(si,Rr*2);this._totalDelta+=t,Math.abs(this._totalDelta)>ah&&(this._zoom(t,o,i),this._totalDelta=0)},nt.prototype._handleWheel=function(t){if(this._canvas.isFocused()){var o=this._container;t.preventDefault();var i=t.ctrlKey||jp()&&t.metaKey,a=t.shiftKey,l=-1*this._scale,r;if(i?l*=t.deltaMode===0?.02:.32:l*=t.deltaMode===0?1:16,i){var s=o.getBoundingClientRect(),d={x:t.clientX-s.left,y:t.clientY-s.top};r=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*ih(t.deltaY)*l,this.zoom(r,d)}else a?r={dx:l*t.deltaY,dy:0}:r={dx:l*t.deltaX,dy:l*t.deltaY},this.scroll(r)}},nt.prototype.stepZoom=function(t,o){var i=Pr(si,Rr);this._zoom(t,o,i)},nt.prototype._zoom=function(e,t,o){var i=this._canvas,a=e>0?1:-1,l=ri(i.zoom()),r=Math.round(l/o)*o;r+=o*a;var s=Math.pow(10,r);i.zoom(oh(si,s),t)},nt.prototype.toggle=function(t){var o=this._container,i=this._handleWheel,a=this._enabled;return typeof t>"u"&&(t=!a),a!==t&&ke[t?"bind":"unbind"](o,"wheel",i,!1),this._enabled=t,t},nt.prototype._init=function(e){this.toggle(e)};const rh={__init__:["zoomScroll"],zoomScroll:["type",nt]};function Be(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}Be.$inject=["eventBus","injector"],Be.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";const o={command:e,context:t};this._pushAction(o),this._internalExecute(o),this._popAction()},Be.prototype.canExecute=function(e,t){const o={command:e,context:t},i=this._getHandler(e);let a=this._fire(e,"canExecute",o);if(a===void 0){if(!i)return!1;i.canExecute&&(a=i.canExecute(t))}return a},Be.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})},Be.prototype.undo=function(){let e=this._getUndoAction(),t;if(e){for(this._currentExecution.trigger="undo",this._pushAction(e);e&&(this._internalUndo(e),t=this._getUndoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Be.prototype.redo=function(){let e=this._getRedoAction(),t;if(e){for(this._currentExecution.trigger="redo",this._pushAction(e);e&&(this._internalExecute(e,!0),t=this._getRedoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Be.prototype.register=function(e,t){this._setHandler(e,t)},Be.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");const o=this._injector.instantiate(t);this.register(e,o)},Be.prototype.canUndo=function(){return!!this._getUndoAction()},Be.prototype.canRedo=function(){return!!this._getRedoAction()},Be.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Be.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Be.prototype._internalUndo=function(e){const t=e.command,o=e.context,i=this._getHandler(t);this._atomicDo(()=>{this._fire(t,"revert",e),i.revert&&this._markDirty(i.revert(o)),this._revertedAction(e),this._fire(t,"reverted",e)})},Be.prototype._fire=function(e,t,o){arguments.length<3&&(o=t,t=null);const i=t?[e+"."+t,t]:[e];let a;o=this._eventBus.createEvent(o);for(const l of i)if(a=this._eventBus.fire("commandStack."+l,o),o.cancelBubble)break;return a},Be.prototype._createId=function(){return this._uid++},Be.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Be.prototype._internalExecute=function(e,t){const o=e.command,i=e.context,a=this._getHandler(o);if(!a)throw new Error("no command handler registered for <"+o+">");this._pushAction(e),t||(this._fire(o,"preExecute",e),a.preExecute&&a.preExecute(i),this._fire(o,"preExecuted",e)),this._atomicDo(()=>{this._fire(o,"execute",e),a.execute&&this._markDirty(a.execute(i)),this._executedAction(e,t),this._fire(o,"executed",e)}),t||(this._fire(o,"postExecute",e),a.postExecute&&a.postExecute(i),this._fire(o,"postExecuted",e)),this._popAction()},Be.prototype._pushAction=function(e){const t=this._currentExecution,o=t.actions,i=o[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),o.push(e)},Be.prototype._popAction=function(){const e=this._currentExecution,t=e.trigger,o=e.actions,i=e.dirty;o.pop(),o.length||(this._eventBus.fire("elements.changed",{elements:Qu("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Be.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=Ne(e)?e:[e],t.dirty=t.dirty.concat(e))},Be.prototype._executedAction=function(e,t){const o=++this._stackIdx;t||this._stack.splice(o,this._stack.length,e)},Be.prototype._revertedAction=function(e){this._stackIdx--},Be.prototype._getHandler=function(e){return this._handlerMap[e]},Be.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};const sh={commandStack:["type",Be]};function rn(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(e){for(var o;o=e[0];)t(o);return e}}var ch=1e3;function Fe(e){this._eventBus=e}Fe.$inject=["eventBus"];function dh(e,t){return function(o){return e.call(t||null,o.context,o.command,o)}}Fe.prototype.on=function(e,t,o,i,a,l){if((mt(t)||We(t))&&(l=a,a=i,i=o,o=t,t=null),mt(o)&&(l=a,a=i,i=o,o=ch),ht(a)&&(l=a,a=!1),!mt(i))throw new Error("handlerFn must be a function");Ne(e)||(e=[e]);var r=this._eventBus;Z(e,function(s){var d=["commandStack",s,t].filter(function(c){return c}).join(".");r.on(d,o,a?dh(i,l):i,l)})},Fe.prototype.canExecute=ct("canExecute"),Fe.prototype.preExecute=ct("preExecute"),Fe.prototype.preExecuted=ct("preExecuted"),Fe.prototype.execute=ct("execute"),Fe.prototype.executed=ct("executed"),Fe.prototype.postExecute=ct("postExecute"),Fe.prototype.postExecuted=ct("postExecuted"),Fe.prototype.revert=ct("revert"),Fe.prototype.reverted=ct("reverted");function ct(e){return function(o,i,a,l,r){(mt(o)||We(o))&&(r=l,l=a,a=i,i=o,o=null),this.on(o,e,i,a,l,r)}}var uh=250,Ar=1400;function ci(e,t,o){Fe.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",Ar,function(a){var l=a.context,r=l.shapes,s=l.validatedShapes;l.shapes=Or(r),l.validatedShapes=Or(s)}),i&&t.on("shape.move.start",uh,function(a){var l=a.context,r=l.shapes,s=[];Z(r,function(d){Z(d.labels,function(c){!c.hidden&&l.shapes.indexOf(c)===-1&&s.push(c),d.labelTarget&&s.push(d)})}),Z(s,function(d){i.makeDraggable(l,d,!0)})}),this.preExecuted("elements.move",Ar,function(a){var l=a.context,r=l.closure,s=r.enclosedElements,d=[];Z(s,function(c){Z(c.labels,function(f){s[f.id]||d.push(f)})}),r.addAll(d)}),this.preExecute(["connection.delete","shape.delete"],function(a){var l=a.context,r=l.connection||l.shape;rn(r.labels,function(s){o.removeShape(s,{nested:!0})})}),this.execute("shape.delete",function(a){var l=a.context,r=l.shape,s=r.labelTarget;s&&(l.labelTargetIndex=Zo(s.labels,r),l.labelTarget=s,r.labelTarget=null)}),this.revert("shape.delete",function(a){var l=a.context,r=l.shape,s=l.labelTarget,d=l.labelTargetIndex;s&&(lt(s.labels,r,d),r.labelTarget=s)})}Mt(ci,Fe),ci.$inject=["injector","eventBus","modeling"];function Or(e){return Qt(e,function(t){return e.indexOf(t.labelTarget)===-1})}const fh={__init__:["labelSupport"],labelSupport:["type",ci]};function Fr(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const o=Math.random()*16|0;return(t==="x"?o:o&3|8).toString(16)})}function Ir(e,t){if(t){let o=e;return Object.keys(t).forEach(i=>{o=o.replace(new RegExp(`{${i}}`,"g"),t[i])}),o}return e}function Ke(e,...t){if(typeof Object.assign=="function")return Object.assign(e,...t);if(e==null)throw new TypeError("Cannot convert undefined or null to object");const o=Object(e);for(let i=0;i<t.length;i++){const a=t[i];if(a!=null)for(const l in a)Object.prototype.hasOwnProperty.call(a,l)&&(o[l]=a[l])}return o}function zr(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ph(e,t){Array.isArray(e)&&e.forEach(t)}var oo={exports:{}},Dr;function hh(){return Dr||(Dr=1,typeof Object.create=="function"?oo.exports=function(t,o){o&&(t.super_=o,t.prototype=Object.create(o.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:oo.exports=function(t,o){if(o){t.super_=o;var i=function(){};i.prototype=o.prototype,t.prototype=new i,t.prototype.constructor=t}}),oo.exports}var mh=hh();const xn=Bf(mh),gh={width:90,height:20};function At(){st.call(this),this._translate=Ir}xn(At,st),At.$inject=[],At.prototype.baseCreate=st.prototype.create,At.prototype.create=function(e,t){return e==="label"?this.baseCreate(e,Ke({type:"label"},gh,t)):this.createFlowElement(e,t)},At.prototype.createFlowElement=function(e,t){if(t==null||t===void 0||t==="")return this.baseCreate(e,t);t.businessObject=t.businessObject||{id:Fr()},e==="connection"&&(t.type="myline");const{businessObject:o}=t;o.type=t.type;const i=this._getDefaultSize(o.type);return t=Ke({businessObject:o,id:o.id},i,t),this.baseCreate(e,t)},At.prototype._getDefaultSize=function(e){let t={width:100,height:80};switch(e){case"startEvent":case"endEvent":case"myEvent":t={width:36,height:36};break;case"gatewayAnd":case"gatewayXor":case"gatewayInclusive":t={width:50,height:50};break;case"subprocess":case"userTask":case"scriptTask":t={width:100,height:80};break}return t};function io(e,t){this._modeling=e,this._canvas=t}io.$inject=["modeling","canvas"],io.prototype.preExecute=function(e){var t=this._modeling,o=e.elements,i=e.alignment;Z(o,function(a){var l={x:0,y:0};Zt(i.left)?l.x=i.left-a.x:Zt(i.right)?l.x=i.right-a.width-a.x:Zt(i.center)?l.x=i.center-Math.round(a.width/2)-a.x:Zt(i.top)?l.y=i.top-a.y:Zt(i.bottom)?l.y=i.bottom-a.height-a.y:Zt(i.middle)&&(l.y=i.middle-Math.round(a.height/2)-a.y),t.moveElements([a],l,a.parent)})},io.prototype.postExecute=function(e){};function ao(e){this._modeling=e}ao.$inject=["modeling"],ao.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var o=e.target||t.parent,i=e.shape,a=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,o,{attach:a.attach}),e.shape=i},ao.prototype.postExecute=function(e){var t=e.hints||{};yh(e.source,e.shape)||(t.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))};function yh(e,t){return Xu(e.outgoing,function(o){return o.target===t})}function lo(e,t){this._canvas=e,this._layouter=t}lo.$inject=["canvas","layouter"],lo.prototype.execute=function(e){var t=e.connection,o=e.source,i=e.target,a=e.parent,l=e.parentIndex,r=e.hints;if(!o||!i)throw new Error("source and target required");if(!a)throw new Error("parent required");return t.source=o,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,r)),this._canvas.addConnection(t,a,l),t},lo.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var ro=Math.round;function di(e){this._modeling=e}di.$inject=["modeling"],di.prototype.preExecute=function(e){var t=e.elements,o=e.parent,i=e.parentIndex,a=e.position,l=e.hints,r=this._modeling;Z(t,function(u){We(u.x)||(u.x=0),We(u.y)||(u.y=0)});var s=Qt(t,function(u){return!u.hidden}),d=Wn(s);Z(t,function(u){rt(u)&&(u.waypoints=yt(u.waypoints,function(p){return{x:ro(p.x-d.x-d.width/2+a.x),y:ro(p.y-d.y-d.height/2+a.y)}})),ie(u,{x:ro(u.x-d.x-d.width/2+a.x),y:ro(u.y-d.y-d.height/2+a.y)})});var c=wf(t),f={};Z(t,function(u){if(rt(u)){f[u.id]=We(i)?r.createConnection(f[u.source.id],f[u.target.id],i,u,u.parent||o,l):r.createConnection(f[u.source.id],f[u.target.id],u,u.parent||o,l);return}var p=ie({},l);c.indexOf(u)===-1&&(p.autoResize=!1),Hl(u)&&(p=of(p,["attach"])),f[u.id]=We(i)?r.createShape(u,Ho(u,["x","y","width","height"]),u.parent||o,i,p):r.createShape(u,Ho(u,["x","y","width","height"]),u.parent||o,p)}),e.elements=Zu(f)};var Hr=Math.round;function Bt(e){this._canvas=e}Bt.$inject=["canvas"],Bt.prototype.execute=function(e){var t=e.shape,o=e.position,i=e.parent,a=e.parentIndex;if(!i)throw new Error("parent required");if(!o)throw new Error("position required");return o.width!==void 0?ie(t,o):ie(t,{x:o.x-Hr(t.width/2),y:o.y-Hr(t.height/2)}),this._canvas.addShape(t,i,a),t},Bt.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t};function Sn(e){Bt.call(this,e)}Mt(Sn,Bt),Sn.$inject=["canvas"];var bh=Bt.prototype.execute;Sn.prototype.execute=function(e){var t=e.shape;return vh(t),t.labelTarget=e.labelTarget,bh.call(this,e)};var wh=Bt.prototype.revert;Sn.prototype.revert=function(e){return e.shape.labelTarget=null,wh.call(this,e)};function vh(e){["width","height"].forEach(function(t){typeof e[t]>"u"&&(e[t]=0)})}function Bn(e,t){this._canvas=e,this._modeling=t}Bn.$inject=["canvas","modeling"],Bn.prototype.preExecute=function(e){var t=this._modeling,o=e.connection;rn(o.incoming,function(i){t.removeConnection(i,{nested:!0})}),rn(o.outgoing,function(i){t.removeConnection(i,{nested:!0})})},Bn.prototype.execute=function(e){var t=e.connection,o=t.parent;return e.parent=o,e.parentIndex=Zo(o.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},Bn.prototype.revert=function(e){var t=e.connection,o=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,lt(o.children,t,i),this._canvas.addConnection(t,o),t};function ui(e,t){this._modeling=e,this._elementRegistry=t}ui.$inject=["modeling","elementRegistry"],ui.prototype.postExecute=function(e){var t=this._modeling,o=this._elementRegistry,i=e.elements;Z(i,function(a){o.get(a.id)&&(a.waypoints?t.removeConnection(a):t.removeShape(a))})};function En(e,t){this._canvas=e,this._modeling=t}En.$inject=["canvas","modeling"],En.prototype.preExecute=function(e){var t=this._modeling,o=e.shape;rn(o.incoming,function(i){t.removeConnection(i,{nested:!0})}),rn(o.outgoing,function(i){t.removeConnection(i,{nested:!0})}),rn(o.children,function(i){rt(i)?t.removeConnection(i,{nested:!0}):t.removeShape(i,{nested:!0})})},En.prototype.execute=function(e){var t=this._canvas,o=e.shape,i=o.parent;return e.oldParent=i,e.oldParentIndex=Zo(i.children,o),t.removeShape(o),o},En.prototype.revert=function(e){var t=this._canvas,o=e.shape,i=e.oldParent,a=e.oldParentIndex;return lt(i.children,o,a),t.addShape(o,i),o};function so(e){this._modeling=e}so.$inject=["modeling"];var Wr={x:"y",y:"x"};so.prototype.preExecute=function(e){var t=this._modeling,o=e.groups,i=e.axis,a=e.dimension;function l(b,k){b.range.min=Math.min(k[i],b.range.min),b.range.max=Math.max(k[i]+k[a],b.range.max)}function r(b){return b[i]+b[a]/2}function s(b){return b.length-1}function d(b){return b.max-b.min}function c(b,k){var v={y:0};v[i]=b-r(k),v[i]&&(v[Wr[i]]=0,t.moveElements([k],v,k.parent))}var f=o[0],u=s(o),p=o[u],h,m,g=0;Z(o,function(b,k){var v,w,C;if(b.elements.length<2){k&&k!==o.length-1&&(l(b,b.elements[0]),g+=d(b.range));return}v=hl(b.elements,i),w=v[0],k===u&&(w=v[s(v)]),C=r(w),b.range=null,Z(v,function(S){if(c(C,S),b.range===null){b.range={min:S[i],max:S[i]+S[a]};return}l(b,S)}),k&&k!==o.length-1&&(g+=d(b.range))}),m=Math.abs(p.range.min-f.range.max),h=Math.round((m-g)/(o.length-1)),!(h<o.length-1)&&Z(o,function(b,k){var v={},w;b===f||b===p||(w=o[k-1],b.range.max=0,Z(b.elements,function(C,S){v[Wr[i]]=0,v[i]=w.range.max-C[i]+h,b.range.min!==C[i]&&(v[i]+=C[i]-b.range.min),v[i]&&t.moveElements([C],v,C.parent),b.range.max=Math.max(C[i]+C[a],S?b.range.max:0)}))})},so.prototype.postExecute=function(e){};function co(e,t){this._layouter=e,this._canvas=t}co.$inject=["layouter","canvas"],co.prototype.execute=function(e){var t=e.connection,o=t.waypoints;return ie(e,{oldWaypoints:o}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},co.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t};function fi(){}fi.prototype.execute=function(e){var t=e.connection,o=e.delta,i=e.newParent||t.parent,a=e.newParentIndex,l=t.parent;return e.oldParent=l,e.oldParentIndex=gn(l.children,t),lt(i.children,t,a),t.parent=i,Z(t.waypoints,function(r){r.x+=o.x,r.y+=o.y,r.original&&(r.original.x+=o.x,r.original.y+=o.y)}),t},fi.prototype.revert=function(e){var t=e.connection,o=t.parent,i=e.oldParent,a=e.oldParentIndex,l=e.delta;return gn(o.children,t),lt(i.children,t,a),t.parent=i,Z(t.waypoints,function(r){r.x-=l.x,r.y-=l.y,r.original&&(r.original.x-=l.x,r.original.y-=l.y)}),t};function uo(e,t,o){var i=gr(t),a=gr(o),l=an(e,i),r={x:l.x*(o.width/t.width),y:l.y*(o.height/t.height)};return yn({x:a.x+r.x,y:a.y+r.y})}function pi(e,t,o){var i=fo(e),a=Jr(i,t),l=i[0];return a.length?a[a.length-1]:uo(l.original||l,o,t)}function hi(e,t,o){var i=fo(e),a=Jr(i,t),l=i[i.length-1];return a.length?a[0]:uo(l.original||l,o,t)}function mi(e,t,o){var i=fo(e),a=Ur(t,o),l=i[0];return uo(l.original||l,a,t)}function gi(e,t,o){var i=fo(e),a=Ur(t,o),l=i[i.length-1];return uo(l.original||l,a,t)}function Ur(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function fo(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function Jr(e,t){var o=yt(e,kh);return Qt(o,function(i){return Ch(i,t)})}function Ch(e,t){return bn(t,e,1)==="intersect"}function kh(e){return e.original||e}function yi(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}yi.prototype.add=function(e,t){return this.addAll([e],t)},yi.prototype.addAll=function(e,t){var o=vf(e,!!t,this);return ie(this,o),this};function _n(e){this._modeling=e}_n.prototype.moveRecursive=function(e,t,o){return e?this.moveClosure(this.getClosure(e),t,o):[]},_n.prototype.moveClosure=function(e,t,o,i,a){var l=this._modeling,r=e.allShapes,s=e.allConnections,d=e.enclosedConnections,c=e.topLevel,f=!1;a&&a.parent===o&&(f=!0),Z(r,function(u){l.moveShape(u,t,c[u.id]&&!f&&o,{recurse:!1,layout:!1})}),Z(s,function(u){var p=!!r[u.source.id],h=!!r[u.target.id];d[u.id]&&p&&h?l.moveConnection(u,t,c[u.id]&&!f&&o):l.layoutConnection(u,{connectionStart:p&&mi(u,u.source,t),connectionEnd:h&&gi(u,u.target,t)})})},_n.prototype.getClosure=function(e){return new yi().addAll(e,!0)};function po(e){this._helper=new _n(e)}po.$inject=["modeling"],po.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},po.prototype.postExecute=function(e){var t=e.hints,o;t&&t.primaryShape&&(o=t.primaryShape,t.oldParent=o.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,o)};function Ot(e){this._modeling=e,this._helper=new _n(e)}Ot.$inject=["modeling"],Ot.prototype.execute=function(e){var t=e.shape,o=e.delta,i=e.newParent||t.parent,a=e.newParentIndex,l=t.parent;return e.oldBounds=Ho(t,["x","y","width","height"]),e.oldParent=l,e.oldParentIndex=gn(l.children,t),lt(i.children,t,a),ie(t,{parent:i,x:t.x+o.x,y:t.y+o.y}),t},Ot.prototype.postExecute=function(e){var t=e.shape,o=e.delta,i=e.hints,a=this._modeling;i.layout!==!1&&(Z(t.incoming,function(l){a.layoutConnection(l,{connectionEnd:gi(l,t,o)})}),Z(t.outgoing,function(l){a.layoutConnection(l,{connectionStart:mi(l,t,o)})})),i.recurse!==!1&&this.moveChildren(e)},Ot.prototype.revert=function(e){var t=e.shape,o=e.oldParent,i=e.oldParentIndex,a=e.delta;return lt(o.children,t,i),ie(t,{parent:o,x:t.x-a.x,y:t.y-a.y}),t},Ot.prototype.moveChildren=function(e){var t=e.delta,o=e.shape;this._helper.moveRecursive(o.children,t,null)},Ot.prototype.getNewParent=function(e){return e.newParent||e.shape.parent};function jn(e){this._modeling=e}jn.$inject=["modeling"],jn.prototype.execute=function(e){var t=e.newSource,o=e.newTarget,i=e.connection,a=e.dockingOrPoints;if(!t&&!o)throw new Error("newSource or newTarget required");return Ne(a)&&(e.oldWaypoints=i.waypoints,i.waypoints=a),t&&(e.oldSource=i.source,i.source=t),o&&(e.oldTarget=i.target,i.target=o),i},jn.prototype.postExecute=function(e){var t=e.connection,o=e.newSource,i=e.newTarget,a=e.dockingOrPoints,l=e.hints||{},r={};l.connectionStart&&(r.connectionStart=l.connectionStart),l.connectionEnd&&(r.connectionEnd=l.connectionEnd),l.layoutConnection!==!1&&(o&&(!i||l.docking==="source")&&(r.connectionStart=r.connectionStart||Yr(Ne(a)?a[0]:a)),i&&(!o||l.docking==="target")&&(r.connectionEnd=r.connectionEnd||Yr(Ne(a)?a[a.length-1]:a)),l.newWaypoints&&(r.waypoints=l.newWaypoints),this._modeling.layoutConnection(t,r))},jn.prototype.revert=function(e){var t=e.oldSource,o=e.oldTarget,i=e.oldWaypoints,a=e.connection;return t&&(a.source=t),o&&(a.target=o),i&&(a.waypoints=i),a};function Yr(e){return e.original||e}function dt(e,t){this._modeling=e,this._rules=t}dt.$inject=["modeling","rules"],dt.prototype.preExecute=function(e){var t=this,o=this._modeling,i=this._rules,a=e.oldShape,l=e.newData,r=e.hints||{},s;function d(m,g,b){return i.allowed("connection.reconnect",{connection:b,source:m,target:g})}var c={x:l.x,y:l.y},f={x:a.x,y:a.y,width:a.width,height:a.height};s=e.newShape=e.newShape||t.createShape(l,c,a.parent,r),a.host&&o.updateAttachment(s,a.host);var u;r.moveChildren!==!1&&(u=a.children.slice(),o.moveElements(u,{x:0,y:0},s,r));var p=a.incoming.slice(),h=a.outgoing.slice();Z(p,function(m){var g=m.source,b=d(g,s,m);b&&t.reconnectEnd(m,s,hi(m,s,f),r)}),Z(h,function(m){var g=m.target,b=d(s,g,m);b&&t.reconnectStart(m,s,pi(m,s,f),r)})},dt.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},dt.prototype.execute=function(e){},dt.prototype.revert=function(e){},dt.prototype.createShape=function(e,t,o,i){return this._modeling.createShape(e,t,o,i)},dt.prototype.reconnectStart=function(e,t,o,i){this._modeling.reconnectStart(e,t,o,i)},dt.prototype.reconnectEnd=function(e,t,o,i){this._modeling.reconnectEnd(e,t,o,i)};function Vn(e){this._modeling=e}Vn.$inject=["modeling"],Vn.prototype.execute=function(e){var t=e.shape,o=e.newBounds,i=e.minBounds;if(o.x===void 0||o.y===void 0||o.width===void 0||o.height===void 0)throw new Error("newBounds must have {x, y, width, height} properties");if(i&&(o.width<i.width||o.height<i.height))throw new Error("width and height cannot be less than minimum height and width");if(!i&&o.width<10||o.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},ie(t,{width:o.width,height:o.height,x:o.x,y:o.y}),t},Vn.prototype.postExecute=function(e){var t=this._modeling,o=e.shape,i=e.oldBounds,a=e.hints||{};a.layout!==!1&&(Z(o.incoming,function(l){t.layoutConnection(l,{connectionEnd:hi(l,o,i)})}),Z(o.outgoing,function(l){t.layoutConnection(l,{connectionStart:pi(l,o,i)})}))},Vn.prototype.revert=function(e){var t=e.shape,o=e.oldBounds;return ie(t,{width:o.width,height:o.height,x:o.x,y:o.y}),t};function xh(e,t){var o=[];return Z(e.concat(t),function(i){var a=i.incoming,l=i.outgoing;Z(a.concat(l),function(r){var s=r.source,d=r.target;(Tn(e,s)||Tn(e,d)||Tn(t,s)||Tn(t,d))&&(Tn(o,r)||o.push(r))})}),o}function Tn(e,t){return e.indexOf(t)!==-1}function Sh(e,t,o){var i=e.x,a=e.y,l=e.width,r=e.height,s=o.x,d=o.y;switch(t){case"n":return{x:i,y:a+d,width:l,height:r-d};case"s":return{x:i,y:a,width:l,height:r+d};case"w":return{x:i+s,y:a,width:l-s,height:r};case"e":return{x:i,y:a,width:l+s,height:r};default:throw new Error("unknown direction: "+t)}}function Et(e){this._modeling=e}Et.$inject=["modeling"],Et.prototype.preExecute=function(e){var t=e.delta,o=e.direction,i=e.movingShapes,a=e.resizingShapes,l=e.start,r={};this.moveShapes(i,t),Z(a,function(s){r[s.id]=Eh(s)}),this.resizeShapes(a,t,o),this.updateConnectionWaypoints(xh(i,a),t,o,l,i,a,r)},Et.prototype.execute=function(){},Et.prototype.revert=function(){},Et.prototype.moveShapes=function(e,t){var o=this;Z(e,function(i){o._modeling.moveShape(i,t,null,{autoResize:!1,layout:!1,recurse:!1})})},Et.prototype.resizeShapes=function(e,t,o){var i=this;Z(e,function(a){var l=Sh(a,o,t);i._modeling.resizeShape(a,l,null,{attachSupport:!1,autoResize:!1,layout:!1})})},Et.prototype.updateConnectionWaypoints=function(e,t,o,i,a,l,r){var s=this,d=a.concat(l);Z(e,function(c){var f=c.source,u=c.target,p=Bh(c),h=Gr(o),m={};_t(d,f)&&_t(d,u)?(p=yt(p,function(g){return Kr(g,i,o)&&(g[h]=g[h]+t[h]),g.original&&Kr(g.original,i,o)&&(g.original[h]=g.original[h]+t[h]),g}),s._modeling.updateWaypoints(c,p,{labelBehavior:!1})):(_t(d,f)||_t(d,u))&&(_t(a,f)?m.connectionStart=mi(c,f,t):_t(a,u)?m.connectionEnd=gi(c,u,t):_t(l,f)?m.connectionStart=pi(c,f,r[f.id]):_t(l,u)&&(m.connectionEnd=hi(c,u,r[u.id])),s._modeling.layoutConnection(c,m))})};function qr(e){return ie({},e)}function Bh(e){return yt(e.waypoints,function(t){return t=qr(t),t.original&&(t.original=qr(t.original)),t})}function Gr(e){switch(e){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function Kr(e,t,o){var i=Gr(o);if(/e|s/.test(o))return e[i]>t;if(/n|w/.test(o))return e[i]<t}function _t(e,t){return e.indexOf(t)!==-1}function Eh(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}function ho(e){this._modeling=e}ho.$inject=["modeling"],ho.prototype.execute=function(e){var t=e.shape,o=t.children;e.oldChildrenVisibility=Xr(o),t.collapsed=!t.collapsed;var i=Zr(o,t.collapsed);return[t].concat(i)},ho.prototype.revert=function(e){var t=e.shape,o=e.oldChildrenVisibility,i=t.children,a=Qr(i,o);return t.collapsed=!t.collapsed,[t].concat(a)};function Xr(e){var t={};return Z(e,function(o){t[o.id]=o.hidden,o.children&&(t=ie({},t,Xr(o.children)))}),t}function Zr(e,t){var o=[];return Z(e,function(i){i.hidden=t,o=o.concat(i),i.children&&(o=o.concat(Zr(i.children,i.collapsed||t)))}),o}function Qr(e,t){var o=[];return Z(e,function(i){i.hidden=t[i.id],o=o.concat(i),i.children&&(o=o.concat(Qr(i.children,t)))}),o}function mo(e){this._modeling=e}mo.$inject=["modeling"],mo.prototype.execute=function(e){var t=e.shape,o=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=es(i,t),ts(o,t),t.host=o,t},mo.prototype.revert=function(e){var t=e.shape,o=e.newHost,i=e.oldHost,a=e.attacherIdx;return t.host=i,es(o,t),ts(i,t,a),t};function es(e,t){return gn(e&&e.attachers,t)}function ts(e,t,o){if(e){var i=e.attachers;i||(e.attachers=i=[]),lt(i,t,o)}}function bi(){}bi.prototype.execute=function(e){var t=e.connection,o=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=o,t},bi.prototype.revert=function(e){var t=e.connection,o=e.oldWaypoints;return t.waypoints=o,t};function be(e,t,o){this._eventBus=e,this._elementFactory=t,this._commandStack=o;var i=this;e.on("diagram.init",function(){i.registerHandlers(o)})}be.$inject=["eventBus","elementFactory","commandStack"],be.prototype.getHandlers=function(){return{"shape.append":ao,"shape.create":Bt,"shape.delete":En,"shape.move":Ot,"shape.resize":Vn,"shape.replace":dt,"shape.toggleCollapse":ho,spaceTool:Et,"label.create":Sn,"connection.create":lo,"connection.delete":Bn,"connection.move":fi,"connection.layout":co,"connection.updateWaypoints":bi,"connection.reconnect":jn,"elements.create":di,"elements.move":po,"elements.delete":ui,"elements.distribute":so,"elements.align":io,"element.updateAttachment":mo}},be.prototype.registerHandlers=function(e){Z(this.getHandlers(),function(t,o){e.registerHandler(o,t)})},be.prototype.moveShape=function(e,t,o,i,a){typeof i=="object"&&(a=i,i=null);var l={shape:e,delta:t,newParent:o,newParentIndex:i,hints:a||{}};this._commandStack.execute("shape.move",l)},be.prototype.updateAttachment=function(e,t){var o={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",o)},be.prototype.moveElements=function(e,t,o,i){i=i||{};var a=i.attach,l=o,r;a===!0?(r=o,l=o.parent):a===!1&&(r=null);var s={shapes:e,delta:t,newParent:l,newHost:r,hints:i};this._commandStack.execute("elements.move",s)},be.prototype.moveConnection=function(e,t,o,i,a){typeof i=="object"&&(a=i,i=void 0);var l={connection:e,delta:t,newParent:o,newParentIndex:i,hints:a||{}};this._commandStack.execute("connection.move",l)},be.prototype.layoutConnection=function(e,t){var o={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",o)},be.prototype.createConnection=function(e,t,o,i,a,l){typeof o=="object"&&(l=a,a=i,i=o,o=void 0),i=this._create("connection",i);var r={source:e,target:t,parent:a,parentIndex:o,connection:i,hints:l};return this._commandStack.execute("connection.create",r),r.connection},be.prototype.createShape=function(e,t,o,i,a){typeof i!="number"&&(a=i,i=void 0),a=a||{};var l=a.attach,r,s;e=this._create("shape",e),l?(r=o.parent,s=o):r=o;var d={position:t,shape:e,parent:r,parentIndex:i,host:s,hints:a};return this._commandStack.execute("shape.create",d),d.shape},be.prototype.createElements=function(e,t,o,i,a){Ne(e)||(e=[e]),typeof i!="number"&&(a=i,i=void 0),a=a||{};var l={position:t,elements:e,parent:o,parentIndex:i,hints:a};return this._commandStack.execute("elements.create",l),l.elements},be.prototype.createLabel=function(e,t,o,i){o=this._create("label",o);var a={labelTarget:e,position:t,parent:i||e.parent,shape:o};return this._commandStack.execute("label.create",a),a.shape},be.prototype.appendShape=function(e,t,o,i,a){a=a||{},t=this._create("shape",t);var l={source:e,position:o,target:i,shape:t,connection:a.connection,connectionParent:a.connectionParent,hints:a};return this._commandStack.execute("shape.append",l),l.shape},be.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},be.prototype.distributeElements=function(e,t,o){var i={groups:e,axis:t,dimension:o};this._commandStack.execute("elements.distribute",i)},be.prototype.removeShape=function(e,t){var o={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",o)},be.prototype.removeConnection=function(e,t){var o={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",o)},be.prototype.replaceShape=function(e,t,o){var i={oldShape:e,newData:t,hints:o||{}};return this._commandStack.execute("shape.replace",i),i.newShape},be.prototype.alignElements=function(e,t){var o={elements:e,alignment:t};this._commandStack.execute("elements.align",o)},be.prototype.resizeShape=function(e,t,o,i){var a={shape:e,newBounds:t,minBounds:o,hints:i};this._commandStack.execute("shape.resize",a)},be.prototype.createSpace=function(e,t,o,i,a){var l={delta:o,direction:i,movingShapes:e,resizingShapes:t,start:a};this._commandStack.execute("spaceTool",l)},be.prototype.updateWaypoints=function(e,t,o){var i={connection:e,newWaypoints:t,hints:o||{}};this._commandStack.execute("connection.updateWaypoints",i)},be.prototype.reconnect=function(e,t,o,i,a){var l={connection:e,newSource:t,newTarget:o,dockingOrPoints:i,hints:a||{}};this._commandStack.execute("connection.reconnect",l)},be.prototype.reconnectStart=function(e,t,o,i){i||(i={}),this.reconnect(e,t,e.target,o,ie(i,{docking:"source"}))},be.prototype.reconnectEnd=function(e,t,o,i){i||(i={}),this.reconnect(e,e.source,t,o,ie(i,{docking:"target"}))},be.prototype.connect=function(e,t,o,i){return this.createConnection(e,t,o||{},e.parent,i)},be.prototype._create=function(e,t){return wp(t)?t:this._elementFactory.create(e,t)},be.prototype.toggleCollapse=function(e,t){var o={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",o)};function wi(e){const t=e.businessObject;if(t)return t.name||""}function _h(e,t){const o=e.businessObject;return o.name=t,e}const jh={height:20},ns=15;function Vh(e){return["startEvent","myEvent","endEvent","gatewayAnd","gatewayXor","gatewayInclusive","myline"].includes(e.type)}function Th(e){return go(e.label)}function Nh(e){const t=e.length/2-1,o=e[Math.floor(t)],i=e[Math.ceil(t+.01)],a=$h(e),l=Math.atan((i.y-o.y)/(i.x-o.x));let{x:r,y:s}=a;return Math.abs(l)<Math.PI/2?s-=ns:r+=ns,{x:r,y:s}}function $h(e){const t=e.length/2-1,o=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:o.x+(i.x-o.x)/2,y:o.y+(i.y-o.y)/2}}function Mh(e){return e.waypoints?Nh(e.waypoints):{x:e.x+e.width/2,y:e.y+e.height+jh.height/2}}function go(e){return e&&!!e.labelTarget}const Lh={width:0,height:0};function os(e,t){function o(s,d){const c=s.label||s,f=s.labelTarget||s;return _h(c,d),[c,f]}function i(s){const{element:d,newLabel:c}=s,{businessObject:f}=d;if(!go(d)&&Vh(d)&&!Th(d)&&!is(c)){let p=Mh(d);p={x:p.x,y:p.y+7},e.createLabel(d,p,{id:f.id+"_label",businessObject:f})}}function a(s){return s.oldLabel=wi(s.element),o(s.element,s.newLabel)}function l(s){return o(s.element,s.oldLabel)}function r(s){const{element:d,newLabel:c}=s,f=d.label||d,u=s.hints||{};let{newBounds:p}=s;if(!go(f))return;if(go(f)&&is(c)){u.removeShape!==!1&&e.removeShape(f,{unsetLabel:!1});return}const h=wi(f);typeof p>"u"&&(p=t.getExternalLabelBounds(f,h)),p&&e.resizeShape(f,p,Lh)}this.preExecute=i,this.execute=a,this.revert=l,this.postExecute=r}os.$inject=["modeling","textRenderer"];function is(e){return!e||!e.trim()}function Nn(e,t,o){be.call(this,e,t,o)}xn(Nn,be),Nn.$inject=["eventBus","elementFactory","commandStack"],Nn.prototype.getHandlers=function(){const e=be.prototype.getHandlers.call(this);return e["element.updateLabel"]=os,e},Nn.prototype.updateLabel=function(e,t,o,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:o,hints:i||{}})};function vi(e,t){Fe.call(this,e);function o(i){const{context:a}=i,l=a.hints||{};let r;!a.cropped&&l.createElementsBehavior!==!1&&(r=a.connection,r.waypoints=t.getCroppedWaypoints(r),a.cropped=!0)}this.executed(["connection.layout","connection.create"],o)}xn(vi,Fe),vi.$inject=["eventBus","connectionDocking"];function as(){}as.prototype.layoutConnection=function(e,t){return t=t||{},[t.connectionStart||tt(t.source||e.source),t.connectionEnd||tt(t.target||e.target)]};var yo=20,Ph=5,bo=Math.round,ls=20,Rh={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function Ah(e,t){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[t].test(e)}function Oh(e,t){return{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[e].test(t)}function rs(e,t,o){var i=bn(t,e,Ph),a=o.split(":")[0],l=bo((t.x-e.x)/2+e.x),r=bo((t.y-e.y)/2+e.y),s,d,c=Oh(a,i),f=/h|r|l/.test(a),u=!1,p=!1;return c?(s=f?{x:l,y:e.y}:{x:e.x,y:r},d=f?"h:h":"v:v"):(u=Ah(i,a),d=f?"h:v":"v:h",u?f?(p=r===e.y,s={x:e.x+yo*(/l/.test(a)?-1:1),y:p?r+yo:r}):(p=l===e.x,s={x:p?l+yo:l,y:e.y+yo*(/t/.test(a)?-1:1)}):s={x:l,y:r}),{waypoints:Ci(e,s,d).concat(s),directions:d,turnNextDirections:p}}function Fh(e,t,o){return rs(e,t,o)}function Ih(e,t,o){var i=rs(t,e,ss(o));return{waypoints:i.waypoints.slice().reverse(),directions:ss(i.directions),turnNextDirections:i.turnNextDirections}}function zh(e,t){var o=e.directions.split(":")[1],i=t.directions.split(":")[0];e.turnNextDirections&&(o=o=="h"?"v":"h"),t.turnNextDirections&&(i=i=="h"?"v":"h");var a=o+":"+i,l=Ci(e.waypoints[e.waypoints.length-1],t.waypoints[0],a);return{waypoints:l,directions:a}}function ss(e){return e.split(":").reverse().join(":")}function Dh(e,t,o){var i=bo((t.x-e.x)/2+e.x),a=bo((t.y-e.y)/2+e.y);if(o==="h:v")return[{x:t.x,y:e.y}];if(o==="v:h")return[{x:e.x,y:t.y}];if(o==="h:h")return[{x:i,y:e.y},{x:i,y:t.y}];if(o==="v:v")return[{x:e.x,y:a},{x:t.x,y:a}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}function Ci(e,t,o){if(o=o||"h:h",!Xh(o))throw new Error("unknown directions: <"+o+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(ds(o)){var i=Fh(e,t,o),a=Ih(e,t,o),l=zh(i,a);return[].concat(i.waypoints,l.waypoints,a.waypoints)}return Dh(e,t,o)}function Hh(e,t,o){var i=Ci(e,t,o);return i.unshift(e),i.push(t),fs(i)}function Wh(e,t,o,i,a){var l=a&&a.preferredLayouts||[],r=Ku(l,"straight")[0]||"h:h",s=Rh[r]||0,d=bn(e,t,s),c=Kh(d,r);o=o||tt(e),i=i||tt(t);var f=c.split(":"),u=us(o,e,f[0],Zh(d)),p=us(i,t,f[1],d);return Hh(u,p,c)}function Uh(e,t,o,i,a,l){Ne(o)&&(a=o,l=i,o=tt(e),i=tt(t)),l=ie({preferredLayouts:[]},l),a=a||[];var r=l.preferredLayouts,s=r.indexOf("straight")!==-1,d;return d=s&&Yh(e,t,o,i,l),d||(d=l.connectionEnd&&Gh(t,e,i,a),d)||(d=l.connectionStart&&qh(e,t,o,a),d)?d:!l.connectionStart&&!l.connectionEnd&&a&&a.length?a:Wh(e,t,o,i,l)}function Jh(e,t,o){return e>=t&&e<=o}function cs(e,t,o){var i={x:"width",y:"height"};return Jh(t[e],o[e],o[e]+o[i[e]])}function Yh(e,t,o,i,a){var l={},r,s;return s=bn(e,t),/^(top|bottom|left|right)$/.test(s)?(/top|bottom/.test(s)&&(r="x"),/left|right/.test(s)&&(r="y"),a.preserveDocking==="target"?cs(r,i,e)?(l[r]=i[r],[{x:l.x!==void 0?l.x:o.x,y:l.y!==void 0?l.y:o.y,original:{x:l.x!==void 0?l.x:o.x,y:l.y!==void 0?l.y:o.y}},{x:i.x,y:i.y}]):null:cs(r,o,t)?(l[r]=o[r],[{x:o.x,y:o.y},{x:l.x!==void 0?l.x:i.x,y:l.y!==void 0?l.y:i.y,original:{x:l.x!==void 0?l.x:i.x,y:l.y!==void 0?l.y:i.y}}]):null):null}function qh(e,t,o,i){return ki(e,t,o,i)}function Gh(e,t,o,i){var a=i.slice().reverse();return a=ki(e,t,o,a),a?a.reverse():null}function ki(e,t,o,i){function a(f){return f.length<3?!0:f.length>4?!1:!!gt(f,function(u,p){var h=f[p-1];return h&&Qo(u,h)<3})}function l(f,u,p){var h=Tl(u,f);switch(h){case"v":return{x:p.x,y:f.y};case"h":return{x:f.x,y:p.y}}return{x:f.x,y:f.y}}function r(f,u,p){var h;for(h=f.length-2;h!==0;h--)if(Nl(f[h],u,ls)||Nl(f[h],p,ls))return f.slice(h);return f}if(a(i))return null;var s=i[0],d=i.slice(),c;return d[0]=o,d[1]=l(d[1],s,o),c=r(d,e,t),c!==d&&(d=ki(e,t,o,c)),d&&Tl(d)?null:d}function Kh(e,t){if(ds(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}function Xh(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function ds(e){return e&&/t|r|b|l/.test(e)}function Zh(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}function us(e,t,o,i){if(o==="h"&&(o=/left/.test(i)?"l":"r"),o==="v"&&(o=/top/.test(i)?"t":"b"),o==="t")return{original:e,x:e.x,y:t.y};if(o==="r")return{original:e,x:t.x+t.width,y:e.y};if(o==="b")return{original:e,x:e.x,y:t.y+t.height};if(o==="l")return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+o+">")}function fs(e){return e.reduce(function(t,o,i){var a=t[t.length-1],l=e[i+1];return Af(a,l,o,0)||t.push(o),t},[])}function xi(){}xn(xi,as);const Ft=(e,t)=>e.type===t;xi.prototype.layoutConnection=function(e,t){t||(t={});const o=t.source||e.source,i=t.target||e.target,a=t.waypoints||e.waypoints;let{connectionStart:l,connectionEnd:r}=t,s,d;return r===void 0&&(l=wo(a&&a[0],o),r=wo(a&&a[a.length-1],i)),l||(l=wo(a&&a[0],o)),r||(r=wo(a&&a[a.length-1],i)),Ft(e,"myline")&&(o===i?s={preferredLayouts:Qh(o,e)}:Ft(o,"gatewayAnd")||Ft(o,"gatewayXor")||Ft(o,"gatewayInclusive")?s={preferredLayouts:["v:h"]}:Ft(i,"gatewayAnd")||Ft(i,"gatewayXor")||Ft(i,"gatewayInclusive")?s={preferredLayouts:["h:v"]}:s={preferredLayouts:["h:h"]}),s&&(s=Ke(s,t),d=fs(Uh(o,i,l,r,a,s))),d||[l,r]};function wo(e,t){return e?e.original||e:tt(t)}function Qh(e,t){const{waypoints:o}=t,i=o&&o.length&&bn(o[0],e);return i==="top"?["t:r"]:i==="right"?["r:b"]:i==="left"?["l:t"]:["b:l"]}function ps(e){return ie({original:e.point.original||e.point},e.actual)}function jt(e,t){this._elementRegistry=e,this._graphicsFactory=t}jt.$inject=["elementRegistry","graphicsFactory"],jt.prototype.getCroppedWaypoints=function(e,t,o){t=t||e.source,o=o||e.target;var i=this.getDockingPoint(e,t,!0),a=this.getDockingPoint(e,o),l=e.waypoints.slice(i.idx+1,a.idx);return l.unshift(ps(i)),l.push(ps(a)),l},jt.prototype.getDockingPoint=function(e,t,o){var i=e.waypoints,a,l,r;return a=o?0:i.length-1,l=i[a],r=this._getIntersection(t,e,o),{point:l,actual:r||l,idx:a}},jt.prototype._getIntersection=function(e,t,o){var i=this._getShapePath(e),a=this._getConnectionPath(t);return ap(i,a,o)},jt.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},jt.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},jt.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};const em={__depends__:[sh,fh,no],__init__:["modeling","elementUpdater"],modeling:["type",Nn],layouter:["type",xi],elementUpdater:["type",vi],elementFactory:["type",At],connectionDocking:["type",jt]};function tm(e){return e.businessObject}function vo(e,t){return e.businessObject.strokeWidth||t||1}function Xe(e,t){return e.businessObject.fillColor||t||"var(--color-bg-container)"}function _e(e,t){return e.businessObject.strokeColor||t||"var(--color-text)"}function nm(e){const t=e.x+e.width/2,o=e.y+e.height/2,i=e.width/2,a=[["M",t,o],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]];return Pt(a)}function om(e,t){const{x:o,y:i,width:a,height:l}=e,r=[["M",o+t,i],["l",a-t*2,0],["a",t,t,0,0,1,t,t],["l",0,l-t*2],["a",t,t,0,0,1,-t,t],["l",t*2-a,0],["a",t,t,0,0,1,-t,-t],["l",0,t*2-l],["a",t,t,0,0,1,t,-t],["z"]];return Pt(r)}function im(e){const{x:t,y:o,width:i,height:a}=e,l=i/2,r=a/2,s=[["M",t+l,o],["l",l,r],["l",-l,r],["l",-l,-r],["z"]];return Pt(s)}function am(e){const{x:t,y:o,width:i,height:a}=e,l=[["M",t,o],["l",i,0],["l",0,a],["l",-i,0],["z"]];return Pt(l)}const Si=10,Bi=.95,Vt=(e,t)=>e.type===t;function It(e,t,o,i,a,l,r){at.call(this,e,r);const s="var(--color-bg-container)",d="var(--color-text)",c={};Object.keys(l.palette).forEach(V=>{const x=l.palette[V];c[x.type]=x.options});const{computeStyle:f}=t;function u(V){return R[V]}function p(V){return t.computeStyle(V,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:d,strokeWidth:2})}function h(V){return t.computeStyle(V,{strokeLinecap:"round",strokeLinejoin:"round",stroke:d,strokeWidth:2,fill:"white"})}function m(V,x,L,P){L=p(L);const G=Ko(x,L,P);return Ee(V,G),G}function g(V,x,L){return m(V,x,L,5)}function b(V,x,L,P,G){zr(P)&&(G=P,P=0),P=P||0,G=f(G,{stroke:d,strokeWidth:2,fill:s}),G.fill==="none"&&delete G.fillOpacity;const K=x/2,ne=L/2,pe=Se("circle");return ce(pe,{cx:K,cy:ne,r:Math.round((x+L)/4-P)}),ce(pe,G),Ee(V,pe),pe}function k(V,x,L,P,G,K){zr(G)&&(K=G,G=0),G=G||0,K=f(K,{stroke:d,strokeWidth:2,fill:s});const ne=Se("rect");return ce(ne,{x:G,y:G,width:x-G*2,height:L-G*2,rx:P,ry:P}),ce(ne,K),Ee(V,ne),ne}function v(V,x,L){L=f(L,["no-fill"],{strokeWidth:2,stroke:d});const P=Se("path");return ce(P,{d:x}),ce(P,L),Ee(V,P),P}function w(V,x,L,P){const G=x/2,K=L/2,pe=[{x:G,y:0},{x,y:K},{x:G,y:L},{x:0,y:K}].map(Y=>Y.x+","+Y.y).join(" ");P=f(P,{stroke:d,strokeWidth:2,fill:s});const fe=Se("polygon");return ce(fe,{points:pe}),ce(fe,P),Ee(V,fe),fe}function C(V,x,L,P){return v(x,L,Ke({"data-marker":V},P))}function S(V,x,L){L=Ke({size:{width:100}},L);const P=a.createText(x||"",L);return Ge(P).add("djs-label"),Ee(V,P),P}function y(V,x,L){const P=tm(x);return S(V,P.name,{box:x,align:L,padding:5,style:{fill:_e(x,d)}})}function E(V,x){const L={width:90,height:30,x:x.width/2+x.x,y:x.height/2+x.y};return S(V,wi(x),{box:L,fitBox:!0,style:Ke({},a.getExternalStyle(),{fill:_e(x,d)})})}function B(V,x,L){const P=L&&L.indexOf("SubProcessMarker")!==-1;let G;P?G={seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:G={seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},ph(L,K=>{u(K)(V,x,G)})}function _(V){return V.replace(/[^0-9a-zA-z]+/g,"_")}function T(V,x){const{ref:L={x:0,y:0},scale:P=1,element:G,parentGfx:K=i._svg}=x,ne=Se("marker",{id:V,viewBox:"0 0 20 20",refX:L.x,refY:L.y,markerWidth:20*P,markerHeight:20*P,orient:"auto"});Ee(ne,G);let pe=mn(":scope > defs",K);pe||(pe=Se("defs"),Ee(K,pe)),Ee(pe,ne)}function j(V,x,L,P){const G=x+"-"+_(L)+"-"+_(P)+"-"+Fr();return D(V,G,x,L,P),"url(#"+G+")"}function D(V,x,L,P,G){{const K=Se("path",{d:"M 1 5 L 11 10 L 1 15 Z",...h({fill:G,stroke:G,strokeWidth:1})});T(x,{element:K,ref:{x:11,y:10},scale:.5,parentGfx:V})}}function A(V,x,L,P){const G=c[x.type]?.icon||x.icon;if(G){const K=o.getScaledPath(G,{abspos:{x:L,y:P}});v(V,K,{strokeWidth:0,fill:_e(x,c[x.type]?.iconFill||x.iconFill)})}}const R={event(V,x,L){return"fillOpacity"in L||(L.fillOpacity=Bi),b(V,x.width,x.height,L)},startEvent(V,x){const L={fill:Xe(x,c.startEvent?.fill||x.fill),stroke:_e(x,c.startEvent?.stroke||x.stroke),strokeWidth:vo(x,c.startEvent?.strokeWidth||x.strokeWidth)},P=u("event")(V,x,L);return A(V,x,18,18),P},endEvent(V,x){const L=u("event")(V,x,{strokeWidth:vo(x,c.endEvent?.strokeWidth||x.strokeWidth||4),fill:Xe(x,c.endEvent?.fill||x.fill),stroke:_e(x,c.endEvent?.stroke||x.stroke)});return A(V,x,18,18),L},gateway(V,x){const L={fillOpacity:Bi,strokeWidth:vo(x,c[x.type]?.strokeWidth||x.strokeWidth||4),fill:Xe(x,c[x.type]?.fill||x.fill),stroke:_e(x,c[x.type]?.stroke||x.stroke)};return w(V,x.width,x.height,L)},gatewayAnd(V,x){const L=u("gateway")(V,x),P=o.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:c[x.type]?.width||x.width,containerHeight:c[x.type]?.height||x.height,position:{mx:.47,my:.29}});return v(V,P,{strokeWidth:1,fill:_e(x,c[x.type]?.iconFill||x.iconFill),stroke:_e(x,c[x.type]?.iconFill||x.iconFill)}),L},gatewayXor(V,x){const L=u("gateway")(V,x),P=o.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:x.width,containerHeight:x.height,position:{mx:.32,my:.3}});return v(V,P,{strokeWidth:1,fill:_e(x,c[x.type]?.iconFill||x.iconFill),stroke:_e(x,c[x.type]?.iconFill||x.iconFill)}),L},gatewayInclusive(V,x){const L=u("gateway")(V,x);return b(V,x.width,x.height,x.height*.24,{strokeWidth:2.5,fill:_e(x,s),stroke:_e(x,c[x.type]?.iconFill||x.iconFill)}),L},activity(V,x,L){return L=L||{},"fillOpacity"in L||(L.fillOpacity=Bi),k(V,x.width,x.height,Si,L)},task(V,x){const L={fill:Xe(x,s),stroke:_e(x,d)},P=u("activity")(V,x,L);return y(V,x,"center-middle"),B(V,x),P},userTask(V,x){const L=u("task")(V,x),P=15,G=12,K=o.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:P,y:G}});v(V,K,{strokeWidth:.5,fill:Xe(x,s),stroke:_e(x,d)});const ne=o.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:P,y:G}});v(V,ne,{strokeWidth:.5,fill:Xe(x,s),stroke:_e(x,d)});const pe=o.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:P,y:G}});return v(V,pe,{strokeWidth:.5,fill:_e(x,d),stroke:_e(x,d)}),L},scriptTask(V,x){const L=u("task")(V,x),P=o.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}});return v(V,P,{strokeWidth:1,stroke:_e(x,d)}),L},SubProcessMarker(V,x){const L=k(V,14,14,0,{strokeWidth:1,fill:Xe(x,s),stroke:_e(x,d)});Zn(L,x.width/2-7.5,x.height-20);const P=o.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:x.width,containerHeight:x.height,position:{mx:(x.width/2-7.5)/x.width,my:(x.height-20)/x.height}});C("sub-process",V,P,{fill:Xe(x,s),stroke:_e(x,d)})},subprocess(V,x,L){L=Ke({fill:Xe(x,s),stroke:_e(x,d)},L);const P=u("activity")(V,x,L);return y(V,x,"center-middle"),B(V,x,["SubProcessMarker"]),P},label(V,x){return E(V,x)},myline(V,x){const L=Xe(x,l.lineStroke||s),P=_e(x,l.lineStroke||d);return g(V,x.waypoints,{markerEnd:j(V,"sequenceflow-end",L,P),stroke:P})},default(V,x){const L={strokeWidth:vo(x,c[x.type]?.strokeWidth||x.strokeWidth||1),fill:Xe(x,c[x.type]?.fill||x.fill),stroke:_e(x,c[x.type]?.stroke||x.stroke)},P=k(V,x.width,x.height,x.radius||Si,L);return y(V,x,"center-middle"),B(V,x),A(V,x,x.iconX,x.iconY),P}};this.handlers=R,this._drawPath=v}xn(It,at),It.$inject=["eventBus","styles","pathMap","canvas","textRenderer","myOptions"],It.prototype.canRender=function(){return!0},It.prototype.drawShape=function(e,t){const{type:o}=t;return(this.handlers[o]||this.handlers.default)(e,t)},It.prototype.drawConnection=function(e,t){const{type:o}=t,i=this.handlers[o];return i(e,t)},It.prototype.getShapePath=function(e){return Vt(e,"startEvent")||Vt(e,"endEvent")?nm(e):Vt(e,"userTask")||Vt(e,"scriptTask")||Vt(e,"subprocess")?om(e,Si):Vt(e,"gatewayAnd")||Vt(e,"gatewayXor")||Vt(e,"gatewayInclusive")?im(e):am(e)};var lm=0,rm={width:150,height:50};function sm(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function cm(e){return ht(e)?ie({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}function dm(e,t){t.textContent=e;var o;try{var i,a=e==="";return t.textContent=a?"dummy":e,o=t.getBBox(),i={width:o.width+o.x*2,height:o.height},a&&(i.width=0),i}catch(l){return console.log(l),{width:0,height:0}}}function um(e,t,o){for(var i=e.shift(),a=i,l;;){if(l=dm(a,o),l.width=a?l.width:0,a===" "||a===""||l.width<Math.round(t)||a.length<2)return fm(e,a,i,l);a=hm(a,l.width,t)}}function fm(e,t,o,i){if(t.length<o.length){var a=o.slice(t.length).trim();e.unshift(a)}return{width:i.width,height:i.height,text:t}}var hs="­";function pm(e,t){var o=e.split(/(\s|-|\u00AD)/g),i,a=[],l=0;if(o.length>1)for(;i=o.shift();)if(i.length+l<t)a.push(i),l+=i.length;else{(i==="-"||i===hs)&&a.pop();break}var r=a[a.length-1];return r&&r===hs&&(a[a.length-1]="-"),a.join("")}function hm(e,t,o){var i=Math.max(e.length*(o/t),1),a=pm(e,i);return a||(a=e.slice(0,Math.max(Math.round(i-1),1))),a}function mm(){var e=document.getElementById("helper-svg");return e||(e=Se("svg"),ce(e,{id:"helper-svg"}),Bl(e,{visibility:"hidden",position:"fixed",width:0,height:0}),document.body.appendChild(e)),e}function Co(e){this._config=ie({},{size:rm,padding:lm,style:{},align:"center-top"},e||{})}Co.prototype.createText=function(e,t){return this.layoutText(e,t).element},Co.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},Co.prototype.layoutText=function(e,t){var o=ie({},this._config.size,t.box),i=ie({},this._config.style,t.style),a=sm(t.align||this._config.align),l=cm(t.padding!==void 0?t.padding:this._config.padding),r=t.fitBox||!1,s=gm(i),d=e.split(/\u00AD?\r?\n/),c=[],f=o.width-l.left-l.right,u=Se("text");ce(u,{x:0,y:0}),ce(u,i);var p=mm();for(Ee(p,u);d.length;)c.push(um(d,f,u));a.vertical==="middle"&&(l.top=l.bottom=0);var h=en(c,function(v,w,C){return v+(s||w.height)},0)+l.top+l.bottom,m=en(c,function(v,w,C){return w.width>v?w.width:v},0),g=l.top;a.vertical==="middle"&&(g+=(o.height-h)/2),g-=(s||c[0].height)/4;var b=Se("text");ce(b,i),Z(c,function(v){var w;switch(g+=s||v.height,a.horizontal){case"left":w=l.left;break;case"right":w=(r?m:f)-l.right-v.width;break;default:w=Math.max(((r?m:f)-v.width)/2+l.left,0)}var C=Se("tspan");ce(C,{x:w,y:g}),C.textContent=v.text,Ee(b,C)}),Lt(u);var k={width:m,height:h};return{dimensions:k,element:b}};function gm(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}const ym=12,bm=1.2,wm=30;function ms(e){const t=Ke({fontFamily:"Arial, sans-serif",fontSize:ym,fontWeight:"normal",lineHeight:bm},e&&e.defaultStyle||{}),o=parseInt(t.fontSize,10)-1,i=Ke({},t,{fontSize:o},e&&e.externalStyle||{}),a=new Co({style:t});this.getExternalLabelBounds=function(l,r){const s=a.getDimensions(r,{box:{width:90,height:30,x:l.width/2+l.x,y:l.height/2+l.y},style:i});return{x:Math.round(l.x+l.width/2-s.width/2),y:Math.round(l.y),width:Math.ceil(s.width),height:Math.ceil(s.height)}},this.getTextAnnotationBounds=function(l,r){const s=a.getDimensions(r,{box:l,style:t,align:"left-top",padding:5});return{x:l.x,y:l.y,width:l.width,height:Math.max(wm,Math.round(s.height))}},this.createText=function(l,r){return a.createText(l,r||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}ms.$inject=["config.textRenderer"];function vm(){this.pathMap={GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,o){let i,a;o.abspos?(i=o.abspos.x,a=o.abspos.y):(i=o.containerWidth*o.position.mx,a=o.containerHeight*o.position.my);let l={};typeof t=="object"?(l=t,l.d.indexOf("{mx},{my}")===-1&&(l.d="m {mx},{my}"+l.d),l.width&&(i-=l.width/2),l.height&&(a-=l.height/2)):l=this.pathMap[t];const r={};if(o.position){const d=o.containerHeight/l.height*o.yScaleFactor,c=o.containerWidth/l.width*o.xScaleFactor;for(let f=0;f<l.heightElements.length;f++)r["y"+f]=l.heightElements[f]*d;for(let f=0;f<l.widthElements.length;f++)r["x"+f]=l.widthElements[f]*c}return Sm(l.d,{mx:i,my:a,e:r})}}const Cm=/\{([^}]+)\}/g,km=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function xm(e,t,o){let i=o;return t.replace(km,(a,l,r,s,d)=>{l=l||s,i&&(l in i&&(i=i[l]),typeof i=="function"&&d&&(i=i()))}),i=(i==null||i===o?e:i)+"",i}function Sm(e,t){return String(e).replace(Cm,(o,i)=>xm(o,i,t))}const Bm={__init__:["myRenderer"],myRenderer:["type",It],textRenderer:["type",ms],pathMap:["type",vm]};function gs(e,t){return Ke({id:e.id,type:e.type,businessObject:e},t)}function Em(e,t,o){const i=e.waypoint;return!i||i.length<2?[tt(t),tt(o)]:i.map(a=>({x:a.x,y:a.y}))}function Tt(e,t,o,i,a,l){this._eventBus=e,this._canvas=o,this._elementFactory=i,this._elementRegistry=a,this._translate=Ir,this._textRenderer=l,this._modeling=t}Tt.$inject=["eventBus","modeling","canvas","elementFactory","elementRegistry","textRenderer"],Tt.prototype.add=function(e){let t;const{label:o}=e;if(o&&(o.id=e.id,o.name=e.name,delete e.label),e.type==="myline"){const i=this._getSource(e),a=this._getTarget(e);t=this._elementFactory.createConnection(gs(e,{source:i,target:a,waypoints:Em(e,i,a)})),this._canvas.addConnection(t)}else{const i=this._elementFactory._getDefaultSize(e.type);t=this._elementFactory.createShape(gs(e,{x:Math.round(e.x),y:Math.round(e.y),width:i.width,height:i.height,isFrame:!1})),this._canvas.addShape(t)}return o&&t&&this.addLabel(o,t),t},Tt.prototype.addLabel=function(e,t){const o=this._elementFactory.createLabel({id:e.id+"_label",labelTarget:t,type:"label",x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height),businessObject:e});return this._canvas.addShape(o,t.parent)},Tt.prototype.update=function(e,t){const o=this._elementRegistry.get(e);o.businessObject=Ke(o.businessObject,t),t.type==="myline"?(this._canvas.removeConnection(o),this._canvas.addConnection(o,o.parent)):(this._canvas.removeShape(o),this._canvas.addShape(o,o.parent));const i=this._elementRegistry.get(e+"_label");if(i)i.businessObject=o.businessObject,this._canvas.removeShape(i),this._canvas.addShape(i,o.parent);else{const{name:a}=t;if(a&&["startEvent","myEvent","endEvent","gatewayAnd","gatewayXor","gatewayInclusive","myline"].includes(t.type)){const l={x:t.x+12,y:t.y+42,width:10,height:10,name:a,id:e},r=this._textRenderer.getExternalLabelBounds(l,t.name);this._modeling.resizeShape(l,r,{width:0,height:0}),o&&this.addLabel(l,o)}}},Tt.prototype._getSource=function(e){return this._getElement(e.from)},Tt.prototype._getTarget=function(e){return this._getElement(e.to)},Tt.prototype._getElement=function(e){return this._elementRegistry.get(e)};const _m={myImporter:["type",Tt]},jm=e=>{const t=[];return e.forEach(o=>{if(o.type!==void 0){const i=o.businessObject;if(o.type==="myline")o.source&&o.target&&(i.from=o.source.id,i.to=o.target.id,i.waypoint=o.waypoints.map(a=>({x:a.x,y:a.y})),t.push(i));else if(o.type!=="label")i.x=o.x,i.y=o.y,t.push(i);else{const a=t.find(l=>l.id===i.id);a&&(a.name=i.name||"",a.label={x:o.x,y:o.y,height:o.height,width:o.width})}}}),t},Vm=(e,t)=>{const o=t.get("myImporter"),i=e.filter(l=>l.type!=="myline"),a=e.filter(l=>l.type==="myline");i.forEach(l=>{o.add(l)}),a.forEach(l=>{o.add(l)})},ys=te(n.defineComponent({name:"JWorkflowViewer",__name:"workflow-viewer",props:{paletteOptions:{default:void 0},lineStroke:{default:void 0}},emits:["elementDblclick","elementClick"],setup(e,{expose:t,emit:o}){const i=e,a=o,l=n.ref(),r={"create.start-event":{className:"icon-start-event",type:"startEvent",group:"event",title:"创建开始事件"},"create.end-event":{className:"icon-end-event",type:"endEvent",group:"event",title:"创建结束事件"},"create.and-gateway":{className:"icon-gateway1",type:"gatewayAnd",group:"gateway",title:"并行网关"},"create.xor-gateway":{className:"icon-gateway2",type:"gatewayXor",group:"gateway",title:"互排网关"},"create.inclusive-gateway":{className:"icon-gateway3",type:"gatewayInclusive",group:"gateway",title:"包含网关"},"create.task":{className:"icon-gateway4",type:"userTask",group:"activity",title:"创建任务"},"create.script":{className:"icon-gateway5",type:"scriptTask",group:"activity",title:"创建脚本"},"create.subprocess":{className:"icon-subprocess",type:"subprocess",group:"activity",title:"创建子流程"}};let s,d=1;const c=()=>{d=1,s.get("canvas").zoom("fit-viewport")},f=()=>{const y=s.get("eventBus");y.on("element.dblclick",E=>{a("elementDblclick",E.element.businessObject)}),y.on("element.click",E=>{a("elementClick",E.element.businessObject)})},u=function(){return{palette:i.paletteOptions||r,lineStroke:i.lineStroke}},p=()=>{let y={__init__:["myOptions"],myOptions:["type",u]};s=new Cn({canvas:{container:l.value},modules:[Qp,Kp,em,nh,rh,y,Bm,_m]});const E=s.get("canvas"),B=s.get("elementFactory");c();const _=B.createRoot();E.setRootElement(_),f()};n.onMounted(()=>{p()});const h=y=>{const E=y==null?1:d+y;s.get("canvas").zoom(E),d=E},m=()=>{s.get("canvas").zoom(1);const y=s.get("elementRegistry").getAll();var E=jm(y);return E},g=y=>{s.clear(),c(),Vm(y,s)},b=y=>{s.get("myImporter").update(y.id,y)};return t({reset:()=>{c()},zoom:y=>{h(y)},getData:()=>m(),setData:y=>{g(y)},updateElemet:y=>{b(y)}}),(y,E)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"containerRef",ref:l,class:"lr-work-flow"},null,512))}})),Tm=[Li,na,oa,ia,aa,la,ra,sa,ca,da,ua,ma,ga,ya,ba,wa,va,Ca,ka,xa,Ba,_a,ja,Oa,Va,Ta,Na,$a,Ma,La,Pa,Ra,Aa,Za,Qa,el,tl,nl,ol,il,Fa,Ga,Xa,al,ll,rl,sl,cl,dl,Fu,ys],Nm={install:e=>{Tm.forEach(t=>{e.component(t.name,t)})}};M.EncryptionFactory=Qi,M.HashingFactory=nc,M.JAutoComplete=da,M.JBarcode=ja,M.JButton=Li,M.JButtonSelect=Za,M.JButtons=na,M.JCascaderSelect=ra,M.JCheckbox=sa,M.JCodeMirror=Oa,M.JCollapse=cl,M.JComp=el,M.JCount=Va,M.JCountUp=Ta,M.JDataPanel=Na,M.JDialog=ga,M.JDialogFull=ya,M.JDivider=$a,M.JDrawer=ba,M.JDynamicLayer=va,M.JEcharts=_a,M.JEditor=dl,M.JForm=tl,M.JFormItem=nl,M.JGuid=il,M.JHpanel=Ma,M.JIcon=ia,M.JInput=oa,M.JInputButton=La,M.JInputCode=Pa,M.JInputColor=Ra,M.JInputRows=al,M.JInputTag=Ca,M.JLayer=wa,M.JLayerForm=ll,M.JLayout=ua,M.JMenu=Ga,M.JNumber=ca,M.JPage=ol,M.JRadio=aa,M.JRate=ka,M.JSelect=la,M.JSlider=xa,M.JSliderCaptcha=Fa,M.JSwitch=rl,M.JTable=ma,M.JTablePanel=Xa,M.JTabs=sl,M.JTitle=Aa,M.JTree=Qa,M.JUpload=Ba,M.JWorkflowViewer=ys,M.buildShortUUID=Pn,M.buildUUID=dn,M.clearJson=cn,M.clone=Ln,M.deepClone=pt,M.default=Nm,M.formatToDate=pn,M.formatToDateTime=qi,M.fullScreenLoading=Ht,M.getCompConfig=$t,M.getCompType=No,M.getFunction=Vo,M.getIsInputComp=Rn,M.getIsTableInputComp=Ji,M.getLabel=Yi,M.getObjType=Pi,M.getTextWidth=fn,M.is=Mi,M.isArray=Mn,M.isNullOrEmpty=it,M.isObject=Ds,M.loadBMap=ta,M.lowerFirst=qs,M.myAesDecrypt=oc,M.numberToChinese=Ai,M.numberToThousandSeparator=Oi,M.pagination=Us,M.paginationEx=Js,M.set=Ri,M.setGroupMap=Ii,M.toArray=Di,M.toDecimal=un,M.toLeafArray=Ui,M.toSimpleTree=Ks,M.toTree=Gs,M.uniqueArray=Ys,M.upFirst=Fi,M.useSortable=ea,Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));