halov 26.812.0 → 26.902.0

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,7 +1,7 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("img[data-v-f7799232]{display:block;max-width:100%}.app-tab-item[data-v-df170cc3]{border-top-width:2px}[data-v-e7319d81] .n-upload-trigger{display:block}.item-box[data-v-e7319d81]{display:block;flex-grow:1}.form-input[data-v-e7319d81]{display:block}.text-input[data-v-e7319d81]{font-size:small;display:block;text-align:end;padding-right:4px}.detail-page-card-center[data-v-6dec6e5e]{width:1080px;align-self:center;margin:1em}div[data-v-8b391a0f] div.n-form-item-feedback-wrapper{display:none}div[data-v-8b391a0f] .n-form-item-blank{margin-bottom:4px}.n-form-item.n-form-item--left-labelled.n-form-item--auto-label-width>label{min-width:8em}[data-v-18129d6e] .n-upload-trigger{display:block}.edit-title-btn{visibility:hidden}.grid-config-global-mode .edit-title-btn{visibility:visible}.main-detail-panel[data-v-ca4664e2]{display:flex;width:100%;height:100%;overflow:hidden;--n-resize-trigger-color: rgb(224, 224, 230, .24);--n-resize-trigger-color-hover: #36ad6a}.dark .main-detail-panel[data-v-ca4664e2]{--n-resize-trigger-color: rgba(255, 255, 255, .24);--n-resize-trigger-color-hover: #7fe7c4}.main-detail-panel.horizontal[data-v-ca4664e2]{flex-direction:row}.main-detail-panel.vertical[data-v-ca4664e2]{flex-direction:column}.panel[data-v-ca4664e2]{overflow:auto;display:flex;flex-direction:column}.divider[data-v-ca4664e2]{background-color:var(--n-resize-trigger-color);cursor:col-resize;transition:background .2s}.main-detail-panel.horizontal .divider[data-v-ca4664e2]{width:4px;height:100%}.main-detail-panel.vertical .divider[data-v-ca4664e2]{height:4px;width:100%;cursor:row-resize}.divider.dragging[data-v-ca4664e2],.divider[data-v-ca4664e2]:hover{background-color:var(--n-resize-trigger-color-hover)}.icon-container[data-v-ff87aac6]{display:flex;flex-direction:row;flex-wrap:wrap;padding-right:4px;padding-bottom:4px}.icon-button[data-v-ff87aac6]{max-width:100px;height:90px;width:80px;margin:4px 0 0 4px}.menu-spin>.n-spin-content{height:100%;display:flex;flex-direction:column}.user-name-box[data-v-d85ebb4a]{background:#abf3;position:relative;z-index:1;width:6rem;height:27px;line-height:27px;border-radius:0 27px 27px 0;left:20px;top:6px}.user-name-label[data-v-d85ebb4a]{padding-left:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-transform:uppercase;text-align:center}.app-tabs{margin-bottom:0}.app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type{--n-tab-color: #D1D5DB;--n-tab-text-color: #1E1B4B;--n-tab-text-color-active: #1E1B4B;--n-tab-border-color: #A3A3A3}.dark .app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type{--n-tab-color: #27272A;--n-tab-text-color: #71717A;--n-tab-text-color-active: #D4D4D8;--n-tab-border-color: #525252}.app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type .n-tabs-tab.n-tabs-tab--active{background-color:#f4f4f5;border-bottom-color:#f4f4f5;font-weight:bolder;border-top-color:#1e40af}.dark .app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type .n-tabs-tab.n-tabs-tab--active{background-color:#171717;border-bottom-color:#171717;border-top-color:#e2e8f0}.app-tab-label{padding:0 1em}.d-block{display:block}.d-none{display:none}.d-flex{display:flex}.d-inline{display:inline}.d-inline-block{display:inline-block}.n-form .n-form-item .n-form-item-feedback-wrapper:empty{display:none}.n-form .n-form-item{margin-bottom:4px}.n-data-table-td,.n-data-table-th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.n-dropdown-menu.n-dropdown{min-width:150px}.text-monospace,.halo-form-code input,.halo-form-code-u input,.halo-form-code-l input{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace}.halo-form-code-u input,.halo-form-code-u{text-transform:uppercase}.halo-form-code-l input,.halo-form-code-l{text-transform:lowercase}.halo-form-wrap{white-space:wrap;overflow-wrap:break-word;display:inline-block}.h-100{height:100%}.h-50{height:50%}td .halo-form-code,td .halo-form-code-u,td .halo-form-code-l{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace}td.text-num{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace;text-align:right}td.text-date,td.text-time,td.text-datetime{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace}td .percent-mark{margin-left:4px;margin-right:2px}td .percent-mark svg{margin:0 auto;display:block}td .status-tag{border-radius:2px;border-width:0 0 0 4px;border-style:solid;padding:0 4px;font-size:smaller;border-color:#9999}td .status-New,td .status-Created,td .status-Standby{border-color:#8bc34a99}td .status-True,td .status-true,td .status-Success,td .status-Succeeded,td .status-Succeed,td .status-Good,td .status-InStock,td .status-Passed,td .status-Resolved,td .status-Processing,td .status-InProduction,td .status-Allowed,td .status-Qualified,td .status-Loaded{border-color:#18a05899}td .status-False,td .status-false,td .status-NonGood,td .status-Failed,td .status-Rejected,td .status-Abnormal,td .status-Forbidden,td .status-Defective{border-color:#d0305099}td .status-Confirmed,td .status-Dispatched,td .status-Inspected{border-color:#3f51b599}td .status-Consumed,td .status-Finished,td .status-Unloaded{border-color:#607d8b99}td .status-Ignored{border-color:#79554899}td .status-OutStock,td .status-Cancelled{border-color:#9e9e9e99}td .status-InTransit{border-color:#78909c99}td .status-InFactory{border-color:#43a04799}td .status-InGarage{border-color:#673ab799}td .status-Doubt,td .status-Paused{border-color:#ffc10799}td .status-Read{border-color:#ffc107cc}td .status-Write{border-color:#673ab7cc}.n-data-table .n-data-table-th .n-data-table-sorter:not(.n-data-table-sorter--asc):not(.n-data-table-sorter--desc){display:none}.n-data-table .btn-cell-ref .n-button__content{opacity:.2}.n-data-table .btn-cell-ref:hover .n-button__content{opacity:1;color:#673ab7}.n-data-table .btn-cell-qr .n-button__content{opacity:.2}.n-data-table .btn-cell-qr:hover .n-button__content{opacity:1;color:#673ab7}.n-data-table-td:not(.check-mark) .cell-unchecked{display:none}.draging-ghost{opacity:.5;background:#c8ebfb}.drag-sorting-handle{cursor:row-resize}.pg-item{margin:1px;border:1px solid transparent;padding:2px;border-radius:3px;display:flex;flex-direction:row;align-items:center}.pg-item:hover{border-color:#eee}.dark .pg-item:hover{border-color:#fff6}.pg-label{padding:0 2px;white-space:nowrap;max-width:50%;text-overflow:clip}.pg-value{padding-left:.5em;padding-right:1em;position:relative}.menu-icon{border-radius:2px}.menu-icon-blank{width:16px;height:16px}.text-positive{color:#00c853}.text-negative,.text-danger{color:#b71c1c}ul,li{list-style:none}html,body,#app,.n-config-provider{height:100%;margin:0;padding:0}.flex-column{display:flex;flex-direction:column}.flex-row{display:flex;flex-direction:row}.flex-1{flex:1 1 0}.flex-grow-1{flex-grow:1}.flex-shrink-1{flex-shrink:1}.flex-wrap{flex-wrap:wrap}.gap1{gap:1em}.gap05{gap:.5em}.gap025{gap:.25em}.gap015{gap:.15em}.gap01{gap:.1em}.gap-x-1{column-gap:1em}.gap-x-05{column-gap:.5em}.gap-x-25{column-gap:.25em}.gap-y-1{row-gap:1em}.gap-y-05{row-gap:.5em}.gap-y-25{row-gap:.25em}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.week-0{background-color:#a5d6a7}input.ime-off,.ime-off input{ime-mode:disabled}.h-scroll{overflow-x:scroll}.v-scroll{overflow-y:scroll}.tabs-card.n-card>.n-card__content{padding:0}.tabs-card.n-card>.n-card__content .n-tab-pane{padding:0}.tabs-card.n-card>.n-card__content .n-tab-pane>.n-card{border-top:0}.info-card{flex-grow:1;margin-top:1em}.info-card>.n-card__content{display:flex;flex-direction:column}.info-card>.n-card__content>.n-tabs{flex-grow:1}.info-card>.n-card__content>.n-tabs>.n-tab-pane{flex-grow:1;display:flex;flex-direction:column}.info-card>.n-card__content>.n-tabs>.n-tab-pane>div{flex-grow:1;display:flex;flex-direction:column}.page-component.n-space>div:first-child{flex-grow:1;display:flex;flex-direction:column}.form-create .n-input--disabled .n-input__input-el,.form-create .n-input--disabled .n-input__placeholder,.form-create .n-input--disabled .n-input__textarea-el,.form-create .n-base-selection--disabled .n-base-selection-overlay__wrapper{color:#000;font-weight:700}.bordered{border:1px solid var(--n-border-color);border-radius:var(--n-border-radius)}.n-dialog__content .line,.n-message__content .line{display:block}.n-tree-node-content__text{white-space:nowrap}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- (function(M,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("axios"),require("vue-router"),require("naive-ui"),require("pinia"),require("moment"),require("mustache"),require("vue-draggable-plus")):typeof define=="function"&&define.amd?define(["exports","vue","axios","vue-router","naive-ui","pinia","moment","mustache","vue-draggable-plus"],e):(M=typeof globalThis<"u"?globalThis:M||self,e(M.halov={},M.Vue,M.axios,M.VueRouter,M.NaiveUI,M.Pinia,M.moment,M.Mustache,M.VueDraggablePlus))})(this,function(M,e,re,de,u,Ae,ie,Ce,Yt){"use strict";var Ed=Object.defineProperty;var Ld=(M,e,re)=>e in M?Ed(M,e,{enumerable:!0,configurable:!0,writable:!0,value:re}):M[e]=re;var J=(M,e,re)=>Ld(M,typeof e!="symbol"?e+"":e,re);var et=typeof document<"u"?document.currentScript:null;const tt=window,Qt="halo-lang";class ml{constructor(l,o=!0){J(this,"langCode","");J(this,"ignoreCase",!1);this.ignoreCase=o,this.swtichLang(l)}loadScript(l){const o=document.createElement("script");return o.src=l,o.id=Qt,document.head.appendChild(o),o}unloadScript(){const l=document.getElementById(Qt);return l&&l.parentNode?(l.parentNode.removeChild(l),!0):!1}swtichLang(l){if(this.langCode!=l){this.langCode=l;const o=`/api/core/Languages/embed.js?code=${encodeURIComponent(l)}&caseType=lowercase`;this.unloadScript(),this.loadScript(o)}}t(l){var n;if(!l)return"";const o=(n=tt.lang)==null?void 0:n.words;return o&&o[this.ignoreCase?l.toLowerCase():l]||l}t2(l,o){var r;if(!l&&!o)return"";const n=(r=tt.lang)==null?void 0:r.words;if(n){if(l){const a=n[this.ignoreCase?l.toLowerCase():l];if(a)return a}if(o){const a=n[this.ignoreCase?o.toLowerCase():o];if(a)return a}}return l||o}info(){const l=tt.lang;if(l)return{code:l.code,name:l.name,displayName:l.displayName,nativeName:l.nativeName,revision:l.revision,rtl:l.rtl}}}const Xt=Symbol("halo-i18n");let ot=null;function Jt(t,l){return ot||(ot=new ml(t,l)),ot}function qt(t,l,o=!0){const n=Jt(l,o);t.config.globalProperties.$t=r=>n.t(r),t.provide(Xt,n)}function W(){const t=e.inject(Xt);if(!t)throw new Error("I18n not initialized. Ensure I18nPlugin is installed.");return{i18n:t,t:t.t.bind(t),switchLang:t.swtichLang.bind(t),lang:t.info}}const hl=()=>{let t=localStorage.getItem("Client-Device-Id");return t||(typeof crypto<"u"&&typeof crypto.randomUUID=="function"?t=crypto.randomUUID():t="c-"+Math.random().toString(36).substring(2)+Date.now().toString(36),localStorage.setItem("Client-Device-Id",t)),t};re.defaults.headers["Client-Device-Id"]=hl(),re.defaults.headers["Content-type"]="application/json",re.defaults.timeout=1e3*60,re.interceptors.request.use(t=>{const l=localStorage.getItem("sessionToken");return l&&t.headers&&(t.headers.Authorization=`Bearer ${l}`),t},t=>(console.log(t),Promise.reject(t))),re.interceptors.response.use(t=>t.status==200?t.data:Promise.reject(t.statusText),t=>{if(t&&t.response&&t.response.status)switch(t.response.status){case 401:const l=de.useRouter();l==null||l.push({name:"Unauthorized"});break}return Promise.reject(t)});const gl=["src"],yl=e.defineComponent({__name:"AppLogoBox",props:{src:{type:String,required:!0},height:{type:String,default:"40px"},defaultSrc:{type:String,default:new URL("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4xIChjNjhlMjJjMzg3LCAyMDIxLTA1LTIzKSIKICAgaW5rc2NhcGU6ZXhwb3J0LXlkcGk9IjUuNjExNzEyIgogICBpbmtzY2FwZTpleHBvcnQteGRwaT0iNS42MTE3MTIiCiAgIGlua3NjYXBlOmV4cG9ydC1maWxlbmFtZT0iRDpcQ29kZXNcSk1DX0ZyYW1lX0FuZG9uXEFydHNcbG9nb18yMC5wbmciCiAgIHNvZGlwb2RpOmRvY25hbWU9ImxvZ28uc3ZnIgogICB3aWR0aD0iODAuNjk3OTE0bW0iCiAgIGhlaWdodD0iNzYuOTQ2MjEzbW0iCiAgIHZpZXdCb3g9IjAgMCA4MC42OTc5MTQgNzYuOTQ2MjEzIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmc4IgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgaW5rc2NhcGU6ZG9jdW1lbnQtcm90YXRpb249IjAiCiAgICAgaW5rc2NhcGU6Y3VycmVudC1sYXllcj0iZzQ1NDMiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMSIKICAgICBpbmtzY2FwZTp3aW5kb3cteT0iLTgiCiAgICAgaW5rc2NhcGU6d2luZG93LXg9Ii04IgogICAgIGlua3NjYXBlOmN5PSIxNDQuOTI4NiIKICAgICBpbmtzY2FwZTpjeD0iNjcuMDg0ODUzIgogICAgIGlua3NjYXBlOnpvb209IjAuNzkwMDQ0MjIiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlkPSJuYW1lZHZpZXc4NTMiCiAgICAgaW5rc2NhcGU6d2luZG93LWhlaWdodD0iMTAxNyIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjE5MjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTpwYWdlb3BhY2l0eT0iMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgZ3JpZHRvbGVyYW5jZT0iMTAiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBib3JkZXJvcGFjaXR5PSIxIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIHBhZ2Vjb2xvcj0iI2ZmZmZmZiIKICAgICBpbmtzY2FwZTpwYWdlY2hlY2tlcmJvYXJkPSIwIgogICAgIGlua3NjYXBlOmRvY3VtZW50LXVuaXRzPSJtbSIgLz4KICA8ZGVmcwogICAgIGlkPSJkZWZzMiI+CiAgICA8Y2xpcFBhdGgKICAgICAgIGNsaXBQYXRoVW5pdHM9InVzZXJTcGFjZU9uVXNlIgogICAgICAgaWQ9ImNsaXBQYXRoNDU2MyI+CiAgICAgIDxyZWN0CiAgICAgICAgIHN0eWxlPSJvcGFjaXR5OjE7ZmlsbDojZmYyYTJhO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDozLjQyNzE2NjQ2O3N0cm9rZS1taXRlcmxpbWl0OjQ7c3Ryb2tlLWRhc2hhcnJheTpub25lO3N0cm9rZS1vcGFjaXR5OjEiCiAgICAgICAgIGlkPSJyZWN0NDU2NSIKICAgICAgICAgd2lkdGg9IjgwLjY5NzkxNCIKICAgICAgICAgaGVpZ2h0PSI3Ni45OTM3NTIiCiAgICAgICAgIHg9Ijg0Ljc1ODIxNyIKICAgICAgICAgeT0iNjUuMTk2NjQ4IgogICAgICAgICByeD0iMTAiCiAgICAgICAgIHJ5PSIxMCIgLz4KICAgIDwvY2xpcFBhdGg+CiAgPC9kZWZzPgogIDxtZXRhZGF0YQogICAgIGlkPSJtZXRhZGF0YTUiPgogICAgPHJkZjpSREY+CiAgICAgIDxjYzpXb3JrCiAgICAgICAgIHJkZjphYm91dD0iIj4KICAgICAgICA8ZGM6Zm9ybWF0PmltYWdlL3N2Zyt4bWw8L2RjOmZvcm1hdD4KICAgICAgICA8ZGM6dHlwZQogICAgICAgICAgIHJkZjpyZXNvdXJjZT0iaHR0cDovL3B1cmwub3JnL2RjL2RjbWl0eXBlL1N0aWxsSW1hZ2UiIC8+CiAgICAgIDwvY2M6V29yaz4KICAgIDwvcmRmOlJERj4KICA8L21ldGFkYXRhPgogIDxnCiAgICAgaWQ9ImxheWVyMSIKICAgICB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtODQuNzU4MjE3LC02NS4yNDQxODMpIj4KICAgIDxnCiAgICAgICBpZD0iZzQ1NDMiCiAgICAgICBjbGlwLXBhdGg9InVybCgjY2xpcFBhdGg0NTYzKSI+CiAgICAgIDxwYXRoCiAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgIGlkPSJwYXRoNDUzMiIKICAgICAgICAgZD0ibSAxMjIuNjcxMDEsOTkuMDkwNTY2IDM0LjY3MTkyLC0zMy44NDYzODMgaCAyMy41NjQ0NSBsIC0zOC44NjA2OCwzNS44MTE3NjcgMjMuNDA5NDIsNDEuMTM0NDQgdiAwIEggMTQzLjU5NyBsIC0xNy4zMTE2MSwtMzEuMTYwODkgLTcuNDE0MDgsNi40NTc0MiIKICAgICAgICAgc3R5bGU9ImZvbnQtc3R5bGU6aXRhbGljO2ZvbnQtdmFyaWFudDpub3JtYWw7Zm9udC13ZWlnaHQ6Ym9sZDtmb250LXN0cmV0Y2g6bm9ybWFsO2ZvbnQtc2l6ZToxMDUuODMzcHg7bGluZS1oZWlnaHQ6MS4yNTtmb250LWZhbWlseTpzYW5zLXNlcmlmOy1pbmtzY2FwZS1mb250LXNwZWNpZmljYXRpb246J3NhbnMtc2VyaWYgQm9sZCBJdGFsaWMnO2xldHRlci1zcGFjaW5nOjBweDt3b3JkLXNwYWNpbmc6MHB4O2ZpbGw6IzVlMzViMTtmaWxsLW9wYWNpdHk6MTtzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MC4yNjQ1ODMiIC8+CiAgICAgIDxwYXRoCiAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgIGQ9Im0gMTE5LjkyOTY1LDExNi44MTcyNyBjIC0yLjEwMTUxLDkuMDI2MTUgLTYuMDQ2MTMsMTUuNzA5NjMgLTExLjgzMzkxLDIwLjA1MDQ1IC01Ljc4Nzc2LDQuMzQwODIgLTEzLjcxMTQ4LDYuNTExMjMgLTIzLjc3MTE1OSw2LjUxMTIzIC0zLjY4NjI1MiwwIC03LjAxMDc2OSwtMC4xMzc4IC05Ljk3MzU1MSwtMC40MTM0MSAtMi45NjI3ODMsLTAuMjQxMTUgLTUuNjE1NTA2LC0wLjYwMjg5IC03Ljk1ODE3MSwtMS4wODUyIGwgMy42NjkwMjcsLTE1LjI4NjUxIGMgNC41Njc1NzYsMC42NTExNyA5LjIxNjI0OSwxLjg4Njg3IDEzLjI4MDg0MywxLjkwMjMxIDUuMjcwOTk2LDAgOS4yMTU2MywtMS4yNTc0NiAxMS44MzM5MDUsLTMuNzcyMzggMi42MTgyNywtMi41MTQ5MiA0Ljc1NDIzLC03LjQwNjk2IDYuNDA3ODc2LC0xNC42NzYxMSBsIDcuMDc5NjgsLTMwLjY0NDEyNCBIIDkxLjA5NDE5NCBMIDk0LjM0OTgwOSw2NS4yNDQxODMgSCAxMzEuODY2OSBaIgogICAgICAgICBzdHlsZT0iZm9udC1zdHlsZTppdGFsaWM7Zm9udC12YXJpYW50Om5vcm1hbDtmb250LXdlaWdodDpib2xkO2ZvbnQtc3RyZXRjaDpub3JtYWw7Zm9udC1zaXplOjEwNS44MzNweDtsaW5lLWhlaWdodDoxLjI1O2ZvbnQtZmFtaWx5OnNhbnMtc2VyaWY7LWlua3NjYXBlLWZvbnQtc3BlY2lmaWNhdGlvbjonc2Fucy1zZXJpZiBCb2xkIEl0YWxpYyc7bGV0dGVyLXNwYWNpbmc6MHB4O3dvcmQtc3BhY2luZzowcHg7ZGlzcGxheTppbmxpbmU7ZmlsbDojMzExYjkyO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDowLjI2NDU4MyIKICAgICAgICAgaWQ9InBhdGg0NDg5IiAvPgogICAgPC9nPgogIDwvZz4KPC9zdmc+Cg==",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:et&&et.tagName.toUpperCase()==="SCRIPT"&&et.src||new URL("halov.umd.cjs",document.baseURI).href).href}},setup(t){const l=t,o=e.ref(l.src);e.watch(()=>l.src,r=>{o.value=r});function n(){o.value=l.defaultSrc}return(r,a)=>(e.openBlock(),e.createElementBlock("img",{src:o.value,style:e.normalizeStyle({height:t.height,objectFit:"contain"}),onError:n,alt:"App Logo"},null,44,gl))}}),oe=(t,l)=>{const o=t.__vccOpts||t;for(const[n,r]of l)o[n]=r;return o},Ut=oe(yl,[["__scopeId","data-v-f7799232"]]);function wl(){try{const t=sessionStorage.getItem("tabs");return t?JSON.parse(t):null}catch{return null}}const nt=Ae.defineStore("tabs",{state:()=>({tabs:wl(),selectedTab:sessionStorage.getItem("selectedTab")}),actions:{setTabs(t){this.tabs=t,t?(sessionStorage.setItem("tabs",JSON.stringify(t)),t.length||this.setSelectedTab(null)):(sessionStorage.removeItem("tabs"),this.setSelectedTab(null))},setSelectedTab(t){this.selectedTab=t,t?sessionStorage.setItem("selectedTab",t):sessionStorage.removeItem("selectedTab")},addTab(t){let l=this.tabs;l?l.find(o=>o.id==t.id)||l.push(t):l=[t],this.setTabs(l),this.setSelectedTab(t.id)},selectTab(t){this.setSelectedTab(t)},closeTab(t){const l=this.tabs;if(l){const o=l.findIndex(n=>n.id==t);o>-1&&(l.splice(o,1),this.setTabs(l))}},changeTabId(t,l){const o=this.tabs;if(o){const n=o.find(r=>r.id==t);n&&!o.find(r=>r.id==l)&&(n.id=l,this.setTabs(o))}},clearTabs(){this.setTabs([]),this.setSelectedTab(null)}}});var Cl=typeof global=="object"&&global&&global.Object===Object&&global,kl=typeof self=="object"&&self&&self.Object===Object&&self,bl=Cl||kl||Function("return this")(),ke=bl.Symbol,vt=Object.prototype,Nl=vt.hasOwnProperty,xl=vt.toString,_e=ke?ke.toStringTag:void 0;function Sl(t){var l=Nl.call(t,_e),o=t[_e];try{t[_e]=void 0;var n=!0}catch{}var r=xl.call(t);return n&&(l?t[_e]=o:delete t[_e]),r}var Il=Object.prototype,Bl=Il.toString;function Vl(t){return Bl.call(t)}var Ml="[object Null]",Tl="[object Undefined]",eo=ke?ke.toStringTag:void 0;function Al(t){return t==null?t===void 0?Tl:Ml:eo&&eo in Object(t)?Sl(t):Vl(t)}function _l(t){return t!=null&&typeof t=="object"}var El="[object Symbol]";function Ll(t){return typeof t=="symbol"||_l(t)&&Al(t)==El}function zl(t,l){for(var o=-1,n=t==null?0:t.length,r=Array(n);++o<n;)r[o]=l(t[o],o,t);return r}var $l=Array.isArray,to=ke?ke.prototype:void 0,oo=to?to.toString:void 0;function no(t){if(typeof t=="string")return t;if($l(t))return zl(t,no)+"";if(Ll(t))return oo?oo.call(t):"";var l=t+"";return l=="0"&&1/t==-1/0?"-0":l}function lt(t){return t==null?"":no(t)}function Dl(t,l,o){var n=-1,r=t.length;l<0&&(l=-l>r?0:r+l),o=o>r?r:o,o<0&&(o+=r),r=l>o?0:o-l>>>0,l>>>=0;for(var a=Array(r);++n<r;)a[n]=t[n+l];return a}function Rl(t,l,o){var n=t.length;return o=o===void 0?n:o,!l&&o>=n?t:Dl(t,l,o)}var Ol="\\ud800-\\udfff",jl="\\u0300-\\u036f",Fl="\\ufe20-\\ufe2f",Pl="\\u20d0-\\u20ff",Hl=jl+Fl+Pl,Gl="\\ufe0e\\ufe0f",Kl="\\u200d",Wl=RegExp("["+Kl+Ol+Hl+Gl+"]");function lo(t){return Wl.test(t)}function Zl(t){return t.split("")}var ro="\\ud800-\\udfff",Yl="\\u0300-\\u036f",Ql="\\ufe20-\\ufe2f",Xl="\\u20d0-\\u20ff",Jl=Yl+Ql+Xl,ql="\\ufe0e\\ufe0f",Ul="["+ro+"]",rt="["+Jl+"]",at="\\ud83c[\\udffb-\\udfff]",vl="(?:"+rt+"|"+at+")",ao="[^"+ro+"]",so="(?:\\ud83c[\\udde6-\\uddff]){2}",io="[\\ud800-\\udbff][\\udc00-\\udfff]",er="\\u200d",co=vl+"?",fo="["+ql+"]?",tr="(?:"+er+"(?:"+[ao,so,io].join("|")+")"+fo+co+")*",or=fo+co+tr,nr="(?:"+[ao+rt+"?",rt,so,io,Ul].join("|")+")",lr=RegExp(at+"(?="+at+")|"+nr+or,"g");function rr(t){return t.match(lr)||[]}function ar(t){return lo(t)?rr(t):Zl(t)}function sr(t){return function(l){l=lt(l);var o=lo(l)?ar(l):void 0,n=o?o[0]:l.charAt(0),r=o?Rl(o,1).join(""):l.slice(1);return n[t]()+r}}var ir=sr("toUpperCase");function cr(t,l,o,n){for(var r=-1,a=t==null?0:t.length;++r<a;)o=l(o,t[r],r,t);return o}function dr(t){return function(l){return t==null?void 0:t[l]}}var fr={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},ur=dr(fr),pr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mr="\\u0300-\\u036f",hr="\\ufe20-\\ufe2f",gr="\\u20d0-\\u20ff",yr=mr+hr+gr,wr="["+yr+"]",Cr=RegExp(wr,"g");function kr(t){return t=lt(t),t&&t.replace(pr,ur).replace(Cr,"")}var br=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Nr(t){return t.match(br)||[]}var xr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Sr(t){return xr.test(t)}var uo="\\ud800-\\udfff",Ir="\\u0300-\\u036f",Br="\\ufe20-\\ufe2f",Vr="\\u20d0-\\u20ff",Mr=Ir+Br+Vr,po="\\u2700-\\u27bf",mo="a-z\\xdf-\\xf6\\xf8-\\xff",Tr="\\xac\\xb1\\xd7\\xf7",Ar="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",_r="\\u2000-\\u206f",Er=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ho="A-Z\\xc0-\\xd6\\xd8-\\xde",Lr="\\ufe0e\\ufe0f",go=Tr+Ar+_r+Er,yo="['’]",wo="["+go+"]",zr="["+Mr+"]",Co="\\d+",$r="["+po+"]",ko="["+mo+"]",bo="[^"+uo+go+Co+po+mo+ho+"]",Dr="\\ud83c[\\udffb-\\udfff]",Rr="(?:"+zr+"|"+Dr+")",Or="[^"+uo+"]",No="(?:\\ud83c[\\udde6-\\uddff]){2}",xo="[\\ud800-\\udbff][\\udc00-\\udfff]",be="["+ho+"]",jr="\\u200d",So="(?:"+ko+"|"+bo+")",Fr="(?:"+be+"|"+bo+")",Io="(?:"+yo+"(?:d|ll|m|re|s|t|ve))?",Bo="(?:"+yo+"(?:D|LL|M|RE|S|T|VE))?",Vo=Rr+"?",Mo="["+Lr+"]?",Pr="(?:"+jr+"(?:"+[Or,No,xo].join("|")+")"+Mo+Vo+")*",Hr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Gr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Kr=Mo+Vo+Pr,Wr="(?:"+[$r,No,xo].join("|")+")"+Kr,Zr=RegExp([be+"?"+ko+"+"+Io+"(?="+[wo,be,"$"].join("|")+")",Fr+"+"+Bo+"(?="+[wo,be+So,"$"].join("|")+")",be+"?"+So+"+"+Io,be+"+"+Bo,Gr,Hr,Co,Wr].join("|"),"g");function Yr(t){return t.match(Zr)||[]}function Qr(t,l,o){return t=lt(t),l=l,l===void 0?Sr(t)?Yr(t):Nr(t):t.match(l)||[]}var Xr="['’]",Jr=RegExp(Xr,"g");function qr(t){return function(l){return cr(Qr(kr(l).replace(Jr,"")),t,"")}}var Ur=qr(function(t,l,o){return t+(o?" ":"")+ir(l)});const Ee="YYYY/MM/DD HH:mm:ss",ge="YYYY/MM/DD",Le="HH:mm:ss";function te(t){return t.length?Ur(t):t}function fe(t){if(t!=null){if(typeof t=="boolean"||t instanceof Boolean)return t;if(typeof t=="number"||typeof t=="bigint")return t>0;if(typeof t=="string"||typeof t=="object")switch(t==null?void 0:t.toString().toLowerCase().trim()){case"true":case"yes":case"1":case"y":return!0;case"false":case"no":case"0":case"n":return!1}else if(typeof t=="function"){const l=t.call(null);if(l)return fe(l)}}}function Oe(t,l){const o=fe(t);return o===void 0?l||!1:o}function To(t,l){if(t!=null){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t);if(typeof t=="string")return ie(t,l||Ee).toDate()}}function Ao(t){return typeof t=="object"&&t!==null&&"hour"in t&&"minute"in t}function vr(t){const l=t%1e3;t/=1e3;const o=t%60;t/=60;const n=t%60;return t/=60,{hour:t%24,minute:n,second:o,millisecond:l}}function _o(t){const l=t%60;t/=60;const o=t%60;return t/=60,{hour:t%24,minute:o,second:l,millisecond:0}}function Eo(t,l){const o=ie(t,l||Le);if(o)return{hour:o.hour(),minute:o.minute(),second:o.second(),millisecond:o.millisecond()}}function Lo(t,l){var o,n;if(t){if(typeof t=="string")return(n=(o=ie(t,l||Ee))==null?void 0:o.toDate())==null?void 0:n.getTime();if(typeof t=="number")return t;if(t instanceof Date)return t.getTime()}}function zo(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return ie(new Date(t)).format(l||Le);if(t instanceof Date)return ie(t).format(l||Le);if(Ao(t))return ie(new Date(2e3,1,1,t.hour,t.minute,t.second)).format(l||Le);if(typeof t=="object")return t==null?void 0:t.toString()}}function st(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return ie(new Date(t)).format(l||ge);if(t instanceof Date)return ie(t).format(l||ge);if(typeof t=="object")return t==null?void 0:t.toString()}}function it(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return ie(new Date(t)).format(l||Ee);if(t instanceof Date)return ie(t).format(l||Ee);if(typeof t=="object")return t==null?void 0:t.toString()}}function $o(t){if(t){const l=t.lastIndexOf(":");if(l>-1&&l<t.length-1)return t.substring(0,l+1)+Math.round(Number(t.substring(l+1,t.length)))}return t}function Do(t){const l={},o=t.split("&").map(n=>n.trim()).filter(n=>n);for(const n of o){let r,a;const i=n.indexOf("=");if(i>-1?(r=n.substring(0,i),a=n.substring(i+1)):r=n,r in l){if(a){const d=l[r];Array.isArray(d)?d.push(a):d?l[r]=[d,a]:l[r]=a}}else l[r]=a}return l}function ea(t,l){let o=t;if(l){const n=[];for(const r in l){const a=l[r];if(Array.isArray(a))for(const i of a)n.push(`${r}=${encodeURIComponent(i)}`);else a?n.push(`${r}=${encodeURIComponent(a)}`):n.push(r)}n.length&&(o+="?"+n.join("&"))}return o}function U(t,l,o=!0){if(!l||Object.keys(l).length==0)return t;let n=t,r={};const a=t.indexOf("?");a>-1&&(n=t.substring(0,a),r=Do(t.substring(a+1)));let i={};const d=Array.isArray(l)?l:[l];for(let m of d)if(m)if(typeof m=="string")i=Do(m);else for(const c in m){const s=m[c];Array.isArray(s)?i[c]=s.map(g=>g==null?void 0:g.toString()):s!=null?i[c]=s.toString():i[c]=void 0}else continue;if(Object.keys(i).length==0)return t;if(r.length)for(const m in i)if(m in r&&!o){const c=r[m],s=i[m];Array.isArray(c)?Array.isArray(s)?c.push(...s):c.push(s):c?Array.isArray(s)?r[m]=[c,...s]:r[m]=[c,s]:r[m]=i[m]}else r[m]=i[m];else for(const m in i)r[m]=i[m];return ea(n,r)}function je(t,l,o){if(t==null)return t;switch(l){case"number":return Number(t);case"boolean":case"bool":return fe(t);case"date":case"datetime":return it(t);default:return o&&typeof t=="string"&&(o.includes("code-u")?t=t.toUpperCase():o.includes("code-l")&&(t=t.toLowerCase())),t}}function Ro(t){switch(t){case"number":return 0;case"boolean":case"bool":return!1;case"date":case"datetime":return new Date}}function ta(){return new Date().getTime().toString()}function oa(t,l){const o={};if(t)if(l)for(const n of l)typeof n=="string"?o[te(n)]=t[n]:o[te(n.name)]=t[n.name];else for(const n in t)o[te(n)]=t[n];return o}function na(t,l){return ie(t,ge).add(l,"days").format(ge)}function la(t,l){if(!t||!l){const o=new Date;t||(t=o.getFullYear()),l||(l=o.getMonth())}return new Date(t,l,1)}function ra(t,l){if(!t||!l){const o=new Date;t||(t=o.getFullYear()),l||(l=o.getMonth())}return new Date(t,l+1,0)}function aa(t,l=!0,o=!0){var r,a;let n=(a=(r=t==null?void 0:t.split(/\s*,\s*|\r?\n+/))==null?void 0:r.map(i=>i.trim()))==null?void 0:a.filter(i=>!l||i.length>0);return n&&o&&(n=n.filter((i,d,m)=>i&&m.indexOf(i)==d)),n}function sa(t,l=!0,o=!0){var r,a;let n=(a=(r=t==null?void 0:t.split(/\r?\n/))==null?void 0:r.map(i=>i.trim()))==null?void 0:a.filter(i=>!l||i.length>0);return n&&o&&(n=n.filter((i,d,m)=>i&&m.indexOf(i)==d)),n}function ia(t){const l=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return!!t.toLowerCase().match(l)}function Oo(t,l=!1){switch(typeof t){case"number":return l?Math.max(0,Math.max(100,t*100)):t*100;case"string":const o=t.indexOf("%");if(o>-1){t=t.substring(0,o-1);const n=Number(t);if(!Number.isNaN(n))return l?Math.max(0,Math.max(100,n)):n}else{const n=Number(t);if(!Number.isNaN(n))return l?Math.max(0,Math.max(100,n*100)):n*100}}}function jo(t){return t==null?!0:/^\s*$/.test(t)}function ca(t,l){return jo(t)?l:t}const Ne=Ae.defineStore("common",{state:()=>({themeName:localStorage.getItem("theme"),menuCollapsed:Oe(localStorage.getItem("menu-collapsed")),isFullscreen:!1,sharedData:{}}),getters:{isDarkTheme:t=>t.themeName=="darkTheme"},actions:{toggleTheme(){this.themeName=="darkTheme"?this.setThemeName(null):this.setThemeName("darkTheme")},setThemeName(t){this.themeName=t,t?localStorage.setItem("theme",t):localStorage.removeItem("theme")},setMenuCollapsed(t){this.menuCollapsed=t,localStorage.setItem("menu-collapsed",t.toString())},setIsFullscreen(t){this.isFullscreen=t},async fetchSharedData(t,l){let o=this.sharedData[t];if(o||(o={key:t,isLoading:!1,data:void 0,error:void 0,promise:void 0},this.sharedData[t]=o),o.data!==void 0)return o.data;if(o.isLoading&&o.promise)return o.promise;try{o.isLoading=!0,o.promise=l();const n=await o.promise;return o.data=n,o.isLoading=!1,o.promise=void 0,n}catch(n){throw o.isLoading=!1,o.error=n,o.promise=void 0,n}}}}),da={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},fa=e.defineComponent({name:"ArrowDropDownOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",da,o[0]||(o[0]=[e.createElementVNode("path",{d:"M7 10l5 5l5-5H7z",fill:"currentColor"},null,-1)]))}}),ua={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},pa=e.defineComponent({name:"CheckFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ua,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z",fill:"currentColor"},null,-1)]))}}),ma={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Fo=e.defineComponent({name:"ClearFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ma,o[0]||(o[0]=[e.createElementVNode("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z",fill:"currentColor"},null,-1)]))}}),ha={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ga=e.defineComponent({name:"CloseOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ha,o[0]||(o[0]=[e.createElementVNode("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z",fill:"currentColor"},null,-1)]))}}),ya={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},wa=e.defineComponent({name:"ColorizeFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ya,o[0]||(o[0]=[e.createElementVNode("path",{d:"M20.71 5.63l-2.34-2.34a.996.996 0 0 0-1.41 0l-3.12 3.12l-1.93-1.91l-1.41 1.41l1.42 1.42L3 16.25V21h4.75l8.92-8.92l1.42 1.42l1.41-1.41l-1.92-1.92l3.12-3.12c.4-.4.4-1.03.01-1.42zM6.92 19L5 17.08l8.06-8.06l1.92 1.92L6.92 19z",fill:"currentColor"},null,-1)]))}}),Ca={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ka=e.defineComponent({name:"DarkModeOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ca,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9.37 5.51A7.35 7.35 0 0 0 9.1 7.5c0 4.08 3.32 7.4 7.4 7.4c.68 0 1.35-.09 1.99-.27A7.014 7.014 0 0 1 12 19c-3.86 0-7-3.14-7-7c0-2.93 1.81-5.45 4.37-6.49zM12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 0 1-4.4 2.26a5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"},null,-1)]))}}),ba={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Po=e.defineComponent({name:"EditFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ba,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83l3.75 3.75l1.83-1.83z",fill:"currentColor"},null,-1)]))}}),Na={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},xa=e.defineComponent({name:"ExpandLessFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Na,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 8l-6 6l1.41 1.41L12 10.83l4.59 4.58L18 14z",fill:"currentColor"},null,-1)]))}}),Sa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ia=e.defineComponent({name:"ExpandMoreFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Sa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16.59 8.59L12 13.17L7.41 8.59L6 10l6 6l6-6z",fill:"currentColor"},null,-1)]))}}),Ba={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ho=e.defineComponent({name:"FolderTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ba,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M11.17 8l-.58-.59L9.17 6H4v12h16V8h-8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l1.41 1.41l.59.59H20v10z",fill:"currentColor"},null,-1)]))}}),Va={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ma=e.defineComponent({name:"FullscreenExitFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Va,o[0]||(o[0]=[e.createElementVNode("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z",fill:"currentColor"},null,-1)]))}}),Ta={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Aa=e.defineComponent({name:"FullscreenFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ta,o[0]||(o[0]=[e.createElementVNode("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",fill:"currentColor"},null,-1)]))}}),_a={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ea=e.defineComponent({name:"ImportExportFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",_a,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z",fill:"currentColor"},null,-1)]))}}),La={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},za=e.defineComponent({name:"LogOutFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",La,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 2h9a2 2 0 0 1 2 2v2h-2V4H6v16h9v-2h2v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M16.09 15.59L17.5 17l5-5l-5-5l-1.41 1.41L18.67 11H9v2h9.67z",fill:"currentColor"},null,-1)]))}}),$a={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Da=e.defineComponent({name:"ManageAccountsOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",$a,o[0]||(o[0]=[e.createElementVNode("path",{d:"M4 18v-.65c0-.34.16-.66.41-.81C6.1 15.53 8.03 15 10 15c.03 0 .05 0 .08.01c.1-.7.3-1.37.59-1.98c-.22-.02-.44-.03-.67-.03c-2.42 0-4.68.67-6.61 1.82c-.88.52-1.39 1.5-1.39 2.53V20h9.26c-.42-.6-.75-1.28-.97-2H4zm6-6c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2s-2-.9-2-2s.9-2 2-2zm10.75 10c0-.22-.03-.42-.06-.63l1.14-1.01l-1-1.73l-1.45.49c-.32-.27-.68-.48-1.08-.63L18 11h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49l-1 1.73l1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01l1 1.73l1.45-.49c.32.27.68.48 1.08.63L16 21h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49l1-1.73l-1.14-1.01c.03-.21.06-.41.06-.63zM17 18c-1.1 0-2-.9-2-2s.9-2 2-2s2 .9 2 2s-.9 2-2 2z",fill:"currentColor"},null,-1)]))}}),Ra={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ct=e.defineComponent({name:"MenuFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ra,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z",fill:"currentColor"},null,-1)]))}}),Oa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ja=e.defineComponent({name:"MenuOpenFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Oa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 18h13v-2H3v2zm0-5h10v-2H3v2zm0-7v2h13V6H3zm18 9.59L17.42 12L21 8.41L19.59 7l-5 5l5 5L21 15.59z",fill:"currentColor"},null,-1)]))}}),Fa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Pa=e.defineComponent({name:"PasswordFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Fa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M2 17h20v2H2v-2zm1.15-4.05L4 11.47l.85 1.48l1.3-.75l-.85-1.48H7v-1.5H5.3l.85-1.47L4.85 7L4 8.47L3.15 7l-1.3.75l.85 1.47H1v1.5h1.7l-.85 1.48l1.3.75zm6.7-.75l1.3.75l.85-1.48l.85 1.48l1.3-.75l-.85-1.48H15v-1.5h-1.7l.85-1.47l-1.3-.75L12 8.47L11.15 7l-1.3.75l.85 1.47H9v1.5h1.7l-.85 1.48zM23 9.22h-1.7l.85-1.47l-1.3-.75L20 8.47L19.15 7l-1.3.75l.85 1.47H17v1.5h1.7l-.85 1.48l1.3.75l.85-1.48l.85 1.48l1.3-.75l-.85-1.48H23v-1.5z",fill:"currentColor"},null,-1)]))}}),Ha={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ga=e.defineComponent({name:"PlaylistAddCheckTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ha,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 10h11v2H3zm0-4h11v2H3zm0 8h7v2H3zm17.59-2.07l-4.25 4.24l-2.12-2.12l-1.41 1.41L16.34 19L22 13.34z",fill:"currentColor"},null,-1)]))}}),Ka={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Wa=e.defineComponent({name:"PlaylistAddFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ka,o[0]||(o[0]=[e.createElementVNode("path",{d:"M14 10H3v2h11v-2zm0-4H3v2h11V6zm4 8v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM3 16h7v-2H3v2z",fill:"currentColor"},null,-1)]))}}),Za={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ya=e.defineComponent({name:"PrintTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Za,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M8 5h8v3H8z",fill:"currentColor"},null,-1),e.createElementVNode("circle",{cx:"18",cy:"11.5",r:"1",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M19 8h-1V3H6v5H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zM8 5h8v3H8V5zm8 14H8v-4h8v4zm4-4h-2v-2H6v2H4v-4c0-.55.45-1 1-1h14c.55 0 1 .45 1 1v4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{opacity:".3",d:"M6 13h12v2h2v-4c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1v4h2v-2zm12-2.5c.55 0 1 .45 1 1s-.45 1-1 1s-1-.45-1-1s.45-1 1-1z",fill:"currentColor"},null,-1)]))}}),Qa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Xa=e.defineComponent({name:"ReadMoreFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Qa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 7h9v2h-9zm0 8h9v2h-9zm3-4h6v2h-6zm-3 1L8 7v4H2v2h6v4z",fill:"currentColor"},null,-1)]))}}),Ja={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},dt=e.defineComponent({name:"RefreshFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ja,o[0]||(o[0]=[e.createElementVNode("path",{d:"M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",fill:"currentColor"},null,-1)]))}}),qa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},pe=e.defineComponent({name:"SearchFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",qa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z",fill:"currentColor"},null,-1)]))}}),Ua={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},va=e.defineComponent({name:"UnarchiveOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ua,o[0]||(o[0]=[e.createElementVNode("path",{d:"M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM6.24 5h11.52l.83 1H5.42l.82-1zM5 19V8h14v11H5zm3-5h2.55v3h2.9v-3H16l-4-4z",fill:"currentColor"},null,-1)]))}}),Go={rootMenuName:"MainMenu",menuPosition:"side"},ft=Symbol("HalovConfig");function ut(){return e.inject(ft)}const es=["src"],xe=e.defineComponent({__name:"MenuIcon",props:{path:{},size:{default:16}},setup(t){const l=t,o=e.ref(n(l.path));function n(r){if(r)return`/api/core/SystemIcons/Icons?path=${encodeURIComponent(r)}`}return e.watch(()=>l.path,r=>o.value=n(r)),(r,a)=>o.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"menu-icon",src:o.value,style:e.normalizeStyle({width:r.size+"px",height:r.size+"px"})},null,12,es)):e.createCommentVNode("",!0)}}),Ko=oe(e.defineComponent({__name:"AppTabs",props:{tabs:{default:()=>[]},currentTab:{}},emits:["update:currentTab","closeTab","closeAll","closeOthers"],setup(t,{emit:l}){var T;const o=t,n=l,{t:r}=W(),a=nt(),i=Ne(),d=e.computed(()=>i.menuCollapsed),m=((T=ut())==null?void 0:T.menuPosition)??"side",c=()=>i.setMenuCollapsed(!i.menuCollapsed),s=e.ref(o.currentTab),g=e.computed(()=>[{label:r("Close"),key:"close-current"},{label:r("Close All"),key:"close-all"},{label:r("Close Others"),key:"close-others"},{type:"divider",key:"------------1"},...o.tabs.map(B=>({label:r(B.title),key:B.id,url:B.url}))]);function h(B){o.tabs.find(V=>V.id==B)&&a.closeTab(B),n("closeTab",B)}function f(B){if(B.key=="close-current"||B.key=="close-all"||B.key=="close-others")return e.h(u.NIcon,null,{default:()=>e.h(ga)});if(B.key&&B.key==s.value)return e.h(u.NIcon,null,{default:()=>e.h(pa)})}function C(B){if(typeof B=="string"&&B)switch(B){case"close-current":n("closeTab",s.value);break;case"close-all":n("closeAll");break;case"close-others":n("closeOthers",s.value);break;default:s.value=B;break}}return e.watch(()=>o.currentTab,B=>{s.value=B}),e.watch(s,B=>{B!=o.currentTab&&n("update:currentTab",B)}),(B,F)=>B.tabs.length?(e.openBlock(),e.createBlock(e.unref(u.NTabs),{key:0,type:"card",closable:"",onClose:h,"tab-style":"min-width: 80px;",value:s.value,"onUpdate:value":F[0]||(F[0]=V=>s.value=V)},{prefix:e.withCtx(()=>[e.renderSlot(B.$slots,"prefix",{},()=>[e.unref(m)=="side"?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,text:"",style:{"margin-left":"8px"},onClick:c,title:d.value?e.unref(r)("Expand Menu"):e.unref(r)("Collapse Menu")},{icon:e.withCtx(()=>[d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(ja),{key:0})),d.value?(e.openBlock(),e.createBlock(e.unref(ct),{key:1})):e.createCommentVNode("",!0)]),_:1},8,["title"])):e.createCommentVNode("",!0)],!0)]),suffix:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{text:"",style:{"font-size":"24px"}},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NDropdown),{trigger:"click",options:g.value,placement:"bottom-end",onSelect:C,"render-icon":f},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(fa))]),_:1})]),_:1},8,["options"])]),_:1})]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.tabs,V=>(e.openBlock(),e.createBlock(e.unref(u.NTab),{key:V.id,name:V.id,title:V.id,closable:V.closable,class:"app-tab-item",style:e.normalizeStyle({"border-top-color":V.color})},{default:e.withCtx(()=>[V.icon?(e.openBlock(),e.createBlock(xe,{key:0,path:V.icon,style:{"margin-right":"4px"}},null,8,["path"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(r)(V.title)),1)]),_:2},1032,["name","title","closable","style"]))),128))]),_:3},8,["value"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-df170cc3"]]),ts=e.defineComponent({props:{direction:{type:String,default:"Right"},step:{type:Number,default:1},intervalFrames:{type:Number,default:1}},setup(t){const l=e.ref(void 0);let o=0;function n(){const i=l.value;if(i){const d=t.step||1;switch(t.direction){case"Left":i.scrollWidth>i.clientWidth&&(i.scrollLeft+i.clientWidth>i.scrollWidth-3?i.scrollLeft=0:i.scrollLeft+=d);break;case"Bottom":i.scrollHeight>i.clientHeight&&(i.scrollTop<3?i.scrollTop=i.scrollHeight:i.scrollTop-=d);break;case"Top":i.scrollHeight>i.clientHeight&&(i.scrollTop+i.clientHeight>i.scrollHeight-3?i.scrollTop=0:i.scrollTop+=d);break;case"Right":default:i.scrollWidth>i.clientWidth&&(i.scrollLeft<3?i.scrollLeft=i.scrollWidth:i.scrollLeft-=d);break}}}function r(){o++,o>1e8&&(o=0);let i=t.intervalFrames||1;i<=0&&(i=1),o%i==0&&n(),l.value&&requestAnimationFrame(r)}function a(){const i=l.value;if(i){switch(t.direction){case"Left":i.scrollLeft=0;break;case"Bottom":i.scrollTop=i.scrollHeight;break;case"Top":i.scrollTop=0;break;case"Right":default:i.scrollLeft=i.scrollWidth;break}i.addEventListener("resize",()=>{console.log("resize me.")})}}return e.onMounted(()=>{a(),requestAnimationFrame(r)}),e.watch(()=>t.direction,()=>a()),{areaRef:l}}}),os={ref:"areaRef",style:{overflow:"hidden"}};function ns(t,l,o,n,r,a){return e.openBlock(),e.createElementBlock("div",os,[e.renderSlot(t.$slots,"default")],512)}const Wo=oe(ts,[["render",ns]]);function Zo(t,l){let o=`/api/core/Barcode/${l.render=="svg"?"Svg":"Image"}?code=${encodeURIComponent(t)}&format=${l.format||"QR_CODE"}`;return l.width&&(o+=`&width=${l.width}`),l.height&&(o+=`&height=${l.height}`),l.showText&&(o+=`&showText=${l.showText}`),l.base64&&(o+=`&base64=${l.base64}`),l.backColor&&(o+=`&backColor=${encodeURIComponent(l.backColor)}`),l.foreColor&&(o+=`&foreColor=${encodeURIComponent(l.foreColor)}`),l.fontSize&&(o+=`&fontSize=${l.fontSize}`),l.margin&&(o+=`&margin=${encodeURIComponent(l.margin)}`),l.gs1Format&&(o+=`&gs1Format=${l.gs1Format}`),o}const Yo=e.defineComponent({__name:"BarcodeImage",props:{code:{},render:{},format:{},width:{},height:{},showText:{type:Boolean},base64:{type:Boolean},backColor:{},foreColor:{},fontSize:{},margin:{},gs1Format:{type:Boolean}},setup(t){const l=t,o=e.ref(void 0),n=()=>{o.value=Zo(l.code||"",{render:l.render,format:l.format,width:l.width,height:l.height,showText:l.showText,base64:l.base64,backColor:l.backColor,foreColor:l.foreColor,fontSize:l.fontSize,margin:l.margin,gs1Format:l.gs1Format})};return e.watch([l.render,l.code,l.format,l.width,l.height,l.showText,l.base64,l.backColor,l.foreColor,l.fontSize,l.margin,l.gs1Format],()=>n()),e.onMounted(()=>n()),(r,a)=>(e.openBlock(),e.createBlock(e.unref(u.NImage),{src:o.value,width:r.width,height:r.height},null,8,["src","width","height"]))}});function Qo(t){for(const l of t)l.guid&&(l.guid=l.guid.toLowerCase()),l.items&&Qo(l.items)}function ls(){try{const t=localStorage.getItem("userInfo");return t?JSON.parse(t):null}catch{return null}}const Se=Ae.defineStore("account",()=>{const t=e.reactive({userInfo:ls(),lastUserName:localStorage.getItem("lastUserName"),sessionToken:localStorage.getItem("sessionToken"),isLoadingMenu:!1,menus:null,messages:JSON.parse(localStorage.getItem("_msgs")??"[]"),authType:localStorage.getItem("authType")}),l=h=>{t.sessionToken=h,h?localStorage.setItem("sessionToken",h):localStorage.removeItem("sessionToken")},o=h=>{t.lastUserName=h,h?localStorage.setItem("lastUserName",h):localStorage.removeItem("lastUserName")},n=h=>{t.userInfo=h,h?localStorage.setItem("userInfo",JSON.stringify(h)):localStorage.removeItem("userInfo")},r=h=>{t.userInfo&&(t.userInfo.avatar=h,localStorage.setItem("userInfo",JSON.stringify(t.userInfo)))},a=()=>{t.userInfo=null,localStorage.removeItem("userInfo"),localStorage.removeItem("_msgs")},i=h=>{t.menus=h},d=h=>{t.isLoadingMenu=h},m=h=>{t.authType=h,h?localStorage.setItem("authType",h):localStorage.removeItem("authType")},c=()=>{localStorage.removeItem("userInfo"),localStorage.removeItem("sessionToken"),a(),i(null),localStorage.removeItem("_msgs")},s=async h=>{var f;d(!0);try{h||(h=((f=ut())==null?void 0:f.rootMenuName)??"MainMenu");const C=await re.get(`/api/core/account/menus?rootName=${encodeURIComponent(h)}`);if(C.isSuccess){const T=C.value||[];Qo(T),i(T)}else console.log(C.errorMessage||"get remote menus error.")}catch(C){console.log(C)}finally{d(!1)}},g=h=>{t.messages.push(h),localStorage.setItem("_msgs",JSON.stringify(t.messages))};return{...e.toRefs(t),setSession:l,setLastUserName:o,setUser:n,setAvatar:r,clearUser:a,setMenus:i,setIsLoadingMenu:d,logout:c,loadMenus:s,addMessage:g,setAuthType:m}}),rs={key:0,style:{"padding-left":"1rem"}},pt=e.defineComponent({__name:"ChangePassword",props:{show:{type:Boolean}},emits:["close"],setup(t,{emit:l}){const o=l,{t:n}=W(),r=u.useMessage(),a=e.inject("axios"),i=Se(),d=e.ref({oldPassword:"",newPassword:"",confirmPassword:""}),m=e.ref(!1),c=e.ref(null),s=e.computed(()=>{var B;return(B=i.userInfo)==null?void 0:B.userName}),g=e.ref([]),h={oldPassword:[{required:!0,message:n("Required here.")}],newPassword:[{required:!0,message:n("Required here.")}],confirmPassword:[{required:!0,message:n("Required here.")}]};function f(){var B;s.value&&!m.value&&c.value&&((B=c.value)==null||B.validate(F=>{if(!F)if(d.value.confirmPassword!=d.value.newPassword){r.error(n("Confirm the password is inconsistent, please check and re-enter."));return}else if(d.value.newPassword==d.value.oldPassword){r.error(n("The new password must not be the same as the old password!"));return}else C(s.value,d.value.oldPassword,d.value.newPassword)}))}async function C(B,F,V){try{const w={userName:B,oldPassword:F,newPassword:V},N=await a.post("/api/core/account/changePassword",w);N.isSuccess?(r.success(n("Password has been successfully modified!")),o("close")):r.error(n(N.errorMessage||"Error"))}catch(w){r.error((w==null?void 0:w.toString())||n("Error"))}}async function T(){try{const B=await a.get("/api/core/system/passwordOptions");B.isSuccess&&B.value!=null?g.value=B.value:r.error(n(B.errorMessage||"Error"))}catch(B){console.error(B),r.error((B==null?void 0:B.toString())||n("Error"))}}return e.onMounted(()=>{T()}),(B,F)=>{const V=e.resolveComponent("n-input"),w=e.resolveComponent("n-form-item"),N=e.resolveComponent("n-spin"),x=e.resolveComponent("n-text"),_=e.resolveComponent("n-button"),O=e.resolveComponent("n-modal");return e.openBlock(),e.createBlock(O,{show:B.show,onClose:F[3]||(F[3]=()=>B.$emit("close")),class:"custom-card",title:e.unref(n)("Change Password"),style:{width:"300px"},preset:"card",size:"medium"},{footer:e.withCtx(()=>[g.value.length?(e.openBlock(),e.createElementBlock("ul",rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,j=>(e.openBlock(),e.createElementBlock("li",{key:j},[e.createVNode(x,{depth:"3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(j),1)]),_:2},1024)]))),128))])):e.createCommentVNode("",!0)]),action:e.withCtx(()=>[e.createVNode(_,{type:"primary",block:"",onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("OK")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NForm),{model:d.value,ref_key:"formRef",ref:c,rules:h},{default:e.withCtx(()=>[e.createVNode(N,{show:m.value},{default:e.withCtx(()=>[e.createVNode(w,{label:e.unref(n)("User Name")},{default:e.withCtx(()=>[e.createVNode(V,{value:s.value,readonly:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(w,{path:"oldPassword",label:e.unref(n)("Old Password")},{default:e.withCtx(()=>[e.createVNode(V,{value:d.value.oldPassword,"onUpdate:value":F[0]||(F[0]=j=>d.value.oldPassword=j),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(w,{path:"newPassword",label:e.unref(n)("New Password")},{default:e.withCtx(()=>[e.createVNode(V,{value:d.value.newPassword,"onUpdate:value":F[1]||(F[1]=j=>d.value.newPassword=j),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(w,{path:"confirmPassword",label:e.unref(n)("Confirm New Password")},{default:e.withCtx(()=>[e.createVNode(V,{value:d.value.confirmPassword,"onUpdate:value":F[2]||(F[2]=j=>d.value.confirmPassword=j),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["show"])]),_:1},8,["model"])]),_:1},8,["show","title"])}}}),mt=e.defineComponent({__name:"ColorInput",props:{value:{},label:{},readonly:{type:Boolean},placeholder:{},clearable:{type:Boolean}},emits:["update:value"],setup(t){return(l,o)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{readonly:l.readonly,value:l.value,placeholder:l.placeholder,clearable:l.clearable,"onUpdate:value":o[0]||(o[0]=n=>l.$emit("update:value",n))},null,8,["readonly","value","placeholder","clearable"]),e.createVNode(e.unref(u.NColorPicker),{value:l.value,"show-preview":"",modes:["hex"],placeholder:"",disabled:l.readonly,style:{"max-width":"80px"},"onUpdate:value":o[1]||(o[1]=n=>l.$emit("update:value",n))},{label:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(wa))]),_:1})]),_:1},8,["value","disabled"])]),_:1}))}}),as={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ss=e.defineComponent({name:"ArrowDown",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",as,o[0]||(o[0]=[e.createElementVNode("path",{d:"M24.59 16.59L17 24.17V4h-2v20.17l-7.59-7.58L6 18l10 10l10-10l-1.41-1.41z",fill:"currentColor"},null,-1)]))}}),is={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},cs=e.defineComponent({name:"ArrowLeft",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",is,o[0]||(o[0]=[e.createElementVNode("path",{d:"M14 26l1.41-1.41L7.83 17H28v-2H7.83l7.58-7.59L14 6L4 16l10 10z",fill:"currentColor"},null,-1)]))}}),ds={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},fs=e.defineComponent({name:"ArrowRight",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ds,o[0]||(o[0]=[e.createElementVNode("path",{d:"M18 6l-1.43 1.393L24.15 15H4v2h20.15l-7.58 7.573L18 26l10-10L18 6z",fill:"currentColor"},null,-1)]))}}),us={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ps=e.defineComponent({name:"ArrowUp",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",us,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16 4L6 14l1.41 1.41L15 7.83V28h2V7.83l7.59 7.58L26 14L16 4z",fill:"currentColor"},null,-1)]))}}),ms={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Xo=e.defineComponent({name:"Checkbox",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ms,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 4H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM6 26V6h20v20z",fill:"currentColor"},null,-1)]))}}),hs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Jo=e.defineComponent({name:"CheckboxChecked",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",hs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 4H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM6 26V6h20v20z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M14 21.5l-5-4.96L10.59 15L14 18.35L21.41 11L23 12.58l-9 8.92z",fill:"currentColor"},null,-1)]))}}),gs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ys=e.defineComponent({name:"Checkmark",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",gs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 24l-9-9l1.414-1.414L13 21.171L26.586 7.586L28 9L13 24z",fill:"currentColor"},null,-1)]))}}),ws={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ze=e.defineComponent({name:"ChevronDown",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ws,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16 22L6 12l1.4-1.4l8.6 8.6l8.6-8.6L26 12z",fill:"currentColor"},null,-1)]))}}),Cs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ks=e.defineComponent({name:"ChevronRight",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Cs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M22 16L12 26l-1.4-1.4l8.6-8.6l-8.6-8.6L12 6z",fill:"currentColor"},null,-1)]))}}),bs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ns=e.defineComponent({name:"ChevronUp",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",bs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16 10l10 10l-1.4 1.4l-8.6-8.6l-8.6 8.6L6 20z",fill:"currentColor"},null,-1)]))}}),xs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},qo=e.defineComponent({name:"CollapseAll",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",xs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 15h-2V7H13V5h15a2.002 2.002 0 0 1 2 2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M25 20h-2v-8H8v-2h15a2.002 2.002 0 0 1 2 2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 27H4a2.002 2.002 0 0 1-2-2v-8a2.002 2.002 0 0 1 2-2h14a2.002 2.002 0 0 1 2 2v8a2.002 2.002 0 0 1-2 2zM4 17v8h14.001L18 17z",fill:"currentColor"},null,-1)]))}}),Ss={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Uo=e.defineComponent({name:"Cube",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ss,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28.504 8.136l-12-7a1 1 0 0 0-1.008 0l-12 7A1 1 0 0 0 3 9v14a1 1 0 0 0 .496.864l12 7a1 1 0 0 0 1.008 0l12-7A1 1 0 0 0 29 23V9a1 1 0 0 0-.496-.864zM16 3.158L26.016 9L16 14.842L5.984 9zM5 10.74l10 5.833V28.26L5 22.426zM17 28.26V16.574l10-5.833v11.685z",fill:"currentColor"},null,-1)]))}}),Is={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Bs=e.defineComponent({name:"Document",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Is,o[0]||(o[0]=[e.createElementVNode("path",{d:"M25.7 9.3l-7-7c-.2-.2-.4-.3-.7-.3H8c-1.1 0-2 .9-2 2v24c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V10c0-.3-.1-.5-.3-.7zM18 4.4l5.6 5.6H18V4.4zM24 28H8V4h8v6c0 1.1.9 2 2 2h6v16z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M10 22h12v2H10z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M10 16h12v2H10z",fill:"currentColor"},null,-1)]))}}),Vs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},vo=e.defineComponent({name:"DocumentDownload",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Vs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 25l-1.414-1.414L26 26.172V18h-2v8.172l-2.586-2.586L20 25l5 5l5-5z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 28H8V4h8v6a2.006 2.006 0 0 0 2 2h6v3h2v-5a.91.91 0 0 0-.3-.7l-7-7A.909.909 0 0 0 18 2H8a2.006 2.006 0 0 0-2 2v24a2.006 2.006 0 0 0 2 2h10zm0-23.6l5.6 5.6H18z",fill:"currentColor"},null,-1)]))}}),Ms={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ht=e.defineComponent({name:"DocumentExport",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ms,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 21h13.17l-2.58 2.59L25 25l5-5l-5-5l-1.41 1.41L26.17 19H13v2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M22 14v-4a1 1 0 0 0-.29-.71l-7-7A1 1 0 0 0 14 2H4a2 2 0 0 0-2 2v24a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2h-2v2H4V4h8v6a2 2 0 0 0 2 2h6v2zm-8-4V4.41L19.59 10z",fill:"currentColor"},null,-1)]))}}),Ts={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},gt=e.defineComponent({name:"DocumentImport",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ts,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 19H14.83l2.58-2.59L16 15l-5 5l5 5l1.41-1.41L14.83 21H28v-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M24 14v-4a1 1 0 0 0-.29-.71l-7-7A1 1 0 0 0 16 2H6a2 2 0 0 0-2 2v24a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2h-2v2H6V4h8v6a2 2 0 0 0 2 2h6v2zm-8-4V4.41L21.59 10z",fill:"currentColor"},null,-1)]))}}),As={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},en=e.defineComponent({name:"Draggable",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",As,o[0]||(o[0]=[e.createStaticVNode('<path d="M10 6h4v4h-4z" fill="currentColor"></path><path d="M18 6h4v4h-4z" fill="currentColor"></path><path d="M10 14h4v4h-4z" fill="currentColor"></path><path d="M18 14h4v4h-4z" fill="currentColor"></path><path d="M10 22h4v4h-4z" fill="currentColor"></path><path d="M18 22h4v4h-4z" fill="currentColor"></path>',6)]))}}),_s={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Es=e.defineComponent({name:"ExpandAll",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",_s,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 10h14a2.002 2.002 0 0 0 2-2V4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6V2H4v23a2.002 2.002 0 0 0 2 2h4v1a2.002 2.002 0 0 0 2 2h14a2.002 2.002 0 0 0 2-2v-4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6v-8h4v1a2.002 2.002 0 0 0 2 2h14a2.002 2.002 0 0 0 2-2v-4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6V7h4v1a2.002 2.002 0 0 0 2 2zm0-6h14l.001 4H12zm0 20h14l.001 4H12zm0-10h14l.001 4H12z",fill:"currentColor"},null,-1)]))}}),Ls={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},yt=e.defineComponent({name:"Folder",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ls,o[0]||(o[0]=[e.createElementVNode("path",{d:"M11.17 6l3.42 3.41l.58.59H28v16H4V6h7.17m0-2H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h24a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2H16l-3.41-3.41A2 2 0 0 0 11.17 4z",fill:"currentColor"},null,-1)]))}}),zs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},$s=e.defineComponent({name:"FolderOpen",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",zs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 8h-7.172l-3.414-3.414A2 2 0 0 0 16 4H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h24a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2zM8 26V14h8v6.17l-2.59-2.58L12 19l5 5l5-5l-1.41-1.41L18 20.17V14a2.002 2.002 0 0 0-2-2H8a2.002 2.002 0 0 0-2 2v12H4V6h12l4 4h8v2h-6v2h6v12z",fill:"currentColor"},null,-1)]))}}),Ds={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Rs=e.defineComponent({name:"IbmCloudPakApplications",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ds,o[0]||(o[0]=[e.createElementVNode("path",{d:"M21 22h-6a2.002 2.002 0 0 1-2-2v-4a2.002 2.002 0 0 1 2-2h6a2.002 2.002 0 0 1 2 2v4a2.002 2.002 0 0 1-2 2zm-6-6v4h6v-4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M11 17H9v-5a2.002 2.002 0 0 1 2-2h6v2h-6z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M16 31a.999.999 0 0 1-.504-.136l-12-7A1 1 0 0 1 3 23V9a1 1 0 0 1 .496-.864l12-7a1 1 0 0 1 1.008 0l12 7l-1.008 1.728L16 3.158L5 9.574v12.852l11 6.417l11-6.417V15h2v8a1 1 0 0 1-.496.864l-12 7A.999.999 0 0 1 16 31z",fill:"currentColor"},null,-1)]))}}),Os={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},js=e.defineComponent({name:"NewTab",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Os,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 26H6V6h10V4H6a2.002 2.002 0 0 0-2 2v20a2.002 2.002 0 0 0 2 2h20a2.002 2.002 0 0 0 2-2V16h-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M26 26H6V6h10V4H6a2.002 2.002 0 0 0-2 2v20a2.002 2.002 0 0 0 2 2h20a2.002 2.002 0 0 0 2-2V16h-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M26 6V2h-2v4h-4v2h4v4h2V8h4V6h-4z",fill:"currentColor"},null,-1)]))}}),Fs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ps=e.defineComponent({name:"NotAvailable",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Fs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M4 15h10v2H4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 15h10v2H18z",fill:"currentColor"},null,-1)]))}}),Hs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Gs=e.defineComponent({name:"PanHorizontal",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Hs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M24 10l-1.414 1.414L26.172 15H5.828l3.586-3.586L8 10l-6 6l6 6l1.414-1.414L5.828 17h20.344l-3.586 3.586L24 22l6-6l-6-6z",fill:"currentColor"},null,-1)]))}}),Ks={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ws=e.defineComponent({name:"QrCode",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ks,o[0]||(o[0]=[e.createStaticVNode('<path d="M24 28v-2h2v2z" fill="currentColor"></path><path d="M18 24v-2h2v2z" fill="currentColor"></path><path d="M18 30h4v-2h-2v-2h-2v4z" fill="currentColor"></path><path d="M26 26v-4h2v4z" fill="currentColor"></path><path d="M28 26h2v4h-4v-2h2v-2z" fill="currentColor"></path><path d="M26 20v-2h4v4h-2v-2h-2z" fill="currentColor"></path><path d="M24 20h-2v4h-2v2h4v-6z" fill="currentColor"></path><path d="M18 20v-2h4v2z" fill="currentColor"></path><path d="M6 22h4v4H6z" fill="currentColor"></path><path d="M14 30H2V18h12zM4 28h8v-8H4z" fill="currentColor"></path><path d="M22 6h4v4h-4z" fill="currentColor"></path><path d="M30 14H18V2h12zm-10-2h8V4h-8z" fill="currentColor"></path><path d="M6 6h4v4H6z" fill="currentColor"></path><path d="M14 14H2V2h12zM4 12h8V4H4z" fill="currentColor"></path>',14)]))}}),Zs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ys=e.defineComponent({name:"Renew",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Zs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 10H6.78A11 11 0 0 1 27 16h2A13 13 0 0 0 6 7.68V4H4v8h8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M20 22h5.22A11 11 0 0 1 5 16H3a13 13 0 0 0 23 8.32V28h2v-8h-8z",fill:"currentColor"},null,-1)]))}}),Qs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},wt=e.defineComponent({name:"Search",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Qs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M29 27.586l-7.552-7.552a11.018 11.018 0 1 0-1.414 1.414L27.586 29zM4 13a9 9 0 1 1 9 9a9.01 9.01 0 0 1-9-9z",fill:"currentColor"},null,-1)]))}}),Xs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},tn=e.defineComponent({name:"SearchLocate",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Xs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 28.586l-4.689-4.688a8.028 8.028 0 1 0-1.414 1.414L28.586 30zM19 25a6 6 0 1 1 6-6a6.007 6.007 0 0 1-6 6z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 12h8v2H2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 2h16v2H2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 7h16v2H2z",fill:"currentColor"},null,-1)]))}}),Js={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},qs=e.defineComponent({name:"SelectWindow",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Js,o[0]||(o[0]=[e.createStaticVNode('<path d="M8 26H4a2.002 2.002 0 0 1-2-2v-4h2v4h4z" fill="currentColor"></path><path d="M2 12h2v4H2z" fill="currentColor"></path><path d="M26 8h-2V4h-4V2h4a2.002 2.002 0 0 1 2 2z" fill="currentColor"></path><path d="M12 2h4v2h-4z" fill="currentColor"></path><path d="M4 8H2V4a2.002 2.002 0 0 1 2-2h4v2H4z" fill="currentColor"></path><path d="M27 32a.997.997 0 0 1-.707-.293l-6.138-6.138l-3.323 4.986a1 1 0 0 1-1.79-.268l-6-20a1 1 0 0 1 1.245-1.245l20 6a1 1 0 0 1 .268 1.79l-4.986 3.323l6.138 6.138a1 1 0 0 1 0 1.414l-4 4A.997.997 0 0 1 27 32zm0-2.414L29.586 27l-7.155-7.155l5.246-3.498l-16.185-4.855l4.855 16.185l3.498-5.246z" fill="currentColor"></path>',6)]))}}),Us={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},vs=e.defineComponent({name:"TableBuilt",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Us,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 8h-4V4a2.002 2.002 0 0 0-2-2H4a2.002 2.002 0 0 0-2 2v18a2.002 2.002 0 0 0 2 2h4v4a2.002 2.002 0 0 0 2 2h18a2.002 2.002 0 0 0 2-2V10a2.002 2.002 0 0 0-2-2zm-6 14h-8v-5h8zm0-7h-8v-5h8zm-10 0H4v-5h8zM22 4v4H4V4zM4 22v-5h8v5zm24 6H10v-4h12a2.002 2.002 0 0 0 2-2V10h4z",fill:"currentColor"},null,-1)]))}}),ei={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ti=e.defineComponent({name:"TagEdit",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ei,o[0]||(o[0]=[e.createElementVNode("path",{d:"M29.707 7.293l-3-3a1 1 0 0 0-1.414 0L16 13.586V18h4.414l9.293-9.293a1 1 0 0 0 0-1.414zM19.586 16H18v-1.586l5-5L24.586 11zM26 9.586L24.414 8L26 6.414L27.586 8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M10 14a4 4 0 1 1 4-4a4.005 4.005 0 0 1-4 4zm0-6a2 2 0 1 0 1.998 2.004A2.002 2.002 0 0 0 10 8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M27.006 14.235l-1.414 1.414L28 18.058L18.058 28L4 13.941V4h9.942l4.406 4.407l1.415-1.415l-4.407-4.406A2 2 0 0 0 13.94 2H4a2 2 0 0 0-2 2v9.941a2 2 0 0 0 .586 1.414l14.058 14.06a2.001 2.001 0 0 0 2.828 0l9.943-9.943a2.001 2.001 0 0 0 0-2.828z",fill:"currentColor"},null,-1)]))}}),oi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ni=e.defineComponent({name:"Upload",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",oi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 18l1.41 1.41L15 11.83V30h2V11.83l7.59 7.58L26 18L16 8L6 18z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M6 8V4h20v4h2V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4z",fill:"currentColor"},null,-1)]))}}),li={class:"flex-column"},ri={class:"flex-1"},ai={class:"flex-1"},on=e.defineComponent({__name:"Collapsable",props:{title:{},defaultCollapsed:{type:Boolean}},setup(t){const l=t,{t:o}=W(),n=e.ref(l.defaultCollapsed??!1),r=()=>{n.value=!n.value};return(a,i)=>(e.openBlock(),e.createElementBlock("div",li,[e.createElementVNode("div",{class:"flex-row gap05",style:{"align-items":"center"},onDblclick:e.withModifiers(r,["prevent"])},[e.renderSlot(a.$slots,"icon"),e.createElementVNode("div",ri,[e.renderSlot(a.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(a.title),1)])]),e.createElementVNode("div",null,[e.createVNode(e.unref(u.NButton),{text:"",onClick:r,title:n.value?e.unref(o)("Expand"):e.unref(o)("Collapse")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createBlock(e.unref(ze),{key:0})):(e.openBlock(),e.createBlock(e.unref(Ns),{key:1}))]),_:1})]),_:1},8,["title"])])],32),e.withDirectives(e.createElementVNode("div",ai,[e.renderSlot(a.$slots,"default")],512),[[e.vShow,!n.value]])]))}});function nn(t){return typeof t=="object"&&t!==null&&"source"in t}function Ie(t){return typeof t=="object"&&t!==null&&"name"in t}function si(t){for(const l in t)delete t[l]}function ln(t){const l={};for(const o of t){const n=o.name,r=l[n];if(o.nullable==!1)switch(o.dataType){case"number":l[n]=Number(r)||0;break;case"boolean":case"bool":l[n]=fe(r)||!1;break;default:const a=Ro(o.dataType);a!=null&&(l[n]=a)}}return l}function rn(t,l,o){for(const n of l){const r=n.name,a=t[r];switch(n.dataType){case"number":n.nullable==!1?o[r]=Number(a)||0:o[r]=Number(a)||null;break;case"boolean":case"bool":n.nullable==!1?o[r]=fe(a)||!1:o[r]=fe(a)||null;break;default:o[r]=a||null;break}}}function an(t,l){const o={};return Object.assign(o,t),rn(t,l,o),o}function ii(t){if(!t)return!0;switch(t){case"number":case"boolean":return!1;default:return!0}}function sn(t,l){const o=l||(r=>r.toString()),n=[];if(t.length){for(const r of t)if(typeof r=="string"&&r)n.push({name:r,label:o(te(r)),visibility:!0,editor:"text"});else if(Ie(r)&&r.editing!="hidden"&&r.name){const a={name:r.name,role:r.role&&!Array.isArray(r.role)?[r.role]:r.role,dataType:r.dataType,minValue:r.minValue,maxValue:r.maxValue,group:r.group,nullable:r.required==null?ii(r.dataType):!r.required,label:r.title?o(r.title):o(te(r.name)),visibility:!0,readonly:r.readonly,sortable:r.sortable,editor:r.editor||r.dataType||"text",editorConfig:r.editorConfig,tagSource:r.tagSource,description:r.description};r.editing=="readonly"?a.readonly=!0:(r.editing=="create"||r.editing=="edit")&&(a.visibility=[r.editing]),r.required!=null&&(a.nullable=!r.required),r.values&&(Array.isArray(r.values)?(a.values=r.values,a.valueSource={type:"static",isLoading:!1,values:r.values.map(i=>{if(typeof i=="string"){let d=i;return d&&(r.prefix&&(d=r.prefix+d),r.suffix&&(d=d+r.suffix)),{value:i,label:o(d)}}else return i})}):typeof r.values=="function"?a.valueSource={type:"function",func:r.values,isLoading:!1}:Array.isArray(r.values.source)?a.valueSource={type:"static",isLoading:!1,values:r.values.source.map(i=>{if(typeof i=="string"){let d=i;return d&&(r.prefix&&(d=r.prefix+d),r.suffix&&(d=d+r.suffix)),{value:i,label:o(d)}}else return i})}:a.valueSource={type:"remote",isLoading:!1,key:r.values.key,label:r.values.label,subLabel:r.values.subLabel,renderLabel:r.values.renderLabel,labelTemplate:r.values.labelTemplate,prefix:r.values.prefix,suffix:r.values.suffix,i18n:r.i18n,filterable:r.values.filterable,sourceUrl:r.values.source,values:[]}),n.push(a)}}return n}function Ct(t){if(t){if(typeof t=="number")return t;switch(t){case"x-large":return 480;case"large":return 300;case"medium":return 160;case"small":return 60;case"x-small":return 30;default:return t}}else return t}function Be(t){const l=new Array;for(const o of t)if(typeof o=="string")l.push({name:o,title:te(o),sortIndex:0,visible:!0});else if(Ie(o)&&o.grid!="none"){if(o.visible!=null&&(typeof o.visible=="boolean"&&!o.visible||typeof o.visible=="function"&&!o.visible.call(null)))continue;const n={name:o.name,title:o.title,role:o.role&&!Array.isArray(o.role)?[o.role]:o.role,behavior:o.grid,align:o.align,fixed:o.gridFixed,dataType:o.dataType,href:o.href,i18n:o.i18n,template:o.template,prefix:o.prefix,suffix:o.suffix,formatter:o.formatter,display:o.display,values:o.values,width:Ct(o.size),minWidth:Ct(o.minWidth),textOverflow:o.textOverflow,sortIndex:0,sortable:o.sortable==null?!0:o.sortable,referencePage:o.referencePage,tagSource:o.tagSource,visible:!0,className:o.className,render:o.render,click:o.click};o.children&&o.children.length&&(n.children=Be(o.children)),l.push(n)}return l.sort((o,n)=>(o.sortIndex||0)-(n.sortIndex||0)),l}function ci(t,l){return Ce.render(t,l)}function cn(t,l){var r;const o=l||(a=>a.toString()),n=new Array;for(const a of t)if(Ie(a)&&a.search){const i={name:a.name,role:a.role&&!Array.isArray(a.role)?[a.role]:a.role,label:a.title?o(a.title):o(te(a.name)),editor:a.editor||a.dataType||"text",dataType:a.dataType,nullable:!0,searchMethod:"normal",template:a.template,prefix:a.prefix,suffix:a.suffix};if(typeof a.search=="boolean")i.searchMethod="normal";else if(typeof a.search=="string")a.search=="range"&&(i.searchMethod=a.search);else{if(a.search.editor&&(i.editor=a.search.editor),a.search.method=="range"?i.searchMethod="range":i.searchMethod="normal",a.search.required&&(i.nullable=!1),a.search.role){const d=Array.isArray(a.search.role)?a.search.role:[a.search.role];if(i.role)for(let m of d)i.role.includes(m)||i.role.push(m);else i.role=d}a.search.field&&(i.searchField=a.search.field),i.defaultValue=a.search.default}if(a.values&&(Array.isArray(a.values)?i.valueSource={type:"static",isLoading:!1,values:a.values.map(d=>{if(typeof d=="string"){let m=d;return a.formatter&&(m=a.formatter.call(null,m,null)??m),m&&(i.prefix&&(m=i.prefix+m),i.suffix&&(m=m+i.suffix)),{value:d,label:o(m)}}else return d})}:typeof a.values=="function"?i.valueSource={type:"function",func:a.values,isLoading:!1}:Array.isArray(a.values.source)?i.valueSource={type:"static",isLoading:!1,values:a.values.source.map(d=>{var m;return typeof d=="string"?{value:d,label:o(((m=a.formatter)==null?void 0:m.call(null,d,null))||d)}:d})}:i.valueSource={type:"remote",isLoading:!1,key:a.values.key,label:a.values.label,subLabel:a.values.subLabel,renderLabel:a.values.renderLabel,labelTemplate:a.values.labelTemplate,prefix:a.values.prefix,suffix:a.values.suffix,filterable:a.values.filterable,i18n:a.values.i18n,sourceUrl:a.values.source,values:[]},i.dataType=="boolean"&&Array.isArray((r=i.valueSource)==null?void 0:r.values))){const d=i.valueSource.values;d.length<=2&&d.splice(0,0,{value:"",label:""})}n.push(i)}return n}async function Fe(t,l,o,n,r){if(l.sourceUrl){l.isLoading=!0,l.values?l.values.length=0:l.values=[];try{let a=l.sourceUrl;o&&(a=U(a,o));const i=await t.get(a);if(i.isSuccess&&i.value!=null){let d=i.value;if(!Array.isArray(d)&&"rows"in d&&Array.isArray(d.rows)&&(d=d.rows),Array.isArray(d)){const m=d.filter(c=>c&&!0).map(c=>{if(typeof c=="string")return{value:c,label:n?n(c):c};{let s;if(l.renderLabel)s=l.renderLabel(c);else if(l.labelTemplate)s=Ce.render(l.labelTemplate,c);else{if(s=c[l.label||"label"],n&&(s=n(s)),l.subLabel){const g=c[l.subLabel];typeof g=="string"&&(s+=" "+(n?n(g):g))}s&&(l.prefix&&(s=l.prefix+s),l.suffix&&(s=s+l.suffix))}return{value:c[l.key||"value"],label:s}}});r&&m.splice(0,0,{value:void 0,label:""}),l.values.length=0,l.values.push(...m)}}}finally{l.isLoading=!1}}}function kt(t,l){return()=>e.h(u.NIcon,l?{color:l}:null,{default:()=>e.h(t)})}function di(t,l,o){if(t)return e.h(u.NIcon,o?{color:o}:null,{default:()=>e.h(l)})}function fi(t,l,o){return e.h(u.NButton,Object.assign({text:!0,onClick:l},o),{default:()=>e.h(u.NIcon,{size:20},{default:()=>e.h(t)})})}function ui(t,l){const o=t[l];let n="";return typeof o=="number"&&(o>0?n="text-positive":o<0&&(n="text-negative")),e.h("span",{class:n},o==null?void 0:o.toString())}const Pe=e.defineComponent({__name:"HaloDatePicker",props:{value:{},type:{},readonly:{type:Boolean},clearable:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=d=>{const m=Lo(d);return m===void 0?null:m},a=e.ref(r(o.value)),i=d=>{if(d!=null){a.value=d;const m=o.type=="date"?st(d):it(d);n("update:value",m,d)}else n("update:value",null,d)};return e.watch(()=>o.value,d=>a.value=r(d)),(d,m)=>(e.openBlock(),e.createBlock(e.unref(u.NDatePicker),{value:a.value,type:d.type,placeholder:"",disabled:d.readonly,"onUpdate:value":i,clearable:d.clearable},null,8,["value","type","disabled","clearable"]))}}),bt=e.defineComponent({__name:"HaloTimePicker",props:{value:{},type:{},readonly:{type:Boolean},clearable:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=d=>{if(d==null)return null;if(typeof d=="number"){const m=new Date(2e3,1,1);return m.setSeconds(d),m.getTime()}else if(typeof d=="string"){const m=Eo(d);if(!m)return null;const c=new Date(2e3,1,1);return c.setMilliseconds(m.millisecond+m.second*1e3+m.minute*60*1e3+m.hour*60*60*1e3),c.getTime()}else return d instanceof Date?d.getTime():null},a=d=>{if(d!=null){i.value=d;const m=new Date;m.setTime(d);const c=m.getSeconds()+m.getMinutes()*60+m.getHours()*60*60;n("update:value",c)}else n("update:value",null)},i=e.ref(r(o.value));return e.watch(()=>o.value,d=>i.value=r(d)),(d,m)=>(e.openBlock(),e.createBlock(e.unref(u.NTimePicker),{value:i.value,type:d.type,placeholder:"",disabled:d.readonly,"onUpdate:value":a,clearable:d.clearable},null,8,["value","type","disabled","clearable"]))}}),Nt=e.defineComponent({__name:"NullableBooleanInput",props:{value:{type:Boolean},readonly:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=W(),a=e.ref(typeof o.value=="boolean"?o.value.toString():""),i=[{value:null,label:""},{value:"true",label:r("Yes")},{value:"false",label:r("No")}],d=m=>{const c=fe(m);c==null?n("update:value",null):n("update:value",c)};return e.watch(()=>o.value,()=>a.value=typeof o.value=="boolean"?o.value.toString():""),(m,c)=>(e.openBlock(),e.createBlock(e.unref(u.NSelect),{value:a.value,options:i,placeholder:"",disabled:m.readonly,clearable:"","onUpdate:value":c[0]||(c[0]=s=>d(s))},null,8,["value","disabled"]))}}),xt=()=>{const{t}=W(),l=u.useMessage(),o=u.useDialog(),n=u.useModal(),r=u.useLoadingBar();let a=0;const i=w=>w&&t(w),d=w=>e.h("div",{},w.split(`
3
- `).map(N=>e.h("span",{class:"line"},t(N)))),m=(w,N)=>{switch(N){case"create":l.create(()=>d(w));break;case"error":l.error(()=>d(w));break;case"loading":l.loading(t(w));break;case"success":l.success(t(w));break;case"warning":l.warning(t(w));break;default:case"info":l.info(t(w));break}},c=(w,N,x)=>{o.warning({title:t(w??"Confirm"),draggable:!0,content:()=>d(N),positiveText:t("OK"),negativeText:t("Cancel"),onPositiveClick:()=>x()})},s=(w,N,x)=>{o.success({title:t(N??"Success"),draggable:!0,content:()=>d(w),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},g=(w,N,x)=>{o.error({title:t(N??"Error"),draggable:!0,content:()=>d(w),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},h=(w,N,x)=>{o.info({title:t(N??"Information"),draggable:!0,content:()=>d(w),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},f=(w,N,x)=>{o.warning({title:t(N??"Warning"),draggable:!0,content:()=>d(w),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},C=w=>{let N=[];const x=n.create({title:t(w.title??"Search"),preset:"card",style:{width:w.width??"800px",height:w.height??"600px"},contentClass:"flex-column",draggable:w.draggable,content:()=>e.h(e.resolveComponent("SearchPanel"),{class:"flex-grow-1",config:w.config,multiSelect:w.multiSelect==!0,onSearchBack:_=>{w.callback.call(null,_)},onResultSelected:(_,O)=>{N=O??[]}}),footer:()=>e.h("div",{class:"flex-row",style:"justify-content:space-between"},[e.h(u.NButton,{type:"primary",style:"min-width: 100px",onClick:()=>{N.length&&(w.callback.call(null,N),x.destroy())}},()=>t("OK")),e.h(u.NButton,{ghost:!0,style:"min-width: 100px",onClick:()=>x.destroy()},()=>t("Close"))])})},T=(w,N)=>{const x=n.create({title:N,preset:"card",style:{width:"300px"},draggable:!0,content:()=>e.h("div",{class:"flex-column",style:"align-items: center"},[e.h(u.NQrCode,{value:w,size:160}),e.h("div",{class:"text-monospace",style:"font-size: large; margin: 0.25em"},w),e.h(u.NButton,{type:"primary",onClick:()=>x.destroy(),style:"align-self: center; min-width: 100px; margin-top: 1em;"},()=>t("Close"))])})},B=(w=!1)=>{a++,(w||a>0)&&r.start()},F=(w=!1)=>{a=Math.max(0,a-1),(w||a<=0)&&r.finish()};return{t:i,message:m,confirm:c,error:w=>l.error(t(w)),success:w=>l.success(t(w)),warning:w=>l.warning(t(w)),info:w=>l.info(t(w)),errorDialog:g,successDialog:s,warningDialog:f,infoDialog:h,showSearchModal:C,showQrModal:T,loadingBar:(w=!0)=>{w?B():F()},showLoadingBar:B,hideLoadingBar:F}};var He=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ge={exports:{}},pi=Ge.exports,dn;function mi(){return dn||(dn=1,function(t,l){(function(o,n){n()})(pi,function(){function o(c,s){return typeof s>"u"?s={autoBom:!1}:typeof s!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),s={autoBom:!s}),s.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function n(c,s,g){var h=new XMLHttpRequest;h.open("GET",c),h.responseType="blob",h.onload=function(){m(h.response,s,g)},h.onerror=function(){console.error("could not download file")},h.send()}function r(c){var s=new XMLHttpRequest;s.open("HEAD",c,!1);try{s.send()}catch{}return 200<=s.status&&299>=s.status}function a(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var s=document.createEvent("MouseEvents");s.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(s)}}var i=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof He=="object"&&He.global===He?He:void 0,d=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),m=i.saveAs||(typeof window!="object"||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!d?function(c,s,g){var h=i.URL||i.webkitURL,f=document.createElement("a");s=s||c.name||"download",f.download=s,f.rel="noopener",typeof c=="string"?(f.href=c,f.origin===location.origin?a(f):r(f.href)?n(c,s,g):a(f,f.target="_blank")):(f.href=h.createObjectURL(c),setTimeout(function(){h.revokeObjectURL(f.href)},4e4),setTimeout(function(){a(f)},0))}:"msSaveOrOpenBlob"in navigator?function(c,s,g){if(s=s||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(o(c,g),s);else if(r(c))n(c,s,g);else{var h=document.createElement("a");h.href=c,h.target="_blank",setTimeout(function(){a(h)})}}:function(c,s,g,h){if(h=h||open("","_blank"),h&&(h.document.title=h.document.body.innerText="downloading..."),typeof c=="string")return n(c,s,g);var f=c.type==="application/octet-stream",C=/constructor/i.test(i.HTMLElement)||i.safari,T=/CriOS\/[\d]+/.test(navigator.userAgent);if((T||f&&C||d)&&typeof FileReader<"u"){var B=new FileReader;B.onloadend=function(){var w=B.result;w=T?w:w.replace(/^data:[^;]*;/,"data:attachment/file;"),h?h.location.href=w:location=w,h=null},B.readAsDataURL(c)}else{var F=i.URL||i.webkitURL,V=F.createObjectURL(c);h?h.location=V:location.href=V,h=null,setTimeout(function(){F.revokeObjectURL(V)},4e4)}});i.saveAs=m.saveAs=m,t.exports=m})}(Ge)),Ge.exports}var hi=mi();function fn(){const t=re.create({headers:{"Content-type":"application/json"},timeout:3e5});return t.interceptors.request.use(l=>{const o=localStorage.getItem("sessionToken");return o&&l.headers&&(l.headers.Authorization=`Bearer ${o}`),l},l=>(console.log(l),Promise.reject(l))),t}function gi(t){if(t){const l=t.match(/filename\*=UTF-8'(?:.*)'(.*)/);if(l&&l.length>1)return decodeURIComponent(l[1]);const o=t.match(/filename=(.*)/);if(o&&o.length>1)return o[1]}}async function me(t,l,o,n){var s;const r=fn();let a;(n==null?void 0:n.toLowerCase())=="post"?a=await r.post(t,{responseType:"blob"}):a=await r.get(t,{responseType:"blob"});const{data:i,headers:d,status:m,statusText:c}=a;if(m==200||i.length){d&&(o||(o=(s=d["content-type"])==null?void 0:s.toString()),l||(l=gi(d["content-disposition"])));const g=new Blob([i],{type:o||"application/octet-stream"});hi.saveAs(g,l)}else throw`[${m}] ${c}`}async function un(t,l,o){var c;const n=fn();let r;(o==null?void 0:o.toLowerCase())=="post"?r=await n.post(t,{responseType:"blob"}):r=await n.get(t,{responseType:"blob"});const{data:a,headers:i,status:d,statusText:m}=r;if(d==200||a.length){i&&(l||(l=(c=i["content-type"])==null?void 0:c.toString()));const s=new Blob([a],{type:l||"application/octet-stream"}),g=URL.createObjectURL(s);window.open(g)}else throw`[${d}] ${m}`}function pn(t,l){let o=t.length,n=0;for(;o--;)l(t[o],o)&&(t.splice(o,1),n++);return n}function yi(t,l){var o={};for(let n of t){const r=l(n);o[r]?o[r].push(n):o[r]=[]}return o}function mn(t,l,o){l<0||l>=t.length||o<0||o>=t.length||l==o||t.splice(o,0,...t.splice(l,1))}function wi(t,l,o,n,r,a){const i={name:t,label:l||te(t),editor:o||"text",dataType:o,nullable:!0,visibility:!0,searchMethod:n||"normal"},d=a??(m=>m);return r&&(typeof r=="string"?i.valueSource={type:"remote",isLoading:!1,key:"key",label:"label",sourceUrl:r}:Array.isArray(r)?i.dataType=="boolean"&&r.length==2&&typeof r[0]=="string"?i.valueSource={type:"static",isLoading:!1,values:[{value:"",label:""},{value:"true",label:d(r[0])},{value:"false",label:d(r[1])}]}:i.valueSource={type:"static",isLoading:!1,values:r.map(m=>typeof m=="string"?{value:m,label:d(m)}:m)}:nn(r)?Array.isArray(r.source)?i.valueSource={type:"static",isLoading:!1,filterable:r.filterable,values:[{value:"",label:""},...r.source.map(m=>typeof m=="string"?{value:m,label:d(m)}:m)]}:i.valueSource={type:"remote",isLoading:!1,key:r.key,label:r.label,subLabel:r.subLabel,labelTemplate:r.labelTemplate,i18n:r.i18n,sourceUrl:r.source,filterable:r.filterable,values:[]}:i.valueSource={type:"static",isLoading:!1,values:Object.keys(r).map(m=>({value:r[m],label:d(m)}))}),i}function Ci(...t){const l=new Map;return t.forEach(o=>{o.forEach(n=>{n.name?l.set(n.name.toString(),n):l.set(n.path,n)})}),Array.from(l.values())}function ki(t,l,o){if(t<=0||l<=0||o<0||!Number.isInteger(l)||!Number.isInteger(o)){console.error("Invalid arguments.");return}const n=Math.pow(10,o);let r=Math.floor(t*n);const a=[],i=Math.max(1,Math.floor(r/l));let d=r;for(let m=0;m<l;m++){let c;m==l-1?c=Math.max(0,d):(c=Math.min(i,d),d=Math.max(0,d-i)),c=parseFloat((c/n).toFixed(o)),a.push(c)}return a}function bi(t,l,o){if(t<=0||l<=0||o<0||!Number.isInteger(o)){console.error("Invalid arguments.");return}const n=Math.pow(10,o),r=Math.round(t*n),a=Math.round(l*n),i=[];let d=r;for(;d>0;){let m=Math.min(a,d);d-=a,i.push(parseFloat((m/n).toFixed(o)))}return i}function Ni(t,l){if(l<0||!Number.isInteger(l)){console.error("Invalid arguments.");return}const o=Math.pow(10,l);let n=0;for(const r of t)n+=Math.round(r*o);return n/o}function xi(){const t=e.ref(new Map),l=c=>(t.value.has(c)||t.value.set(c,{isLocked:!1,waitingQueue:[]}),t.value.get(c));async function o(c){const s=l(c);return s.isLocked?new Promise(g=>{s.waitingQueue.push(()=>{s.isLocked=!0,g(()=>r(c))})}):(s.isLocked=!0,()=>r(c))}function n(c){const s=l(c);return s.isLocked?null:(s.isLocked=!0,()=>r(c))}function r(c){const s=l(c);if(!s.isLocked)return;s.isLocked=!1;const g=s.waitingQueue.shift();g&&g(),!s.isLocked&&s.waitingQueue.length===0&&t.value.delete(c)}async function a(c,s){const g=await o(c);try{return await Promise.resolve(s())}finally{g()}}async function i(c,s,g="Failed to acquire the operation lock."){const h=n(c);if(!h)throw console.error(`Failed to acquire the operation lock.(key: ${c})`),g;try{return await Promise.resolve(s())}finally{h()}}function d(c){return l(c).isLocked}function m(c){t.value.delete(c)}return{runExclusive:a,lock:o,unlock:r,tryLock:n,runExclusiveOrThrow:i,isLocked:d,clearLock:m}}const ce=()=>{const t=xt(),l=e.inject("axios"),o=xi();async function n(s,g="Error"){if(s)if(s.response){let h=t.t(s.response.statusText);return s.response.data&&(s.response.data instanceof Blob?h+=`
4
- `+t.t(await s.response.data.text()):h+=`
5
- `+t.t(s.response.data.toString()),console.log(h)),h}else return s.toString();else return g}function r(s,g,h){h.mutexKey==null&&(h.mutexKey=h.url),t.confirm(s,g,()=>{i(h)})}async function a(s){var g,h,f,C,T,B,F;try{(g=s.loadingStatus)==null||g.call(null,!0);let V;s.data?V=await l.post(s.url,s.data):V=await l.post(s.url),(h=s.callback)==null||h.call(null,V),V.isSuccess?((f=s.success)==null||f.call(null,V.value),s.successMessage===!0?t.message("Successful operation.","success"):typeof s.successMessage=="string"&&t.message(s.successMessage,"success")):((C=s.fail)==null||C.call(null,V),V.errorMessage&&console.error(V.errorMessage),s.failMessage?t.message(s.failMessage,"error"):t.message(V.errorMessage??((T=V.value)==null?void 0:T.toString())??"Error","error"))}catch(V){((B=s.exception)==null?void 0:B.call(null,V))!=!0&&t.message(await n(V)??s.failMessage??"Error")}finally{(F=s.loadingStatus)==null||F.call(null,!1)}}async function i(s){var g;if(s.mutexKey)try{const h=typeof s.mutexKey=="boolean"?s.url:s.mutexKey;await o.runExclusiveOrThrow(h,()=>a(s))}catch(h){((g=s.exception)==null?void 0:g.call(null,h))!=!0&&t.message(await n(h)??s.failMessage??"Error")}else await a(s)}async function d(s){var g,h,f,C,T;try{(g=s.loadingStatus)==null||g.call(null,!0);let B=await l.get(s.url);if(B.isSuccess)return(h=s.callback)==null||h.call(null,B.value),B.value;s.quiet!=!0&&t.message(B.errorMessage??((f=B.value)==null?void 0:f.toString())??"Error","error")}catch(B){((C=s.exception)==null?void 0:C.call(null,B))!=!0&&t.message(await n(B)??"Error","error")}finally{(T=s.loadingStatus)==null||T.call(null,!1)}}async function m(s){var g,h,f,C;try{(g=s.loadingStatus)==null||g.call(null,!0),t.showLoadingBar(),await un(s.url,s.contentType,s.method),(h=s.callback)==null||h.call(null)}catch(T){((f=s.exception)==null?void 0:f.call(null,T))!=!0&&t.message(await n(T)??"Error","error")}finally{t.hideLoadingBar(),(C=s.loadingStatus)==null||C.call(null,!1)}}async function c(s){var g,h,f,C;try{(g=s.loadingStatus)==null||g.call(null,!0),t.showLoadingBar(),await me(s.url,s.filename,s.contentType,s.method),(h=s.callback)==null||h.call(null)}catch(T){((f=s.exception)==null?void 0:f.call(null,T))!=!0&&t.message(await n(T)??"Error","error")}finally{t.hideLoadingBar(),(C=s.loadingStatus)==null||C.call(null,!1)}}return{post:i,get:d,confirmToPost:r,getHttpErrorMessage:n,openFile:m,downloadFile:c}},St=e.defineComponent({__name:"HaloTagsInput",props:{value:{},disabled:{type:Boolean,default:!1},tagSource:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=Ne(),a=ce(),i=e.ref(c(o.value)),d=e.ref([]);async function m(){if(o.tagSource){const g=await r.fetchSharedData(`tags:${o.tagSource}`,async()=>await a.get({url:`/api/core/CommonCodeItems/list?commonCode=${o.tagSource}`})??[]);d.value=g.map(h=>({value:h.code,label:`[${h.code}] ${h.name}`}))}else d.value=[]}function c(g){return g?g.split(","):[]}function s(g){o.disabled||(Array.isArray(g)?n("update:value",g.join(",")):n("update:value",g))}return e.watch(()=>o.value,g=>i.value=c(g)),e.watch(()=>o.tagSource,()=>m()),e.onMounted(()=>m()),(g,h)=>g.tagSource?(e.openBlock(),e.createBlock(e.unref(u.NSelect),{key:0,value:i.value,multiple:"",options:d.value,"onUpdate:value":s},null,8,["value","options"])):(e.openBlock(),e.createBlock(e.unref(u.NDynamicTags),{key:1,value:i.value,"onUpdate:value":s},null,8,["value"]))}}),It=e.defineComponent({__name:"ListInputModal",props:{title:{},message:{},value:{},placeholder:{default:""},maxLength:{},show:{type:Boolean},readonly:{type:Boolean}},emits:["update:show","update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=W(),a=()=>{o.readonly||n("update:value",d()),n("update:show",!1)},i=()=>{var c,s,g,h;return o.value?Array.isArray(o.value)?o.value.join(`
6
- `):((h=(g=(s=(c=o.value)==null?void 0:c.replace(/\n/g,","))==null?void 0:s.split(","))==null?void 0:g.map(C=>C.trim()))==null?void 0:h.filter((C,T,B)=>C&&B.indexOf(C)==T)).join(`
7
- `):o.value},d=()=>{var s,g,h;return m.value?((h=(g=(s=m.value)==null?void 0:s.split(/\r?\n/))==null?void 0:g.map(f=>f.trim()))==null?void 0:h.filter((f,C,T)=>f&&T.indexOf(f)==C)).join(","):""},m=e.ref(i());return e.watch(()=>o.value,()=>{m.value=i()}),(c,s)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{title:c.title,show:c.show,preset:"card",style:{width:"350px"},draggable:"",onClose:s[2]||(s[2]=()=>c.$emit("update:show",!1))},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:a,disabled:c.readonly},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:s[1]||(s[1]=()=>c.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.message),1)]),_:1}),e.createVNode(e.unref(u.NInput),{value:m.value,"onUpdate:value":s[0]||(s[0]=g=>m.value=g),placeholder:c.placeholder,maxlength:c.maxLength,type:"textarea",readonly:c.readonly,rows:16,class:"halo-form-code"},null,8,["value","placeholder","maxlength","readonly"])]),_:1})]),_:1},8,["title","show"]))}}),Bt=e.defineComponent({__name:"HaloModalInput",props:{value:{},label:{},inputReadOnly:{type:Boolean},placeholder:{},config:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=W(),a=e.ref(!1),i=o.config;function d(){a.value=!a.value}function m(c){c!=null&&(n("update:value",c),a.value=!1)}return e.watch(()=>o.value,c=>{console.log(`value changed: [${c}]`)}),e.onMounted(()=>{console.log("Modal-Input onMounted")}),(c,s)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{readonly:c.inputReadOnly,value:c.value,placeholder:c.placeholder,"onUpdate:value":s[0]||(s[0]=g=>c.$emit("update:value",g))},null,8,["readonly","value","placeholder"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:d},{default:e.withCtx(()=>s[4]||(s[4]=[e.createTextVNode(" … ",-1)])),_:1,__:[4]}),e.createVNode(e.unref(u.NModal),{show:a.value,"onUpdate:show":s[2]||(s[2]=g=>a.value=g),title:e.unref(r)(e.unref(i).title??c.label??""),onClose:s[3]||(s[3]=()=>a.value=!1),preset:"card",style:e.normalizeStyle(e.unref(i).modalStyle),"content-style":"display: flex; flex-direction: column;"},{default:e.withCtx(()=>[e.unref(i).componentType?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(i).componentType),{key:0,style:e.normalizeStyle(e.unref(i).style),"onUpdate:selected":s[1]||(s[1]=g=>m(g))},null,40,["style"])):e.createCommentVNode("",!0)]),_:1},8,["show","title","style"])]),_:1}))}}),Si={key:0,style:{"flex-grow":"1"}},Ii={key:0,style:{"text-align":"right"}},Bi=["readonly","disabled"],Vi=["readonly","disabled"],Ve=e.defineComponent({__name:"FormInput",props:{value:{},readonly:{type:Boolean},formItem:{},label:{},placeholder:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=e.ref(o.value),{t:a}=W(),i=e.inject("axios"),d=e.ref(void 0),m=e.ref(!1),c=e.ref(!1),s=()=>{var f;if(typeof((f=o.formItem)==null?void 0:f.editor)=="function")return o.formItem.editor.call(o.formItem,{readonly:o.readonly,formItem:o.formItem,label:o.label,placeholder:o.placeholder,value:r.value,"onUpdate:value":C=>{r.value=C}})},g=f=>{if(f.target instanceof HTMLInputElement){const C=f.target.files;C!=null&&C.length?r.value=C[0]:r.value=null}},h=f=>{var T,B;const C=(T=o.formItem)==null?void 0:T.valueSource;C&&C.type=="remote"&&C.sourceUrl&&C.filterable&&Fe(i,C,{searchWords:f},F=>C.i18n?a(F):F,((B=o.formItem)==null?void 0:B.nullable)!=!1)};return e.watch(r,f=>{n("update:value",f)}),e.watch(()=>o.value,f=>{r.value=f}),e.onMounted(()=>{var f,C;(C=(f=o.formItem)==null?void 0:f.role)!=null&&C.length&&(m.value=o.formItem.role.includes("list"),d.value=o.formItem.role.map(T=>`halo-form-${T}`).join(" "))}),(f,C)=>{var O,j,z,H,S,y,I,A,$,L,P,Y,v,ee,ne,le,Z,ae;const T=e.resolveComponent("n-switch"),B=e.resolveComponent("n-text"),F=e.resolveComponent("n-select"),V=e.resolveComponent("n-input-number"),w=e.resolveComponent("n-checkbox"),N=e.resolveComponent("n-input"),x=e.resolveComponent("n-icon"),_=e.resolveComponent("n-button");return f.formItem?(e.openBlock(),e.createElementBlock("div",Si,[typeof f.formItem.editor=="function"?(e.openBlock(),e.createBlock(e.KeepAlive,{key:0},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s),{value:r.value,"onUpdate:value":C[0]||(C[0]=K=>r.value=K)},null,40,["value"]))],1024)):((O=f.formItem.editor)==null?void 0:O.startsWith("@"))==!0?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.formItem.editor.substring(1)),{key:1,value:r.value,"onUpdate:value":C[1]||(C[1]=K=>r.value=K),config:f.formItem.editorConfig,label:f.formItem.label,readonly:f.readonly,disabled:f.readonly},null,40,["value","config","label","readonly","disabled"])):f.formItem.editor=="modal"?(e.openBlock(),e.createBlock(Bt,{key:2,value:r.value,"onUpdate:value":C[2]||(C[2]=K=>r.value=K),config:f.formItem.editorConfig,label:f.formItem.label},null,8,["value","config","label"])):f.formItem.editor=="boolean"&&Array.isArray(f.formItem.values)&&f.formItem.values.length>1?(e.openBlock(),e.createBlock(T,{key:3,value:r.value,"onUpdate:value":C[3]||(C[3]=K=>r.value=K),style:e.normalizeStyle((j=f.formItem.editorConfig)==null?void 0:j.style)},{checked:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.formItem.values[0]),1)]),unchecked:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.formItem.values[1]),1)]),_:1},8,["value","style"])):f.formItem.valueSource?(e.openBlock(),e.createBlock(F,{key:4,value:r.value,"onUpdate:value":C[4]||(C[4]=K=>r.value=K),remote:f.formItem.valueSource.type=="remote",loading:f.formItem.valueSource.isLoading,options:f.formItem.valueSource.values,filterable:f.formItem.valueSource.filterable,multiple:((z=f.formItem.role)==null?void 0:z.includes("list"))==!0,placeholder:"",disabled:f.readonly,clearable:f.formItem.nullable,style:e.normalizeStyle((H=f.formItem.editorConfig)==null?void 0:H.style),onSearch:h},{action:e.withCtx(()=>[f.formItem.valueSource.filterable?(e.openBlock(),e.createElementBlock("div",Ii,[e.createVNode(B,{depth:"3",italic:""},{default:e.withCtx(()=>[e.createElementVNode("small",null,e.toDisplayString(e.unref(a)("Enter text to filter the result list.")),1)]),_:1})])):e.createCommentVNode("",!0)]),_:1},8,["value","remote","loading","options","filterable","multiple","disabled","clearable","style"])):f.formItem.editor=="number"?(e.openBlock(),e.createBlock(V,{key:5,value:r.value,"onUpdate:value":C[5]||(C[5]=K=>r.value=K),min:f.formItem.minValue,max:f.formItem.maxValue,clearable:f.formItem.nullable,readonly:f.readonly,placeholder:f.placeholder,style:e.normalizeStyle((S=f.formItem.editorConfig)==null?void 0:S.style)},null,8,["value","min","max","clearable","readonly","placeholder","style"])):f.formItem.editor=="boolean"&&f.formItem.nullable?(e.openBlock(),e.createBlock(Nt,{key:6,value:r.value,"onUpdate:value":C[6]||(C[6]=K=>r.value=K),placeholder:"",disabled:f.readonly,style:e.normalizeStyle((y=f.formItem.editorConfig)==null?void 0:y.style)},null,8,["value","disabled","style"])):f.formItem.editor=="boolean"?(e.openBlock(),e.createBlock(w,{key:7,checked:r.value,"onUpdate:checked":C[7]||(C[7]=K=>r.value=K),disabled:f.readonly,style:e.normalizeStyle((I=f.formItem.editorConfig)==null?void 0:I.style)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.label),1)]),_:1},8,["checked","disabled","style"])):f.formItem.editor=="datetime"?(e.openBlock(),e.createBlock(Pe,{key:8,value:r.value,"onUpdate:value":C[8]||(C[8]=K=>r.value=K),type:"datetime",placeholder:"",disabled:f.readonly,clearable:f.formItem.nullable,style:e.normalizeStyle((A=f.formItem.editorConfig)==null?void 0:A.style)},null,8,["value","disabled","clearable","style"])):f.formItem.editor=="date"?(e.openBlock(),e.createBlock(Pe,{key:9,value:r.value,"onUpdate:value":C[9]||(C[9]=K=>r.value=K),type:"date",placeholder:"",disabled:f.readonly,clearable:f.formItem.nullable,style:e.normalizeStyle(($=f.formItem.editorConfig)==null?void 0:$.style)},null,8,["value","disabled","clearable","style"])):f.formItem.editor=="time"?(e.openBlock(),e.createBlock(bt,{key:10,value:r.value,"onUpdate:value":C[10]||(C[10]=K=>r.value=K),placeholder:"",disabled:f.readonly,clearable:f.formItem.nullable,style:e.normalizeStyle((L=f.formItem.editorConfig)==null?void 0:L.style)},null,8,["value","disabled","clearable","style"])):f.formItem.editor=="color"?(e.openBlock(),e.createBlock(mt,{key:11,value:r.value,"onUpdate:value":C[11]||(C[11]=K=>r.value=K),placeholder:"",disabled:f.readonly,readonly:f.readonly,clearable:f.formItem.nullable,style:e.normalizeStyle((P=f.formItem.editorConfig)==null?void 0:P.style)},null,8,["value","disabled","readonly","clearable","style"])):f.formItem.editor=="tags"?(e.openBlock(),e.createBlock(St,{key:12,value:r.value,"onUpdate:value":C[12]||(C[12]=K=>r.value=K),tagSource:f.formItem.tagSource,placeholder:"",disabled:f.readonly,style:e.normalizeStyle((Y=f.formItem.editorConfig)==null?void 0:Y.style)},null,8,["value","tagSource","disabled","style"])):f.formItem.editor=="image"?(e.openBlock(),e.createElementBlock("input",{key:13,type:"file",onChange:g,readonly:f.readonly,disabled:f.readonly,style:e.normalizeStyle((v=f.formItem.editorConfig)==null?void 0:v.style)},null,44,Bi)):f.formItem.editor=="file"?(e.openBlock(),e.createElementBlock("input",{key:14,type:"file",onChange:g,readonly:f.readonly,disabled:f.readonly,style:e.normalizeStyle((ee=f.formItem.editorConfig)==null?void 0:ee.style)},null,44,Vi)):f.formItem.editor=="password"?(e.openBlock(),e.createBlock(N,{key:15,value:r.value,"onUpdate:value":C[13]||(C[13]=K=>r.value=K),class:e.normalizeClass(d.value),placeholder:f.placeholder??"",type:"password",readonly:f.readonly,style:e.normalizeStyle((ne=f.formItem.editorConfig)==null?void 0:ne.style)},null,8,["value","class","placeholder","readonly","style"])):f.formItem.editor=="textarea"?(e.openBlock(),e.createBlock(N,{key:16,value:r.value,"onUpdate:value":C[14]||(C[14]=K=>r.value=K),class:e.normalizeClass(d.value),type:"textarea",placeholder:f.placeholder??"",readonly:f.readonly,style:e.normalizeStyle((le=f.formItem.editorConfig)==null?void 0:le.style)},null,8,["value","class","placeholder","readonly","style"])):(e.openBlock(),e.createBlock(N,{key:17,value:r.value,"onUpdate:value":C[16]||(C[16]=K=>r.value=K),class:e.normalizeClass(d.value),placeholder:f.placeholder??"",readonly:f.readonly,clearable:f.formItem.nullable,type:f.formItem.editor,style:e.normalizeStyle((Z=f.formItem.editorConfig)==null?void 0:Z.style)},{suffix:e.withCtx(()=>[m.value?(e.openBlock(),e.createBlock(_,{key:0,text:"",title:e.unref(a)("If there are multiple items, separate them with commas."),onClick:C[15]||(C[15]=()=>c.value=!0)},{default:e.withCtx(()=>[e.createVNode(x,null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ga))]),_:1})]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1},8,["value","class","placeholder","readonly","clearable","type","style"])),m.value?(e.openBlock(),e.createBlock(It,{key:18,show:c.value,"onUpdate:show":C[17]||(C[17]=K=>c.value=K),title:f.formItem.label,readonly:f.readonly,message:e.unref(a)("Please enter a list, separated by lines or commas."),value:r.value,"onUpdate:value":C[18]||(C[18]=K=>r.value=K),style:e.normalizeStyle((ae=f.formItem.editorConfig)==null?void 0:ae.style)},null,8,["show","title","readonly","message","value","style"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}}),Mi=e.defineComponent({name:"DefaultPropertyForm",components:{FormInput:Ve,NForm:u.NForm,NFormItem:u.NFormItem},props:{readOnly:{type:Boolean,default:!1},method:String,columns:Number,groupLayout:String,formItems:Array,data:Object,original:Object},emits:["itemChange"],setup(t,l){const{t:o}=W(),n=e.inject("axios"),r=e.ref(null),a=e.ref([]),i=e.ref(t.columns||1),d=e.ref({}),m=e.ref(g(t.formItems)),c=f(t.formItems),s=e.ref(void 0);function g(w){return w?[...new Set(w.map(x=>x.group))].map(x=>({label:x||"General",items:w.filter(_=>_.group==x)})):[]}function h(w){return w.dataType=="boolean"&&!w.nullable?" ":w.label}function f(w){const N={};if(w&&w.length)for(const x of w){const _=[];x.nullable==!1&&x.dataType!="boolean"&&_.push({required:!0,message:o("Must be filled here.")}),_.length&&(N[x.name]=_)}return N}async function C(w,N){var x;if(N.type=="remote"&&N.sourceUrl)Fe(n,N,null,_=>N.i18n?o(_):_,w.nullable);else if(N.type=="function"&&N.func){N.isLoading=!0;try{const _=(x=N.func)==null?void 0:x.call(void 0);_&&(N.values=_)}finally{N.isLoading=!1}}}function T(){var w;(w=t.formItems)==null||w.forEach(N=>{N.valueSource&&(N.valueSource.type=="remote"||N.valueSource.type=="function")&&C(N,N.valueSource)})}function B(w,N){l.emit("itemChange",{item:w,data:t.data,value:N})}function F(w){return!!(w.readonly==!0||t.readOnly==!0||t.method&&Array.isArray(w.readonly)&&w.readonly.includes(t.method))}function V(w){return!!(w.visibility==!0||t.method&&Array.isArray(w.visibility)&&w.visibility.includes(t.method))}return e.onMounted(()=>{T(),t.data&&(d.value=t.data)}),e.watch(()=>t.data,w=>d.value=w||{}),{t:o,formRef:r,formItemsRef:a,getItemLabel:h,originalModel:s,model:d,rules:c,formColumns:i,updateValue:B,formGroups:m,isReadonly:F,isVisible:V}}}),Ti={class:"item-box"},Ai={class:"item-box"},_i={class:"item-box"};function Ei(t,l,o,n,r,a){const i=e.resolveComponent("form-input"),d=e.resolveComponent("n-text"),m=e.resolveComponent("n-form-item-grid-item"),c=e.resolveComponent("n-grid"),s=e.resolveComponent("n-tab-pane"),g=e.resolveComponent("n-tabs"),h=e.resolveComponent("n-grid-item"),f=e.resolveComponent("n-form");return e.openBlock(),e.createBlock(f,{ref:"formRef",model:t.model,rules:t.rules,"label-placement":"left","label-width":160},{default:e.withCtx(()=>[t.groupLayout=="tab"?(e.openBlock(),e.createBlock(g,{key:0,type:"line"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formGroups,C=>(e.openBlock(),e.createBlock(s,{key:C,name:C.label,tab:t.t(C.label)},{default:e.withCtx(()=>[e.createVNode(c,{cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.items,T=>e.withDirectives((e.openBlock(),e.createBlock(m,{ref_for:!0,ref:"formItemsRef",key:T.name,label:t.getItemLabel(T),path:T.name,feedback:T.errorMessage,"validation-status":T.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",Ti,[e.createVNode(i,{"form-item":T,value:t.model[T.name],"onUpdate:value":[B=>t.model[T.name]=B,B=>t.updateValue(T,B)],readonly:t.isReadonly(T),label:T.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),T.description?(e.openBlock(),e.createBlock(d,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(T.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(T)]])),128))]),_:2},1032,["cols"])]),_:2},1032,["name","tab"]))),128)),e.renderSlot(t.$slots,"more-tabs",{},void 0,!0)]),_:3})):t.groupLayout=="column"?(e.openBlock(),e.createBlock(c,{key:1,cols:t.formGroups.length,"x-gap":"8"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formGroups,C=>(e.openBlock(),e.createBlock(h,{key:C},{default:e.withCtx(()=>[e.createVNode(c,{cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.items,T=>e.withDirectives((e.openBlock(),e.createBlock(m,{ref_for:!0,ref:"formItemsRef",key:T.name,label:t.getItemLabel(T),path:T.name,feedback:T.errorMessage,"validation-status":T.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",Ai,[e.createVNode(i,{"form-item":T,value:t.model[T.name],"onUpdate:value":[B=>t.model[T.name]=B,B=>t.updateValue(T,B)],readonly:t.isReadonly(T),label:T.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),T.description?(e.openBlock(),e.createBlock(d,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(T.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(T)]])),128))]),_:2},1032,["cols"])]),_:2},1024))),128))]),_:1},8,["cols"])):(e.openBlock(),e.createBlock(c,{key:2,cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formItems,C=>e.withDirectives((e.openBlock(),e.createBlock(m,{ref_for:!0,ref:"formItemsRef",key:C.name,label:t.getItemLabel(C),path:C.name,feedback:C.errorMessage,"validation-status":C.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",_i,[e.createVNode(i,{"form-item":C,value:t.model[C.name],"onUpdate:value":[T=>t.model[C.name]=T,T=>t.updateValue(C,T)],readonly:t.isReadonly(C),label:C.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),C.description?(e.openBlock(),e.createBlock(d,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(C.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(C)]])),128))]),_:1},8,["cols"]))]),_:3},8,["model","rules"])}const Vt=oe(Mi,[["render",Ei],["__scopeId","data-v-e7319d81"]]),Li={class:"pg-value flex-grow-1"},Mt=e.defineComponent({__name:"PropertyGrid",props:{columns:{default:1},hideEmpty:{type:Boolean},data:{},names:{},justify:{}},setup(t){const l=t,{t:o}=W(),n=e.ref(a()),r=()=>{n.value=a()};function a(){var s;const i=new Array,d=l.data,m=l.names,c=l.hideEmpty;if(d)if(m)for(const g of m)if(typeof g=="string")(!c||d[g])&&i.push({name:g,label:o(te(g)),value:d[g],span:1});else{const h={name:g.name??g.label,label:o(g.label||te(g.name)),value:d[g.name],span:g.span||1,dataType:g.dataType,role:g.role};h.value!=null&&(h.dataType=="boolean"?h.value=fe(h.value)?o("Yes"):o("No"):g.i18n&&(h.value=o((s=h.value)==null?void 0:s.toString()))),(!c||h.value)&&i.push(h)}else if(Array.isArray(d))for(const g of d)(!c||g.value)&&i.push({name:g.label,label:o(te(g.label)),value:g.value,span:1});else for(const g in d)(!c||d[g])&&i.push({name:g,label:o(te(g)),value:d[g],span:1});return i}return e.watch(()=>l.data,()=>r()),e.watch(()=>l.hideEmpty,()=>r()),(i,d)=>(e.openBlock(),e.createBlock(e.unref(u.NGrid),{cols:i.columns,"item-responsive":""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value.filter(m=>!i.hideEmpty||m.value),m=>(e.openBlock(),e.createBlock(e.unref(u.NGridItem),{class:"pg-item",key:m.label,span:m.span},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default",{label:m.label,value:m.value,class:"flex-1"},()=>[e.createElementVNode("div",{class:"flex-row justify flex-1",style:e.normalizeStyle({"justify-content":i.justify})},[e.createVNode(e.unref(u.NText),{class:"pg-label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.label)+":",1)]),_:2},1024),e.createElementVNode("div",Li,[m.role=="percent"?(e.openBlock(),e.createBlock(e.unref(u.NProgress),{key:0,type:"line",percentage:Number(m.value),title:m.value+"%",style:{"margin-top":"auto","max-width":"80%"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value)+" % ",1)]),_:2},1032,["percentage","title"])):(e.openBlock(),e.createBlock(e.unref(u.NText),{key:1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:2},1024))])],4),e.renderSlot(i.$slots,"item-tools",{item:m})])]),_:2},1032,["span"]))),128))]),_:3},8,["cols"]))}}),zi={style:{"align-items":"center"},class:"flex-row gap05"},$i={class:"flex-row gap05"},Di={class:"flex-column flex-1 gap05"},Ri={key:0,class:"flex-row",style:{"justify-content":"space-between"}},Oi={class:"text-monospace",style:{"font-size":"24pt"}},ji={key:0},Fi=["src"],Pi=["src"],Hi={class:"flex-row gap05",style:{"justify-content":"flex-end"}},hn=oe(e.defineComponent({__name:"DetailPage",props:{loading:{type:Boolean},title:{},subject:{},data:{},properties:{},showBarcode:{type:Boolean,default:!0},columns:{default:3}},emits:["refresh"],setup(t){const{t:l}=W(),o=e.ref(!0),n=e.ref(localStorage.getItem("detail-page-full-size")=="true"),r=e.ref(localStorage.getItem("detail-page-show-info")!="false"),a=()=>{n.value=!n.value,localStorage.setItem("detail-page-full-size",n.value.toString())},i=()=>{o.value=!o.value},d=()=>{r.value=!r.value,localStorage.setItem("detail-page-show-info",r.value.toString())};return(m,c)=>(e.openBlock(),e.createBlock(e.unref(u.NSpin),{show:m.loading,class:"flex-grow-1 flex-column","content-class":"flex-column flex-grow-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NCard),{embedded:"",class:e.normalizeClass(["detail-page-card flex-grow-1",{"detail-page-card-center":!n.value}]),segmented:{content:!0,footer:"soft"},"content-class":"flex-column"},e.createSlots({"header-extra":e.withCtx(()=>[e.createElementVNode("div",$i,[e.createVNode(e.unref(u.NButton),{onClick:c[0]||(c[0]=()=>m.$emit("refresh")),title:e.unref(l)("Refresh")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ys))]),_:1})]),_:1},8,["title"]),e.createVNode(e.unref(u.NButton),{onClick:c[1]||(c[1]=()=>a()),title:n.value?e.unref(l)("Collapse"):e.unref(l)("Expand")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Gs))]),_:1})]),_:1},8,["title"])])]),default:e.withCtx(()=>[e.createElementVNode("div",Di,[m.subject?(e.openBlock(),e.createElementBlock("div",Ri,[e.createElementVNode("div",null,[e.createElementVNode("div",Oi,e.toDisplayString(m.subject),1),m.showBarcode?(e.openBlock(),e.createElementBlock("div",ji,[e.createElementVNode("img",{src:"/api/core/Barcode/Image?code="+m.subject+"&format=CODE_128&height=30&margin=4,2"},null,8,Fi)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[m.showBarcode?(e.openBlock(),e.createElementBlock("img",{key:0,src:"/api/core/QR/Image?code="+m.subject+"&format=CODE_128&width=100&height=100"},null,8,Pi)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[m.data?(e.openBlock(),e.createBlock(e.unref(u.NCard),{key:0},e.createSlots({header:e.withCtx(()=>[e.createElementVNode("div",{class:"flex-row gap05",style:{"align-items":"center"},onClick:d},[r.value?(e.openBlock(),e.createBlock(e.unref(u.NIcon),{key:0,size:24},{default:e.withCtx(()=>[e.createVNode(e.unref(ze))]),_:1})):(e.openBlock(),e.createBlock(e.unref(u.NIcon),{key:1,size:24},{default:e.withCtx(()=>[e.createVNode(e.unref(ks))]),_:1})),e.createElementVNode("span",null,e.toDisplayString(e.unref(l)("Property")),1)])]),default:e.withCtx(()=>[r.value?(e.openBlock(),e.createBlock(Mt,{key:0,data:m.data,columns:m.columns,names:m.properties,"hide-empty":o.value},null,8,["data","columns","names","hide-empty"])):e.createCommentVNode("",!0)]),_:2},[r.value?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",Hi,[e.createVNode(e.unref(u.NButton),{text:"",onClick:c[2]||(c[2]=()=>i()),title:e.unref(l)("More")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(qo))]),_:1})]),_:1},8,["title"])])]),key:"0"}:void 0]),1024)):e.createCommentVNode("",!0)]),e.renderSlot(m.$slots,"default",{},void 0,!0)])]),_:2},[m.title?{name:"header",fn:e.withCtx(()=>[e.createElementVNode("div",zi,[e.renderSlot(m.$slots,"icon",{},()=>[e.createVNode(e.unref(u.NIcon),{size:24},{default:e.withCtx(()=>[e.createVNode(e.unref(Bs))]),_:1})],!0),e.createElementVNode("strong",null,e.toDisplayString(e.unref(l)(m.title)),1)])]),key:"0"}:void 0]),1032,["class"])]),_:3},8,["show"]))}}),[["__scopeId","data-v-6dec6e5e"]]),Gi={style:{"min-height":"50px"}},Tt=e.defineComponent({__name:"ExportModal",props:{show:{type:Boolean},range:{},supportedFormats:{},supportedRanges:{}},emits:["export","close"],setup(t){const l=t,{t:o}=W(),n=e.ref(null),r=e.ref(d()),a=e.ref(null),i=e.ref(m());function d(){let c=[{label:o("Excel"),value:"excel"},{label:o("Json"),value:"json"},{label:o("Text"),value:"text"},{label:o("XML"),value:"xml"}];const s=l.supportedFormats;return s&&(c=c.filter(g=>s.includes(g.value))),n.value=c.length?c[0].value:null,c}function m(){const c=l.supportedRanges||["empty","selection","page","all"],s=[{label:o("Selection"),value:"selection"},{label:o("Current Page"),value:"page"},{label:o("Search"),value:"search"},{label:o("All"),value:"all"},{label:o("Empty(Template)"),value:"empty"}].filter(g=>c.includes(g.value));return l.range?a.value=l.range:a.value=s.length?s[0].value:null,s}return e.watch(()=>l.range,c=>{c&&(a.value=c)}),(c,s)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:c.show,preset:"card",title:e.unref(o)("Export Options"),style:{"max-width":"400px"},draggable:"",onClose:s[4]||(s[4]=()=>c.$emit("close"))},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{onClick:s[2]||(s[2]=()=>c.$emit("export",n.value,a.value)),style:{"min-width":"100px"},type:"primary"},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(vo))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(o)("Export")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:s[3]||(s[3]=()=>c.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",Gi,[r.value.length>1?(e.openBlock(),e.createBlock(e.unref(u.NFormItem),{key:0,label:e.unref(o)("File Format")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSelect),{options:r.value,value:n.value,"onUpdate:value":s[0]||(s[0]=g=>n.value=g)},null,8,["options","value"])]),_:1},8,["label"])):e.createCommentVNode("",!0),i.value.length>1?(e.openBlock(),e.createBlock(e.unref(u.NFormItem),{key:1,label:e.unref(o)("Data Range")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSelect),{options:i.value,value:a.value,"onUpdate:value":s[1]||(s[1]=g=>a.value=g)},null,8,["options","value"])]),_:1},8,["label"])):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"options")])]),_:3},8,["show","title"]))}}),Ki={class:"flex-column gap1",style:{"justify-content":"center","align-items":"center"}},gn=e.defineComponent({__name:"EmptyDetailView",props:{message:{default:"Please select a object."}},setup(t){const{t:l}=W();return(o,n)=>(e.openBlock(),e.createElementBlock("div",Ki,[e.createVNode(e.unref(u.NIcon),{depth:5,size:48},{default:e.withCtx(()=>[e.createVNode(e.unref(qs))]),_:1}),e.createVNode(e.unref(u.NText),{depth:"3",style:{opacity:"0.6"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)(o.message)),1)]),_:1})]))}}),Wi=e.defineComponent({components:{FullscreenIcon:Aa,ExitFullscreenIcon:Ma},emits:["change"],setup(t,l){const{t:o}=W(),n=Ne(),r=e.computed(()=>n.isFullscreen);function a(c){c||(c=document.body),c.requestFullscreen&&c.requestFullscreen()}function i(){document.exitFullscreen&&document.exitFullscreen()}function d(c){var s;if(r.value)i();else{const g=(s=c.target)==null?void 0:s.closest(".fullscreen-view");a(g)}}function m(){const c=!!document.fullscreenElement;n.setIsFullscreen(c),l.emit("change",c)}return e.onMounted(()=>{document.addEventListener("fullscreenchange",m),document.addEventListener("mozfullscreenchange",m),document.addEventListener("webkitfullscreenchange",m),document.addEventListener("msfullscreenchange",m)}),{t:o,isFullscreen:r,toggleFullscreen:d}}});function Zi(t,l,o,n,r,a){const i=e.resolveComponent("fullscreen-icon"),d=e.resolveComponent("exit-fullscreen-icon"),m=e.resolveComponent("n-icon"),c=e.resolveComponent("n-button");return e.openBlock(),e.createBlock(c,{onClick:t.toggleFullscreen},{icon:e.withCtx(()=>[e.createVNode(m,null,{default:e.withCtx(()=>[t.isFullscreen?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(i,{key:0})),t.isFullscreen?(e.openBlock(),e.createBlock(d,{key:1})):e.createCommentVNode("",!0)]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(t.t("Toggle Fullscreen")),1)]),_:1},8,["onClick"])}const yn=oe(Wi,[["render",Zi]]),At=t=>{const l=e.inject("axios"),o={},n=[],r=[];t.forEach(g=>{typeof g=="string"?(o[g]=!1,n.push(g)):(o[g.id]=!1,o[g.name]=!1,n.push(g.id),r.push(g))});let a=0;async function i(g){a||await m(g)}function d(){for(let g in o)o[g]=!1}async function m(g){d();const h=n.filter(f=>(f==null?void 0:f.length)==32);if(h.length)try{let f=await l.get(`/api/core/Account/CheckPermissions?permissions=${encodeURIComponent(h.join())}`);f.isSuccess&&f.value!=null?(a++,f.value.forEach(C=>{o[C]=!0;const T=r.find(B=>B.id==C);T&&(o[T.name]=!0)}),g==null||g.call(null,o)):console.error(f.errorMessage)}catch(f){console.error(f)}}function c(){for(let g in o)if(!o[g])return!1;return!0}function s(){for(let g in o)if(o[g])return!0;return!1}return{flags:o,check:m,checkOnce:i,all:c,any:s}},Yi={key:0,class:"flex-row",style:{"align-items":"center","justify-content":"space-between",gap:"0.25em","margin-bottom":"1em"}},Qi={style:{display:"grid","grid-template-columns":"auto 1fr",gap:"0.5em","margin-top":"1em","align-items":"center"}},wn=200,_t=e.defineComponent({__name:"GridConfigModal",props:{gridId:{},show:{type:Boolean},pageSize:{},gridColumns:{}},emits:["close","update:pageSize","update:config"],setup(t,{emit:l}){const o=t,n=l,{t:r}=W(),a=ce(),i=e.inject("axios"),d=u.useMessage(),m=At(["2E2466DDD34847C8B33460E4277A6528"]),c=e.ref(o.pageSize),s=e.ref(!1),g=e.ref(!1),h=N=>N?N.map((x,_)=>({columnId:x.name,title:x.title?r(x.title):r(te(x.name)),visible:!0,sortIndex:_})).sort((x,_)=>x.sortIndex-_.sortIndex):[],f=N=>(x,_)=>{let O=null;if(N=="visible"){const j=Oe(x[N]);O=e.h(u.NIcon,{size:"20"},{default:()=>j?e.h(Jo):e.h(Xo)})}else N=="move_up"?O=e.h(u.NIcon,{size:"20"},{default:()=>e.h(ps)}):N=="move_down"&&(O=e.h(u.NIcon,{size:"20"},{default:()=>e.h(ss)}));return e.h(u.NButton,{text:!0,onClick:j=>{C(x,_,N),j.stopPropagation()}},{default:()=>O})};function C(N,x,_){switch(_){case"visible":N.visible=!N.visible;break;case"move_up":if(x>0&&V.value){const O=V.value.splice(x,1);V.value.splice(x-1,0,O[0])}break;case"move_down":if(V.value&&x<V.value.length-1){const O=V.value.splice(x,1);V.value.splice(x+1,0,O[0])}break}}const T=()=>{const N=o.gridId;N&&a.confirmToPost("Reset","Are you sure reset the configuration of this data grid?",{url:`/api/core/UserDataGrids/Reset?dataGridId=${N}`,successMessage:"The configuration has been reset, please refresh the page.",success:()=>{n("update:config",null)}})};async function B(){if(!o.gridId)return;const N={dataGridId:o.gridId,pageSize:c.value,columns:V.value.filter(x=>x.columnId).map((x,_)=>({columnId:x.columnId,visible:x.visible,sortIndex:_}))};N.pageSize&&(N.pageSize=Math.max(1,Math.min(wn,N.pageSize)));try{const x=s.value&&g.value,_=await i.post(`/api/core/UserDataGrids/Save?isDefault=${x}`,N);(_==null?void 0:_.isSuccess)==!0?(d.success(r("The configuration has been saved, please refresh the page.")),n("update:pageSize",c.value),n("update:config",N)):d.error((_==null?void 0:_.errorMessage)||r("Error"))}catch(x){d.error((x==null?void 0:x.toString())||r("Error"))}}async function F(){if(o.gridId&&V.value.length)try{const N=s.value&&g.value,x=await i.get(`/api/core/UserDataGrids/Entity?dataGridId=${encodeURIComponent(o.gridId)}?isDefault=${N}`);if(x!=null&&x.isSuccess)if(x.value){c.value=x.value.pageSize;for(const _ of x.value.columns){const O=V.value.find(j=>j.columnId==_.columnId);O&&(O.visible=_.visible,O.sortIndex=_.sortIndex),V.value.sort((j,z)=>j.sortIndex-z.sortIndex)}}else V.value=h(o.gridColumns),c.value=o.pageSize;else console.log(x==null?void 0:x.errorMessage)}catch(N){console.log(N)}}e.watch(()=>o.show,N=>{N&&(m.checkOnce(x=>{g.value=x["2E2466DDD34847C8B33460E4277A6528"]}),F())}),e.watch(()=>o.gridColumns,()=>V.value=h(o.gridColumns)),e.watch(s,()=>F());const V=e.ref(h(o.gridColumns)),w=[{title:r("Name"),key:"title"},{title:r("Visible"),key:"visible",width:80,align:"center",fixed:"right",render:f("visible")},{key:"move_up",width:30,align:"center",fixed:"right",render:f("move_up")},{key:"move_down",width:30,align:"center",fixed:"right",render:f("move_down")},{key:"empty",width:20,fixed:"right"}];return(N,x)=>{const _=e.resolveComponent("n-space");return e.openBlock(),e.createBlock(e.unref(u.NModal),{show:N.show,preset:"card",title:e.unref(r)("Config Data Grid"),style:{"max-width":"500px"},draggable:"",onClose:x[3]||(x[3]=()=>N.$emit("close"))},{action:e.withCtx(()=>[e.createVNode(_,{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{onClick:B,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Save")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:T,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Reset")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:x[2]||(x[2]=()=>N.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[g.value?(e.openBlock(),e.createElementBlock("div",Yi,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("System Default")),1),e.createVNode(e.unref(u.NSwitch),{value:s.value,"onUpdate:value":x[0]||(x[0]=O=>s.value=O)},null,8,["value"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NDataTable),{columns:w,data:V.value,"max-height":450,size:"small"},null,8,["data"]),e.createElementVNode("div",Qi,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Page Size")),1),e.createVNode(e.unref(u.NInputNumber),{value:c.value,"onUpdate:value":x[1]||(x[1]=O=>c.value=O),max:wn,min:1,style:{"max-width":"200px"}},null,8,["value"])])]),_:1},8,["show","title"])}}}),Cn=e.defineComponent({__name:"HaloButtonSelect",props:{value:{},sourceUrl:{},additionalQuery:{},labelFormatter:{type:Function},keyField:{},labelField:{},subLabelField:{},size:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=W(),a=e.inject("axios"),i=e.ref(!1),d=e.ref([]);async function m(s){let g=o.sourceUrl;if(g){const h=o.labelFormatter,f=o.keyField,C=o.labelField,T=o.subLabelField,B=o.additionalQuery;i.value=!0,d.value=[];try{B&&(g=U(g,B,!0));const F=await a.get(g);if(F.isSuccess&&F.value!=null){let V=F.value;if(!Array.isArray(V)&&"rows"in V&&Array.isArray(V.rows)&&(V=V.rows),Array.isArray(V)){const w=V.filter(N=>N&&!0).map(N=>{if(typeof N=="string")return{value:N,label:h?h(N):r(N)};{let x=N[C||"label"];if(h&&(x=h(x)),T){const _=N[T];typeof _=="string"&&(x+=" "+(h?h(_):_))}return{value:N[f||"value"],label:x}}});d.value=w}}}finally{i.value=!1}}}function c(s,g){n("update:value",s,g)}return e.watch(()=>o.sourceUrl,()=>m()),e.onMounted(()=>{m()}),(s,g)=>{const h=e.resolveComponent("n-radio-button"),f=e.resolveComponent("n-radio-group");return e.openBlock(),e.createBlock(f,{value:s.value,size:s.size,"onUpdate:value":c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,C=>(e.openBlock(),e.createBlock(h,{key:C.value,value:C.value,label:C.label},null,8,["value","label"]))),128))]),_:1},8,["value","size"])}}}),Ke=oe(e.defineComponent({__name:"SearchForm",props:{searchItems:{},searchArgs:{},groupOptions:{},groupBy:{}},emits:["update:searchArgs","update:groupBy"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=W(),i=e.inject("axios"),d=V=>V==null?void 0:V.map(w=>typeof w=="string"?{label:a(w),value:w}:w),m=()=>{const V=new Array;if(n.searchItems)for(const w of n.searchItems)if(typeof w=="string")V.push({name:w,label:te(w),editor:"text",nullable:!0,visibility:!0,searchMethod:"normal"});else{let N=w;w.searchField&&(N=Object.assign({},w),N.name=w.searchField),V.push(N)}return V},c=()=>{const V={};if(T.forEach(w=>{V[w.name]=null,w.searchMethod=="range"&&(V[w.name+"From"]=null,V[w.name+"To"]=null)}),n.searchArgs)for(const w in V)n.searchArgs[w]!=null&&(V[w]=n.searchArgs[w]);return V},s=()=>{for(const V in B)B[V]=null},g=async V=>{var N,x;const w=V.valueSource;if(w){if(w.type=="remote"&&w.sourceUrl)await Fe(i,w,null,_=>w.i18n?a(_):_,!1),V.nullable==!1&&((N=w.values)!=null&&N.length)&&(B[V.name]=w.values[0].value);else if(w.type=="function"&&w.func){w.isLoading=!0;try{const _=(x=w.func)==null?void 0:x.call(void 0);_&&(w.values=_)}finally{w.isLoading=!1}}}},h=()=>{var w;const V={};for(const N of T){const x=N.searchField??N.name;if(N.searchMethod=="range"){const _=f(x+"From",N);_!=null&&(V[x+"From"]=_);let O=f(x+"To",N);O!=null&&(N.editor=="date"&&typeof O=="string"&&(O=ie(O,ge).add(1,"days").format(ge)),V[x+"To"]=O)}else{const _=f(x,N);_!=null&&(((w=N.role)==null?void 0:w.includes("list"))==!0&&typeof _=="string"?_.includes(",")?V[x]=_.split(","):V[x]=[_]:V[x]=_)}}return V},f=(V,w)=>{var x,_;let N=B[V];if(!(typeof N=="string"&&(N=N.trim(),N==""&&!w.valueSource))){if(Array.isArray((x=w.valueSource)==null?void 0:x.values)){const O=(_=w.valueSource)==null?void 0:_.values;if(O){if(O.some(j=>j.value==B[V]))N=B[V];else if(N=="")return;if(w.dataType=="boolean"){if(typeof N=="boolean")return N;const j=O.findIndex(z=>z.value==N);return j>-1&&(O.length==2?N=j==0:O.length==3&&j>0&&(N=j==1)),typeof N=="boolean"?N:je(N,w.dataType,w.role)}}}return je(N,w.dataType,w.role)}},C=()=>{r("update:searchArgs",h())},T=m(),B=e.reactive(c()),F=e.ref(d(n.groupOptions));return e.watch(()=>n.groupOptions,()=>F.value=d(n.groupOptions)),e.onMounted(()=>{c(),T.forEach(V=>{V.valueSource&&(V.valueSource.type=="remote"||V.valueSource.type=="function"?g(V):V.valueSource.type=="static")})}),l({reset:s,updateValues:C,pickValues:h}),(V,w)=>(e.openBlock(),e.createBlock(e.unref(u.NForm),{model:B,"label-placement":"left","label-width":"auto"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NGrid),{"x-gap":"12",cols:"1 700:2 1200:3"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(T),N=>(e.openBlock(),e.createBlock(e.unref(u.NGridItem),{key:N.name},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NFormItem),{label:e.unref(a)(N.label==null?N.name:N.label),path:N.name},{default:e.withCtx(()=>[N.searchMethod=="range"?(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),{key:0},{default:e.withCtx(()=>[e.createVNode(Ve,{"form-item":N,value:B[N.name+"From"],"onUpdate:value":x=>B[N.name+"From"]=x,style:{"flex-grow":"1"},onInput:w[0]||(w[0]=()=>C())},null,8,["form-item","value","onUpdate:value"]),e.createVNode(e.unref(u.NInputGroupLabel),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("to")),1)]),_:1}),e.createVNode(Ve,{"form-item":N,value:B[N.name+"To"],"onUpdate:value":x=>B[N.name+"To"]=x,style:{"flex-grow":"1"},onInput:w[1]||(w[1]=()=>C())},null,8,["form-item","value","onUpdate:value"])]),_:2},1024)):(e.openBlock(),e.createBlock(Ve,{key:1,"form-item":N,value:B[N.name],"onUpdate:value":x=>B[N.name]=x,onInput:w[2]||(w[2]=()=>C())},null,8,["form-item","value","onUpdate:value"]))]),_:2},1032,["label","path"])]),_:2},1024))),128))]),_:1}),F.value?(e.openBlock(),e.createBlock(e.unref(u.NGrid),{key:0,"x-gap":"12",cols:"1 700:2 1200:3"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NGridItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NFormItem),{label:e.unref(a)("Group By")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSelect),{value:V.groupBy,options:F.value,"onUpdate:value":w[3]||(w[3]=N=>V.$emit("update:groupBy",N))},null,8,["value","options"])]),_:1},8,["label"])]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["model"]))}}),[["__scopeId","data-v-8b391a0f"]]),Xi={class:"flex-row gap05"},Et=e.defineComponent({__name:"TagsView",props:{tags:{},tagSource:{},size:{default:"small"}},setup(t){const l=t,o=Ne(),n=ce(),r=e.ref([]);async function a(){var d;const i=((d=l.tags)==null?void 0:d.map(m=>({value:m,text:m})))??[];if(r.value=i,l.tagSource){const m=await o.fetchSharedData(`tags:${l.tagSource}`,async()=>await n.get({url:`/api/core/CommonCodeItems/list?commonCode=${l.tagSource}`})??[]);for(const c of i){const s=m.find(g=>g.code==c.value);s&&(c.desc=s.name,c.color=s.color)}r.value=[...i]}}return e.watch(()=>l.tags,()=>a()),e.onMounted(()=>a()),(i,d)=>(e.openBlock(),e.createElementBlock("div",Xi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,m=>(e.openBlock(),e.createBlock(e.unref(u.NTag),{key:m.value,title:m.desc,color:{borderColor:m.color},size:i.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.text),1)]),_:2},1032,["title","color","size"]))),128))]))}}),We=e.defineComponent({__name:"HaloGrid",props:{keyField:{default:"__key__"},checkable:{type:Boolean,default:!0},dragSorting:{type:Boolean},columns:{},data:{},withEdit:{type:Boolean,default:!1},withDelete:{type:Boolean,default:!1},withDetails:{type:Boolean,default:!1},multiSelect:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},maxHeight:{},height:{},selectedId:{},selectedIds:{},flexHeight:{type:Boolean,default:!0}},emits:["editRow","deleteRow","showDetails","columnButtonClick","update:selectedIds","update:selectedId","update:sorter","rowSorting"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=W(),i=de.useRouter(),d=xt(),m=e.ref(void 0),c=e.ref(F()),s=e.ref([]),g=e.ref(void 0),h=e.ref(f());function f(){const y={};return typeof n.height=="number"?y.height=`${n.height}px`:typeof n.height=="string"&&(y.height=n.height),y}function C(){var A;const y=s.value,I=(A=n.data)==null?void 0:A.filter($=>y.includes($[n.keyField]));r("update:selectedIds",y,I),y.length&&r("update:selectedId",y[0])}function T(y){return y[n.keyField]}function B(y,I){let A=0,$=0;for(const L of I){let P,Y;if(typeof L=="string")P={key:L,title:a(te(L))};else if(!(L.behavior=="none"||L.visible==!1))if(L.behavior=="link"||L.behavior=="router-link")P={key:L.name||`column_${A}`,title:L.title?a(L.title):void 0,align:L.align,fixed:L.fixed||void 0,width:L.width,sorter:L.sortable==!0,render:L.render||V(L)};else if(L.behavior=="button")P={key:L.name||`column_${A}`,title:L.title?a(L.title):void 0,align:L.align||"center",fixed:L.fixed||void 0,width:L.width,sorter:L.sortable==!0,render:L.render||V(L)};else{let v=L.align,ee=[];if(!L.display)switch(L.dataType){case"number":v=v||"right",Y=60,ee.push("text-num");break;case"boolean":v=v||"center",Y=60;break;case"date":Y=100;break;case"datetime":Y=180;break;case"timespan":v=v||"center",Y=80;break;case"time":Y=80,ee.push(`text-${L.dataType}`);break}if(P={key:L.name||`column_${A}`,title:L.title==null?a(te(L.name)):L?a(L.title):void 0,titleAlign:"center",align:v,width:L.width||Y,sorter:L.sortable==!0,minWidth:L.minWidth,resizable:!0,fixed:L.fixed,render:L.render||V(L)},typeof L.className=="string"?ee.push(L.className):Array.isArray(L.className)&&ee.push(...L.className),ee.length&&(P.className=ee.join(" ")),!P.width&&P.minWidth&&(P.width=P.minWidth),L.referencePage&&typeof P.width=="number"&&(P.width+=30),L.role&&L.role.includes("qr")&&typeof P.width=="number"&&(P.width+=30),L.role&&L.role.includes("percent")&&typeof P.width=="number"&&(P.width+=30,P.align||(P.align="right")),(L.textOverflow=="ellipsis"||L.textOverflow=="clip")&&(P.ellipsis={tooltip:!0},P.resizable=!0,Y||(Y=400)),L.children&&L.children.length){const ne=[];B(ne,L.children),P.children=ne,ne.some(le=>le.width)&&(P.width=void 0)}}P&&(y.push(P),typeof L=="object"&&typeof L.width=="number"?$+=L.width:$+=Y||150)}return $}function F(){if(n.columns){const y=[];let I=0;return n.checkable&&(y.push({type:"selection",fixed:"left"}),I+=30),I+=B(y,n.columns),n.withEdit&&(y.push({key:"btn-edit",width:30,fixed:"right",render(A,$){return e.h(u.NButton,{text:!0,titie:a("Edit"),onClick:L=>{r("editRow",A,$),L.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#5C6BC0",size:"20"},{default:()=>e.h(Po)})})}}),I+=30),n.withDelete&&(y.push({key:"btn-delete",width:30,fixed:"right",render(A,$){return e.h(u.NButton,{text:!0,titie:a("Delete"),onClick:L=>{r("deleteRow",A,$),L.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#f44336",size:"20"},{default:()=>e.h(Fo)})})}}),I+=30),n.withDetails&&(y.push({key:"btn-details",width:30,fixed:"right",render(A,$){return e.h(u.NButton,{text:!0,titie:a("Details"),onClick:L=>{r("showDetails",A,$),L.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#4CAF50",size:"20"},{default:()=>e.h(Xa)})})}}),I+=30),n.dragSorting&&(y.push({key:"drag-sorting-handler",width:30,fixed:"right",render(){return e.h(u.NIcon,{color:"#90A4AE",size:"20",class:"drag-sorting-handle"},{default:()=>e.h(en)})}}),I+=30),m.value=I,y}else return[]}function V(y){return(I,A)=>{var ee,ne,le;let $=null;const L=y.display||y.name;if(y.template&&typeof y.template=="function")$=y.template.call(null,I,A);else if(y.dataType=="bool"||y.dataType=="boolean"){const Z=Oe(I[L]);if(y.values&&y.values.length>1)return y.i18n?a(Z?y.values[0]:y.values[1]):Z?y.values[0]:y.values[1];Z!=null?$=e.h(u.NIcon,{size:"20",class:Z?"cell-checked":"cell-unchecked"},{default:()=>Z?e.h(ys):e.h(Ps)}):$=e.h("span")}else if(y.dataType=="date")$=st(To(I[L]));else if(y.dataType=="time")$=zo(_o(I[L]));else if(y.dataType=="timespan")$=$o(I[L]);else{let Z=I[L];y.formatter?Z=y.formatter(Z,I):y.template&&(Z=Ce.render(y.template,I)),typeof Z=="string"&&(y.prefix&&(Z=y.prefix+Z),y.suffix&&(Z=Z+y.suffix),y.i18n&&(Z=a(Z))),$=Z}let P=y.role;if(P&&!Array.isArray(P)&&(P=[P]),P!=null&&P.length)if(P.includes("tag")){let Z;Array.isArray(I[L])?Z=I[L]:Z=(le=(ne=(ee=I[L])==null?void 0:ee.toString())==null?void 0:ne.split(","))==null?void 0:le.filter(ae=>ae.length),Z&&Z.length&&($=e.h(Et,{tags:Z,tagSource:y.tagSource},{}))}else $&&($=e.h("span",{class:P.map(Z=>{switch(Z){case"status":return`status-tag status-${I[L]}`;default:return`halo-form-${Z}`}}).join(" ")},[$]));const Y=typeof y.href=="function"?y.href(I):y.href;if(y.behavior=="link")Y?$=e.h("a",{href:Ce.render(Y,I),target:"_blank"},[$]):$=e.h("a",{href:"#",onClick:Z=>{var ae;r("columnButtonClick",y.name,I,A),(ae=y==null?void 0:y.click)==null||ae.call(null,I,A),Z.stopPropagation()}},[$]);else if(y.behavior=="router-link"&&Y){const Z=$;$=e.h(de.RouterLink,{to:Ce.render(Y,I)},{default:()=>Z})}else if(y.behavior=="button"){const Z=$;$=e.h(u.NButton,{size:"tiny",tag:"a",onClick:ae=>{var K;r("columnButtonClick",y.name,I,A),(K=y==null?void 0:y.click)==null||K.call(null,I,A),ae.stopPropagation()}},{default:()=>Z})}const v=[];if(y.role&&(y.role.includes("qr")&&v.push(e.h(u.NButton,{quaternary:!0,size:"tiny",class:"btn-cell-qr",title:a("QR Code"),onClick:()=>N(y,A)},{default:()=>e.h(u.NIcon,{},{default:()=>e.h(Ws)})})),y.role.includes("percent"))){const Z=Oo(I[L]);v.push(e.h(u.NProgress,{showIndicator:!1,type:"circle",status:Z&&Z>100?"error":"success",percentage:Z||0,class:"percent-mark",style:"width: 1em; margin-bottom: auto; margin-top: auto"}))}return y.referencePage&&v.push(e.h(u.NButton,{quaternary:!0,size:"tiny",class:"btn-cell-ref",title:a("Details"),onClick:()=>w(y,A)},{default:()=>e.h(u.NIcon,{},{default:()=>e.h(wt)})})),v.length?e.h("div",{style:"display: flex; justify-content: space-between;"},[e.h("div",{style:"flex-shrink: 1; flex-grow: 1; overflow: hidden;"},[$]),e.h("div",{},...v)]):$}}function w(y,I){if(Array.isArray(n.data)&&I!=null&&I>=0&&I<n.data.length&&y.referencePage){const A=n.data[I],$=Ce.render(y.referencePage,A);$.startsWith("/")&&i.push({path:$})}}function N(y,I){if(Array.isArray(n.data)&&I!=null&&I>=0&&I<n.data.length){const A=n.data[I][y.name];if(typeof A=="string"){const $=a(y.title??te(y.name));d.showQrModal(A,$)}}}function x(y,I){return{onClick:A=>{if(A.target instanceof HTMLElement&&A.target.classList.contains("n-checkbox-box__border")==!1){const $=T(y);$!==void 0&&!s.value.includes($)&&(s.value=[$],C())}},ondblclick:A=>{A.target instanceof HTMLTableCellElement&&r("editRow",y,I)}}}function _(y,I){I!=!1||!n.multiSelect?(s.value=[y],C()):s.value.includes(y)||(s.value.push(y),C())}function O(y,I){if(I!=!1||!n.multiSelect)s.value=y,C();else{const A=s.value.slice();for(const $ of y)A.includes($)||A.push($);s.value.length<A.length&&(s.value=A,C())}}function j(y){n.multiSelect?s.value=y:s.value=y.slice(0,1),C()}function z(){return s.value}function H(y,I){Array.isArray(n.data)&&y>-1&&mn(n.data,y,I)}function S(){var A;const y=(A=g.value)==null?void 0:A.$el,I=y==null?void 0:y.querySelector("tbody.n-data-table-tbody");if(I&&Array.isArray(n.data)){const $=e.ref(n.data);Yt.useDraggable(I,$,{animation:150,ghostClass:"draging-ghost",handle:".drag-sorting-handle",onUpdate(L){var v;const P=L.oldIndex,Y=L.newIndex;if(P!=null&&Y!=null&&n.data&&P<((v=n.data)==null?void 0:v.length)){const ee=n.data[P];console.log(P,Y,ee==null?void 0:ee.id),r("rowSorting",{oldIndex:P,newIndex:Y,source:ee,updateGrid:()=>H(P,Y)})}}})}}return e.watch(()=>n.data,y=>{const A=y.map($=>$[n.keyField]);s.value=s.value.filter($=>A.includes($)),C()}),e.watch(()=>n.columns,()=>c.value=F()),e.watch(()=>n.height,()=>h.value=f()),e.onMounted(()=>{n.dragSorting&&setTimeout(()=>{S()},500)}),l({selectRow:_,selectRows:O,getSelectedRowKeys:z}),(y,I)=>(e.openBlock(),e.createBlock(e.unref(u.NDataTable),{ref_key:"nTableRef",ref:g,columns:c.value,data:y.data,size:"small","row-key":T,"row-props":x,loading:y.loading,"single-line":!1,"max-height":y.maxHeight,"scroll-x":m.value,striped:"",remote:"","flex-height":y.flexHeight,style:e.normalizeStyle(h.value),"checked-row-keys":s.value,"onUpdate:checkedRowKeys":[I[0]||(I[0]=A=>s.value=A),j],"scrollbar-props":{trigger:"none"},"onUpdate:sorter":I[1]||(I[1]=A=>y.$emit("update:sorter",A))},null,8,["columns","data","loading","max-height","scroll-x","flex-height","style","checked-row-keys"]))}}),Ji={class:"flex-column gap05"},qi={class:"flex-row gap05",style:{"justify-content":"space-between"}},Ze=e.defineComponent({__name:"SearchPanel",props:{title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean},additionQuery:{}},emits:["searchBack","resultSelected"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=W(),i=u.useMessage(),d=e.inject("axios"),m=e.ref(null),c=e.ref(1),s=e.ref(0),g=e.ref(!1),h=e.ref(Array()),f=e.ref(Array());let C=!0;function T(x){if(x){const _=x.rows;_.forEach((O,j)=>{O.__key__=j}),h.value=_,s.value=x.pageCount||1,c.value=x.pageIndex+1}}function B(){h.value=[],s.value=0,c.value=1}function F(x){V(x)}async function V(x){var j,z,H;const _=((j=m.value)==null?void 0:j.pickValues())||{},O=(z=n.config)==null?void 0:z.searchAction;if(_&&O){const S={pageSize:((H=n.config)==null?void 0:H.pageSize)||10,pageIndex:(x||c.value)-1};Object.assign(S,_),n.additionQuery&&(typeof n.additionQuery=="function"?Object.assign(S,n.additionQuery.call(null)):Object.assign(S,n.additionQuery));try{g.value=!0;const y=await d.post(O,S);y.isSuccess&&y.value!=null?(C=!1,T(y.value)):i.error(a(y.errorMessage||"Error"))}catch(y){i.error(y==null?void 0:y.toString())}finally{g.value=!1}}}function w(){const x=f.value;if(x!=null&&x.length){const _=h.value.filter(O=>x.includes(O.__key__));r("searchBack",_,n.config),n.autoClose==!0&&close()}}function N(){n.searchOnMounted&&C&&V(1)}return e.watch(()=>n.config,x=>{x&&(C=!0),B()}),e.onMounted(()=>N()),l({searchPage:V,returnAndClose:w}),(x,_)=>(e.openBlock(),e.createElementBlock("div",Ji,[e.createVNode(Ke,{ref_key:"searchFormRef",ref:m,cols:2,"search-items":x.config.searchFields},null,8,["search-items"]),e.createElementVNode("div",qi,[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:_[0]||(_[0]=()=>V(1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Search")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:_[1]||(_[1]=()=>{var O;return(O=m.value)==null?void 0:O.reset()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Reset")),1)]),_:1})]),e.createVNode(We,{class:"flex-grow-1",style:{height:"200px"},columns:x.config.gridColumns,loading:g.value,data:h.value,multiSelect:x.multiSelect,selectedIds:f.value,"onUpdate:selectedIds":[_[2]||(_[2]=O=>f.value=O),_[3]||(_[3]=(O,j)=>x.$emit("resultSelected",O,j))],onDblclickRow:_[4]||(_[4]=O=>x.$emit("searchBack",[O]))},null,8,["columns","loading","data","multiSelect","selectedIds"]),e.createVNode(e.unref(u.NPagination),{page:c.value,"onUpdate:page":[_[5]||(_[5]=O=>c.value=O),F],"page-count":s.value,"show-quick-jumper":"",style:{"align-self":"self-end"}},null,8,["page","page-count"])]))}}),Ui={key:0,class:"flex-column flex-grow-1"},vi={class:"flex-row",style:{"align-items":"center"}},ec={style:{"margin-left":"0.5em"}},tc={class:"flex-row",style:{"justify-content":"space-between"}},Lt=e.defineComponent({__name:"SearchModal",props:{show:{type:Boolean},width:{},height:{},title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean,default:!1},additionQuery:{}},emits:["searchBack","update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=W(),a=e.ref(void 0);let i=!0;const d=e.ref([]);function m(h,f){d.value=f??[]}function c(h){h&&h.length&&n("searchBack",h,o.config)}function s(){d.value&&d.value.length&&(n("searchBack",d.value,o.config),o.autoClose==!0&&g())}function g(){n("update:show",!1)}return e.watch(()=>o.config,h=>{h&&(i=!0)}),e.watch(a,()=>{var h;o.searchOnMounted&&i&&(i=!1,(h=a.value)==null||h.searchPage(1))}),e.watch(()=>o.show,h=>{var f;h&&o.searchOnMounted&&i&&(i=!1,(f=a.value)==null||f.searchPage(1))}),(h,f)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:h.show,style:e.normalizeStyle({width:h.width??"900px",height:h.height??"650px"}),preset:"card","display-directive":"show","content-class":"flex-column",onClose:f[0]||(f[0]=()=>g())},{header:e.withCtx(()=>[e.createElementVNode("div",vi,[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1}),e.createElementVNode("span",ec,e.toDisplayString(e.unref(r)(h.title)),1)])]),action:e.withCtx(()=>[e.createElementVNode("div",tc,[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:s},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:g},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})])]),default:e.withCtx(()=>[h.config?(e.openBlock(),e.createElementBlock("div",Ui,[e.createVNode(Ze,{ref_key:"searchPanelRef",ref:a,class:"flex-grow-1",config:h.config,"multi-select":h.multiSelect,"auto-close":h.autoClose,"addition-query":h.additionQuery,onResultSelected:m,onSearchBack:c},null,8,["config","multi-select","auto-close","addition-query"])])):e.createCommentVNode("",!0)]),_:1},8,["show","style"]))}}),oc={style:{"margin-bottom":"12px","min-height":"100px"}},Ye=oe(e.defineComponent({__name:"ImportModal",props:{title:{default:"Import File"},multiple:{type:Boolean},action:{},accept:{},show:{type:Boolean},timeout:{},additionParams:{},templateCode:{},templateUrl:{},beforeUpload:{},disabled:{type:Boolean}},emits:["uploaded","update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=W(),a=u.useMessage(),i=u.useLoadingBar(),d=e.inject("axios"),m=ce(),c=e.reactive({}),s=e.ref(!1),g=e.ref(new Array),h=e.ref(!1),f=e.ref(void 0),C=e.ref(T());function T(){if(o.templateUrl)return o.templateUrl;if(o.templateCode)return`/api/core/DataExchangeTemplates/ImportTemplate?templateCode=${o.templateCode}`}async function B(){var N;if(h.value)return a.warning("Is uploading..."),!1;let w=typeof o.action=="function"?o.action.call(void 0):o.action;if(w&&o.templateCode&&(w=U(w,{templateCode:o.templateCode})),(N=g.value)!=null&&N.length&&w){if(!o.multiple&&g.value.length>1)return a.error("Only one file can be uploaded."),!1;if(o.beforeUpload&&o.beforeUpload.call(null,{files:g})==!1)return!1;try{h.value=!0;const x=g.value.filter(_=>_.status=="pending"||_.status=="error").map(_=>F(_,w));await Promise.all(x),g.value.every(_=>_.status=="finished")&&(g.value.length=0,a.success(r("Upload Success.")),s.value=!1)}catch(x){f.value=(x==null?void 0:x.toString())||r("Error")}finally{h.value=!1}}}async function F(w,N){const x=new FormData;x.append("file",w.file);const _={timeout:o.timeout||1e3*60*10,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:j=>{w.percentage=Math.round(j.loaded*100/j.total)}};w.percentage=0,w.status="uploading";let O=N;o.additionParams&&(O=U(N,o.additionParams)),c&&(O=U(O,c));try{const j=await d.post(O,x,_);j.isSuccess?(w.status="finished",n("uploaded",j.value),n("update:show",!1)):(w.status="error",w.errorMessage=j.errorMessage,f.value=r(j.errorMessage||"Error"))}catch(j){w.status="error",w.errorMessage=j==null?void 0:j.toString(),f.value=(j==null?void 0:j.toString())||r("Error")}}async function V(){const w=C.value;if(w)try{i.start(),await me(w)}catch(N){a.error(await m.getHttpErrorMessage(N,"Error"))}finally{i.finish()}}return e.watch(()=>o.show,()=>{f.value=void 0,g.value=[]}),(w,N)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:w.show,"onUpdate:show":N[3]||(N[3]=x=>w.$emit("update:show",x)),preset:"card",title:e.unref(r)(w.title),style:{"max-width":"600px"},draggable:""},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px"},onClick:B,disabled:w.disabled||!w.action||h.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ni))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Upload")),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(u.NSpace),null,{default:e.withCtx(()=>[C.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,style:{"min-width":"100px"},onClick:V},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(vo))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Download Template")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:N[2]||(N[2]=()=>w.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:h.value},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NUpload),{multiple:w.multiple,"default-upload":!1,"file-list":g.value,"onUpdate:fileList":N[0]||(N[0]=x=>g.value=x),accept:w.accept,disabled:!w.action,"show-retry-button":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NUploadDragger),null,{default:e.withCtx(()=>[e.createElementVNode("div",oc,[e.createVNode(e.unref(u.NIcon),{size:"48",depth:3},{default:e.withCtx(()=>[e.createVNode(e.unref(va))]),_:1})]),e.createVNode(e.unref(u.NText),{style:{"font-size":"16px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Click or drag files to this area to upload.")),1)]),_:1})]),_:1})]),_:1},8,["multiple","file-list","accept","disabled"]),e.renderSlot(w.$slots,"options",{options:c},void 0,!0)]),_:3})]),_:3},8,["show"]),f.value?(e.openBlock(),e.createBlock(e.unref(u.NAlert),{key:0,type:"error",class:"my-1",closable:"",onClose:N[1]||(N[1]=()=>f.value=void 0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value),1)]),_:1})):e.createCommentVNode("",!0)]),_:3},8,["show","title"]))}}),[["__scopeId","data-v-18129d6e"]]),zt=e.defineComponent({__name:"InputModal",props:{title:{},message:{},value:{},placeholder:{},maxLength:{},type:{},lines:{},clearable:{type:Boolean},show:{type:Boolean},submitting:{type:Boolean}},emits:["close","commit","update:show","update:value"],setup(t,{emit:l}){var m;const o=t,n=l,{t:r}=W(),a=e.ref((m=o.value)==null?void 0:m.toString()),i=()=>{n("close"),n("update:show",!1)},d=()=>{n("commit",a.value),n("update:value",a.value)};return e.watch(()=>o.value,c=>a.value=c==null?void 0:c.toString()),(c,s)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{title:c.title,show:c.show,preset:"card",style:{width:"400px"},onClose:i},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},loading:c.submitting,onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["loading"]),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:i},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:c.submitting},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.message),1)]),_:1}),e.createVNode(e.unref(u.NInput),{value:a.value,"onUpdate:value":s[0]||(s[0]=g=>a.value=g),placeholder:c.placeholder,maxlength:c.maxLength,type:c.type,rows:c.lines,clearable:c.clearable},null,8,["value","placeholder","maxlength","type","rows","clearable"])]),_:1})]),_:1},8,["show"])]),_:1},8,["title","show"]))}}),nc={key:0,class:"flex-row",style:{"align-items":"center","justify-content":"space-between",gap:"0.25em","margin-bottom":"1em"}},lc={key:1},rc={class:"flex-row gap05"},ac={style:{display:"grid","grid-template-columns":"auto 1fr",gap:"0.5em","align-items":"center"}},sc={class:"flex-row gap05",style:{"justify-content":"space-between"}},kn=200,ic=e.defineComponent({__name:"GridConfigBox",props:{gridId:{},pageSize:{},gridColumns:{}},emits:["close","reset","update:pageSize","update:config"],setup(t,{emit:l}){const o=t,n=l,{t:r}=W(),a=ce(),i=At(["2E2466DDD34847C8B33460E4277A6528"]),d=de.useRouter(),m=e.ref(o.pageSize),c=e.ref(!1),s=e.ref(!1),g=e.ref(void 0),h=e.ref(void 0),f=e.ref(!1),C=e.ref(!1),T=S=>S?S.map((y,I)=>({columnId:y.name,title:y.title?r(y.title):r(te(y.name)),visible:!0,sortIndex:I})).sort((y,I)=>y.sortIndex-I.sortIndex):[],B=e.ref(T(o.gridColumns)),F=()=>{const S=o.gridId;if(!S)return;const I=c.value&&s.value?`/api/core/UserDataGrids/ResetGlobal?dataGridId=${S}`:`/api/core/UserDataGrids/Reset?dataGridId=${S}`;a.confirmToPost("Reset","Are you sure reset the configuration of this data grid?",{url:I,successMessage:"The configuration has been reset, please refresh the page.",success:()=>{n("reset")}})},V=()=>{if(!o.gridId)return;const S={dataGridId:o.gridId,pageSize:m.value,columns:B.value.filter(A=>A.columnId).map(A=>({columnId:A.columnId,visible:A.visible,customTitle:A.customTitle,sortIndex:A.sortIndex}))};S.pageSize&&(S.pageSize=Math.max(1,Math.min(kn,S.pageSize)));const y=c.value&&s.value,I=y?`/api/core/UserDataGrids/SaveGlobal?isDefault=${y}`:`/api/core/UserDataGrids/Save?isDefault=${y}`;a.post({url:I,data:S,successMessage:"The configuration has been saved, please refresh the page.",success:()=>{n("update:pageSize",m.value),n("update:config",S)}})},w=()=>{if(!o.gridId||!B.value.length)return;const S=c.value&&s.value;a.get({url:`/api/core/UserDataGrids/${encodeURIComponent(o.gridId)}?isDefault=${S}`,callback:y=>{if(y){m.value=y.pageSize;for(const I of y.columns){const A=B.value.find($=>$.columnId==I.columnId);A&&(A.visible=I.visible,A.sortIndex=I.sortIndex,A.customTitle=I.customTitle),B.value.sort(($,L)=>$.sortIndex-L.sortIndex)}}else B.value=T(o.gridColumns),m.value=o.pageSize}})},N=()=>{var I;const S=(I=g.value)==null?void 0:I.$el,y=S==null?void 0:S.querySelector("tbody.n-data-table-tbody");y&&B&&Yt.useDraggable(y,B,{animation:150,ghostClass:"draging-ghost",handle:".drag-sorting-handle",onUpdate:()=>{const A=B.value;for(let $=0;$<A.length;$++)A[$].sortIndex=$;console.log(B.value)}})},x=S=>{var y;f.value=!1,h.value&&(h.value.customTitle=S,c.value&&a.post({url:"/api/core/UserDataGrids/UpdateCustomTitleGlobal",data:{dataGridId:o.gridId,columnId:(y=h.value)==null?void 0:y.columnId,customTitle:S}}))},_=()=>{o.gridId&&a.downloadFile({url:`/api/core/UserDataGrids/export?dataGridId=${encodeURIComponent(o.gridId)}`})},O=S=>e.h("div",{class:"flex-row gap05"},[S.customTitle?e.h("span",null,`${S.customTitle} (${S.title})`):e.h("span",null,`${S.title}`),e.h(u.NButton,{text:!0,title:r("Edit"),class:"edit-title-btn",onClick:()=>{h.value=S,f.value=!0}},{default:()=>e.h(u.NIcon,{size:16},{default:()=>e.h(ti)})})]),j=S=>e.h(u.NButton,{text:!0,onClick:y=>{S.visible=!S.visible,y.stopPropagation()}},{default:()=>e.h(u.NIcon,{size:20},{default:()=>S.visible?e.h(Jo):e.h(Xo)})}),z=()=>{var y;const S={dataGridId:o.gridId,pageSize:o.pageSize,columns:(y=o.gridColumns)==null?void 0:y.map(I=>({columnId:I.name,sortIndex:I.sortIndex,visible:I.visible,title:I.title}))};S.dataGridId&&a.post({url:"/api/core/DataGrids/getOrCreate",data:S,success:I=>{I&&d.push({name:"DataGrid",params:{id:I}})}})},H=[{title:r("Name"),key:"title",render:O},{title:r("Visible"),key:"visible",width:80,align:"center",fixed:"right",render:j},{width:30,align:"center",fixed:"right",render:()=>e.h(u.NIcon,{color:"#90A4AE",size:"20",class:"drag-sorting-handle"},{default:()=>e.h(en)})},{key:"empty",width:20,fixed:"right"}];return e.watch(()=>o.gridColumns,()=>B.value=T(o.gridColumns)),e.watch(c,()=>w()),e.watch(B,()=>N()),e.onMounted(()=>{setTimeout(()=>{N()},500),i.checkOnce(S=>{s.value=S["2E2466DDD34847C8B33460E4277A6528"]})}),(S,y)=>{var I;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{"grid-config-global-mode":c.value},"flex-column gap05"])},[s.value?(e.openBlock(),e.createElementBlock("div",nc,[e.createVNode(e.unref(u.NButton),{onClick:z},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("System Default")),1)]),_:1})])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("div",lc,[e.createElementVNode("div",rc,[e.createVNode(e.unref(u.NButton),{onClick:y[0]||(y[0]=()=>C.value=!0)},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{size:"16"},{default:e.withCtx(()=>[e.createVNode(e.unref(gt))]),_:1}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Import")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:_},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{size:"16"},{default:e.withCtx(()=>[e.createVNode(e.unref(ht))]),_:1}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Export")),1)]),_:1})])])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NDataTable),{ref_key:"nTableRef",ref:g,columns:H,data:B.value,"max-height":"60vh",size:"small"},null,8,["data"]),e.createElementVNode("div",ac,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Page Size")),1),e.createVNode(e.unref(u.NInputNumber),{value:m.value,"onUpdate:value":y[1]||(y[1]=A=>m.value=A),max:kn,min:1,style:{"max-width":"200px"}},null,8,["value"])]),e.createVNode(zt,{show:f.value,"onUpdate:show":y[2]||(y[2]=A=>f.value=A),value:((I=h.value)==null?void 0:I.customTitle)??"",title:e.unref(r)("Custom Title"),clearable:"","onUpdate:value":x},null,8,["show","value","title"]),e.createVNode(Ye,{show:C.value,"onUpdate:show":y[3]||(y[3]=A=>C.value=A),action:"/api/UserDataGrids/Import",onUploaded:y[4]||(y[4]=()=>w())},null,8,["show"]),e.createElementVNode("div",sc,[e.createVNode(e.unref(u.NButton),{onClick:V,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Save")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:F,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Reset")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:y[5]||(y[5]=()=>S.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})])],2)}}}),cc=t=>{const l=u.useModal(),{t:o}=W(),n=ce();return{showConfigModal:i=>{const d=t.gridId??i.gridId;if(!d)return;const m=l.create({title:o("Config Data Grid"),preset:"card",contentClass:"flex-column",style:"width: 500px;",draggable:!0,content:()=>e.h(ic,{gridId:d,pageSize:i.pageSize,gridColumns:i.gridColumns,class:"flex-grow-1",onClose:()=>m.destroy(),onReset:()=>{var c;(c=t.onReset)==null||c.call(null),m.destroy()},"onUpdate:pageSize":c=>{var s;c>0&&((s=t.onPageSizeChanged)==null||s.call(null,c))},"onUpdate:config":c=>{var s;(s=t.onConfigChanged)==null||s.call(null,c),m.destroy()}})})},loadGridConfig:i=>{t.gridId&&n.get({url:`/api/core/UserDataGrids/Entity?dataGridId=${encodeURIComponent(t.gridId)}`,callback:d=>{var m;(m=t.onConfigChanged)==null||m.call(null,d),i==null||i.call(null,d)}})}}},dc={class:"flex-column flex-grow-1",style:{gap:"0.25em"}},fc={key:0,class:"flex-row",style:{"justify-content":"space-between"}},uc={style:{"margin-left":"8px"}},pc={style:{display:"flex"}},mc={style:{"flex-grow":"1"}},bn=e.defineComponent({__name:"HaloForm",props:{name:{},autoLoad:{type:Boolean,default:!0},columns:{},keys:{default:"id"},allowNew:{type:Boolean,default:!0},allowEdit:{type:Boolean,default:!0},searchAction:{},getListAction:{},getEntityAction:{},initEntityAction:{},deleteAction:{},deleteBatchAction:{},deleteMethod:{default:"DELETE"},saveAction:{},exportAction:{},importAction:{},detailsPage:{},detailsPageName:{},detailsKeys:{},dataExchangeCode:{},exportFormats:{},exportRanges:{},exportOptions:{},importOptions:{},importTimeout:{},importTemplateCode:{},gridMaxHeight:{},gridHeight:{},gridCheckable:{type:Boolean,default:!0},gridDragSorting:{type:Boolean},chainCreating:{type:Boolean,default:!0},readOnly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},pageSize:{default:20},multiSelect:{type:Boolean,default:!0},quickSearch:{type:Boolean,default:!0},gridFlexHeight:{type:Boolean,default:!0},parentKey:{},parentValue:{},verifyParentKey:{type:[Boolean,Function]},selectedId:{},selectedIds:{},modalColumns:{},modalStyle:{},formGroupLayout:{},enctype:{},batchAdds:{},beforeSave:{},defaultSearchArgs:{},extendedMenus:{},additionKeys:{},searchGroupOptions:{},defaultSortBy:{},defaultSortDirection:{},propertyModal:{}},emits:["update:selectedIds","update:selectedId","update:data","columnButtonClick","saved","beforeShow","itemChange","commitEdit","extendedMenuSelect","beforeRenderPage","searchReturn","rowSorting"],setup(t,{expose:l,emit:o}){var pl;const n=t,r=o,{t:a}=W(),i=e.inject("axios"),d=e.ref(Array()),m=u.useDialog(),c=u.useMessage(),s=u.useLoadingBar(),g=de.useRouter(),h=e.ref(sn(n.columns||[],a)),f=e.ref(Be(n.columns||[])),C=e.ref(cn(n.columns||[],a));let T=1;const B=e.ref(1),F=e.ref(0),V=e.ref(0),w=e.ref(n.pageSize),N=e.ref(!0),x=e.ref(!1),_=e.ref(!1),O=e.ref(""),j=e.ref(n.searchAction&&((pl=n.columns)==null?void 0:pl.some(p=>Ie(p)&&p.search))),z=e.ref(j.value&&!n.getListAction),H=e.ref(z.value&&!0),S=e.ref(!1),y=e.ref(null),I=e.ref(null),A=e.ref(new Array),$=e.ref(!1),L=e.ref(void 0),P=e.ref(void 0),Y=e.ref(void 0),v=e.ref(!1),ee=e.ref(n.readOnly),ne=e.ref(a("Property")),le=e.ref(!1),Z=e.ref(!1);let ae;const K=e.ref([]),Rt=e.ref(jt("page")),Zn=e.ref(rd()),Ot=e.ref(void 0),he=e.ref([]),Me=e.ref(void 0),Xe=e.ref(!1);let ye;const Yn=e.ref(void 0),we=e.ref(void 0),Te=e.ref(void 0);let $e=[],De=0;const ld=e.ref({width:ad(n.modalColumns)});function rd(){var k;const p={};if(n.defaultSearchArgs)for(const b in n.defaultSearchArgs)p[b]=n.defaultSearchArgs[b];return(k=C.value)==null||k.forEach(b=>{b.defaultValue!=null&&(b.searchMethod=="range"?Array.isArray(b.defaultValue)&&(b.defaultValue.length>0&&b.defaultValue[0]!=null&&(p[`${b.name}From`]=b.defaultValue[0]),b.defaultValue.length>1&&b.defaultValue[1]!=null&&(p[`${b.name}To`]=b.defaultValue[1])):p[b.name]=b.defaultValue)}),p}function jt(p){return n.exportRanges&&n.exportRanges.length&&!n.exportRanges.includes(p)?n.exportRanges[0]:p}function ad(p){return p?p>4?"100%":p>1?450*p+"px":"600px":"600px"}function Je(p){if(n.keys){if(typeof n.keys=="string")return p[n.keys];if(n.keys.length==1&&typeof n.keys[0]=="string")return p[n.keys[0]];if(n.keys.length>1)return n.keys.map(k=>p[k]).join()}return""}function qe(p){if(p.__key__=Je(p),n.columns)for(const k of n.columns){let b;if(typeof k=="string")b=k;else if(Ie(k))b=k.name;else continue;b&&!(b in p)&&(p[b]=null)}}function Qn(p){if(p){r("beforeRenderPage",{data:p});const b=p.rows;b.forEach(E=>qe(E)),d.value=b,r("update:data",d.value),V.value=p.totalRecords||0,F.value=p.pageCount||1,B.value=p.pageIndex+1,N.value=!0}}function Xn(p){if(p){const k={data:p};r("beforeRenderPage",k),p=k.data,p.forEach(b=>qe(b)),d.value=p,r("update:data",d.value),F.value=1,B.value=1,N.value=!1}}async function ue(p){var k,b;if(!(x.value||n.disabled)&&n.getListAction){const E={pageSize:w.value,pageIndex:p},D=(k=O.value)==null?void 0:k.trim();if(n.quickSearch&&D&&(E.searchWords=D),n.additionKeys&&Object.assign(E,n.additionKeys),n.parentKey&&!se(E))return;(we.value||n.defaultSortBy)&&(E.sortBy=we.value??n.defaultSortBy,E.sortDirection=Te.value??n.defaultSortDirection);try{x.value=!0;let G=n.getListAction;typeof G=="function"&&(G=G.call(void 0));const X=U(G,E),R=await i.get(X);R!=null&&R.isSuccess&&R.value?(De++,R.value&&(Array.isArray(R.value)?Xn(R.value):Qn(R.value))):c.error(a((R==null?void 0:R.errorMessage)??((b=R==null?void 0:R.value)==null?void 0:b.toString())??"Error"))}catch(G){c.error((G==null?void 0:G.toString())??a("Error")),console.error(G)}finally{x.value=!1}}}function Re(p){if(!n.disabled)if(H.value&&ye){const k=Object.assign({},ye);k.sortBy=we.value,k.sortDirection=Te.value,Ht(k)}else p!=null?ue(p):ue(B.value-1)}function Ft(){ue(0)}function sd(){O.value="",ue(0)}function id(p){if(n.additionKeys)for(const k in n.additionKeys){const b=n.additionKeys[k];b!=null&&(p[k]=b)}}function Jn(){if(!n.parentKey||!n.verifyParentKey)return!0;if(n.verifyParentKey==!0)return!(n.parentValue==null||Array.isArray(n.parentKey)&&Array.isArray(n.parentValue)&&n.parentValue.some(p=>p==null));if(typeof n.verifyParentKey=="function"){const p=n.verifyParentKey({key:n.parentKey,value:n.parentValue});if(typeof p=="boolean")return p}return!0}function se(p){if(n.verifyParentKey&&Jn()==!1)return!1;if(n.parentKey){const k={};if(Array.isArray(n.parentKey))if(Array.isArray(n.parentValue))for(let b=0;b<n.parentKey.length;b++){const E=n.parentKey[b];(typeof E=="string"||typeof E=="number")&&n.parentValue.length>b&&(k[E]=n.parentValue[b])}else for(let b=0;b<n.parentKey.length;b++){const E=n.parentKey[b];(typeof E=="string"||typeof E=="number")&&(k[E]=n.parentValue)}else n.parentKey&&(k[n.parentKey]=n.parentValue);p&&Object.assign(p,k)}return!0}async function Pt(){var k;if(n.disabled)return;const p=(k=y.value)==null?void 0:k.pickValues();if(p&&n.searchAction){const b={};Object.assign(b,p),id(b),b.pageSize=w.value,b.pageIndex=0,b.sortBy=we.value??n.defaultSortBy,b.sortDirection=Te.value??n.defaultSortDirection,b.groupBy=Ot.value,Ht(b)}}async function Ht(p){if(!x.value)try{x.value=!0;let k=n.searchAction;if(typeof k=="function"&&(k=k.call(void 0,p)),!k)return;const b={};if(!se(b))return;k=U(k,b);const E=await i.post(k,p);E.isSuccess&&E.value!=null?(De++,ye=p,r("searchReturn",{data:E.value,query:p,action:k}),Array.isArray(E.value)?Xn(E.value):Qn(E.value)):c.error(a(E.errorMessage||"Error"))}catch(k){c.error(k==null?void 0:k.toString())}finally{x.value=!1}}function qn(p,k){const b={};if(se(b)){if(typeof n.keys=="string"?b[n.keys]=p[n.keys]:n.keys.forEach(D=>b[D]=p[D]),Array.isArray(n.detailsKeys))n.detailsKeys.map(D=>D.toString()).forEach(D=>b[D]=p[D]);else if(typeof n.detailsKeys=="object"){const D=n.detailsKeys;for(const G in D){var E=D[G];E&&(b[G]=p[E])}}else typeof n.detailsKeys=="function"?n.detailsKeys.call(null,b):n.detailsKeys&&(b[n.detailsKeys]=p[n.detailsKeys]);if(n.detailsPageName)g.push({name:n.detailsPageName,params:b});else if(n.detailsPage)if(typeof n.detailsPage=="function"){const D=n.detailsPage(p,k);(typeof D=="string"||typeof D=="object")&&g.push(D)}else g.push({path:n.detailsPage,query:b})}}async function Gt(p,k){var b;if(!n.disabled)if(n.getEntityAction){const E={};if(n.additionKeys&&Object.assign(E,n.additionKeys),!se(E))return;typeof n.keys=="string"?E[n.keys]=p[n.keys]:n.keys.forEach(D=>E[D]=p[D]);try{let D=n.getEntityAction;typeof D=="function"&&(D=D.call(void 0,p,k));const G=U(D,E),X=await i.get(G);X.isSuccess&&X.value!=null?Ue(X.value,n.readOnly||!n.saveAction||!n.allowEdit?"view":"edit"):c.error(a((X==null?void 0:X.errorMessage)??((b=X==null?void 0:X.value)==null?void 0:b.toString())??"Error"))}catch(D){c.error((D==null?void 0:D.toString())??a("Error")),console.error(D)}}else Ue(p,n.readOnly||!n.saveAction||!n.allowEdit?"view":"edit")}function Kt(p,k){n.readOnly||n.disabled||n.deleteAction&&p&&p.__key__&&m.warning({title:a("Delete"),content:a("Are you sure you want to delete this row?"),positiveText:a("Delete"),negativeText:a("Cancel"),onPositiveClick:()=>{cd(p,k)}})}async function cd(p,k){var b;if(n.deleteAction&&n.keys.length)try{const E={};if(n.additionKeys&&Object.assign(E,n.additionKeys),!se(E))return;typeof n.keys=="string"?E[n.keys]=p[n.keys]:n.keys.forEach(q=>E[q]=p[q]);const D=p.__key__;let G=n.deleteAction;typeof G=="function"&&(G=G.call(void 0,p,k));const X=U(G,E);let R;if(n.deleteMethod=="POST"?R=await i.post(X):R=await i.delete(X),R.isSuccess){let q=d.value.indexOf(p);if(q>-1&&(d.value.splice(q,1),c.success(a("The data has been deleted."))),A.value&&(q=A.value.findIndex(Q=>Q==D),q>-1)){A.value.splice(q,1);const Q=(b=d.value)==null?void 0:b.filter(_d=>A.value.includes(_d["__key__]"]));r("update:selectedIds",A.value,Q),A.value.length?r("update:selectedId",A.value[0],Q!=null&&Q.length?Q[0]:void 0):r("update:selectedId",void 0,void 0)}}else c.error(a(R.errorMessage||"Error"))}catch(E){console.error(E),c.error(E==null?void 0:E.toString())}}function dd(p){n.readOnly||n.disabled||n.deleteBatchAction&&p&&p.length&&m.warning({title:a("Delete"),content:a("Are you sure you want to delete selected rows?"),positiveText:a("Delete"),negativeText:a("Cancel"),onPositiveClick:()=>{fd(p)}})}async function fd(p){if(n.deleteBatchAction&&p.length)try{const k={ids:p.join()};if(n.additionKeys&&Object.assign(k,n.additionKeys),!se(k))return;let b=n.deleteBatchAction;typeof b=="function"&&(b=b.call(void 0));const E=U(b,k);let D;if(n.deleteMethod=="POST"?D=await i.post(E):D=await i.delete(E),D.isSuccess){for(const G of p){const X=d.value.findIndex(R=>R.__key__==G);X>-1&&d.value.splice(X,1)}A.value=A.value.filter(G=>!p.includes(G)),c.success(a("The data has been deleted."))}else c.error(a(D.errorMessage||"Error"))}catch(k){c.error(k),console.error(k==null?void 0:k.toString())}}function Un(){if(A.value.length){const p=d.value.find(k=>k.__key__==A.value[0]);p&&Gt(p,d.value.indexOf(p))}}function vn(){if(A.value.length>1&&n.deleteBatchAction)dd(A.value);else if(A.value.length){const p=d.value.find(k=>k.__key__==A.value[0]);p&&Kt(p,d.value.indexOf(p))}}function Ue(p,k){const b={method:k,original:p,value:an(p,h.value)};switch(r("beforeShow",b),Y.value=p,L.value=b.value,P.value=k,v.value=!0,ee.value=k!="create"&&k!="edit",k){case"create":ne.value=a("New");break;case"edit":ne.value=a("Edit");break;default:ne.value=a("Property");break}}function el(){Y.value=void 0,L.value=void 0,P.value=void 0,v.value=!1,ne.value=a("Property")}async function Wt(){var p;if(!(n.readOnly||n.disabled||!n.saveAction))if(n.initEntityAction){let k=n.initEntityAction;typeof k=="function"&&(k=k.call(void 0));let b=k;const E={};if(n.additionKeys&&Object.assign(E,n.additionKeys),!se(E))return;b=U(b,E);try{const D=await i.get(b);D!=null&&D.isSuccess&&D.value?Ue(D.value||{},"create"):c.error(a((D==null?void 0:D.errorMessage)??((p=D==null?void 0:D.value)==null?void 0:p.toString())??"Error"))}catch(D){c.error(a((D==null?void 0:D.toString())??"Error")),console.error(D)}}else{const k=ln(h.value);Ue(k,"create")}}async function ud(p,k){var D;if(n.readOnly||n.disabled)return;const b=Me.value;if(!b||b.searchConfig!=k||!b.actionUrl)return;let E;if(b.dataBuilder)E=b.dataBuilder(p);else{let G;if(b.keyPicker?G=b.keyPicker(p):G=p.map(X=>X.id),!G||!G.length)return;E={},E[b.keyName||"ids"]=G}if(E){let G=b.actionUrl;n.additionKeys&&Object.assign(E,n.additionKeys);const X={};se(X)&&(G=U(G,X),Object.assign(E,X));try{const R=await i.post(G,E);if(R.isSuccess){if(R.value){for(const Q of R.value)ve(Q);const q=R.value.map(Q=>Je(Q));(D=I.value)==null||D.selectRows(q),Xe.value=!1}}else c.error(a(R.errorMessage||"Error"))}catch(R){c.error(a((R==null?void 0:R.toString())||"Error")),console.error(R)}}}function tl(p){Me.value=p,Xe.value=!0}function pd(p){const k=h.value;if(!k||!k.length)return!1;k.forEach(b=>{b.validationStatus=void 0,b.errorMessage=void 0});for(const b of k)b.nullable===!1&&!b.readonly&&(p[b.name]==null||p[b.name]===null||!b.dataType&&(p[b.name]==null||p[b.name]==null)?(b.validationStatus="error",b.errorMessage=a("Required here.")):(b.validationStatus="success",b.errorMessage=void 0));return!k.some(b=>b.validationStatus=="error"||b.validationStatus=="warning")}function md(){if(n.readOnly||n.disabled)return;const p=h.value;if(!p||!p.length)return;const k=P.value;if(k!="create"&&k!="edit")return;const b=L.value,E=Y.value;if(b&&E){const D=Object.assign({},E);for(let G of p){if(G.readonly==!0||Array.isArray(G.readonly)&&G.readonly.includes(k))continue;let X=je(b[G.name],G.dataType,G.role);D[G.name]=X}if(r("commitEdit",{data:D,current:b,original:E,method:k}),n.beforeSave&&n.beforeSave(D,k)===!1)return;pd(D)?ol({data:D,original:E,method:k}):c.error(a("Form validation failed."))}}async function ol(p){var k;if(!(n.readOnly||n.disabled||!n.saveAction))try{let b;const E={};if(n.additionKeys)for(const q in n.additionKeys)n.additionKeys[q]!=null&&(p.data[q]=n.additionKeys[q]);const D={};if(!se(D))return;if(Object.assign(p.data,D),n.enctype=="multipart/form-data"){b=new FormData;const q=Object.keys(p.data);for(const Q of q)p.data[Q]&&b.set(Q,p.data[Q]);E["Content-Type"]="multipart/form-data"}else b=p.data,E["Content-Type"]="application/json;charset=utf-8";let G=n.saveAction;typeof G=="function"&&(G=G.call(void 0));let X=U(G,D);_.value=!0;const R=await i.post(X,b,{headers:E});if(R.isSuccess){if(c.success(a("The data is saved.")),R.value){p.method=="create"?ve(R.value):p.method=="edit"&&nl(R.value),(k=I.value)==null||k.selectRow(Je(R.value)),p.method=="create"&&n.chainCreating?Wt():el();try{r("saved",{value:R.value,method:p.method})}catch(q){console.error("emit(saved) fail."+(q==null?void 0:q.toString()))}}}else c.error(a(R.errorMessage||"Error")),R.errors&&hd(h.value,R.errors)}catch(b){c.error((b==null?void 0:b.toString())||a("Error")),console.error(b)}finally{_.value=!1}}function hd(p,k){if(p&&p.length)for(const b of k){const E=p.find(D=>D.name.toLowerCase()==b.key.toLowerCase());E&&(E.validationStatus="error",E.errorMessage=b.value)}}function ve(p){qe(p);const k=p.__key__,b=d.value.findIndex(E=>E.__key__==k);b>-1?d.value.splice(b,1,p):d.value.push(p)}function nl(p){qe(p);const k=p.__key__,b=d.value.find(E=>E.__key__==k);if(b)for(const E in p)b[E]=p[E]}function gd(p){if(H.value&&ye){const k=Object.assign({},ye);k.pageIndex=Math.max(0,p-1),Ht(k)}else p>0?ue(p-1):ue(0)}function yd(p){p&&(w.value=p)}function wd(p,k){A.value=p,r("update:selectedIds",p,k),r("update:selectedId",p.length?p[0]:void 0,k.length?k[0]:void 0)}async function Cd(p,k){n.exportAction?await kd(p,k)&&(le.value=!1):n.dataExchangeCode&&(rl(p,k),le.value=!1)}function ll(p,k,b){const E={outputType:p,dataRange:k,searchArgs:JSON.stringify(ye)};if(n.importTemplateCode&&(E.templateCode=n.importTemplateCode),!ye&&(n.additionKeys||n.parentKey)){const D={pageSize:w.value,pageIndex:B.value,sortBy:we.value,sortDirection:Te.value};n.additionKeys&&Object.assign(D,n.additionKeys),se(D),E.searchArgs=JSON.stringify(D)}switch(b&&Object.assign(E,b),k){case"selection":if(!A.value||!A.value.length)throw a("Please select the rows to be exported.");E.selectedKeys=A.value;break;case"page":E.pageSize=w.value,E.pageIndex=Math.max(0,B.value-1);break}return E}async function kd(p,k){let b=n.exportAction;if(typeof b=="function"&&(b=b.call(void 0)),b){try{if(!Jn())return console.log("Invalid parent key."),!1;const E=ll(p,k,n.exportOptions);se(E),s.start(),b=U(b,E),await me(b)}catch(E){console.log(E),c.error((E==null?void 0:E.toString())||a("Error"))}finally{s.finish()}return!0}else return!1}function bd(){n.importAction&&($.value=!0)}async function Nd(){const p=n.importTemplateCode;if(p){const k=`/api/core/DataExchangeTemplates/ImportTemplate?templateCode=${p}`;try{s.start(),await me(k)}finally{s.finish()}}}async function rl(p,k,b=!1){var q;const E=n.dataExchangeCode;if(!E)return;if(k.toLowerCase()=="empty"){const Q=`/api/core/dataExchange/importTemplate?templateCode=${E}&engineName=${p}`;try{s.start(),await me(Q)}finally{s.finish()}return}const D={name:E,engineName:p,dataRange:k};n.importTemplateCode&&(D.templateCode=n.importTemplateCode);const G={pageSize:w.value,pageIndex:B.value-1};switch(k.toLowerCase()){case"empty":G.pageSize=0,G.pageIndex=0;break;case"all":G.pageSize=2e3,G.pageIndex=0;break}if(!se(G)){console.log("Invalid parent key.");return}let X=n.exportAction||n.getListAction;typeof X=="function"&&(X=X.call(void 0));let R=X;if(b)try{const Q=await i.post("/api/core/tempData/add",{value:JSON.stringify(D)});if(Q.isSuccess){if(G.exportOptionId=Q.value,R){R=U(R,G);try{s.start(),await me(R)}finally{s.finish()}}}else c.error((Q==null?void 0:Q.errorMessage)??((q=Q==null?void 0:Q.value)==null?void 0:q.toString())??a("Error"))}catch(Q){c.error((Q==null?void 0:Q.toString())??a("Error")),console.error(Q)}else if(G.exportOption=btoa(JSON.stringify(D)),R){R=U(R,G);try{s.start(),await me(R)}finally{s.finish()}}}function al(p){if(p)switch(p){case"menu_export_action":A.value&&A.value.length?Rt.value=jt("selection"):Rt.value=jt("page"),le.value=!0;break;case"menu_export_template_action":Nd();break;case"menu_import_action":bd();break;case"menu_export":le.value=!0;break;case"menu_export_template":rl("Excel","Empty");break;case"menu_import":break;default:{const k=$e.find(b=>b.key==p);k&&sl(k)}break}}function sl(p){var E;const k=A.value,b={selectedId:k!=null&&k.length?k[0]:void 0,selectedIds:k?[...k]:void 0,data:d.value};typeof p!="string"&&((E=p.click)==null||E.call(null,b)),r("extendedMenuSelect",b)}function xd(p){const k=[];n.exportAction&&k.push({label:a("Export")+"…",key:"menu_export_action",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(ht)})}),n.importTemplateCode&&k.push({label:a("Download Template")+"…",key:"menu_export_template_action"}),n.importAction&&!n.readOnly&&k.push({label:a("Import"),key:"menu_import_action",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(gt)})}),n.dataExchangeCode&&(k.push({label:a("Export")+"…",key:"menu_export",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(ht)})}),k.push({label:a("Export Template"),key:"menu_export_template"}),n.readOnly||(k.push({type:"divider",key:"------------1"}),k.push({label:a("Import"),key:"menu_import",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(gt)})}))),p&&p.length&&(k.push({type:"divider",key:"----------e--1"}),p.forEach(b=>{const E={label:b.label,key:b.key};b.icon?E.icon=kt(b.icon):b.renderIcon&&(E.icon=b.renderIcon),k.push(E)})),K.value=k}const il=cc({gridId:n.name,onConfigChanged:p=>Zt(p),onPageSizeChanged:p=>w.value=p,onReset:()=>Id});il.loadGridConfig();const Zt=(p,k)=>{if(p){ae=p,w.value=p.pageSize,k||(k=[...f.value]),k.forEach(b=>{b.sortIndex=99999});for(const b of p.columns){const E=k.find(D=>D.name==b.columnId);E&&(E.visible=b.visible,E.sortIndex=b.sortIndex,b.title&&(E.title=b.title))}k.sort((b,E)=>(b.sortIndex||0)-(E.sortIndex||0)),f.value=k}};function Sd(p){p?Zt(p):(f.value=Be(n.columns||[]),w.value=n.pageSize||20),Z.value=!1}const Id=()=>{f.value=Be(n.columns||[]),w.value=n.pageSize||20},Bd=()=>{n.name&&il.showConfigModal({gridId:n.name,gridColumns:f.value,pageSize:w.value})};function Vd(p,k){var b;for(const E of p)ve(E);if(k){const E=p.map(D=>Je(D));(b=I.value)==null||b.selectRows(E)}}function cl(p){if(!p)return;const k=$e==null?void 0:$e.find(b=>b.key==p);k&&sl(k)}function Md(p){var k,b;Array.isArray(p)?(we.value=(k=p[0].columnKey)==null?void 0:k.toString(),Te.value=p[0].order=="ascend"?"Asc":"Desc"):p&&(we.value=(b=p.columnKey)==null?void 0:b.toString(),Te.value=p.order=="ascend"?"Asc":"Desc"),Re()}function dl(){const p=new Array;if(n.extendedMenus)for(const b of n.extendedMenus)typeof b=="string"?p.push({label:a(b),key:T++}):(b.key||(b.key=T++),p.push(b));$e=p,Td(p);const k=p.filter(b=>b.group=="import"||b.group=="export");xd(k)}function Td(p){if(p){const k=p.filter(b=>!b.group).map(b=>b.label=="-"?{type:"divider"}:b.icon?{label:b.label,key:b.key,icon:kt(b.icon)}:b.renderIcon?{label:b.label,key:b.key,icon:b.renderIcon()}:{label:b.label,key:b.key});he.value=k}else he.value=[]}function fl(){const p={};return n.parentKey&&se(p),n.additionKeys&&Object.assign(p,n.additionKeys),p}function ul(){const p=Object.assign({},fl(),n.importOptions);Yn.value=Object.keys(p).length?p:void 0}function Ad(){z?S.value=!S.value:S.value=!1}return e.onMounted(()=>{ul(),n.autoLoad!=!1&&(z.value?n.autoLoad&&Pt():ue(0)),dl()}),e.watch(e.computed(fl),(p,k)=>{JSON.stringify(p)!=JSON.stringify(k)&&(ul(),n.autoLoad!=!1&&De>0&&Re())}),e.watch(()=>n.extendedMenus,()=>dl()),e.watch(()=>n.parentValue,()=>{(n.autoLoad!=!1||De>0)&&ue(0)}),e.watch(()=>n.getListAction,(p,k)=>{k&&(n.autoLoad!=!1||De>0)&&ue(0)}),e.watch(w,(p,k)=>{if(p&&k){var b=void 0,E=B.value,D=V.value;if(E>0&&D){const G=Math.ceil(D/p);G<E&&(b=Math.max(0,G-1))}Re(b)}}),e.watch(()=>n.columns,()=>{const p=Be(n.columns||[]);ae?Zt(ae,p):f.value=p}),l({reloadPage:Re,addRow:Wt,addBatch:tl,editSelectedRow:Un,deleteSelectedRows:vn,saveData:ol,doQuickSearch:Ft,clearQuickSearch:sd,advancedSerach:Pt,checkedRowKeys:A,editRow:Gt,deleteRow:Kt,showDetails:qn,insertRow:ve,updateRow:nl,appendRows:Vd,buildExportArgs:ll}),(p,k)=>{var b,E,D,G,X;return e.openBlock(),e.createElementBlock("div",dc,[e.renderSlot(p.$slots,"header"),z.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",fc,[e.createVNode(e.unref(u.NButtonGroup),null,{default:e.withCtx(()=>[e.renderSlot(p.$slots,"prefix-tools"),p.readOnly?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(p.batchAdds,R=>(e.openBlock(),e.createBlock(e.unref(u.NButton),{onClick:()=>tl(R),disabled:p.readOnly||p.disabled,key:R.id},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#388e3c"},{default:e.withCtx(()=>[e.createVNode(e.unref(Wa))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)(R.label||"Batch Add")),1)]),_:2},1032,["onClick","disabled"]))),128)),p.saveAction&&!p.readOnly&&p.allowNew?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:1,onClick:Wt,disabled:p.readOnly||p.disabled},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#388e3c"},{default:e.withCtx(()=>[e.createVNode(e.unref(js))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("New")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),p.saveAction&&!p.readOnly&&p.allowEdit?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:2,onClick:Un,disabled:p.readOnly||p.disabled||!A.value.length},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#5c6bc0"},{default:e.withCtx(()=>[e.createVNode(e.unref(Po))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Edit")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),(p.deleteAction||p.deleteBatchAction)&&!p.readOnly?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:3,onClick:vn,disabled:p.readOnly||p.disabled||!A.value.length},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#f44336"},{default:e.withCtx(()=>[e.createVNode(e.unref(Fo))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Delete")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NButton),{onClick:k[0]||(k[0]=()=>Re()),disabled:p.disabled},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#689f38"},{default:e.withCtx(()=>[e.createVNode(e.unref(dt))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Refresh")),1)]),_:1},8,["disabled"]),e.renderSlot(p.$slots,"suffix-tools"),K.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:4,options:K.value,disabled:p.disabled,onSelect:al},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#009688"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ea))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Import/Export"))+" ",1),e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ze))]),_:1})]),_:1})]),_:1},8,["options","disabled"])):e.createCommentVNode("",!0),he.value&&he.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:5,options:he.value,disabled:p.disabled,onSelect:cl},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5"},{default:e.withCtx(()=>[e.createVNode(e.unref(ct))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Advanced"))+" ",1),e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ze))]),_:1})]),_:1})]),_:1},8,["options","disabled"])):e.createCommentVNode("",!0)]),_:3}),e.renderSlot(p.$slots,"tools"),p.quickSearch?(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),{key:0,class:"flex-row quick-search-box",style:{width:"inherit"}},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref(u.NInput),{class:"flex-grow-1",style:{width:"260px"},value:O.value,"onUpdate:value":k[1]||(k[1]=R=>O.value=R),placeholder:e.unref(a)("Quick Search"),clearable:"",onChange:Ft},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),_:1},8,["value","placeholder"]),[[e.vShow,!H.value]]),e.withDirectives(e.createVNode(e.unref(u.NButton),{title:e.unref(a)("Search"),onClick:k[2]||(k[2]=()=>Ft()),style:{padding:"0 8px"}},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),_:1},8,["title"]),[[e.vShow,!H.value]]),j.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,title:e.unref(a)("More"),style:{padding:"0 8px"},onClick:k[3]||(k[3]=()=>H.value=!H.value)},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[H.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(Ia),{key:0})),H.value?(e.openBlock(),e.createBlock(e.unref(xa),{key:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0)])),e.renderSlot(p.$slots,"neck"),j.value?e.withDirectives((e.openBlock(),e.createBlock(e.unref(u.NCard),{key:1,size:"small",hoverable:"",closable:!z.value,onClose:k[8]||(k[8]=()=>H.value=!1)},{header:e.withCtx(()=>[e.createElementVNode("div",{class:"flex-row",style:e.normalizeStyle([{"align-items":"center"},{cursor:z.value?"pointer":"unset"}]),onClick:Ad},[e.createVNode(e.unref(u.NIcon),{size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1}),e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Search"))+" ",1),e.withDirectives(e.createElementVNode("span",uc," … ",512),[[e.vShow,S.value]])],4)]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px"},onClick:Pt},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Search")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:k[6]||(k[6]=()=>{var R;return(R=y.value)==null?void 0:R.reset()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Reset")),1)]),_:1}),K.value.length==1&&z.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,style:{"min-width":"100px"},onClick:k[7]||(k[7]=()=>le.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Export")),1)]),_:1})):e.createCommentVNode("",!0),K.value.length>1&&z.value?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:1,options:K.value,onSelect:al},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Export")),1)]),_:1})]),_:1},8,["options"])):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"search-tools"),z.value&&he.value&&he.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:2,options:he.value,onSelect:cl},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5"},{default:e.withCtx(()=>[e.createVNode(e.unref(ct))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Advanced"))+" ",1),e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ze))]),_:1})]),_:1})]),_:1},8,["options"])):e.createCommentVNode("",!0)]),_:3})]),_:3})]),default:e.withCtx(()=>[e.withDirectives(e.createVNode(Ke,{"search-items":C.value,ref_key:"searchFormRef",ref:y,"search-args":Zn.value,"onUpdate:searchArgs":k[4]||(k[4]=R=>Zn.value=R),"group-options":p.searchGroupOptions,"group-by":Ot.value,"onUpdate:groupBy":k[5]||(k[5]=R=>Ot.value=R)},null,8,["search-items","search-args","group-options","group-by"]),[[e.vShow,!S.value]])]),_:3},8,["closable"])),[[e.vShow,H.value]]):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"grid",{data:d.value,columns:f.value,loading:x.value,style:"background-color: chartreuse;"},()=>[e.createVNode(We,{ref_key:"dataGridRef",ref:I,data:d.value,columns:f.value,loading:x.value,class:"halo-form-grid flex-grow-1",style:{height:"80px","min-height":"80px"},"drag-sorting":p.gridDragSorting,"flex-height":p.gridFlexHeight,"with-edit":!!p.saveAction&&!p.readOnly&&p.allowEdit,"with-delete":(!!p.deleteAction||!!p.deleteBatchAction)&&!p.readOnly,"with-details":!!p.detailsPage||!!p.detailsPageName,"multi-select":p.multiSelect,"max-height":p.gridMaxHeight,height:p.gridHeight,checkable:p.gridCheckable,onEditRow:Gt,onDeleteRow:Kt,onShowDetails:qn,"onUpdate:selectedIds":wd,onColumnButtonClick:k[9]||(k[9]=(R,q,Q)=>p.$emit("columnButtonClick",R,q,Q)),"onUpdate:sorter":k[10]||(k[10]=R=>Md(R)),onRowSorting:k[11]||(k[11]=R=>p.$emit("rowSorting",R))},null,8,["data","columns","loading","drag-sorting","flex-height","with-edit","with-delete","with-details","multi-select","max-height","height","checkable"])]),e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[N.value?(e.openBlock(),e.createBlock(e.unref(u.NPagination),{key:0,page:B.value,"onUpdate:page":[k[12]||(k[12]=R=>B.value=R),gd],"item-count":V.value,"page-size":w.value,"page-sizes":[10,20,30,40,50,100],"show-quick-jumper":"","show-size-picker":"","onUpdate:pageSize":yd},{suffix:e.withCtx(({startIndex:R,endIndex:q,itemCount:Q})=>[Q?(e.openBlock(),e.createBlock(e.unref(u.NText),{key:0,italic:"",depth:"3"},{default:e.withCtx(()=>[e.createTextVNode("["+e.toDisplayString(R+1)+"~"+e.toDisplayString(q+1)+"] / "+e.toDisplayString(Q),1)]),_:2},1024)):e.createCommentVNode("",!0)]),_:1},8,["page","item-count","page-size"])):e.createCommentVNode("",!0),p.name?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:1,text:"",onClick:k[13]||(k[13]=()=>Bd())},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(vs))]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.renderSlot(p.$slots,"default"),e.renderSlot(p.$slots,"bottom",{formItems:h.value,currentData:L.value,list:d.value,selectedKeys:A.value}),e.createVNode(e.unref(u.NModal),{class:"custom-card",show:v.value,"onUpdate:show":k[15]||(k[15]=R=>v.value=R),preset:"card",draggable:"",style:e.normalizeStyle([ld.value,p.modalStyle]),title:ne.value,"close-on-esc":!1,"mask-closable":!1},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[P.value=="create"||P.value=="edit"?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,onClick:md,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Save")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NButton),{onClick:el,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Close")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:_.value},{default:e.withCtx(()=>[e.createElementVNode("div",pc,[e.createElementVNode("div",null,[e.renderSlot(p.$slots,"entity-form-left",{data:L.value,original:Y.value,method:P.value})]),e.createElementVNode("div",mc,[e.renderSlot(p.$slots,"entity-form",{formItems:h.value,data:L.value,original:Y.value,method:P.value},()=>[e.createVNode(Vt,{"form-items":h.value,columns:p.modalColumns,data:L.value,original:Y.value,method:P.value,"group-layout":p.formGroupLayout,"read-only":ee.value,onItemChange:k[14]||(k[14]=R=>p.$emit("itemChange",R))},null,8,["form-items","columns","data","original","method","group-layout","read-only"])])]),e.createElementVNode("div",null,[e.renderSlot(p.$slots,"entity-form-right",{data:L.value,original:Y.value,method:P.value})])])]),_:3},8,["show"])]),_:3},8,["show","style","title"]),(b=p.batchAdds)!=null&&b.length?(e.openBlock(),e.createBlock(Lt,{key:2,show:Xe.value,"onUpdate:show":k[16]||(k[16]=R=>Xe.value=R),draggable:"",config:(E=Me.value)==null?void 0:E.searchConfig,title:(D=Me.value)==null?void 0:D.searchTitle,"multi-select":((G=Me.value)==null?void 0:G.singleOne)!=!0,"addition-query":(X=Me.value)==null?void 0:X.additionQuery,onSearchBack:ud},null,8,["show","config","title","multi-select","addition-query"])):e.createCommentVNode("",!0),p.importAction?(e.openBlock(),e.createBlock(Ye,{key:3,show:$.value,"onUpdate:show":k[17]||(k[17]=R=>$.value=R),draggable:"",action:p.importAction,"addition-params":Yn.value,timeout:p.importTimeout,"template-code":p.importTemplateCode},{options:e.withCtx(({options:R})=>[e.renderSlot(p.$slots,"import-options",{options:R})]),_:3},8,["show","action","addition-params","timeout","template-code"])):e.createCommentVNode("",!0),p.dataExchangeCode||p.exportAction?(e.openBlock(),e.createBlock(Tt,{key:4,show:le.value,draggable:"","supported-formats":p.exportFormats,"supported-ranges":p.exportRanges,onClose:k[18]||(k[18]=()=>le.value=!1),onExport:Cd,range:Rt.value,"template-code":p.importTemplateCode},{options:e.withCtx(()=>[e.renderSlot(p.$slots,"export-options")]),_:3},8,["show","supported-formats","supported-ranges","range","template-code"])):e.createCommentVNode("",!0),p.name?(e.openBlock(),e.createBlock(_t,{key:5,"grid-id":p.name,draggable:"","grid-columns":f.value,pageSize:w.value,"onUpdate:pageSize":k[19]||(k[19]=R=>w.value=R),show:Z.value,onClose:k[20]||(k[20]=()=>Z.value=!1),"onUpdate:config":Sd},null,8,["grid-id","grid-columns","pageSize","show"])):e.createCommentVNode("",!0)])}}}),hc={class:"flex-row gap05",style:{"align-items":"center"}},Nn=e.defineComponent({__name:"HaloModal",props:{show:{type:Boolean},title:{},submitting:{type:Boolean},hideOkButton:{type:Boolean},width:{default:"600px"}},emits:["submit","update:show"],setup(t){const{t:l}=W();return(o,n)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{class:"custom-card",show:o.show,preset:"card",style:e.normalizeStyle({width:o.width}),draggable:"",onClose:n[2]||(n[2]=()=>o.$emit("update:show",!1))},{header:e.withCtx(()=>[e.createElementVNode("div",hc,[e.renderSlot(o.$slots,"icon"),e.createElementVNode("div",null,e.toDisplayString(o.title),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[o.hideOkButton?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,onClick:n[0]||(n[0]=r=>o.$emit("submit")),style:{"min-width":"100px"},type:"primary",loading:o.submitting},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("OK")),1)]),_:1},8,["loading"])),e.createVNode(e.unref(u.NButton),{onClick:n[1]||(n[1]=()=>o.$emit("update:show",!1)),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["show","style"]))}}),gc={key:0,style:{"text-align":"right"}},xn=e.defineComponent({__name:"HaloSelect",props:{multiple:{type:Boolean},filterable:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},value:{},sourceUrl:{},additionalQuery:{},labelFormatter:{},keyField:{},labelField:{},subLabelField:{},prefix:{},suffix:{},insertBlank:{type:Boolean},autoSelect:{type:Boolean},i18n:{type:Boolean,default:!0}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=W(),a=e.inject("axios"),i=e.ref(!1),d=e.ref([]);let m;const c=h=>{(!m||m!=h)&&(m=h,s(h))},s=async h=>{let f=o.sourceUrl;if(f){const C=o.labelFormatter,T=o.keyField,B=o.labelField,F=o.subLabelField,V=o.insertBlank,w=o.additionalQuery;i.value=!0,d.value=[];try{h&&(f=U(f,{searchWords:h})),w&&(f=U(f,w,!0));const N=await a.get(f);if(N.isSuccess&&N.value!=null){let x=N.value;if(!Array.isArray(x)&&"rows"in x&&Array.isArray(x.rows)&&(x=x.rows),Array.isArray(x)){const _=x.filter(O=>O&&!0).map(O=>{if(typeof O=="string")return{value:O,label:C?C(O):r(O)};{let j=O[B||"label"];if(C&&(j=C(j)),o.prefix&&(j=o.prefix+j),o.suffix&&(j=j+o.suffix),o.i18n&&(j=r(j)),F){let z=O[F];typeof z=="string"&&(C&&(z=C(z)),o.i18n&&(z=r(z)),z&&(j+=" "+z))}return{value:O[T||"value"],label:j,data:O}}});V&&_.splice(0,0,{value:"",label:""}),d.value=_,o.autoSelect&&!o.value&&_.length&&n("update:value",_[0].value,_[0],_[0].data)}}}finally{i.value=!1}}},g=(h,f)=>{var T;const C=(T=d.value.find(B=>B.value==h))==null?void 0:T.data;n("update:value",h,f,C)};return e.watch(()=>o.sourceUrl,()=>s()),e.watch(()=>o.additionalQuery,(h,f)=>{JSON.stringify(f)!=JSON.stringify(h)&&s()}),e.onMounted(()=>s()),(h,f)=>(e.openBlock(),e.createBlock(e.unref(u.NSelect),{value:h.value,remote:"",loading:i.value,options:d.value,filterable:h.filterable,multiple:h.multiple,placeholder:"",disabled:h.readonly,clearable:h.clearable,onSearch:c,"onUpdate:value":g},{action:e.withCtx(()=>[h.filterable?(e.openBlock(),e.createElementBlock("div",gc,[e.createVNode(e.unref(u.NText),{depth:"3",italic:""},{default:e.withCtx(()=>[e.createElementVNode("small",null,e.toDisplayString(e.unref(r)("Enter text to filter the result list.")),1)]),_:1})])):e.createCommentVNode("",!0)]),_:1},8,["value","loading","options","filterable","multiple","disabled","clearable"]))}}),yc=e.defineComponent({components:{SearchIcon:wt,LeftIcon:cs,RightIcon:fs},props:{sourceList:Object,selectedItems:Object,loading:Boolean,placeholder:{type:String,default:"Search"}},emits:["search","update:selectedItems"],setup(t,l){const{t:o}=W(),n=e.ref(void 0),r=e.ref(i(t.sourceList)),a=e.ref([]);function i(h){return h?h.map(f=>({isSelected:!1,value:f})):[]}function d(){n.value&&l.emit("search",n.value)}function m(){pn(a.value,h=>h.isSelected)>0&&l.emit("update:selectedItems",a.value.map(h=>h.value))}function c(){a.value.forEach(f=>f.isSelected=!1);let h=!1;r.value.forEach(f=>{f.isSelected&&!a.value.some(C=>C.value==f.value)&&(a.value.push({value:f.value,isSelected:!1}),h=!0)}),h&&l.emit("update:selectedItems",a.value.map(f=>f.value))}function s(h){h.forEach(f=>f.isSelected=!0)}function g(h){h.forEach(f=>f.isSelected=!f.isSelected)}return e.watch(()=>t.sourceList,h=>r.value=i(h)),{t:o,searchWords:n,searchMaterials:d,source:r,target:a,moveRight:c,moveLeft:m,selectAll:s,inverseSelect:g}}}),wc={class:"flex-row gap1"},Cc={class:"flex-column flex-grow-1 gap25",style:{width:"100px",height:"400px"}},kc={class:"flex-row gap1",style:{"justify-content":"flex-end"}},bc={class:"flex-column gap1",style:{width:"60px","justify-content":"center"}},Nc={class:"flex-column flex-grow-1 gap25",style:{width:"100px",height:"400px"}},xc={class:"flex-row gap1",style:{"justify-content":"flex-end"}};function Sc(t,l,o,n,r,a){const i=e.resolveComponent("search-icon"),d=e.resolveComponent("n-icon"),m=e.resolveComponent("n-input"),c=e.resolveComponent("n-checkbox"),s=e.resolveComponent("n-scrollbar"),g=e.resolveComponent("n-spin"),h=e.resolveComponent("n-button"),f=e.resolveComponent("right-icon"),C=e.resolveComponent("left-icon");return e.openBlock(),e.createElementBlock("div",wc,[e.createElementVNode("div",Cc,[e.createVNode(m,{placeholder:t.placeholder,value:t.searchWords,"onUpdate:value":l[0]||(l[0]=T=>t.searchWords=T),onInput:t.searchMaterials},{suffix:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>[e.createVNode(i)]),_:1})]),_:1},8,["placeholder","value","onInput"]),e.createVNode(g,{show:t.loading,class:"flex-grow-1 flex-column","content-class":"flex-column flex-grow-1"},{default:e.withCtx(()=>[e.createVNode(s,{class:"flex-grow-1 bordered",style:{height:"50px"},"content-class":"flex-column gap25","content-style":"padding: 4px"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.source,T=>(e.openBlock(),e.createBlock(c,{checked:T.isSelected,"onUpdate:checked":B=>T.isSelected=B,style:{"align-items":"center"}},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"source",{item:T.value,isSelected:T.isSelected},()=>[e.createTextVNode(e.toDisplayString(T.value),1)])]),_:2},1032,["checked","onUpdate:checked"]))),256))]),_:3})]),_:3},8,["show"]),e.createElementVNode("div",kc,[e.createVNode(h,{text:"",onClick:l[1]||(l[1]=()=>t.selectAll(t.source))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Select All")),1)]),_:1}),e.createVNode(h,{text:"",onClick:l[2]||(l[2]=()=>t.inverseSelect(t.source))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Inverse Selection")),1)]),_:1})])]),e.createElementVNode("div",bc,[e.createVNode(h,{onClick:t.moveRight},{default:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>[e.createVNode(f)]),_:1})]),_:1},8,["onClick"]),e.createVNode(h,{onClick:t.moveLeft},{default:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>[e.createVNode(C)]),_:1})]),_:1},8,["onClick"])]),e.createElementVNode("div",Nc,[e.createVNode(s,{class:"flex-grow-1 bordered","content-class":"flex-column gap25","content-style":"padding: 4px"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.target,T=>(e.openBlock(),e.createBlock(c,{checked:T.isSelected,"onUpdate:checked":B=>T.isSelected=B,style:{"align-items":"center"}},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"target",{item:T.value,isSelected:T.isSelected},()=>[e.createTextVNode(e.toDisplayString(T.value),1)])]),_:2},1032,["checked","onUpdate:checked"]))),256))]),_:3}),e.createElementVNode("div",xc,[e.createVNode(h,{text:"",onClick:l[3]||(l[3]=()=>t.selectAll(t.target))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Select All")),1)]),_:1}),e.createVNode(h,{text:"",onClick:l[4]||(l[4]=()=>t.inverseSelect(t.target))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Inverse Selection")),1)]),_:1})])])])}const Sn=oe(yc,[["render",Sc]]),In=oe(e.defineComponent({__name:"MainDetailPanel",props:{direction:{default:"vertical"},initialRatio:{default:.618},minSize:{default:100},mainPanelStyle:{},mainPanelClass:{},detailPanelStyle:{},detailPanelClass:{},detailFolded:{type:Boolean,default:!1}},setup(t){const l=t,o=e.ref(l.initialRatio),n=e.ref(!1),r=e.ref(void 0),a=e.computed(()=>l.detailFolded?{[l.direction==="horizontal"?"width":"height"]:"100%",[l.direction==="horizontal"?"height":"width"]:"100%"}:{[l.direction==="horizontal"?"width":"height"]:`${o.value*100}%`,[l.direction==="horizontal"?"height":"width"]:"100%"}),i=e.computed(()=>l.detailFolded?{[l.direction==="horizontal"?"width":"height"]:"100%",[l.direction==="horizontal"?"height":"width"]:"100%"}:{[l.direction==="horizontal"?"width":"height"]:`${(1-o.value)*100}%`,[l.direction==="horizontal"?"height":"width"]:"100%"}),d=s=>{s.preventDefault(),l.detailFolded||(n.value=!0)},m=s=>{if(!n.value||!r.value||l.detailFolded)return;const g=r.value.getBoundingClientRect();let h;l.direction==="horizontal"?h=(s.clientX-g.left)/g.width:h=(s.clientY-g.top)/g.height;const f=l.minSize/(l.direction==="horizontal"?g.width:g.height),C=1-f;o.value=Math.max(f,Math.min(C,h))},c=()=>{n.value=!1};return e.onMounted(()=>{document.addEventListener("mousemove",m),document.addEventListener("mouseup",c)}),e.onUnmounted(()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",c)}),(s,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["main-detail-panel",[s.direction]]),ref_key:"container",ref:r},[e.createElementVNode("div",{class:e.normalizeClass(["panel main-panel",s.mainPanelClass]),style:e.normalizeStyle([[s.mainPanelStyle,a.value],{}])},[e.renderSlot(s.$slots,"main",{},void 0,!0)],6),s.detailFolded?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["divider",{dragging:n.value}]),onMousedown:d},null,34)),s.detailFolded?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["panel detail-panel",s.detailPanelClass]),style:e.normalizeStyle([[s.detailPanelStyle,i.value],{}])},[e.renderSlot(s.$slots,"detail",{},void 0,!0)],6))],2))}}),[["__scopeId","data-v-ca4664e2"]]),Bn=e.defineComponent({__name:"NumberInputModal",props:{title:{},message:{},value:{},show:{type:Boolean}},emits:["update:show","commit"],setup(t,{emit:l}){const o=t,{t:n}=W(),r=e.ref(o.value);return e.watch(()=>o.value,()=>r.value=o.value),(a,i)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{title:a.title,show:a.show,preset:"card",style:{width:"400px"},draggable:"",onClose:i[3]||(i[3]=()=>a.$emit("update:show",!1))},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:i[1]||(i[1]=()=>a.$emit("commit",r.value))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("OK")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:i[2]||(i[2]=()=>a.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NForm),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NGrid),{cols:24,"x-gap":24},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NFormItemGi),{span:24,label:a.message},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInputNumber),{value:r.value,"onUpdate:value":i[0]||(i[0]=d=>r.value=d)},null,8,["value"])]),_:1},8,["label"])]),_:1})]),_:1})]),_:1},8,["title","show"]))}}),Ic={class:"flex-column"},Vn=e.defineComponent({__name:"ObjectTreeView",props:{selectedId:{},rootId:{default:"0"},rootName:{default:"root"},data:{},loadTreeAction:{},moveAction:{},sortAction:{},treeNodeMapper:{},labelRender:{},searchWords:{},iconRender:{},additionKeys:{}},emits:["update:selectedId","update:path"],setup(t,{emit:l}){var H;const o=t,n=l,{t:r}=W(),a=ce(),i=e.ref(new Array),d=e.ref(void 0),m=(S,y)=>{for(const I of S){if(I.key==y)return[I];if(I.key!=null&&I.key!=null&&I.children&&!I.isLeaf){const A=m(I.children,y);if(A.length)return A.push(I),A}}return[]},c=(S,y)=>{for(let I=0;I<S.length;I++){const A=S[I];if(A.key==y)return{nodes:S,index:I};if(A.children){const $=c(A.children,y);if($)return $}}return null},s=S=>{const y=m(j.value,S);return y?y.reverse():[]},g=S=>S,h=(S,y=!0)=>{let I=[];if(Array.isArray(S)){const A=(o==null?void 0:o.treeNodeMapper)??g;I=S.map(A)}return y?[{key:o.rootId,label:r(o.rootName),isLeaf:!Array.isArray(I)||I.length==0,children:I}]:I},f=()=>{let S=o.loadTreeAction;S&&(o.additionKeys&&(S=U(S,o.additionKeys)),a.get({url:S,callback:y=>{if(y){const I=h(y);j.value=I,z.value=I.map(A=>A.key)}}}))},C=S=>{const y=j.value;if(y){const I=y.map(A=>A.children?B(A.children):[]);z.value=I.flat()}},T=S=>{const y=j.value;y&&(z.value=y.map(I=>I.key))},B=(S,y)=>{const I=new Array;for(const A of S)if(A.key&&I.push(A.key),A.children){const $=B(A.children);$.length&&I.push(...$)}return I},F=S=>{i.value=S;const y=S.length?S[0]:void 0;n("update:selectedId",y==o.rootId?void 0:y);const I=y?s(y):[];n("update:path",I)},V=S=>e.h("span",null,S.option.label),w=S=>o.iconRender?e.h(u.NIcon,null,{default:()=>{var y;return(y=o.iconRender)==null?void 0:y.call(null,S)}}):S.option.isLeaf?e.h(u.NIcon,null,{default:()=>e.h(Uo)}):e.h(u.NIcon,null,{default:()=>e.h(yt)}),N=S=>{!o.moveAction&&!o.sortAction||(S.dropPosition=="before"||S.dropPosition=="after"?S.dragNode.key&&typeof S.node.key&&_(S.dragNode,S.node,S.dropPosition):S.dropPosition=="inside"&&typeof S.dragNode.key=="number"&&typeof S.node.key=="number"&&x(S.dragNode,S.node))},x=(S,y)=>{const I=o.moveAction;if(!I)return;const A=S.key,$=[S.key],L=y.key;!A||!L||S==y||a.post({url:I,data:{menuItemIds:$,targetId:L},successMessage:"Successful operation.",success:()=>{const P=c(j.value,A);P&&(P.nodes.splice(P.index,1),y.children&&y.children.push(S))}})};async function _(S,y,I){const A=o.sortAction;if(!A)return;const $=S.key;let L=y.key;if(!$||!L||$==L)return;const P=c(j.value,$);if(P){if(I=="after"){const Y=P.nodes.indexOf(y);if(Y>-1&&Y<P.nodes.length-1&&(y=P.nodes[Y+1],L=y.key,!L||$==L))return}a.post({url:A,data:{menuId:$,nextSiblingId:L},successMessage:"Successful operation.",success:()=>{P.nodes.splice(P.index,1);const Y=P.nodes.indexOf(y);Y>-1?P.nodes.splice(Y,0,S):P.nodes.push(S)}})}}const O=S=>{if(S==null&&(S=o.rootId),i.value.includes(S))return;const y=m(j.value,S);y.length&&(z.value=y.map(I=>I.key),i.value=[S])},j=e.ref(h(o.data??[])),z=e.ref(((H=j.value)==null?void 0:H.map(S=>S.key))??[]);return e.watch(()=>o.additionKeys,()=>f()),e.watch(()=>o.loadTreeAction,()=>f()),e.watch(()=>o.data,S=>{S?j.value=h(S):j.value=[]}),e.watch(()=>o.selectedId,S=>{O(S)}),e.onMounted(()=>{f()}),(S,y)=>(e.openBlock(),e.createElementBlock("div",Ic,[e.createVNode(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{placeholder:e.unref(r)("Search"),clearable:"",onChange:y[0]||(y[0]=I=>d.value=I)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(tn))]),_:1})]),_:1},8,["placeholder"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:f,title:e.unref(r)("Refresh")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(dt))]),_:1})]),_:1},8,["title"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:y[1]||(y[1]=()=>C()),title:e.unref(r)("Expand All")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Es))]),_:1})]),_:1},8,["title"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:y[2]||(y[2]=()=>T()),title:e.unref(r)("Collapse All")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(qo))]),_:1})]),_:1},8,["title"])]),_:1}),e.createVNode(e.unref(u.NTree),{class:"flex-grow-1",style:{height:"10px"},"virtual-scroll":"","show-line":"","block-node":"",draggable:S.sortAction!=null||S.moveAction!=null,data:j.value,pattern:d.value,"render-label":V,"render-prefix":w,onDrop:N,"selected-keys":i.value,"default-expanded-keys":z.value,"onUpdate:selectedKeys":F},null,8,["draggable","data","pattern","selected-keys","default-expanded-keys"])]))}}),Bc=["src"],Mn=e.defineComponent({__name:"PhotoBox",props:{src:{},fallbackSrc:{}},setup(t){const l=t,n="/img/no_photo.png";let r=!1;function a(i){if(!r){var d=i.target;d instanceof HTMLImageElement&&(r=!0,d.src=l.fallbackSrc??n)}}return e.watch(()=>l.src,()=>{r=!1}),(i,d)=>(e.openBlock(),e.createElementBlock("img",{src:i.src,style:{"border-radius":"0.8em","object-fit":"cover"},onError:a},null,40,Bc))}}),Vc={class:"flex-column gap05"},Mc={key:0},Tc={class:"flex-row gap05",style:{"align-items":"center"}},Tn=e.defineComponent({__name:"PrintModal",props:{show:{type:Boolean},title:{default:"Print"},name:{},action:{},additionParams:{},width:{default:"300px"},disabled:{type:Boolean},beforePrint:{}},emits:["update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=W(),a=ce(),i=e.ref(!1),d=e.ref(s()),m=e.ref(g()),c=[{label:r("Collated (123-123-123)"),value:"Collated"},{label:r("Uncollated (111-222-333)"),value:"Uncollated"}];function s(){if(o.name){const f=Number(localStorage.getItem(`${o.name}:print-copies`));if(f&&f>0)return f}return 1}function g(){if(o.name){const f=localStorage.getItem(`${o.name}:print-collate`);if(f&&(f=="Collated"||f=="Uncollated"))return f}return"Collated"}function h(){if(o.disabled||i.value)return;const f={action:o.action,collate:m.value,copies:d.value,additionParams:o.additionParams};if(o.beforePrint&&o.beforePrint(f)==!1)return;let C=f.action;C&&(C=U(C,[{collate:f.collate,copies:f.copies},f.additionParams]),o.name&&(localStorage.setItem(`${o.name}:print-collate`,m.value),localStorage.setItem(`${o.name}:print-copies`,d.value.toString())),i.value=!1,a.openFile({url:C,loadingStatus:T=>i.value=T,callback:()=>{i.value=!1,n("update:show",!1)}}))}return(f,C)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{class:"custom-card",show:f.show,preset:"card",style:e.normalizeStyle({width:f.width}),onClose:C[3]||(C[3]=()=>f.$emit("update:show",!1))},{header:e.withCtx(()=>[e.createElementVNode("div",Tc,[e.createVNode(e.unref(u.NIcon),{size:"16"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ya))]),_:1}),e.createElementVNode("div",null,e.toDisplayString(e.unref(r)(f.title)),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{onClick:h,style:{"min-width":"100px"},type:"primary",loading:i.value,disable:!f.action||f.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Print")),1)]),_:1},8,["loading","disable"]),e.createVNode(e.unref(u.NButton),{onClick:C[2]||(C[2]=()=>f.$emit("update:show",!1)),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.renderSlot(f.$slots,"default"),e.createElementVNode("div",Vc,[e.createElementVNode("div",null,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Number of print copies"))+":",1),e.createVNode(e.unref(u.NInputNumber),{value:d.value,"onUpdate:value":C[0]||(C[0]=T=>d.value=T),min:"1"},null,8,["value"])]),d.value>1?(e.openBlock(),e.createElementBlock("div",Mc,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Copies print order")),1),e.createVNode(e.unref(u.NSelect),{options:c,value:m.value,"onUpdate:value":C[1]||(C[1]=T=>m.value=T)},null,8,["value"])])):e.createCommentVNode("",!0)])]),_:3},8,["show","style"]))}}),Ac={key:0,style:{"text-align":"center"}},_c=["src"],Ec={key:1,style:{"text-align":"center"}},An=e.defineComponent({__name:"QrModal",props:{title:{default:"QR Code"},code:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:l}){const o=t,{t:n}=W(),r=e.computed(()=>`/api/core/QR/Image?code=${encodeURIComponent(o.code||"")}&format=CODE_128&width=200&height=200`);return(a,i)=>{const d=e.resolveComponent("n-text");return e.openBlock(),e.createBlock(e.unref(u.NModal),{show:a.show,"onUpdate:show":i[1]||(i[1]=m=>a.$emit("update:show",m)),preset:"card",title:e.unref(n)(a.title),style:{"max-width":"350px"}},{default:e.withCtx(()=>[a.code?(e.openBlock(),e.createElementBlock("div",Ac,[e.createElementVNode("img",{src:r.value},null,8,_c),e.createVNode(e.unref(u.NH3),{style:{margin:"1em"}},{default:e.withCtx(()=>[e.createVNode(d,{class:"text-monospace"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.code),1)]),_:1})]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:i[0]||(i[0]=()=>a.$emit("update:show",!1)),type:"primary",style:{width:"200px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("Close")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",Ec,[e.createVNode(e.unref(u.NEmpty))]))]),_:1},8,["show","title"])}}}),Lc={class:"flex-row",style:{"align-items":"center"}},zc={style:{"margin-left":"0.5em"}},_n=e.defineComponent({__name:"SearchCard",props:{title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean},additionQuery:{}},emits:["searchBack"],setup(t,{emit:l}){const o=t,n=l,{t:r}=W(),a=e.ref([]),i=(c,s)=>{a.value=s??[]},d=()=>{a&&n("searchBack",a.value,o.config)},m=c=>{c&&c.length&&n("searchBack",c,o.config)};return(c,s)=>(e.openBlock(),e.createBlock(e.unref(u.NCard),{class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createElementVNode("div",Lc,[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1}),e.createElementVNode("span",zc,e.toDisplayString(e.unref(r)(c.title)),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px"},disabled:a.value.length==0,onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["disabled"])]),default:e.withCtx(()=>[e.createVNode(Ze,{class:"flex-grow-1",config:c.config,"multi-select":c.multiSelect,"auto-close":c.autoClose,"addition-query":c.additionQuery,onResultSelected:i,onSearchBack:m},null,8,["config","multi-select","auto-close","addition-query"])]),_:1}))}});class $c{constructor(){J(this,"rows",Array());J(this,"totalRecords",null);J(this,"pageIndex",0);J(this,"pageSize",10);J(this,"pageCount",null);J(this,"noTotal",!1);J(this,"message",null);J(this,"summary",null);J(this,"currentPageRecords",0);J(this,"meta")}}const Dc={class:"flex-grow-1 flex-column"},Rc={class:"icon-container"},Oc=["title"],Qe="browse_icon_directory",En="page_index",Ln="search_words",zn=32,$t=oe(e.defineComponent({__name:"SelectIconBox",emits:["update:selected"],setup(t,{emit:l}){const o=l,{t:n}=W(),r=ce(),a=e.ref(sessionStorage.getItem(Qe)),i=e.ref(h(void 0)),d=e.ref([]),m=e.ref(1),c=e.ref(0),s=e.ref(!1),g=e.ref(sessionStorage.getItem(Ln));function h(V){const w=[{name:n("Root"),path:"/"}];if(V){for(;V.startsWith("/")||V.startsWith("\\");)V=V.substring(1);const N=V.split(/[\\/]+/);let x="/";for(const _ of N){x+=_;const O={name:_,path:x};w.push(O),x+="/"}}return w}function f(V){V.isDirectory?a.value=V.path:V.path&&o("update:selected",V.path)}function C(){B(0)}function T(V){B(V-1)}function B(V){V=Math.max(0,V);let w=`/api/core/SystemIcons/page?pageSize=${zn}&pageIndex=${V}`;var N=g.value;N&&(w+=`&searchWords=${encodeURIComponent(N)}`);const x=a.value;x&&(w+=`&directory=${encodeURIComponent(x)}`),r.get({url:w,callback:_=>{_&&(d.value=_.rows,c.value=_.totalRecords,m.value=_.pageIndex+1,F(_.pageIndex,x,N))},loadingStatus:_=>s.value=_})}function F(V,w,N){sessionStorage.setItem(En,V.toString()),w?sessionStorage.setItem(Qe,w):sessionStorage.removeItem(Qe),N?sessionStorage.setItem(Ln,N):sessionStorage.removeItem(Qe)}return e.watch(a,V=>{i.value=h(V),B(0)}),e.onMounted(()=>{i.value=h(a.value);let V=Number(sessionStorage.getItem(En));B(V||0)}),(V,w)=>(e.openBlock(),e.createElementBlock("div",Dc,[e.createElementVNode("div",null,[e.createVNode(e.unref(u.NBreadcrumb),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,N=>(e.openBlock(),e.createBlock(e.unref(u.NBreadcrumbItem),{key:N.path},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{text:"",onClick:()=>a.value=N.path,title:N.path},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ho))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N.name)+" ",1)]),_:2},1032,["onClick","title"])]),_:2},1024))),128))]),_:1})]),e.createVNode(e.unref(u.NCard),{class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createVNode(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{style:{width:"250px"},placeholder:e.unref(n)("Quick Search"),clearable:"",onChange:C,value:g.value,"onUpdate:value":w[0]||(w[0]=N=>g.value=N)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),_:1},8,["placeholder","value"]),e.createVNode(e.unref(u.NButton),{title:e.unref(n)("Search"),onClick:C,style:{padding:"0 8px"}},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(n)("Search")),1)]),_:1},8,["title"])]),_:1})]),footer:e.withCtx(()=>[e.createVNode(e.unref(u.NPagination),{page:m.value,"onUpdate:page":[w[1]||(w[1]=N=>m.value=N),T],"item-count":c.value??0,"page-size":zn},{suffix:e.withCtx(({startIndex:N,endIndex:x,itemCount:_})=>[_?(e.openBlock(),e.createBlock(e.unref(u.NText),{key:0,italic:"",depth:"3"},{default:e.withCtx(()=>[e.createTextVNode("["+e.toDisplayString(N+1)+"~"+e.toDisplayString(x+1)+"] / "+e.toDisplayString(_),1)]),_:2},1024)):e.createCommentVNode("",!0)]),_:1},8,["page","item-count"])]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:s.value,class:"flex-grow-1 flex-column","content-class":"flex-grow-1 flex-column"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NScrollbar),{"x-scrollable":"",class:"flex-grow-1",style:{"min-height":"100%","min-width":"100%",overflow:"auto",height:"1px",width:"1px"}},{default:e.withCtx(()=>[e.createElementVNode("div",Rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,N=>(e.openBlock(),e.createBlock(e.unref(u.NButton),{quaternary:"",class:"icon-button",onClick:()=>f(N)},{default:e.withCtx(()=>[e.createElementVNode("div",{style:{overflow:"hidden"},title:N.name},[e.createElementVNode("div",null,[N.isDirectory?(e.openBlock(),e.createBlock(e.unref(u.NIcon),{key:0,size:"48",color:"#FFCA28"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ho))]),_:1})):(e.openBlock(),e.createBlock(e.unref(u.NImage),{key:1,width:"48",height:"48","preview-disabled":"",src:"/api/core/SystemIcons/Icons?path="+N.path},null,8,["src"]))]),e.createElementVNode("div",null,e.toDisplayString(N.name),1)],8,Oc)]),_:2},1032,["onClick"]))),256))])]),_:1})]),_:1},8,["show"])]),_:1})]))}}),[["__scopeId","data-v-ff87aac6"]]),$n=e.defineComponent({__name:"SelectObjectModal",props:{show:{type:Boolean},title:{default:"Select Object"},items:{},getListAction:{},width:{default:300},keyName:{default:"id"},selectedValue:{},message:{},description:{}},emits:["update:show","valueSelected"],setup(t,{emit:l}){const o=t,n=l,{t:r}=W(),a=ce(),i=e.ref(c(o.items)),d=e.ref(!1),m=e.ref(o.selectedValue);function c(h){if(h){if(!h.length||typeof h[0]=="object")return h}else return[];const f=[];for(let C of h)typeof C=="string"||typeof C=="number"?f.push({id:C.toString(),code:r(C.toString())}):f.push(C);return f}const s=()=>{if(d.value)return;const h=o.getListAction;if(!h){i.value=[];return}a.get({url:h,callback:f=>{Array.isArray(f)?i.value=f:Array.isArray(f==null?void 0:f.rows)?i.value=f.rows:i.value=[]},loadingStatus:f=>d.value=f})},g=()=>{m.value&&n("valueSelected",m.value)};return e.onMounted(()=>{o.getListAction&&s()}),e.watch(()=>o.getListAction,()=>{s()}),(h,f)=>(e.openBlock(),e.createBlock(e.unref(u.NSpin),{show:d.value},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NModal),{show:h.show,style:e.normalizeStyle({width:h.width+"px",minWidth:"100px"}),preset:"card",title:e.unref(r)(h.title),onClose:f[2]||(f[2]=()=>h.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:"",align:"stretch"},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"header"),e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.message),1)]),_:1}),e.createVNode(e.unref(u.NRadioGroup),{value:m.value,"onUpdate:value":f[0]||(f[0]=C=>m.value=C),name:"valueList",style:{display:"block"}},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,C=>(e.openBlock(),e.createBlock(e.unref(u.NRadio),{key:C[h.keyName],value:C[h.keyName]},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"default",{data:C},()=>[e.createTextVNode(e.toDisplayString(C.code)+" "+e.toDisplayString(C.name),1)])]),_:2},1032,["value"]))),128))]),_:3})]),_:3},8,["value"]),e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.description),1)]),_:1}),e.renderSlot(h.$slots,"bottom"),e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:g},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:f[1]||(f[1]=()=>h.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),_:3})]),_:3},8,["show","style","title"])]),_:3},8,["show"]))}});function Dn(t,l){for(let o of t){if(o.guid==l)return o;if(Array.isArray(o.items)){const n=Dn(o.items,l);if(n)return n}}}const Dt=()=>{const t={};function l(n,r,a){return!!(r&&r.includes(a)||n.title&&n.title.includes(a)||n.url&&n.url.includes(a))}function o(n,r,a,i){var m;const d=new Array;if(r){let c=0,s=!1;for(const g of r)if(g.isEnabled!==!1)if(g.isSeparator)s||(d.push({type:"divider",key:`_${a}_${c++}`}),s=!0);else{const h=n(g.title),f={key:g.guid,id:g.guid,label:h,disabled:!g.isEnabled,href:g.url,tabBehavior:g.tabBehavior};if(g.items&&g.items.length)f.children=o(n,g.items,g.guid,i);else if(i&&!l(g,h,i))continue;g.guid&&g.icon&&(t[g.guid]={icon:g.icon,color:g.color}),((m=f.children)!=null&&m.length||f.href)&&d.push(f),s=!1}}return d.every(c=>c.type=="divider")?[]:d}return{menuLooks:t,systemMenuToNaiveMenu:o}},Rn=e.defineComponent({__name:"SideMenu",props:{collapsed:{type:Boolean},currentMenuId:{}},setup(t){const{t:l}=W(),o=e.inject("axios"),n=Se(),r=/^https?:\/\//i,a=e.ref([]),i=e.ref(void 0),d=Dt(),m=e.computed(()=>d.systemMenuToNaiveMenu(l,n.menus,void 0,i.value)),c=e.computed(()=>n.isLoadingMenu);function s(f){if(typeof f.href=="string"&&f.href&&!f.children){let C=f.href.startsWith("~")?f.href.substring(1):f.href;f.id&&(C=U(C,{_menuid:f.id}));let T;return f.tabBehavior=="NewTab"?T="_blank":f.tabBehavior=="NamedTab"&&(T=f.id),r.test(C)?e.h("a",{href:C,target:"_blank"},{default:()=>f.label}):e.h(de.RouterLink,{to:C,target:T},{default:()=>f.label})}else return typeof f.label=="string"?f.label:""}function g(f){var C,T,B;if(f.key){const F=(C=d.menuLooks[f.key])==null?void 0:C.icon;if(F)return e.h(xe,{path:F,class:"menu-icon"});if((T=f.children)!=null&&T.length){const V=(B=f.key)==null?void 0:B.toString();return V&&a.value.includes(V)?e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h($s)}):e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(yt)})}else return e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(Uo)})}}function h(f){if(f)try{o.post(`/api/core/UserRecentMenus/add?menuId=${encodeURIComponent(f)}`)}catch(C){console.error(C)}}return e.onMounted(()=>{!n.menus&&!n.isLoadingMenu&&n.sessionToken&&n.loadMenus()}),e.watch(()=>n.sessionToken,()=>n.loadMenus()),(f,C)=>{const T=e.resolveComponent("n-scrollbar"),B=e.resolveComponent("n-input");return e.openBlock(),e.createBlock(e.unref(u.NSpin),{show:c.value,class:"h-100 menu-spin","content-class":"flex-column h-100"},{default:e.withCtx(()=>[e.createVNode(T,null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NMenu),{collapsed:f.collapsed,"collapsed-width":64,"collapsed-icon-size":22,options:m.value,"root-indent":16,indent:16,"render-label":s,"render-icon":g,value:f.currentMenuId,accordion:!0,"onUpdate:expandedKeys":C[0]||(C[0]=F=>a.value=F),"onUpdate:value":h},null,8,["collapsed","options","value"])]),_:1}),e.withDirectives(e.createVNode(B,{style:{width:"250px"},placeholder:e.unref(l)("Search Menu"),clearable:"",onChange:C[1]||(C[1]=F=>i.value=F)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(tn))]),_:1})]),_:1},8,["placeholder"]),[[e.vShow,!f.collapsed]])]),_:1},8,["show"])}}}),jc=["src"],On=e.defineComponent({__name:"SystemIconInput",props:{value:{},label:{},placeholder:{},readonly:{type:Boolean},clearable:{type:Boolean,default:!0}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=W(),a=e.ref(!1),i=e.ref(void 0);function d(){a.value=!a.value}function m(c){c!=null&&!o.readonly&&(n("update:value",c),a.value=!1)}return e.watch(()=>o.value,c=>{c?i.value=`/api/core/SystemIcons/Icons?path=${encodeURIComponent(c)}`:i.value=void 0}),(c,s)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInputGroupLabel),{style:{display:"flex","justify-content":"center","align-items":"center",width:"40px"}},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:i.value,style:{height:"16px",width:"16px","align-self":"center"}},null,8,jc)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.unref(u.NInput),{readonly:c.readonly,value:c.value,placeholder:c.placeholder,"onUpdate:value":s[0]||(s[0]=g=>c.$emit("update:value",g)),clearable:c.clearable},null,8,["readonly","value","placeholder","clearable"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:d,disabled:c.readonly},{default:e.withCtx(()=>s[4]||(s[4]=[e.createTextVNode(" … ",-1)])),_:1,__:[4]},8,["disabled"]),e.createVNode(e.unref(u.NModal),{show:a.value,"onUpdate:show":s[2]||(s[2]=g=>a.value=g),title:e.unref(r)("Select Icon"),onClose:s[3]||(s[3]=()=>a.value=!1),preset:"card",style:{width:"730px",height:"600px"},"content-style":"display: flex; flex-direction: column;"},{default:e.withCtx(()=>[e.createVNode($t,{"onUpdate:selected":s[1]||(s[1]=g=>m(g))})]),_:1},8,["show","title"])]),_:1}))}}),Fc=e.defineComponent({components:{NButton:u.NButton,NIcon:u.NIcon},props:{title:String,iconColor:String,icon:Object},setup(){const{t}=W();return{t}}});function Pc(t,l,o,n,r,a){const i=e.resolveComponent("n-icon"),d=e.resolveComponent("n-button");return e.openBlock(),e.createBlock(d,null,e.createSlots({default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(t.title?t.t(t.title):""),1)]),_:2},[t.icon?{name:"icon",fn:e.withCtx(()=>[e.createVNode(i,{color:t.iconColor},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.icon),1)]),_:1},8,["color"])]),key:"0"}:void 0]),1024)}const jn=oe(Fc,[["render",Pc]]),Hc=e.defineComponent({name:"TopMenu",components:{NMenu:u.NMenu,NSpin:u.NSpin},setup(){const{t}=W(),l=e.inject("axios"),o=Se(),n=/^https?:\/\//i,r=Dt(),a=e.computed(()=>r.systemMenuToNaiveMenu(t,o.menus)),i=e.computed(()=>o.isLoadingMenu);function d(s){if(typeof s.href=="string"&&s.href&&!s.children){let g=s.href.startsWith("~")?s.href.substr(1):s.href;s.id&&(g=U(g,{_menuid:s.id}));let h;return s.tabBehavior=="NewTab"?h="_blank":s.tabBehavior=="NamedTab"&&(h=s.id),n.test(g)?e.h("a",{href:g,target:"_blank"},{default:()=>s.label}):e.h(de.RouterLink,{to:g,target:h},{default:()=>s.label})}else return s.label}function m(s){var g,h;if(s.key){const f=(g=r.menuLooks[s.key])==null?void 0:g.icon;return f?e.h(xe,{path:f,class:"menu-icon"}):(h=s.children)!=null&&h.length?void 0:e.h("div",{class:"menu-icon-blank"},[])}}function c(s){if(s)try{l.post(`/api/core/UserRecentMenus/add?menuId=${encodeURIComponent(s)}`)}catch(g){console.error(g)}}return e.onMounted(()=>{!o.menus&&!o.isLoadingMenu&&o.sessionToken&&o.loadMenus()}),e.watch(()=>o.sessionToken,()=>o.loadMenus()),{menuOptions:a,isLoadingMenu:i,renderMenuLabel:d,renderMenuIcon:m,onMenuSelected:c}}});function Gc(t,l,o,n,r,a){const i=e.resolveComponent("n-menu"),d=e.resolveComponent("n-spin");return e.openBlock(),e.createBlock(d,{show:t.isLoadingMenu},{default:e.withCtx(()=>[e.createVNode(i,{mode:"horizontal",options:t.menuOptions,"render-label":t.renderMenuLabel,"render-icon":t.renderMenuIcon,"onUpdate:value":t.onMenuSelected},null,8,["options","render-label","render-icon","onUpdate:value"])]),_:1},8,["show"])}const Fn=oe(Hc,[["render",Gc]]),Kc=e.defineComponent({name:"TreeView",emits:["update:selectedId","update:path"],props:{selectedId:[Number,String],path:Array,rootId:{type:[Number,String],default:""},rootName:{type:String,default:"Root"},parentKey:{type:String,default:"parentId"},childrenAction:String,moveAction:String,sortAction:String,treeNodeMapper:Function,labelRender:Function},setup(t,l){const o=u.useMessage(),n=e.inject("axios"),{t:r}=W(),a=e.ref(new Array),i=e.ref(new Array),d=e.ref(new Array);function m(z,H){for(const S of z){if(S.key==H)return{node:S,path:[S.key]};if(S.key!=null&&S.key!=null&&S.children&&!S.isLeaf){const y=m(S.children,H);if(y)return{node:y,path:[S.key,...y.path]}}}return null}function c(z,H){for(let S=0;S<z.length;S++){const y=z[S];if(y.key==H)return{nodes:z,index:S};if(y.children){const I=c(y.children,H);if(I)return I}}return null}function s(z){const H=m(a.value,z);return H?H.path:[]}function g(z,H){const S=new Array;for(const y of z)if(y.key&&(!H||H(y.key))&&S.push(y.key),y.children){const I=g(y.children,H);I.length&&S.push(...I)}return S}function h(z){i.value=z}function f(z){d.value=z;const H=z.length?z[0]:null;l.emit("update:selectedId",H);const S=H?s(H):[];l.emit("update:path",S)}function C(z){return t.treeNodeMapper?t.treeNodeMapper.call(void 0,z):{key:z.id,label:z.title,isLeaf:!z.hasSubitems}}async function T(z){const H=t.childrenAction,S=t.parentKey;if(!(!H||!S))try{const y=U(H,{parentKey:S,parentId:z}),I=await n.get(y);if(I.isSuccess&&I.value!=null)return I.value.map(C);o.error(r(I.errorMessage||"Error"))}catch(y){console.log(y),o.error((y==null?void 0:y.toString())||r("Error"))}}async function B(){a.value=[{key:t.rootId,label:r(t.rootName||"Root"),isLeaf:!1,children:await T(null)}],t.selectedId==null?d.value=[t.rootId]:t.selectedId?d.value=[t.selectedId]:d.value=[],i.value=[t.rootId]}async function F(z){const H=z.key;if(H!=null){if(z.children){const y=i.value,I=g(z.children,A=>y.includes(A));i.value=i.value.filter(A=>!I.includes(A))}const S=await T(H);S&&(z.isLeaf=!S.length,z.children=S.length?S:void 0)}}function V(z){return e.h("span",null,z.option.label)}function w(z){if(!z.option.isLeaf)return e.h(u.NIcon,null,{default:()=>e.h(yt)})}function N(z){const H=z.option.key;if(H!=null&&d.value.includes(H))return e.h(u.NButton,{text:!0,onClick:S=>{S.stopPropagation(),F(z.option)}},{default:()=>e.h(u.NIcon,null,{default:()=>e.h(dt)})})}function x(z){!t.moveAction&&!t.sortAction||(z.dropPosition=="before"||z.dropPosition=="after"?z.dragNode.key&&typeof z.node.key&&O(z.dragNode,z.node,z.dropPosition):z.dropPosition=="inside"&&typeof z.dragNode.key=="number"&&typeof z.node.key=="number"&&_(z.dragNode,z.node))}async function _(z,H){const S=t.moveAction;if(!S)return;const y=z.key,I=[z.key],A=H.key;if(!(!y||!A||z==H))try{const $=await n.post(S,{menuItemIds:I,targetId:A});if($.isSuccess){o.success(r("Successful operation."));const L=c(a.value,y);L&&(L.nodes.splice(L.index,1),H.children?H.children.push(z):F(H))}else o.error(r($.errorMessage||"Error"))}catch($){console.log($),o.error(($==null?void 0:$.toString())||"Error")}}async function O(z,H,S){const y=t.sortAction;if(!y)return;console.log(`dragNode: ${z.key} ${z.label}, targetNode: ${H.key} ${H.label}, dropPosition: ${S}`);const I=z.key;let A=H.key;if(!I||!A||I==A)return;const $=c(a.value,I);if($){if(S=="after"){const L=$.nodes.indexOf(H);if(L>-1&&L<$.nodes.length-1&&(H=$.nodes[L+1],A=H.key,!A||I==A))return}try{const L=await n.post(y,{menuId:I,nextSiblingId:A});if(L.isSuccess){o.success(r("Successful operation.")),$.nodes.splice($.index,1);const P=$.nodes.indexOf(H);P>-1?$.nodes.splice(P,0,z):$.nodes.push(z)}else o.error(r(L.errorMessage||"Error"))}catch(L){console.log(L),o.error((L==null?void 0:L.toString())||"Error")}}}async function j(z){var H;if(z.length){let S=(H=a.value)==null?void 0:H.find($=>$.key==z[0]);S==null&&(S={key:z[0],label:r(t.rootName||"Root"),isLeaf:!1},a.value.push(S));let y=z[0],I=S;for(let $=1;$<z.length-1&&I;$++)if(I.children||(I.children=await T(y)),I.children){const L=z[$];I=I.children.find(P=>P.key==L),y=L}const A=i.value;for(let $=0;$<z.length-1;$++)A.includes(z[$])||A.push(z[$]);i.value=A,d.value=[z[z.length-1]]}}return e.onMounted(()=>{B()}),e.watch(()=>t.childrenAction,()=>{B()}),e.watch(()=>t.path,z=>{z&&j(z)}),{data:a,expandedKeys:i,expandedKeysChanged:h,loadChildren:F,dragDrop:x,renderLabel:V,renderPrefix:w,renderSuffix:N,selectedKeys:d,selectedKeysChanged:f}}});function Wc(t,l,o,n,r,a){const i=e.resolveComponent("n-tree");return e.openBlock(),e.createBlock(i,{"block-line":"",remote:t.childrenAction!=null,draggable:t.sortAction!=null||t.moveAction!=null,data:t.data,"render-label":t.renderLabel,"render-prefix":t.renderPrefix,"render-suffix":t.renderSuffix,onLoad:t.loadChildren,onDrop:t.dragDrop,"expanded-keys":t.expandedKeys,"onUpdate:expandedKeys":t.expandedKeysChanged,"selected-keys":t.selectedKeys,"onUpdate:selectedKeys":t.selectedKeysChanged},null,8,["remote","draggable","data","render-label","render-prefix","render-suffix","onLoad","onDrop","expanded-keys","onUpdate:expandedKeys","selected-keys","onUpdate:selectedKeys"])}const Pn=oe(Kc,[["render",Wc]]),Zc={style:{margin:"0 20px 10px 0",cursor:"pointer"}},Yc={class:"user-name-box"},Qc={class:"user-name-label"},Hn="/img/user_avatar.png",Gn=oe(e.defineComponent({__name:"UserMenu",setup(t){var f;const l=de.useRouter(),{t:o}=W(),n=u.useDialog(),r=Ne(),a=Se(),i=nt(),d=e.computed(()=>a.userInfo),m=e.ref(!1),c=e.computed(()=>{var C,T;return(C=a.userInfo)!=null&&C.avatar?`/api/core/avatar?id=${(T=a.userInfo)==null?void 0:T.avatar}`:Hn});function s(){n.warning({title:o("Logout"),content:o("Are you sure log out?"),positiveText:o("OK"),negativeText:o("Cancel"),onPositiveClick:()=>{a.logout(),i.clearTabs(),l.push({path:"/login"})}})}function g(C){switch(C){case"preferences":l.push({path:"/core/preferences"});break;case"change_password":m.value=!0;break;case"logout":s();break;case"toggle_theme":r.toggleTheme();break}}const h=[{label:(f=d.value)==null?void 0:f.userName,type:"group",key:"user_group",children:[{label:o("Preferences"),key:"preferences",icon(){return e.h(u.NIcon,null,{default:()=>e.h(Da)})}},{label:o("Change Password"),key:"change_password",icon(){return e.h(u.NIcon,null,{default:()=>e.h(Pa)})}}]},{label:o("Toggle Theme"),key:"toggle_theme",icon(){return e.h(u.NIcon,null,{default:()=>e.h(ka)})}},{type:"divider"},{label:o("Logout"),key:"logout",icon(){return e.h(u.NIcon,null,{default:()=>e.h(za)})}}];return(C,T)=>{const B=e.resolveComponent("n-avatar"),F=e.resolveComponent("n-dropdown"),V=e.resolveComponent("n-space");return e.openBlock(),e.createBlock(V,{style:{"align-items":"center"}},{default:e.withCtx(()=>[e.createVNode(F,{trigger:"click",options:h,placement:"bottom-end",onSelect:g,size:"medium"},{default:e.withCtx(()=>{var w,N;return[e.createElementVNode("div",Zc,[e.createVNode(B,{round:"",size:"medium",title:(w=d.value)==null?void 0:w.userName,src:c.value,"fallback-src":Hn,bordered:"",style:{position:"absolute","z-index":"10"}},null,8,["title","src"]),e.createElementVNode("div",Yc,[e.createElementVNode("div",Qc,e.toDisplayString((N=d.value)==null?void 0:N.name),1)])])]}),_:1}),e.createVNode(pt,{show:m.value,onClose:T[0]||(T[0]=()=>m.value=!1)},null,8,["show"])]),_:1})}}}),[["__scopeId","data-v-d85ebb4a"]]),Xc={class:"flex-row"},Jc={class:"app-tab-label"},qc={style:{"margin-left":"4px"}},Kn=e.defineComponent({__name:"TabMenu",props:{type:{default:"card"}},setup(t){const l=de.useRouter(),o=Se(),n=e.computed(()=>o.menus),r=e.ref(void 0);l.afterEach(d=>{!d.path||d.path=="/"||d.name=="blank"||(r.value=a(d.path))});function a(d){var c;const m=(c=o.menus)==null?void 0:c.find(s=>{var g;return((g=s.url)==null?void 0:g.toLowerCase())==d.toLowerCase()});if(m)return m.guid}function i(d){var m;if(d){const c=(m=o.menus)==null?void 0:m.find(s=>s.guid==d);c&&c.url&&(l.push(c.url),r.value=c.guid)}}return e.watch(()=>o.sessionToken,()=>o.loadMenus()),e.onMounted(()=>{!o.menus&&!o.isLoadingMenu&&o.sessionToken&&o.loadMenus()}),(d,m)=>n.value&&n.value.length?(e.openBlock(),e.createBlock(e.unref(u.NTabs),{key:0,class:"app-tabs",type:d.type,"justify-content":"space-evenly",animated:"","tab-class":"tab-item","tabs-padding":8,value:r.value,"onUpdate:value":i},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,c=>(e.openBlock(),e.createBlock(e.unref(u.NTab),{key:c.guid,name:c.guid},{default:e.withCtx(()=>[e.createElementVNode("div",Xc,[e.createElementVNode("div",null,[c.icon?(e.openBlock(),e.createBlock(xe,{key:0,path:c.icon},null,8,["path"])):(e.openBlock(),e.createBlock(e.unref(u.NIcon),{key:1},{default:e.withCtx(()=>[e.createVNode(e.unref(Rs))]),_:1}))]),e.createElementVNode("div",Jc,[e.createElementVNode("span",qc,e.toDisplayString(c.title),1)])])]),_:2},1032,["name"]))),128))]),_:1},8,["type","value"])):e.createCommentVNode("",!0)}}),Wn=e.defineComponent({__name:"QuickSearchBox",props:{searchWords:{},placeholder:{default:"Search"}},emits:["search","update:search-words"],setup(t,{emit:l}){const o=t,n=l,{t:r}=W(),a=e.ref(o.searchWords||""),i=()=>{n("update:search-words",a.value),n("search",a.value)};return e.watch(()=>o.searchWords,d=>{a.value=d||""}),(d,m)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),{class:"flex-row quick-search-box",style:{width:"inherit"}},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{class:"flex-1",value:a.value,"onUpdate:value":m[0]||(m[0]=c=>a.value=c),placeholder:e.unref(r)(d.placeholder),clearable:"",onChange:i},null,8,["value","placeholder"]),e.createVNode(e.unref(u.NButton),{title:e.unref(r)("Search"),onClick:i,style:{padding:"0 8px"}},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(wt))]),_:1})]),_:1},8,["title"])]),_:1}))}});class Uc{constructor(){J(this,"token");J(this,"userId");J(this,"startupTime")}}class vc{constructor(){J(this,"guid","");J(this,"title","");J(this,"icon");J(this,"color");J(this,"url");J(this,"isSeparator",!1);J(this,"isEnabled",!0);J(this,"groupName");J(this,"description");J(this,"items");J(this,"tabBehavior");J(this,"closable")}}const ed=Ae.defineStore("fontSize",()=>{const t={small:"14px",medium:"16px",large:"20px"},l="medium",o=()=>{var i;const a=(i=localStorage.getItem("fontSizeMode"))==null?void 0:i.toString();return a&&t[a]?a:l},n=e.ref(o());return{fontSizeMode:n,fontSizeOptions:t,setFontSize:a=>{t[a]&&(n.value=a,localStorage.setItem("fontSizeMode",a))},getFontSize:()=>t[n.value??l]}}),td=Ae.defineStore("userConfig",()=>{const t=e.reactive({}),l=e.computed(()=>s=>t[s]),o=e.computed(()=>({...t}));function n(s,g){t[s]=g,m()}function r(s){Object.assign(t,s),m()}function a(s,g=null){return t[s]!==void 0?t[s]:g}function i(s){delete t[s],m()}function d(){Object.keys(t).forEach(s=>delete t[s]),localStorage.removeItem("user_config")}function m(){try{localStorage.setItem("user_config",JSON.stringify(t))}catch(s){console.error("保存配置失败:",s)}}function c(){try{const s=localStorage.getItem("user_config");if(s){const g=JSON.parse(s);Object.assign(t,g)}}catch(s){console.error("加载配置失败:",s)}}return{config:t,getConfig:l,getAllConfig:o,setConfig:n,setMultipleConfig:r,getConfigValue:a,removeConfig:i,clearAllConfig:d,loadFromLocalStorage:c}}),od={AppLogoBox:Ut,AppTabs:Ko,AutoScrollView:Wo,BarcodeImage:Yo,ChangePassword:pt,ColorInput:mt,Collapsable:on,DefaultPropertyForm:Vt,DetailPage:hn,ExportModal:Tt,EmptyDetailView:gn,FormInput:Ve,FullscreenSwitch:yn,GridConfigModal:_t,HaloButtonSelect:Cn,HaloDatePicker:Pe,HaloForm:bn,HaloGrid:We,HaloModal:Nn,HaloModalInput:Bt,HaloSelect:xn,HaloTagsInput:St,HaloTimePicker:bt,HaloTransfer:Sn,ImportModal:Ye,InputModal:zt,ListInputModal:It,MainDetailPanel:In,MenuIcon:xe,NullableBooleanInput:Nt,NumberInputModal:Bn,ObjectTreeView:Vn,PhotoBox:Mn,PrintModal:Tn,PropertyGrid:Mt,QrModal:An,SearchCard:_n,SearchForm:Ke,SearchModal:Lt,SearchPanel:Ze,SelectIconBox:$t,SelectObjectModal:$n,SideMenu:Rn,SystemIconInput:On,TagsView:Et,ToolButton:jn,TopMenu:Fn,TreeView:Pn,UserMenu:Gn,TabMenu:Kn,QuickSearchBox:Wn},nd={install(t,l){const o={...Go,...l};for(const[n,r]of Object.entries(od))t.component(n,r);l!=null&&l.langCode&&t.use(qt,l==null?void 0:l.langCode,!0),t.provide("axios",re),t.provide(ft,o)}};M.axios=re,M.AppLogoBox=Ut,M.AppTabs=Ko,M.AutoScrollView=Wo,M.BarcodeImage=Yo,M.ChangePassword=pt,M.Collapsable=on,M.ColorInput=mt,M.DataPage=$c,M.DateFormat=ge,M.DateTimeFormat=Ee,M.DefaultPropertyForm=Vt,M.DetailPage=hn,M.EmptyDetailView=gn,M.ExportModal=Tt,M.FormInput=Ve,M.FullscreenSwitch=yn,M.GridConfigModal=_t,M.HaloButtonSelect=Cn,M.HaloDatePicker=Pe,M.HaloForm=bn,M.HaloGrid=We,M.HaloModal=Nn,M.HaloModalInput=Bt,M.HaloSelect=xn,M.HaloTagsInput=St,M.HaloTimePicker=bt,M.HaloTransfer=Sn,M.HalovConfigKey=ft,M.I18nPlugin=qt,M.ImportModal=Ye,M.InputModal=zt,M.ListInputModal=It,M.MainDetailPanel=In,M.MenuIcon=xe,M.NullableBooleanInput=Nt,M.NumberInputModal=Bn,M.ObjectTreeView=Vn,M.PhotoBox=Mn,M.PrintModal=Tn,M.PropertyGrid=Mt,M.QrModal=An,M.QuickSearchBox=Wn,M.SearchCard=_n,M.SearchForm=Ke,M.SearchModal=Lt,M.SearchPanel=Ze,M.SelectIconBox=$t,M.SelectObjectModal=$n,M.SessionSummary=Uc,M.SideMenu=Rn,M.SystemIconInput=On,M.SystemMenu=vc,M.TabMenu=Kn,M.TagsView=Et,M.TimeFormat=Le,M.ToolButton=jn,M.TopMenu=Fn,M.TreeView=Pn,M.UserMenu=Gn,M.addDays=na,M.appendParamsToUrl=U,M.arrayGroupBy=yi,M.arrayMove=mn,M.arrayRemoveIf=pn,M.buildBarcodeUrl=Zo,M.buildSearchItems=cn,M.camelToWords=te,M.clearObject=si,M.convertItems=sn,M.convertPercentValue=Oo,M.convertTo=je,M.copyEntity=an,M.copyToEntity=rn,M.createGridColumns=Be,M.createI18n=Jt,M.dateTimeToString=it,M.dateToNumber=Lo,M.dateToString=st,M.default=nd,M.defaultHalovOptions=Go,M.defaultValue=Ro,M.downloadFile=me,M.findMenuById=Dn,M.firstDayOfMonth=la,M.formatTimespan=$o,M.getColumnWidth=Ct,M.getConfig=ut,M.iconRender=kt,M.iconRenderIf=di,M.initEntity=ln,M.instanceOfColumnValueSource=nn,M.instanceOfHaloColumn=Ie,M.instanceOfTime=Ao,M.isNullOrWhiteSpace=jo,M.lastDayOfMonth=ra,M.linesToArray=sa,M.loadItemSources=Fe,M.mergeRoutes=Ci,M.msToTime=vr,M.onNullOrWhiteSpace=ca,M.openFile=un,M.renderDifference=ui,M.renderIconButton=fi,M.renderLabel=ci,M.searchField=wi,M.secondsToTime=_o,M.splitNumberByCount=ki,M.splitNumberBySize=bi,M.stringToArray=aa,M.stringToTime=Eo,M.sumNumbers=Ni,M.timeToString=zo,M.timestamp=ta,M.toBool=fe,M.toBoolDefault=Oe,M.toDate=To,M.toViewModel=oa,M.useAccountStore=Se,M.useCommonStore=Ne,M.useFontSizeStore=ed,M.useHttpTools=ce,M.useI18n=W,M.useMenus=Dt,M.usePermissions=At,M.useTabsStore=nt,M.useUiTools=xt,M.useUserConfigStore=td,M.validateEmail=ia,Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("img[data-v-895f02de]{display:block;max-width:100%}.app-tab-item[data-v-24ca420a]{border-top-width:2px}[data-v-b01b239f] .n-upload-trigger{display:block}.item-box[data-v-b01b239f]{display:block;flex-grow:1}.form-input[data-v-b01b239f]{display:block}.text-input[data-v-b01b239f]{font-size:small;display:block;text-align:end;padding-right:4px}.detail-page-card-center[data-v-c909376f]{width:1080px;align-self:center;margin:1em}div[data-v-8b391a0f] div.n-form-item-feedback-wrapper{display:none}div[data-v-8b391a0f] .n-form-item-blank{margin-bottom:4px}.n-form-item.n-form-item--left-labelled.n-form-item--auto-label-width>label{min-width:8em}[data-v-f6faec10] .n-upload-trigger{display:block}.edit-title-btn{visibility:hidden}.main-detail-panel[data-v-d5ae5145]{display:flex;width:100%;height:100%;overflow:hidden;--n-resize-trigger-color: rgb(224, 224, 230, .24);--n-resize-trigger-color-hover: #36ad6a}.dark .main-detail-panel[data-v-d5ae5145]{--n-resize-trigger-color: rgba(255, 255, 255, .24);--n-resize-trigger-color-hover: #7fe7c4}.main-detail-panel.horizontal[data-v-d5ae5145]{flex-direction:row}.main-detail-panel.vertical[data-v-d5ae5145]{flex-direction:column}.panel[data-v-d5ae5145]{overflow:auto;display:flex;flex-direction:column}.divider[data-v-d5ae5145]{background-color:var(--n-resize-trigger-color);cursor:col-resize;transition:background .2s}.main-detail-panel.horizontal .divider[data-v-d5ae5145]{width:4px;height:100%}.main-detail-panel.vertical .divider[data-v-d5ae5145]{height:4px;width:100%;cursor:row-resize}.divider.dragging[data-v-d5ae5145],.divider[data-v-d5ae5145]:hover{background-color:var(--n-resize-trigger-color-hover)}.icon-container[data-v-4fa23665]{display:flex;flex-direction:row;flex-wrap:wrap;padding-right:4px;padding-bottom:4px}.icon-button[data-v-4fa23665]{max-width:100px;height:90px;width:80px;margin:4px 0 0 4px}.menu-spin>.n-spin-content{height:100%;display:flex;flex-direction:column}.user-name-box[data-v-709139c3]{background:#abf3;position:relative;z-index:1;width:6rem;height:27px;line-height:27px;border-radius:0 27px 27px 0;left:20px;top:6px}.user-name-label[data-v-709139c3]{padding-left:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-transform:uppercase;text-align:center}.app-tabs{margin-bottom:0}.app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type{--n-tab-color: #D1D5DB;--n-tab-text-color: #1E1B4B;--n-tab-text-color-active: #1E1B4B;--n-tab-border-color: #A3A3A3}.dark .app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type{--n-tab-color: #27272A;--n-tab-text-color: #71717A;--n-tab-text-color-active: #D4D4D8;--n-tab-border-color: #525252}.app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type .n-tabs-tab.n-tabs-tab--active{background-color:#f4f4f5;border-bottom-color:#f4f4f5;font-weight:bolder;border-top-color:#1e40af}.dark .app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type .n-tabs-tab.n-tabs-tab--active{background-color:#171717;border-bottom-color:#171717;border-top-color:#e2e8f0}.app-tab-label{padding:0 1em}.d-block{display:block}.d-none{display:none}.d-flex{display:flex}.d-inline{display:inline}.d-inline-block{display:inline-block}.n-form .n-form-item .n-form-item-feedback-wrapper:empty{display:none}.n-form .n-form-item{margin-bottom:4px}.n-data-table-td,.n-data-table-th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.n-dropdown-menu.n-dropdown{min-width:150px}.text-monospace,.halo-form-code input,.halo-form-code-u input,.halo-form-code-l input{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace}.halo-form-code-u input,.halo-form-code-u{text-transform:uppercase}.halo-form-code-l input,.halo-form-code-l{text-transform:lowercase}.halo-form-wrap{white-space:wrap;overflow-wrap:break-word;display:inline-block}.h-100{height:100%}.h-50{height:50%}td .halo-form-code,td .halo-form-code-u,td .halo-form-code-l{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace}td.text-num{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace;text-align:right}td.text-date,td.text-time,td.text-datetime{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace}td .percent-mark{margin-left:4px;margin-right:2px}td .percent-mark svg{margin:0 auto;display:block}td .status-tag{border-radius:2px;border-width:0 0 0 4px;border-style:solid;padding:0 4px;font-size:smaller;border-color:#9999}td .status-New,td .status-Created,td .status-Standby{border-color:#8bc34a99}td .status-True,td .status-true,td .status-Success,td .status-Succeeded,td .status-Succeed,td .status-Good,td .status-InStock,td .status-Passed,td .status-Resolved,td .status-Processing,td .status-InProduction,td .status-Allowed,td .status-Qualified,td .status-Loaded{border-color:#18a05899}td .status-False,td .status-false,td .status-NonGood,td .status-Failed,td .status-Rejected,td .status-Abnormal,td .status-Forbidden,td .status-Defective{border-color:#d0305099}td .status-Confirmed,td .status-Dispatched,td .status-Inspected{border-color:#3f51b599}td .status-Consumed,td .status-Finished,td .status-Unloaded{border-color:#607d8b99}td .status-Ignored{border-color:#79554899}td .status-OutStock,td .status-Cancelled{border-color:#9e9e9e99}td .status-InTransit{border-color:#78909c99}td .status-InFactory{border-color:#43a04799}td .status-InGarage{border-color:#673ab799}td .status-Doubt,td .status-Paused{border-color:#ffc10799}td .status-Read{border-color:#ffc107cc}td .status-Write{border-color:#673ab7cc}.n-data-table .n-data-table-th .n-data-table-sorter:not(.n-data-table-sorter--asc):not(.n-data-table-sorter--desc){display:none}.n-data-table .btn-cell-ref .n-button__content{opacity:.2}.n-data-table .btn-cell-ref:hover .n-button__content{opacity:1;color:#673ab7}.n-data-table .btn-cell-qr .n-button__content{opacity:.2}.n-data-table .btn-cell-qr:hover .n-button__content{opacity:1;color:#673ab7}.n-data-table-td:not(.check-mark) .cell-unchecked{display:none}.draging-ghost{opacity:.5;background:#c8ebfb}.drag-sorting-handle{cursor:row-resize}.pg-item{margin:1px;border:1px solid transparent;padding:2px;border-radius:3px;display:flex;flex-direction:row;align-items:center}.pg-item:hover{border-color:#eee}.dark .pg-item:hover{border-color:#fff6}.pg-label{padding:0 2px;white-space:nowrap;max-width:50%;text-overflow:clip}.pg-value{padding-left:.5em;padding-right:1em;position:relative}.menu-icon{border-radius:2px}.menu-icon-blank{width:16px;height:16px}.text-positive{color:#00c853}.text-negative,.text-danger{color:#b71c1c}ul,li{list-style:none}html,body,#app,.n-config-provider{height:100%;margin:0;padding:0}.flex-column{display:flex;flex-direction:column}.flex-row{display:flex;flex-direction:row}.flex-1{flex:1 1 0}.flex-grow-1{flex-grow:1}.flex-shrink-1{flex-shrink:1}.flex-wrap{flex-wrap:wrap}.gap1{gap:1em}.gap05{gap:.5em}.gap025{gap:.25em}.gap015{gap:.15em}.gap01{gap:.1em}.gap-x-1{column-gap:1em}.gap-x-05{column-gap:.5em}.gap-x-25{column-gap:.25em}.gap-y-1{row-gap:1em}.gap-y-05{row-gap:.5em}.gap-y-25{row-gap:.25em}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.week-0{background-color:#a5d6a7}input.ime-off,.ime-off input{ime-mode:disabled}.h-scroll{overflow-x:scroll}.v-scroll{overflow-y:scroll}.tabs-card.n-card>.n-card__content{padding:0}.tabs-card.n-card>.n-card__content .n-tab-pane{padding:0}.tabs-card.n-card>.n-card__content .n-tab-pane>.n-card{border-top:0}.info-card{flex-grow:1;margin-top:1em}.info-card>.n-card__content{display:flex;flex-direction:column}.info-card>.n-card__content>.n-tabs{flex-grow:1}.info-card>.n-card__content>.n-tabs>.n-tab-pane{flex-grow:1;display:flex;flex-direction:column}.info-card>.n-card__content>.n-tabs>.n-tab-pane>div{flex-grow:1;display:flex;flex-direction:column}.page-component.n-space>div:first-child{flex-grow:1;display:flex;flex-direction:column}.form-create .n-input--disabled .n-input__input-el,.form-create .n-input--disabled .n-input__placeholder,.form-create .n-input--disabled .n-input__textarea-el,.form-create .n-base-selection--disabled .n-base-selection-overlay__wrapper{color:#000;font-weight:700}.bordered{border:1px solid var(--n-border-color);border-radius:var(--n-border-radius)}.n-dialog__content .line,.n-message__content .line{display:block}.n-tree-node-content__text{white-space:nowrap}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ (function(I,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("axios"),require("vue-router"),require("naive-ui"),require("pinia"),require("moment"),require("mustache"),require("vue-draggable-plus")):typeof define=="function"&&define.amd?define(["exports","vue","axios","vue-router","naive-ui","pinia","moment","mustache","vue-draggable-plus"],e):(I=typeof globalThis<"u"?globalThis:I||self,e(I.halov={},I.Vue,I.axios,I.VueRouter,I.NaiveUI,I.Pinia,I.moment,I.Mustache,I.VueDraggablePlus))})(this,function(I,e,ae,de,u,Me,ie,ke,Zt){"use strict";var Od=Object.defineProperty;var jd=(I,e,ae)=>e in I?Od(I,e,{enumerable:!0,configurable:!0,writable:!0,value:ae}):I[e]=ae;var q=(I,e,ae)=>jd(I,typeof e!="symbol"?e+"":e,ae);var et=typeof document<"u"?document.currentScript:null;const tt=window,Yt="halo-lang";class wl{constructor(l,o=!0){q(this,"langCode","");q(this,"ignoreCase",!1);this.ignoreCase=o,this.swtichLang(l)}loadScript(l){const o=document.createElement("script");return o.src=l,o.id=Yt,document.head.appendChild(o),o}unloadScript(){const l=document.getElementById(Yt);return l&&l.parentNode?(l.parentNode.removeChild(l),!0):!1}swtichLang(l){if(this.langCode!=l){this.langCode=l;const o=`/api/core/Languages/embed.js?code=${encodeURIComponent(l)}&caseType=lowercase`;this.unloadScript(),this.loadScript(o)}}t(l){var n;if(!l)return"";const o=(n=tt.lang)==null?void 0:n.words;return o&&o[this.ignoreCase?l.toLowerCase():l]||l}t2(l,o){var r;if(!l&&!o)return"";const n=(r=tt.lang)==null?void 0:r.words;if(n){if(l){const a=n[this.ignoreCase?l.toLowerCase():l];if(a)return a}if(o){const a=n[this.ignoreCase?o.toLowerCase():o];if(a)return a}}return l||o}info(){const l=tt.lang;if(l)return{code:l.code,name:l.name,displayName:l.displayName,nativeName:l.nativeName,revision:l.revision,rtl:l.rtl}}}const Qt=Symbol("halo-i18n");let ot=null;function Xt(t,l){return ot||(ot=new wl(t,l)),ot}function Jt(t,l,o=!0){const n=Xt(l,o);t.config.globalProperties.$t=r=>n.t(r),t.provide(Qt,n)}function Q(){const t=e.inject(Qt);if(!t)throw new Error("I18n not initialized. Ensure I18nPlugin is installed.");return{i18n:t,t:t.t.bind(t),switchLang:t.swtichLang.bind(t),lang:t.info}}const Cl=()=>{let t=localStorage.getItem("Client-Device-Id");return t||(typeof crypto<"u"&&typeof crypto.randomUUID=="function"?t=crypto.randomUUID():t="c-"+Math.random().toString(36).substring(2)+Date.now().toString(36),localStorage.setItem("Client-Device-Id",t)),t};ae.defaults.headers["Client-Device-Id"]=Cl(),ae.defaults.headers["Content-type"]="application/json",ae.defaults.timeout=1e3*60,ae.interceptors.request.use(t=>{const l=localStorage.getItem("sessionToken");return l&&t.headers&&(t.headers.Authorization=`Bearer ${l}`),t},t=>(console.log(t),Promise.reject(t))),ae.interceptors.response.use(t=>t.status==200?t.data:Promise.reject(t.statusText),t=>{if(t&&t.response&&t.response.status)switch(t.response.status){case 401:const l=de.useRouter();l==null||l.push({name:"Unauthorized"});break}return Promise.reject(t)});const kl=["src"],bl=e.defineComponent({__name:"AppLogoBox",props:{src:{type:String,required:!0},height:{type:String,default:"40px"},defaultSrc:{type:String,default:new URL("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4xIChjNjhlMjJjMzg3LCAyMDIxLTA1LTIzKSIKICAgaW5rc2NhcGU6ZXhwb3J0LXlkcGk9IjUuNjExNzEyIgogICBpbmtzY2FwZTpleHBvcnQteGRwaT0iNS42MTE3MTIiCiAgIGlua3NjYXBlOmV4cG9ydC1maWxlbmFtZT0iRDpcQ29kZXNcSk1DX0ZyYW1lX0FuZG9uXEFydHNcbG9nb18yMC5wbmciCiAgIHNvZGlwb2RpOmRvY25hbWU9ImxvZ28uc3ZnIgogICB3aWR0aD0iODAuNjk3OTE0bW0iCiAgIGhlaWdodD0iNzYuOTQ2MjEzbW0iCiAgIHZpZXdCb3g9IjAgMCA4MC42OTc5MTQgNzYuOTQ2MjEzIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmc4IgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgaW5rc2NhcGU6ZG9jdW1lbnQtcm90YXRpb249IjAiCiAgICAgaW5rc2NhcGU6Y3VycmVudC1sYXllcj0iZzQ1NDMiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMSIKICAgICBpbmtzY2FwZTp3aW5kb3cteT0iLTgiCiAgICAgaW5rc2NhcGU6d2luZG93LXg9Ii04IgogICAgIGlua3NjYXBlOmN5PSIxNDQuOTI4NiIKICAgICBpbmtzY2FwZTpjeD0iNjcuMDg0ODUzIgogICAgIGlua3NjYXBlOnpvb209IjAuNzkwMDQ0MjIiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlkPSJuYW1lZHZpZXc4NTMiCiAgICAgaW5rc2NhcGU6d2luZG93LWhlaWdodD0iMTAxNyIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjE5MjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTpwYWdlb3BhY2l0eT0iMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgZ3JpZHRvbGVyYW5jZT0iMTAiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBib3JkZXJvcGFjaXR5PSIxIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIHBhZ2Vjb2xvcj0iI2ZmZmZmZiIKICAgICBpbmtzY2FwZTpwYWdlY2hlY2tlcmJvYXJkPSIwIgogICAgIGlua3NjYXBlOmRvY3VtZW50LXVuaXRzPSJtbSIgLz4KICA8ZGVmcwogICAgIGlkPSJkZWZzMiI+CiAgICA8Y2xpcFBhdGgKICAgICAgIGNsaXBQYXRoVW5pdHM9InVzZXJTcGFjZU9uVXNlIgogICAgICAgaWQ9ImNsaXBQYXRoNDU2MyI+CiAgICAgIDxyZWN0CiAgICAgICAgIHN0eWxlPSJvcGFjaXR5OjE7ZmlsbDojZmYyYTJhO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDozLjQyNzE2NjQ2O3N0cm9rZS1taXRlcmxpbWl0OjQ7c3Ryb2tlLWRhc2hhcnJheTpub25lO3N0cm9rZS1vcGFjaXR5OjEiCiAgICAgICAgIGlkPSJyZWN0NDU2NSIKICAgICAgICAgd2lkdGg9IjgwLjY5NzkxNCIKICAgICAgICAgaGVpZ2h0PSI3Ni45OTM3NTIiCiAgICAgICAgIHg9Ijg0Ljc1ODIxNyIKICAgICAgICAgeT0iNjUuMTk2NjQ4IgogICAgICAgICByeD0iMTAiCiAgICAgICAgIHJ5PSIxMCIgLz4KICAgIDwvY2xpcFBhdGg+CiAgPC9kZWZzPgogIDxtZXRhZGF0YQogICAgIGlkPSJtZXRhZGF0YTUiPgogICAgPHJkZjpSREY+CiAgICAgIDxjYzpXb3JrCiAgICAgICAgIHJkZjphYm91dD0iIj4KICAgICAgICA8ZGM6Zm9ybWF0PmltYWdlL3N2Zyt4bWw8L2RjOmZvcm1hdD4KICAgICAgICA8ZGM6dHlwZQogICAgICAgICAgIHJkZjpyZXNvdXJjZT0iaHR0cDovL3B1cmwub3JnL2RjL2RjbWl0eXBlL1N0aWxsSW1hZ2UiIC8+CiAgICAgIDwvY2M6V29yaz4KICAgIDwvcmRmOlJERj4KICA8L21ldGFkYXRhPgogIDxnCiAgICAgaWQ9ImxheWVyMSIKICAgICB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtODQuNzU4MjE3LC02NS4yNDQxODMpIj4KICAgIDxnCiAgICAgICBpZD0iZzQ1NDMiCiAgICAgICBjbGlwLXBhdGg9InVybCgjY2xpcFBhdGg0NTYzKSI+CiAgICAgIDxwYXRoCiAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgIGlkPSJwYXRoNDUzMiIKICAgICAgICAgZD0ibSAxMjIuNjcxMDEsOTkuMDkwNTY2IDM0LjY3MTkyLC0zMy44NDYzODMgaCAyMy41NjQ0NSBsIC0zOC44NjA2OCwzNS44MTE3NjcgMjMuNDA5NDIsNDEuMTM0NDQgdiAwIEggMTQzLjU5NyBsIC0xNy4zMTE2MSwtMzEuMTYwODkgLTcuNDE0MDgsNi40NTc0MiIKICAgICAgICAgc3R5bGU9ImZvbnQtc3R5bGU6aXRhbGljO2ZvbnQtdmFyaWFudDpub3JtYWw7Zm9udC13ZWlnaHQ6Ym9sZDtmb250LXN0cmV0Y2g6bm9ybWFsO2ZvbnQtc2l6ZToxMDUuODMzcHg7bGluZS1oZWlnaHQ6MS4yNTtmb250LWZhbWlseTpzYW5zLXNlcmlmOy1pbmtzY2FwZS1mb250LXNwZWNpZmljYXRpb246J3NhbnMtc2VyaWYgQm9sZCBJdGFsaWMnO2xldHRlci1zcGFjaW5nOjBweDt3b3JkLXNwYWNpbmc6MHB4O2ZpbGw6IzVlMzViMTtmaWxsLW9wYWNpdHk6MTtzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MC4yNjQ1ODMiIC8+CiAgICAgIDxwYXRoCiAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgIGQ9Im0gMTE5LjkyOTY1LDExNi44MTcyNyBjIC0yLjEwMTUxLDkuMDI2MTUgLTYuMDQ2MTMsMTUuNzA5NjMgLTExLjgzMzkxLDIwLjA1MDQ1IC01Ljc4Nzc2LDQuMzQwODIgLTEzLjcxMTQ4LDYuNTExMjMgLTIzLjc3MTE1OSw2LjUxMTIzIC0zLjY4NjI1MiwwIC03LjAxMDc2OSwtMC4xMzc4IC05Ljk3MzU1MSwtMC40MTM0MSAtMi45NjI3ODMsLTAuMjQxMTUgLTUuNjE1NTA2LC0wLjYwMjg5IC03Ljk1ODE3MSwtMS4wODUyIGwgMy42NjkwMjcsLTE1LjI4NjUxIGMgNC41Njc1NzYsMC42NTExNyA5LjIxNjI0OSwxLjg4Njg3IDEzLjI4MDg0MywxLjkwMjMxIDUuMjcwOTk2LDAgOS4yMTU2MywtMS4yNTc0NiAxMS44MzM5MDUsLTMuNzcyMzggMi42MTgyNywtMi41MTQ5MiA0Ljc1NDIzLC03LjQwNjk2IDYuNDA3ODc2LC0xNC42NzYxMSBsIDcuMDc5NjgsLTMwLjY0NDEyNCBIIDkxLjA5NDE5NCBMIDk0LjM0OTgwOSw2NS4yNDQxODMgSCAxMzEuODY2OSBaIgogICAgICAgICBzdHlsZT0iZm9udC1zdHlsZTppdGFsaWM7Zm9udC12YXJpYW50Om5vcm1hbDtmb250LXdlaWdodDpib2xkO2ZvbnQtc3RyZXRjaDpub3JtYWw7Zm9udC1zaXplOjEwNS44MzNweDtsaW5lLWhlaWdodDoxLjI1O2ZvbnQtZmFtaWx5OnNhbnMtc2VyaWY7LWlua3NjYXBlLWZvbnQtc3BlY2lmaWNhdGlvbjonc2Fucy1zZXJpZiBCb2xkIEl0YWxpYyc7bGV0dGVyLXNwYWNpbmc6MHB4O3dvcmQtc3BhY2luZzowcHg7ZGlzcGxheTppbmxpbmU7ZmlsbDojMzExYjkyO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDowLjI2NDU4MyIKICAgICAgICAgaWQ9InBhdGg0NDg5IiAvPgogICAgPC9nPgogIDwvZz4KPC9zdmc+Cg==",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:et&&et.tagName.toUpperCase()==="SCRIPT"&&et.src||new URL("halov.umd.cjs",document.baseURI).href).href}},setup(t){const l=t,o=e.ref(l.src);e.watch(()=>l.src,r=>{o.value=r});function n(){o.value=l.defaultSrc}return(r,a)=>(e.openBlock(),e.createElementBlock("img",{src:o.value,style:e.normalizeStyle({height:t.height,objectFit:"contain"}),onError:n,alt:"App Logo"},null,44,kl))}}),le=(t,l)=>{const o=t.__vccOpts||t;for(const[n,r]of l)o[n]=r;return o},qt=le(bl,[["__scopeId","data-v-895f02de"]]);function Nl(){try{const t=sessionStorage.getItem("tabs");return t?JSON.parse(t):null}catch{return null}}const nt=Me.defineStore("tabs",{state:()=>({tabs:Nl(),selectedTab:sessionStorage.getItem("selectedTab")}),actions:{setTabs(t){this.tabs=t,t?(sessionStorage.setItem("tabs",JSON.stringify(t)),t.length||this.setSelectedTab(null)):(sessionStorage.removeItem("tabs"),this.setSelectedTab(null))},setSelectedTab(t){this.selectedTab=t,t?sessionStorage.setItem("selectedTab",t):sessionStorage.removeItem("selectedTab")},addTab(t){let l=this.tabs;l?l.find(o=>o.id==t.id)||l.push(t):l=[t],this.setTabs(l),this.setSelectedTab(t.id)},selectTab(t){this.setSelectedTab(t)},closeTab(t){const l=this.tabs;if(l){const o=l.findIndex(n=>n.id==t);o>-1&&(l.splice(o,1),this.setTabs(l))}},changeTabId(t,l){const o=this.tabs;if(o){const n=o.find(r=>r.id==t);n&&!o.find(r=>r.id==l)&&(n.id=l,this.setTabs(o))}},clearTabs(){this.setTabs([]),this.setSelectedTab(null)}}});var xl=typeof global=="object"&&global&&global.Object===Object&&global,Sl=typeof self=="object"&&self&&self.Object===Object&&self,Il=xl||Sl||Function("return this")(),be=Il.Symbol,Ut=Object.prototype,Bl=Ut.hasOwnProperty,Vl=Ut.toString,Te=be?be.toStringTag:void 0;function Ml(t){var l=Bl.call(t,Te),o=t[Te];try{t[Te]=void 0;var n=!0}catch{}var r=Vl.call(t);return n&&(l?t[Te]=o:delete t[Te]),r}var Tl=Object.prototype,Al=Tl.toString;function El(t){return Al.call(t)}var _l="[object Null]",Ll="[object Undefined]",vt=be?be.toStringTag:void 0;function zl(t){return t==null?t===void 0?Ll:_l:vt&&vt in Object(t)?Ml(t):El(t)}function $l(t){return t!=null&&typeof t=="object"}var Dl="[object Symbol]";function Rl(t){return typeof t=="symbol"||$l(t)&&zl(t)==Dl}function Ol(t,l){for(var o=-1,n=t==null?0:t.length,r=Array(n);++o<n;)r[o]=l(t[o],o,t);return r}var jl=Array.isArray,eo=be?be.prototype:void 0,to=eo?eo.toString:void 0;function oo(t){if(typeof t=="string")return t;if(jl(t))return Ol(t,oo)+"";if(Rl(t))return to?to.call(t):"";var l=t+"";return l=="0"&&1/t==-1/0?"-0":l}function lt(t){return t==null?"":oo(t)}function Pl(t,l,o){var n=-1,r=t.length;l<0&&(l=-l>r?0:r+l),o=o>r?r:o,o<0&&(o+=r),r=l>o?0:o-l>>>0,l>>>=0;for(var a=Array(r);++n<r;)a[n]=t[n+l];return a}function Fl(t,l,o){var n=t.length;return o=o===void 0?n:o,!l&&o>=n?t:Pl(t,l,o)}var Hl="\\ud800-\\udfff",Gl="\\u0300-\\u036f",Kl="\\ufe20-\\ufe2f",Wl="\\u20d0-\\u20ff",Zl=Gl+Kl+Wl,Yl="\\ufe0e\\ufe0f",Ql="\\u200d",Xl=RegExp("["+Ql+Hl+Zl+Yl+"]");function no(t){return Xl.test(t)}function Jl(t){return t.split("")}var lo="\\ud800-\\udfff",ql="\\u0300-\\u036f",Ul="\\ufe20-\\ufe2f",vl="\\u20d0-\\u20ff",er=ql+Ul+vl,tr="\\ufe0e\\ufe0f",or="["+lo+"]",rt="["+er+"]",at="\\ud83c[\\udffb-\\udfff]",nr="(?:"+rt+"|"+at+")",ro="[^"+lo+"]",ao="(?:\\ud83c[\\udde6-\\uddff]){2}",so="[\\ud800-\\udbff][\\udc00-\\udfff]",lr="\\u200d",io=nr+"?",co="["+tr+"]?",rr="(?:"+lr+"(?:"+[ro,ao,so].join("|")+")"+co+io+")*",ar=co+io+rr,sr="(?:"+[ro+rt+"?",rt,ao,so,or].join("|")+")",ir=RegExp(at+"(?="+at+")|"+sr+ar,"g");function cr(t){return t.match(ir)||[]}function dr(t){return no(t)?cr(t):Jl(t)}function fr(t){return function(l){l=lt(l);var o=no(l)?dr(l):void 0,n=o?o[0]:l.charAt(0),r=o?Fl(o,1).join(""):l.slice(1);return n[t]()+r}}var ur=fr("toUpperCase");function pr(t,l,o,n){for(var r=-1,a=t==null?0:t.length;++r<a;)o=l(o,t[r],r,t);return o}function mr(t){return function(l){return t==null?void 0:t[l]}}var hr={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},gr=mr(hr),yr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wr="\\u0300-\\u036f",Cr="\\ufe20-\\ufe2f",kr="\\u20d0-\\u20ff",br=wr+Cr+kr,Nr="["+br+"]",xr=RegExp(Nr,"g");function Sr(t){return t=lt(t),t&&t.replace(yr,gr).replace(xr,"")}var Ir=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Br(t){return t.match(Ir)||[]}var Vr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Mr(t){return Vr.test(t)}var fo="\\ud800-\\udfff",Tr="\\u0300-\\u036f",Ar="\\ufe20-\\ufe2f",Er="\\u20d0-\\u20ff",_r=Tr+Ar+Er,uo="\\u2700-\\u27bf",po="a-z\\xdf-\\xf6\\xf8-\\xff",Lr="\\xac\\xb1\\xd7\\xf7",zr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",$r="\\u2000-\\u206f",Dr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",mo="A-Z\\xc0-\\xd6\\xd8-\\xde",Rr="\\ufe0e\\ufe0f",ho=Lr+zr+$r+Dr,go="['’]",yo="["+ho+"]",Or="["+_r+"]",wo="\\d+",jr="["+uo+"]",Co="["+po+"]",ko="[^"+fo+ho+wo+uo+po+mo+"]",Pr="\\ud83c[\\udffb-\\udfff]",Fr="(?:"+Or+"|"+Pr+")",Hr="[^"+fo+"]",bo="(?:\\ud83c[\\udde6-\\uddff]){2}",No="[\\ud800-\\udbff][\\udc00-\\udfff]",Ne="["+mo+"]",Gr="\\u200d",xo="(?:"+Co+"|"+ko+")",Kr="(?:"+Ne+"|"+ko+")",So="(?:"+go+"(?:d|ll|m|re|s|t|ve))?",Io="(?:"+go+"(?:D|LL|M|RE|S|T|VE))?",Bo=Fr+"?",Vo="["+Rr+"]?",Wr="(?:"+Gr+"(?:"+[Hr,bo,No].join("|")+")"+Vo+Bo+")*",Zr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Yr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Qr=Vo+Bo+Wr,Xr="(?:"+[jr,bo,No].join("|")+")"+Qr,Jr=RegExp([Ne+"?"+Co+"+"+So+"(?="+[yo,Ne,"$"].join("|")+")",Kr+"+"+Io+"(?="+[yo,Ne+xo,"$"].join("|")+")",Ne+"?"+xo+"+"+So,Ne+"+"+Io,Yr,Zr,wo,Xr].join("|"),"g");function qr(t){return t.match(Jr)||[]}function Ur(t,l,o){return t=lt(t),l=l,l===void 0?Mr(t)?qr(t):Br(t):t.match(l)||[]}var vr="['’]",ea=RegExp(vr,"g");function ta(t){return function(l){return pr(Ur(Sr(l).replace(ea,"")),t,"")}}var oa=ta(function(t,l,o){return t+(o?" ":"")+ur(l)}),Re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Oe={exports:{}},na=Oe.exports,Mo;function la(){return Mo||(Mo=1,function(t,l){(function(o,n){n()})(na,function(){function o(i,s){return typeof s>"u"?s={autoBom:!1}:typeof s!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),s={autoBom:!s}),s.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i}function n(i,s,h){var g=new XMLHttpRequest;g.open("GET",i),g.responseType="blob",g.onload=function(){m(g.response,s,h)},g.onerror=function(){console.error("could not download file")},g.send()}function r(i){var s=new XMLHttpRequest;s.open("HEAD",i,!1);try{s.send()}catch{}return 200<=s.status&&299>=s.status}function a(i){try{i.dispatchEvent(new MouseEvent("click"))}catch{var s=document.createEvent("MouseEvents");s.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),i.dispatchEvent(s)}}var c=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Re=="object"&&Re.global===Re?Re:void 0,f=c.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),m=c.saveAs||(typeof window!="object"||window!==c?function(){}:"download"in HTMLAnchorElement.prototype&&!f?function(i,s,h){var g=c.URL||c.webkitURL,d=document.createElement("a");s=s||i.name||"download",d.download=s,d.rel="noopener",typeof i=="string"?(d.href=i,d.origin===location.origin?a(d):r(d.href)?n(i,s,h):a(d,d.target="_blank")):(d.href=g.createObjectURL(i),setTimeout(function(){g.revokeObjectURL(d.href)},4e4),setTimeout(function(){a(d)},0))}:"msSaveOrOpenBlob"in navigator?function(i,s,h){if(s=s||i.name||"download",typeof i!="string")navigator.msSaveOrOpenBlob(o(i,h),s);else if(r(i))n(i,s,h);else{var g=document.createElement("a");g.href=i,g.target="_blank",setTimeout(function(){a(g)})}}:function(i,s,h,g){if(g=g||open("","_blank"),g&&(g.document.title=g.document.body.innerText="downloading..."),typeof i=="string")return n(i,s,h);var d=i.type==="application/octet-stream",y=/constructor/i.test(c.HTMLElement)||c.safari,B=/CriOS\/[\d]+/.test(navigator.userAgent);if((B||d&&y||f)&&typeof FileReader<"u"){var V=new FileReader;V.onloadend=function(){var w=V.result;w=B?w:w.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=w:location=w,g=null},V.readAsDataURL(i)}else{var F=c.URL||c.webkitURL,S=F.createObjectURL(i);g?g.location=S:location.href=S,g=null,setTimeout(function(){F.revokeObjectURL(S)},4e4)}});c.saveAs=m.saveAs=m,t.exports=m})}(Oe)),Oe.exports}var ra=la();function To(t){return typeof t=="object"&&t!==null&&"source"in t}function Ae(t){return typeof t=="object"&&t!==null&&"name"in t}function Ao(){const t=ae.create({headers:{"Content-type":"application/json"},timeout:3e5});return t.interceptors.request.use(l=>{const o=localStorage.getItem("sessionToken");return o&&l.headers&&(l.headers.Authorization=`Bearer ${o}`),l},l=>(console.log(l),Promise.reject(l))),t}function aa(t){if(t){const l=t.match(/filename\*=UTF-8'(?:.*)'(.*)/);if(l&&l.length>1)return decodeURIComponent(l[1]);const o=t.match(/filename=(.*)/);if(o&&o.length>1)return o[1]}}async function pe(t,l,o,n){var s;const r=Ao();let a;(n==null?void 0:n.toLowerCase())=="post"?a=await r.post(t,{responseType:"blob"}):a=await r.get(t,{responseType:"blob"});const{data:c,headers:f,status:m,statusText:i}=a;if(m==200||c.length){f&&(o||(o=(s=f["content-type"])==null?void 0:s.toString()),l||(l=aa(f["content-disposition"])));const h=new Blob([c],{type:o||"application/octet-stream"});ra.saveAs(h,l)}else throw`[${m}] ${i}`}async function Eo(t,l,o){var i;const n=Ao();let r;(o==null?void 0:o.toLowerCase())=="post"?r=await n.post(t,{responseType:"blob"}):r=await n.get(t,{responseType:"blob"});const{data:a,headers:c,status:f,statusText:m}=r;if(f==200||a.length){c&&(l||(l=(i=c["content-type"])==null?void 0:i.toString()));const s=new Blob([a],{type:l||"application/octet-stream"}),h=URL.createObjectURL(s);window.open(h)}else throw`[${f}] ${m}`}function _o(t,l){let o=t.length,n=0;for(;o--;)l(t[o],o)&&(t.splice(o,1),n++);return n}function sa(t,l){var o={};for(let n of t){const r=l(n);o[r]?o[r].push(n):o[r]=[]}return o}function Lo(t,l,o){l<0||l>=t.length||o<0||o>=t.length||l==o||t.splice(o,0,...t.splice(l,1))}function zo(t,l){return l?t.filter((o,n,r)=>r.findIndex(a=>l(a)===l(o))===n):Array.from(new Set(t))}function ia(t,l,o,n,r,a){const c={name:t,label:l||ee(t),editor:o||"text",dataType:o,nullable:!0,visibility:!0,searchMethod:n||"normal"},f=a??(m=>m);return r&&(typeof r=="string"?c.valueSource={type:"remote",isLoading:!1,key:"key",label:"label",sourceUrl:r}:Array.isArray(r)?c.dataType=="boolean"&&r.length==2&&typeof r[0]=="string"?c.valueSource={type:"static",isLoading:!1,values:[{value:"",label:""},{value:"true",label:f(r[0])},{value:"false",label:f(r[1])}]}:c.valueSource={type:"static",isLoading:!1,values:r.map(m=>typeof m=="string"?{value:m,label:f(m)}:m)}:To(r)?Array.isArray(r.source)?c.valueSource={type:"static",isLoading:!1,filterable:r.filterable,values:[{value:"",label:""},...r.source.map(m=>typeof m=="string"?{value:m,label:f(m)}:m)]}:c.valueSource={type:"remote",isLoading:!1,key:r.key,label:r.label,subLabel:r.subLabel,labelTemplate:r.labelTemplate,i18n:r.i18n,sourceUrl:r.source,filterable:r.filterable,values:[]}:c.valueSource={type:"static",isLoading:!1,values:Object.keys(r).map(m=>({value:r[m],label:f(m)}))}),c}function ca(...t){const l=new Map;return t.forEach(o=>{o.forEach(n=>{n.name?l.set(n.name.toString(),n):l.set(n.path,n)})}),Array.from(l.values())}function da(t,l,o){if(t<=0||l<=0||o<0||!Number.isInteger(l)||!Number.isInteger(o)){console.error("Invalid arguments.");return}const n=Math.pow(10,o);let r=Math.floor(t*n);const a=[],c=Math.max(1,Math.floor(r/l));let f=r;for(let m=0;m<l;m++){let i;m==l-1?i=Math.max(0,f):(i=Math.min(c,f),f=Math.max(0,f-c)),i=parseFloat((i/n).toFixed(o)),a.push(i)}return a}function fa(t,l,o){if(t<=0||l<=0||o<0||!Number.isInteger(o)){console.error("Invalid arguments.");return}const n=Math.pow(10,o),r=Math.round(t*n),a=Math.round(l*n),c=[];let f=r;for(;f>0;){let m=Math.min(a,f);f-=a,c.push(parseFloat((m/n).toFixed(o)))}return c}function ua(t,l){if(l<0||!Number.isInteger(l)){console.error("Invalid arguments.");return}const o=Math.pow(10,l);let n=0;for(const r of t)n+=Math.round(r*o);return n/o}const Ee="YYYY/MM/DD HH:mm:ss",ye="YYYY/MM/DD",_e="HH:mm:ss";function ee(t){return t.length?oa(t):t}function fe(t){if(t!=null){if(typeof t=="boolean"||t instanceof Boolean)return t;if(typeof t=="number"||typeof t=="bigint")return t>0;if(typeof t=="string"||typeof t=="object")switch(t==null?void 0:t.toString().toLowerCase().trim()){case"true":case"yes":case"1":case"y":return!0;case"false":case"no":case"0":case"n":return!1}else if(typeof t=="function"){const l=t.call(null);if(l)return fe(l)}}}function je(t,l){const o=fe(t);return o===void 0?l||!1:o}function $o(t,l){if(t!=null){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t);if(typeof t=="string")return ie(t,l||Ee).toDate()}}function Do(t){return typeof t=="object"&&t!==null&&"hour"in t&&"minute"in t}function pa(t){const l=t%1e3;t/=1e3;const o=t%60;t/=60;const n=t%60;return t/=60,{hour:t%24,minute:n,second:o,millisecond:l}}function Ro(t){const l=t%60;t/=60;const o=t%60;return t/=60,{hour:t%24,minute:o,second:l,millisecond:0}}function Oo(t,l){const o=ie(t,l||_e);if(o)return{hour:o.hour(),minute:o.minute(),second:o.second(),millisecond:o.millisecond()}}function jo(t,l){var o,n;if(t){if(typeof t=="string")return(n=(o=ie(t,l||Ee))==null?void 0:o.toDate())==null?void 0:n.getTime();if(typeof t=="number")return t;if(t instanceof Date)return t.getTime()}}function Po(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return ie(new Date(t)).format(l||_e);if(t instanceof Date)return ie(t).format(l||_e);if(Do(t))return ie(new Date(2e3,1,1,t.hour,t.minute,t.second)).format(l||_e);if(typeof t=="object")return t==null?void 0:t.toString()}}function st(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return ie(new Date(t)).format(l||ye);if(t instanceof Date)return ie(t).format(l||ye);if(typeof t=="object")return t==null?void 0:t.toString()}}function it(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return ie(new Date(t)).format(l||Ee);if(t instanceof Date)return ie(t).format(l||Ee);if(typeof t=="object")return t==null?void 0:t.toString()}}function Fo(t){if(t){const l=t.lastIndexOf(":");if(l>-1&&l<t.length-1)return t.substring(0,l+1)+Math.round(Number(t.substring(l+1,t.length)))}return t}function Ho(t){const l={},o=t.split("&").map(n=>n.trim()).filter(n=>n);for(const n of o){let r,a;const c=n.indexOf("=");if(c>-1?(r=n.substring(0,c),a=n.substring(c+1)):r=n,r in l){if(a){const f=l[r];Array.isArray(f)?f.push(a):f?l[r]=[f,a]:l[r]=a}}else l[r]=a}return l}function ma(t,l){let o=t;if(l){const n=[];for(const r in l){const a=l[r];if(Array.isArray(a))for(const c of a)n.push(`${r}=${encodeURIComponent(c)}`);else a?n.push(`${r}=${encodeURIComponent(a)}`):n.push(r)}n.length&&(o+="?"+n.join("&"))}return o}function v(t,l,o=!0){if(!l||Object.keys(l).length==0)return t;let n=t,r={};const a=t.indexOf("?");a>-1&&(n=t.substring(0,a),r=Ho(t.substring(a+1)));let c={};const f=Array.isArray(l)?l:[l];for(let m of f)if(m)if(typeof m=="string")c=Ho(m);else for(const i in m){const s=m[i];Array.isArray(s)?c[i]=s.map(h=>h==null?void 0:h.toString()):s!=null?c[i]=s.toString():c[i]=void 0}else continue;if(Object.keys(c).length==0)return t;if(r.length)for(const m in c)if(m in r&&!o){const i=r[m],s=c[m];Array.isArray(i)?Array.isArray(s)?i.push(...s):i.push(s):i?Array.isArray(s)?r[m]=[i,...s]:r[m]=[i,s]:r[m]=c[m]}else r[m]=c[m];else for(const m in c)r[m]=c[m];return ma(n,r)}function Pe(t,l,o){if(t==null)return t;switch(l){case"number":return Number(t);case"boolean":case"bool":return fe(t);case"date":case"datetime":return it(t);default:return o&&typeof t=="string"&&(o.includes("code-u")?t=t.toUpperCase():o.includes("code-l")&&(t=t.toLowerCase())),t}}function Go(t){switch(t){case"number":return 0;case"boolean":case"bool":return!1;case"date":case"datetime":return new Date}}function ha(){return new Date().getTime().toString()}function ga(t,l){const o={};if(t)if(l)for(const n of l)typeof n=="string"?o[ee(n)]=t[n]:o[ee(n.name)]=t[n.name];else for(const n in t)o[ee(n)]=t[n];return o}function ya(t,l){return ie(t,ye).add(l,"days").format(ye)}function wa(t,l){if(!t||!l){const o=new Date;t||(t=o.getFullYear()),l||(l=o.getMonth())}return new Date(t,l,1)}function Ca(t,l){if(!t||!l){const o=new Date;t||(t=o.getFullYear()),l||(l=o.getMonth())}return new Date(t,l+1,0)}function ka(t,l=!0,o=!0){var r,a;let n=(a=(r=t==null?void 0:t.split(/\s*,\s*|\r?\n+/))==null?void 0:r.map(c=>c.trim()))==null?void 0:a.filter(c=>!l||c.length>0);return n&&o&&(n=n.filter((c,f,m)=>c&&m.indexOf(c)==f)),n}function ba(t,l=!0,o=!0){var r,a;let n=(a=(r=t==null?void 0:t.split(/\r?\n/))==null?void 0:r.map(c=>c.trim()))==null?void 0:a.filter(c=>!l||c.length>0);return n&&o&&(n=n.filter((c,f,m)=>c&&m.indexOf(c)==f)),n}function Na(t){const l=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return!!t.toLowerCase().match(l)}function Ko(t,l=!1){switch(typeof t){case"number":return l?Math.max(0,Math.max(100,t*100)):t*100;case"string":const o=t.indexOf("%");if(o>-1){t=t.substring(0,o-1);const n=Number(t);if(!Number.isNaN(n))return l?Math.max(0,Math.max(100,n)):n}else{const n=Number(t);if(!Number.isNaN(n))return l?Math.max(0,Math.max(100,n*100)):n*100}}}function Wo(t){return t==null?!0:/^\s*$/.test(t)}function xa(t,l){return Wo(t)?l:t}function Zo(t,l){return t?l?t.trim().endsWith(";")?t+l:t+";"+l:t:l}function Yo(t,l){if(!t&&!l)return;const o=[];return Array.isArray(t)?o.push(...t):t&&o.push(t),Array.isArray(l)?o.push(...l):l&&o.push(l),zo(o)}const xe=Me.defineStore("common",{state:()=>({themeName:localStorage.getItem("theme"),menuCollapsed:je(localStorage.getItem("menu-collapsed")),isFullscreen:!1,sharedData:{}}),getters:{isDarkTheme:t=>t.themeName=="darkTheme"},actions:{toggleTheme(){this.themeName=="darkTheme"?this.setThemeName(null):this.setThemeName("darkTheme")},setThemeName(t){this.themeName=t,t?localStorage.setItem("theme",t):localStorage.removeItem("theme")},setMenuCollapsed(t){this.menuCollapsed=t,localStorage.setItem("menu-collapsed",t.toString())},setIsFullscreen(t){this.isFullscreen=t},async fetchSharedData(t,l){let o=this.sharedData[t];if(o||(o={key:t,isLoading:!1,data:void 0,error:void 0,promise:void 0},this.sharedData[t]=o),o.data!==void 0)return o.data;if(o.isLoading&&o.promise)return o.promise;try{o.isLoading=!0,o.promise=l();const n=await o.promise;return o.data=n,o.isLoading=!1,o.promise=void 0,n}catch(n){throw o.isLoading=!1,o.error=n,o.promise=void 0,n}}}}),Sa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ia=e.defineComponent({name:"ArrowDropDownOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Sa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M7 10l5 5l5-5H7z",fill:"currentColor"},null,-1)]))}}),Ba={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Va=e.defineComponent({name:"CheckFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ba,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z",fill:"currentColor"},null,-1)]))}}),Ma={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Qo=e.defineComponent({name:"ClearFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ma,o[0]||(o[0]=[e.createElementVNode("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z",fill:"currentColor"},null,-1)]))}}),Ta={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Aa=e.defineComponent({name:"CloseOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ta,o[0]||(o[0]=[e.createElementVNode("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z",fill:"currentColor"},null,-1)]))}}),Ea={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},_a=e.defineComponent({name:"ColorizeFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ea,o[0]||(o[0]=[e.createElementVNode("path",{d:"M20.71 5.63l-2.34-2.34a.996.996 0 0 0-1.41 0l-3.12 3.12l-1.93-1.91l-1.41 1.41l1.42 1.42L3 16.25V21h4.75l8.92-8.92l1.42 1.42l1.41-1.41l-1.92-1.92l3.12-3.12c.4-.4.4-1.03.01-1.42zM6.92 19L5 17.08l8.06-8.06l1.92 1.92L6.92 19z",fill:"currentColor"},null,-1)]))}}),La={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},za=e.defineComponent({name:"DarkModeOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",La,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9.37 5.51A7.35 7.35 0 0 0 9.1 7.5c0 4.08 3.32 7.4 7.4 7.4c.68 0 1.35-.09 1.99-.27A7.014 7.014 0 0 1 12 19c-3.86 0-7-3.14-7-7c0-2.93 1.81-5.45 4.37-6.49zM12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 0 1-4.4 2.26a5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"},null,-1)]))}}),$a={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Xo=e.defineComponent({name:"EditFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",$a,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83l3.75 3.75l1.83-1.83z",fill:"currentColor"},null,-1)]))}}),Da={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ra=e.defineComponent({name:"ExpandLessFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Da,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 8l-6 6l1.41 1.41L12 10.83l4.59 4.58L18 14z",fill:"currentColor"},null,-1)]))}}),Oa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ja=e.defineComponent({name:"ExpandMoreFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Oa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16.59 8.59L12 13.17L7.41 8.59L6 10l6 6l6-6z",fill:"currentColor"},null,-1)]))}}),Pa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Jo=e.defineComponent({name:"FolderTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Pa,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M11.17 8l-.58-.59L9.17 6H4v12h16V8h-8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l1.41 1.41l.59.59H20v10z",fill:"currentColor"},null,-1)]))}}),Fa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ha=e.defineComponent({name:"FullscreenExitFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Fa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z",fill:"currentColor"},null,-1)]))}}),Ga={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ka=e.defineComponent({name:"FullscreenFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ga,o[0]||(o[0]=[e.createElementVNode("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",fill:"currentColor"},null,-1)]))}}),Wa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Za=e.defineComponent({name:"ImportExportFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Wa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z",fill:"currentColor"},null,-1)]))}}),Ya={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Qa=e.defineComponent({name:"LogOutFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ya,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 2h9a2 2 0 0 1 2 2v2h-2V4H6v16h9v-2h2v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M16.09 15.59L17.5 17l5-5l-5-5l-1.41 1.41L18.67 11H9v2h9.67z",fill:"currentColor"},null,-1)]))}}),Xa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ja=e.defineComponent({name:"ManageAccountsOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Xa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M4 18v-.65c0-.34.16-.66.41-.81C6.1 15.53 8.03 15 10 15c.03 0 .05 0 .08.01c.1-.7.3-1.37.59-1.98c-.22-.02-.44-.03-.67-.03c-2.42 0-4.68.67-6.61 1.82c-.88.52-1.39 1.5-1.39 2.53V20h9.26c-.42-.6-.75-1.28-.97-2H4zm6-6c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2s-2-.9-2-2s.9-2 2-2zm10.75 10c0-.22-.03-.42-.06-.63l1.14-1.01l-1-1.73l-1.45.49c-.32-.27-.68-.48-1.08-.63L18 11h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49l-1 1.73l1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01l1 1.73l1.45-.49c.32.27.68.48 1.08.63L16 21h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49l1-1.73l-1.14-1.01c.03-.21.06-.41.06-.63zM17 18c-1.1 0-2-.9-2-2s.9-2 2-2s2 .9 2 2s-.9 2-2 2z",fill:"currentColor"},null,-1)]))}}),qa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ct=e.defineComponent({name:"MenuFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",qa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z",fill:"currentColor"},null,-1)]))}}),Ua={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},va=e.defineComponent({name:"MenuOpenFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ua,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 18h13v-2H3v2zm0-5h10v-2H3v2zm0-7v2h13V6H3zm18 9.59L17.42 12L21 8.41L19.59 7l-5 5l5 5L21 15.59z",fill:"currentColor"},null,-1)]))}}),es={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ts=e.defineComponent({name:"PasswordFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",es,o[0]||(o[0]=[e.createElementVNode("path",{d:"M2 17h20v2H2v-2zm1.15-4.05L4 11.47l.85 1.48l1.3-.75l-.85-1.48H7v-1.5H5.3l.85-1.47L4.85 7L4 8.47L3.15 7l-1.3.75l.85 1.47H1v1.5h1.7l-.85 1.48l1.3.75zm6.7-.75l1.3.75l.85-1.48l.85 1.48l1.3-.75l-.85-1.48H15v-1.5h-1.7l.85-1.47l-1.3-.75L12 8.47L11.15 7l-1.3.75l.85 1.47H9v1.5h1.7l-.85 1.48zM23 9.22h-1.7l.85-1.47l-1.3-.75L20 8.47L19.15 7l-1.3.75l.85 1.47H17v1.5h1.7l-.85 1.48l1.3.75l.85-1.48l.85 1.48l1.3-.75l-.85-1.48H23v-1.5z",fill:"currentColor"},null,-1)]))}}),os={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ns=e.defineComponent({name:"PlaylistAddCheckTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",os,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 10h11v2H3zm0-4h11v2H3zm0 8h7v2H3zm17.59-2.07l-4.25 4.24l-2.12-2.12l-1.41 1.41L16.34 19L22 13.34z",fill:"currentColor"},null,-1)]))}}),ls={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},rs=e.defineComponent({name:"PlaylistAddFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ls,o[0]||(o[0]=[e.createElementVNode("path",{d:"M14 10H3v2h11v-2zm0-4H3v2h11V6zm4 8v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM3 16h7v-2H3v2z",fill:"currentColor"},null,-1)]))}}),as={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ss=e.defineComponent({name:"PrintTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",as,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M8 5h8v3H8z",fill:"currentColor"},null,-1),e.createElementVNode("circle",{cx:"18",cy:"11.5",r:"1",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M19 8h-1V3H6v5H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zM8 5h8v3H8V5zm8 14H8v-4h8v4zm4-4h-2v-2H6v2H4v-4c0-.55.45-1 1-1h14c.55 0 1 .45 1 1v4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{opacity:".3",d:"M6 13h12v2h2v-4c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1v4h2v-2zm12-2.5c.55 0 1 .45 1 1s-.45 1-1 1s-1-.45-1-1s.45-1 1-1z",fill:"currentColor"},null,-1)]))}}),is={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},cs=e.defineComponent({name:"ReadMoreFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",is,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 7h9v2h-9zm0 8h9v2h-9zm3-4h6v2h-6zm-3 1L8 7v4H2v2h6v4z",fill:"currentColor"},null,-1)]))}}),ds={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},dt=e.defineComponent({name:"RefreshFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ds,o[0]||(o[0]=[e.createElementVNode("path",{d:"M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",fill:"currentColor"},null,-1)]))}}),fs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},me=e.defineComponent({name:"SearchFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",fs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z",fill:"currentColor"},null,-1)]))}}),us={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ps=e.defineComponent({name:"UnarchiveOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",us,o[0]||(o[0]=[e.createElementVNode("path",{d:"M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM6.24 5h11.52l.83 1H5.42l.82-1zM5 19V8h14v11H5zm3-5h2.55v3h2.9v-3H16l-4-4z",fill:"currentColor"},null,-1)]))}}),qo={rootMenuName:"MainMenu",menuPosition:"side"},ft=Symbol("HalovConfig");function ut(){return e.inject(ft)}const ms=["src"],Se=e.defineComponent({__name:"MenuIcon",props:{path:{},size:{default:16}},setup(t){const l=t,o=e.ref(n(l.path));function n(r){if(r)return`/api/core/SystemIcons/Icons?path=${encodeURIComponent(r)}`}return e.watch(()=>l.path,r=>o.value=n(r)),(r,a)=>o.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"menu-icon",src:o.value,style:e.normalizeStyle({width:r.size+"px",height:r.size+"px"})},null,12,ms)):e.createCommentVNode("",!0)}}),Uo=le(e.defineComponent({__name:"AppTabs",props:{tabs:{default:()=>[]},currentTab:{}},emits:["update:currentTab","closeTab","closeAll","closeOthers"],setup(t,{emit:l}){var B;const o=t,n=l,{t:r}=Q(),a=nt(),c=xe(),f=e.computed(()=>c.menuCollapsed),m=((B=ut())==null?void 0:B.menuPosition)??"side",i=()=>c.setMenuCollapsed(!c.menuCollapsed),s=e.ref(o.currentTab),h=e.computed(()=>[{label:r("Close"),key:"close-current"},{label:r("Close All"),key:"close-all"},{label:r("Close Others"),key:"close-others"},{type:"divider",key:"------------1"},...o.tabs.map(V=>({label:r(V.title),key:V.id,url:V.url}))]);function g(V){o.tabs.find(S=>S.id==V)&&a.closeTab(V),n("closeTab",V)}function d(V){if(V.key=="close-current"||V.key=="close-all"||V.key=="close-others")return e.h(u.NIcon,null,{default:()=>e.h(Aa)});if(V.key&&V.key==s.value)return e.h(u.NIcon,null,{default:()=>e.h(Va)})}function y(V){if(typeof V=="string"&&V)switch(V){case"close-current":n("closeTab",s.value);break;case"close-all":n("closeAll");break;case"close-others":n("closeOthers",s.value);break;default:s.value=V;break}}return e.watch(()=>o.currentTab,V=>{s.value=V}),e.watch(s,V=>{V!=o.currentTab&&n("update:currentTab",V)}),(V,F)=>V.tabs.length?(e.openBlock(),e.createBlock(e.unref(u.NTabs),{key:0,type:"card",closable:"",onClose:g,"tab-style":"min-width: 80px;",value:s.value,"onUpdate:value":F[0]||(F[0]=S=>s.value=S)},{prefix:e.withCtx(()=>[e.renderSlot(V.$slots,"prefix",{},()=>[e.unref(m)=="side"?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,text:"",style:{"margin-left":"8px"},onClick:i,title:f.value?e.unref(r)("Expand Menu"):e.unref(r)("Collapse Menu")},{icon:e.withCtx(()=>[f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(va),{key:0})),f.value?(e.openBlock(),e.createBlock(e.unref(ct),{key:1})):e.createCommentVNode("",!0)]),_:1},8,["title"])):e.createCommentVNode("",!0)],!0)]),suffix:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{text:"",style:{"font-size":"24px"}},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NDropdown),{trigger:"click",options:h.value,placement:"bottom-end",onSelect:y,"render-icon":d},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ia))]),_:1})]),_:1},8,["options"])]),_:1})]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.tabs,S=>(e.openBlock(),e.createBlock(e.unref(u.NTab),{key:S.id,name:S.id,title:S.id,closable:S.closable,class:"app-tab-item",style:e.normalizeStyle({"border-top-color":S.color})},{default:e.withCtx(()=>[S.icon?(e.openBlock(),e.createBlock(Se,{key:0,path:S.icon,style:{"margin-right":"4px"}},null,8,["path"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(r)(S.title)),1)]),_:2},1032,["name","title","closable","style"]))),128))]),_:3},8,["value"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-24ca420a"]]),hs=e.defineComponent({props:{direction:{type:String,default:"Right"},step:{type:Number,default:1},intervalFrames:{type:Number,default:1}},setup(t){const l=e.ref(void 0);let o=0;function n(){const c=l.value;if(c){const f=t.step||1;switch(t.direction){case"Left":c.scrollWidth>c.clientWidth&&(c.scrollLeft+c.clientWidth>c.scrollWidth-3?c.scrollLeft=0:c.scrollLeft+=f);break;case"Bottom":c.scrollHeight>c.clientHeight&&(c.scrollTop<3?c.scrollTop=c.scrollHeight:c.scrollTop-=f);break;case"Top":c.scrollHeight>c.clientHeight&&(c.scrollTop+c.clientHeight>c.scrollHeight-3?c.scrollTop=0:c.scrollTop+=f);break;case"Right":default:c.scrollWidth>c.clientWidth&&(c.scrollLeft<3?c.scrollLeft=c.scrollWidth:c.scrollLeft-=f);break}}}function r(){o++,o>1e8&&(o=0);let c=t.intervalFrames||1;c<=0&&(c=1),o%c==0&&n(),l.value&&requestAnimationFrame(r)}function a(){const c=l.value;if(c){switch(t.direction){case"Left":c.scrollLeft=0;break;case"Bottom":c.scrollTop=c.scrollHeight;break;case"Top":c.scrollTop=0;break;case"Right":default:c.scrollLeft=c.scrollWidth;break}c.addEventListener("resize",()=>{console.log("resize me.")})}}return e.onMounted(()=>{a(),requestAnimationFrame(r)}),e.watch(()=>t.direction,()=>a()),{areaRef:l}}}),gs={ref:"areaRef",style:{overflow:"hidden"}};function ys(t,l,o,n,r,a){return e.openBlock(),e.createElementBlock("div",gs,[e.renderSlot(t.$slots,"default")],512)}const vo=le(hs,[["render",ys]]);function en(t,l){let o=`/api/core/Barcode/${l.render=="svg"?"Svg":"Image"}?code=${encodeURIComponent(t)}&format=${l.format||"QR_CODE"}`;return l.width&&(o+=`&width=${l.width}`),l.height&&(o+=`&height=${l.height}`),l.showText&&(o+=`&showText=${l.showText}`),l.base64&&(o+=`&base64=${l.base64}`),l.backColor&&(o+=`&backColor=${encodeURIComponent(l.backColor)}`),l.foreColor&&(o+=`&foreColor=${encodeURIComponent(l.foreColor)}`),l.fontSize&&(o+=`&fontSize=${l.fontSize}`),l.margin&&(o+=`&margin=${encodeURIComponent(l.margin)}`),l.gs1Format&&(o+=`&gs1Format=${l.gs1Format}`),o}const tn=e.defineComponent({__name:"BarcodeImage",props:{code:{},render:{},format:{},width:{},height:{},showText:{type:Boolean},base64:{type:Boolean},backColor:{},foreColor:{},fontSize:{},margin:{},gs1Format:{type:Boolean}},setup(t){const l=t,o=e.ref(void 0),n=()=>{o.value=en(l.code||"",{render:l.render,format:l.format,width:l.width,height:l.height,showText:l.showText,base64:l.base64,backColor:l.backColor,foreColor:l.foreColor,fontSize:l.fontSize,margin:l.margin,gs1Format:l.gs1Format})};return e.watch([l.render,l.code,l.format,l.width,l.height,l.showText,l.base64,l.backColor,l.foreColor,l.fontSize,l.margin,l.gs1Format],()=>n()),e.onMounted(()=>n()),(r,a)=>(e.openBlock(),e.createBlock(e.unref(u.NImage),{src:o.value,width:r.width,height:r.height},null,8,["src","width","height"]))}});function on(t){for(const l of t)l.guid&&(l.guid=l.guid.toLowerCase()),l.items&&on(l.items)}function ws(){try{const t=localStorage.getItem("userInfo");return t?JSON.parse(t):null}catch{return null}}const Ie=Me.defineStore("account",()=>{const t=e.reactive({userInfo:ws(),lastUserName:localStorage.getItem("lastUserName"),sessionToken:localStorage.getItem("sessionToken"),isLoadingMenu:!1,menus:null,messages:JSON.parse(localStorage.getItem("_msgs")??"[]"),authType:localStorage.getItem("authType")}),l=g=>{t.sessionToken=g,g?localStorage.setItem("sessionToken",g):localStorage.removeItem("sessionToken")},o=g=>{t.lastUserName=g,g?localStorage.setItem("lastUserName",g):localStorage.removeItem("lastUserName")},n=g=>{t.userInfo=g,g?localStorage.setItem("userInfo",JSON.stringify(g)):localStorage.removeItem("userInfo")},r=g=>{t.userInfo&&(t.userInfo.avatar=g,localStorage.setItem("userInfo",JSON.stringify(t.userInfo)))},a=()=>{t.userInfo=null,localStorage.removeItem("userInfo"),localStorage.removeItem("_msgs")},c=g=>{t.menus=g},f=g=>{t.isLoadingMenu=g},m=g=>{t.authType=g,g?localStorage.setItem("authType",g):localStorage.removeItem("authType")},i=()=>{localStorage.removeItem("userInfo"),localStorage.removeItem("sessionToken"),a(),c(null),localStorage.removeItem("_msgs")},s=async g=>{var d;f(!0);try{g||(g=((d=ut())==null?void 0:d.rootMenuName)??"MainMenu");const y=await ae.get(`/api/core/account/menus?rootName=${encodeURIComponent(g)}`);if(y.isSuccess){const B=y.value||[];on(B),c(B)}else console.log(y.errorMessage||"get remote menus error.")}catch(y){console.log(y)}finally{f(!1)}},h=g=>{t.messages.push(g),localStorage.setItem("_msgs",JSON.stringify(t.messages))};return{...e.toRefs(t),setSession:l,setLastUserName:o,setUser:n,setAvatar:r,clearUser:a,setMenus:c,setIsLoadingMenu:f,logout:i,loadMenus:s,addMessage:h,setAuthType:m}}),Cs={key:0,style:{"padding-left":"1rem"}},pt=e.defineComponent({__name:"ChangePassword",props:{show:{type:Boolean}},emits:["close"],setup(t,{emit:l}){const o=l,{t:n}=Q(),r=u.useMessage(),a=e.inject("axios"),c=Ie(),f=e.ref({oldPassword:"",newPassword:"",confirmPassword:""}),m=e.ref(!1),i=e.ref(null),s=e.computed(()=>{var V;return(V=c.userInfo)==null?void 0:V.userName}),h=e.ref([]),g={oldPassword:[{required:!0,message:n("Required here.")}],newPassword:[{required:!0,message:n("Required here.")}],confirmPassword:[{required:!0,message:n("Required here.")}]};function d(){var V;s.value&&!m.value&&i.value&&((V=i.value)==null||V.validate(F=>{if(!F)if(f.value.confirmPassword!=f.value.newPassword){r.error(n("Confirm the password is inconsistent, please check and re-enter."));return}else if(f.value.newPassword==f.value.oldPassword){r.error(n("The new password must not be the same as the old password!"));return}else y(s.value,f.value.oldPassword,f.value.newPassword)}))}async function y(V,F,S){try{const w={userName:V,oldPassword:F,newPassword:S},k=await a.post("/api/core/account/changePassword",w);k.isSuccess?(r.success(n("Password has been successfully modified!")),o("close")):r.error(n(k.errorMessage||"Error"))}catch(w){r.error((w==null?void 0:w.toString())||n("Error"))}}async function B(){try{const V=await a.get("/api/core/system/passwordOptions");V.isSuccess&&V.value!=null?h.value=V.value:r.error(n(V.errorMessage||"Error"))}catch(V){console.error(V),r.error((V==null?void 0:V.toString())||n("Error"))}}return e.onMounted(()=>{B()}),(V,F)=>{const S=e.resolveComponent("n-input"),w=e.resolveComponent("n-form-item"),k=e.resolveComponent("n-spin"),x=e.resolveComponent("n-text"),E=e.resolveComponent("n-button"),H=e.resolveComponent("n-modal");return e.openBlock(),e.createBlock(H,{show:V.show,onClose:F[3]||(F[3]=()=>V.$emit("close")),class:"custom-card",title:e.unref(n)("Change Password"),style:{width:"300px"},preset:"card",size:"medium"},{footer:e.withCtx(()=>[h.value.length?(e.openBlock(),e.createElementBlock("ul",Cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,L=>(e.openBlock(),e.createElementBlock("li",{key:L},[e.createVNode(x,{depth:"3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(L),1)]),_:2},1024)]))),128))])):e.createCommentVNode("",!0)]),action:e.withCtx(()=>[e.createVNode(E,{type:"primary",block:"",onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("OK")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NForm),{model:f.value,ref_key:"formRef",ref:i,rules:g},{default:e.withCtx(()=>[e.createVNode(k,{show:m.value},{default:e.withCtx(()=>[e.createVNode(w,{label:e.unref(n)("User Name")},{default:e.withCtx(()=>[e.createVNode(S,{value:s.value,readonly:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(w,{path:"oldPassword",label:e.unref(n)("Old Password")},{default:e.withCtx(()=>[e.createVNode(S,{value:f.value.oldPassword,"onUpdate:value":F[0]||(F[0]=L=>f.value.oldPassword=L),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(w,{path:"newPassword",label:e.unref(n)("New Password")},{default:e.withCtx(()=>[e.createVNode(S,{value:f.value.newPassword,"onUpdate:value":F[1]||(F[1]=L=>f.value.newPassword=L),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(w,{path:"confirmPassword",label:e.unref(n)("Confirm New Password")},{default:e.withCtx(()=>[e.createVNode(S,{value:f.value.confirmPassword,"onUpdate:value":F[2]||(F[2]=L=>f.value.confirmPassword=L),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["show"])]),_:1},8,["model"])]),_:1},8,["show","title"])}}}),mt=e.defineComponent({__name:"ColorInput",props:{value:{},label:{},readonly:{type:Boolean},placeholder:{},clearable:{type:Boolean}},emits:["update:value"],setup(t){return(l,o)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{readonly:l.readonly,value:l.value,placeholder:l.placeholder,clearable:l.clearable,"onUpdate:value":o[0]||(o[0]=n=>l.$emit("update:value",n))},null,8,["readonly","value","placeholder","clearable"]),e.createVNode(e.unref(u.NColorPicker),{value:l.value,"show-preview":"",modes:["hex"],placeholder:"",disabled:l.readonly,style:{"max-width":"80px"},"onUpdate:value":o[1]||(o[1]=n=>l.$emit("update:value",n))},{label:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(_a))]),_:1})]),_:1},8,["value","disabled"])]),_:1}))}}),ks={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},bs=e.defineComponent({name:"ArrowDown",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ks,o[0]||(o[0]=[e.createElementVNode("path",{d:"M24.59 16.59L17 24.17V4h-2v20.17l-7.59-7.58L6 18l10 10l10-10l-1.41-1.41z",fill:"currentColor"},null,-1)]))}}),Ns={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},xs=e.defineComponent({name:"ArrowLeft",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ns,o[0]||(o[0]=[e.createElementVNode("path",{d:"M14 26l1.41-1.41L7.83 17H28v-2H7.83l7.58-7.59L14 6L4 16l10 10z",fill:"currentColor"},null,-1)]))}}),Ss={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Is=e.defineComponent({name:"ArrowRight",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ss,o[0]||(o[0]=[e.createElementVNode("path",{d:"M18 6l-1.43 1.393L24.15 15H4v2h20.15l-7.58 7.573L18 26l10-10L18 6z",fill:"currentColor"},null,-1)]))}}),Bs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Vs=e.defineComponent({name:"ArrowUp",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Bs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16 4L6 14l1.41 1.41L15 7.83V28h2V7.83l7.59 7.58L26 14L16 4z",fill:"currentColor"},null,-1)]))}}),Ms={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},nn=e.defineComponent({name:"Checkbox",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ms,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 4H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM6 26V6h20v20z",fill:"currentColor"},null,-1)]))}}),Ts={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ln=e.defineComponent({name:"CheckboxChecked",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ts,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 4H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM6 26V6h20v20z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M14 21.5l-5-4.96L10.59 15L14 18.35L21.41 11L23 12.58l-9 8.92z",fill:"currentColor"},null,-1)]))}}),As={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Es=e.defineComponent({name:"Checkmark",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",As,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 24l-9-9l1.414-1.414L13 21.171L26.586 7.586L28 9L13 24z",fill:"currentColor"},null,-1)]))}}),_s={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Le=e.defineComponent({name:"ChevronDown",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",_s,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16 22L6 12l1.4-1.4l8.6 8.6l8.6-8.6L26 12z",fill:"currentColor"},null,-1)]))}}),Ls={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},zs=e.defineComponent({name:"ChevronRight",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ls,o[0]||(o[0]=[e.createElementVNode("path",{d:"M22 16L12 26l-1.4-1.4l8.6-8.6l-8.6-8.6L12 6z",fill:"currentColor"},null,-1)]))}}),$s={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ds=e.defineComponent({name:"ChevronUp",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",$s,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16 10l10 10l-1.4 1.4l-8.6-8.6l-8.6 8.6L6 20z",fill:"currentColor"},null,-1)]))}}),Rs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},rn=e.defineComponent({name:"CollapseAll",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Rs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 15h-2V7H13V5h15a2.002 2.002 0 0 1 2 2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M25 20h-2v-8H8v-2h15a2.002 2.002 0 0 1 2 2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 27H4a2.002 2.002 0 0 1-2-2v-8a2.002 2.002 0 0 1 2-2h14a2.002 2.002 0 0 1 2 2v8a2.002 2.002 0 0 1-2 2zM4 17v8h14.001L18 17z",fill:"currentColor"},null,-1)]))}}),Os={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},an=e.defineComponent({name:"Cube",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Os,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28.504 8.136l-12-7a1 1 0 0 0-1.008 0l-12 7A1 1 0 0 0 3 9v14a1 1 0 0 0 .496.864l12 7a1 1 0 0 0 1.008 0l12-7A1 1 0 0 0 29 23V9a1 1 0 0 0-.496-.864zM16 3.158L26.016 9L16 14.842L5.984 9zM5 10.74l10 5.833V28.26L5 22.426zM17 28.26V16.574l10-5.833v11.685z",fill:"currentColor"},null,-1)]))}}),js={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ps=e.defineComponent({name:"Document",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",js,o[0]||(o[0]=[e.createElementVNode("path",{d:"M25.7 9.3l-7-7c-.2-.2-.4-.3-.7-.3H8c-1.1 0-2 .9-2 2v24c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V10c0-.3-.1-.5-.3-.7zM18 4.4l5.6 5.6H18V4.4zM24 28H8V4h8v6c0 1.1.9 2 2 2h6v16z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M10 22h12v2H10z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M10 16h12v2H10z",fill:"currentColor"},null,-1)]))}}),Fs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},sn=e.defineComponent({name:"DocumentDownload",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Fs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 25l-1.414-1.414L26 26.172V18h-2v8.172l-2.586-2.586L20 25l5 5l5-5z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 28H8V4h8v6a2.006 2.006 0 0 0 2 2h6v3h2v-5a.91.91 0 0 0-.3-.7l-7-7A.909.909 0 0 0 18 2H8a2.006 2.006 0 0 0-2 2v24a2.006 2.006 0 0 0 2 2h10zm0-23.6l5.6 5.6H18z",fill:"currentColor"},null,-1)]))}}),Hs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},cn=e.defineComponent({name:"DocumentExport",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Hs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 21h13.17l-2.58 2.59L25 25l5-5l-5-5l-1.41 1.41L26.17 19H13v2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M22 14v-4a1 1 0 0 0-.29-.71l-7-7A1 1 0 0 0 14 2H4a2 2 0 0 0-2 2v24a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2h-2v2H4V4h8v6a2 2 0 0 0 2 2h6v2zm-8-4V4.41L19.59 10z",fill:"currentColor"},null,-1)]))}}),Gs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},dn=e.defineComponent({name:"DocumentImport",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Gs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 19H14.83l2.58-2.59L16 15l-5 5l5 5l1.41-1.41L14.83 21H28v-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M24 14v-4a1 1 0 0 0-.29-.71l-7-7A1 1 0 0 0 16 2H6a2 2 0 0 0-2 2v24a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2h-2v2H6V4h8v6a2 2 0 0 0 2 2h6v2zm-8-4V4.41L21.59 10z",fill:"currentColor"},null,-1)]))}}),Ks={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},fn=e.defineComponent({name:"Draggable",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ks,o[0]||(o[0]=[e.createStaticVNode('<path d="M10 6h4v4h-4z" fill="currentColor"></path><path d="M18 6h4v4h-4z" fill="currentColor"></path><path d="M10 14h4v4h-4z" fill="currentColor"></path><path d="M18 14h4v4h-4z" fill="currentColor"></path><path d="M10 22h4v4h-4z" fill="currentColor"></path><path d="M18 22h4v4h-4z" fill="currentColor"></path>',6)]))}}),Ws={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Zs=e.defineComponent({name:"ExpandAll",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ws,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 10h14a2.002 2.002 0 0 0 2-2V4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6V2H4v23a2.002 2.002 0 0 0 2 2h4v1a2.002 2.002 0 0 0 2 2h14a2.002 2.002 0 0 0 2-2v-4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6v-8h4v1a2.002 2.002 0 0 0 2 2h14a2.002 2.002 0 0 0 2-2v-4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6V7h4v1a2.002 2.002 0 0 0 2 2zm0-6h14l.001 4H12zm0 20h14l.001 4H12zm0-10h14l.001 4H12z",fill:"currentColor"},null,-1)]))}}),Ys={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ht=e.defineComponent({name:"Folder",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ys,o[0]||(o[0]=[e.createElementVNode("path",{d:"M11.17 6l3.42 3.41l.58.59H28v16H4V6h7.17m0-2H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h24a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2H16l-3.41-3.41A2 2 0 0 0 11.17 4z",fill:"currentColor"},null,-1)]))}}),Qs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Xs=e.defineComponent({name:"FolderOpen",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Qs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 8h-7.172l-3.414-3.414A2 2 0 0 0 16 4H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h24a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2zM8 26V14h8v6.17l-2.59-2.58L12 19l5 5l5-5l-1.41-1.41L18 20.17V14a2.002 2.002 0 0 0-2-2H8a2.002 2.002 0 0 0-2 2v12H4V6h12l4 4h8v2h-6v2h6v12z",fill:"currentColor"},null,-1)]))}}),Js={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},qs=e.defineComponent({name:"IbmCloudPakApplications",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Js,o[0]||(o[0]=[e.createElementVNode("path",{d:"M21 22h-6a2.002 2.002 0 0 1-2-2v-4a2.002 2.002 0 0 1 2-2h6a2.002 2.002 0 0 1 2 2v4a2.002 2.002 0 0 1-2 2zm-6-6v4h6v-4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M11 17H9v-5a2.002 2.002 0 0 1 2-2h6v2h-6z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M16 31a.999.999 0 0 1-.504-.136l-12-7A1 1 0 0 1 3 23V9a1 1 0 0 1 .496-.864l12-7a1 1 0 0 1 1.008 0l12 7l-1.008 1.728L16 3.158L5 9.574v12.852l11 6.417l11-6.417V15h2v8a1 1 0 0 1-.496.864l-12 7A.999.999 0 0 1 16 31z",fill:"currentColor"},null,-1)]))}}),Us={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},vs=e.defineComponent({name:"Launch",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Us,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 28H6a2.003 2.003 0 0 1-2-2V6a2.003 2.003 0 0 1 2-2h10v2H6v20h20V16h2v10a2.003 2.003 0 0 1-2 2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M20 2v2h6.586L18 12.586L19.414 14L28 5.414V12h2V2H20z",fill:"currentColor"},null,-1)]))}}),ei={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ti=e.defineComponent({name:"NewTab",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ei,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 26H6V6h10V4H6a2.002 2.002 0 0 0-2 2v20a2.002 2.002 0 0 0 2 2h20a2.002 2.002 0 0 0 2-2V16h-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M26 26H6V6h10V4H6a2.002 2.002 0 0 0-2 2v20a2.002 2.002 0 0 0 2 2h20a2.002 2.002 0 0 0 2-2V16h-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M26 6V2h-2v4h-4v2h4v4h2V8h4V6h-4z",fill:"currentColor"},null,-1)]))}}),oi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ni=e.defineComponent({name:"NotAvailable",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",oi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M4 15h10v2H4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 15h10v2H18z",fill:"currentColor"},null,-1)]))}}),li={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ri=e.defineComponent({name:"PanHorizontal",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",li,o[0]||(o[0]=[e.createElementVNode("path",{d:"M24 10l-1.414 1.414L26.172 15H5.828l3.586-3.586L8 10l-6 6l6 6l1.414-1.414L5.828 17h20.344l-3.586 3.586L24 22l6-6l-6-6z",fill:"currentColor"},null,-1)]))}}),ai={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},si=e.defineComponent({name:"QrCode",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ai,o[0]||(o[0]=[e.createStaticVNode('<path d="M24 28v-2h2v2z" fill="currentColor"></path><path d="M18 24v-2h2v2z" fill="currentColor"></path><path d="M18 30h4v-2h-2v-2h-2v4z" fill="currentColor"></path><path d="M26 26v-4h2v4z" fill="currentColor"></path><path d="M28 26h2v4h-4v-2h2v-2z" fill="currentColor"></path><path d="M26 20v-2h4v4h-2v-2h-2z" fill="currentColor"></path><path d="M24 20h-2v4h-2v2h4v-6z" fill="currentColor"></path><path d="M18 20v-2h4v2z" fill="currentColor"></path><path d="M6 22h4v4H6z" fill="currentColor"></path><path d="M14 30H2V18h12zM4 28h8v-8H4z" fill="currentColor"></path><path d="M22 6h4v4h-4z" fill="currentColor"></path><path d="M30 14H18V2h12zm-10-2h8V4h-8z" fill="currentColor"></path><path d="M6 6h4v4H6z" fill="currentColor"></path><path d="M14 14H2V2h12zM4 12h8V4H4z" fill="currentColor"></path>',14)]))}}),ii={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ci=e.defineComponent({name:"Renew",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ii,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 10H6.78A11 11 0 0 1 27 16h2A13 13 0 0 0 6 7.68V4H4v8h8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M20 22h5.22A11 11 0 0 1 5 16H3a13 13 0 0 0 23 8.32V28h2v-8h-8z",fill:"currentColor"},null,-1)]))}}),di={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},gt=e.defineComponent({name:"Search",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",di,o[0]||(o[0]=[e.createElementVNode("path",{d:"M29 27.586l-7.552-7.552a11.018 11.018 0 1 0-1.414 1.414L27.586 29zM4 13a9 9 0 1 1 9 9a9.01 9.01 0 0 1-9-9z",fill:"currentColor"},null,-1)]))}}),fi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},un=e.defineComponent({name:"SearchLocate",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",fi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 28.586l-4.689-4.688a8.028 8.028 0 1 0-1.414 1.414L28.586 30zM19 25a6 6 0 1 1 6-6a6.007 6.007 0 0 1-6 6z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 12h8v2H2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 2h16v2H2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 7h16v2H2z",fill:"currentColor"},null,-1)]))}}),ui={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},pi=e.defineComponent({name:"SelectWindow",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ui,o[0]||(o[0]=[e.createStaticVNode('<path d="M8 26H4a2.002 2.002 0 0 1-2-2v-4h2v4h4z" fill="currentColor"></path><path d="M2 12h2v4H2z" fill="currentColor"></path><path d="M26 8h-2V4h-4V2h4a2.002 2.002 0 0 1 2 2z" fill="currentColor"></path><path d="M12 2h4v2h-4z" fill="currentColor"></path><path d="M4 8H2V4a2.002 2.002 0 0 1 2-2h4v2H4z" fill="currentColor"></path><path d="M27 32a.997.997 0 0 1-.707-.293l-6.138-6.138l-3.323 4.986a1 1 0 0 1-1.79-.268l-6-20a1 1 0 0 1 1.245-1.245l20 6a1 1 0 0 1 .268 1.79l-4.986 3.323l6.138 6.138a1 1 0 0 1 0 1.414l-4 4A.997.997 0 0 1 27 32zm0-2.414L29.586 27l-7.155-7.155l5.246-3.498l-16.185-4.855l4.855 16.185l3.498-5.246z" fill="currentColor"></path>',6)]))}}),mi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},hi=e.defineComponent({name:"TableBuilt",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",mi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 8h-4V4a2.002 2.002 0 0 0-2-2H4a2.002 2.002 0 0 0-2 2v18a2.002 2.002 0 0 0 2 2h4v4a2.002 2.002 0 0 0 2 2h18a2.002 2.002 0 0 0 2-2V10a2.002 2.002 0 0 0-2-2zm-6 14h-8v-5h8zm0-7h-8v-5h8zm-10 0H4v-5h8zM22 4v4H4V4zM4 22v-5h8v5zm24 6H10v-4h12a2.002 2.002 0 0 0 2-2V10h4z",fill:"currentColor"},null,-1)]))}}),gi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},yi=e.defineComponent({name:"TagEdit",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",gi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M29.707 7.293l-3-3a1 1 0 0 0-1.414 0L16 13.586V18h4.414l9.293-9.293a1 1 0 0 0 0-1.414zM19.586 16H18v-1.586l5-5L24.586 11zM26 9.586L24.414 8L26 6.414L27.586 8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M10 14a4 4 0 1 1 4-4a4.005 4.005 0 0 1-4 4zm0-6a2 2 0 1 0 1.998 2.004A2.002 2.002 0 0 0 10 8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M27.006 14.235l-1.414 1.414L28 18.058L18.058 28L4 13.941V4h9.942l4.406 4.407l1.415-1.415l-4.407-4.406A2 2 0 0 0 13.94 2H4a2 2 0 0 0-2 2v9.941a2 2 0 0 0 .586 1.414l14.058 14.06a2.001 2.001 0 0 0 2.828 0l9.943-9.943a2.001 2.001 0 0 0 0-2.828z",fill:"currentColor"},null,-1)]))}}),wi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ci=e.defineComponent({name:"Upload",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",wi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 18l1.41 1.41L15 11.83V30h2V11.83l7.59 7.58L26 18L16 8L6 18z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M6 8V4h20v4h2V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4z",fill:"currentColor"},null,-1)]))}}),ki={class:"flex-column"},bi={class:"flex-1"},Ni={class:"flex-1"},pn=e.defineComponent({__name:"Collapsable",props:{title:{},defaultCollapsed:{type:Boolean}},setup(t){const l=t,{t:o}=Q(),n=e.ref(l.defaultCollapsed??!1),r=()=>{n.value=!n.value};return(a,c)=>(e.openBlock(),e.createElementBlock("div",ki,[e.createElementVNode("div",{class:"flex-row gap05",style:{"align-items":"center"},onDblclick:e.withModifiers(r,["prevent"])},[e.renderSlot(a.$slots,"icon"),e.createElementVNode("div",bi,[e.renderSlot(a.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(a.title),1)])]),e.createElementVNode("div",null,[e.createVNode(e.unref(u.NButton),{text:"",onClick:r,title:n.value?e.unref(o)("Expand"):e.unref(o)("Collapse")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createBlock(e.unref(Le),{key:0})):(e.openBlock(),e.createBlock(e.unref(Ds),{key:1}))]),_:1})]),_:1},8,["title"])])],32),e.withDirectives(e.createElementVNode("div",Ni,[e.renderSlot(a.$slots,"default")],512),[[e.vShow,!n.value]])]))}});function xi(t){for(const l in t)delete t[l]}function mn(t){const l={};for(const o of t){const n=o.name,r=l[n];if(o.nullable==!1)switch(o.dataType){case"number":l[n]=Number(r)||0;break;case"boolean":case"bool":l[n]=fe(r)||!1;break;default:const a=Go(o.dataType);a!=null&&(l[n]=a)}}return l}function hn(t,l,o){for(const n of l){const r=n.name,a=t[r];switch(n.dataType){case"number":n.nullable==!1?o[r]=Number(a)||0:o[r]=Number(a)||null;break;case"boolean":case"bool":n.nullable==!1?o[r]=fe(a)||!1:o[r]=fe(a)||null;break;default:o[r]=a||null;break}}}function gn(t,l){const o={};return Object.assign(o,t),hn(t,l,o),o}function Si(t){if(!t)return!0;switch(t){case"number":case"boolean":return!1;default:return!0}}function yn(t,l){const o=l||(r=>r.toString()),n=[];if(t.length){for(const r of t)if(typeof r=="string"&&r)n.push({name:r,label:o(ee(r)),visibility:!0,editor:"text"});else if(Ae(r)&&r.editing!="hidden"&&r.name){const a={name:r.name,role:r.role&&!Array.isArray(r.role)?[r.role]:r.role,dataType:r.dataType,minValue:r.minValue,maxValue:r.maxValue,group:r.group,nullable:r.required==null?Si(r.dataType):!r.required,label:r.title?o(r.title):o(ee(r.name)),visibility:!0,readonly:r.readonly,sortable:r.sortable,editor:r.editor||r.dataType||"text",editorConfig:r.editorConfig,tagSource:r.tagSource,description:r.description};r.editing=="readonly"?a.readonly=!0:(r.editing=="create"||r.editing=="edit")&&(a.visibility=[r.editing]),r.required!=null&&(a.nullable=!r.required),r.values&&(Array.isArray(r.values)?(a.values=r.values,a.valueSource={type:"static",isLoading:!1,values:r.values.map(c=>{if(typeof c=="string"){let f=c;return f&&(r.prefix&&(f=r.prefix+f),r.suffix&&(f=f+r.suffix)),{value:c,label:o(f)}}else return c})}):typeof r.values=="function"?a.valueSource={type:"function",func:r.values,isLoading:!1}:Array.isArray(r.values.source)?a.valueSource={type:"static",isLoading:!1,values:r.values.source.map(c=>{if(typeof c=="string"){let f=c;return f&&(r.prefix&&(f=r.prefix+f),r.suffix&&(f=f+r.suffix)),{value:c,label:o(f)}}else return c})}:a.valueSource={type:"remote",isLoading:!1,key:r.values.key,label:r.values.label,subLabel:r.values.subLabel,renderLabel:r.values.renderLabel,labelTemplate:r.values.labelTemplate,prefix:r.values.prefix,suffix:r.values.suffix,i18n:r.i18n,filterable:r.values.filterable,sourceUrl:r.values.source,values:[]}),n.push(a)}}return n}function yt(t){if(t){if(typeof t=="number")return t;switch(t){case"x-large":return 480;case"large":return 300;case"medium":return 160;case"small":return 60;case"x-small":return 30;default:return t}}else return t}function wt(t){const l=new Array;for(const o of t)if(typeof o=="string")l.push({name:o,title:ee(o),sortIndex:0,visible:!0});else if(Ae(o)&&o.grid!="none"){if(o.visible!=null&&(typeof o.visible=="boolean"&&!o.visible||typeof o.visible=="function"&&!o.visible.call(null)))continue;const n={name:o.name,title:o.title,role:o.role&&!Array.isArray(o.role)?[o.role]:o.role,behavior:o.grid,align:o.align,fixed:o.gridFixed,dataType:o.dataType,href:o.href,i18n:o.i18n,template:o.template,prefix:o.prefix,suffix:o.suffix,formatter:o.formatter,display:o.display,values:o.values,width:yt(o.size),minWidth:yt(o.minWidth),textOverflow:o.textOverflow,sortIndex:0,sortable:o.sortable==null?!0:o.sortable,referencePage:o.referencePage,tagSource:o.tagSource,visible:!0,className:o.className,render:o.render,click:o.click};o.children&&o.children.length&&(n.children=wt(o.children)),l.push(n)}return l.sort((o,n)=>(o.sortIndex||0)-(n.sortIndex||0)),l}function Ii(t,l){return ke.render(t,l)}function wn(t,l){var r;const o=l||(a=>a.toString()),n=new Array;for(const a of t)if(Ae(a)&&a.search){const c={name:a.name,role:a.role&&!Array.isArray(a.role)?[a.role]:a.role,label:a.title?o(a.title):o(ee(a.name)),editor:a.editor||a.dataType||"text",dataType:a.dataType,nullable:!0,searchMethod:"normal",template:a.template,prefix:a.prefix,suffix:a.suffix};if(typeof a.search=="boolean")c.searchMethod="normal";else if(typeof a.search=="string")a.search=="range"&&(c.searchMethod=a.search);else{if(a.search.editor&&(c.editor=a.search.editor),a.search.method=="range"?c.searchMethod="range":c.searchMethod="normal",a.search.required&&(c.nullable=!1),a.search.role){const f=Array.isArray(a.search.role)?a.search.role:[a.search.role];if(c.role)for(let m of f)c.role.includes(m)||c.role.push(m);else c.role=f}a.search.field&&(c.searchField=a.search.field),c.defaultValue=a.search.default}if(a.values&&(Array.isArray(a.values)?c.valueSource={type:"static",isLoading:!1,values:a.values.map(f=>{if(typeof f=="string"){let m=f;return a.formatter&&(m=a.formatter.call(null,m,null)??m),m&&(c.prefix&&(m=c.prefix+m),c.suffix&&(m=m+c.suffix)),{value:f,label:o(m)}}else return f})}:typeof a.values=="function"?c.valueSource={type:"function",func:a.values,isLoading:!1}:Array.isArray(a.values.source)?c.valueSource={type:"static",isLoading:!1,values:a.values.source.map(f=>{var m;return typeof f=="string"?{value:f,label:o(((m=a.formatter)==null?void 0:m.call(null,f,null))||f)}:f})}:c.valueSource={type:"remote",isLoading:!1,key:a.values.key,label:a.values.label,subLabel:a.values.subLabel,renderLabel:a.values.renderLabel,labelTemplate:a.values.labelTemplate,prefix:a.values.prefix,suffix:a.values.suffix,filterable:a.values.filterable,i18n:a.values.i18n,sourceUrl:a.values.source,values:[]},c.dataType=="boolean"&&Array.isArray((r=c.valueSource)==null?void 0:r.values))){const f=c.valueSource.values;f.length<=2&&f.splice(0,0,{value:"",label:""})}n.push(c)}return n}async function Fe(t,l,o,n,r){if(l.sourceUrl){l.isLoading=!0,l.values?l.values.length=0:l.values=[];try{let a=l.sourceUrl;o&&(a=v(a,o));const c=await t.get(a);if(c.isSuccess&&c.value!=null){let f=c.value;if(!Array.isArray(f)&&"rows"in f&&Array.isArray(f.rows)&&(f=f.rows),Array.isArray(f)){const m=f.filter(i=>i&&!0).map(i=>{if(typeof i=="string")return{value:i,label:n?n(i):i};{let s;if(l.renderLabel)s=l.renderLabel(i);else if(l.labelTemplate)s=ke.render(l.labelTemplate,i);else{if(s=i[l.label||"label"],n&&(s=n(s)),l.subLabel){const h=i[l.subLabel];typeof h=="string"&&(s+=" "+(n?n(h):h))}s&&(l.prefix&&(s=l.prefix+s),l.suffix&&(s=s+l.suffix))}return{value:i[l.key||"value"],label:s}}});r&&m.splice(0,0,{value:void 0,label:""}),l.values.length=0,l.values.push(...m)}}}finally{l.isLoading=!1}}}function Ct(t,l){return()=>e.h(u.NIcon,l?{color:l}:null,{default:()=>e.h(t)})}function Bi(t,l,o){if(t)return e.h(u.NIcon,o?{color:o}:null,{default:()=>e.h(l)})}function Vi(t,l,o){return e.h(u.NButton,Object.assign({text:!0,onClick:l},o),{default:()=>e.h(u.NIcon,{size:20},{default:()=>e.h(t)})})}function Mi(t,l){const o=t[l];let n="";return typeof o=="number"&&(o>0?n="text-positive":o<0&&(n="text-negative")),e.h("span",{class:n},o==null?void 0:o.toString())}const He=e.defineComponent({__name:"HaloDatePicker",props:{value:{},type:{},readonly:{type:Boolean},clearable:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=f=>{const m=jo(f);return m===void 0?null:m},a=e.ref(r(o.value)),c=f=>{if(f!=null){a.value=f;const m=o.type=="date"?st(f):it(f);n("update:value",m,f)}else n("update:value",null,f)};return e.watch(()=>o.value,f=>a.value=r(f)),(f,m)=>(e.openBlock(),e.createBlock(e.unref(u.NDatePicker),{value:a.value,type:f.type,placeholder:"",disabled:f.readonly,"onUpdate:value":c,clearable:f.clearable},null,8,["value","type","disabled","clearable"]))}}),kt=e.defineComponent({__name:"HaloTimePicker",props:{value:{},type:{},readonly:{type:Boolean},clearable:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=f=>{if(f==null)return null;if(typeof f=="number"){const m=new Date(2e3,1,1);return m.setSeconds(f),m.getTime()}else if(typeof f=="string"){const m=Oo(f);if(!m)return null;const i=new Date(2e3,1,1);return i.setMilliseconds(m.millisecond+m.second*1e3+m.minute*60*1e3+m.hour*60*60*1e3),i.getTime()}else return f instanceof Date?f.getTime():null},a=f=>{if(f!=null){c.value=f;const m=new Date;m.setTime(f);const i=m.getSeconds()+m.getMinutes()*60+m.getHours()*60*60;n("update:value",i)}else n("update:value",null)},c=e.ref(r(o.value));return e.watch(()=>o.value,f=>c.value=r(f)),(f,m)=>(e.openBlock(),e.createBlock(e.unref(u.NTimePicker),{value:c.value,type:f.type,placeholder:"",disabled:f.readonly,"onUpdate:value":a,clearable:f.clearable},null,8,["value","type","disabled","clearable"]))}}),bt=e.defineComponent({__name:"NullableBooleanInput",props:{value:{type:Boolean},readonly:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Q(),a=e.ref(typeof o.value=="boolean"?o.value.toString():""),c=[{value:null,label:""},{value:"true",label:r("Yes")},{value:"false",label:r("No")}],f=m=>{const i=fe(m);i==null?n("update:value",null):n("update:value",i)};return e.watch(()=>o.value,()=>a.value=typeof o.value=="boolean"?o.value.toString():""),(m,i)=>(e.openBlock(),e.createBlock(e.unref(u.NSelect),{value:a.value,options:c,placeholder:"",disabled:m.readonly,clearable:"","onUpdate:value":i[0]||(i[0]=s=>f(s))},null,8,["value","disabled"]))}}),Nt=()=>{const{t}=Q(),l=u.useMessage(),o=u.useDialog(),n=u.useModal(),r=u.useLoadingBar();let a=0;const c=w=>w&&t(w),f=w=>e.h("div",{},w.split(`
3
+ `).map(k=>e.h("span",{class:"line"},t(k)))),m=(w,k)=>{switch(k){case"create":l.create(()=>f(w));break;case"error":l.error(()=>f(w));break;case"loading":l.loading(t(w));break;case"success":l.success(t(w));break;case"warning":l.warning(t(w));break;default:case"info":l.info(t(w));break}},i=(w,k,x)=>{o.warning({title:t(w??"Confirm"),draggable:!0,content:()=>f(k),positiveText:t("OK"),negativeText:t("Cancel"),onPositiveClick:()=>x()})},s=(w,k,x)=>{o.success({title:t(k??"Success"),draggable:!0,content:()=>f(w),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},h=(w,k,x)=>{o.error({title:t(k??"Error"),draggable:!0,content:()=>f(w),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},g=(w,k,x)=>{o.info({title:t(k??"Information"),draggable:!0,content:()=>f(w),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},d=(w,k,x)=>{o.warning({title:t(k??"Warning"),draggable:!0,content:()=>f(w),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},y=w=>{let k=[];const x=n.create({title:t(w.title??"Search"),preset:"card",style:{width:w.width??"800px",height:w.height??"600px"},contentClass:"flex-column",draggable:w.draggable,content:()=>e.h(e.resolveComponent("SearchPanel"),{class:"flex-grow-1",config:w.config,multiSelect:w.multiSelect==!0,onSearchBack:E=>{w.callback.call(null,E)},onResultSelected:(E,H)=>{k=H??[]}}),footer:()=>e.h("div",{class:"flex-row",style:"justify-content:space-between"},[e.h(u.NButton,{type:"primary",style:"min-width: 100px",onClick:()=>{k.length&&(w.callback.call(null,k),x.destroy())}},()=>t("OK")),e.h(u.NButton,{ghost:!0,style:"min-width: 100px",onClick:()=>x.destroy()},()=>t("Close"))])})},B=(w,k)=>{const x=n.create({title:k,preset:"card",style:{width:"300px"},draggable:!0,content:()=>e.h("div",{class:"flex-column",style:"align-items: center"},[e.h(u.NQrCode,{value:w,size:160}),e.h("div",{class:"text-monospace",style:"font-size: large; margin: 0.25em"},w),e.h(u.NButton,{type:"primary",onClick:()=>x.destroy(),style:"align-self: center; min-width: 100px; margin-top: 1em;"},()=>t("Close"))])})},V=(w=!1)=>{a++,(w||a>0)&&r.start()},F=(w=!1)=>{a=Math.max(0,a-1),(w||a<=0)&&r.finish()};return{t:c,message:m,confirm:i,error:w=>l.error(t(w)),success:w=>l.success(t(w)),warning:w=>l.warning(t(w)),info:w=>l.info(t(w)),errorDialog:h,successDialog:s,warningDialog:d,infoDialog:g,showSearchModal:y,showQrModal:B,loadingBar:(w=!0)=>{w?V():F()},showLoadingBar:V,hideLoadingBar:F}};function Ti(){const t=e.ref(new Map),l=i=>(t.value.has(i)||t.value.set(i,{isLocked:!1,waitingQueue:[]}),t.value.get(i));async function o(i){const s=l(i);return s.isLocked?new Promise(h=>{s.waitingQueue.push(()=>{s.isLocked=!0,h(()=>r(i))})}):(s.isLocked=!0,()=>r(i))}function n(i){const s=l(i);return s.isLocked?null:(s.isLocked=!0,()=>r(i))}function r(i){const s=l(i);if(!s.isLocked)return;s.isLocked=!1;const h=s.waitingQueue.shift();h&&h(),!s.isLocked&&s.waitingQueue.length===0&&t.value.delete(i)}async function a(i,s){const h=await o(i);try{return await Promise.resolve(s())}finally{h()}}async function c(i,s,h="Failed to acquire the operation lock."){const g=n(i);if(!g)throw console.error(`Failed to acquire the operation lock.(key: ${i})`),h;try{return await Promise.resolve(s())}finally{g()}}function f(i){return l(i).isLocked}function m(i){t.value.delete(i)}return{runExclusive:a,lock:o,unlock:r,tryLock:n,runExclusiveOrThrow:c,isLocked:f,clearLock:m}}const ce=()=>{const t=Nt(),l=e.inject("axios"),o=Ti();async function n(s,h="Error"){if(s)if(s.response){let g=t.t(s.response.statusText);return s.response.data&&(s.response.data instanceof Blob?g+=`
4
+ `+t.t(await s.response.data.text()):g+=`
5
+ `+t.t(s.response.data.toString()),console.log(g)),g}else return s.toString();else return h}function r(s,h,g){g.mutexKey==null&&(g.mutexKey=g.url),t.confirm(s,h,()=>{c(g)})}async function a(s){var h,g,d,y,B,V,F;try{(h=s.loadingStatus)==null||h.call(null,!0);let S;s.data?S=await l.post(s.url,s.data):S=await l.post(s.url),(g=s.callback)==null||g.call(null,S),S.isSuccess?((d=s.success)==null||d.call(null,S.value),s.successMessage===!0?t.message("Successful operation.","success"):typeof s.successMessage=="string"&&t.message(s.successMessage,"success")):((y=s.fail)==null||y.call(null,S),S.errorMessage&&console.error(S.errorMessage),s.failMessage?t.message(s.failMessage,"error"):t.message(S.errorMessage??((B=S.value)==null?void 0:B.toString())??"Error","error"))}catch(S){((V=s.exception)==null?void 0:V.call(null,S))!=!0&&t.message(await n(S)??s.failMessage??"Error")}finally{(F=s.loadingStatus)==null||F.call(null,!1)}}async function c(s){var h;if(s.mutexKey)try{const g=typeof s.mutexKey=="boolean"?s.url:s.mutexKey;await o.runExclusiveOrThrow(g,()=>a(s))}catch(g){((h=s.exception)==null?void 0:h.call(null,g))!=!0&&t.message(await n(g)??s.failMessage??"Error")}else await a(s)}async function f(s){var h,g,d,y,B;try{(h=s.loadingStatus)==null||h.call(null,!0);let V=await l.get(s.url);if(V.isSuccess)return(g=s.callback)==null||g.call(null,V.value),V.value;s.quiet!=!0&&t.message(V.errorMessage??((d=V.value)==null?void 0:d.toString())??"Error","error")}catch(V){((y=s.exception)==null?void 0:y.call(null,V))!=!0&&t.message(await n(V)??"Error","error")}finally{(B=s.loadingStatus)==null||B.call(null,!1)}}async function m(s){var h,g,d,y;try{(h=s.loadingStatus)==null||h.call(null,!0),t.showLoadingBar(),await Eo(s.url,s.contentType,s.method),(g=s.callback)==null||g.call(null)}catch(B){((d=s.exception)==null?void 0:d.call(null,B))!=!0&&t.message(await n(B)??"Error","error")}finally{t.hideLoadingBar(),(y=s.loadingStatus)==null||y.call(null,!1)}}async function i(s){var h,g,d,y;try{(h=s.loadingStatus)==null||h.call(null,!0),t.showLoadingBar(),await pe(s.url,s.filename,s.contentType,s.method),(g=s.callback)==null||g.call(null)}catch(B){((d=s.exception)==null?void 0:d.call(null,B))!=!0&&t.message(await n(B)??"Error","error")}finally{t.hideLoadingBar(),(y=s.loadingStatus)==null||y.call(null,!1)}}return{post:c,get:f,confirmToPost:r,getHttpErrorMessage:n,openFile:m,downloadFile:i}},xt=e.defineComponent({__name:"HaloTagsInput",props:{value:{},disabled:{type:Boolean,default:!1},tagSource:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=xe(),a=ce(),c=e.ref(i(o.value)),f=e.ref([]);async function m(){if(o.tagSource){const h=await r.fetchSharedData(`tags:${o.tagSource}`,async()=>await a.get({url:`/api/core/CommonCodeItems/list?commonCode=${o.tagSource}`})??[]);f.value=h.map(g=>({value:g.code,label:`[${g.code}] ${g.name}`}))}else f.value=[]}function i(h){return h?h.split(","):[]}function s(h){o.disabled||(Array.isArray(h)?n("update:value",h.join(",")):n("update:value",h))}return e.watch(()=>o.value,h=>c.value=i(h)),e.watch(()=>o.tagSource,()=>m()),e.onMounted(()=>m()),(h,g)=>h.tagSource?(e.openBlock(),e.createBlock(e.unref(u.NSelect),{key:0,value:c.value,multiple:"",options:f.value,"onUpdate:value":s},null,8,["value","options"])):(e.openBlock(),e.createBlock(e.unref(u.NDynamicTags),{key:1,value:c.value,"onUpdate:value":s},null,8,["value"]))}}),St=e.defineComponent({__name:"ListInputModal",props:{title:{},message:{},value:{},placeholder:{default:""},maxLength:{},show:{type:Boolean},readonly:{type:Boolean}},emits:["update:show","update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Q(),a=()=>{o.readonly||n("update:value",f()),n("update:show",!1)},c=()=>{var i,s,h,g;return o.value?Array.isArray(o.value)?o.value.join(`
6
+ `):((g=(h=(s=(i=o.value)==null?void 0:i.replace(/\n/g,","))==null?void 0:s.split(","))==null?void 0:h.map(y=>y.trim()))==null?void 0:g.filter((y,B,V)=>y&&V.indexOf(y)==B)).join(`
7
+ `):o.value},f=()=>{var s,h,g;return m.value?((g=(h=(s=m.value)==null?void 0:s.split(/\r?\n/))==null?void 0:h.map(d=>d.trim()))==null?void 0:g.filter((d,y,B)=>d&&B.indexOf(d)==y)).join(","):""},m=e.ref(c());return e.watch(()=>o.value,()=>{m.value=c()}),(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{title:i.title,show:i.show,preset:"card",style:{width:"350px"},draggable:"",onClose:s[2]||(s[2]=()=>i.$emit("update:show",!1))},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:a,disabled:i.readonly},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:s[1]||(s[1]=()=>i.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.message),1)]),_:1}),e.createVNode(e.unref(u.NInput),{value:m.value,"onUpdate:value":s[0]||(s[0]=h=>m.value=h),placeholder:i.placeholder,maxlength:i.maxLength,type:"textarea",readonly:i.readonly,rows:16,class:"halo-form-code"},null,8,["value","placeholder","maxlength","readonly"])]),_:1})]),_:1},8,["title","show"]))}}),It=e.defineComponent({__name:"HaloModalInput",props:{value:{},label:{},inputReadOnly:{type:Boolean},placeholder:{},config:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Q(),a=e.ref(!1),c=o.config;function f(){a.value=!a.value}function m(i){i!=null&&(n("update:value",i),a.value=!1)}return e.watch(()=>o.value,i=>{console.log(`value changed: [${i}]`)}),e.onMounted(()=>{console.log("Modal-Input onMounted")}),(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{readonly:i.inputReadOnly,value:i.value,placeholder:i.placeholder,"onUpdate:value":s[0]||(s[0]=h=>i.$emit("update:value",h))},null,8,["readonly","value","placeholder"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:f},{default:e.withCtx(()=>s[4]||(s[4]=[e.createTextVNode(" … ",-1)])),_:1,__:[4]}),e.createVNode(e.unref(u.NModal),{show:a.value,"onUpdate:show":s[2]||(s[2]=h=>a.value=h),title:e.unref(r)(e.unref(c).title??i.label??""),onClose:s[3]||(s[3]=()=>a.value=!1),preset:"card",style:e.normalizeStyle(e.unref(c).modalStyle),"content-style":"display: flex; flex-direction: column;"},{default:e.withCtx(()=>[e.unref(c).componentType?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(c).componentType),{key:0,style:e.normalizeStyle(e.unref(c).style),"onUpdate:selected":s[1]||(s[1]=h=>m(h))},null,40,["style"])):e.createCommentVNode("",!0)]),_:1},8,["show","title","style"])]),_:1}))}}),Ai={key:0,style:{"flex-grow":"1"}},Ei={key:0,style:{"text-align":"right"}},_i=["readonly","disabled"],Li=["readonly","disabled"],Be=e.defineComponent({__name:"FormInput",props:{value:{},readonly:{type:Boolean},formItem:{},label:{},placeholder:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=e.ref(o.value),{t:a}=Q(),c=e.inject("axios"),f=e.ref(void 0),m=e.ref(!1),i=e.ref(!1),s=()=>{var d;if(typeof((d=o.formItem)==null?void 0:d.editor)=="function")return o.formItem.editor.call(o.formItem,{readonly:o.readonly,formItem:o.formItem,label:o.label,placeholder:o.placeholder,value:r.value,"onUpdate:value":y=>{r.value=y}})},h=d=>{if(d.target instanceof HTMLInputElement){const y=d.target.files;y!=null&&y.length?r.value=y[0]:r.value=null}},g=d=>{var B,V;const y=(B=o.formItem)==null?void 0:B.valueSource;y&&y.type=="remote"&&y.sourceUrl&&y.filterable&&Fe(c,y,{searchWords:d},F=>y.i18n?a(F):F,((V=o.formItem)==null?void 0:V.nullable)!=!1)};return e.watch(r,d=>{n("update:value",d)}),e.watch(()=>o.value,d=>{r.value=d}),e.onMounted(()=>{var d,y;(y=(d=o.formItem)==null?void 0:d.role)!=null&&y.length&&(m.value=o.formItem.role.includes("list"),f.value=o.formItem.role.map(B=>`halo-form-${B}`).join(" "))}),(d,y)=>{var H,L,T,O,M,b,A,D,_,G,$,W,J,te,ne,oe,Z,re;const B=e.resolveComponent("n-switch"),V=e.resolveComponent("n-text"),F=e.resolveComponent("n-select"),S=e.resolveComponent("n-input-number"),w=e.resolveComponent("n-checkbox"),k=e.resolveComponent("n-input"),x=e.resolveComponent("n-icon"),E=e.resolveComponent("n-button");return d.formItem?(e.openBlock(),e.createElementBlock("div",Ai,[typeof d.formItem.editor=="function"?(e.openBlock(),e.createBlock(e.KeepAlive,{key:0},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s),{value:r.value,"onUpdate:value":y[0]||(y[0]=Y=>r.value=Y)},null,40,["value"]))],1024)):((H=d.formItem.editor)==null?void 0:H.startsWith("@"))==!0?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.formItem.editor.substring(1)),{key:1,value:r.value,"onUpdate:value":y[1]||(y[1]=Y=>r.value=Y),config:d.formItem.editorConfig,label:d.formItem.label,readonly:d.readonly,disabled:d.readonly},null,40,["value","config","label","readonly","disabled"])):d.formItem.editor=="modal"?(e.openBlock(),e.createBlock(It,{key:2,value:r.value,"onUpdate:value":y[2]||(y[2]=Y=>r.value=Y),config:d.formItem.editorConfig,label:d.formItem.label},null,8,["value","config","label"])):d.formItem.editor=="boolean"&&Array.isArray(d.formItem.values)&&d.formItem.values.length>1?(e.openBlock(),e.createBlock(B,{key:3,value:r.value,"onUpdate:value":y[3]||(y[3]=Y=>r.value=Y),style:e.normalizeStyle((L=d.formItem.editorConfig)==null?void 0:L.style)},{checked:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.formItem.values[0]),1)]),unchecked:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.formItem.values[1]),1)]),_:1},8,["value","style"])):d.formItem.valueSource?(e.openBlock(),e.createBlock(F,{key:4,value:r.value,"onUpdate:value":y[4]||(y[4]=Y=>r.value=Y),remote:d.formItem.valueSource.type=="remote",loading:d.formItem.valueSource.isLoading,options:d.formItem.valueSource.values,filterable:d.formItem.valueSource.filterable,multiple:((T=d.formItem.role)==null?void 0:T.includes("list"))==!0,placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((O=d.formItem.editorConfig)==null?void 0:O.style),onSearch:g},{action:e.withCtx(()=>[d.formItem.valueSource.filterable?(e.openBlock(),e.createElementBlock("div",Ei,[e.createVNode(V,{depth:"3",italic:""},{default:e.withCtx(()=>[e.createElementVNode("small",null,e.toDisplayString(e.unref(a)("Enter text to filter the result list.")),1)]),_:1})])):e.createCommentVNode("",!0)]),_:1},8,["value","remote","loading","options","filterable","multiple","disabled","clearable","style"])):d.formItem.editor=="number"?(e.openBlock(),e.createBlock(S,{key:5,value:r.value,"onUpdate:value":y[5]||(y[5]=Y=>r.value=Y),min:d.formItem.minValue,max:d.formItem.maxValue,clearable:d.formItem.nullable,readonly:d.readonly,placeholder:d.placeholder,style:e.normalizeStyle((M=d.formItem.editorConfig)==null?void 0:M.style)},null,8,["value","min","max","clearable","readonly","placeholder","style"])):d.formItem.editor=="boolean"&&d.formItem.nullable?(e.openBlock(),e.createBlock(bt,{key:6,value:r.value,"onUpdate:value":y[6]||(y[6]=Y=>r.value=Y),placeholder:"",disabled:d.readonly,style:e.normalizeStyle((b=d.formItem.editorConfig)==null?void 0:b.style)},null,8,["value","disabled","style"])):d.formItem.editor=="boolean"?(e.openBlock(),e.createBlock(w,{key:7,checked:r.value,"onUpdate:checked":y[7]||(y[7]=Y=>r.value=Y),disabled:d.readonly,style:e.normalizeStyle((A=d.formItem.editorConfig)==null?void 0:A.style)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:1},8,["checked","disabled","style"])):d.formItem.editor=="datetime"?(e.openBlock(),e.createBlock(He,{key:8,value:r.value,"onUpdate:value":y[8]||(y[8]=Y=>r.value=Y),type:"datetime",placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((D=d.formItem.editorConfig)==null?void 0:D.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="date"?(e.openBlock(),e.createBlock(He,{key:9,value:r.value,"onUpdate:value":y[9]||(y[9]=Y=>r.value=Y),type:"date",placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((_=d.formItem.editorConfig)==null?void 0:_.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="time"?(e.openBlock(),e.createBlock(kt,{key:10,value:r.value,"onUpdate:value":y[10]||(y[10]=Y=>r.value=Y),placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((G=d.formItem.editorConfig)==null?void 0:G.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="color"?(e.openBlock(),e.createBlock(mt,{key:11,value:r.value,"onUpdate:value":y[11]||(y[11]=Y=>r.value=Y),placeholder:"",disabled:d.readonly,readonly:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle(($=d.formItem.editorConfig)==null?void 0:$.style)},null,8,["value","disabled","readonly","clearable","style"])):d.formItem.editor=="tags"?(e.openBlock(),e.createBlock(xt,{key:12,value:r.value,"onUpdate:value":y[12]||(y[12]=Y=>r.value=Y),tagSource:d.formItem.tagSource,placeholder:"",disabled:d.readonly,style:e.normalizeStyle((W=d.formItem.editorConfig)==null?void 0:W.style)},null,8,["value","tagSource","disabled","style"])):d.formItem.editor=="image"?(e.openBlock(),e.createElementBlock("input",{key:13,type:"file",onChange:h,readonly:d.readonly,disabled:d.readonly,style:e.normalizeStyle((J=d.formItem.editorConfig)==null?void 0:J.style)},null,44,_i)):d.formItem.editor=="file"?(e.openBlock(),e.createElementBlock("input",{key:14,type:"file",onChange:h,readonly:d.readonly,disabled:d.readonly,style:e.normalizeStyle((te=d.formItem.editorConfig)==null?void 0:te.style)},null,44,Li)):d.formItem.editor=="password"?(e.openBlock(),e.createBlock(k,{key:15,value:r.value,"onUpdate:value":y[13]||(y[13]=Y=>r.value=Y),class:e.normalizeClass(f.value),placeholder:d.placeholder??"",type:"password",readonly:d.readonly,style:e.normalizeStyle((ne=d.formItem.editorConfig)==null?void 0:ne.style)},null,8,["value","class","placeholder","readonly","style"])):d.formItem.editor=="textarea"?(e.openBlock(),e.createBlock(k,{key:16,value:r.value,"onUpdate:value":y[14]||(y[14]=Y=>r.value=Y),class:e.normalizeClass(f.value),type:"textarea",placeholder:d.placeholder??"",readonly:d.readonly,style:e.normalizeStyle((oe=d.formItem.editorConfig)==null?void 0:oe.style)},null,8,["value","class","placeholder","readonly","style"])):(e.openBlock(),e.createBlock(k,{key:17,value:r.value,"onUpdate:value":y[16]||(y[16]=Y=>r.value=Y),class:e.normalizeClass(f.value),placeholder:d.placeholder??"",readonly:d.readonly,clearable:d.formItem.nullable,type:d.formItem.editor,style:e.normalizeStyle((Z=d.formItem.editorConfig)==null?void 0:Z.style)},{suffix:e.withCtx(()=>[m.value?(e.openBlock(),e.createBlock(E,{key:0,text:"",title:e.unref(a)("If there are multiple items, separate them with commas."),onClick:y[15]||(y[15]=()=>i.value=!0)},{default:e.withCtx(()=>[e.createVNode(x,null,{default:e.withCtx(()=>[e.createVNode(e.unref(ns))]),_:1})]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1},8,["value","class","placeholder","readonly","clearable","type","style"])),m.value?(e.openBlock(),e.createBlock(St,{key:18,show:i.value,"onUpdate:show":y[17]||(y[17]=Y=>i.value=Y),title:d.formItem.label,readonly:d.readonly,message:e.unref(a)("Please enter a list, separated by lines or commas."),value:r.value,"onUpdate:value":y[18]||(y[18]=Y=>r.value=Y),style:e.normalizeStyle((re=d.formItem.editorConfig)==null?void 0:re.style)},null,8,["show","title","readonly","message","value","style"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}}),zi=e.defineComponent({name:"DefaultPropertyForm",components:{FormInput:Be,NForm:u.NForm,NFormItem:u.NFormItem},props:{readOnly:{type:Boolean,default:!1},method:String,columns:Number,groupLayout:String,formItems:Array,data:Object,original:Object},emits:["itemChange"],setup(t,l){const{t:o}=Q(),n=e.inject("axios"),r=e.ref(null),a=e.ref([]),c=e.ref(t.columns||1),f=e.ref({}),m=e.ref(h(t.formItems)),i=d(t.formItems),s=e.ref(void 0);function h(w){return w?[...new Set(w.map(x=>x.group))].map(x=>({label:x||"General",items:w.filter(E=>E.group==x)})):[]}function g(w){return w.dataType=="boolean"&&!w.nullable?" ":w.label}function d(w){const k={};if(w&&w.length)for(const x of w){const E=[];x.nullable==!1&&x.dataType!="boolean"&&E.push({required:!0,message:o("Must be filled here.")}),E.length&&(k[x.name]=E)}return k}async function y(w,k){var x;if(k.type=="remote"&&k.sourceUrl)Fe(n,k,null,E=>k.i18n?o(E):E,w.nullable);else if(k.type=="function"&&k.func){k.isLoading=!0;try{const E=(x=k.func)==null?void 0:x.call(void 0);E&&(k.values=E)}finally{k.isLoading=!1}}}function B(){var w;(w=t.formItems)==null||w.forEach(k=>{k.valueSource&&(k.valueSource.type=="remote"||k.valueSource.type=="function")&&y(k,k.valueSource)})}function V(w,k){l.emit("itemChange",{item:w,data:t.data,value:k})}function F(w){return!!(w.readonly==!0||t.readOnly==!0||t.method&&Array.isArray(w.readonly)&&w.readonly.includes(t.method))}function S(w){return!!(w.visibility==!0||t.method&&Array.isArray(w.visibility)&&w.visibility.includes(t.method))}return e.onMounted(()=>{B(),t.data&&(f.value=t.data)}),e.watch(()=>t.data,w=>f.value=w||{}),{t:o,formRef:r,formItemsRef:a,getItemLabel:g,originalModel:s,model:f,rules:i,formColumns:c,updateValue:V,formGroups:m,isReadonly:F,isVisible:S}}}),$i={class:"item-box"},Di={class:"item-box"},Ri={class:"item-box"};function Oi(t,l,o,n,r,a){const c=e.resolveComponent("form-input"),f=e.resolveComponent("n-text"),m=e.resolveComponent("n-form-item-grid-item"),i=e.resolveComponent("n-grid"),s=e.resolveComponent("n-tab-pane"),h=e.resolveComponent("n-tabs"),g=e.resolveComponent("n-grid-item"),d=e.resolveComponent("n-form");return e.openBlock(),e.createBlock(d,{ref:"formRef",model:t.model,rules:t.rules,"label-placement":"left","label-width":160},{default:e.withCtx(()=>[t.groupLayout=="tab"?(e.openBlock(),e.createBlock(h,{key:0,type:"line"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formGroups,y=>(e.openBlock(),e.createBlock(s,{key:y,name:y.label,tab:t.t(y.label)},{default:e.withCtx(()=>[e.createVNode(i,{cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.items,B=>e.withDirectives((e.openBlock(),e.createBlock(m,{ref_for:!0,ref:"formItemsRef",key:B.name,label:t.getItemLabel(B),path:B.name,feedback:B.errorMessage,"validation-status":B.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",$i,[e.createVNode(c,{"form-item":B,value:t.model[B.name],"onUpdate:value":[V=>t.model[B.name]=V,V=>t.updateValue(B,V)],readonly:t.isReadonly(B),label:B.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),B.description?(e.openBlock(),e.createBlock(f,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(B.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(B)]])),128))]),_:2},1032,["cols"])]),_:2},1032,["name","tab"]))),128)),e.renderSlot(t.$slots,"more-tabs",{},void 0,!0)]),_:3})):t.groupLayout=="column"?(e.openBlock(),e.createBlock(i,{key:1,cols:t.formGroups.length,"x-gap":"8"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formGroups,y=>(e.openBlock(),e.createBlock(g,{key:y},{default:e.withCtx(()=>[e.createVNode(i,{cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.items,B=>e.withDirectives((e.openBlock(),e.createBlock(m,{ref_for:!0,ref:"formItemsRef",key:B.name,label:t.getItemLabel(B),path:B.name,feedback:B.errorMessage,"validation-status":B.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",Di,[e.createVNode(c,{"form-item":B,value:t.model[B.name],"onUpdate:value":[V=>t.model[B.name]=V,V=>t.updateValue(B,V)],readonly:t.isReadonly(B),label:B.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),B.description?(e.openBlock(),e.createBlock(f,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(B.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(B)]])),128))]),_:2},1032,["cols"])]),_:2},1024))),128))]),_:1},8,["cols"])):(e.openBlock(),e.createBlock(i,{key:2,cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formItems,y=>e.withDirectives((e.openBlock(),e.createBlock(m,{ref_for:!0,ref:"formItemsRef",key:y.name,label:t.getItemLabel(y),path:y.name,feedback:y.errorMessage,"validation-status":y.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",Ri,[e.createVNode(c,{"form-item":y,value:t.model[y.name],"onUpdate:value":[B=>t.model[y.name]=B,B=>t.updateValue(y,B)],readonly:t.isReadonly(y),label:y.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),y.description?(e.openBlock(),e.createBlock(f,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(y.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(y)]])),128))]),_:1},8,["cols"]))]),_:3},8,["model","rules"])}const Bt=le(zi,[["render",Oi],["__scopeId","data-v-b01b239f"]]),ji={class:"pg-value flex-grow-1"},Vt=e.defineComponent({__name:"PropertyGrid",props:{columns:{default:1},hideEmpty:{type:Boolean},data:{},names:{},justify:{}},setup(t){const l=t,{t:o}=Q(),n=e.ref(a()),r=()=>{n.value=a()};function a(){var s;const c=new Array,f=l.data,m=l.names,i=l.hideEmpty;if(f)if(m)for(const h of m)if(typeof h=="string")(!i||f[h])&&c.push({name:h,label:o(ee(h)),value:f[h],span:1});else{const g={name:h.name??h.label,label:o(h.label||ee(h.name)),value:f[h.name],span:h.span||1,dataType:h.dataType,role:h.role};g.value!=null&&(g.dataType=="boolean"?g.value=fe(g.value)?o("Yes"):o("No"):h.i18n&&(g.value=o((s=g.value)==null?void 0:s.toString()))),(!i||g.value)&&c.push(g)}else if(Array.isArray(f))for(const h of f)(!i||h.value)&&c.push({name:h.label,label:o(ee(h.label)),value:h.value,span:1});else for(const h in f)(!i||f[h])&&c.push({name:h,label:o(ee(h)),value:f[h],span:1});return c}return e.watch(()=>l.data,()=>r()),e.watch(()=>l.hideEmpty,()=>r()),(c,f)=>(e.openBlock(),e.createBlock(e.unref(u.NGrid),{cols:c.columns,"item-responsive":""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value.filter(m=>!c.hideEmpty||m.value),m=>(e.openBlock(),e.createBlock(e.unref(u.NGridItem),{class:"pg-item",key:m.label,span:m.span},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default",{label:m.label,value:m.value,class:"flex-1"},()=>[e.createElementVNode("div",{class:"flex-row justify flex-1",style:e.normalizeStyle({"justify-content":c.justify})},[e.createVNode(e.unref(u.NText),{class:"pg-label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.label)+":",1)]),_:2},1024),e.createElementVNode("div",ji,[m.role=="percent"?(e.openBlock(),e.createBlock(e.unref(u.NProgress),{key:0,type:"line",percentage:Number(m.value),title:m.value+"%",style:{"margin-top":"auto","max-width":"80%"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value)+" % ",1)]),_:2},1032,["percentage","title"])):(e.openBlock(),e.createBlock(e.unref(u.NText),{key:1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:2},1024))])],4),e.renderSlot(c.$slots,"item-tools",{item:m})])]),_:2},1032,["span"]))),128))]),_:3},8,["cols"]))}}),Pi={style:{"align-items":"center"},class:"flex-row gap05"},Fi={class:"flex-row gap05"},Hi={class:"flex-column flex-1 gap05"},Gi={key:0,class:"flex-row",style:{"justify-content":"space-between"}},Ki={class:"text-monospace",style:{"font-size":"24pt"}},Wi={key:0},Zi=["src"],Yi=["src"],Qi={class:"flex-row gap05",style:{"justify-content":"flex-end"}},Cn=le(e.defineComponent({__name:"DetailPage",props:{loading:{type:Boolean},title:{},subject:{},data:{},properties:{},showBarcode:{type:Boolean,default:!0},columns:{default:3}},emits:["refresh"],setup(t){const{t:l}=Q(),o=e.ref(!0),n=e.ref(localStorage.getItem("detail-page-full-size")=="true"),r=e.ref(localStorage.getItem("detail-page-show-info")!="false"),a=()=>{n.value=!n.value,localStorage.setItem("detail-page-full-size",n.value.toString())},c=()=>{o.value=!o.value},f=()=>{r.value=!r.value,localStorage.setItem("detail-page-show-info",r.value.toString())};return(m,i)=>(e.openBlock(),e.createBlock(e.unref(u.NSpin),{show:m.loading,class:"flex-grow-1 flex-column","content-class":"flex-column flex-grow-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NCard),{embedded:"",class:e.normalizeClass(["detail-page-card flex-grow-1",{"detail-page-card-center":!n.value}]),segmented:{content:!0,footer:"soft"},"content-class":"flex-column"},e.createSlots({"header-extra":e.withCtx(()=>[e.createElementVNode("div",Fi,[e.createVNode(e.unref(u.NButton),{onClick:i[0]||(i[0]=()=>m.$emit("refresh")),title:e.unref(l)("Refresh")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ci))]),_:1})]),_:1},8,["title"]),e.createVNode(e.unref(u.NButton),{onClick:i[1]||(i[1]=()=>a()),title:n.value?e.unref(l)("Collapse"):e.unref(l)("Expand")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ri))]),_:1})]),_:1},8,["title"])])]),default:e.withCtx(()=>[e.createElementVNode("div",Hi,[m.subject?(e.openBlock(),e.createElementBlock("div",Gi,[e.createElementVNode("div",null,[e.createElementVNode("div",Ki,e.toDisplayString(m.subject),1),m.showBarcode?(e.openBlock(),e.createElementBlock("div",Wi,[e.createElementVNode("img",{src:"/api/core/Barcode/Image?code="+m.subject+"&format=CODE_128&height=30&margin=4,2"},null,8,Zi)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[m.showBarcode?(e.openBlock(),e.createElementBlock("img",{key:0,src:"/api/core/QR/Image?code="+m.subject+"&format=CODE_128&width=100&height=100"},null,8,Yi)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[m.data?(e.openBlock(),e.createBlock(e.unref(u.NCard),{key:0},e.createSlots({header:e.withCtx(()=>[e.createElementVNode("div",{class:"flex-row gap05",style:{"align-items":"center"},onClick:f},[r.value?(e.openBlock(),e.createBlock(e.unref(u.NIcon),{key:0,size:24},{default:e.withCtx(()=>[e.createVNode(e.unref(Le))]),_:1})):(e.openBlock(),e.createBlock(e.unref(u.NIcon),{key:1,size:24},{default:e.withCtx(()=>[e.createVNode(e.unref(zs))]),_:1})),e.createElementVNode("span",null,e.toDisplayString(e.unref(l)("Property")),1)])]),default:e.withCtx(()=>[r.value?(e.openBlock(),e.createBlock(Vt,{key:0,data:m.data,columns:m.columns,names:m.properties,"hide-empty":o.value},null,8,["data","columns","names","hide-empty"])):e.createCommentVNode("",!0)]),_:2},[r.value?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",Qi,[e.createVNode(e.unref(u.NButton),{text:"",onClick:i[2]||(i[2]=()=>c()),title:e.unref(l)("More")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(rn))]),_:1})]),_:1},8,["title"])])]),key:"0"}:void 0]),1024)):e.createCommentVNode("",!0)]),e.renderSlot(m.$slots,"default",{},void 0,!0)])]),_:2},[m.title?{name:"header",fn:e.withCtx(()=>[e.createElementVNode("div",Pi,[e.renderSlot(m.$slots,"icon",{},()=>[e.createVNode(e.unref(u.NIcon),{size:24},{default:e.withCtx(()=>[e.createVNode(e.unref(Ps))]),_:1})],!0),e.createElementVNode("strong",null,e.toDisplayString(e.unref(l)(m.title)),1)])]),key:"0"}:void 0]),1032,["class"])]),_:3},8,["show"]))}}),[["__scopeId","data-v-c909376f"]]),Xi={style:{"min-height":"50px"}},Mt=e.defineComponent({__name:"ExportModal",props:{show:{type:Boolean},range:{},supportedFormats:{},supportedRanges:{}},emits:["export","close"],setup(t){const l=t,{t:o}=Q(),n=e.ref(null),r=e.ref(f()),a=e.ref(null),c=e.ref(m());function f(){let i=[{label:o("Excel"),value:"excel"},{label:o("Json"),value:"json"},{label:o("Text"),value:"text"},{label:o("XML"),value:"xml"}];const s=l.supportedFormats;return s&&(i=i.filter(h=>s.includes(h.value))),n.value=i.length?i[0].value:null,i}function m(){const i=l.supportedRanges||["empty","selection","page","all"],s=[{label:o("Selection"),value:"selection"},{label:o("Current Page"),value:"page"},{label:o("Search"),value:"search"},{label:o("All"),value:"all"},{label:o("Empty(Template)"),value:"empty"}].filter(h=>i.includes(h.value));return l.range?a.value=l.range:a.value=s.length?s[0].value:null,s}return e.watch(()=>l.range,i=>{i&&(a.value=i)}),(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:i.show,preset:"card",title:e.unref(o)("Export Options"),style:{"max-width":"400px"},draggable:"",onClose:s[4]||(s[4]=()=>i.$emit("close"))},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{onClick:s[2]||(s[2]=()=>i.$emit("export",n.value,a.value)),style:{"min-width":"100px"},type:"primary"},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(sn))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(o)("Export")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:s[3]||(s[3]=()=>i.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",Xi,[r.value.length>1?(e.openBlock(),e.createBlock(e.unref(u.NFormItem),{key:0,label:e.unref(o)("File Format")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSelect),{options:r.value,value:n.value,"onUpdate:value":s[0]||(s[0]=h=>n.value=h)},null,8,["options","value"])]),_:1},8,["label"])):e.createCommentVNode("",!0),c.value.length>1?(e.openBlock(),e.createBlock(e.unref(u.NFormItem),{key:1,label:e.unref(o)("Data Range")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSelect),{options:c.value,value:a.value,"onUpdate:value":s[1]||(s[1]=h=>a.value=h)},null,8,["options","value"])]),_:1},8,["label"])):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"options")])]),_:3},8,["show","title"]))}}),Ji={class:"flex-column gap1",style:{"justify-content":"center","align-items":"center"}},kn=e.defineComponent({__name:"EmptyDetailView",props:{message:{default:"Please select a object."}},setup(t){const{t:l}=Q();return(o,n)=>(e.openBlock(),e.createElementBlock("div",Ji,[e.createVNode(e.unref(u.NIcon),{depth:5,size:48},{default:e.withCtx(()=>[e.createVNode(e.unref(pi))]),_:1}),e.createVNode(e.unref(u.NText),{depth:"3",style:{opacity:"0.6"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)(o.message)),1)]),_:1})]))}}),qi=e.defineComponent({components:{FullscreenIcon:Ka,ExitFullscreenIcon:Ha},emits:["change"],setup(t,l){const{t:o}=Q(),n=xe(),r=e.computed(()=>n.isFullscreen);function a(i){i||(i=document.body),i.requestFullscreen&&i.requestFullscreen()}function c(){document.exitFullscreen&&document.exitFullscreen()}function f(i){var s;if(r.value)c();else{const h=(s=i.target)==null?void 0:s.closest(".fullscreen-view");a(h)}}function m(){const i=!!document.fullscreenElement;n.setIsFullscreen(i),l.emit("change",i)}return e.onMounted(()=>{document.addEventListener("fullscreenchange",m),document.addEventListener("mozfullscreenchange",m),document.addEventListener("webkitfullscreenchange",m),document.addEventListener("msfullscreenchange",m)}),{t:o,isFullscreen:r,toggleFullscreen:f}}});function Ui(t,l,o,n,r,a){const c=e.resolveComponent("fullscreen-icon"),f=e.resolveComponent("exit-fullscreen-icon"),m=e.resolveComponent("n-icon"),i=e.resolveComponent("n-button");return e.openBlock(),e.createBlock(i,{onClick:t.toggleFullscreen},{icon:e.withCtx(()=>[e.createVNode(m,null,{default:e.withCtx(()=>[t.isFullscreen?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(c,{key:0})),t.isFullscreen?(e.openBlock(),e.createBlock(f,{key:1})):e.createCommentVNode("",!0)]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(t.t("Toggle Fullscreen")),1)]),_:1},8,["onClick"])}const bn=le(qi,[["render",Ui]]),Tt=t=>{const l=e.inject("axios"),o={},n=[],r=[];t.forEach(h=>{typeof h=="string"?(o[h]=!1,n.push(h)):(o[h.id]=!1,o[h.name]=!1,n.push(h.id),r.push(h))});let a=0;async function c(h){a||await m(h)}function f(){for(let h in o)o[h]=!1}async function m(h){f();const g=n.filter(d=>(d==null?void 0:d.length)==32);if(g.length)try{let d=await l.get(`/api/core/Account/CheckPermissions?permissions=${encodeURIComponent(g.join())}`);d.isSuccess&&d.value!=null?(a++,d.value.forEach(y=>{o[y]=!0;const B=r.find(V=>V.id==y);B&&(o[B.name]=!0)}),h==null||h.call(null,o)):console.error(d.errorMessage)}catch(d){console.error(d)}}function i(){for(let h in o)if(!o[h])return!1;return!0}function s(){for(let h in o)if(o[h])return!0;return!1}return{flags:o,check:m,checkOnce:c,all:i,any:s}},vi={key:0,class:"flex-row",style:{"align-items":"center","justify-content":"space-between",gap:"0.25em","margin-bottom":"1em"}},ec={style:{display:"grid","grid-template-columns":"auto 1fr",gap:"0.5em","margin-top":"1em","align-items":"center"}},Nn=200,At=e.defineComponent({__name:"GridConfigModal",props:{gridId:{},show:{type:Boolean},pageSize:{},gridColumns:{}},emits:["close","update:pageSize","update:config"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Q(),a=ce(),c=e.inject("axios"),f=u.useMessage(),m=Tt(["2E2466DDD34847C8B33460E4277A6528"]),i=e.ref(o.pageSize),s=e.ref(!1),h=e.ref(!1),g=k=>k?k.map((x,E)=>({columnId:x.name,title:x.title?r(x.title):r(ee(x.name)),visible:!0,sortIndex:E})).sort((x,E)=>x.sortIndex-E.sortIndex):[],d=k=>(x,E)=>{let H=null;if(k=="visible"){const L=je(x[k]);H=e.h(u.NIcon,{size:"20"},{default:()=>L?e.h(ln):e.h(nn)})}else k=="move_up"?H=e.h(u.NIcon,{size:"20"},{default:()=>e.h(Vs)}):k=="move_down"&&(H=e.h(u.NIcon,{size:"20"},{default:()=>e.h(bs)}));return e.h(u.NButton,{text:!0,onClick:L=>{y(x,E,k),L.stopPropagation()}},{default:()=>H})};function y(k,x,E){switch(E){case"visible":k.visible=!k.visible;break;case"move_up":if(x>0&&S.value){const H=S.value.splice(x,1);S.value.splice(x-1,0,H[0])}break;case"move_down":if(S.value&&x<S.value.length-1){const H=S.value.splice(x,1);S.value.splice(x+1,0,H[0])}break}}const B=()=>{const k=o.gridId;k&&a.confirmToPost("Reset","Are you sure reset the configuration of this data grid?",{url:`/api/core/UserDataGrids/Reset?dataGridId=${k}`,successMessage:"The configuration has been reset, please refresh the page.",success:()=>{n("update:config",null)}})};async function V(){if(!o.gridId)return;const k={dataGridId:o.gridId,pageSize:i.value,columns:S.value.filter(x=>x.columnId).map((x,E)=>({columnId:x.columnId,visible:x.visible,sortIndex:E}))};k.pageSize&&(k.pageSize=Math.max(1,Math.min(Nn,k.pageSize)));try{const x=s.value&&h.value,E=await c.post(`/api/core/UserDataGrids/Save?isDefault=${x}`,k);(E==null?void 0:E.isSuccess)==!0?(f.success(r("The configuration has been saved, please refresh the page.")),n("update:pageSize",i.value),n("update:config",k)):f.error((E==null?void 0:E.errorMessage)||r("Error"))}catch(x){f.error((x==null?void 0:x.toString())||r("Error"))}}async function F(){if(o.gridId&&S.value.length)try{const k=s.value&&h.value,x=await c.get(`/api/core/UserDataGrids/Entity?dataGridId=${encodeURIComponent(o.gridId)}?isDefault=${k}`);if(x!=null&&x.isSuccess)if(x.value){i.value=x.value.pageSize;for(const E of x.value.columns){const H=S.value.find(L=>L.columnId==E.columnId);H&&(H.visible=E.visible,H.sortIndex=E.sortIndex),S.value.sort((L,T)=>L.sortIndex-T.sortIndex)}}else S.value=g(o.gridColumns),i.value=o.pageSize;else console.log(x==null?void 0:x.errorMessage)}catch(k){console.log(k)}}e.watch(()=>o.show,k=>{k&&(m.checkOnce(x=>{h.value=x["2E2466DDD34847C8B33460E4277A6528"]}),F())}),e.watch(()=>o.gridColumns,()=>S.value=g(o.gridColumns)),e.watch(s,()=>F());const S=e.ref(g(o.gridColumns)),w=[{title:r("Name"),key:"title"},{title:r("Visible"),key:"visible",width:80,align:"center",fixed:"right",render:d("visible")},{key:"move_up",width:30,align:"center",fixed:"right",render:d("move_up")},{key:"move_down",width:30,align:"center",fixed:"right",render:d("move_down")},{key:"empty",width:20,fixed:"right"}];return(k,x)=>{const E=e.resolveComponent("n-space");return e.openBlock(),e.createBlock(e.unref(u.NModal),{show:k.show,preset:"card",title:e.unref(r)("Config Data Grid"),style:{"max-width":"500px"},draggable:"",onClose:x[3]||(x[3]=()=>k.$emit("close"))},{action:e.withCtx(()=>[e.createVNode(E,{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{onClick:V,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Save")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:B,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Reset")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:x[2]||(x[2]=()=>k.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[h.value?(e.openBlock(),e.createElementBlock("div",vi,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("System Default")),1),e.createVNode(e.unref(u.NSwitch),{value:s.value,"onUpdate:value":x[0]||(x[0]=H=>s.value=H)},null,8,["value"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NDataTable),{columns:w,data:S.value,"max-height":450,size:"small"},null,8,["data"]),e.createElementVNode("div",ec,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Page Size")),1),e.createVNode(e.unref(u.NInputNumber),{value:i.value,"onUpdate:value":x[1]||(x[1]=H=>i.value=H),max:Nn,min:1,style:{"max-width":"200px"}},null,8,["value"])])]),_:1},8,["show","title"])}}}),xn=e.defineComponent({__name:"HaloButtonSelect",props:{value:{},sourceUrl:{},additionalQuery:{},labelFormatter:{type:Function},keyField:{},labelField:{},subLabelField:{},size:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Q(),a=e.inject("axios"),c=e.ref(!1),f=e.ref([]);async function m(s){let h=o.sourceUrl;if(h){const g=o.labelFormatter,d=o.keyField,y=o.labelField,B=o.subLabelField,V=o.additionalQuery;c.value=!0,f.value=[];try{V&&(h=v(h,V,!0));const F=await a.get(h);if(F.isSuccess&&F.value!=null){let S=F.value;if(!Array.isArray(S)&&"rows"in S&&Array.isArray(S.rows)&&(S=S.rows),Array.isArray(S)){const w=S.filter(k=>k&&!0).map(k=>{if(typeof k=="string")return{value:k,label:g?g(k):r(k)};{let x=k[y||"label"];if(g&&(x=g(x)),B){const E=k[B];typeof E=="string"&&(x+=" "+(g?g(E):E))}return{value:k[d||"value"],label:x}}});f.value=w}}}finally{c.value=!1}}}function i(s,h){n("update:value",s,h)}return e.watch(()=>o.sourceUrl,()=>m()),e.onMounted(()=>{m()}),(s,h)=>{const g=e.resolveComponent("n-radio-button"),d=e.resolveComponent("n-radio-group");return e.openBlock(),e.createBlock(d,{value:s.value,size:s.size,"onUpdate:value":i},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,y=>(e.openBlock(),e.createBlock(g,{key:y.value,value:y.value,label:y.label},null,8,["value","label"]))),128))]),_:1},8,["value","size"])}}}),Ge=le(e.defineComponent({__name:"SearchForm",props:{searchItems:{},searchArgs:{},groupOptions:{},groupBy:{}},emits:["update:searchArgs","update:groupBy"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Q(),c=e.inject("axios"),f=S=>S==null?void 0:S.map(w=>typeof w=="string"?{label:a(w),value:w}:w),m=()=>{const S=new Array;if(n.searchItems)for(const w of n.searchItems)if(typeof w=="string")S.push({name:w,label:ee(w),editor:"text",nullable:!0,visibility:!0,searchMethod:"normal"});else{let k=w;w.searchField&&(k=Object.assign({},w),k.name=w.searchField),S.push(k)}return S},i=()=>{const S={};if(B.forEach(w=>{S[w.name]=null,w.searchMethod=="range"&&(S[w.name+"From"]=null,S[w.name+"To"]=null)}),n.searchArgs)for(const w in S)n.searchArgs[w]!=null&&(S[w]=n.searchArgs[w]);return S},s=()=>{for(const S in V)V[S]=null},h=async S=>{var k,x;const w=S.valueSource;if(w){if(w.type=="remote"&&w.sourceUrl)await Fe(c,w,null,E=>w.i18n?a(E):E,!1),S.nullable==!1&&((k=w.values)!=null&&k.length)&&(V[S.name]=w.values[0].value);else if(w.type=="function"&&w.func){w.isLoading=!0;try{const E=(x=w.func)==null?void 0:x.call(void 0);E&&(w.values=E)}finally{w.isLoading=!1}}}},g=()=>{var w;const S={};for(const k of B){const x=k.searchField??k.name;if(k.searchMethod=="range"){const E=d(x+"From",k);E!=null&&(S[x+"From"]=E);let H=d(x+"To",k);H!=null&&(k.editor=="date"&&typeof H=="string"&&(H=ie(H,ye).add(1,"days").format(ye)),S[x+"To"]=H)}else{const E=d(x,k);E!=null&&(((w=k.role)==null?void 0:w.includes("list"))==!0&&typeof E=="string"?E.includes(",")?S[x]=E.split(","):S[x]=[E]:S[x]=E)}}return S},d=(S,w)=>{var x,E;let k=V[S];if(!(typeof k=="string"&&(k=k.trim(),k==""&&!w.valueSource))){if(Array.isArray((x=w.valueSource)==null?void 0:x.values)){const H=(E=w.valueSource)==null?void 0:E.values;if(H){if(H.some(L=>L.value==V[S]))k=V[S];else if(k=="")return;if(w.dataType=="boolean"){if(typeof k=="boolean")return k;const L=H.findIndex(T=>T.value==k);return L>-1&&(H.length==2?k=L==0:H.length==3&&L>0&&(k=L==1)),typeof k=="boolean"?k:Pe(k,w.dataType,w.role)}}}return Pe(k,w.dataType,w.role)}},y=()=>{r("update:searchArgs",g())},B=m(),V=e.reactive(i()),F=e.ref(f(n.groupOptions));return e.watch(()=>n.groupOptions,()=>F.value=f(n.groupOptions)),e.onMounted(()=>{i(),B.forEach(S=>{S.valueSource&&(S.valueSource.type=="remote"||S.valueSource.type=="function"?h(S):S.valueSource.type=="static")})}),l({reset:s,updateValues:y,pickValues:g}),(S,w)=>(e.openBlock(),e.createBlock(e.unref(u.NForm),{model:V,"label-placement":"left","label-width":"auto"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NGrid),{"x-gap":"12",cols:"1 700:2 1200:3"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(B),k=>(e.openBlock(),e.createBlock(e.unref(u.NGridItem),{key:k.name},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NFormItem),{label:e.unref(a)(k.label==null?k.name:k.label),path:k.name},{default:e.withCtx(()=>[k.searchMethod=="range"?(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),{key:0},{default:e.withCtx(()=>[e.createVNode(Be,{"form-item":k,value:V[k.name+"From"],"onUpdate:value":x=>V[k.name+"From"]=x,style:{"flex-grow":"1"},onInput:w[0]||(w[0]=()=>y())},null,8,["form-item","value","onUpdate:value"]),e.createVNode(e.unref(u.NInputGroupLabel),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("to")),1)]),_:1}),e.createVNode(Be,{"form-item":k,value:V[k.name+"To"],"onUpdate:value":x=>V[k.name+"To"]=x,style:{"flex-grow":"1"},onInput:w[1]||(w[1]=()=>y())},null,8,["form-item","value","onUpdate:value"])]),_:2},1024)):(e.openBlock(),e.createBlock(Be,{key:1,"form-item":k,value:V[k.name],"onUpdate:value":x=>V[k.name]=x,onInput:w[2]||(w[2]=()=>y())},null,8,["form-item","value","onUpdate:value"]))]),_:2},1032,["label","path"])]),_:2},1024))),128))]),_:1}),F.value?(e.openBlock(),e.createBlock(e.unref(u.NGrid),{key:0,"x-gap":"12",cols:"1 700:2 1200:3"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NGridItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NFormItem),{label:e.unref(a)("Group By")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSelect),{value:S.groupBy,options:F.value,"onUpdate:value":w[3]||(w[3]=k=>S.$emit("update:groupBy",k))},null,8,["value","options"])]),_:1},8,["label"])]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["model"]))}}),[["__scopeId","data-v-8b391a0f"]]),tc={class:"flex-row gap05"},Et=e.defineComponent({__name:"TagsView",props:{tags:{},tagSource:{},size:{default:"small"}},setup(t){const l=t,o=xe(),n=ce(),r=e.ref([]);async function a(){var f;const c=((f=l.tags)==null?void 0:f.map(m=>({value:m,text:m})))??[];if(r.value=c,l.tagSource){const m=await o.fetchSharedData(`tags:${l.tagSource}`,async()=>await n.get({url:`/api/core/CommonCodeItems/list?commonCode=${l.tagSource}`})??[]);for(const i of c){const s=m.find(h=>h.code==i.value);s&&(i.desc=s.name,i.color=s.color)}r.value=[...c]}}return e.watch(()=>l.tags,()=>a()),e.onMounted(()=>a()),(c,f)=>(e.openBlock(),e.createElementBlock("div",tc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,m=>(e.openBlock(),e.createBlock(e.unref(u.NTag),{key:m.value,title:m.desc,color:{borderColor:m.color},size:c.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.text),1)]),_:2},1032,["title","color","size"]))),128))]))}}),Ke=e.defineComponent({__name:"HaloGrid",props:{keyField:{default:"__key__"},checkable:{type:Boolean,default:!0},dragSorting:{type:Boolean},columns:{},data:{},withEdit:{type:Boolean,default:!1},withDelete:{type:Boolean,default:!1},withDetails:{type:Boolean,default:!1},multiSelect:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},maxHeight:{},height:{},selectedId:{},selectedIds:{},flexHeight:{type:Boolean,default:!0}},emits:["editRow","deleteRow","showDetails","columnButtonClick","update:selectedIds","update:selectedId","update:sorter","rowSorting"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Q(),c=de.useRouter(),f=Nt(),m=e.ref(void 0),i=e.ref([]),s=e.ref(void 0),h=()=>{const b={};return typeof n.height=="number"?b.height=`${n.height}px`:typeof n.height=="string"&&(b.height=n.height),b},g=e.ref(h()),d=()=>{var D;const b=i.value,A=(D=n.data)==null?void 0:D.filter(_=>b.includes(_[n.keyField]));r("update:selectedIds",b,A),b.length&&r("update:selectedId",b[0])},y=b=>b[n.keyField],B=(b,A)=>{let D=0,_=0;const G=new Set;for(const $ of A){let W,J,te;if(typeof $=="string")te=$,W={key:$,title:a(ee($))};else if(te=$.name||`column_${D}`,!($.behavior=="none"||$.visible==!1))if($.behavior=="link"||$.behavior=="router-link")W={key:te,title:$.title?a($.title):void 0,align:$.align,fixed:$.fixed||void 0,width:$.width,sorter:$.sortable==!0,cssStyle:$.cssStyle,render:$.render||F($)};else if($.behavior=="button")W={key:te,title:$.title?a($.title):void 0,align:$.align||"center",fixed:$.fixed||void 0,width:$.width,sorter:$.sortable==!0,cssStyle:$.cssStyle,render:$.render||F($)};else{let ne=$.align,oe=[];if(!$.display)switch($.dataType){case"number":ne=ne||"right",J=60,oe.push("text-num");break;case"boolean":ne=ne||"center",J=60;break;case"date":J=100;break;case"datetime":J=180;break;case"timespan":ne=ne||"center",J=80;break;case"time":J=80,oe.push(`text-${$.dataType}`);break}if(W={key:te,title:$.title==null?a(ee($.name)):$?a($.title):void 0,titleAlign:"center",align:ne,width:$.width||J,sorter:$.sortable==!0,cssStyle:$.cssStyle,minWidth:$.minWidth,resizable:!0,fixed:$.fixed,render:$.render||F($)},typeof $.className=="string"?oe.push($.className):Array.isArray($.className)&&oe.push(...$.className),oe.length&&(W.className=oe.join(" ")),!W.width&&W.minWidth&&(W.width=W.minWidth),$.referencePage&&typeof W.width=="number"&&(W.width+=30),$.role&&$.role.includes("qr")&&typeof W.width=="number"&&(W.width+=30),$.role&&$.role.includes("percent")&&typeof W.width=="number"&&(W.width+=30,W.align||(W.align="right")),($.textOverflow=="ellipsis"||$.textOverflow=="clip")&&(W.ellipsis={tooltip:!0},W.resizable=!0,J||(J=400)),$.children&&$.children.length){const Z=[];B(Z,$.children),W.children=Z,Z.some(re=>re.width)&&(W.width=void 0)}}W&&!G.has(te)&&(G.add(te),b.push(W),typeof $=="object"&&typeof $.width=="number"?_+=$.width:_+=J||150)}return _},V=()=>{if(n.columns){const b=[];let A=0;return n.checkable&&(b.push({type:"selection",fixed:"left"}),A+=30),A+=B(b,n.columns),n.withEdit&&(b.push({key:"btn-edit",width:30,fixed:"right",render(D,_){return e.h(u.NButton,{text:!0,titie:a("Edit"),onClick:G=>{r("editRow",D,_),G.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#5C6BC0",size:"20"},{default:()=>e.h(Xo)})})}}),A+=30),n.withDelete&&(b.push({key:"btn-delete",width:30,fixed:"right",render(D,_){return e.h(u.NButton,{text:!0,titie:a("Delete"),onClick:G=>{r("deleteRow",D,_),G.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#f44336",size:"20"},{default:()=>e.h(Qo)})})}}),A+=30),n.withDetails&&(b.push({key:"btn-details",width:30,fixed:"right",render(D,_){return e.h(u.NButton,{text:!0,titie:a("Details"),onClick:G=>{r("showDetails",D,_),G.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#4CAF50",size:"20"},{default:()=>e.h(cs)})})}}),A+=30),n.dragSorting&&(b.push({key:"drag-sorting-handler",width:30,fixed:"right",render(){return e.h(u.NIcon,{color:"#90A4AE",size:"20",class:"drag-sorting-handle"},{default:()=>e.h(fn)})}}),A+=30),m.value=A,b}else return[]},F=b=>(A,D)=>{var te,ne,oe;let _=null;const G=b.display||b.name;if(b.template&&typeof b.template=="function")_=b.template.call(null,A,D);else if(b.dataType=="bool"||b.dataType=="boolean"){const Z=je(A[G]);if(b.values&&b.values.length>1)return b.i18n?a(Z?b.values[0]:b.values[1]):Z?b.values[0]:b.values[1];Z!=null?_=e.h(u.NIcon,{size:"20",class:Z?"cell-checked":"cell-unchecked"},{default:()=>Z?e.h(Es):e.h(ni)}):_=e.h("span")}else if(b.dataType=="date")_=st($o(A[G]));else if(b.dataType=="time")_=Po(Ro(A[G]));else if(b.dataType=="timespan")_=Fo(A[G]);else{let Z=A[G];b.formatter?Z=b.formatter(Z,A):b.template&&(Z=ke.render(b.template,A)),typeof Z=="string"&&(b.prefix&&(Z=b.prefix+Z),b.suffix&&(Z=Z+b.suffix),b.i18n&&(Z=a(Z))),_=Z}let $=b.role;if($&&!Array.isArray($)&&($=[$]),$!=null&&$.length)if($.includes("tag")){let Z;Array.isArray(A[G])?Z=A[G]:Z=(oe=(ne=(te=A[G])==null?void 0:te.toString())==null?void 0:ne.split(","))==null?void 0:oe.filter(re=>re.length),Z&&Z.length&&(_=e.h(Et,{tags:Z,tagSource:b.tagSource},{}))}else _&&(_=e.h("span",{class:$.map(Z=>{switch(Z){case"status":return`status-tag status-${A[G]}`;default:return`halo-form-${Z}`}}).join(" "),style:b.cssStyle},[_]));const W=typeof b.href=="function"?b.href(A):b.href;if(b.behavior=="link")W?_=e.h("a",{href:ke.render(W,A),target:"_blank"},[_]):_=e.h("a",{href:"#",onClick:Z=>{var re;r("columnButtonClick",b.name,A,D),(re=b==null?void 0:b.click)==null||re.call(null,A,D),Z.stopPropagation()}},[_]);else if(b.behavior=="router-link"&&W){const Z=_;_=e.h(de.RouterLink,{to:ke.render(W,A)},{default:()=>Z})}else if(b.behavior=="button"){const Z=_;_=e.h(u.NButton,{size:"tiny",tag:"a",onClick:re=>{var Y;r("columnButtonClick",b.name,A,D),(Y=b==null?void 0:b.click)==null||Y.call(null,A,D),re.stopPropagation()}},{default:()=>Z})}const J=[];if(b.role&&(b.role.includes("qr")&&J.push(e.h(u.NButton,{quaternary:!0,size:"tiny",class:"btn-cell-qr",title:a("QR Code"),onClick:()=>w(b,D)},{default:()=>e.h(u.NIcon,{},{default:()=>e.h(si)})})),b.role.includes("percent"))){const Z=Ko(A[G]);J.push(e.h(u.NProgress,{showIndicator:!1,type:"circle",status:Z&&Z>100?"error":"success",percentage:Z||0,class:"percent-mark",style:"width: 1em; margin-bottom: auto; margin-top: auto"}))}return b.referencePage&&J.push(e.h(u.NButton,{quaternary:!0,size:"tiny",class:"btn-cell-ref",title:a("Details"),onClick:()=>S(b,D)},{default:()=>e.h(u.NIcon,{},{default:()=>e.h(gt)})})),J.length?e.h("div",{style:"display: flex; justify-content: space-between;"},[e.h("div",{style:"flex-shrink: 1; flex-grow: 1; overflow: hidden;"},[_]),e.h("div",{},...J)]):_},S=(b,A)=>{if(Array.isArray(n.data)&&A!=null&&A>=0&&A<n.data.length&&b.referencePage){const D=n.data[A],_=ke.render(b.referencePage,D);_.startsWith("/")&&c.push({path:_})}},w=(b,A)=>{if(Array.isArray(n.data)&&A!=null&&A>=0&&A<n.data.length){const D=n.data[A][b.name];if(typeof D=="string"){const _=a(b.title??ee(b.name));f.showQrModal(D,_)}}},k=(b,A)=>({onClick:D=>{if(D.target instanceof HTMLElement&&D.target.classList.contains("n-checkbox-box__border")==!1){const _=y(b);_!==void 0&&!i.value.includes(_)&&(i.value=[_],d())}},ondblclick:D=>{D.target instanceof HTMLTableCellElement&&r("editRow",b,A)}}),x=(b,A)=>{A!=!1||!n.multiSelect?(i.value=[b],d()):i.value.includes(b)||(i.value.push(b),d())},E=(b,A)=>{if(A!=!1||!n.multiSelect)i.value=b,d();else{const D=i.value.slice();for(const _ of b)D.includes(_)||D.push(_);i.value.length<D.length&&(i.value=D,d())}},H=b=>{n.multiSelect?i.value=b:i.value=b.slice(0,1),d()},L=()=>i.value,T=(b,A)=>{Array.isArray(n.data)&&b>-1&&Lo(n.data,b,A)},O=()=>{var D;const b=(D=s.value)==null?void 0:D.$el,A=b==null?void 0:b.querySelector("tbody.n-data-table-tbody");if(A&&Array.isArray(n.data)){const _=e.ref(n.data);Zt.useDraggable(A,_,{animation:150,ghostClass:"draging-ghost",handle:".drag-sorting-handle",onUpdate(G){var J;const $=G.oldIndex,W=G.newIndex;if($!=null&&W!=null&&n.data&&$<((J=n.data)==null?void 0:J.length)){const te=n.data[$];r("rowSorting",{oldIndex:$,newIndex:W,source:te,updateGrid:()=>T($,W)})}}})}},M=e.ref(V());return e.watch(()=>n.data,b=>{const D=b.map(_=>_[n.keyField]);i.value=i.value.filter(_=>D.includes(_)),d()}),e.watch(()=>n.columns,()=>M.value=V()),e.watch(()=>n.height,()=>g.value=h()),e.onMounted(()=>{n.dragSorting&&setTimeout(()=>{O()},500)}),l({selectRow:x,selectRows:E,getSelectedRowKeys:L}),(b,A)=>(e.openBlock(),e.createBlock(e.unref(u.NDataTable),{ref_key:"nTableRef",ref:s,class:"flex-1",columns:M.value,data:b.data,size:"small","row-key":y,"row-props":k,loading:b.loading,"single-line":!1,"max-height":b.maxHeight,"scroll-x":m.value,striped:"",remote:"","flex-height":b.flexHeight,style:e.normalizeStyle(g.value),"checked-row-keys":i.value,"onUpdate:checkedRowKeys":[A[0]||(A[0]=D=>i.value=D),H],"scrollbar-props":{trigger:"none"},"onUpdate:sorter":A[1]||(A[1]=D=>b.$emit("update:sorter",D))},null,8,["columns","data","loading","max-height","scroll-x","flex-height","style","checked-row-keys"]))}}),oc={class:"flex-column gap05"},nc={class:"flex-row gap05",style:{"justify-content":"space-between"}},We=e.defineComponent({__name:"SearchPanel",props:{title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean},additionQuery:{}},emits:["searchBack","resultSelected"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Q(),c=u.useMessage(),f=e.inject("axios"),m=e.ref(null),i=e.ref(1),s=e.ref(0),h=e.ref(!1),g=e.ref(Array()),d=e.ref(Array());let y=!0;function B(x){if(x){const E=x.rows;E.forEach((H,L)=>{H.__key__=L}),g.value=E,s.value=x.pageCount||1,i.value=x.pageIndex+1}}function V(){g.value=[],s.value=0,i.value=1}function F(x){S(x)}async function S(x){var L,T,O;const E=((L=m.value)==null?void 0:L.pickValues())||{},H=(T=n.config)==null?void 0:T.searchAction;if(E&&H){const M={pageSize:((O=n.config)==null?void 0:O.pageSize)||10,pageIndex:(x||i.value)-1};Object.assign(M,E),n.additionQuery&&(typeof n.additionQuery=="function"?Object.assign(M,n.additionQuery.call(null)):Object.assign(M,n.additionQuery));try{h.value=!0;const b=await f.post(H,M);b.isSuccess&&b.value!=null?(y=!1,B(b.value)):c.error(a(b.errorMessage||"Error"))}catch(b){c.error(b==null?void 0:b.toString())}finally{h.value=!1}}}function w(){const x=d.value;if(x!=null&&x.length){const E=g.value.filter(H=>x.includes(H.__key__));r("searchBack",E,n.config),n.autoClose==!0&&close()}}function k(){n.searchOnMounted&&y&&S(1)}return e.watch(()=>n.config,x=>{x&&(y=!0),V()}),e.onMounted(()=>k()),l({searchPage:S,returnAndClose:w}),(x,E)=>(e.openBlock(),e.createElementBlock("div",oc,[e.createVNode(Ge,{ref_key:"searchFormRef",ref:m,cols:2,"search-items":x.config.searchFields},null,8,["search-items"]),e.createElementVNode("div",nc,[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:E[0]||(E[0]=()=>S(1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Search")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:E[1]||(E[1]=()=>{var H;return(H=m.value)==null?void 0:H.reset()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Reset")),1)]),_:1})]),e.createVNode(Ke,{class:"flex-grow-1",style:{height:"200px"},columns:x.config.gridColumns,loading:h.value,data:g.value,multiSelect:x.multiSelect,selectedIds:d.value,"onUpdate:selectedIds":[E[2]||(E[2]=H=>d.value=H),E[3]||(E[3]=(H,L)=>x.$emit("resultSelected",H,L))],onDblclickRow:E[4]||(E[4]=H=>x.$emit("searchBack",[H]))},null,8,["columns","loading","data","multiSelect","selectedIds"]),e.createVNode(e.unref(u.NPagination),{page:i.value,"onUpdate:page":[E[5]||(E[5]=H=>i.value=H),F],"page-count":s.value,"show-quick-jumper":"",style:{"align-self":"self-end"}},null,8,["page","page-count"])]))}}),lc={key:0,class:"flex-column flex-grow-1"},rc={class:"flex-row",style:{"align-items":"center"}},ac={style:{"margin-left":"0.5em"}},sc={class:"flex-row",style:{"justify-content":"space-between"}},_t=e.defineComponent({__name:"SearchModal",props:{show:{type:Boolean},width:{},height:{},title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean,default:!1},additionQuery:{}},emits:["searchBack","update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Q(),a=e.ref(void 0);let c=!0;const f=e.ref([]);function m(g,d){f.value=d??[]}function i(g){g&&g.length&&n("searchBack",g,o.config)}function s(){f.value&&f.value.length&&(n("searchBack",f.value,o.config),o.autoClose==!0&&h())}function h(){n("update:show",!1)}return e.watch(()=>o.config,g=>{g&&(c=!0)}),e.watch(a,()=>{var g;o.searchOnMounted&&c&&(c=!1,(g=a.value)==null||g.searchPage(1))}),e.watch(()=>o.show,g=>{var d;g&&o.searchOnMounted&&c&&(c=!1,(d=a.value)==null||d.searchPage(1))}),(g,d)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:g.show,style:e.normalizeStyle({width:g.width??"900px",height:g.height??"650px"}),preset:"card","display-directive":"show","content-class":"flex-column",onClose:d[0]||(d[0]=()=>h())},{header:e.withCtx(()=>[e.createElementVNode("div",rc,[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(me))]),_:1}),e.createElementVNode("span",ac,e.toDisplayString(e.unref(r)(g.title)),1)])]),action:e.withCtx(()=>[e.createElementVNode("div",sc,[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:s},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:h},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})])]),default:e.withCtx(()=>[g.config?(e.openBlock(),e.createElementBlock("div",lc,[e.createVNode(We,{ref_key:"searchPanelRef",ref:a,class:"flex-grow-1",config:g.config,"multi-select":g.multiSelect,"auto-close":g.autoClose,"addition-query":g.additionQuery,onResultSelected:m,onSearchBack:i},null,8,["config","multi-select","auto-close","addition-query"])])):e.createCommentVNode("",!0)]),_:1},8,["show","style"]))}}),ic={style:{"margin-bottom":"12px","min-height":"100px"}},Lt=le(e.defineComponent({__name:"ImportModal",props:{title:{default:"Import File"},multiple:{type:Boolean},action:{},accept:{},show:{type:Boolean},timeout:{},additionParams:{},templateCode:{},templateUrl:{},beforeUpload:{},disabled:{type:Boolean}},emits:["uploaded","update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Q(),a=u.useMessage(),c=u.useLoadingBar(),f=e.inject("axios"),m=ce(),i=e.reactive({}),s=e.ref(!1),h=e.ref(new Array),g=e.ref(!1),d=e.ref(void 0),y=e.ref(B());function B(){if(o.templateUrl)return o.templateUrl;if(o.templateCode)return`/api/core/DataExchangeTemplates/ImportTemplate?templateCode=${o.templateCode}`}async function V(){var k;if(g.value)return a.warning("Is uploading..."),!1;let w=typeof o.action=="function"?o.action.call(void 0):o.action;if(w&&o.templateCode&&(w=v(w,{templateCode:o.templateCode})),(k=h.value)!=null&&k.length&&w){if(!o.multiple&&h.value.length>1)return a.error("Only one file can be uploaded."),!1;if(o.beforeUpload&&o.beforeUpload.call(null,{files:h})==!1)return!1;try{g.value=!0;const x=h.value.filter(E=>E.status=="pending"||E.status=="error").map(E=>F(E,w));await Promise.all(x),h.value.every(E=>E.status=="finished")&&(h.value.length=0,a.success(r("Upload Success.")),s.value=!1)}catch(x){d.value=(x==null?void 0:x.toString())||r("Error")}finally{g.value=!1}}}async function F(w,k){const x=new FormData;x.append("file",w.file);const E={timeout:o.timeout||1e3*60*10,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:L=>{w.percentage=Math.round(L.loaded*100/L.total)}};w.percentage=0,w.status="uploading";let H=k;o.additionParams&&(H=v(k,o.additionParams)),i&&(H=v(H,i));try{const L=await f.post(H,x,E);L.isSuccess?(w.status="finished",n("uploaded",L.value),n("update:show",!1)):(w.status="error",w.errorMessage=L.errorMessage,d.value=r(L.errorMessage||"Error"))}catch(L){w.status="error",w.errorMessage=L==null?void 0:L.toString(),d.value=(L==null?void 0:L.toString())||r("Error")}}async function S(){const w=y.value;if(w)try{c.start(),await pe(w)}catch(k){a.error(await m.getHttpErrorMessage(k,"Error"))}finally{c.finish()}}return e.watch(()=>o.show,()=>{d.value=void 0,h.value=[]}),(w,k)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:w.show,"onUpdate:show":k[3]||(k[3]=x=>w.$emit("update:show",x)),preset:"card",title:e.unref(r)(w.title),style:{"max-width":"600px"},draggable:""},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px"},onClick:V,disabled:w.disabled||!w.action||g.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ci))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Upload")),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(u.NSpace),null,{default:e.withCtx(()=>[y.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,style:{"min-width":"100px"},onClick:S},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(sn))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Download Template")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:k[2]||(k[2]=()=>w.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:g.value},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NUpload),{multiple:w.multiple,"default-upload":!1,"file-list":h.value,"onUpdate:fileList":k[0]||(k[0]=x=>h.value=x),accept:w.accept,disabled:!w.action,"show-retry-button":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NUploadDragger),null,{default:e.withCtx(()=>[e.createElementVNode("div",ic,[e.createVNode(e.unref(u.NIcon),{size:"48",depth:3},{default:e.withCtx(()=>[e.createVNode(e.unref(ps))]),_:1})]),e.createVNode(e.unref(u.NText),{style:{"font-size":"16px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Click or drag files to this area to upload.")),1)]),_:1})]),_:1})]),_:1},8,["multiple","file-list","accept","disabled"]),e.renderSlot(w.$slots,"options",{options:i},void 0,!0)]),_:3})]),_:3},8,["show"]),d.value?(e.openBlock(),e.createBlock(e.unref(u.NAlert),{key:0,type:"error",class:"my-1",closable:"",onClose:k[1]||(k[1]=()=>d.value=void 0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1})):e.createCommentVNode("",!0)]),_:3},8,["show","title"]))}}),[["__scopeId","data-v-f6faec10"]]),zt=e.defineComponent({__name:"InputModal",props:{title:{},message:{},value:{},placeholder:{},maxLength:{},type:{},lines:{},clearable:{type:Boolean},show:{type:Boolean},submitting:{type:Boolean}},emits:["close","commit","update:show","update:value"],setup(t,{emit:l}){var m;const o=t,n=l,{t:r}=Q(),a=e.ref((m=o.value)==null?void 0:m.toString()),c=()=>{n("close"),n("update:show",!1)},f=()=>{n("commit",a.value),n("update:value",a.value)};return e.watch(()=>o.value,i=>a.value=i==null?void 0:i.toString()),(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{title:i.title,show:i.show,preset:"card",style:{width:"400px"},onClose:c},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},loading:i.submitting,onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["loading"]),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:c},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:i.submitting},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.message),1)]),_:1}),e.createVNode(e.unref(u.NInput),{value:a.value,"onUpdate:value":s[0]||(s[0]=h=>a.value=h),placeholder:i.placeholder,maxlength:i.maxLength,type:i.type,rows:i.lines,clearable:i.clearable},null,8,["value","placeholder","maxlength","type","rows","clearable"])]),_:1})]),_:1},8,["show"])]),_:1},8,["title","show"]))}}),cc={class:"flex-column gap05"},dc={key:0,class:"flex-row",style:{"align-items":"center","justify-content":"space-between",gap:"0.25em","margin-bottom":"1em"}},fc={style:{display:"grid","grid-template-columns":"auto 1fr",gap:"0.5em","align-items":"center"}},uc={class:"flex-row gap05",style:{"justify-content":"space-between"}},Sn=200,pc=e.defineComponent({__name:"GridConfigBox",props:{gridId:{},pageSize:{},gridColumns:{}},emits:["close","reset","update:pageSize","update:config"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Q(),a=ce(),c=Tt(["2E2466DDD34847C8B33460E4277A6528"]),f=de.useRouter(),m=e.ref(o.pageSize),i=e.ref(!1),s=e.ref(void 0),h=e.ref(void 0),g=e.ref(!1),d=L=>L?L.map((T,O)=>({columnId:T.name,title:T.title?r(T.title):r(ee(T.name)),visible:!0,sortIndex:O})).sort((T,O)=>T.sortIndex-O.sortIndex):[],y=e.ref(d(o.gridColumns)),B=()=>{const L=o.gridId;L&&a.confirmToPost("Reset","Are you sure reset the configuration of this data grid?",{url:`/api/core/UserDataGrids/Reset?dataGridId=${L}`,successMessage:"The configuration has been reset, please refresh the page.",success:()=>{n("reset")}})},V=()=>{if(!o.gridId)return;const L={dataGridId:o.gridId,pageSize:m.value,columns:y.value.filter(T=>T.columnId).map(T=>({columnId:T.columnId,visible:T.visible,customTitle:T.customTitle,sortIndex:T.sortIndex}))};L.pageSize&&(L.pageSize=Math.max(1,Math.min(Sn,L.pageSize))),a.post({url:"/api/core/UserDataGrids/Save",data:L,successMessage:"The configuration has been saved, please refresh the page.",success:()=>{n("update:pageSize",m.value),n("update:config",L)}})},F=()=>{var O;const L=(O=s.value)==null?void 0:O.$el,T=L==null?void 0:L.querySelector("tbody.n-data-table-tbody");T&&y&&Zt.useDraggable(T,y,{animation:150,ghostClass:"draging-ghost",handle:".drag-sorting-handle",onUpdate:()=>{const M=y.value;for(let b=0;b<M.length;b++)M[b].sortIndex=b;console.log(y.value)}})},S=L=>{g.value=!1,h.value&&(h.value.customTitle=L)},w=L=>e.h("div",{class:"flex-row gap05"},[L.customTitle?e.h("span",null,`${L.customTitle} (${L.title})`):e.h("span",null,`${L.title}`),e.h(u.NButton,{text:!0,title:r("Edit"),class:"edit-title-btn",onClick:()=>{h.value=L,g.value=!0}},{default:()=>e.h(u.NIcon,{size:16},{default:()=>e.h(yi)})})]),k=L=>e.h(u.NButton,{text:!0,onClick:T=>{L.visible=!L.visible,T.stopPropagation()}},{default:()=>e.h(u.NIcon,{size:20},{default:()=>L.visible?e.h(ln):e.h(nn)})}),x=()=>{var T;const L={dataGridId:o.gridId,pageSize:o.pageSize,columns:(T=o.gridColumns)==null?void 0:T.map(O=>({columnId:O.name,sortIndex:O.sortIndex,visible:O.visible,title:O.title}))};L.dataGridId&&a.post({url:"/api/core/DataGrids/getOrCreate",data:L,success:O=>{O&&(f.push({name:"DataGrid",params:{dataGridId:O}}),n("close"))}})},E=()=>{var T;const L={dataGridId:o.gridId,pageSize:o.pageSize,columns:(T=o.gridColumns)==null?void 0:T.map(O=>({columnId:O.name,sortIndex:O.sortIndex,visible:O.visible,title:O.title}))};L.dataGridId&&a.confirmToPost("Initialize Data Grid Config","Are you sure to initialize config of this data grid?",{url:"/api/core/DataGrids/init",data:L,success:O=>{O&&(f.push({name:"DataGrid",params:{dataGridId:O}}),n("close"))}})},H=[{title:r("Name"),key:"title",render:w},{title:r("Visible"),key:"visible",width:80,align:"center",fixed:"right",render:k},{width:30,align:"center",fixed:"right",render:()=>e.h(u.NIcon,{color:"#90A4AE",size:"20",class:"drag-sorting-handle"},{default:()=>e.h(fn)})},{key:"empty",width:20,fixed:"right"}];return e.watch(()=>o.gridColumns,()=>y.value=d(o.gridColumns)),e.watch(y,()=>F()),e.onMounted(()=>{setTimeout(()=>{F()},500),c.checkOnce(L=>{i.value=L["2E2466DDD34847C8B33460E4277A6528"]})}),(L,T)=>{var O;return e.openBlock(),e.createElementBlock("div",cc,[i.value?(e.openBlock(),e.createElementBlock("div",dc,[e.createVNode(e.unref(u.NButton),{onClick:x},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(vs))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Config System Default")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:E},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Initialize")),1)]),_:1})])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NDataTable),{ref_key:"nTableRef",ref:s,columns:H,data:y.value,"max-height":"60vh",size:"small"},null,8,["data"]),e.createElementVNode("div",fc,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Page Size")),1),e.createVNode(e.unref(u.NInputNumber),{value:m.value,"onUpdate:value":T[0]||(T[0]=M=>m.value=M),max:Sn,min:1,style:{"max-width":"200px"}},null,8,["value"])]),e.createVNode(zt,{show:g.value,"onUpdate:show":T[1]||(T[1]=M=>g.value=M),value:((O=h.value)==null?void 0:O.customTitle)??"",title:e.unref(r)("Custom Title"),clearable:"","onUpdate:value":S},null,8,["show","value","title"]),e.createElementVNode("div",uc,[e.createVNode(e.unref(u.NButton),{onClick:V,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Save")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:B,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Reset")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:T[2]||(T[2]=()=>L.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})])])}}}),mc=t=>{const l=u.useModal(),{t:o}=Q(),n=ce(),r=()=>t.gridId&&t.gridId.length>0;let a;return{hasGridId:r,getConfig:()=>a,showConfigModal:m=>{const i=t.gridId??m.gridId;if(!i)return;const s=l.create({title:o("Config Data Grid"),preset:"card",contentClass:"flex-column",style:"width: 500px;",draggable:!0,content:()=>e.h(pc,{gridId:i,pageSize:m.pageSize,gridColumns:m.gridColumns,class:"flex-grow-1",onClose:()=>s.destroy(),onReset:()=>{var h;(h=t.onReset)==null||h.call(null),s.destroy()},"onUpdate:pageSize":h=>{var g;h>0&&((g=t.onPageSizeChanged)==null||g.call(null,h))},"onUpdate:config":h=>{var g;(g=t.onConfigChanged)==null||g.call(null,h),s.destroy()}})})},loadGridConfig:m=>{t.gridId&&n.get({url:`/api/core/UserDataGrids/Entity?dataGridId=${encodeURIComponent(t.gridId)}`,callback:i=>{var s;a=i,(s=t.onConfigChanged)==null||s.call(null,i),m==null||m.call(null,i)}})}}},hc={class:"flex-column flex-grow-1",style:{gap:"0.25em"}},gc={key:0,class:"flex-row",style:{"justify-content":"space-between"}},yc={style:{"margin-left":"8px"}},wc={style:{display:"flex"}},Cc={style:{"flex-grow":"1"}},In=e.defineComponent({__name:"HaloForm",props:{name:{},autoLoad:{type:Boolean,default:!0},columns:{},keys:{default:"id"},allowNew:{type:Boolean,default:!0},allowEdit:{type:Boolean,default:!0},searchAction:{},getListAction:{},getEntityAction:{},initEntityAction:{},deleteAction:{},deleteBatchAction:{},deleteMethod:{default:"DELETE"},saveAction:{},exportAction:{},importAction:{},detailsPage:{},detailsPageName:{},detailsKeys:{},dataExchangeCode:{},exportFormats:{},exportRanges:{},exportOptions:{},importOptions:{},importTimeout:{},importTemplateCode:{},gridMaxHeight:{},gridHeight:{},gridCheckable:{type:Boolean,default:!0},gridDragSorting:{type:Boolean},chainCreating:{type:Boolean,default:!0},readOnly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},pageSize:{default:20},multiSelect:{type:Boolean,default:!0},quickSearch:{type:Boolean,default:!0},gridFlexHeight:{type:Boolean,default:!0},parentKey:{},parentValue:{},verifyParentKey:{type:[Boolean,Function]},selectedId:{},selectedIds:{},modalColumns:{},modalStyle:{},formGroupLayout:{},enctype:{},batchAdds:{},beforeSave:{},defaultSearchArgs:{},extendedMenus:{},additionKeys:{},searchGroupOptions:{},defaultSortBy:{},defaultSortDirection:{},propertyModal:{}},emits:["update:selectedIds","update:selectedId","update:data","columnButtonClick","saved","beforeShow","itemChange","commitEdit","extendedMenuSelect","beforeRenderPage","searchReturn","rowSorting"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Q(),c=e.inject("axios"),f=e.ref(Array()),m=u.useDialog(),i=u.useMessage(),s=u.useLoadingBar(),h=de.useRouter();let g=[];const d=e.ref([]),y=e.ref([]),B=e.ref([]);let V=1;const F=e.ref(1),S=e.ref(0),w=e.ref(0),k=e.ref(n.pageSize),x=e.ref(!0),E=e.ref(!1),H=e.ref(!1),L=e.ref(""),T=e.computed(()=>{var p;return!!n.searchAction&&((p=B.value)==null?void 0:p.length)}),O=e.ref(T.value&&!n.getListAction),M=e.ref(O.value&&!0),b=e.ref(!1),A=e.ref(null),D=e.ref(null),_=e.ref(new Array),G=e.ref(!1),$=e.ref(void 0),W=e.ref(void 0),J=e.ref(void 0),te=e.ref(!1),ne=e.ref(n.readOnly),oe=e.ref(a("Property")),Z=e.ref(!1),re=e.ref(!1),Y=e.ref([]),Rt=e.ref(jt("page")),Jn=e.ref(dd()),Ot=e.ref(void 0),he=e.ref([]),Ve=e.ref(void 0),Ye=e.ref(!1);let we;const qn=e.ref(void 0),ge=e.ref(void 0),Ce=e.ref(void 0);let ze=[],$e=0;const cd=e.ref({width:fd(n.modalColumns)});function dd(){var C;const p={};if(n.defaultSearchArgs)for(const N in n.defaultSearchArgs)p[N]=n.defaultSearchArgs[N];return(C=B.value)==null||C.forEach(N=>{N.defaultValue!=null&&(N.searchMethod=="range"?Array.isArray(N.defaultValue)&&(N.defaultValue.length>0&&N.defaultValue[0]!=null&&(p[`${N.name}From`]=N.defaultValue[0]),N.defaultValue.length>1&&N.defaultValue[1]!=null&&(p[`${N.name}To`]=N.defaultValue[1])):p[N.name]=N.defaultValue)}),p}function jt(p){return n.exportRanges&&n.exportRanges.length&&!n.exportRanges.includes(p)?n.exportRanges[0]:p}function fd(p){return p?p>4?"100%":p>1?450*p+"px":"600px":"600px"}function Qe(p){if(n.keys){if(typeof n.keys=="string")return p[n.keys];if(n.keys.length==1&&typeof n.keys[0]=="string")return p[n.keys[0]];if(n.keys.length>1)return n.keys.map(C=>p[C]).join()}return""}function Xe(p){p.__key__=Qe(p);for(const C of g){let N;if(typeof C=="string")N=C;else if(Ae(C))N=C.name;else continue;N&&!(N in p)&&(p[N]=null)}}function Un(p){if(p){r("beforeRenderPage",{data:p});const N=p.rows;N.forEach(z=>Xe(z)),f.value=N,r("update:data",f.value),w.value=p.totalRecords||0,S.value=p.pageCount||1,F.value=p.pageIndex+1,x.value=!0}}function vn(p){if(p){const C={data:p};r("beforeRenderPage",C),p=C.data,p.forEach(N=>Xe(N)),f.value=p,r("update:data",f.value),S.value=1,F.value=1,x.value=!1}}async function ue(p){var C,N;if(!(E.value||n.disabled)&&n.getListAction){const z={pageSize:k.value,pageIndex:p},j=(C=L.value)==null?void 0:C.trim();if(n.quickSearch&&j&&(z.searchWords=j),n.additionKeys&&Object.assign(z,n.additionKeys),n.parentKey&&!se(z))return;(ge.value||n.defaultSortBy)&&(z.sortBy=ge.value??n.defaultSortBy,z.sortDirection=Ce.value??n.defaultSortDirection);try{E.value=!0;let P=n.getListAction;typeof P=="function"&&(P=P.call(void 0));const K=v(P,z),R=await c.get(K);R!=null&&R.isSuccess&&R.value?($e++,R.value&&(Array.isArray(R.value)?vn(R.value):Un(R.value))):i.error(a((R==null?void 0:R.errorMessage)??((N=R==null?void 0:R.value)==null?void 0:N.toString())??"Error"))}catch(P){i.error((P==null?void 0:P.toString())??a("Error")),console.error(P)}finally{E.value=!1}}}function De(p){if(!n.disabled)if(M.value&&we){const C=Object.assign({},we);C.sortBy=ge.value,C.sortDirection=Ce.value,Ht(C)}else p!=null?ue(p):ue(F.value-1)}function Pt(){ue(0)}function ud(){L.value="",ue(0)}function pd(p){if(n.additionKeys)for(const C in n.additionKeys){const N=n.additionKeys[C];N!=null&&(p[C]=N)}}function el(){if(!n.parentKey||!n.verifyParentKey)return!0;if(n.verifyParentKey==!0)return!(n.parentValue==null||Array.isArray(n.parentKey)&&Array.isArray(n.parentValue)&&n.parentValue.some(p=>p==null));if(typeof n.verifyParentKey=="function"){const p=n.verifyParentKey({key:n.parentKey,value:n.parentValue});if(typeof p=="boolean")return p}return!0}function se(p){if(n.verifyParentKey&&el()==!1)return!1;if(n.parentKey){const C={};if(Array.isArray(n.parentKey))if(Array.isArray(n.parentValue))for(let N=0;N<n.parentKey.length;N++){const z=n.parentKey[N];(typeof z=="string"||typeof z=="number")&&n.parentValue.length>N&&(C[z]=n.parentValue[N])}else for(let N=0;N<n.parentKey.length;N++){const z=n.parentKey[N];(typeof z=="string"||typeof z=="number")&&(C[z]=n.parentValue)}else n.parentKey&&(C[n.parentKey]=n.parentValue);p&&Object.assign(p,C)}return!0}async function Ft(){var C;if(n.disabled)return;const p=(C=A.value)==null?void 0:C.pickValues();if(p&&n.searchAction){const N={};Object.assign(N,p),pd(N),N.pageSize=k.value,N.pageIndex=0,N.sortBy=ge.value??n.defaultSortBy,N.sortDirection=Ce.value??n.defaultSortDirection,N.groupBy=Ot.value,Ht(N)}}async function Ht(p){if(!E.value)try{E.value=!0;let C=n.searchAction;if(typeof C=="function"&&(C=C.call(void 0,p)),!C)return;const N={};if(!se(N))return;C=v(C,N);const z=await c.post(C,p);z.isSuccess&&z.value!=null?($e++,we=p,r("searchReturn",{data:z.value,query:p,action:C}),Array.isArray(z.value)?vn(z.value):Un(z.value)):i.error(a(z.errorMessage||"Error"))}catch(C){i.error(C==null?void 0:C.toString())}finally{E.value=!1}}function tl(p,C){const N={};if(se(N)){if(typeof n.keys=="string"?N[n.keys]=p[n.keys]:n.keys.forEach(j=>N[j]=p[j]),Array.isArray(n.detailsKeys))n.detailsKeys.map(j=>j.toString()).forEach(j=>N[j]=p[j]);else if(typeof n.detailsKeys=="object"){const j=n.detailsKeys;for(const P in j){var z=j[P];z&&(N[P]=p[z])}}else typeof n.detailsKeys=="function"?n.detailsKeys.call(null,N):n.detailsKeys&&(N.id=p[n.detailsKeys]);if(n.detailsPageName)h.push({name:n.detailsPageName,params:N});else if(n.detailsPage)if(typeof n.detailsPage=="function"){const j=n.detailsPage(p,C);(typeof j=="string"||typeof j=="object")&&h.push(j)}else h.push({path:n.detailsPage,query:N})}}async function Gt(p,C){var N;if(!n.disabled)if(n.getEntityAction){const z={};if(n.additionKeys&&Object.assign(z,n.additionKeys),!se(z))return;typeof n.keys=="string"?z[n.keys]=p[n.keys]:n.keys.forEach(j=>z[j]=p[j]);try{let j=n.getEntityAction;typeof j=="function"&&(j=j.call(void 0,p,C));const P=v(j,z),K=await c.get(P);K.isSuccess&&K.value!=null?Je(K.value,n.readOnly||!n.saveAction||!n.allowEdit?"view":"edit"):i.error(a((K==null?void 0:K.errorMessage)??((N=K==null?void 0:K.value)==null?void 0:N.toString())??"Error"))}catch(j){i.error((j==null?void 0:j.toString())??a("Error")),console.error(j)}}else Je(p,n.readOnly||!n.saveAction||!n.allowEdit?"view":"edit")}function Kt(p,C){n.readOnly||n.disabled||n.deleteAction&&p&&p.__key__&&m.warning({title:a("Delete"),content:a("Are you sure you want to delete this row?"),positiveText:a("Delete"),negativeText:a("Cancel"),onPositiveClick:()=>{md(p,C)}})}async function md(p,C){var N;if(n.deleteAction&&n.keys.length)try{const z={};if(n.additionKeys&&Object.assign(z,n.additionKeys),!se(z))return;typeof n.keys=="string"?z[n.keys]=p[n.keys]:n.keys.forEach(U=>z[U]=p[U]);const j=p.__key__;let P=n.deleteAction;typeof P=="function"&&(P=P.call(void 0,p,C));const K=v(P,z);let R;if(n.deleteMethod=="POST"?R=await c.post(K):R=await c.delete(K),R.isSuccess){let U=f.value.indexOf(p);if(U>-1&&(f.value.splice(U,1),i.success(a("The data has been deleted."))),_.value&&(U=_.value.findIndex(X=>X==j),U>-1)){_.value.splice(U,1);const X=(N=f.value)==null?void 0:N.filter(Rd=>_.value.includes(Rd["__key__]"]));r("update:selectedIds",_.value,X),_.value.length?r("update:selectedId",_.value[0],X!=null&&X.length?X[0]:void 0):r("update:selectedId",void 0,void 0)}}else i.error(a(R.errorMessage||"Error"))}catch(z){console.error(z),i.error(z==null?void 0:z.toString())}}function hd(p){n.readOnly||n.disabled||n.deleteBatchAction&&p&&p.length&&m.warning({title:a("Delete"),content:a("Are you sure you want to delete selected rows?"),positiveText:a("Delete"),negativeText:a("Cancel"),onPositiveClick:()=>{gd(p)}})}async function gd(p){if(n.deleteBatchAction&&p.length)try{const C={ids:p.join()};if(n.additionKeys&&Object.assign(C,n.additionKeys),!se(C))return;let N=n.deleteBatchAction;typeof N=="function"&&(N=N.call(void 0));const z=v(N,C);let j;if(n.deleteMethod=="POST"?j=await c.post(z):j=await c.delete(z),j.isSuccess){for(const P of p){const K=f.value.findIndex(R=>R.__key__==P);K>-1&&f.value.splice(K,1)}_.value=_.value.filter(P=>!p.includes(P)),i.success(a("The data has been deleted."))}else i.error(a(j.errorMessage||"Error"))}catch(C){i.error(C),console.error(C==null?void 0:C.toString())}}function ol(){if(_.value.length){const p=f.value.find(C=>C.__key__==_.value[0]);p&&Gt(p,f.value.indexOf(p))}}function nl(){if(_.value.length>1&&n.deleteBatchAction)hd(_.value);else if(_.value.length){const p=f.value.find(C=>C.__key__==_.value[0]);p&&Kt(p,f.value.indexOf(p))}}function Je(p,C){const N={method:C,original:p,value:gn(p,d.value)};switch(r("beforeShow",N),J.value=p,$.value=N.value,W.value=C,te.value=!0,ne.value=C!="create"&&C!="edit",C){case"create":oe.value=a("New");break;case"edit":oe.value=a("Edit");break;default:oe.value=a("Property");break}}function ll(){J.value=void 0,$.value=void 0,W.value=void 0,te.value=!1,oe.value=a("Property")}async function Wt(){var p;if(!(n.readOnly||n.disabled||!n.saveAction))if(n.initEntityAction){let C=n.initEntityAction;typeof C=="function"&&(C=C.call(void 0));let N=C;const z={};if(n.additionKeys&&Object.assign(z,n.additionKeys),!se(z))return;N=v(N,z);try{const j=await c.get(N);j!=null&&j.isSuccess&&j.value?Je(j.value||{},"create"):i.error(a((j==null?void 0:j.errorMessage)??((p=j==null?void 0:j.value)==null?void 0:p.toString())??"Error"))}catch(j){i.error(a((j==null?void 0:j.toString())??"Error")),console.error(j)}}else{const C=mn(d.value);Je(C,"create")}}async function yd(p,C){var j;if(n.readOnly||n.disabled)return;const N=Ve.value;if(!N||N.searchConfig!=C||!N.actionUrl)return;let z;if(N.dataBuilder)z=N.dataBuilder(p);else{let P;if(N.keyPicker?P=N.keyPicker(p):P=p.map(K=>K.id),!P||!P.length)return;z={},z[N.keyName||"ids"]=P}if(z){let P=N.actionUrl;n.additionKeys&&Object.assign(z,n.additionKeys);const K={};se(K)&&(P=v(P,K),Object.assign(z,K));try{const R=await c.post(P,z);if(R.isSuccess){if(R.value){for(const X of R.value)qe(X);const U=R.value.map(X=>Qe(X));(j=D.value)==null||j.selectRows(U),Ye.value=!1}}else i.error(a(R.errorMessage||"Error"))}catch(R){i.error(a((R==null?void 0:R.toString())||"Error")),console.error(R)}}}function rl(p){Ve.value=p,Ye.value=!0}function wd(p){const C=d.value;if(!C||!C.length)return!1;C.forEach(N=>{N.validationStatus=void 0,N.errorMessage=void 0});for(const N of C)N.nullable===!1&&!N.readonly&&(p[N.name]==null||p[N.name]===null||!N.dataType&&(p[N.name]==null||p[N.name]==null)?(N.validationStatus="error",N.errorMessage=a("Required here.")):(N.validationStatus="success",N.errorMessage=void 0));return!C.some(N=>N.validationStatus=="error"||N.validationStatus=="warning")}function Cd(){if(n.readOnly||n.disabled)return;const p=d.value;if(!p||!p.length)return;const C=W.value;if(C!="create"&&C!="edit")return;const N=$.value,z=J.value;if(N&&z){const j=Object.assign({},z);for(let P of p){if(P.readonly==!0||Array.isArray(P.readonly)&&P.readonly.includes(C))continue;let K=Pe(N[P.name],P.dataType,P.role);j[P.name]=K}if(r("commitEdit",{data:j,current:N,original:z,method:C}),n.beforeSave&&n.beforeSave(j,C)===!1)return;wd(j)?al({data:j,original:z,method:C}):i.error(a("Form validation failed."))}}async function al(p){var C;if(!(n.readOnly||n.disabled||!n.saveAction))try{let N;const z={};if(n.additionKeys)for(const U in n.additionKeys)n.additionKeys[U]!=null&&(p.data[U]=n.additionKeys[U]);const j={};if(!se(j))return;if(Object.assign(p.data,j),n.enctype=="multipart/form-data"){N=new FormData;const U=Object.keys(p.data);for(const X of U)p.data[X]&&N.set(X,p.data[X]);z["Content-Type"]="multipart/form-data"}else N=p.data,z["Content-Type"]="application/json;charset=utf-8";let P=n.saveAction;typeof P=="function"&&(P=P.call(void 0));let K=v(P,j);H.value=!0;const R=await c.post(K,N,{headers:z});if(R.isSuccess){if(i.success(a("The data is saved.")),R.value){p.method=="create"?qe(R.value):p.method=="edit"&&sl(R.value),(C=D.value)==null||C.selectRow(Qe(R.value)),p.method=="create"&&n.chainCreating?Wt():ll();try{r("saved",{value:R.value,method:p.method})}catch(U){console.error("emit(saved) fail."+(U==null?void 0:U.toString()))}}}else i.error(a(R.errorMessage||"Error")),R.errors&&kd(d.value,R.errors)}catch(N){i.error((N==null?void 0:N.toString())||a("Error")),console.error(N)}finally{H.value=!1}}function kd(p,C){if(p&&p.length)for(const N of C){const z=p.find(j=>j.name.toLowerCase()==N.key.toLowerCase());z&&(z.validationStatus="error",z.errorMessage=N.value)}}function qe(p){Xe(p);const C=p.__key__,N=f.value.findIndex(z=>z.__key__==C);N>-1?f.value.splice(N,1,p):f.value.push(p)}function sl(p){Xe(p);const C=p.__key__,N=f.value.find(z=>z.__key__==C);if(N)for(const z in p)N[z]=p[z]}function bd(p){if(M.value&&we){const C=Object.assign({},we);C.pageIndex=Math.max(0,p-1),Ht(C)}else p>0?ue(p-1):ue(0)}function Nd(p){p&&(k.value=p)}function xd(p,C){_.value=p,r("update:selectedIds",p,C),r("update:selectedId",p.length?p[0]:void 0,C.length?C[0]:void 0)}async function Sd(p,C){n.exportAction?await Id(p,C)&&(Z.value=!1):n.dataExchangeCode&&(cl(p,C),Z.value=!1)}function il(p,C,N){const z={outputType:p,dataRange:C,searchArgs:JSON.stringify(we)};if(n.importTemplateCode&&(z.templateCode=n.importTemplateCode),!we&&(n.additionKeys||n.parentKey)){const j={pageSize:k.value,pageIndex:F.value,sortBy:ge.value,sortDirection:Ce.value};n.additionKeys&&Object.assign(j,n.additionKeys),se(j),z.searchArgs=JSON.stringify(j)}switch(N&&Object.assign(z,N),C){case"selection":if(!_.value||!_.value.length)throw a("Please select the rows to be exported.");z.selectedKeys=_.value;break;case"page":z.pageSize=k.value,z.pageIndex=Math.max(0,F.value-1);break}return z}async function Id(p,C){let N=n.exportAction;if(typeof N=="function"&&(N=N.call(void 0)),N){try{if(!el())return console.error("Invalid parent key."),!1;const z=il(p,C,n.exportOptions);se(z),s.start(),N=v(N,z),await pe(N)}catch(z){console.log(z),i.error((z==null?void 0:z.toString())||a("Error"))}finally{s.finish()}return!0}else return!1}function Bd(){n.importAction&&(G.value=!0)}async function Vd(){const p=n.importTemplateCode;if(p){const C=`/api/core/DataExchangeTemplates/ImportTemplate?templateCode=${p}`;try{s.start(),await pe(C)}finally{s.finish()}}}async function cl(p,C,N=!1){var U;const z=n.dataExchangeCode;if(!z)return;if(C.toLowerCase()=="empty"){const X=`/api/core/dataExchange/importTemplate?templateCode=${z}&engineName=${p}`;try{s.start(),await pe(X)}finally{s.finish()}return}const j={name:z,engineName:p,dataRange:C};n.importTemplateCode&&(j.templateCode=n.importTemplateCode);const P={pageSize:k.value,pageIndex:F.value-1};switch(C.toLowerCase()){case"empty":P.pageSize=0,P.pageIndex=0;break;case"all":P.pageSize=2e3,P.pageIndex=0;break}if(!se(P)){console.error("Invalid parent key.");return}let K=n.exportAction||n.getListAction;typeof K=="function"&&(K=K.call(void 0));let R=K;if(N)try{const X=await c.post("/api/core/tempData/add",{value:JSON.stringify(j)});if(X.isSuccess){if(P.exportOptionId=X.value,R){R=v(R,P);try{s.start(),await pe(R)}finally{s.finish()}}}else i.error((X==null?void 0:X.errorMessage)??((U=X==null?void 0:X.value)==null?void 0:U.toString())??a("Error"))}catch(X){i.error((X==null?void 0:X.toString())??a("Error")),console.error(X)}else if(P.exportOption=btoa(JSON.stringify(j)),R){R=v(R,P);try{s.start(),await pe(R)}finally{s.finish()}}}function dl(p){if(p)switch(p){case"menu_export_action":_.value&&_.value.length?Rt.value=jt("selection"):Rt.value=jt("page"),Z.value=!0;break;case"menu_export_template_action":Vd();break;case"menu_import_action":Bd();break;case"menu_export":Z.value=!0;break;case"menu_export_template":cl("Excel","Empty");break;case"menu_import":break;default:{const C=ze.find(N=>N.key==p);C&&fl(C)}break}}function fl(p){var z;const C=_.value,N={selectedId:C!=null&&C.length?C[0]:void 0,selectedIds:C?[...C]:void 0,data:f.value};typeof p!="string"&&((z=p.click)==null||z.call(null,N)),r("extendedMenuSelect",N)}function Md(p){const C=[];n.exportAction&&C.push({label:a("Export")+"…",key:"menu_export_action",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(cn)})}),n.importTemplateCode&&C.push({label:a("Download Template")+"…",key:"menu_export_template_action"}),n.importAction&&!n.readOnly&&C.push({label:a("Import"),key:"menu_import_action",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(dn)})}),n.dataExchangeCode&&(C.push({label:a("Export")+"…",key:"menu_export",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(cn)})}),C.push({label:a("Export Template"),key:"menu_export_template"}),n.readOnly||(C.push({type:"divider",key:"------------1"}),C.push({label:a("Import"),key:"menu_import",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(dn)})}))),p&&p.length&&(C.push({type:"divider",key:"----------e--1"}),p.forEach(N=>{const z={label:N.label,key:N.key};N.icon?z.icon=Ct(N.icon):N.renderIcon&&(z.icon=N.renderIcon),C.push(z)})),Y.value=C}const Ue=mc({gridId:n.name,onConfigChanged:p=>ul(p),onPageSizeChanged:p=>k.value=p||n.pageSize,onReset:()=>Td});function ul(p){ve(),p!=null&&p.sortColumns&&(ge.value=p==null?void 0:p.sortColumns,Ce.value=n.defaultSortDirection??"Asc"),k.value=p!=null&&p.pageSize?p.pageSize:n.pageSize,re.value=!1}const Td=()=>{ve(),k.value=n.pageSize},Ad=()=>{n.name&&Ue.showConfigModal({gridId:n.name,gridColumns:y.value,pageSize:k.value})};function Ed(p,C){var N;for(const z of p)qe(z);if(C){const z=p.map(j=>Qe(j));(N=D.value)==null||N.selectRows(z)}}function pl(p){if(!p)return;const C=ze==null?void 0:ze.find(N=>N.key==p);C&&fl(C)}function _d(p){var C,N;Array.isArray(p)?(ge.value=(C=p[0].columnKey)==null?void 0:C.toString(),Ce.value=p[0].order=="ascend"?"Asc":"Desc"):p&&(ge.value=(N=p.columnKey)==null?void 0:N.toString(),Ce.value=p.order=="ascend"?"Asc":"Desc"),De()}function ml(){const p=new Array;if(n.extendedMenus)for(const N of n.extendedMenus)typeof N=="string"?p.push({label:a(N),key:V++}):(N.key||(N.key=V++),p.push(N));ze=p,Ld(p);const C=p.filter(N=>N.group=="import"||N.group=="export");Md(C)}function Ld(p){if(p){const C=p.filter(N=>!N.group).map(N=>N.label=="-"?{type:"divider"}:N.icon?{label:N.label,key:N.key,icon:Ct(N.icon)}:N.renderIcon?{label:N.label,key:N.key,icon:N.renderIcon()}:{label:N.label,key:N.key});he.value=C}else he.value=[]}function hl(){const p={};return n.parentKey&&se(p),n.additionKeys&&Object.assign(p,n.additionKeys),p}function gl(){const p=Object.assign({},hl(),n.importOptions);qn.value=Object.keys(p).length?p:void 0}function zd(){O?b.value=!b.value:b.value=!1}const $d=p=>p.map(C=>typeof C=="string"?{name:C,title:ee(C)}:Object.assign({},C)),Dd=(p,C)=>{var j;C.forEach(P=>{P.sortIndex=-1});const N=["left","center","right"];for(const P of p){const K=C.find(R=>R.name==P.columnId);if(K){K.visible=P.visible,K.sortIndex=P.sortIndex;const R=(j=P.alignment)==null?void 0:j.toLowerCase();R&&N.includes(R)&&(K.align=R),P.title&&(K.title=P.title),P.suffix&&(K.suffix=P.suffix),P.prefix&&(K.prefix=P.prefix),P.renderTemplate&&(K.template=P.renderTemplate),K.cssStyle=Zo(K.cssStyle,P.cssStyle),K.className=Yo(K.className,P.cssClass)}}let z=Math.max(...C.filter(P=>P.sortIndex!=null&&P.sortIndex>=0).map(P=>P.sortIndex))||0;for(const P of C.filter(K=>K.sortIndex==null||K.sortIndex<0))P.sortIndex=z++;C.sort((P,K)=>(P.sortIndex||0)-(K.sortIndex||0))},ve=p=>{g=$d(p??n.columns??[]);const C=Ue.getConfig();C!=null&&C.columns&&Dd(C.columns,g),d.value=yn(g,a),y.value=wt(g),B.value=wn(g,a)},yl=()=>{n.autoLoad!=!1&&(O.value?n.autoLoad&&Ft():ue(0))};return e.onMounted(()=>{gl(),Ue.hasGridId()?Ue.loadGridConfig(()=>{yl()}):(ve(),yl()),ml()}),e.watch(e.computed(hl),(p,C)=>{JSON.stringify(p)!=JSON.stringify(C)&&(gl(),n.autoLoad!=!1&&$e>0&&De())}),e.watch(()=>n.extendedMenus,()=>ml()),e.watch(()=>n.parentValue,()=>{(n.autoLoad!=!1||$e>0)&&ue(0)}),e.watch(()=>n.getListAction,(p,C)=>{C&&(n.autoLoad!=!1||$e>0)&&ue(0)}),e.watch(k,(p,C)=>{if(p&&C){var N=void 0,z=F.value,j=w.value;if(z>0&&j){const P=Math.ceil(j/p);P<z&&(N=Math.max(0,P-1))}De(N)}}),e.watch(()=>n.columns,p=>ve(p)),l({reloadPage:De,addRow:Wt,addBatch:rl,editSelectedRow:ol,deleteSelectedRows:nl,saveData:al,doQuickSearch:Pt,clearQuickSearch:ud,advancedSerach:Ft,checkedRowKeys:_,editRow:Gt,deleteRow:Kt,showDetails:tl,insertRow:qe,updateRow:sl,appendRows:Ed,buildExportArgs:il}),(p,C)=>{var N,z,j,P,K;return e.openBlock(),e.createElementBlock("div",hc,[e.renderSlot(p.$slots,"header"),O.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",gc,[e.createVNode(e.unref(u.NButtonGroup),null,{default:e.withCtx(()=>[e.renderSlot(p.$slots,"prefix-tools"),p.readOnly?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(p.batchAdds,R=>(e.openBlock(),e.createBlock(e.unref(u.NButton),{onClick:()=>rl(R),disabled:p.readOnly||p.disabled,key:R.id},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#388e3c"},{default:e.withCtx(()=>[e.createVNode(e.unref(rs))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)(R.label||"Batch Add")),1)]),_:2},1032,["onClick","disabled"]))),128)),p.saveAction&&!p.readOnly&&p.allowNew?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:1,onClick:Wt,disabled:p.readOnly||p.disabled},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#388e3c"},{default:e.withCtx(()=>[e.createVNode(e.unref(ti))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("New")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),p.saveAction&&!p.readOnly&&p.allowEdit?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:2,onClick:ol,disabled:p.readOnly||p.disabled||!_.value.length},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#5c6bc0"},{default:e.withCtx(()=>[e.createVNode(e.unref(Xo))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Edit")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),(p.deleteAction||p.deleteBatchAction)&&!p.readOnly?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:3,onClick:nl,disabled:p.readOnly||p.disabled||!_.value.length},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#f44336"},{default:e.withCtx(()=>[e.createVNode(e.unref(Qo))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Delete")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NButton),{onClick:C[0]||(C[0]=()=>De()),disabled:p.disabled},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#689f38"},{default:e.withCtx(()=>[e.createVNode(e.unref(dt))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Refresh")),1)]),_:1},8,["disabled"]),e.renderSlot(p.$slots,"suffix-tools"),Y.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:4,options:Y.value,disabled:p.disabled,onSelect:dl},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#009688"},{default:e.withCtx(()=>[e.createVNode(e.unref(Za))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Import/Export"))+" ",1),e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Le))]),_:1})]),_:1})]),_:1},8,["options","disabled"])):e.createCommentVNode("",!0),he.value&&he.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:5,options:he.value,disabled:p.disabled,onSelect:pl},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5"},{default:e.withCtx(()=>[e.createVNode(e.unref(ct))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Advanced"))+" ",1),e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Le))]),_:1})]),_:1})]),_:1},8,["options","disabled"])):e.createCommentVNode("",!0)]),_:3}),e.renderSlot(p.$slots,"tools"),p.quickSearch?(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),{key:0,class:"flex-row quick-search-box",style:{width:"inherit"}},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref(u.NInput),{class:"flex-grow-1",style:{width:"260px"},value:L.value,"onUpdate:value":C[1]||(C[1]=R=>L.value=R),placeholder:e.unref(a)("Quick Search"),clearable:"",onChange:Pt},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(me))]),_:1})]),_:1},8,["value","placeholder"]),[[e.vShow,!M.value]]),e.withDirectives(e.createVNode(e.unref(u.NButton),{title:e.unref(a)("Search"),onClick:C[2]||(C[2]=()=>Pt()),style:{padding:"0 8px"}},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(me))]),_:1})]),_:1},8,["title"]),[[e.vShow,!M.value]]),T.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,title:e.unref(a)("More"),style:{padding:"0 8px"},onClick:C[3]||(C[3]=()=>M.value=!M.value)},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[M.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(ja),{key:0})),M.value?(e.openBlock(),e.createBlock(e.unref(Ra),{key:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0)])),e.renderSlot(p.$slots,"neck"),T.value?e.withDirectives((e.openBlock(),e.createBlock(e.unref(u.NCard),{key:1,size:"small",hoverable:"",closable:!O.value,onClose:C[8]||(C[8]=()=>M.value=!1)},{header:e.withCtx(()=>[e.createElementVNode("div",{class:"flex-row",style:e.normalizeStyle([{"align-items":"center"},{cursor:O.value?"pointer":"unset"}]),onClick:zd},[e.createVNode(e.unref(u.NIcon),{size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(me))]),_:1}),e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Search"))+" ",1),e.withDirectives(e.createElementVNode("span",yc," … ",512),[[e.vShow,b.value]])],4)]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px"},onClick:Ft},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(me))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Search")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:C[6]||(C[6]=()=>{var R;return(R=A.value)==null?void 0:R.reset()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Reset")),1)]),_:1}),Y.value.length==1&&O.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,style:{"min-width":"100px"},onClick:C[7]||(C[7]=()=>Z.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Export")),1)]),_:1})):e.createCommentVNode("",!0),Y.value.length>1&&O.value?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:1,options:Y.value,onSelect:dl},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Export")),1)]),_:1})]),_:1},8,["options"])):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"search-tools"),O.value&&he.value&&he.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:2,options:he.value,onSelect:pl},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5"},{default:e.withCtx(()=>[e.createVNode(e.unref(ct))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Advanced"))+" ",1),e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Le))]),_:1})]),_:1})]),_:1},8,["options"])):e.createCommentVNode("",!0)]),_:3})]),_:3})]),default:e.withCtx(()=>[e.withDirectives(e.createVNode(Ge,{"search-items":B.value,ref_key:"searchFormRef",ref:A,"search-args":Jn.value,"onUpdate:searchArgs":C[4]||(C[4]=R=>Jn.value=R),"group-options":p.searchGroupOptions,"group-by":Ot.value,"onUpdate:groupBy":C[5]||(C[5]=R=>Ot.value=R)},null,8,["search-items","search-args","group-options","group-by"]),[[e.vShow,!b.value]])]),_:3},8,["closable"])),[[e.vShow,M.value]]):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"grid",{data:f.value,columns:y.value,loading:E.value,style:"background-color: chartreuse"},()=>[e.createVNode(Ke,{ref_key:"dataGridRef",ref:D,data:f.value,columns:y.value,loading:E.value,class:"halo-form-grid flex-grow-1",style:{height:"80px","min-height":"80px"},"drag-sorting":p.gridDragSorting,"flex-height":p.gridFlexHeight,"with-edit":!!p.saveAction&&!p.readOnly&&p.allowEdit,"with-delete":(!!p.deleteAction||!!p.deleteBatchAction)&&!p.readOnly,"with-details":!!p.detailsPage||!!p.detailsPageName,"multi-select":p.multiSelect,"max-height":p.gridMaxHeight,height:p.gridHeight,checkable:p.gridCheckable,onEditRow:Gt,onDeleteRow:Kt,onShowDetails:tl,"onUpdate:selectedIds":xd,onColumnButtonClick:C[9]||(C[9]=(R,U,X)=>p.$emit("columnButtonClick",R,U,X)),"onUpdate:sorter":C[10]||(C[10]=R=>_d(R)),onRowSorting:C[11]||(C[11]=R=>p.$emit("rowSorting",R))},null,8,["data","columns","loading","drag-sorting","flex-height","with-edit","with-delete","with-details","multi-select","max-height","height","checkable"])]),e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[x.value&&k.value>0?(e.openBlock(),e.createBlock(e.unref(u.NPagination),{key:0,page:F.value,"onUpdate:page":[C[12]||(C[12]=R=>F.value=R),bd],"item-count":w.value,"page-size":k.value?k.value:p.pageSize,"page-sizes":[10,20,30,40,50,100],"show-quick-jumper":"","show-size-picker":"","onUpdate:pageSize":Nd},{suffix:e.withCtx(({startIndex:R,endIndex:U,itemCount:X})=>[X?(e.openBlock(),e.createBlock(e.unref(u.NText),{key:0,italic:"",depth:"3"},{default:e.withCtx(()=>[e.createTextVNode("["+e.toDisplayString(R+1)+"~"+e.toDisplayString(U+1)+"] / "+e.toDisplayString(X),1)]),_:2},1024)):e.createCommentVNode("",!0)]),_:1},8,["page","item-count","page-size"])):e.createCommentVNode("",!0),p.name?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:1,text:"",onClick:C[13]||(C[13]=()=>Ad())},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(hi))]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.renderSlot(p.$slots,"default"),e.renderSlot(p.$slots,"bottom",{formItems:d.value,currentData:$.value,list:f.value,selectedKeys:_.value}),e.createVNode(e.unref(u.NModal),{class:"custom-card",show:te.value,"onUpdate:show":C[15]||(C[15]=R=>te.value=R),preset:"card",draggable:"",style:e.normalizeStyle([cd.value,p.modalStyle]),title:oe.value,"close-on-esc":!1,"mask-closable":!1},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[W.value=="create"||W.value=="edit"?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,onClick:Cd,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Save")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NButton),{onClick:ll,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Close")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:H.value},{default:e.withCtx(()=>[e.createElementVNode("div",wc,[e.createElementVNode("div",null,[e.renderSlot(p.$slots,"entity-form-left",{data:$.value,original:J.value,method:W.value})]),e.createElementVNode("div",Cc,[e.renderSlot(p.$slots,"entity-form",{formItems:d.value,data:$.value,original:J.value,method:W.value},()=>[e.createVNode(Bt,{"form-items":d.value,columns:p.modalColumns,data:$.value,original:J.value,method:W.value,"group-layout":p.formGroupLayout,"read-only":ne.value,onItemChange:C[14]||(C[14]=R=>p.$emit("itemChange",R))},null,8,["form-items","columns","data","original","method","group-layout","read-only"])])]),e.createElementVNode("div",null,[e.renderSlot(p.$slots,"entity-form-right",{data:$.value,original:J.value,method:W.value})])])]),_:3},8,["show"])]),_:3},8,["show","style","title"]),(N=p.batchAdds)!=null&&N.length?(e.openBlock(),e.createBlock(_t,{key:2,show:Ye.value,"onUpdate:show":C[16]||(C[16]=R=>Ye.value=R),draggable:"",config:(z=Ve.value)==null?void 0:z.searchConfig,title:(j=Ve.value)==null?void 0:j.searchTitle,"multi-select":((P=Ve.value)==null?void 0:P.singleOne)!=!0,"addition-query":(K=Ve.value)==null?void 0:K.additionQuery,onSearchBack:yd},null,8,["show","config","title","multi-select","addition-query"])):e.createCommentVNode("",!0),p.importAction?(e.openBlock(),e.createBlock(Lt,{key:3,show:G.value,"onUpdate:show":C[17]||(C[17]=R=>G.value=R),draggable:"",action:p.importAction,"addition-params":qn.value,timeout:p.importTimeout,"template-code":p.importTemplateCode},{options:e.withCtx(({options:R})=>[e.renderSlot(p.$slots,"import-options",{options:R})]),_:3},8,["show","action","addition-params","timeout","template-code"])):e.createCommentVNode("",!0),p.dataExchangeCode||p.exportAction?(e.openBlock(),e.createBlock(Mt,{key:4,show:Z.value,draggable:"","supported-formats":p.exportFormats,"supported-ranges":p.exportRanges,onClose:C[18]||(C[18]=()=>Z.value=!1),onExport:Sd,range:Rt.value,"template-code":p.importTemplateCode},{options:e.withCtx(()=>[e.renderSlot(p.$slots,"export-options")]),_:3},8,["show","supported-formats","supported-ranges","range","template-code"])):e.createCommentVNode("",!0),p.name?(e.openBlock(),e.createBlock(At,{key:5,"grid-id":p.name,draggable:"","grid-columns":y.value,pageSize:k.value,"onUpdate:pageSize":C[19]||(C[19]=R=>k.value=R),show:re.value,onClose:C[20]||(C[20]=()=>re.value=!1),"onUpdate:config":ul},null,8,["grid-id","grid-columns","pageSize","show"])):e.createCommentVNode("",!0)])}}}),kc={class:"flex-row gap05",style:{"align-items":"center"}},Bn=e.defineComponent({__name:"HaloModal",props:{show:{type:Boolean},title:{},submitting:{type:Boolean},hideOkButton:{type:Boolean},width:{default:"600px"}},emits:["submit","update:show"],setup(t){const{t:l}=Q();return(o,n)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{class:"custom-card",show:o.show,preset:"card",style:e.normalizeStyle({width:o.width}),draggable:"",onClose:n[2]||(n[2]=()=>o.$emit("update:show",!1))},{header:e.withCtx(()=>[e.createElementVNode("div",kc,[e.renderSlot(o.$slots,"icon"),e.createElementVNode("div",null,e.toDisplayString(o.title),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[o.hideOkButton?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,onClick:n[0]||(n[0]=r=>o.$emit("submit")),style:{"min-width":"100px"},type:"primary",loading:o.submitting},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("OK")),1)]),_:1},8,["loading"])),e.createVNode(e.unref(u.NButton),{onClick:n[1]||(n[1]=()=>o.$emit("update:show",!1)),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["show","style"]))}}),bc={key:0,style:{"text-align":"right"}},Vn=e.defineComponent({__name:"HaloSelect",props:{multiple:{type:Boolean},filterable:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},value:{},sourceUrl:{},additionalQuery:{},labelFormatter:{},keyField:{},labelField:{},subLabelField:{},prefix:{},suffix:{},insertBlank:{type:Boolean},autoSelect:{type:Boolean},i18n:{type:Boolean,default:!0}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Q(),a=e.inject("axios"),c=e.ref(!1),f=e.ref([]);let m;const i=g=>{(!m||m!=g)&&(m=g,s(g))},s=async g=>{let d=o.sourceUrl;if(d){const y=o.labelFormatter,B=o.keyField,V=o.labelField,F=o.subLabelField,S=o.insertBlank,w=o.additionalQuery;c.value=!0,f.value=[];try{g&&(d=v(d,{searchWords:g})),w&&(d=v(d,w,!0));const k=await a.get(d);if(k.isSuccess&&k.value!=null){let x=k.value;if(!Array.isArray(x)&&"rows"in x&&Array.isArray(x.rows)&&(x=x.rows),Array.isArray(x)){const E=x.filter(H=>H&&!0).map(H=>{if(typeof H=="string")return{value:H,label:y?y(H):r(H)};{let L=H[V||"label"];if(y&&(L=y(L)),o.prefix&&(L=o.prefix+L),o.suffix&&(L=L+o.suffix),o.i18n&&(L=r(L)),F){let T=H[F];typeof T=="string"&&(y&&(T=y(T)),o.i18n&&(T=r(T)),T&&(L+=" "+T))}return{value:H[B||"value"],label:L,data:H}}});S&&E.splice(0,0,{value:"",label:""}),f.value=E,o.autoSelect&&!o.value&&E.length&&n("update:value",E[0].value,E[0],E[0].data)}}}finally{c.value=!1}}},h=(g,d)=>{var B;const y=(B=f.value.find(V=>V.value==g))==null?void 0:B.data;n("update:value",g,d,y)};return e.watch(()=>o.sourceUrl,()=>s()),e.watch(()=>o.additionalQuery,(g,d)=>{JSON.stringify(d)!=JSON.stringify(g)&&s()}),e.onMounted(()=>s()),(g,d)=>(e.openBlock(),e.createBlock(e.unref(u.NSelect),{value:g.value,remote:"",loading:c.value,options:f.value,filterable:g.filterable,multiple:g.multiple,placeholder:"",disabled:g.readonly,clearable:g.clearable,onSearch:i,"onUpdate:value":h},{action:e.withCtx(()=>[g.filterable?(e.openBlock(),e.createElementBlock("div",bc,[e.createVNode(e.unref(u.NText),{depth:"3",italic:""},{default:e.withCtx(()=>[e.createElementVNode("small",null,e.toDisplayString(e.unref(r)("Enter text to filter the result list.")),1)]),_:1})])):e.createCommentVNode("",!0)]),_:1},8,["value","loading","options","filterable","multiple","disabled","clearable"]))}}),Nc=e.defineComponent({components:{SearchIcon:gt,LeftIcon:xs,RightIcon:Is},props:{sourceList:Object,selectedItems:Object,loading:Boolean,placeholder:{type:String,default:"Search"}},emits:["search","update:selectedItems"],setup(t,l){const{t:o}=Q(),n=e.ref(void 0),r=e.ref(c(t.sourceList)),a=e.ref([]);function c(g){return g?g.map(d=>({isSelected:!1,value:d})):[]}function f(){n.value&&l.emit("search",n.value)}function m(){_o(a.value,g=>g.isSelected)>0&&l.emit("update:selectedItems",a.value.map(g=>g.value))}function i(){a.value.forEach(d=>d.isSelected=!1);let g=!1;r.value.forEach(d=>{d.isSelected&&!a.value.some(y=>y.value==d.value)&&(a.value.push({value:d.value,isSelected:!1}),g=!0)}),g&&l.emit("update:selectedItems",a.value.map(d=>d.value))}function s(g){g.forEach(d=>d.isSelected=!0)}function h(g){g.forEach(d=>d.isSelected=!d.isSelected)}return e.watch(()=>t.sourceList,g=>r.value=c(g)),{t:o,searchWords:n,searchMaterials:f,source:r,target:a,moveRight:i,moveLeft:m,selectAll:s,inverseSelect:h}}}),xc={class:"flex-row gap1"},Sc={class:"flex-column flex-grow-1 gap25",style:{width:"100px",height:"400px"}},Ic={class:"flex-row gap1",style:{"justify-content":"flex-end"}},Bc={class:"flex-column gap1",style:{width:"60px","justify-content":"center"}},Vc={class:"flex-column flex-grow-1 gap25",style:{width:"100px",height:"400px"}},Mc={class:"flex-row gap1",style:{"justify-content":"flex-end"}};function Tc(t,l,o,n,r,a){const c=e.resolveComponent("search-icon"),f=e.resolveComponent("n-icon"),m=e.resolveComponent("n-input"),i=e.resolveComponent("n-checkbox"),s=e.resolveComponent("n-scrollbar"),h=e.resolveComponent("n-spin"),g=e.resolveComponent("n-button"),d=e.resolveComponent("right-icon"),y=e.resolveComponent("left-icon");return e.openBlock(),e.createElementBlock("div",xc,[e.createElementVNode("div",Sc,[e.createVNode(m,{placeholder:t.placeholder,value:t.searchWords,"onUpdate:value":l[0]||(l[0]=B=>t.searchWords=B),onInput:t.searchMaterials},{suffix:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(c)]),_:1})]),_:1},8,["placeholder","value","onInput"]),e.createVNode(h,{show:t.loading,class:"flex-grow-1 flex-column","content-class":"flex-column flex-grow-1"},{default:e.withCtx(()=>[e.createVNode(s,{class:"flex-grow-1 bordered",style:{height:"50px"},"content-class":"flex-column gap25","content-style":"padding: 4px"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.source,B=>(e.openBlock(),e.createBlock(i,{checked:B.isSelected,"onUpdate:checked":V=>B.isSelected=V,style:{"align-items":"center"}},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"source",{item:B.value,isSelected:B.isSelected},()=>[e.createTextVNode(e.toDisplayString(B.value),1)])]),_:2},1032,["checked","onUpdate:checked"]))),256))]),_:3})]),_:3},8,["show"]),e.createElementVNode("div",Ic,[e.createVNode(g,{text:"",onClick:l[1]||(l[1]=()=>t.selectAll(t.source))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Select All")),1)]),_:1}),e.createVNode(g,{text:"",onClick:l[2]||(l[2]=()=>t.inverseSelect(t.source))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Inverse Selection")),1)]),_:1})])]),e.createElementVNode("div",Bc,[e.createVNode(g,{onClick:t.moveRight},{default:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(d)]),_:1})]),_:1},8,["onClick"]),e.createVNode(g,{onClick:t.moveLeft},{default:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(y)]),_:1})]),_:1},8,["onClick"])]),e.createElementVNode("div",Vc,[e.createVNode(s,{class:"flex-grow-1 bordered","content-class":"flex-column gap25","content-style":"padding: 4px"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.target,B=>(e.openBlock(),e.createBlock(i,{checked:B.isSelected,"onUpdate:checked":V=>B.isSelected=V,style:{"align-items":"center"}},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"target",{item:B.value,isSelected:B.isSelected},()=>[e.createTextVNode(e.toDisplayString(B.value),1)])]),_:2},1032,["checked","onUpdate:checked"]))),256))]),_:3}),e.createElementVNode("div",Mc,[e.createVNode(g,{text:"",onClick:l[3]||(l[3]=()=>t.selectAll(t.target))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Select All")),1)]),_:1}),e.createVNode(g,{text:"",onClick:l[4]||(l[4]=()=>t.inverseSelect(t.target))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Inverse Selection")),1)]),_:1})])])])}const Mn=le(Nc,[["render",Tc]]),Tn=le(e.defineComponent({__name:"MainDetailPanel",props:{direction:{default:"vertical"},initialRatio:{default:.618},minSize:{default:100},mainPanelStyle:{},mainPanelClass:{},detailPanelStyle:{},detailPanelClass:{},detailFolded:{type:Boolean,default:!1}},setup(t){const l=t,o=e.ref(l.initialRatio),n=e.ref(!1),r=e.ref(void 0),a=e.computed(()=>l.detailFolded?{[l.direction==="horizontal"?"width":"height"]:"100%",[l.direction==="horizontal"?"height":"width"]:"100%"}:{[l.direction==="horizontal"?"width":"height"]:`${o.value*100}%`,[l.direction==="horizontal"?"height":"width"]:"100%"}),c=e.computed(()=>l.detailFolded?{[l.direction==="horizontal"?"width":"height"]:"100%",[l.direction==="horizontal"?"height":"width"]:"100%"}:{[l.direction==="horizontal"?"width":"height"]:`${(1-o.value)*100}%`,[l.direction==="horizontal"?"height":"width"]:"100%"}),f=s=>{s.preventDefault(),l.detailFolded||(n.value=!0)},m=s=>{if(!n.value||!r.value||l.detailFolded)return;const h=r.value.getBoundingClientRect();let g;l.direction==="horizontal"?g=(s.clientX-h.left)/h.width:g=(s.clientY-h.top)/h.height;const d=l.minSize/(l.direction==="horizontal"?h.width:h.height),y=1-d;o.value=Math.max(d,Math.min(y,g))},i=()=>{n.value=!1};return e.onMounted(()=>{document.addEventListener("mousemove",m),document.addEventListener("mouseup",i)}),e.onUnmounted(()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",i)}),(s,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["main-detail-panel",[s.direction]]),ref_key:"container",ref:r},[e.createElementVNode("div",{class:e.normalizeClass(["panel main-panel",s.mainPanelClass]),style:e.normalizeStyle([[s.mainPanelStyle,a.value],{}])},[e.renderSlot(s.$slots,"main",{},void 0,!0)],6),s.detailFolded?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["divider",{dragging:n.value}]),onMousedown:f},null,34)),s.detailFolded?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["panel detail-panel",s.detailPanelClass]),style:e.normalizeStyle([[s.detailPanelStyle,c.value],{}])},[e.renderSlot(s.$slots,"detail",{},void 0,!0)],6))],2))}}),[["__scopeId","data-v-d5ae5145"]]),An=e.defineComponent({__name:"NumberInputModal",props:{title:{},message:{},value:{},show:{type:Boolean}},emits:["update:show","commit"],setup(t,{emit:l}){const o=t,{t:n}=Q(),r=e.ref(o.value);return e.watch(()=>o.value,()=>r.value=o.value),(a,c)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{title:a.title,show:a.show,preset:"card",style:{width:"400px"},draggable:"",onClose:c[3]||(c[3]=()=>a.$emit("update:show",!1))},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:c[1]||(c[1]=()=>a.$emit("commit",r.value))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("OK")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:c[2]||(c[2]=()=>a.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NForm),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NGrid),{cols:24,"x-gap":24},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NFormItemGi),{span:24,label:a.message},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInputNumber),{value:r.value,"onUpdate:value":c[0]||(c[0]=f=>r.value=f)},null,8,["value"])]),_:1},8,["label"])]),_:1})]),_:1})]),_:1},8,["title","show"]))}}),Ac={class:"flex-column"},En=e.defineComponent({__name:"ObjectTreeView",props:{selectedId:{},rootId:{default:"0"},rootName:{default:"root"},data:{},loadTreeAction:{},moveAction:{},sortAction:{},treeNodeMapper:{},labelRender:{},searchWords:{},iconRender:{},additionKeys:{}},emits:["update:selectedId","update:path"],setup(t,{emit:l}){var O;const o=t,n=l,{t:r}=Q(),a=ce(),c=e.ref(new Array),f=e.ref(void 0),m=(M,b)=>{for(const A of M){if(A.key==b)return[A];if(A.key!=null&&A.key!=null&&A.children&&!A.isLeaf){const D=m(A.children,b);if(D.length)return D.push(A),D}}return[]},i=(M,b)=>{for(let A=0;A<M.length;A++){const D=M[A];if(D.key==b)return{nodes:M,index:A};if(D.children){const _=i(D.children,b);if(_)return _}}return null},s=M=>{const b=m(L.value,M);return b?b.reverse():[]},h=M=>M,g=(M,b=!0)=>{let A=[];if(Array.isArray(M)){const D=(o==null?void 0:o.treeNodeMapper)??h;A=M.map(D)}return b?[{key:o.rootId,label:r(o.rootName),isLeaf:!Array.isArray(A)||A.length==0,children:A}]:A},d=()=>{let M=o.loadTreeAction;M&&(o.additionKeys&&(M=v(M,o.additionKeys)),a.get({url:M,callback:b=>{if(b){const A=g(b);L.value=A,T.value=A.map(D=>D.key)}}}))},y=M=>{const b=L.value;if(b){const A=b.map(D=>D.children?V(D.children):[]);T.value=A.flat()}},B=M=>{const b=L.value;b&&(T.value=b.map(A=>A.key))},V=(M,b)=>{const A=new Array;for(const D of M)if(D.key&&A.push(D.key),D.children){const _=V(D.children);_.length&&A.push(..._)}return A},F=M=>{c.value=M;const b=M.length?M[0]:void 0;n("update:selectedId",b==o.rootId?void 0:b);const A=b?s(b):[];n("update:path",A)},S=M=>e.h("span",null,M.option.label),w=M=>o.iconRender?e.h(u.NIcon,null,{default:()=>{var b;return(b=o.iconRender)==null?void 0:b.call(null,M)}}):M.option.isLeaf?e.h(u.NIcon,null,{default:()=>e.h(an)}):e.h(u.NIcon,null,{default:()=>e.h(ht)}),k=M=>{!o.moveAction&&!o.sortAction||(M.dropPosition=="before"||M.dropPosition=="after"?M.dragNode.key&&typeof M.node.key&&E(M.dragNode,M.node,M.dropPosition):M.dropPosition=="inside"&&typeof M.dragNode.key=="number"&&typeof M.node.key=="number"&&x(M.dragNode,M.node))},x=(M,b)=>{const A=o.moveAction;if(!A)return;const D=M.key,_=[M.key],G=b.key;!D||!G||M==b||a.post({url:A,data:{menuItemIds:_,targetId:G},successMessage:"Successful operation.",success:()=>{const $=i(L.value,D);$&&($.nodes.splice($.index,1),b.children&&b.children.push(M))}})};async function E(M,b,A){const D=o.sortAction;if(!D)return;const _=M.key;let G=b.key;if(!_||!G||_==G)return;const $=i(L.value,_);if($){if(A=="after"){const W=$.nodes.indexOf(b);if(W>-1&&W<$.nodes.length-1&&(b=$.nodes[W+1],G=b.key,!G||_==G))return}a.post({url:D,data:{menuId:_,nextSiblingId:G},successMessage:"Successful operation.",success:()=>{$.nodes.splice($.index,1);const W=$.nodes.indexOf(b);W>-1?$.nodes.splice(W,0,M):$.nodes.push(M)}})}}const H=M=>{if(M==null&&(M=o.rootId),c.value.includes(M))return;const b=m(L.value,M);b.length&&(T.value=b.map(A=>A.key),c.value=[M])},L=e.ref(g(o.data??[])),T=e.ref(((O=L.value)==null?void 0:O.map(M=>M.key))??[]);return e.watch(()=>o.additionKeys,()=>d()),e.watch(()=>o.loadTreeAction,()=>d()),e.watch(()=>o.data,M=>{M?L.value=g(M):L.value=[]}),e.watch(()=>o.selectedId,M=>{H(M)}),e.onMounted(()=>{d()}),(M,b)=>(e.openBlock(),e.createElementBlock("div",Ac,[e.createVNode(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{placeholder:e.unref(r)("Search"),clearable:"",onChange:b[0]||(b[0]=A=>f.value=A)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(un))]),_:1})]),_:1},8,["placeholder"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:d,title:e.unref(r)("Refresh")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(dt))]),_:1})]),_:1},8,["title"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:b[1]||(b[1]=()=>y()),title:e.unref(r)("Expand All")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Zs))]),_:1})]),_:1},8,["title"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:b[2]||(b[2]=()=>B()),title:e.unref(r)("Collapse All")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(rn))]),_:1})]),_:1},8,["title"])]),_:1}),e.createVNode(e.unref(u.NTree),{class:"flex-grow-1",style:{height:"10px"},"virtual-scroll":"","show-line":"","block-node":"",draggable:M.sortAction!=null||M.moveAction!=null,data:L.value,pattern:f.value,"render-label":S,"render-prefix":w,onDrop:k,"selected-keys":c.value,"default-expanded-keys":T.value,"onUpdate:selectedKeys":F},null,8,["draggable","data","pattern","selected-keys","default-expanded-keys"])]))}}),Ec=["src"],_n=e.defineComponent({__name:"PhotoBox",props:{src:{},fallbackSrc:{}},setup(t){const l=t,n="/img/no_photo.png";let r=!1;function a(c){if(!r){var f=c.target;f instanceof HTMLImageElement&&(r=!0,f.src=l.fallbackSrc??n)}}return e.watch(()=>l.src,()=>{r=!1}),(c,f)=>(e.openBlock(),e.createElementBlock("img",{src:c.src,style:{"border-radius":"0.8em","object-fit":"cover"},onError:a},null,40,Ec))}}),_c={class:"flex-column gap05"},Lc={key:0},zc={class:"flex-row gap05",style:{"align-items":"center"}},Ln=e.defineComponent({__name:"PrintModal",props:{show:{type:Boolean},title:{default:"Print"},name:{},action:{},additionParams:{},width:{default:"300px"},disabled:{type:Boolean},beforePrint:{}},emits:["update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Q(),a=ce(),c=e.ref(!1),f=e.ref(s()),m=e.ref(h()),i=[{label:r("Collated (123-123-123)"),value:"Collated"},{label:r("Uncollated (111-222-333)"),value:"Uncollated"}];function s(){if(o.name){const d=Number(localStorage.getItem(`${o.name}:print-copies`));if(d&&d>0)return d}return 1}function h(){if(o.name){const d=localStorage.getItem(`${o.name}:print-collate`);if(d&&(d=="Collated"||d=="Uncollated"))return d}return"Collated"}function g(){if(o.disabled||c.value)return;const d={action:o.action,collate:m.value,copies:f.value,additionParams:o.additionParams};if(o.beforePrint&&o.beforePrint(d)==!1)return;let y=d.action;y&&(y=v(y,[{collate:d.collate,copies:d.copies},d.additionParams]),o.name&&(localStorage.setItem(`${o.name}:print-collate`,m.value),localStorage.setItem(`${o.name}:print-copies`,f.value.toString())),c.value=!1,a.openFile({url:y,loadingStatus:B=>c.value=B,callback:()=>{c.value=!1,n("update:show",!1)}}))}return(d,y)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{class:"custom-card",show:d.show,preset:"card",style:e.normalizeStyle({width:d.width}),onClose:y[3]||(y[3]=()=>d.$emit("update:show",!1))},{header:e.withCtx(()=>[e.createElementVNode("div",zc,[e.createVNode(e.unref(u.NIcon),{size:"16"},{default:e.withCtx(()=>[e.createVNode(e.unref(ss))]),_:1}),e.createElementVNode("div",null,e.toDisplayString(e.unref(r)(d.title)),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{onClick:g,style:{"min-width":"100px"},type:"primary",loading:c.value,disable:!d.action||d.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Print")),1)]),_:1},8,["loading","disable"]),e.createVNode(e.unref(u.NButton),{onClick:y[2]||(y[2]=()=>d.$emit("update:show",!1)),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.renderSlot(d.$slots,"default"),e.createElementVNode("div",_c,[e.createElementVNode("div",null,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Number of print copies"))+":",1),e.createVNode(e.unref(u.NInputNumber),{value:f.value,"onUpdate:value":y[0]||(y[0]=B=>f.value=B),min:"1"},null,8,["value"])]),f.value>1?(e.openBlock(),e.createElementBlock("div",Lc,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Copies print order")),1),e.createVNode(e.unref(u.NSelect),{options:i,value:m.value,"onUpdate:value":y[1]||(y[1]=B=>m.value=B)},null,8,["value"])])):e.createCommentVNode("",!0)])]),_:3},8,["show","style"]))}}),$c={key:0,style:{"text-align":"center"}},Dc=["src"],Rc={key:1,style:{"text-align":"center"}},zn=e.defineComponent({__name:"QrModal",props:{title:{default:"QR Code"},code:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:l}){const o=t,{t:n}=Q(),r=e.computed(()=>`/api/core/QR/Image?code=${encodeURIComponent(o.code||"")}&format=CODE_128&width=200&height=200`);return(a,c)=>{const f=e.resolveComponent("n-text");return e.openBlock(),e.createBlock(e.unref(u.NModal),{show:a.show,"onUpdate:show":c[1]||(c[1]=m=>a.$emit("update:show",m)),preset:"card",title:e.unref(n)(a.title),style:{"max-width":"350px"}},{default:e.withCtx(()=>[a.code?(e.openBlock(),e.createElementBlock("div",$c,[e.createElementVNode("img",{src:r.value},null,8,Dc),e.createVNode(e.unref(u.NH3),{style:{margin:"1em"}},{default:e.withCtx(()=>[e.createVNode(f,{class:"text-monospace"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.code),1)]),_:1})]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:c[0]||(c[0]=()=>a.$emit("update:show",!1)),type:"primary",style:{width:"200px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("Close")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",Rc,[e.createVNode(e.unref(u.NEmpty))]))]),_:1},8,["show","title"])}}}),Oc={class:"flex-row",style:{"align-items":"center"}},jc={style:{"margin-left":"0.5em"}},$n=e.defineComponent({__name:"SearchCard",props:{title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean},additionQuery:{}},emits:["searchBack"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Q(),a=e.ref([]),c=(i,s)=>{a.value=s??[]},f=()=>{a&&n("searchBack",a.value,o.config)},m=i=>{i&&i.length&&n("searchBack",i,o.config)};return(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NCard),{class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createElementVNode("div",Oc,[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(me))]),_:1}),e.createElementVNode("span",jc,e.toDisplayString(e.unref(r)(i.title)),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px"},disabled:a.value.length==0,onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["disabled"])]),default:e.withCtx(()=>[e.createVNode(We,{class:"flex-grow-1",config:i.config,"multi-select":i.multiSelect,"auto-close":i.autoClose,"addition-query":i.additionQuery,onResultSelected:c,onSearchBack:m},null,8,["config","multi-select","auto-close","addition-query"])]),_:1}))}});class Pc{constructor(){q(this,"rows",Array());q(this,"totalRecords",null);q(this,"pageIndex",0);q(this,"pageSize",10);q(this,"pageCount",null);q(this,"noTotal",!1);q(this,"message",null);q(this,"summary",null);q(this,"currentPageRecords",0);q(this,"meta")}}const Fc={class:"flex-grow-1 flex-column"},Hc={class:"icon-container"},Gc=["title"],Ze="browse_icon_directory",Dn="page_index",Rn="search_words",On=32,$t=le(e.defineComponent({__name:"SelectIconBox",emits:["update:selected"],setup(t,{emit:l}){const o=l,{t:n}=Q(),r=ce(),a=e.ref(sessionStorage.getItem(Ze)),c=e.ref(g(void 0)),f=e.ref([]),m=e.ref(1),i=e.ref(0),s=e.ref(!1),h=e.ref(sessionStorage.getItem(Rn));function g(S){const w=[{name:n("Root"),path:"/"}];if(S){for(;S.startsWith("/")||S.startsWith("\\");)S=S.substring(1);const k=S.split(/[\\/]+/);let x="/";for(const E of k){x+=E;const H={name:E,path:x};w.push(H),x+="/"}}return w}function d(S){S.isDirectory?a.value=S.path:S.path&&o("update:selected",S.path)}function y(){V(0)}function B(S){V(S-1)}function V(S){S=Math.max(0,S);let w=`/api/core/SystemIcons/page?pageSize=${On}&pageIndex=${S}`;var k=h.value;k&&(w+=`&searchWords=${encodeURIComponent(k)}`);const x=a.value;x&&(w+=`&directory=${encodeURIComponent(x)}`),r.get({url:w,callback:E=>{E&&(f.value=E.rows,i.value=E.totalRecords,m.value=E.pageIndex+1,F(E.pageIndex,x,k))},loadingStatus:E=>s.value=E})}function F(S,w,k){sessionStorage.setItem(Dn,S.toString()),w?sessionStorage.setItem(Ze,w):sessionStorage.removeItem(Ze),k?sessionStorage.setItem(Rn,k):sessionStorage.removeItem(Ze)}return e.watch(a,S=>{c.value=g(S),V(0)}),e.onMounted(()=>{c.value=g(a.value);let S=Number(sessionStorage.getItem(Dn));V(S||0)}),(S,w)=>(e.openBlock(),e.createElementBlock("div",Fc,[e.createElementVNode("div",null,[e.createVNode(e.unref(u.NBreadcrumb),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,k=>(e.openBlock(),e.createBlock(e.unref(u.NBreadcrumbItem),{key:k.path},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{text:"",onClick:()=>a.value=k.path,title:k.path},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Jo))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.name)+" ",1)]),_:2},1032,["onClick","title"])]),_:2},1024))),128))]),_:1})]),e.createVNode(e.unref(u.NCard),{class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createVNode(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{style:{width:"250px"},placeholder:e.unref(n)("Quick Search"),clearable:"",onChange:y,value:h.value,"onUpdate:value":w[0]||(w[0]=k=>h.value=k)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(me))]),_:1})]),_:1},8,["placeholder","value"]),e.createVNode(e.unref(u.NButton),{title:e.unref(n)("Search"),onClick:y,style:{padding:"0 8px"}},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(me))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(n)("Search")),1)]),_:1},8,["title"])]),_:1})]),footer:e.withCtx(()=>[e.createVNode(e.unref(u.NPagination),{page:m.value,"onUpdate:page":[w[1]||(w[1]=k=>m.value=k),B],"item-count":i.value??0,"page-size":On},{suffix:e.withCtx(({startIndex:k,endIndex:x,itemCount:E})=>[E?(e.openBlock(),e.createBlock(e.unref(u.NText),{key:0,italic:"",depth:"3"},{default:e.withCtx(()=>[e.createTextVNode("["+e.toDisplayString(k+1)+"~"+e.toDisplayString(x+1)+"] / "+e.toDisplayString(E),1)]),_:2},1024)):e.createCommentVNode("",!0)]),_:1},8,["page","item-count"])]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:s.value,class:"flex-grow-1 flex-column","content-class":"flex-grow-1 flex-column"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NScrollbar),{"x-scrollable":"",class:"flex-grow-1",style:{"min-height":"100%","min-width":"100%",overflow:"auto",height:"1px",width:"1px"}},{default:e.withCtx(()=>[e.createElementVNode("div",Hc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,k=>(e.openBlock(),e.createBlock(e.unref(u.NButton),{quaternary:"",class:"icon-button",onClick:()=>d(k)},{default:e.withCtx(()=>[e.createElementVNode("div",{style:{overflow:"hidden"},title:k.name},[e.createElementVNode("div",null,[k.isDirectory?(e.openBlock(),e.createBlock(e.unref(u.NIcon),{key:0,size:"48",color:"#FFCA28"},{default:e.withCtx(()=>[e.createVNode(e.unref(Jo))]),_:1})):(e.openBlock(),e.createBlock(e.unref(u.NImage),{key:1,width:"48",height:"48","preview-disabled":"",src:"/api/core/SystemIcons/Icons?path="+k.path},null,8,["src"]))]),e.createElementVNode("div",null,e.toDisplayString(k.name),1)],8,Gc)]),_:2},1032,["onClick"]))),256))])]),_:1})]),_:1},8,["show"])]),_:1})]))}}),[["__scopeId","data-v-4fa23665"]]),jn=e.defineComponent({__name:"SelectObjectModal",props:{show:{type:Boolean},title:{default:"Select Object"},items:{},getListAction:{},width:{default:300},keyName:{default:"id"},selectedValue:{},message:{},description:{}},emits:["update:show","valueSelected"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Q(),a=ce(),c=e.ref(i(o.items)),f=e.ref(!1),m=e.ref(o.selectedValue);function i(g){if(g){if(!g.length||typeof g[0]=="object")return g}else return[];const d=[];for(let y of g)typeof y=="string"||typeof y=="number"?d.push({id:y.toString(),code:r(y.toString())}):d.push(y);return d}const s=()=>{if(f.value)return;const g=o.getListAction;if(!g){c.value=[];return}a.get({url:g,callback:d=>{Array.isArray(d)?c.value=d:Array.isArray(d==null?void 0:d.rows)?c.value=d.rows:c.value=[]},loadingStatus:d=>f.value=d})},h=()=>{m.value&&n("valueSelected",m.value)};return e.onMounted(()=>{o.getListAction&&s()}),e.watch(()=>o.getListAction,()=>{s()}),(g,d)=>(e.openBlock(),e.createBlock(e.unref(u.NSpin),{show:f.value},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NModal),{show:g.show,style:e.normalizeStyle({width:g.width+"px",minWidth:"100px"}),preset:"card",title:e.unref(r)(g.title),onClose:d[2]||(d[2]=()=>g.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:"",align:"stretch"},{default:e.withCtx(()=>[e.renderSlot(g.$slots,"header"),e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.message),1)]),_:1}),e.createVNode(e.unref(u.NRadioGroup),{value:m.value,"onUpdate:value":d[0]||(d[0]=y=>m.value=y),name:"valueList",style:{display:"block"}},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,y=>(e.openBlock(),e.createBlock(e.unref(u.NRadio),{key:y[g.keyName],value:y[g.keyName]},{default:e.withCtx(()=>[e.renderSlot(g.$slots,"default",{data:y},()=>[e.createTextVNode(e.toDisplayString(y.code)+" "+e.toDisplayString(y.name),1)])]),_:2},1032,["value"]))),128))]),_:3})]),_:3},8,["value"]),e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.description),1)]),_:1}),e.renderSlot(g.$slots,"bottom"),e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:h},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:d[1]||(d[1]=()=>g.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),_:3})]),_:3},8,["show","style","title"])]),_:3},8,["show"]))}});function Pn(t,l){for(let o of t){if(o.guid==l)return o;if(Array.isArray(o.items)){const n=Pn(o.items,l);if(n)return n}}}const Dt=()=>{const t={};function l(n,r,a){return!!(r&&r.includes(a)||n.title&&n.title.includes(a)||n.url&&n.url.includes(a))}function o(n,r,a,c){var m;const f=new Array;if(r){let i=0,s=!1;for(const h of r)if(h.isEnabled!==!1)if(h.isSeparator)s||(f.push({type:"divider",key:`_${a}_${i++}`}),s=!0);else{const g=n(h.title),d={key:h.guid,id:h.guid,label:g,disabled:!h.isEnabled,href:h.url,tabBehavior:h.tabBehavior};if(h.items&&h.items.length)d.children=o(n,h.items,h.guid,c);else if(c&&!l(h,g,c))continue;h.guid&&h.icon&&(t[h.guid]={icon:h.icon,color:h.color}),((m=d.children)!=null&&m.length||d.href)&&f.push(d),s=!1}}return f.every(i=>i.type=="divider")?[]:f}return{menuLooks:t,systemMenuToNaiveMenu:o}},Fn=e.defineComponent({__name:"SideMenu",props:{collapsed:{type:Boolean},currentMenuId:{}},setup(t){const{t:l}=Q(),o=e.inject("axios"),n=Ie(),r=/^https?:\/\//i,a=e.ref([]),c=e.ref(void 0),f=Dt(),m=e.computed(()=>f.systemMenuToNaiveMenu(l,n.menus,void 0,c.value)),i=e.computed(()=>n.isLoadingMenu);function s(d){if(typeof d.href=="string"&&d.href&&!d.children){let y=d.href.startsWith("~")?d.href.substring(1):d.href;d.id&&(y=v(y,{_menuid:d.id}));let B;return d.tabBehavior=="NewTab"?B="_blank":d.tabBehavior=="NamedTab"&&(B=d.id),r.test(y)?e.h("a",{href:y,target:"_blank"},{default:()=>d.label}):e.h(de.RouterLink,{to:y,target:B},{default:()=>d.label})}else return typeof d.label=="string"?d.label:""}function h(d){var y,B,V;if(d.key){const F=(y=f.menuLooks[d.key])==null?void 0:y.icon;if(F)return e.h(Se,{path:F,class:"menu-icon"});if((B=d.children)!=null&&B.length){const S=(V=d.key)==null?void 0:V.toString();return S&&a.value.includes(S)?e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(Xs)}):e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(ht)})}else return e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(an)})}}function g(d){if(d)try{o.post(`/api/core/UserRecentMenus/add?menuId=${encodeURIComponent(d)}`)}catch(y){console.error(y)}}return e.onMounted(()=>{!n.menus&&!n.isLoadingMenu&&n.sessionToken&&n.loadMenus()}),e.watch(()=>n.sessionToken,()=>n.loadMenus()),(d,y)=>{const B=e.resolveComponent("n-scrollbar"),V=e.resolveComponent("n-input");return e.openBlock(),e.createBlock(e.unref(u.NSpin),{show:i.value,class:"h-100 menu-spin","content-class":"flex-column h-100"},{default:e.withCtx(()=>[e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NMenu),{collapsed:d.collapsed,"collapsed-width":64,"collapsed-icon-size":22,options:m.value,"root-indent":16,indent:16,"render-label":s,"render-icon":h,value:d.currentMenuId,accordion:!0,"onUpdate:expandedKeys":y[0]||(y[0]=F=>a.value=F),"onUpdate:value":g},null,8,["collapsed","options","value"])]),_:1}),e.withDirectives(e.createVNode(V,{style:{width:"250px"},placeholder:e.unref(l)("Search Menu"),clearable:"",onChange:y[1]||(y[1]=F=>c.value=F)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(un))]),_:1})]),_:1},8,["placeholder"]),[[e.vShow,!d.collapsed]])]),_:1},8,["show"])}}}),Kc=["src"],Hn=e.defineComponent({__name:"SystemIconInput",props:{value:{},label:{},placeholder:{},readonly:{type:Boolean},clearable:{type:Boolean,default:!0}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Q(),a=e.ref(!1),c=e.ref(void 0);function f(){a.value=!a.value}function m(i){i!=null&&!o.readonly&&(n("update:value",i),a.value=!1)}return e.watch(()=>o.value,i=>{i?c.value=`/api/core/SystemIcons/Icons?path=${encodeURIComponent(i)}`:c.value=void 0}),(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInputGroupLabel),{style:{display:"flex","justify-content":"center","align-items":"center",width:"40px"}},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:c.value,style:{height:"16px",width:"16px","align-self":"center"}},null,8,Kc)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.unref(u.NInput),{readonly:i.readonly,value:i.value,placeholder:i.placeholder,"onUpdate:value":s[0]||(s[0]=h=>i.$emit("update:value",h)),clearable:i.clearable},null,8,["readonly","value","placeholder","clearable"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:f,disabled:i.readonly},{default:e.withCtx(()=>s[4]||(s[4]=[e.createTextVNode(" … ",-1)])),_:1,__:[4]},8,["disabled"]),e.createVNode(e.unref(u.NModal),{show:a.value,"onUpdate:show":s[2]||(s[2]=h=>a.value=h),title:e.unref(r)("Select Icon"),onClose:s[3]||(s[3]=()=>a.value=!1),preset:"card",style:{width:"730px",height:"600px"},"content-style":"display: flex; flex-direction: column;"},{default:e.withCtx(()=>[e.createVNode($t,{"onUpdate:selected":s[1]||(s[1]=h=>m(h))})]),_:1},8,["show","title"])]),_:1}))}}),Wc=e.defineComponent({components:{NButton:u.NButton,NIcon:u.NIcon},props:{title:String,iconColor:String,icon:Object},setup(){const{t}=Q();return{t}}});function Zc(t,l,o,n,r,a){const c=e.resolveComponent("n-icon"),f=e.resolveComponent("n-button");return e.openBlock(),e.createBlock(f,null,e.createSlots({default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(t.title?t.t(t.title):""),1)]),_:2},[t.icon?{name:"icon",fn:e.withCtx(()=>[e.createVNode(c,{color:t.iconColor},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.icon),1)]),_:1},8,["color"])]),key:"0"}:void 0]),1024)}const Gn=le(Wc,[["render",Zc]]),Yc=e.defineComponent({name:"TopMenu",components:{NMenu:u.NMenu,NSpin:u.NSpin},setup(){const{t}=Q(),l=e.inject("axios"),o=Ie(),n=/^https?:\/\//i,r=Dt(),a=e.computed(()=>r.systemMenuToNaiveMenu(t,o.menus)),c=e.computed(()=>o.isLoadingMenu);function f(s){if(typeof s.href=="string"&&s.href&&!s.children){let h=s.href.startsWith("~")?s.href.substr(1):s.href;s.id&&(h=v(h,{_menuid:s.id}));let g;return s.tabBehavior=="NewTab"?g="_blank":s.tabBehavior=="NamedTab"&&(g=s.id),n.test(h)?e.h("a",{href:h,target:"_blank"},{default:()=>s.label}):e.h(de.RouterLink,{to:h,target:g},{default:()=>s.label})}else return s.label}function m(s){var h,g;if(s.key){const d=(h=r.menuLooks[s.key])==null?void 0:h.icon;return d?e.h(Se,{path:d,class:"menu-icon"}):(g=s.children)!=null&&g.length?void 0:e.h("div",{class:"menu-icon-blank"},[])}}function i(s){if(s)try{l.post(`/api/core/UserRecentMenus/add?menuId=${encodeURIComponent(s)}`)}catch(h){console.error(h)}}return e.onMounted(()=>{!o.menus&&!o.isLoadingMenu&&o.sessionToken&&o.loadMenus()}),e.watch(()=>o.sessionToken,()=>o.loadMenus()),{menuOptions:a,isLoadingMenu:c,renderMenuLabel:f,renderMenuIcon:m,onMenuSelected:i}}});function Qc(t,l,o,n,r,a){const c=e.resolveComponent("n-menu"),f=e.resolveComponent("n-spin");return e.openBlock(),e.createBlock(f,{show:t.isLoadingMenu},{default:e.withCtx(()=>[e.createVNode(c,{mode:"horizontal",options:t.menuOptions,"render-label":t.renderMenuLabel,"render-icon":t.renderMenuIcon,"onUpdate:value":t.onMenuSelected},null,8,["options","render-label","render-icon","onUpdate:value"])]),_:1},8,["show"])}const Kn=le(Yc,[["render",Qc]]),Xc=e.defineComponent({name:"TreeView",emits:["update:selectedId","update:path"],props:{selectedId:[Number,String],path:Array,rootId:{type:[Number,String],default:""},rootName:{type:String,default:"Root"},parentKey:{type:String,default:"parentId"},childrenAction:String,moveAction:String,sortAction:String,treeNodeMapper:Function,labelRender:Function},setup(t,l){const o=u.useMessage(),n=e.inject("axios"),{t:r}=Q(),a=e.ref(new Array),c=e.ref(new Array),f=e.ref(new Array);function m(T,O){for(const M of T){if(M.key==O)return{node:M,path:[M.key]};if(M.key!=null&&M.key!=null&&M.children&&!M.isLeaf){const b=m(M.children,O);if(b)return{node:b,path:[M.key,...b.path]}}}return null}function i(T,O){for(let M=0;M<T.length;M++){const b=T[M];if(b.key==O)return{nodes:T,index:M};if(b.children){const A=i(b.children,O);if(A)return A}}return null}function s(T){const O=m(a.value,T);return O?O.path:[]}function h(T,O){const M=new Array;for(const b of T)if(b.key&&(!O||O(b.key))&&M.push(b.key),b.children){const A=h(b.children,O);A.length&&M.push(...A)}return M}function g(T){c.value=T}function d(T){f.value=T;const O=T.length?T[0]:null;l.emit("update:selectedId",O);const M=O?s(O):[];l.emit("update:path",M)}function y(T){return t.treeNodeMapper?t.treeNodeMapper.call(void 0,T):{key:T.id,label:T.title,isLeaf:!T.hasSubitems}}async function B(T){const O=t.childrenAction,M=t.parentKey;if(!(!O||!M))try{const b=v(O,{parentKey:M,parentId:T}),A=await n.get(b);if(A.isSuccess&&A.value!=null)return A.value.map(y);o.error(r(A.errorMessage||"Error"))}catch(b){console.log(b),o.error((b==null?void 0:b.toString())||r("Error"))}}async function V(){a.value=[{key:t.rootId,label:r(t.rootName||"Root"),isLeaf:!1,children:await B(null)}],t.selectedId==null?f.value=[t.rootId]:t.selectedId?f.value=[t.selectedId]:f.value=[],c.value=[t.rootId]}async function F(T){const O=T.key;if(O!=null){if(T.children){const b=c.value,A=h(T.children,D=>b.includes(D));c.value=c.value.filter(D=>!A.includes(D))}const M=await B(O);M&&(T.isLeaf=!M.length,T.children=M.length?M:void 0)}}function S(T){return e.h("span",null,T.option.label)}function w(T){if(!T.option.isLeaf)return e.h(u.NIcon,null,{default:()=>e.h(ht)})}function k(T){const O=T.option.key;if(O!=null&&f.value.includes(O))return e.h(u.NButton,{text:!0,onClick:M=>{M.stopPropagation(),F(T.option)}},{default:()=>e.h(u.NIcon,null,{default:()=>e.h(dt)})})}function x(T){!t.moveAction&&!t.sortAction||(T.dropPosition=="before"||T.dropPosition=="after"?T.dragNode.key&&typeof T.node.key&&H(T.dragNode,T.node,T.dropPosition):T.dropPosition=="inside"&&typeof T.dragNode.key=="number"&&typeof T.node.key=="number"&&E(T.dragNode,T.node))}async function E(T,O){const M=t.moveAction;if(!M)return;const b=T.key,A=[T.key],D=O.key;if(!(!b||!D||T==O))try{const _=await n.post(M,{menuItemIds:A,targetId:D});if(_.isSuccess){o.success(r("Successful operation."));const G=i(a.value,b);G&&(G.nodes.splice(G.index,1),O.children?O.children.push(T):F(O))}else o.error(r(_.errorMessage||"Error"))}catch(_){console.log(_),o.error((_==null?void 0:_.toString())||"Error")}}async function H(T,O,M){const b=t.sortAction;if(!b)return;console.log(`dragNode: ${T.key} ${T.label}, targetNode: ${O.key} ${O.label}, dropPosition: ${M}`);const A=T.key;let D=O.key;if(!A||!D||A==D)return;const _=i(a.value,A);if(_){if(M=="after"){const G=_.nodes.indexOf(O);if(G>-1&&G<_.nodes.length-1&&(O=_.nodes[G+1],D=O.key,!D||A==D))return}try{const G=await n.post(b,{menuId:A,nextSiblingId:D});if(G.isSuccess){o.success(r("Successful operation.")),_.nodes.splice(_.index,1);const $=_.nodes.indexOf(O);$>-1?_.nodes.splice($,0,T):_.nodes.push(T)}else o.error(r(G.errorMessage||"Error"))}catch(G){console.log(G),o.error((G==null?void 0:G.toString())||"Error")}}}async function L(T){var O;if(T.length){let M=(O=a.value)==null?void 0:O.find(_=>_.key==T[0]);M==null&&(M={key:T[0],label:r(t.rootName||"Root"),isLeaf:!1},a.value.push(M));let b=T[0],A=M;for(let _=1;_<T.length-1&&A;_++)if(A.children||(A.children=await B(b)),A.children){const G=T[_];A=A.children.find($=>$.key==G),b=G}const D=c.value;for(let _=0;_<T.length-1;_++)D.includes(T[_])||D.push(T[_]);c.value=D,f.value=[T[T.length-1]]}}return e.onMounted(()=>{V()}),e.watch(()=>t.childrenAction,()=>{V()}),e.watch(()=>t.path,T=>{T&&L(T)}),{data:a,expandedKeys:c,expandedKeysChanged:g,loadChildren:F,dragDrop:x,renderLabel:S,renderPrefix:w,renderSuffix:k,selectedKeys:f,selectedKeysChanged:d}}});function Jc(t,l,o,n,r,a){const c=e.resolveComponent("n-tree");return e.openBlock(),e.createBlock(c,{"block-line":"",remote:t.childrenAction!=null,draggable:t.sortAction!=null||t.moveAction!=null,data:t.data,"render-label":t.renderLabel,"render-prefix":t.renderPrefix,"render-suffix":t.renderSuffix,onLoad:t.loadChildren,onDrop:t.dragDrop,"expanded-keys":t.expandedKeys,"onUpdate:expandedKeys":t.expandedKeysChanged,"selected-keys":t.selectedKeys,"onUpdate:selectedKeys":t.selectedKeysChanged},null,8,["remote","draggable","data","render-label","render-prefix","render-suffix","onLoad","onDrop","expanded-keys","onUpdate:expandedKeys","selected-keys","onUpdate:selectedKeys"])}const Wn=le(Xc,[["render",Jc]]),qc={style:{margin:"0 20px 10px 0",cursor:"pointer"}},Uc={class:"user-name-box"},vc={class:"user-name-label"},Zn="/img/user_avatar.png",Yn=le(e.defineComponent({__name:"UserMenu",setup(t){var d;const l=de.useRouter(),{t:o}=Q(),n=u.useDialog(),r=xe(),a=Ie(),c=nt(),f=e.computed(()=>a.userInfo),m=e.ref(!1),i=e.computed(()=>{var y,B;return(y=a.userInfo)!=null&&y.avatar?`/api/core/avatar?id=${(B=a.userInfo)==null?void 0:B.avatar}`:Zn});function s(){n.warning({title:o("Logout"),content:o("Are you sure log out?"),positiveText:o("OK"),negativeText:o("Cancel"),onPositiveClick:()=>{a.logout(),c.clearTabs(),l.push({path:"/login"})}})}function h(y){switch(y){case"preferences":l.push({path:"/core/preferences"});break;case"change_password":m.value=!0;break;case"logout":s();break;case"toggle_theme":r.toggleTheme();break}}const g=[{label:(d=f.value)==null?void 0:d.userName,type:"group",key:"user_group",children:[{label:o("Preferences"),key:"preferences",icon(){return e.h(u.NIcon,null,{default:()=>e.h(Ja)})}},{label:o("Change Password"),key:"change_password",icon(){return e.h(u.NIcon,null,{default:()=>e.h(ts)})}}]},{label:o("Toggle Theme"),key:"toggle_theme",icon(){return e.h(u.NIcon,null,{default:()=>e.h(za)})}},{type:"divider"},{label:o("Logout"),key:"logout",icon(){return e.h(u.NIcon,null,{default:()=>e.h(Qa)})}}];return(y,B)=>{const V=e.resolveComponent("n-avatar"),F=e.resolveComponent("n-dropdown"),S=e.resolveComponent("n-space");return e.openBlock(),e.createBlock(S,{style:{"align-items":"center"}},{default:e.withCtx(()=>[e.createVNode(F,{trigger:"click",options:g,placement:"bottom-end",onSelect:h,size:"medium"},{default:e.withCtx(()=>{var w,k;return[e.createElementVNode("div",qc,[e.createVNode(V,{round:"",size:"medium",title:(w=f.value)==null?void 0:w.userName,src:i.value,"fallback-src":Zn,bordered:"",style:{position:"absolute","z-index":"10"}},null,8,["title","src"]),e.createElementVNode("div",Uc,[e.createElementVNode("div",vc,e.toDisplayString((k=f.value)==null?void 0:k.name),1)])])]}),_:1}),e.createVNode(pt,{show:m.value,onClose:B[0]||(B[0]=()=>m.value=!1)},null,8,["show"])]),_:1})}}}),[["__scopeId","data-v-709139c3"]]),ed={class:"flex-row"},td={class:"app-tab-label"},od={style:{"margin-left":"4px"}},Qn=e.defineComponent({__name:"TabMenu",props:{type:{default:"card"}},setup(t){const l=de.useRouter(),o=Ie(),n=e.computed(()=>o.menus),r=e.ref(void 0);l.afterEach(f=>{!f.path||f.path=="/"||f.name=="blank"||(r.value=a(f.path))});function a(f){var i;const m=(i=o.menus)==null?void 0:i.find(s=>{var h;return((h=s.url)==null?void 0:h.toLowerCase())==f.toLowerCase()});if(m)return m.guid}function c(f){var m;if(f){const i=(m=o.menus)==null?void 0:m.find(s=>s.guid==f);i&&i.url&&(l.push(i.url),r.value=i.guid)}}return e.watch(()=>o.sessionToken,()=>o.loadMenus()),e.onMounted(()=>{!o.menus&&!o.isLoadingMenu&&o.sessionToken&&o.loadMenus()}),(f,m)=>n.value&&n.value.length?(e.openBlock(),e.createBlock(e.unref(u.NTabs),{key:0,class:"app-tabs",type:f.type,"justify-content":"space-evenly",animated:"","tab-class":"tab-item","tabs-padding":8,value:r.value,"onUpdate:value":c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,i=>(e.openBlock(),e.createBlock(e.unref(u.NTab),{key:i.guid,name:i.guid},{default:e.withCtx(()=>[e.createElementVNode("div",ed,[e.createElementVNode("div",null,[i.icon?(e.openBlock(),e.createBlock(Se,{key:0,path:i.icon},null,8,["path"])):(e.openBlock(),e.createBlock(e.unref(u.NIcon),{key:1},{default:e.withCtx(()=>[e.createVNode(e.unref(qs))]),_:1}))]),e.createElementVNode("div",td,[e.createElementVNode("span",od,e.toDisplayString(i.title),1)])])]),_:2},1032,["name"]))),128))]),_:1},8,["type","value"])):e.createCommentVNode("",!0)}}),Xn=e.defineComponent({__name:"QuickSearchBox",props:{searchWords:{},placeholder:{default:"Search"}},emits:["search","update:search-words"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Q(),a=e.ref(o.searchWords||""),c=()=>{n("update:search-words",a.value),n("search",a.value)};return e.watch(()=>o.searchWords,f=>{a.value=f||""}),(f,m)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),{class:"flex-row quick-search-box",style:{width:"inherit"}},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{class:"flex-1",value:a.value,"onUpdate:value":m[0]||(m[0]=i=>a.value=i),placeholder:e.unref(r)(f.placeholder),clearable:"",onChange:c},null,8,["value","placeholder"]),e.createVNode(e.unref(u.NButton),{title:e.unref(r)("Search"),onClick:c,style:{padding:"0 8px"}},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(gt))]),_:1})]),_:1},8,["title"])]),_:1}))}});class nd{constructor(){q(this,"token");q(this,"userId");q(this,"startupTime")}}class ld{constructor(){q(this,"guid","");q(this,"title","");q(this,"icon");q(this,"color");q(this,"url");q(this,"isSeparator",!1);q(this,"isEnabled",!0);q(this,"groupName");q(this,"description");q(this,"items");q(this,"tabBehavior");q(this,"closable")}}const rd=Me.defineStore("fontSize",()=>{const t={small:"14px",medium:"16px",large:"20px"},l="medium",o=()=>{var c;const a=(c=localStorage.getItem("fontSizeMode"))==null?void 0:c.toString();return a&&t[a]?a:l},n=e.ref(o());return{fontSizeMode:n,fontSizeOptions:t,setFontSize:a=>{t[a]&&(n.value=a,localStorage.setItem("fontSizeMode",a))},getFontSize:()=>t[n.value??l]}}),ad=Me.defineStore("userConfig",()=>{const t=e.reactive({}),l=e.computed(()=>s=>t[s]),o=e.computed(()=>({...t}));function n(s,h){t[s]=h,m()}function r(s){Object.assign(t,s),m()}function a(s,h=null){return t[s]!==void 0?t[s]:h}function c(s){delete t[s],m()}function f(){Object.keys(t).forEach(s=>delete t[s]),localStorage.removeItem("user_config")}function m(){try{localStorage.setItem("user_config",JSON.stringify(t))}catch(s){console.error("保存配置失败:",s)}}function i(){try{const s=localStorage.getItem("user_config");if(s){const h=JSON.parse(s);Object.assign(t,h)}}catch(s){console.error("加载配置失败:",s)}}return{config:t,getConfig:l,getAllConfig:o,setConfig:n,setMultipleConfig:r,getConfigValue:a,removeConfig:c,clearAllConfig:f,loadFromLocalStorage:i}}),sd={AppLogoBox:qt,AppTabs:Uo,AutoScrollView:vo,BarcodeImage:tn,ChangePassword:pt,ColorInput:mt,Collapsable:pn,DefaultPropertyForm:Bt,DetailPage:Cn,ExportModal:Mt,EmptyDetailView:kn,FormInput:Be,FullscreenSwitch:bn,GridConfigModal:At,HaloButtonSelect:xn,HaloDatePicker:He,HaloForm:In,HaloGrid:Ke,HaloModal:Bn,HaloModalInput:It,HaloSelect:Vn,HaloTagsInput:xt,HaloTimePicker:kt,HaloTransfer:Mn,ImportModal:Lt,InputModal:zt,ListInputModal:St,MainDetailPanel:Tn,MenuIcon:Se,NullableBooleanInput:bt,NumberInputModal:An,ObjectTreeView:En,PhotoBox:_n,PrintModal:Ln,PropertyGrid:Vt,QrModal:zn,SearchCard:$n,SearchForm:Ge,SearchModal:_t,SearchPanel:We,SelectIconBox:$t,SelectObjectModal:jn,SideMenu:Fn,SystemIconInput:Hn,TagsView:Et,ToolButton:Gn,TopMenu:Kn,TreeView:Wn,UserMenu:Yn,TabMenu:Qn,QuickSearchBox:Xn},id={install(t,l){const o={...qo,...l};for(const[n,r]of Object.entries(sd))t.component(n,r);l!=null&&l.langCode&&t.use(Jt,l==null?void 0:l.langCode,!0),t.provide("axios",ae),t.provide(ft,o)}};I.axios=ae,I.AppLogoBox=qt,I.AppTabs=Uo,I.AutoScrollView=vo,I.BarcodeImage=tn,I.ChangePassword=pt,I.Collapsable=pn,I.ColorInput=mt,I.DataPage=Pc,I.DateFormat=ye,I.DateTimeFormat=Ee,I.DefaultPropertyForm=Bt,I.DetailPage=Cn,I.EmptyDetailView=kn,I.ExportModal=Mt,I.FormInput=Be,I.FullscreenSwitch=bn,I.GridConfigModal=At,I.HaloButtonSelect=xn,I.HaloDatePicker=He,I.HaloForm=In,I.HaloGrid=Ke,I.HaloModal=Bn,I.HaloModalInput=It,I.HaloSelect=Vn,I.HaloTagsInput=xt,I.HaloTimePicker=kt,I.HaloTransfer=Mn,I.HalovConfigKey=ft,I.I18nPlugin=Jt,I.ImportModal=Lt,I.InputModal=zt,I.ListInputModal=St,I.MainDetailPanel=Tn,I.MenuIcon=Se,I.NullableBooleanInput=bt,I.NumberInputModal=An,I.ObjectTreeView=En,I.PhotoBox=_n,I.PrintModal=Ln,I.PropertyGrid=Vt,I.QrModal=zn,I.QuickSearchBox=Xn,I.SearchCard=$n,I.SearchForm=Ge,I.SearchModal=_t,I.SearchPanel=We,I.SelectIconBox=$t,I.SelectObjectModal=jn,I.SessionSummary=nd,I.SideMenu=Fn,I.SystemIconInput=Hn,I.SystemMenu=ld,I.TabMenu=Qn,I.TagsView=Et,I.TimeFormat=_e,I.ToolButton=Gn,I.TopMenu=Kn,I.TreeView=Wn,I.UserMenu=Yn,I.addDays=ya,I.appendParamsToUrl=v,I.arrayDistinct=zo,I.arrayGroupBy=sa,I.arrayMove=Lo,I.arrayRemoveIf=_o,I.buildBarcodeUrl=en,I.buildSearchItems=wn,I.camelToWords=ee,I.clearObject=xi,I.convertItems=yn,I.convertPercentValue=Ko,I.convertTo=Pe,I.copyEntity=gn,I.copyToEntity=hn,I.createGridColumns=wt,I.createI18n=Xt,I.dateTimeToString=it,I.dateToNumber=jo,I.dateToString=st,I.default=id,I.defaultHalovOptions=qo,I.defaultValue=Go,I.downloadFile=pe,I.findMenuById=Pn,I.firstDayOfMonth=wa,I.formatTimespan=Fo,I.getColumnWidth=yt,I.getConfig=ut,I.iconRender=Ct,I.iconRenderIf=Bi,I.initEntity=mn,I.instanceOfColumnValueSource=To,I.instanceOfHaloColumn=Ae,I.instanceOfTime=Do,I.isNullOrWhiteSpace=Wo,I.lastDayOfMonth=Ca,I.linesToArray=ba,I.loadItemSources=Fe,I.mergeCssClass=Yo,I.mergeCssStyles=Zo,I.mergeRoutes=ca,I.msToTime=pa,I.onNullOrWhiteSpace=xa,I.openFile=Eo,I.renderDifference=Mi,I.renderIconButton=Vi,I.renderLabel=Ii,I.searchField=ia,I.secondsToTime=Ro,I.splitNumberByCount=da,I.splitNumberBySize=fa,I.stringToArray=ka,I.stringToTime=Oo,I.sumNumbers=ua,I.timeToString=Po,I.timestamp=ha,I.toBool=fe,I.toBoolDefault=je,I.toDate=$o,I.toViewModel=ga,I.useAccountStore=Ie,I.useCommonStore=xe,I.useFontSizeStore=rd,I.useHttpTools=ce,I.useI18n=Q,I.useMenus=Dt,I.usePermissions=Tt,I.useTabsStore=nt,I.useUiTools=Nt,I.useUserConfigStore=ad,I.validateEmail=Na,Object.defineProperties(I,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});