halov 26.914.0 → 26.914.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/halov.es.js +2392 -2392
- package/dist/halov.umd.cjs +4 -4
- package/package.json +1 -1
package/dist/halov.umd.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
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-3f7ad8bc] div.n-form-item-feedback-wrapper{display:none}div[data-v-3f7ad8bc] .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}.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(S,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):(S=typeof globalThis<"u"?globalThis:S||self,e(S.halov={},S.Vue,S.axios,S.VueRouter,S.NaiveUI,S.Pinia,S.moment,S.Mustache,S.VueDraggablePlus))})(this,function(S,e,ne,ce,u,Me,ae,ke,Zt){"use strict";var Od=Object.defineProperty;var jd=(S,e,ne)=>e in S?Od(S,e,{enumerable:!0,configurable:!0,writable:!0,value:ne}):S[e]=ne;var X=(S,e,ne)=>jd(S,typeof e!="symbol"?e+"":e,ne);var et=typeof document<"u"?document.currentScript:null;const tt=window,Yt="halo-lang";class wl{constructor(l,o=!0){X(this,"langCode","");X(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 qt(t,l){return ot||(ot=new wl(t,l)),ot}function Xt(t,l,o=!0){const n=qt(l,o);t.config.globalProperties.$t=r=>n.t(r),t.provide(Qt,n)}function Y(){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};ne.defaults.headers["Client-Device-Id"]=Cl(),ne.defaults.headers["Content-type"]="application/json",ne.defaults.timeout=1e3*60,ne.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))),ne.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=ce.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))}}),te=(t,l)=>{const o=t.__vccOpts||t;for(const[n,r]of l)o[n]=r;return o},Jt=te(bl,[["__scopeId","data-v-f7799232"]]);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",ql=RegExp("["+Ql+Hl+Zl+Yl+"]");function no(t){return ql.test(t)}function Xl(t){return t.split("")}var lo="\\ud800-\\udfff",Jl="\\u0300-\\u036f",Ul="\\ufe20-\\ufe2f",vl="\\u20d0-\\u20ff",er=Jl+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):Xl(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,qr="(?:"+[jr,bo,No].join("|")+")"+Qr,Xr=RegExp([Ne+"?"+Co+"+"+So+"(?="+[yo,Ne,"$"].join("|")+")",Kr+"+"+Io+"(?="+[yo,Ne+xo,"$"].join("|")+")",Ne+"?"+xo+"+"+So,Ne+"+"+Io,Yr,Zr,wo,qr].join("|"),"g");function Jr(t){return t.match(Xr)||[]}function Ur(t,l,o){return t=lt(t),l=l,l===void 0?Mr(t)?Jr(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,g){var h=new XMLHttpRequest;h.open("GET",i),h.responseType="blob",h.onload=function(){m(h.response,s,g)},h.onerror=function(){console.error("could not download file")},h.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,g){var h=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,g):a(d,d.target="_blank")):(d.href=h.createObjectURL(i),setTimeout(function(){h.revokeObjectURL(d.href)},4e4),setTimeout(function(){a(d)},0))}:"msSaveOrOpenBlob"in navigator?function(i,s,g){if(s=s||i.name||"download",typeof i!="string")navigator.msSaveOrOpenBlob(o(i,g),s);else if(r(i))n(i,s,g);else{var h=document.createElement("a");h.href=i,h.target="_blank",setTimeout(function(){a(h)})}}:function(i,s,g,h){if(h=h||open("","_blank"),h&&(h.document.title=h.document.body.innerText="downloading..."),typeof i=="string")return n(i,s,g);var d=i.type==="application/octet-stream",w=/constructor/i.test(c.HTMLElement)||c.safari,B=/CriOS\/[\d]+/.test(navigator.userAgent);if((B||d&&w||f)&&typeof FileReader<"u"){var V=new FileReader;V.onloadend=function(){var y=V.result;y=B?y:y.replace(/^data:[^;]*;/,"data:attachment/file;"),h?h.location.href=y:location=y,h=null},V.readAsDataURL(i)}else{var O=c.URL||c.webkitURL,I=O.createObjectURL(i);h?h.location=I:location.href=I,h=null,setTimeout(function(){O.revokeObjectURL(I)},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=ne.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,r,a){var d;const c=Ao();let f;const m={responseType:"blob"};r!=null&&(m.timeout=r),(n==null?void 0:n.toLowerCase())=="post"?f=await c.post(t,a,m):(a&&(t=U(t,a)),f=await c.get(t,m));const{data:i,headers:s,status:g,statusText:h}=f;if(g==200||i.length){s&&(o||(o=(d=s["content-type"])==null?void 0:d.toString()),l||(l=aa(s["content-disposition"])));const w=new Blob([i],{type:o||"application/octet-stream"});ra.saveAs(w,l)}else throw`[${g}] ${h}`}async function Eo(t,l,o,n,r){var h;const a=Ao(),c={responseType:"blob"};n!=null&&(c.timeout=n);let f;(o==null?void 0:o.toLowerCase())=="post"?f=await a.post(t,r,c):(r&&(t=U(t,r)),f=await a.get(t,c));const{data:m,headers:i,status:s,statusText:g}=f;if(s==200||m.length){i&&(l||(l=(h=i["content-type"])==null?void 0:h.toString()));const d=new Blob([m],{type:l||"application/octet-stream"}),w=URL.createObjectURL(d);window.open(w)}else throw`[${s}] ${g}`}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||v(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 v(t){return t.length?oa(t):t}function de(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 de(l)}}}function je(t,l){const o=de(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 ae(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=ae(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=ae(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 ae(new Date(t)).format(l||_e);if(t instanceof Date)return ae(t).format(l||_e);if(Do(t))return ae(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 ae(new Date(t)).format(l||ye);if(t instanceof Date)return ae(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 ae(new Date(t)).format(l||Ee);if(t instanceof Date)return ae(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 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=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(g=>g==null?void 0:g.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 de(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[v(n)]=t[n]:o[v(n.name)]=t[n.name];else for(const n in t)o[v(n)]=t[n];return o}function ya(t,l){return ae(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"},qo=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"},Xo=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)]))}}),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:"ManageAccountsOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",qa,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)]))}}),Ja={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",Ja,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)]))}}),Jo={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=te(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}=Y(),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),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(V=>({label:r(V.title),key:V.id,url:V.url}))]);function h(V){o.tabs.find(I=>I.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 w(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,O)=>V.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":O[0]||(O[0]=I=>s.value=I)},{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:g.value,placement:"bottom-end",onSelect:w,"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,I=>(e.openBlock(),e.createBlock(e.unref(u.NTab),{key:I.id,name:I.id,title:I.id,closable:I.closable,class:"app-tab-item",style:e.normalizeStyle({"border-top-color":I.color})},{default:e.withCtx(()=>[I.icon?(e.openBlock(),e.createBlock(Se,{key:0,path:I.icon,style:{"margin-right":"4px"}},null,8,["path"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(r)(I.title)),1)]),_:2},1032,["name","title","closable","style"]))),128))]),_:3},8,["value"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-df170cc3"]]),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=te(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=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")},c=h=>{t.menus=h},f=h=>{t.isLoadingMenu=h},m=h=>{t.authType=h,h?localStorage.setItem("authType",h):localStorage.removeItem("authType")},i=()=>{localStorage.removeItem("userInfo"),localStorage.removeItem("sessionToken"),a(),c(null),localStorage.removeItem("_msgs")},s=async h=>{var d;f(!0);try{h||(h=((d=ut())==null?void 0:d.rootMenuName)??"MainMenu");const w=await ne.get(`/api/core/account/menus?rootName=${encodeURIComponent(h)}`);if(w.isSuccess){const B=w.value||[];on(B),c(B)}else console.log(w.errorMessage||"get remote menus error.")}catch(w){console.log(w)}finally{f(!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:c,setIsLoadingMenu:f,logout:i,loadMenus:s,addMessage:g,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}=Y(),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}),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 d(){var V;s.value&&!m.value&&i.value&&((V=i.value)==null||V.validate(O=>{if(!O)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 w(s.value,f.value.oldPassword,f.value.newPassword)}))}async function w(V,O,I){try{const y={userName:V,oldPassword:O,newPassword:I},k=await a.post("/api/core/account/changePassword",y);k.isSuccess?(r.success(n("Password has been successfully modified!")),o("close")):r.error(n(k.errorMessage||"Error"))}catch(y){r.error((y==null?void 0:y.toString())||n("Error"))}}async function B(){try{const V=await a.get("/api/core/system/passwordOptions");V.isSuccess&&V.value!=null?g.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,O)=>{const I=e.resolveComponent("n-input"),y=e.resolveComponent("n-form-item"),k=e.resolveComponent("n-spin"),x=e.resolveComponent("n-text"),_=e.resolveComponent("n-button"),H=e.resolveComponent("n-modal");return e.openBlock(),e.createBlock(H,{show:V.show,onClose:O[3]||(O[3]=()=>V.$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",Cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,z=>(e.openBlock(),e.createElementBlock("li",{key:z},[e.createVNode(x,{depth:"3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(z),1)]),_:2},1024)]))),128))])):e.createCommentVNode("",!0)]),action:e.withCtx(()=>[e.createVNode(_,{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:h},{default:e.withCtx(()=>[e.createVNode(k,{show:m.value},{default:e.withCtx(()=>[e.createVNode(y,{label:e.unref(n)("User Name")},{default:e.withCtx(()=>[e.createVNode(I,{value:s.value,readonly:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(y,{path:"oldPassword",label:e.unref(n)("Old Password")},{default:e.withCtx(()=>[e.createVNode(I,{value:f.value.oldPassword,"onUpdate:value":O[0]||(O[0]=z=>f.value.oldPassword=z),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(y,{path:"newPassword",label:e.unref(n)("New Password")},{default:e.withCtx(()=>[e.createVNode(I,{value:f.value.newPassword,"onUpdate:value":O[1]||(O[1]=z=>f.value.newPassword=z),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(y,{path:"confirmPassword",label:e.unref(n)("Confirm New Password")},{default:e.withCtx(()=>[e.createVNode(I,{value:f.value.confirmPassword,"onUpdate:value":O[2]||(O[2]=z=>f.value.confirmPassword=z),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"},qs=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)]))}}),Xs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Js=e.defineComponent({name:"IbmCloudPakApplications",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Xs,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}=Y(),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]=de(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]=de(a)||!1:o[r]=de(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(v(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(v(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:v(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(v(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=U(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 g=i[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: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},defaultTime:{}},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,"default-time":f.defaultTime},null,8,["value","type","disabled","clearable","default-time"]))}}),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}=Y(),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=de(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}=Y(),l=u.useMessage(),o=u.useDialog(),n=u.useModal(),r=u.useLoadingBar();let a=0;const c=y=>y&&t(y),f=y=>e.h("div",{},y.split(`
|
|
3
|
-
`).map(k=>e.h("span",{class:"line"},t(k)))),m=(y,k)=>{switch(k){case"create":l.create(()=>f(y));break;case"error":l.error(()=>f(y));break;case"loading":l.loading(t(y));break;case"success":l.success(t(y));break;case"warning":l.warning(t(y));break;default:case"info":l.info(t(y));break}},i=(y,k,x)=>{o.warning({title:t(y??"Confirm"),draggable:!0,content:()=>f(k),positiveText:t("OK"),negativeText:t("Cancel"),onPositiveClick:()=>x()})},s=(y,k,x)=>{o.success({title:t(k??"Success"),draggable:!0,content:()=>f(y),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},g=(y,k,x)=>{o.error({title:t(k??"Error"),draggable:!0,content:()=>f(y),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},h=(y,k,x)=>{o.info({title:t(k??"Information"),draggable:!0,content:()=>f(y),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},d=(y,k,x)=>{o.warning({title:t(k??"Warning"),draggable:!0,content:()=>f(y),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},w=y=>{let k=[];const x=n.create({title:t(y.title??"Search"),preset:"card",style:{width:y.width??"800px",height:y.height??"600px"},contentClass:"flex-column",draggable:y.draggable,content:()=>e.h(e.resolveComponent("SearchPanel"),{class:"flex-grow-1",config:y.config,multiSelect:y.multiSelect==!0,onSearchBack:
|
|
2
|
+
(function(S,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):(S=typeof globalThis<"u"?globalThis:S||self,e(S.halov={},S.Vue,S.axios,S.VueRouter,S.NaiveUI,S.Pinia,S.moment,S.Mustache,S.VueDraggablePlus))})(this,function(S,e,le,ce,u,Te,ae,Ce,Yt){"use strict";var jd=Object.defineProperty;var Pd=(S,e,le)=>e in S?jd(S,e,{enumerable:!0,configurable:!0,writable:!0,value:le}):S[e]=le;var J=(S,e,le)=>Pd(S,typeof e!="symbol"?e+"":e,le);var tt=typeof document<"u"?document.currentScript:null;const ot=window,Qt="halo-lang";class Cl{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=ot.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=ot.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=ot.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 nt=null;function Xt(t,l){return nt||(nt=new Cl(t,l)),nt}function Jt(t,l,o=!0){const n=Xt(l,o);t.config.globalProperties.$t=r=>n.t(r),t.provide(qt,n)}function Y(){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 kl=()=>{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};le.defaults.headers["Client-Device-Id"]=kl(),le.defaults.headers["Content-type"]="application/json",le.defaults.timeout=1e3*60,le.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))),le.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=ce.useRouter();l==null||l.push({name:"Unauthorized"});break}return Promise.reject(t)});const bl=["src"],Nl=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:tt&&tt.tagName.toUpperCase()==="SCRIPT"&&tt.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,bl))}}),oe=(t,l)=>{const o=t.__vccOpts||t;for(const[n,r]of l)o[n]=r;return o},Ut=oe(Nl,[["__scopeId","data-v-f7799232"]]);function xl(){try{const t=sessionStorage.getItem("tabs");return t?JSON.parse(t):null}catch{return null}}const lt=Te.defineStore("tabs",{state:()=>({tabs:xl(),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 Sl=typeof global=="object"&&global&&global.Object===Object&&global,Il=typeof self=="object"&&self&&self.Object===Object&&self,Bl=Sl||Il||Function("return this")(),ke=Bl.Symbol,vt=Object.prototype,Vl=vt.hasOwnProperty,Ml=vt.toString,Ae=ke?ke.toStringTag:void 0;function Tl(t){var l=Vl.call(t,Ae),o=t[Ae];try{t[Ae]=void 0;var n=!0}catch{}var r=Ml.call(t);return n&&(l?t[Ae]=o:delete t[Ae]),r}var Al=Object.prototype,El=Al.toString;function _l(t){return El.call(t)}var Ll="[object Null]",zl="[object Undefined]",eo=ke?ke.toStringTag:void 0;function $l(t){return t==null?t===void 0?zl:Ll:eo&&eo in Object(t)?Tl(t):_l(t)}function Dl(t){return t!=null&&typeof t=="object"}var Rl="[object Symbol]";function Ol(t){return typeof t=="symbol"||Dl(t)&&$l(t)==Rl}function jl(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 Pl=Array.isArray,to=ke?ke.prototype:void 0,oo=to?to.toString:void 0;function no(t){if(typeof t=="string")return t;if(Pl(t))return jl(t,no)+"";if(Ol(t))return oo?oo.call(t):"";var l=t+"";return l=="0"&&1/t==-1/0?"-0":l}function rt(t){return t==null?"":no(t)}function Fl(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 Hl(t,l,o){var n=t.length;return o=o===void 0?n:o,!l&&o>=n?t:Fl(t,l,o)}var Gl="\\ud800-\\udfff",Kl="\\u0300-\\u036f",Wl="\\ufe20-\\ufe2f",Zl="\\u20d0-\\u20ff",Yl=Kl+Wl+Zl,Ql="\\ufe0e\\ufe0f",ql="\\u200d",Xl=RegExp("["+ql+Gl+Yl+Ql+"]");function lo(t){return Xl.test(t)}function Jl(t){return t.split("")}var ro="\\ud800-\\udfff",Ul="\\u0300-\\u036f",vl="\\ufe20-\\ufe2f",er="\\u20d0-\\u20ff",tr=Ul+vl+er,or="\\ufe0e\\ufe0f",nr="["+ro+"]",at="["+tr+"]",st="\\ud83c[\\udffb-\\udfff]",lr="(?:"+at+"|"+st+")",ao="[^"+ro+"]",so="(?:\\ud83c[\\udde6-\\uddff]){2}",io="[\\ud800-\\udbff][\\udc00-\\udfff]",rr="\\u200d",co=lr+"?",fo="["+or+"]?",ar="(?:"+rr+"(?:"+[ao,so,io].join("|")+")"+fo+co+")*",sr=fo+co+ar,ir="(?:"+[ao+at+"?",at,so,io,nr].join("|")+")",cr=RegExp(st+"(?="+st+")|"+ir+sr,"g");function dr(t){return t.match(cr)||[]}function fr(t){return lo(t)?dr(t):Jl(t)}function ur(t){return function(l){l=rt(l);var o=lo(l)?fr(l):void 0,n=o?o[0]:l.charAt(0),r=o?Hl(o,1).join(""):l.slice(1);return n[t]()+r}}var pr=ur("toUpperCase");function mr(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 hr(t){return function(l){return t==null?void 0:t[l]}}var gr={À:"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"},yr=hr(gr),wr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Cr="\\u0300-\\u036f",kr="\\ufe20-\\ufe2f",br="\\u20d0-\\u20ff",Nr=Cr+kr+br,xr="["+Nr+"]",Sr=RegExp(xr,"g");function Ir(t){return t=rt(t),t&&t.replace(wr,yr).replace(Sr,"")}var Br=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Vr(t){return t.match(Br)||[]}var Mr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Tr(t){return Mr.test(t)}var uo="\\ud800-\\udfff",Ar="\\u0300-\\u036f",Er="\\ufe20-\\ufe2f",_r="\\u20d0-\\u20ff",Lr=Ar+Er+_r,po="\\u2700-\\u27bf",mo="a-z\\xdf-\\xf6\\xf8-\\xff",zr="\\xac\\xb1\\xd7\\xf7",$r="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Dr="\\u2000-\\u206f",Rr=" \\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",Or="\\ufe0e\\ufe0f",go=zr+$r+Dr+Rr,yo="['’]",wo="["+go+"]",jr="["+Lr+"]",Co="\\d+",Pr="["+po+"]",ko="["+mo+"]",bo="[^"+uo+go+Co+po+mo+ho+"]",Fr="\\ud83c[\\udffb-\\udfff]",Hr="(?:"+jr+"|"+Fr+")",Gr="[^"+uo+"]",No="(?:\\ud83c[\\udde6-\\uddff]){2}",xo="[\\ud800-\\udbff][\\udc00-\\udfff]",be="["+ho+"]",Kr="\\u200d",So="(?:"+ko+"|"+bo+")",Wr="(?:"+be+"|"+bo+")",Io="(?:"+yo+"(?:d|ll|m|re|s|t|ve))?",Bo="(?:"+yo+"(?:D|LL|M|RE|S|T|VE))?",Vo=Hr+"?",Mo="["+Or+"]?",Zr="(?:"+Kr+"(?:"+[Gr,No,xo].join("|")+")"+Mo+Vo+")*",Yr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Qr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",qr=Mo+Vo+Zr,Xr="(?:"+[Pr,No,xo].join("|")+")"+qr,Jr=RegExp([be+"?"+ko+"+"+Io+"(?="+[wo,be,"$"].join("|")+")",Wr+"+"+Bo+"(?="+[wo,be+So,"$"].join("|")+")",be+"?"+So+"+"+Io,be+"+"+Bo,Qr,Yr,Co,Xr].join("|"),"g");function Ur(t){return t.match(Jr)||[]}function vr(t,l,o){return t=rt(t),l=l,l===void 0?Tr(t)?Ur(t):Vr(t):t.match(l)||[]}var ea="['’]",ta=RegExp(ea,"g");function oa(t){return function(l){return mr(vr(Ir(l).replace(ta,"")),t,"")}}var na=oa(function(t,l,o){return t+(o?" ":"")+pr(l)}),Oe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},je={exports:{}},la=je.exports,To;function ra(){return To||(To=1,function(t,l){(function(o,n){n()})(la,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,g){var h=new XMLHttpRequest;h.open("GET",i),h.responseType="blob",h.onload=function(){m(h.response,s,g)},h.onerror=function(){console.error("could not download file")},h.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 Oe=="object"&&Oe.global===Oe?Oe: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,g){var h=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,g):a(d,d.target="_blank")):(d.href=h.createObjectURL(i),setTimeout(function(){h.revokeObjectURL(d.href)},4e4),setTimeout(function(){a(d)},0))}:"msSaveOrOpenBlob"in navigator?function(i,s,g){if(s=s||i.name||"download",typeof i!="string")navigator.msSaveOrOpenBlob(o(i,g),s);else if(r(i))n(i,s,g);else{var h=document.createElement("a");h.href=i,h.target="_blank",setTimeout(function(){a(h)})}}:function(i,s,g,h){if(h=h||open("","_blank"),h&&(h.document.title=h.document.body.innerText="downloading..."),typeof i=="string")return n(i,s,g);var d=i.type==="application/octet-stream",w=/constructor/i.test(c.HTMLElement)||c.safari,B=/CriOS\/[\d]+/.test(navigator.userAgent);if((B||d&&w||f)&&typeof FileReader<"u"){var V=new FileReader;V.onloadend=function(){var y=V.result;y=B?y:y.replace(/^data:[^;]*;/,"data:attachment/file;"),h?h.location.href=y:location=y,h=null},V.readAsDataURL(i)}else{var O=c.URL||c.webkitURL,I=O.createObjectURL(i);h?h.location=I:location.href=I,h=null,setTimeout(function(){O.revokeObjectURL(I)},4e4)}});c.saveAs=m.saveAs=m,t.exports=m})}(je)),je.exports}var aa=ra();function Ao(t){return typeof t=="object"&&t!==null&&"source"in t}function Ee(t){return typeof t=="object"&&t!==null&&"name"in t}function Eo(){const t=le.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 sa(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 ue(t,l,o,n,r,a){var d;const c=Eo();let f;const m={responseType:"blob"};r!=null&&(m.timeout=r),(n==null?void 0:n.toLowerCase())=="post"?f=await c.post(t,a,m):(a&&(t=U(t,a)),f=await c.get(t,m));const{data:i,headers:s,status:g,statusText:h}=f;if(g==200||i.length){s&&(o||(o=(d=s["content-type"])==null?void 0:d.toString()),l||(l=sa(s["content-disposition"])));const w=new Blob([i],{type:o||"application/octet-stream"});aa.saveAs(w,l)}else throw`[${g}] ${h}`}async function _o(t,l,o,n,r){var h;const a=Eo(),c={responseType:"blob"};n!=null&&(c.timeout=n);let f;(o==null?void 0:o.toLowerCase())=="post"?f=await a.post(t,r,c):(r&&(t=U(t,r)),f=await a.get(t,c));const{data:m,headers:i,status:s,statusText:g}=f;if(s==200||m.length){i&&(l||(l=(h=i["content-type"])==null?void 0:h.toString()));const d=new Blob([m],{type:l||"application/octet-stream"}),w=URL.createObjectURL(d);window.open(w)}else throw`[${s}] ${g}`}function Lo(t,l){let o=t.length,n=0;for(;o--;)l(t[o],o)&&(t.splice(o,1),n++);return n}function ia(t,l){var o={};for(let n of t){const r=l(n);o[r]?o[r].push(n):o[r]=[]}return o}function zo(t,l,o){l<0||l>=t.length||o<0||o>=t.length||l==o||t.splice(o,0,...t.splice(l,1))}function $o(t,l){return l?t.filter((o,n,r)=>r.findIndex(a=>l(a)===l(o))===n):Array.from(new Set(t))}function ca(t,l,o,n,r,a){const c={name:t,label:l||v(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)}:Ao(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 da(...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 fa(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 ua(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 pa(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 _e="YYYY/MM/DD HH:mm:ss",ge="YYYY/MM/DD",Le="HH:mm:ss";function v(t){return t.length?na(t):t}function de(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 de(l)}}}function Pe(t,l){const o=de(t);return o===void 0?l||!1:o}function Do(t,l){if(t!=null){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t);if(typeof t=="string")return ae(t,l||_e).toDate()}}function Ro(t){return typeof t=="object"&&t!==null&&"hour"in t&&"minute"in t}function ma(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 Oo(t){const l=t%60;t/=60;const o=t%60;return t/=60,{hour:t%24,minute:o,second:l,millisecond:0}}function jo(t,l){const o=ae(t,l||Le);if(o)return{hour:o.hour(),minute:o.minute(),second:o.second(),millisecond:o.millisecond()}}function Po(t,l){var o,n;if(t){if(typeof t=="string")return(n=(o=ae(t,l||_e))==null?void 0:o.toDate())==null?void 0:n.getTime();if(typeof t=="number")return t;if(t instanceof Date)return t.getTime()}}function Fo(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return ae(new Date(t)).format(l||Le);if(t instanceof Date)return ae(t).format(l||Le);if(Ro(t))return ae(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 it(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return ae(new Date(t)).format(l||ge);if(t instanceof Date)return ae(t).format(l||ge);if(typeof t=="object")return t==null?void 0:t.toString()}}function ct(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return ae(new Date(t)).format(l||_e);if(t instanceof Date)return ae(t).format(l||_e);if(typeof t=="object")return t==null?void 0:t.toString()}}function Ho(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 Go(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 ha(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 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=Go(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=Go(m);else for(const i in m){const s=m[i];Array.isArray(s)?c[i]=s.map(g=>g==null?void 0:g.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 ha(n,r)}function Fe(t,l,o){if(t==null)return t;switch(l){case"number":return Number(t);case"boolean":case"bool":return de(t);case"date":case"datetime":return ct(t);default:return o&&typeof t=="string"&&(o.includes("code-u")?t=t.toUpperCase():o.includes("code-l")&&(t=t.toLowerCase())),t}}function Ko(t){switch(t){case"number":return 0;case"boolean":case"bool":return!1;case"date":case"datetime":return new Date}}function ga(){return new Date().getTime().toString()}function ya(t,l){const o={};if(t)if(l)for(const n of l)typeof n=="string"?o[v(n)]=t[n]:o[v(n.name)]=t[n.name];else for(const n in t)o[v(n)]=t[n];return o}function wa(t,l){return ae(t,ge).add(l,"days").format(ge)}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)}function ka(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 ba(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 Na(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 xa(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 Wo(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 Zo(t){return t==null?!0:/^\s*$/.test(t)}function Sa(t,l){return Zo(t)?l:t}function Yo(t,l){return t?l?t.trim().endsWith(";")?t+l:t+";"+l:t:l}function Qo(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),$o(o)}const Ne=Te.defineStore("common",{state:()=>({themeName:localStorage.getItem("theme"),menuCollapsed:Pe(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}}}}),Ia={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ba=e.defineComponent({name:"ArrowDropDownOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ia,o[0]||(o[0]=[e.createElementVNode("path",{d:"M7 10l5 5l5-5H7z",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:"CheckFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Va,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)]))}}),Ta={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",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 12z",fill:"currentColor"},null,-1)]))}}),Aa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ea=e.defineComponent({name:"CloseOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Aa,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)]))}}),_a={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},La=e.defineComponent({name:"ColorizeFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",_a,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)]))}}),za={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},$a=e.defineComponent({name:"DarkModeOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",za,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)]))}}),Da={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",Da,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)]))}}),Ra={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Oa=e.defineComponent({name:"ExpandLessFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ra,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)]))}}),ja={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Pa=e.defineComponent({name:"ExpandMoreFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ja,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16.59 8.59L12 13.17L7.41 8.59L6 10l6 6l6-6z",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"},Jo=e.defineComponent({name:"FolderTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Fa,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)]))}}),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:"FullscreenExitFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ha,o[0]||(o[0]=[e.createElementVNode("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z",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:"FullscreenFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ka,o[0]||(o[0]=[e.createElementVNode("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",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:"ImportExportFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Za,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)]))}}),Qa={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",Qa,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)]))}}),Ua={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},dt=e.defineComponent({name:"MenuFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ua,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z",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"},es=e.defineComponent({name:"MenuOpenFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",va,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)]))}}),ts={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},os=e.defineComponent({name:"PasswordFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ts,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)]))}}),ns={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ls=e.defineComponent({name:"PlaylistAddCheckTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ns,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)]))}}),rs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},as=e.defineComponent({name:"PlaylistAddFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",rs,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)]))}}),ss={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},is=e.defineComponent({name:"PrintTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ss,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)]))}}),cs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ds=e.defineComponent({name:"ReadMoreFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",cs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 7h9v2h-9zm0 8h9v2h-9zm3-4h6v2h-6zm-3 1L8 7v4H2v2h6v4z",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"},ft=e.defineComponent({name:"RefreshFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",fs,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)]))}}),us={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",us,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)]))}}),ps={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ms=e.defineComponent({name:"UnarchiveOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ps,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)]))}}),Uo={rootMenuName:"MainMenu",menuPosition:"side"},ut=Symbol("HalovConfig");function pt(){return e.inject(ut)}const hs=["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,hs)):e.createCommentVNode("",!0)}}),vo=oe(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}=Y(),a=lt(),c=Ne(),f=e.computed(()=>c.menuCollapsed),m=((B=pt())==null?void 0:B.menuPosition)??"side",i=()=>c.setMenuCollapsed(!c.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(V=>({label:r(V.title),key:V.id,url:V.url}))]);function h(V){o.tabs.find(I=>I.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(Ea)});if(V.key&&V.key==s.value)return e.h(u.NIcon,null,{default:()=>e.h(Ma)})}function w(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,O)=>V.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":O[0]||(O[0]=I=>s.value=I)},{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(es),{key:0})),f.value?(e.openBlock(),e.createBlock(e.unref(dt),{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:w,"render-icon":d},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ba))]),_:1})]),_:1},8,["options"])]),_:1})]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.tabs,I=>(e.openBlock(),e.createBlock(e.unref(u.NTab),{key:I.id,name:I.id,title:I.id,closable:I.closable,class:"app-tab-item",style:e.normalizeStyle({"border-top-color":I.color})},{default:e.withCtx(()=>[I.icon?(e.openBlock(),e.createBlock(xe,{key:0,path:I.icon,style:{"margin-right":"4px"}},null,8,["path"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(r)(I.title)),1)]),_:2},1032,["name","title","closable","style"]))),128))]),_:3},8,["value"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-df170cc3"]]),gs=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}}}),ys={ref:"areaRef",style:{overflow:"hidden"}};function ws(t,l,o,n,r,a){return e.openBlock(),e.createElementBlock("div",ys,[e.renderSlot(t.$slots,"default")],512)}const en=oe(gs,[["render",ws]]);function tn(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 on=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=tn(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 nn(t){for(const l of t)l.guid&&(l.guid=l.guid.toLowerCase()),l.items&&nn(l.items)}function Cs(){try{const t=localStorage.getItem("userInfo");return t?JSON.parse(t):null}catch{return null}}const Se=Te.defineStore("account",()=>{const t=e.reactive({userInfo:Cs(),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")},c=h=>{t.menus=h},f=h=>{t.isLoadingMenu=h},m=h=>{t.authType=h,h?localStorage.setItem("authType",h):localStorage.removeItem("authType")},i=()=>{localStorage.removeItem("userInfo"),localStorage.removeItem("sessionToken"),a(),c(null),localStorage.removeItem("_msgs")},s=async h=>{var d;f(!0);try{h||(h=((d=pt())==null?void 0:d.rootMenuName)??"MainMenu");const w=await le.get(`/api/core/account/menus?rootName=${encodeURIComponent(h)}`);if(w.isSuccess){const B=w.value||[];nn(B),c(B)}else console.log(w.errorMessage||"get remote menus error.")}catch(w){console.log(w)}finally{f(!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:c,setIsLoadingMenu:f,logout:i,loadMenus:s,addMessage:g,setAuthType:m}}),ks={key:0,style:{"padding-left":"1rem"}},mt=e.defineComponent({__name:"ChangePassword",props:{show:{type:Boolean}},emits:["close"],setup(t,{emit:l}){const o=l,{t:n}=Y(),r=u.useMessage(),a=e.inject("axios"),c=Se(),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}),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 d(){var V;s.value&&!m.value&&i.value&&((V=i.value)==null||V.validate(O=>{if(!O)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 w(s.value,f.value.oldPassword,f.value.newPassword)}))}async function w(V,O,I){try{const y={userName:V,oldPassword:O,newPassword:I},k=await a.post("/api/core/account/changePassword",y);k.isSuccess?(r.success(n("Password has been successfully modified!")),o("close")):r.error(n(k.errorMessage||"Error"))}catch(y){r.error((y==null?void 0:y.toString())||n("Error"))}}async function B(){try{const V=await a.get("/api/core/system/passwordOptions");V.isSuccess&&V.value!=null?g.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,O)=>{const I=e.resolveComponent("n-input"),y=e.resolveComponent("n-form-item"),k=e.resolveComponent("n-spin"),x=e.resolveComponent("n-text"),A=e.resolveComponent("n-button"),H=e.resolveComponent("n-modal");return e.openBlock(),e.createBlock(H,{show:V.show,onClose:O[3]||(O[3]=()=>V.$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",ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.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(A,{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:h},{default:e.withCtx(()=>[e.createVNode(k,{show:m.value},{default:e.withCtx(()=>[e.createVNode(y,{label:e.unref(n)("User Name")},{default:e.withCtx(()=>[e.createVNode(I,{value:s.value,readonly:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(y,{path:"oldPassword",label:e.unref(n)("Old Password")},{default:e.withCtx(()=>[e.createVNode(I,{value:f.value.oldPassword,"onUpdate:value":O[0]||(O[0]=L=>f.value.oldPassword=L),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(y,{path:"newPassword",label:e.unref(n)("New Password")},{default:e.withCtx(()=>[e.createVNode(I,{value:f.value.newPassword,"onUpdate:value":O[1]||(O[1]=L=>f.value.newPassword=L),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(y,{path:"confirmPassword",label:e.unref(n)("Confirm New Password")},{default:e.withCtx(()=>[e.createVNode(I,{value:f.value.confirmPassword,"onUpdate:value":O[2]||(O[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"])}}}),ht=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(La))]),_:1})]),_:1},8,["value","disabled"])]),_: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:"ArrowDown",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",bs,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)]))}}),xs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ss=e.defineComponent({name:"ArrowLeft",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",xs,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)]))}}),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:"ArrowRight",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Is,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)]))}}),Vs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ms=e.defineComponent({name:"ArrowUp",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Vs,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)]))}}),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:"Checkbox",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)]))}}),As={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},rn=e.defineComponent({name:"CheckboxChecked",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",As,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)]))}}),Es={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},_s=e.defineComponent({name:"Checkmark",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Es,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)]))}}),Ls={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",Ls,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)]))}}),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:"ChevronRight",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",zs,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)]))}}),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:"ChevronUp",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ds,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)]))}}),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:"CollapseAll",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Os,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)]))}}),js={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},sn=e.defineComponent({name:"Cube",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",js,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)]))}}),Ps={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Fs=e.defineComponent({name:"Document",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ps,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)]))}}),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:"DocumentDownload",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Hs,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)]))}}),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:"DocumentExport",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Gs,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)]))}}),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:"DocumentImport",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ks,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)]))}}),Ws={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},un=e.defineComponent({name:"Draggable",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ws,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)]))}}),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:"ExpandAll",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Zs,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)]))}}),Qs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},gt=e.defineComponent({name:"Folder",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Qs,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"},Us=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)]))}}),vs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ei=e.defineComponent({name:"Launch",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",vs,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)]))}}),ti={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},oi=e.defineComponent({name:"NewTab",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ti,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)]))}}),ni={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},li=e.defineComponent({name:"NotAvailable",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ni,o[0]||(o[0]=[e.createElementVNode("path",{d:"M4 15h10v2H4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 15h10v2H18z",fill:"currentColor"},null,-1)]))}}),ri={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ai=e.defineComponent({name:"PanHorizontal",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ri,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)]))}}),si={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ii=e.defineComponent({name:"QrCode",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",si,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)]))}}),ci={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},di=e.defineComponent({name:"Renew",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ci,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)]))}}),fi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},yt=e.defineComponent({name:"Search",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",fi,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)]))}}),ui={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},pn=e.defineComponent({name:"SearchLocate",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ui,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)]))}}),pi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},mi=e.defineComponent({name:"SelectWindow",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",pi,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)]))}}),hi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},gi=e.defineComponent({name:"TableBuilt",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",hi,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)]))}}),yi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},wi=e.defineComponent({name:"TagEdit",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",yi,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)]))}}),Ci={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ki=e.defineComponent({name:"Upload",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ci,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)]))}}),bi={class:"flex-column"},Ni={class:"flex-1"},xi={class:"flex-1"},mn=e.defineComponent({__name:"Collapsable",props:{title:{},defaultCollapsed:{type:Boolean}},setup(t){const l=t,{t:o}=Y(),n=e.ref(l.defaultCollapsed??!1),r=()=>{n.value=!n.value};return(a,c)=>(e.openBlock(),e.createElementBlock("div",bi,[e.createElementVNode("div",{class:"flex-row gap05",style:{"align-items":"center"},onDblclick:e.withModifiers(r,["prevent"])},[e.renderSlot(a.$slots,"icon"),e.createElementVNode("div",Ni,[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(Rs),{key:1}))]),_:1})]),_:1},8,["title"])])],32),e.withDirectives(e.createElementVNode("div",xi,[e.renderSlot(a.$slots,"default")],512),[[e.vShow,!n.value]])]))}});function Si(t){for(const l in t)delete t[l]}function hn(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]=de(r)||!1;break;default:const a=Ko(o.dataType);a!=null&&(l[n]=a)}}return l}function gn(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]=de(a)||!1:o[r]=de(a)||null;break;default:o[r]=a||null;break}}}function yn(t,l){const o={};return Object.assign(o,t),gn(t,l,o),o}function Ii(t){if(!t)return!0;switch(t){case"number":case"boolean":return!1;default:return!0}}function wn(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(v(r)),visibility:!0,editor:"text"});else if(Ee(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(v(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 wt(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 Ct(t){const l=new Array;for(const o of t)if(typeof o=="string")l.push({name:o,title:v(o),sortIndex:0,visible:!0});else if(Ee(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:wt(o.size),minWidth:wt(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=Ct(o.children)),l.push(n)}return l.sort((o,n)=>(o.sortIndex||0)-(n.sortIndex||0)),l}function Bi(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(Ee(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(v(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 He(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 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=Ce.render(l.labelTemplate,i);else{if(s=i[l.label||"label"],n&&(s=n(s)),l.subLabel){const g=i[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: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 kt(t,l){return()=>e.h(u.NIcon,l?{color:l}:null,{default:()=>e.h(t)})}function Vi(t,l,o){if(t)return e.h(u.NIcon,o?{color:o}:null,{default:()=>e.h(l)})}function Mi(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 Ti(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 Ge=e.defineComponent({__name:"HaloDatePicker",props:{value:{},type:{},readonly:{type:Boolean},clearable:{type:Boolean},defaultTime:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=f=>{const m=Po(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"?it(f):ct(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,"default-time":f.defaultTime},null,8,["value","type","disabled","clearable","default-time"]))}}),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=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=jo(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"]))}}),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}=Y(),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=de(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"]))}}),xt=()=>{const{t}=Y(),l=u.useMessage(),o=u.useDialog(),n=u.useModal(),r=u.useLoadingBar();let a=0;const c=y=>y&&t(y),f=y=>e.h("div",{},y.split(`
|
|
3
|
+
`).map(k=>e.h("span",{class:"line"},t(k)))),m=(y,k)=>{switch(k){case"create":l.create(()=>f(y));break;case"error":l.error(()=>f(y));break;case"loading":l.loading(t(y));break;case"success":l.success(t(y));break;case"warning":l.warning(t(y));break;default:case"info":l.info(t(y));break}},i=(y,k,x)=>{o.warning({title:t(y??"Confirm"),draggable:!0,content:()=>f(k),positiveText:t("OK"),negativeText:t("Cancel"),onPositiveClick:()=>x()})},s=(y,k,x)=>{o.success({title:t(k??"Success"),draggable:!0,content:()=>f(y),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},g=(y,k,x)=>{o.error({title:t(k??"Error"),draggable:!0,content:()=>f(y),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},h=(y,k,x)=>{o.info({title:t(k??"Information"),draggable:!0,content:()=>f(y),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},d=(y,k,x)=>{o.warning({title:t(k??"Warning"),draggable:!0,content:()=>f(y),positiveText:t("OK"),onPositiveClick:()=>x==null?void 0:x()})},w=y=>{let k=[];const x=n.create({title:t(y.title??"Search"),preset:"card",style:{width:y.width??"800px",height:y.height??"600px"},contentClass:"flex-column",draggable:y.draggable,content:()=>e.h(e.resolveComponent("SearchPanel"),{class:"flex-grow-1",config:y.config,multiSelect:y.multiSelect==!0,onSearchBack:A=>{y.callback.call(null,A)},onResultSelected:(A,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&&(y.callback.call(null,k),x.destroy())}},()=>t("OK")),e.h(u.NButton,{ghost:!0,style:"min-width: 100px",onClick:()=>x.destroy()},()=>t("Close"))])})},B=(y,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:y,size:160}),e.h("div",{class:"text-monospace",style:"font-size: large; margin: 0.25em"},y),e.h(u.NButton,{type:"primary",onClick:()=>x.destroy(),style:"align-self: center; min-width: 100px; margin-top: 1em;"},()=>t("Close"))])})},V=(y=!1)=>{a++,(y||a>0)&&r.start()},O=(y=!1)=>{a=Math.max(0,a-1),(y||a<=0)&&r.finish()};return{t:c,message:m,confirm:i,error:y=>l.error(t(y)),success:y=>l.success(t(y)),warning:y=>l.warning(t(y)),info:y=>l.info(t(y)),errorDialog:g,successDialog:s,warningDialog:d,infoDialog:h,showSearchModal:w,showQrModal:B,loadingBar:(y=!0)=>{y?V():O()},showLoadingBar:V,hideLoadingBar:O}};function Ai(){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(g=>{s.waitingQueue.push(()=>{s.isLocked=!0,g(()=>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 g=s.waitingQueue.shift();g&&g(),!s.isLocked&&s.waitingQueue.length===0&&t.value.delete(i)}async function a(i,s){const g=await o(i);try{return await Promise.resolve(s())}finally{g()}}async function c(i,s,g="Failed to acquire the operation lock."){const h=n(i);if(!h)throw console.error(`Failed to acquire the operation lock.(key: ${i})`),g;try{return await Promise.resolve(s())}finally{h()}}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 ie=()=>{const t=xt(),l=e.inject("axios"),o=Ai();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
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,()=>{c(h)})}async function a(s){var g,h,d,w,B,V,O;try{(g=s.loadingStatus)==null||g.call(null,!0);const I={};s.timeout!=null&&(I.timeout=s.timeout);const y=await l.post(s.url,s.data,I);(h=s.callback)==null||h.call(null,y),y.isSuccess?((d=s.success)==null||d.call(null,y.value),s.successMessage===!0?t.message("Successful operation.","success"):typeof s.successMessage=="string"&&t.message(s.successMessage,"success")):((w=s.fail)==null||w.call(null,y),y.errorMessage&&console.error(y.errorMessage),s.failMessage?t.message(s.failMessage,"error"):t.message(y.errorMessage??((B=y.value)==null?void 0:B.toString())??"Error","error"))}catch(I){((V=s.exception)==null?void 0:V.call(null,I))!=!0&&t.message(await n(I)??s.failMessage??"Error")}finally{(O=s.loadingStatus)==null||O.call(null,!1)}}async function c(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 f(s){var g,h,d,w,B;try{(g=s.loadingStatus)==null||g.call(null,!0);const V={};s.timeout!=null&&(V.timeout=s.timeout);const O=await l.get(s.url,V);if(O.isSuccess)return(h=s.callback)==null||h.call(null,O.value),O.value;s.quiet!=!0&&t.message(O.errorMessage??((d=O.value)==null?void 0:d.toString())??"Error","error")}catch(V){((w=s.exception)==null?void 0:w.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 g,h,d,w;try{(g=s.loadingStatus)==null||g.call(null,!0),t.showLoadingBar(),await
|
|
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,()=>{c(h)})}async function a(s){var g,h,d,w,B,V,O;try{(g=s.loadingStatus)==null||g.call(null,!0);const I={};s.timeout!=null&&(I.timeout=s.timeout);const y=await l.post(s.url,s.data,I);(h=s.callback)==null||h.call(null,y),y.isSuccess?((d=s.success)==null||d.call(null,y.value),s.successMessage===!0?t.message("Successful operation.","success"):typeof s.successMessage=="string"&&t.message(s.successMessage,"success")):((w=s.fail)==null||w.call(null,y),y.errorMessage&&console.error(y.errorMessage),s.failMessage?t.message(s.failMessage,"error"):t.message(y.errorMessage??((B=y.value)==null?void 0:B.toString())??"Error","error"))}catch(I){((V=s.exception)==null?void 0:V.call(null,I))!=!0&&t.message(await n(I)??s.failMessage??"Error")}finally{(O=s.loadingStatus)==null||O.call(null,!1)}}async function c(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 f(s){var g,h,d,w,B;try{(g=s.loadingStatus)==null||g.call(null,!0);const V={};s.timeout!=null&&(V.timeout=s.timeout);const O=await l.get(s.url,V);if(O.isSuccess)return(h=s.callback)==null||h.call(null,O.value),O.value;s.quiet!=!0&&t.message(O.errorMessage??((d=O.value)==null?void 0:d.toString())??"Error","error")}catch(V){((w=s.exception)==null?void 0:w.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 g,h,d,w;try{(g=s.loadingStatus)==null||g.call(null,!0),t.showLoadingBar(),await _o(s.url,s.contentType,s.method,s.timeout,s.args),(h=s.callback)==null||h.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(),(w=s.loadingStatus)==null||w.call(null,!1)}}async function i(s){var g,h,d,w;try{(g=s.loadingStatus)==null||g.call(null,!0),t.showLoadingBar(),await ue(s.url,s.filename,s.contentType,s.method,s.timeout,s.args),(h=s.callback)==null||h.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(),(w=s.loadingStatus)==null||w.call(null,!1)}}return{post:c,get:f,confirmToPost:r,getHttpErrorMessage:n,openFile:m,downloadFile:i}},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=ie(),c=e.ref(i(o.value)),f=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}`})??[]);f.value=g.map(h=>({value:h.code,label:`[${h.code}] ${h.name}`}))}else f.value=[]}function i(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=>c.value=i(g)),e.watch(()=>o.tagSource,()=>m()),e.onMounted(()=>m()),(g,h)=>g.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"]))}}),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}=Y(),a=()=>{o.readonly||n("update:value",f()),n("update:show",!1)},c=()=>{var i,s,g,h;return o.value?Array.isArray(o.value)?o.value.join(`
|
|
6
6
|
`):((h=(g=(s=(i=o.value)==null?void 0:i.replace(/\n/g,","))==null?void 0:s.split(","))==null?void 0:g.map(w=>w.trim()))==null?void 0:h.filter((w,B,V)=>w&&V.indexOf(w)==B)).join(`
|
|
7
|
-
`):o.value},f=()=>{var s,g,h;return m.value?((h=(g=(s=m.value)==null?void 0:s.split(/\r?\n/))==null?void 0:g.map(d=>d.trim()))==null?void 0:h.filter((d,w,B)=>d&&B.indexOf(d)==w)).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]=g=>m.value=g),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}=Y(),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]=g=>i.$emit("update:value",g))},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]=g=>a.value=g),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]=g=>m(g))},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}=Y(),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":w=>{r.value=w}})},g=d=>{if(d.target instanceof HTMLInputElement){const w=d.target.files;w!=null&&w.length?r.value=w[0]:r.value=null}},h=d=>{var B,V;const w=(B=o.formItem)==null?void 0:B.valueSource;w&&w.type=="remote"&&w.sourceUrl&&w.filterable&&Fe(c,w,{searchWords:d},O=>w.i18n?a(O):O,((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,w;(w=(d=o.formItem)==null?void 0:d.role)!=null&&w.length&&(m.value=o.formItem.role.includes("list"),f.value=o.formItem.role.map(B=>`halo-form-${B}`).join(" "))}),(d,w)=>{var B,V,O,I,y,k,x,_,H,z,A,j,T,b,E,R,L,G;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":w[0]||(w[0]=M=>r.value=M)},null,40,["value"]))],1024)):((B=d.formItem.editor)==null?void 0:B.startsWith("@"))==!0?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.formItem.editor.substring(1)),{key:1,value:r.value,"onUpdate:value":w[1]||(w[1]=M=>r.value=M),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":w[2]||(w[2]=M=>r.value=M),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(e.unref(u.NSwitch),{key:3,value:r.value,"onUpdate:value":w[3]||(w[3]=M=>r.value=M),style:e.normalizeStyle((V=d.formItem.editorConfig)==null?void 0:V.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(e.unref(u.NSelect),{key:4,value:r.value,"onUpdate:value":w[4]||(w[4]=M=>r.value=M),remote:d.formItem.valueSource.type=="remote",loading:d.formItem.valueSource.isLoading,options:d.formItem.valueSource.values,filterable:d.formItem.valueSource.filterable,multiple:((O=d.formItem.role)==null?void 0:O.includes("list"))==!0,placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((I=d.formItem.editorConfig)==null?void 0:I.style),onSearch:h},{action:e.withCtx(()=>[d.formItem.valueSource.filterable?(e.openBlock(),e.createElementBlock("div",Ei,[e.createVNode(e.unref(u.NText),{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(e.unref(u.NInputNumber),{key:5,value:r.value,"onUpdate:value":w[5]||(w[5]=M=>r.value=M),min:d.formItem.minValue,max:d.formItem.maxValue,clearable:d.formItem.nullable,readonly:d.readonly,placeholder:d.placeholder,style:e.normalizeStyle((y=d.formItem.editorConfig)==null?void 0:y.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":w[6]||(w[6]=M=>r.value=M),placeholder:"",disabled:d.readonly,style:e.normalizeStyle((k=d.formItem.editorConfig)==null?void 0:k.style)},null,8,["value","disabled","style"])):d.formItem.editor=="boolean"?(e.openBlock(),e.createBlock(e.unref(u.NCheckbox),{key:7,checked:r.value,"onUpdate:checked":w[7]||(w[7]=M=>r.value=M),disabled:d.readonly,style:e.normalizeStyle((x=d.formItem.editorConfig)==null?void 0:x.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":w[8]||(w[8]=M=>r.value=M),type:"datetime",placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((_=d.formItem.editorConfig)==null?void 0:_.style),"default-time":"00:00:00"},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="date"?(e.openBlock(),e.createBlock(He,{key:9,value:r.value,"onUpdate:value":w[9]||(w[9]=M=>r.value=M),type:"date",placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((H=d.formItem.editorConfig)==null?void 0:H.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="time"?(e.openBlock(),e.createBlock(kt,{key:10,value:r.value,"onUpdate:value":w[10]||(w[10]=M=>r.value=M),placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((z=d.formItem.editorConfig)==null?void 0:z.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="color"?(e.openBlock(),e.createBlock(mt,{key:11,value:r.value,"onUpdate:value":w[11]||(w[11]=M=>r.value=M),placeholder:"",disabled:d.readonly,readonly:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((A=d.formItem.editorConfig)==null?void 0:A.style)},null,8,["value","disabled","readonly","clearable","style"])):d.formItem.editor=="tags"?(e.openBlock(),e.createBlock(xt,{key:12,value:r.value,"onUpdate:value":w[12]||(w[12]=M=>r.value=M),tagSource:d.formItem.tagSource,placeholder:"",disabled:d.readonly,style:e.normalizeStyle((j=d.formItem.editorConfig)==null?void 0:j.style)},null,8,["value","tagSource","disabled","style"])):d.formItem.editor=="image"?(e.openBlock(),e.createElementBlock("input",{key:13,type:"file",onChange:g,readonly:d.readonly,disabled:d.readonly,style:e.normalizeStyle((T=d.formItem.editorConfig)==null?void 0:T.style)},null,44,_i)):d.formItem.editor=="file"?(e.openBlock(),e.createElementBlock("input",{key:14,type:"file",onChange:g,readonly:d.readonly,disabled:d.readonly,style:e.normalizeStyle((b=d.formItem.editorConfig)==null?void 0:b.style)},null,44,Li)):d.formItem.editor=="password"?(e.openBlock(),e.createBlock(e.unref(u.NInput),{key:15,value:r.value,"onUpdate:value":w[13]||(w[13]=M=>r.value=M),class:e.normalizeClass(f.value),placeholder:d.placeholder??"",type:"password",readonly:d.readonly,style:e.normalizeStyle((E=d.formItem.editorConfig)==null?void 0:E.style)},null,8,["value","class","placeholder","readonly","style"])):d.formItem.editor=="textarea"?(e.openBlock(),e.createBlock(e.unref(u.NInput),{key:16,value:r.value,"onUpdate:value":w[14]||(w[14]=M=>r.value=M),class:e.normalizeClass(f.value),type:"textarea",placeholder:d.placeholder??"",readonly:d.readonly,style:e.normalizeStyle((R=d.formItem.editorConfig)==null?void 0:R.style)},null,8,["value","class","placeholder","readonly","style"])):(e.openBlock(),e.createBlock(e.unref(u.NInput),{key:17,value:r.value,"onUpdate:value":w[16]||(w[16]=M=>r.value=M),class:e.normalizeClass(f.value),placeholder:d.placeholder??"",readonly:d.readonly,clearable:d.formItem.nullable,type:d.formItem.editor,style:e.normalizeStyle((L=d.formItem.editorConfig)==null?void 0:L.style)},{suffix:e.withCtx(()=>[m.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,text:"",title:e.unref(a)("If there are multiple items, separate them with commas."),onClick:w[15]||(w[15]=()=>i.value=!0)},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),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":w[17]||(w[17]=M=>i.value=M),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":w[18]||(w[18]=M=>r.value=M),style:e.normalizeStyle((G=d.formItem.editorConfig)==null?void 0:G.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}=Y(),n=e.inject("axios"),r=e.ref(null),a=e.ref([]),c=e.ref(t.columns||1),f=e.ref({}),m=e.ref(g(t.formItems)),i=d(t.formItems),s=e.ref(void 0);function g(y){return y?[...new Set(y.map(x=>x.group))].map(x=>({label:x||"General",items:y.filter(_=>_.group==x)})):[]}function h(y){return y.dataType=="boolean"&&!y.nullable?" ":y.label}function d(y){const k={};if(y&&y.length)for(const x of y){const _=[];x.nullable==!1&&x.dataType!="boolean"&&_.push({required:!0,message:o("Must be filled here.")}),_.length&&(k[x.name]=_)}return k}async function w(y,k){var x;if(k.type=="remote"&&k.sourceUrl)Fe(n,k,null,_=>k.i18n?o(_):_,y.nullable);else if(k.type=="function"&&k.func){k.isLoading=!0;try{const _=(x=k.func)==null?void 0:x.call(void 0);_&&(k.values=_)}finally{k.isLoading=!1}}}function B(){var y;(y=t.formItems)==null||y.forEach(k=>{k.valueSource&&(k.valueSource.type=="remote"||k.valueSource.type=="function")&&w(k,k.valueSource)})}function V(y,k){l.emit("itemChange",{item:y,data:t.data,value:k})}function O(y){return!!(y.readonly==!0||t.readOnly==!0||t.method&&Array.isArray(y.readonly)&&y.readonly.includes(t.method))}function I(y){return!!(y.visibility==!0||t.method&&Array.isArray(y.visibility)&&y.visibility.includes(t.method))}return e.onMounted(()=>{B(),t.data&&(f.value=t.data)}),e.watch(()=>t.data,y=>f.value=y||{}),{t:o,formRef:r,formItemsRef:a,getItemLabel:h,originalModel:s,model:f,rules:i,formColumns:c,updateValue:V,formGroups:m,isReadonly:O,isVisible:I}}}),$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"),g=e.resolveComponent("n-tabs"),h=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(g,{key:0,type:"line"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formGroups,w=>(e.openBlock(),e.createBlock(s,{key:w,name:w.label,tab:t.t(w.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(w.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,w=>(e.openBlock(),e.createBlock(h,{key:w},{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(w.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,w=>e.withDirectives((e.openBlock(),e.createBlock(m,{ref_for:!0,ref:"formItemsRef",key:w.name,label:t.getItemLabel(w),path:w.name,feedback:w.errorMessage,"validation-status":w.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",Ri,[e.createVNode(c,{"form-item":w,value:t.model[w.name],"onUpdate:value":[B=>t.model[w.name]=B,B=>t.updateValue(w,B)],readonly:t.isReadonly(w),label:w.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),w.description?(e.openBlock(),e.createBlock(f,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(w.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(w)]])),128))]),_:1},8,["cols"]))]),_:3},8,["model","rules"])}const Bt=te(zi,[["render",Oi],["__scopeId","data-v-e7319d81"]]),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}=Y(),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 g of m)if(typeof g=="string")(!i||f[g])&&c.push({name:g,label:o(v(g)),value:f[g],span:1});else{const h={name:g.name??g.label,label:o(g.label||v(g.name)),value:f[g.name],span:g.span||1,dataType:g.dataType,role:g.role};h.value!=null&&(h.dataType=="boolean"?h.value=de(h.value)?o("Yes"):o("No"):g.i18n&&(h.value=o((s=h.value)==null?void 0:s.toString()))),(!i||h.value)&&c.push(h)}else if(Array.isArray(f))for(const g of f)(!i||g.value)&&c.push({name:g.label,label:o(v(g.label)),value:g.value,span:1});else for(const g in f)(!i||f[g])&&c.push({name:g,label:o(v(g)),value:f[g],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=te(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}=Y(),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-6dec6e5e"]]),qi={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}=Y(),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(g=>s.includes(g.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(g=>i.includes(g.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",qi,[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),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]=g=>a.value=g)},null,8,["options","value"])]),_:1},8,["label"])):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"options")])]),_:3},8,["show","title"]))}}),Xi={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}=Y();return(o,n)=>(e.openBlock(),e.createElementBlock("div",Xi,[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})]))}}),Ji=e.defineComponent({components:{FullscreenIcon:Ka,ExitFullscreenIcon:Ha},emits:["change"],setup(t,l){const{t:o}=Y(),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 g=(s=i.target)==null?void 0:s.closest(".fullscreen-view");a(g)}}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=te(Ji,[["render",Ui]]),Tt=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 c(g){a||await m(g)}function f(){for(let g in o)o[g]=!1}async function m(g){f();const h=n.filter(d=>(d==null?void 0:d.length)==32);if(h.length)try{let d=await l.get(`/api/core/Account/CheckPermissions?permissions=${encodeURIComponent(h.join())}`);d.isSuccess&&d.value!=null?(a++,d.value.forEach(w=>{o[w]=!0;const B=r.find(V=>V.id==w);B&&(o[B.name]=!0)}),g==null||g.call(null,o)):console.error(d.errorMessage)}catch(d){console.error(d)}}function i(){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: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}=Y(),a=ie(),c=e.inject("axios"),f=u.useMessage(),m=Tt(["2E2466DDD34847C8B33460E4277A6528"]),i=e.ref(o.pageSize),s=e.ref(!1),g=e.ref(!1),h=k=>k?k.map((x,_)=>({columnId:x.name,title:x.title?r(x.title):r(v(x.name)),visible:!0,sortIndex:_})).sort((x,_)=>x.sortIndex-_.sortIndex):[],d=k=>(x,_)=>{let H=null;if(k=="visible"){const z=je(x[k]);H=e.h(u.NIcon,{size:"20"},{default:()=>z?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:z=>{w(x,_,k),z.stopPropagation()}},{default:()=>H})};function w(k,x,_){switch(_){case"visible":k.visible=!k.visible;break;case"move_up":if(x>0&&I.value){const H=I.value.splice(x,1);I.value.splice(x-1,0,H[0])}break;case"move_down":if(I.value&&x<I.value.length-1){const H=I.value.splice(x,1);I.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:I.value.filter(x=>x.columnId).map((x,_)=>({columnId:x.columnId,visible:x.visible,sortIndex:_}))};k.pageSize&&(k.pageSize=Math.max(1,Math.min(Nn,k.pageSize)));try{const x=s.value&&g.value,_=await c.post(`/api/core/UserDataGrids/Save?isDefault=${x}`,k);(_==null?void 0:_.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((_==null?void 0:_.errorMessage)||r("Error"))}catch(x){f.error((x==null?void 0:x.toString())||r("Error"))}}async function O(){if(o.gridId&&I.value.length)try{const k=s.value&&g.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 _ of x.value.columns){const H=I.value.find(z=>z.columnId==_.columnId);H&&(H.visible=_.visible,H.sortIndex=_.sortIndex),I.value.sort((z,A)=>z.sortIndex-A.sortIndex)}}else I.value=h(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=>{g.value=x["2E2466DDD34847C8B33460E4277A6528"]}),O())}),e.watch(()=>o.gridColumns,()=>I.value=h(o.gridColumns)),e.watch(s,()=>O());const I=e.ref(h(o.gridColumns)),y=[{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.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(_,{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(()=>[g.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:y,data:I.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}=Y(),a=e.inject("axios"),c=e.ref(!1),f=e.ref([]);async function m(s){let g=o.sourceUrl;if(g){const h=o.labelFormatter,d=o.keyField,w=o.labelField,B=o.subLabelField,V=o.additionalQuery;c.value=!0,f.value=[];try{V&&(g=U(g,V,!0));const O=await a.get(g);if(O.isSuccess&&O.value!=null){let I=O.value;if(!Array.isArray(I)&&"rows"in I&&Array.isArray(I.rows)&&(I=I.rows),Array.isArray(I)){const y=I.filter(k=>k&&!0).map(k=>{if(typeof k=="string")return{value:k,label:h?h(k):r(k)};{let x=k[w||"label"];if(h&&(x=h(x)),B){const _=k[B];typeof _=="string"&&(x+=" "+(h?h(_):_))}return{value:k[d||"value"],label:x}}});f.value=y}}}finally{c.value=!1}}}function i(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"),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,w=>(e.openBlock(),e.createBlock(h,{key:w.value,value:w.value,label:w.label},null,8,["value","label"]))),128))]),_:1},8,["value","size"])}}}),Ge=te(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}=Y(),c=e.inject("axios"),f=I=>I==null?void 0:I.map(y=>typeof y=="string"?{label:a(y),value:y}:y),m=()=>{const I=new Array;if(n.searchItems)for(const y of n.searchItems)if(typeof y=="string")I.push({name:y,label:v(y),editor:"text",nullable:!0,visibility:!0,searchMethod:"normal"});else{let k=y;y.searchField&&(k=Object.assign({},y),k.name=y.searchField),I.push(k)}return I},i=()=>{const I={};if(B.forEach(y=>{I[y.name]=null,y.searchMethod=="range"&&(I[y.name+"From"]=null,I[y.name+"To"]=null)}),n.searchArgs)for(const y in I)n.searchArgs[y]!=null&&(I[y]=n.searchArgs[y]);return I},s=()=>{for(const I in V)V[I]=null},g=async I=>{var k,x;const y=I.valueSource;if(y){if(y.type=="remote"&&y.sourceUrl)await Fe(c,y,null,_=>y.i18n?a(_):_,!1),I.nullable==!1&&((k=y.values)!=null&&k.length)&&(V[I.name]=y.values[0].value);else if(y.type=="function"&&y.func){y.isLoading=!0;try{const _=(x=y.func)==null?void 0:x.call(void 0);_&&(y.values=_)}finally{y.isLoading=!1}}}},h=()=>{var y;const I={};for(const k of B){const x=k.searchField??k.name;if(k.searchMethod=="range"){const _=d(x+"From",k);_!=null&&(I[x+"From"]=_);let H=d(x+"To",k);H!=null&&(k.editor=="date"&&typeof H=="string"&&(H=ae(H,ye).add(1,"days").format(ye)),I[x+"To"]=H)}else{const _=d(x,k);_!=null&&(((y=k.role)==null?void 0:y.includes("list"))==!0&&typeof _=="string"?_.includes(",")?I[x]=_.split(","):I[x]=[_]:I[x]=_)}}return I},d=(I,y)=>{var x,_;let k=V[I];if(!(typeof k=="string"&&(k=k.trim(),k==""&&!y.valueSource))){if(Array.isArray((x=y.valueSource)==null?void 0:x.values)){const H=(_=y.valueSource)==null?void 0:_.values;if(H){if(H.some(z=>z.value==V[I]))k=V[I];else if(k=="")return;if(y.dataType=="boolean"){if(typeof k=="boolean")return k;const z=H.findIndex(A=>A.value==k);return z>-1&&(H.length==2?k=z==0:H.length==3&&z>0&&(k=z==1)),typeof k=="boolean"?k:Pe(k,y.dataType,y.role)}}}return Pe(k,y.dataType,y.role)}},w=()=>{r("update:searchArgs",h())},B=m(),V=e.reactive(i()),O=e.ref(f(n.groupOptions));return e.watch(()=>n.groupOptions,()=>O.value=f(n.groupOptions)),e.onMounted(()=>{i(),B.forEach(I=>{I.valueSource&&(I.valueSource.type=="remote"||I.valueSource.type=="function"?g(I):I.valueSource.type=="static")})}),l({reset:s,updateValues:w,pickValues:h}),(I,y)=>(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:y[0]||(y[0]=()=>w())},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:y[1]||(y[1]=()=>w())},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:y[2]||(y[2]=()=>w())},null,8,["form-item","value","onUpdate:value"]))]),_:2},1032,["label","path"])]),_:2},1024))),128))]),_:1}),O.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:I.groupBy,options:O.value,"onUpdate:value":y[3]||(y[3]=k=>I.$emit("update:groupBy",k))},null,8,["value","options"])]),_:1},8,["label"])]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["model"]))}}),[["__scopeId","data-v-3f7ad8bc"]]),tc={class:"flex-row gap05"},Et=e.defineComponent({__name:"TagsView",props:{tags:{},tagSource:{},size:{default:"small"}},setup(t){const l=t,o=xe(),n=ie(),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(g=>g.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}=Y(),c=ce.useRouter(),f=Nt(),m=e.ref(void 0),i=e.ref([]),s=e.ref(void 0),g=()=>{const b={};return typeof n.height=="number"?b.height=`${n.height}px`:typeof n.height=="string"&&(b.height=n.height),b},h=e.ref(g()),d=()=>{var R;const b=i.value,E=(R=n.data)==null?void 0:R.filter(L=>b.includes(L[n.keyField]));r("update:selectedIds",b,E),b.length&&r("update:selectedId",b[0])},w=b=>b[n.keyField],B=(b,E)=>{let R=0,L=0;const G=new Set;for(const M of E){let K,J,ee;if(typeof M=="string")ee=M,K={key:M,title:a(v(M))};else if(ee=M.name||`column_${R}`,!(M.behavior=="none"||M.visible==!1))if(M.behavior=="link"||M.behavior=="router-link")K={key:ee,title:M.title?a(M.title):void 0,align:M.align,fixed:M.fixed||void 0,width:M.width,sorter:M.sortable==!0,cssStyle:M.cssStyle,render:M.render||O(M)};else if(M.behavior=="button")K={key:ee,title:M.title?a(M.title):void 0,align:M.align||"center",fixed:M.fixed||void 0,width:M.width,sorter:M.sortable==!0,cssStyle:M.cssStyle,render:M.render||O(M)};else{let le=M.align,oe=[];if(!M.display)switch(M.dataType){case"number":le=le||"right",J=60,oe.push("text-num");break;case"boolean":le=le||"center",J=60;break;case"date":J=100;break;case"datetime":J=180;break;case"timespan":le=le||"center",J=80;break;case"time":J=80,oe.push(`text-${M.dataType}`);break}if(K={key:ee,title:M.title==null?a(v(M.name)):M?a(M.title):void 0,titleAlign:"center",align:le,width:M.width||J,sorter:M.sortable==!0,cssStyle:M.cssStyle,minWidth:M.minWidth,resizable:!0,fixed:M.fixed,render:M.render||O(M)},typeof M.className=="string"?oe.push(M.className):Array.isArray(M.className)&&oe.push(...M.className),oe.length&&(K.className=oe.join(" ")),!K.width&&K.minWidth&&(K.width=K.minWidth),M.referencePage&&typeof K.width=="number"&&(K.width+=30),M.role&&M.role.includes("qr")&&typeof K.width=="number"&&(K.width+=30),M.role&&M.role.includes("percent")&&typeof K.width=="number"&&(K.width+=30,K.align||(K.align="right")),(M.textOverflow=="ellipsis"||M.textOverflow=="clip")&&(K.ellipsis={tooltip:!0},K.resizable=!0,J||(J=400)),M.children&&M.children.length){const W=[];B(W,M.children),K.children=W,W.some(se=>se.width)&&(K.width=void 0)}}K&&!G.has(ee)&&(G.add(ee),b.push(K),typeof M=="object"&&typeof M.width=="number"?L+=M.width:L+=J||150)}return L},V=()=>{if(console.log("buildGridColumns"),n.columns){const b=[];let E=0;return n.checkable&&(b.push({type:"selection",fixed:"left"}),E+=30),E+=B(b,n.columns),n.withEdit&&(b.push({key:"btn-edit",width:30,fixed:"right",render(R,L){return e.h(u.NButton,{text:!0,titie:a("Edit"),onClick:G=>{r("editRow",R,L),G.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#5C6BC0",size:"20"},{default:()=>e.h(qo)})})}}),E+=30),n.withDelete&&(b.push({key:"btn-delete",width:30,fixed:"right",render(R,L){return e.h(u.NButton,{text:!0,titie:a("Delete"),onClick:G=>{r("deleteRow",R,L),G.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#f44336",size:"20"},{default:()=>e.h(Qo)})})}}),E+=30),n.withDetails&&(b.push({key:"btn-details",width:30,fixed:"right",render(R,L){return e.h(u.NButton,{text:!0,titie:a("Details"),onClick:G=>{r("showDetails",R,L),G.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#4CAF50",size:"20"},{default:()=>e.h(cs)})})}}),E+=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)})}}),E+=30),m.value=E,b}else return[]},O=b=>(E,R)=>{var ee,le,oe;let L=null;const G=b.display||b.name;if(b.template&&typeof b.template=="function")L=b.template.call(null,E,R);else if(b.dataType=="bool"||b.dataType=="boolean"){const W=je(E[G]);if(b.values&&b.values.length>1)return b.i18n?a(W?b.values[0]:b.values[1]):W?b.values[0]:b.values[1];W!=null?L=e.h(u.NIcon,{size:"20",class:W?"cell-checked":"cell-unchecked"},{default:()=>W?e.h(Es):e.h(ni)}):L=e.h("span")}else if(b.dataType=="date")L=st($o(E[G]));else if(b.dataType=="time")L=Po(Ro(E[G]));else if(b.dataType=="timespan")L=Fo(E[G]);else{let W=E[G];b.formatter?W=b.formatter(W,E):b.template&&(W=ke.render(b.template,E)),typeof W=="string"&&(b.prefix&&(W=b.prefix+W),b.suffix&&(W=W+b.suffix),b.i18n&&(W=a(W))),L=W}let M=b.role;if(M&&!Array.isArray(M)&&(M=[M]),M!=null&&M.length)if(M.includes("tag")){let W;Array.isArray(E[G])?W=E[G]:W=(oe=(le=(ee=E[G])==null?void 0:ee.toString())==null?void 0:le.split(","))==null?void 0:oe.filter(se=>se.length),W&&W.length&&(L=e.h(Et,{tags:W,tagSource:b.tagSource},{}))}else L&&(L=e.h("span",{class:M.map(W=>{switch(W){case"status":return`status-tag status-${E[G]}`;default:return`halo-form-${W}`}}).join(" "),style:b.cssStyle},[L]));const K=typeof b.href=="function"?b.href(E):b.href;if(b.behavior=="link")K?L=e.h("a",{href:ke.render(K,E),target:"_blank"},[L]):L=e.h("a",{href:"#",onClick:W=>{var se;r("columnButtonClick",b.name,E,R),(se=b==null?void 0:b.click)==null||se.call(null,E,R),W.stopPropagation()}},[L]);else if(b.behavior=="router-link"&&K){const W=L;L=e.h(ce.RouterLink,{to:ke.render(K,E)},{default:()=>W})}else if(b.behavior=="button"){const W=L;L=e.h(u.NButton,{size:"tiny",tag:"a",onClick:se=>{var fe;r("columnButtonClick",b.name,E,R),(fe=b==null?void 0:b.click)==null||fe.call(null,E,R),se.stopPropagation()}},{default:()=>W})}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:()=>y(b,R)},{default:()=>e.h(u.NIcon,{},{default:()=>e.h(si)})})),b.role.includes("percent"))){const W=Ko(E[G]);J.push(e.h(u.NProgress,{showIndicator:!1,type:"circle",status:W&&W>100?"error":"success",percentage:W||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:()=>I(b,R)},{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;"},[L]),e.h("div",{},...J)]):L},I=(b,E)=>{if(Array.isArray(n.data)&&E!=null&&E>=0&&E<n.data.length&&b.referencePage){const R=n.data[E],L=ke.render(b.referencePage,R);L.startsWith("/")&&c.push({path:L})}},y=(b,E)=>{if(Array.isArray(n.data)&&E!=null&&E>=0&&E<n.data.length){const R=n.data[E][b.name];if(typeof R=="string"){const L=a(b.title??v(b.name));f.showQrModal(R,L)}}},k=(b,E)=>({onClick:R=>{if(R.target instanceof HTMLElement&&R.target.classList.contains("n-checkbox-box__border")==!1){const L=w(b);L!==void 0&&!i.value.includes(L)&&(i.value=[L],d())}},ondblclick:R=>{R.target instanceof HTMLTableCellElement&&r("editRow",b,E)}}),x=(b,E)=>{E!=!1||!n.multiSelect?(i.value=[b],d()):i.value.includes(b)||(i.value.push(b),d())},_=(b,E)=>{if(E!=!1||!n.multiSelect)i.value=b,d();else{const R=i.value.slice();for(const L of b)R.includes(L)||R.push(L);i.value.length<R.length&&(i.value=R,d())}},H=b=>{n.multiSelect?i.value=b:i.value=b.slice(0,1),d()},z=()=>i.value,A=(b,E)=>{Array.isArray(n.data)&&b>-1&&Lo(n.data,b,E)},j=()=>{var R;const b=(R=s.value)==null?void 0:R.$el,E=b==null?void 0:b.querySelector("tbody.n-data-table-tbody");if(E&&Array.isArray(n.data)){const L=e.ref(n.data);Zt.useDraggable(E,L,{animation:150,ghostClass:"draging-ghost",handle:".drag-sorting-handle",onUpdate(G){var J;const M=G.oldIndex,K=G.newIndex;if(M!=null&&K!=null&&n.data&&M<((J=n.data)==null?void 0:J.length)){const ee=n.data[M];r("rowSorting",{oldIndex:M,newIndex:K,source:ee,updateGrid:()=>A(M,K)})}}})}},T=e.ref(V());return e.watch(()=>n.data,b=>{const R=b.map(L=>L[n.keyField]);i.value=i.value.filter(L=>R.includes(L)),d()}),e.watch(()=>n.columns,()=>T.value=V()),e.watch(()=>n.height,()=>h.value=g()),e.onMounted(()=>{n.dragSorting&&setTimeout(()=>{j()},500)}),l({selectRow:x,selectRows:_,getSelectedRowKeys:z}),(b,E)=>(e.openBlock(),e.createBlock(e.unref(u.NDataTable),{ref_key:"nTableRef",ref:s,class:"flex-1",columns:T.value,data:b.data,size:"small","row-key":w,"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(h.value),"checked-row-keys":i.value,"onUpdate:checkedRowKeys":[E[0]||(E[0]=R=>i.value=R),H],"scrollbar-props":{trigger:"none"},"onUpdate:sorter":E[1]||(E[1]=R=>b.$emit("update:sorter",R))},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}=Y(),c=u.useMessage(),f=e.inject("axios"),m=e.ref(null),i=e.ref(1),s=e.ref(0),g=e.ref(!1),h=e.ref(Array()),d=e.ref(Array());let w=!0;function B(x){if(x){const _=x.rows;_.forEach((H,z)=>{H.__key__=z}),h.value=_,s.value=x.pageCount||1,i.value=x.pageIndex+1}}function V(){h.value=[],s.value=0,i.value=1}function O(x){I(x)}async function I(x){var z,A,j;const _=((z=m.value)==null?void 0:z.pickValues())||{},H=(A=n.config)==null?void 0:A.searchAction;if(_&&H){const T={pageSize:((j=n.config)==null?void 0:j.pageSize)||10,pageIndex:(x||i.value)-1};Object.assign(T,_),n.additionQuery&&(typeof n.additionQuery=="function"?Object.assign(T,n.additionQuery.call(null)):Object.assign(T,n.additionQuery));try{g.value=!0;const b=await f.post(H,T);b.isSuccess&&b.value!=null?(w=!1,B(b.value)):c.error(a(b.errorMessage||"Error"))}catch(b){c.error(b==null?void 0:b.toString())}finally{g.value=!1}}}function y(){const x=d.value;if(x!=null&&x.length){const _=h.value.filter(H=>x.includes(H.__key__));r("searchBack",_,n.config),n.autoClose==!0&&close()}}function k(){n.searchOnMounted&&w&&I(1)}return e.watch(()=>n.config,x=>{x&&(w=!0),V()}),e.onMounted(()=>k()),l({searchPage:I,returnAndClose:y}),(x,_)=>(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:_[0]||(_[0]=()=>I(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 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:g.value,data:h.value,multiSelect:x.multiSelect,selectedIds:d.value,"onUpdate:selectedIds":[_[2]||(_[2]=H=>d.value=H),_[3]||(_[3]=(H,z)=>x.$emit("resultSelected",H,z))],onDblclickRow:_[4]||(_[4]=H=>x.$emit("searchBack",[H]))},null,8,["columns","loading","data","multiSelect","selectedIds"]),e.createVNode(e.unref(u.NPagination),{page:i.value,"onUpdate:page":[_[5]||(_[5]=H=>i.value=H),O],"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}=Y(),a=e.ref(void 0);let c=!0;const f=e.ref([]);function m(h,d){f.value=d??[]}function i(h){h&&h.length&&n("searchBack",h,o.config)}function s(){f.value&&f.value.length&&(n("searchBack",f.value,o.config),o.autoClose==!0&&g())}function g(){n("update:show",!1)}return e.watch(()=>o.config,h=>{h&&(c=!0)}),e.watch(a,()=>{var h;o.searchOnMounted&&c&&(c=!1,(h=a.value)==null||h.searchPage(1))}),e.watch(()=>o.show,h=>{var d;h&&o.searchOnMounted&&c&&(c=!1,(d=a.value)==null||d.searchPage(1))}),(h,d)=>(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:d[0]||(d[0]=()=>g())},{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)(h.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:g},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})])]),default:e.withCtx(()=>[h.config?(e.openBlock(),e.createElementBlock("div",lc,[e.createVNode(We,{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: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=te(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}=Y(),a=u.useMessage(),c=u.useLoadingBar(),f=e.inject("axios"),m=ie(),i=e.reactive({}),s=e.ref(!1),g=e.ref(new Array),h=e.ref(!1),d=e.ref(void 0),w=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(h.value)return a.warning("Is uploading..."),!1;let y=typeof o.action=="function"?o.action.call(void 0):o.action;if(y&&o.templateCode&&(y=U(y,{templateCode:o.templateCode})),(k=g.value)!=null&&k.length&&y){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(_=>O(_,y));await Promise.all(x),g.value.every(_=>_.status=="finished")&&(g.value.length=0,a.success(r("Upload Success.")),s.value=!1)}catch(x){d.value=(x==null?void 0:x.toString())||r("Error")}finally{h.value=!1}}}async function O(y,k){const x=new FormData;x.append("file",y.file);const _={timeout:o.timeout||1e3*60*10,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:z=>{y.percentage=Math.round(z.loaded*100/z.total)}};y.percentage=0,y.status="uploading";let H=k;o.additionParams&&(H=U(k,o.additionParams)),i&&(H=U(H,i));try{const z=await f.post(H,x,_);z.isSuccess?(y.status="finished",n("uploaded",z.value),n("update:show",!1)):(y.status="error",y.errorMessage=z.errorMessage,d.value=r(z.errorMessage||"Error"))}catch(z){y.status="error",y.errorMessage=z==null?void 0:z.toString(),d.value=(z==null?void 0:z.toString())||r("Error")}}async function I(){const y=w.value;if(y)try{c.start(),await pe(y)}catch(k){a.error(await m.getHttpErrorMessage(k,"Error"))}finally{c.finish()}}return e.watch(()=>o.show,()=>{d.value=void 0,g.value=[]}),(y,k)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:y.show,"onUpdate:show":k[3]||(k[3]=x=>y.$emit("update:show",x)),preset:"card",title:e.unref(r)(y.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:y.disabled||!y.action||h.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(()=>[w.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,style:{"min-width":"100px"},onClick:I},{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]=()=>y.$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:y.multiple,"default-upload":!1,"file-list":g.value,"onUpdate:fileList":k[0]||(k[0]=x=>g.value=x),accept:y.accept,disabled:!y.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(y.$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-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}=Y(),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]=g=>a.value=g),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}=Y(),a=ie(),c=Tt(["2E2466DDD34847C8B33460E4277A6528"]),f=ce.useRouter(),m=e.ref(o.pageSize),i=e.ref(!1),s=e.ref(void 0),g=e.ref(void 0),h=e.ref(!1),d=z=>z?z.map((A,j)=>({columnId:A.name,title:A.title?r(A.title):r(v(A.name)),visible:!0,sortIndex:j})).sort((A,j)=>A.sortIndex-j.sortIndex):[],w=e.ref(d(o.gridColumns)),B=()=>{const z=o.gridId;z&&a.confirmToPost("Reset","Are you sure reset the configuration of this data grid?",{url:`/api/core/UserDataGrids/Reset?dataGridId=${z}`,successMessage:"The configuration has been reset, please refresh the page.",success:()=>{n("reset")}})},V=()=>{if(!o.gridId)return;const z={dataGridId:o.gridId,pageSize:m.value,columns:w.value.filter(A=>A.columnId).map(A=>({columnId:A.columnId,visible:A.visible,customTitle:A.customTitle,sortIndex:A.sortIndex}))};z.pageSize&&(z.pageSize=Math.max(1,Math.min(Sn,z.pageSize))),a.post({url:"/api/core/UserDataGrids/Save",data:z,successMessage:"The configuration has been saved, please refresh the page.",success:()=>{n("update:pageSize",m.value),n("update:config",z)}})},O=()=>{var j;const z=(j=s.value)==null?void 0:j.$el,A=z==null?void 0:z.querySelector("tbody.n-data-table-tbody");A&&w&&Zt.useDraggable(A,w,{animation:150,ghostClass:"draging-ghost",handle:".drag-sorting-handle",onUpdate:()=>{const T=w.value;for(let b=0;b<T.length;b++)T[b].sortIndex=b;console.log(w.value)}})},I=z=>{h.value=!1,g.value&&(g.value.customTitle=z)},y=z=>e.h("div",{class:"flex-row gap05"},[z.customTitle?e.h("span",null,`${z.customTitle} (${z.title})`):e.h("span",null,`${z.title}`),e.h(u.NButton,{text:!0,title:r("Edit"),class:"edit-title-btn",onClick:()=>{g.value=z,h.value=!0}},{default:()=>e.h(u.NIcon,{size:16},{default:()=>e.h(yi)})})]),k=z=>e.h(u.NButton,{text:!0,onClick:A=>{z.visible=!z.visible,A.stopPropagation()}},{default:()=>e.h(u.NIcon,{size:20},{default:()=>z.visible?e.h(ln):e.h(nn)})}),x=()=>{var A;const z={dataGridId:o.gridId,pageSize:o.pageSize,columns:(A=o.gridColumns)==null?void 0:A.map(j=>({columnId:j.name,sortIndex:j.sortIndex,visible:j.visible,title:j.title}))};z.dataGridId&&a.post({url:"/api/core/DataGrids/getOrCreate",data:z,success:j=>{j&&(f.push({name:"DataGrid",params:{dataGridId:j}}),n("close"))}})},_=()=>{var A;const z={dataGridId:o.gridId,pageSize:o.pageSize,columns:(A=o.gridColumns)==null?void 0:A.map(j=>({columnId:j.name,sortIndex:j.sortIndex,visible:j.visible,title:j.title}))};z.dataGridId&&a.confirmToPost("Initialize Data Grid Config","Are you sure to initialize config of this data grid?",{url:"/api/core/DataGrids/init",data:z,success:j=>{j&&(f.push({name:"DataGrid",params:{dataGridId:j}}),n("close"))}})},H=[{title:r("Name"),key:"title",render:y},{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,()=>w.value=d(o.gridColumns)),e.watch(w,()=>O()),e.onMounted(()=>{setTimeout(()=>{O()},500),c.checkOnce(z=>{i.value=z["2E2466DDD34847C8B33460E4277A6528"]})}),(z,A)=>{var j;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:_},{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:w.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":A[0]||(A[0]=T=>m.value=T),max:Sn,min:1,style:{"max-width":"200px"}},null,8,["value"])]),e.createVNode(zt,{show:h.value,"onUpdate:show":A[1]||(A[1]=T=>h.value=T),value:((j=g.value)==null?void 0:j.customTitle)??"",title:e.unref(r)("Custom Title"),clearable:"","onUpdate:value":I},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:A[2]||(A[2]=()=>z.$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}=Y(),n=ie(),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 g;(g=t.onReset)==null||g.call(null),s.destroy()},"onUpdate:pageSize":g=>{var h;g>0&&((h=t.onPageSizeChanged)==null||h.call(null,g))},"onUpdate:config":g=>{var h;(h=t.onConfigChanged)==null||h.call(null,g),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:{},loadingTimeout:{}},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}=Y(),c=e.inject("axios"),f=e.ref(Array()),m=u.useDialog(),i=u.useMessage(),s=u.useLoadingBar(),g=ce.useRouter();let h=[];const d=e.ref([]),w=e.ref([]),B=e.ref([]);let V=1;const O=e.ref(1),I=e.ref(0),y=e.ref(0),k=e.ref(n.pageSize),x=e.ref(!0),_=e.ref(!1),H=e.ref(!1),z=e.ref(""),A=e.computed(()=>{var p;return!!n.searchAction&&!!((p=B.value)!=null&&p.length)}),j=e.computed(()=>A.value&&!n.getListAction),T=e.computed(()=>!!j.value),b=e.ref(!1),E=e.ref(null),R=e.ref(null),L=e.ref(new Array),G=e.ref(!1),M=e.ref(void 0),K=e.ref(void 0),J=e.ref(void 0),ee=e.ref(!1),le=e.ref(n.readOnly),oe=e.ref(a("Property")),W=e.ref(!1),se=e.ref(!1),fe=e.ref([]),Rt=e.ref(jt("page")),Xn=e.ref(dd()),Ot=e.ref(void 0),he=e.ref([]),Ve=e.ref(void 0),Ye=e.ref(!1);let we;const Jn=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 qe(p){p.__key__=Qe(p);for(const C of h){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($=>qe($)),f.value=N,r("update:data",f.value),y.value=p.totalRecords||0,I.value=p.pageCount||1,O.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=>qe(N)),f.value=p,r("update:data",f.value),I.value=1,O.value=1,x.value=!1}}async function ue(p){var C,N;if(!(_.value||n.disabled)&&n.getListAction){const $={pageSize:k.value,pageIndex:p},F=(C=z.value)==null?void 0:C.trim();if(n.quickSearch&&F&&($.searchWords=F),n.additionKeys&&Object.assign($,n.additionKeys),n.parentKey&&!re($))return;(ge.value||n.defaultSortBy)&&($.sortBy=ge.value??n.defaultSortBy,$.sortDirection=Ce.value??n.defaultSortDirection);try{_.value=!0;let D=n.getListAction;typeof D=="function"&&(D=D.call(void 0));const Z={};n.loadingTimeout!=null&&(Z.timeout=n.loadingTimeout);const P=U(D,$),Q=await c.get(P,Z);Q!=null&&Q.isSuccess&&Q.value?($e++,Q.value&&(Array.isArray(Q.value)?vn(Q.value):Un(Q.value))):i.error(a((Q==null?void 0:Q.errorMessage)??((N=Q==null?void 0:Q.value)==null?void 0:N.toString())??"Error"))}catch(D){i.error((D==null?void 0:D.toString())??a("Error")),console.error(D)}finally{_.value=!1}}}function De(p){if(!n.disabled)if(T.value&&we){const C=Object.assign({},we);C.sortBy=ge.value,C.sortDirection=Ce.value,Ht(C)}else p!=null?ue(p):ue(O.value-1)}function Pt(){ue(0)}function ud(){z.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 re(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 $=n.parentKey[N];(typeof $=="string"||typeof $=="number")&&n.parentValue.length>N&&(C[$]=n.parentValue[N])}else for(let N=0;N<n.parentKey.length;N++){const $=n.parentKey[N];(typeof $=="string"||typeof $=="number")&&(C[$]=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=E.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(!_.value)try{_.value=!0;let C=n.searchAction;if(typeof C=="function"&&(C=C.call(void 0,p)),!C)return;const N={};if(!re(N))return;C=U(C,N);const $={};n.loadingTimeout!=null&&($.timeout=n.loadingTimeout);const F=await c.post(C,p,$);F.isSuccess&&F.value!=null?($e++,we=p,r("searchReturn",{data:F.value,query:p,action:C}),Array.isArray(F.value)?vn(F.value):Un(F.value)):i.error(a(F.errorMessage||"Error"))}catch(C){i.error(C==null?void 0:C.toString())}finally{_.value=!1}}function tl(p,C){const N={};if(re(N)){if(typeof n.keys=="string"?N[n.keys]=p[n.keys]:n.keys.forEach(F=>N[F]=p[F]),Array.isArray(n.detailsKeys))n.detailsKeys.map(F=>F.toString()).forEach(F=>N[F]=p[F]);else if(typeof n.detailsKeys=="object"){const F=n.detailsKeys;for(const D in F){var $=F[D];$&&(N[D]=p[$])}}else typeof n.detailsKeys=="function"?n.detailsKeys.call(null,N):n.detailsKeys&&(N.id=p[n.detailsKeys]);if(n.detailsPageName)g.push({name:n.detailsPageName,params:N});else if(n.detailsPage)if(typeof n.detailsPage=="function"){const F=n.detailsPage(p,C);(typeof F=="string"||typeof F=="object")&&g.push(F)}else g.push({path:n.detailsPage,query:N})}}async function Gt(p,C){var N;if(!n.disabled)if(n.getEntityAction){const $={};if(n.additionKeys&&Object.assign($,n.additionKeys),!re($))return;typeof n.keys=="string"?$[n.keys]=p[n.keys]:n.keys.forEach(F=>$[F]=p[F]);try{let F=n.getEntityAction;typeof F=="function"&&(F=F.call(void 0,p,C));const D={};n.loadingTimeout!=null&&(D.timeout=n.loadingTimeout);const Z=U(F,$),P=await c.get(Z,D);P.isSuccess&&P.value!=null?Xe(P.value,n.readOnly||!n.saveAction||!n.allowEdit?"view":"edit"):i.error(a((P==null?void 0:P.errorMessage)??((N=P==null?void 0:P.value)==null?void 0:N.toString())??"Error"))}catch(F){i.error((F==null?void 0:F.toString())??a("Error")),console.error(F)}}else Xe(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 $={};if(n.additionKeys&&Object.assign($,n.additionKeys),!re($))return;typeof n.keys=="string"?$[n.keys]=p[n.keys]:n.keys.forEach(Q=>$[Q]=p[Q]);const F=p.__key__;let D=n.deleteAction;typeof D=="function"&&(D=D.call(void 0,p,C));const Z=U(D,$);let P;if(n.deleteMethod=="POST"?P=await c.post(Z):P=await c.delete(Z),P.isSuccess){let Q=f.value.indexOf(p);if(Q>-1&&(f.value.splice(Q,1),i.success(a("The data has been deleted."))),L.value&&(Q=L.value.findIndex(q=>q==F),Q>-1)){L.value.splice(Q,1);const q=(N=f.value)==null?void 0:N.filter(Rd=>L.value.includes(Rd["__key__]"]));r("update:selectedIds",L.value,q),L.value.length?r("update:selectedId",L.value[0],q!=null&&q.length?q[0]:void 0):r("update:selectedId",void 0,void 0)}}else i.error(a(P.errorMessage||"Error"))}catch($){console.error($),i.error($==null?void 0:$.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),!re(C))return;let N=n.deleteBatchAction;typeof N=="function"&&(N=N.call(void 0));const $=U(N,C);let F;if(n.deleteMethod=="POST"?F=await c.post($):F=await c.delete($),F.isSuccess){for(const D of p){const Z=f.value.findIndex(P=>P.__key__==D);Z>-1&&f.value.splice(Z,1)}L.value=L.value.filter(D=>!p.includes(D)),i.success(a("The data has been deleted."))}else i.error(a(F.errorMessage||"Error"))}catch(C){i.error(C),console.error(C==null?void 0:C.toString())}}function ol(){if(L.value.length){const p=f.value.find(C=>C.__key__==L.value[0]);p&&Gt(p,f.value.indexOf(p))}}function nl(){if(L.value.length>1&&n.deleteBatchAction)hd(L.value);else if(L.value.length){const p=f.value.find(C=>C.__key__==L.value[0]);p&&Kt(p,f.value.indexOf(p))}}function Xe(p,C){const N={method:C,original:p,value:gn(p,d.value)};switch(r("beforeShow",N),J.value=p,M.value=N.value,K.value=C,ee.value=!0,le.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,M.value=void 0,K.value=void 0,ee.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 $={};if(n.additionKeys&&Object.assign($,n.additionKeys),!re($))return;N=U(N,$);try{const F={};n.loadingTimeout!=null&&(F.timeout=n.loadingTimeout);const D=await c.get(N,F);D!=null&&D.isSuccess&&D.value?Xe(D.value||{},"create"):i.error(a((D==null?void 0:D.errorMessage)??((p=D==null?void 0:D.value)==null?void 0:p.toString())??"Error"))}catch(F){i.error(a((F==null?void 0:F.toString())??"Error")),console.error(F)}}else{const C=mn(d.value);Xe(C,"create")}}async function yd(p,C){var F;if(n.readOnly||n.disabled)return;const N=Ve.value;if(!N||N.searchConfig!=C||!N.actionUrl)return;let $;if(N.dataBuilder)$=N.dataBuilder(p);else{let D;if(N.keyPicker?D=N.keyPicker(p):D=p.map(Z=>Z.id),!D||!D.length)return;$={},$[N.keyName||"ids"]=D}if($){let D=N.actionUrl;n.additionKeys&&Object.assign($,n.additionKeys);const Z={};re(Z)&&(D=U(D,Z),Object.assign($,Z));try{const P=await c.post(D,$);if(P.isSuccess){if(P.value){for(const q of P.value)Je(q);const Q=P.value.map(q=>Qe(q));(F=R.value)==null||F.selectRows(Q),Ye.value=!1}}else i.error(a(P.errorMessage||"Error"))}catch(P){i.error(a((P==null?void 0:P.toString())||"Error")),console.error(P)}}}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=K.value;if(C!="create"&&C!="edit")return;const N=M.value,$=J.value;if(N&&$){const F=Object.assign({},$);for(let D of p){if(D.readonly==!0||Array.isArray(D.readonly)&&D.readonly.includes(C))continue;let Z=Pe(N[D.name],D.dataType,D.role);F[D.name]=Z}if(r("commitEdit",{data:F,current:N,original:$,method:C}),n.beforeSave&&n.beforeSave(F,C)===!1)return;wd(F)?al({data:F,original:$,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 $={};if(n.additionKeys)for(const Q in n.additionKeys)n.additionKeys[Q]!=null&&(p.data[Q]=n.additionKeys[Q]);const F={};if(!re(F))return;if(Object.assign(p.data,F),n.enctype=="multipart/form-data"){N=new FormData;const Q=Object.keys(p.data);for(const q of Q)p.data[q]&&N.set(q,p.data[q]);$["Content-Type"]="multipart/form-data"}else N=p.data,$["Content-Type"]="application/json;charset=utf-8";let D=n.saveAction;typeof D=="function"&&(D=D.call(void 0));let Z=U(D,F);H.value=!0;const P=await c.post(Z,N,{headers:$});if(P.isSuccess){if(i.success(a("The data is saved.")),P.value){p.method=="create"?Je(P.value):p.method=="edit"&&sl(P.value),(C=R.value)==null||C.selectRow(Qe(P.value)),p.method=="create"&&n.chainCreating?Wt():ll();try{r("saved",{value:P.value,method:p.method})}catch(Q){console.error("emit(saved) fail."+(Q==null?void 0:Q.toString()))}}}else i.error(a(P.errorMessage||"Error")),P.errors&&kd(d.value,P.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 $=p.find(F=>F.name.toLowerCase()==N.key.toLowerCase());$&&($.validationStatus="error",$.errorMessage=N.value)}}function Je(p){qe(p);const C=p.__key__,N=f.value.findIndex($=>$.__key__==C);N>-1?f.value.splice(N,1,p):f.value.push(p)}function sl(p){qe(p);const C=p.__key__,N=f.value.find($=>$.__key__==C);if(N)for(const $ in p)N[$]=p[$]}function bd(p){if(T.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){L.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)&&(W.value=!1):n.dataExchangeCode&&(cl(p,C),W.value=!1)}function il(p,C,N){const $={outputType:p,dataRange:C,searchArgs:JSON.stringify(we)};if(n.importTemplateCode&&($.templateCode=n.importTemplateCode),!we&&(n.additionKeys||n.parentKey)){const F={pageSize:k.value,pageIndex:O.value,sortBy:ge.value,sortDirection:Ce.value};n.additionKeys&&Object.assign(F,n.additionKeys),re(F),$.searchArgs=JSON.stringify(F)}switch(N&&Object.assign($,N),C){case"selection":if(!L.value||!L.value.length)throw a("Please select the rows to be exported.");$.selectedKeys=L.value;break;case"page":$.pageSize=k.value,$.pageIndex=Math.max(0,O.value-1);break}return $}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 $=il(p,C,n.exportOptions);re($),s.start(),N=U(N,$),await pe(N)}catch($){console.log($),i.error(($==null?void 0:$.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 Q;const $=n.dataExchangeCode;if(!$)return;if(C.toLowerCase()=="empty"){const q=`/api/core/dataExchange/importTemplate?templateCode=${$}&engineName=${p}`;try{s.start(),await pe(q)}finally{s.finish()}return}const F={name:$,engineName:p,dataRange:C};n.importTemplateCode&&(F.templateCode=n.importTemplateCode);const D={pageSize:k.value,pageIndex:O.value-1};switch(C.toLowerCase()){case"empty":D.pageSize=0,D.pageIndex=0;break;case"all":D.pageSize=2e3,D.pageIndex=0;break}if(!re(D)){console.error("Invalid parent key.");return}let Z=n.exportAction||n.getListAction;typeof Z=="function"&&(Z=Z.call(void 0));let P=Z;if(N)try{const q=await c.post("/api/core/tempData/add",{value:JSON.stringify(F)});if(q.isSuccess){if(D.exportOptionId=q.value,P){P=U(P,D);try{s.start(),await pe(P)}finally{s.finish()}}}else i.error((q==null?void 0:q.errorMessage)??((Q=q==null?void 0:q.value)==null?void 0:Q.toString())??a("Error"))}catch(q){i.error((q==null?void 0:q.toString())??a("Error")),console.error(q)}else if(D.exportOption=btoa(JSON.stringify(F)),P){P=U(P,D);try{s.start(),await pe(P)}finally{s.finish()}}}function dl(p){if(p)switch(p){case"menu_export_action":L.value&&L.value.length?Rt.value=jt("selection"):Rt.value=jt("page"),W.value=!0;break;case"menu_export_template_action":Vd();break;case"menu_import_action":Bd();break;case"menu_export":W.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 $;const C=L.value,N={selectedId:C!=null&&C.length?C[0]:void 0,selectedIds:C?[...C]:void 0,data:f.value};typeof p!="string"&&(($=p.click)==null||$.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 $={label:N.label,key:N.key};N.icon?$.icon=Ct(N.icon):N.renderIcon&&($.icon=N.renderIcon),C.push($)})),fe.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,se.value=!1}const Td=()=>{ve(),k.value=n.pageSize},Ad=()=>{n.name&&Ue.showConfigModal({gridId:n.name,gridColumns:w.value,pageSize:k.value})};function Ed(p,C){var N;for(const $ of p)Je($);if(C){const $=p.map(F=>Qe(F));(N=R.value)==null||N.selectRows($)}}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&&re(p),n.additionKeys&&Object.assign(p,n.additionKeys),p}function gl(){const p=Object.assign({},hl(),n.importOptions);Jn.value=Object.keys(p).length?p:void 0}function zd(){j?b.value=!b.value:b.value=!1}const $d=p=>p.map(C=>typeof C=="string"?{name:C,title:v(C)}:Object.assign({},C)),Dd=(p,C)=>{var F;C.forEach(D=>{D.sortIndex=-1});const N=["left","center","right"];for(const D of p){const Z=C.find(P=>P.name==D.columnId);if(Z){Z.visible=D.visible,Z.sortIndex=D.sortIndex;const P=(F=D.alignment)==null?void 0:F.toLowerCase();P&&N.includes(P)&&(Z.align=P),D.title&&(Z.title=D.title),D.suffix&&(Z.suffix=D.suffix),D.prefix&&(Z.prefix=D.prefix),D.renderTemplate&&(Z.template=D.renderTemplate),Z.cssStyle=Zo(Z.cssStyle,D.cssStyle),Z.className=Yo(Z.className,D.cssClass)}}let $=Math.max(...C.filter(D=>D.sortIndex!=null&&D.sortIndex>=0).map(D=>D.sortIndex))||0;for(const D of C.filter(Z=>Z.sortIndex==null||Z.sortIndex<0))D.sortIndex=$++;C.sort((D,Z)=>(D.sortIndex||0)-(Z.sortIndex||0))},ve=p=>{h=$d(p??n.columns??[]);const C=Ue.getConfig();C!=null&&C.columns&&Dd(C.columns,h),d.value=yn(h,a),w.value=wt(h),B.value=wn(h,a)},yl=()=>{n.autoLoad!=!1&&(j.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,$=O.value,F=y.value;if($>0&&F){const D=Math.ceil(F/p);D<$&&(N=Math.max(0,D-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:L,editRow:Gt,deleteRow:Kt,showDetails:tl,insertRow:Je,updateRow:sl,appendRows:Ed,buildExportArgs:il}),(p,C)=>{var N,$,F,D,Z;return e.openBlock(),e.createElementBlock("div",hc,[e.renderSlot(p.$slots,"header"),j.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,P=>(e.openBlock(),e.createBlock(e.unref(u.NButton),{onClick:()=>rl(P),disabled:p.readOnly||p.disabled,key:P.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)(P.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||!L.value.length},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#5c6bc0"},{default:e.withCtx(()=>[e.createVNode(e.unref(qo))]),_: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||!L.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"),fe.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:4,options:fe.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:z.value,"onUpdate:value":C[1]||(C[1]=P=>z.value=P),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,!T.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,!T.value]]),A.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]=()=>T.value=!T.value)},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[T.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(ja),{key:0})),T.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"),A.value?e.withDirectives((e.openBlock(),e.createBlock(e.unref(u.NCard),{key:1,size:"small",hoverable:"",closable:!j.value,onClose:C[8]||(C[8]=()=>T.value=!1)},{header:e.withCtx(()=>[e.createElementVNode("div",{class:"flex-row",style:e.normalizeStyle([{"align-items":"center"},{cursor:j.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 P;return(P=E.value)==null?void 0:P.reset()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Reset")),1)]),_:1}),fe.value.length==1&&j.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,style:{"min-width":"100px"},onClick:C[7]||(C[7]=()=>W.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Export")),1)]),_:1})):e.createCommentVNode("",!0),fe.value.length>1&&j.value?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:1,options:fe.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"),j.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:E,"search-args":Xn.value,"onUpdate:searchArgs":C[4]||(C[4]=P=>Xn.value=P),"group-options":p.searchGroupOptions,"group-by":Ot.value,"onUpdate:groupBy":C[5]||(C[5]=P=>Ot.value=P)},null,8,["search-items","search-args","group-options","group-by"]),[[e.vShow,!b.value]])]),_:3},8,["closable"])),[[e.vShow,T.value]]):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"grid",{data:f.value,columns:w.value,loading:_.value,style:"background-color: chartreuse"},()=>[e.createVNode(Ke,{ref_key:"dataGridRef",ref:R,data:f.value,columns:w.value,loading:_.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]=(P,Q,q)=>p.$emit("columnButtonClick",P,Q,q)),"onUpdate:sorter":C[10]||(C[10]=P=>_d(P)),onRowSorting:C[11]||(C[11]=P=>p.$emit("rowSorting",P))},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:O.value,"onUpdate:page":[C[12]||(C[12]=P=>O.value=P),bd],"item-count":y.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:P,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(P+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: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:M.value,list:f.value,selectedKeys:L.value}),e.createVNode(e.unref(u.NModal),{class:"custom-card",show:ee.value,"onUpdate:show":C[15]||(C[15]=P=>ee.value=P),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(()=>[K.value=="create"||K.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:M.value,original:J.value,method:K.value})]),e.createElementVNode("div",Cc,[e.renderSlot(p.$slots,"entity-form",{formItems:d.value,data:M.value,original:J.value,method:K.value},()=>[e.createVNode(Bt,{"form-items":d.value,columns:p.modalColumns,data:M.value,original:J.value,method:K.value,"group-layout":p.formGroupLayout,"read-only":le.value,onItemChange:C[14]||(C[14]=P=>p.$emit("itemChange",P))},null,8,["form-items","columns","data","original","method","group-layout","read-only"])])]),e.createElementVNode("div",null,[e.renderSlot(p.$slots,"entity-form-right",{data:M.value,original:J.value,method:K.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]=P=>Ye.value=P),draggable:"",config:($=Ve.value)==null?void 0:$.searchConfig,title:(F=Ve.value)==null?void 0:F.searchTitle,"multi-select":((D=Ve.value)==null?void 0:D.singleOne)!=!0,"addition-query":(Z=Ve.value)==null?void 0:Z.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]=P=>G.value=P),draggable:"",action:p.importAction,"addition-params":Jn.value,timeout:p.importTimeout,"template-code":p.importTemplateCode},{options:e.withCtx(({options:P})=>[e.renderSlot(p.$slots,"import-options",{options:P})]),_:3},8,["show","action","addition-params","timeout","template-code"])):e.createCommentVNode("",!0),p.dataExchangeCode||p.exportAction?(e.openBlock(),e.createBlock(Mt,{key:4,show:W.value,draggable:"","supported-formats":p.exportFormats,"supported-ranges":p.exportRanges,onClose:C[18]||(C[18]=()=>W.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":w.value,pageSize:k.value,"onUpdate:pageSize":C[19]||(C[19]=P=>k.value=P),show:se.value,onClose:C[20]||(C[20]=()=>se.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}=Y();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}=Y(),a=e.inject("axios"),c=e.ref(!1),f=e.ref([]);let m;const i=h=>{(!m||m!=h)&&(m=h,s(h))},s=async h=>{let d=o.sourceUrl;if(d){const w=o.labelFormatter,B=o.keyField,V=o.labelField,O=o.subLabelField,I=o.insertBlank,y=o.additionalQuery;c.value=!0,f.value=[];try{h&&(d=U(d,{searchWords:h})),y&&(d=U(d,y,!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 _=x.filter(H=>H&&!0).map(H=>{if(typeof H=="string")return{value:H,label:w?w(H):r(H)};{let z=H[V||"label"];if(w&&(z=w(z)),o.prefix&&(z=o.prefix+z),o.suffix&&(z=z+o.suffix),o.i18n&&(z=r(z)),O){let A=H[O];typeof A=="string"&&(w&&(A=w(A)),o.i18n&&(A=r(A)),A&&(z+=" "+A))}return{value:H[B||"value"],label:z,data:H}}});I&&_.splice(0,0,{value:"",label:""}),f.value=_,o.autoSelect&&!o.value&&_.length&&n("update:value",_[0].value,_[0],_[0].data)}}}finally{c.value=!1}}},g=(h,d)=>{var B;const w=(B=f.value.find(V=>V.value==h))==null?void 0:B.data;n("update:value",h,d,w)};return e.watch(()=>o.sourceUrl,()=>s()),e.watch(()=>o.additionalQuery,(h,d)=>{JSON.stringify(d)!=JSON.stringify(h)&&s()}),e.onMounted(()=>s()),(h,d)=>(e.openBlock(),e.createBlock(e.unref(u.NSelect),{value:h.value,remote:"",loading:c.value,options:f.value,filterable:h.filterable,multiple:h.multiple,placeholder:"",disabled:h.readonly,clearable:h.clearable,onSearch:i,"onUpdate:value":g},{action:e.withCtx(()=>[h.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}=Y(),n=e.ref(void 0),r=e.ref(c(t.sourceList)),a=e.ref([]);function c(h){return h?h.map(d=>({isSelected:!1,value:d})):[]}function f(){n.value&&l.emit("search",n.value)}function m(){_o(a.value,h=>h.isSelected)>0&&l.emit("update:selectedItems",a.value.map(h=>h.value))}function i(){a.value.forEach(d=>d.isSelected=!1);let h=!1;r.value.forEach(d=>{d.isSelected&&!a.value.some(w=>w.value==d.value)&&(a.value.push({value:d.value,isSelected:!1}),h=!0)}),h&&l.emit("update:selectedItems",a.value.map(d=>d.value))}function s(h){h.forEach(d=>d.isSelected=!0)}function g(h){h.forEach(d=>d.isSelected=!d.isSelected)}return e.watch(()=>t.sourceList,h=>r.value=c(h)),{t:o,searchWords:n,searchMaterials:f,source:r,target:a,moveRight:i,moveLeft:m,selectAll:s,inverseSelect:g}}}),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"),g=e.resolveComponent("n-spin"),h=e.resolveComponent("n-button"),d=e.resolveComponent("right-icon"),w=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(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,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(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(f,null,{default:e.withCtx(()=>[e.createVNode(d)]),_:1})]),_:1},8,["onClick"]),e.createVNode(h,{onClick:t.moveLeft},{default:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(w)]),_: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(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 Mn=te(Nc,[["render",Tc]]),Tn=te(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 g=r.value.getBoundingClientRect();let h;l.direction==="horizontal"?h=(s.clientX-g.left)/g.width:h=(s.clientY-g.top)/g.height;const d=l.minSize/(l.direction==="horizontal"?g.width:g.height),w=1-d;o.value=Math.max(d,Math.min(w,h))},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,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: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-ca4664e2"]]),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}=Y(),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 j;const o=t,n=l,{t:r}=Y(),a=ie(),c=e.ref(new Array),f=e.ref(void 0),m=(T,b)=>{for(const E of T){if(E.key==b)return[E];if(E.key!=null&&E.key!=null&&E.children&&!E.isLeaf){const R=m(E.children,b);if(R.length)return R.push(E),R}}return[]},i=(T,b)=>{for(let E=0;E<T.length;E++){const R=T[E];if(R.key==b)return{nodes:T,index:E};if(R.children){const L=i(R.children,b);if(L)return L}}return null},s=T=>{const b=m(z.value,T);return b?b.reverse():[]},g=T=>T,h=(T,b=!0)=>{let E=[];if(Array.isArray(T)){const R=(o==null?void 0:o.treeNodeMapper)??g;E=T.map(R)}return b?[{key:o.rootId,label:r(o.rootName),isLeaf:!Array.isArray(E)||E.length==0,children:E}]:E},d=()=>{let T=o.loadTreeAction;T&&(o.additionKeys&&(T=U(T,o.additionKeys)),a.get({url:T,callback:b=>{if(b){const E=h(b);z.value=E,A.value=E.map(R=>R.key)}}}))},w=T=>{const b=z.value;if(b){const E=b.map(R=>R.children?V(R.children):[]);A.value=E.flat()}},B=T=>{const b=z.value;b&&(A.value=b.map(E=>E.key))},V=(T,b)=>{const E=new Array;for(const R of T)if(R.key&&E.push(R.key),R.children){const L=V(R.children);L.length&&E.push(...L)}return E},O=T=>{c.value=T;const b=T.length?T[0]:void 0;n("update:selectedId",b==o.rootId?void 0:b);const E=b?s(b):[];n("update:path",E)},I=T=>e.h("span",null,T.option.label),y=T=>o.iconRender?e.h(u.NIcon,null,{default:()=>{var b;return(b=o.iconRender)==null?void 0:b.call(null,T)}}):T.option.isLeaf?e.h(u.NIcon,null,{default:()=>e.h(an)}):e.h(u.NIcon,null,{default:()=>e.h(ht)}),k=T=>{!o.moveAction&&!o.sortAction||(T.dropPosition=="before"||T.dropPosition=="after"?T.dragNode.key&&typeof T.node.key&&_(T.dragNode,T.node,T.dropPosition):T.dropPosition=="inside"&&typeof T.dragNode.key=="number"&&typeof T.node.key=="number"&&x(T.dragNode,T.node))},x=(T,b)=>{const E=o.moveAction;if(!E)return;const R=T.key,L=[T.key],G=b.key;!R||!G||T==b||a.post({url:E,data:{menuItemIds:L,targetId:G},successMessage:"Successful operation.",success:()=>{const M=i(z.value,R);M&&(M.nodes.splice(M.index,1),b.children&&b.children.push(T))}})};async function _(T,b,E){const R=o.sortAction;if(!R)return;const L=T.key;let G=b.key;if(!L||!G||L==G)return;const M=i(z.value,L);if(M){if(E=="after"){const K=M.nodes.indexOf(b);if(K>-1&&K<M.nodes.length-1&&(b=M.nodes[K+1],G=b.key,!G||L==G))return}a.post({url:R,data:{menuId:L,nextSiblingId:G},successMessage:"Successful operation.",success:()=>{M.nodes.splice(M.index,1);const K=M.nodes.indexOf(b);K>-1?M.nodes.splice(K,0,T):M.nodes.push(T)}})}}const H=T=>{if(T==null&&(T=o.rootId),c.value.includes(T))return;const b=m(z.value,T);b.length&&(A.value=b.map(E=>E.key),c.value=[T])},z=e.ref(h(o.data??[])),A=e.ref(((j=z.value)==null?void 0:j.map(T=>T.key))??[]);return e.watch(()=>o.additionKeys,()=>d()),e.watch(()=>o.loadTreeAction,()=>d()),e.watch(()=>o.data,T=>{T?z.value=h(T):z.value=[]}),e.watch(()=>o.selectedId,T=>{H(T)}),e.onMounted(()=>{d()}),(T,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]=E=>f.value=E)},{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]=()=>w()),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:T.sortAction!=null||T.moveAction!=null,data:z.value,pattern:f.value,"render-label":I,"render-prefix":y,onDrop:k,"selected-keys":c.value,"default-expanded-keys":A.value,"onUpdate:selectedKeys":O},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}=Y(),a=ie(),c=e.ref(!1),f=e.ref(s()),m=e.ref(g()),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 g(){if(o.name){const d=localStorage.getItem(`${o.name}:print-collate`);if(d&&(d=="Collated"||d=="Uncollated"))return d}return"Collated"}function h(){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 w=d.action;w&&(w=U(w,[{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:w,loadingStatus:B=>c.value=B,callback:()=>{c.value=!1,n("update:show",!1)}}))}return(d,w)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{class:"custom-card",show:d.show,preset:"card",style:e.normalizeStyle({width:d.width}),onClose:w[3]||(w[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:h,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:w[2]||(w[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":w[0]||(w[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":w[1]||(w[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}=Y(),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}=Y(),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(){X(this,"rows",Array());X(this,"totalRecords",null);X(this,"pageIndex",0);X(this,"pageSize",10);X(this,"pageCount",null);X(this,"noTotal",!1);X(this,"message",null);X(this,"summary",null);X(this,"currentPageRecords",0);X(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=te(e.defineComponent({__name:"SelectIconBox",emits:["update:selected"],setup(t,{emit:l}){const o=l,{t:n}=Y(),r=ie(),a=e.ref(sessionStorage.getItem(Ze)),c=e.ref(h(void 0)),f=e.ref([]),m=e.ref(1),i=e.ref(0),s=e.ref(!1),g=e.ref(sessionStorage.getItem(Rn));function h(I){const y=[{name:n("Root"),path:"/"}];if(I){for(;I.startsWith("/")||I.startsWith("\\");)I=I.substring(1);const k=I.split(/[\\/]+/);let x="/";for(const _ of k){x+=_;const H={name:_,path:x};y.push(H),x+="/"}}return y}function d(I){I.isDirectory?a.value=I.path:I.path&&o("update:selected",I.path)}function w(){V(0)}function B(I){V(I-1)}function V(I){I=Math.max(0,I);let y=`/api/core/SystemIcons/page?pageSize=${On}&pageIndex=${I}`;var k=g.value;k&&(y+=`&searchWords=${encodeURIComponent(k)}`);const x=a.value;x&&(y+=`&directory=${encodeURIComponent(x)}`),r.get({url:y,callback:_=>{_&&(f.value=_.rows,i.value=_.totalRecords,m.value=_.pageIndex+1,O(_.pageIndex,x,k))},loadingStatus:_=>s.value=_})}function O(I,y,k){sessionStorage.setItem(Dn,I.toString()),y?sessionStorage.setItem(Ze,y):sessionStorage.removeItem(Ze),k?sessionStorage.setItem(Rn,k):sessionStorage.removeItem(Ze)}return e.watch(a,I=>{c.value=h(I),V(0)}),e.onMounted(()=>{c.value=h(a.value);let I=Number(sessionStorage.getItem(Dn));V(I||0)}),(I,y)=>(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(Xo))]),_: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:w,value:g.value,"onUpdate:value":y[0]||(y[0]=k=>g.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:w,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":[y[1]||(y[1]=k=>m.value=k),B],"item-count":i.value??0,"page-size":On},{suffix:e.withCtx(({startIndex:k,endIndex:x,itemCount:_})=>[_?(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(_),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(Xo))]),_: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-ff87aac6"]]),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}=Y(),a=ie(),c=e.ref(i(o.items)),f=e.ref(!1),m=e.ref(o.selectedValue);function i(h){if(h){if(!h.length||typeof h[0]=="object")return h}else return[];const d=[];for(let w of h)typeof w=="string"||typeof w=="number"?d.push({id:w.toString(),code:r(w.toString())}):d.push(w);return d}const s=()=>{if(f.value)return;const h=o.getListAction;if(!h){c.value=[];return}a.get({url:h,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})},g=()=>{m.value&&n("valueSelected",m.value)};return e.onMounted(()=>{o.getListAction&&s()}),e.watch(()=>o.getListAction,()=>{s()}),(h,d)=>(e.openBlock(),e.createBlock(e.unref(u.NSpin),{show:f.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:d[2]||(d[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":d[0]||(d[0]=w=>m.value=w),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,w=>(e.openBlock(),e.createBlock(e.unref(u.NRadio),{key:w[h.keyName],value:w[h.keyName]},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"default",{data:w},()=>[e.createTextVNode(e.toDisplayString(w.code)+" "+e.toDisplayString(w.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:d[1]||(d[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 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 g of r)if(g.isEnabled!==!1)if(g.isSeparator)s||(f.push({type:"divider",key:`_${a}_${i++}`}),s=!0);else{const h=n(g.title),d={key:g.guid,id:g.guid,label:h,disabled:!g.isEnabled,href:g.url,tabBehavior:g.tabBehavior};if(g.items&&g.items.length)d.children=o(n,g.items,g.guid,c);else if(c&&!l(g,h,c))continue;g.guid&&g.icon&&(t[g.guid]={icon:g.icon,color:g.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}=Y(),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 w=d.href.startsWith("~")?d.href.substring(1):d.href;d.id&&(w=U(w,{_menuid:d.id}));let B;return d.tabBehavior=="NewTab"?B="_blank":d.tabBehavior=="NamedTab"&&(B=d.id),r.test(w)?e.h("a",{href:w,target:"_blank"},{default:()=>d.label}):e.h(ce.RouterLink,{to:w,target:B},{default:()=>d.label})}else return typeof d.label=="string"?d.label:""}function g(d){var w,B,V;if(d.key){const O=(w=f.menuLooks[d.key])==null?void 0:w.icon;if(O)return e.h(Se,{path:O,class:"menu-icon"});if((B=d.children)!=null&&B.length){const I=(V=d.key)==null?void 0:V.toString();return I&&a.value.includes(I)?e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(qs)}):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 h(d){if(d)try{o.post(`/api/core/UserRecentMenus/add?menuId=${encodeURIComponent(d)}`)}catch(w){console.error(w)}}return e.onMounted(()=>{!n.menus&&!n.isLoadingMenu&&n.sessionToken&&n.loadMenus()}),e.watch(()=>n.sessionToken,()=>n.loadMenus()),(d,w)=>{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":g,value:d.currentMenuId,accordion:!0,"onUpdate:expandedKeys":w[0]||(w[0]=O=>a.value=O),"onUpdate:value":h},null,8,["collapsed","options","value"])]),_:1}),e.withDirectives(e.createVNode(V,{style:{width:"250px"},placeholder:e.unref(l)("Search Menu"),clearable:"",onChange:w[1]||(w[1]=O=>c.value=O)},{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}=Y(),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]=g=>i.$emit("update:value",g)),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]=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}))}}),Wc=e.defineComponent({components:{NButton:u.NButton,NIcon:u.NIcon},props:{title:String,iconColor:String,icon:Object},setup(){const{t}=Y();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=te(Wc,[["render",Zc]]),Yc=e.defineComponent({name:"TopMenu",components:{NMenu:u.NMenu,NSpin:u.NSpin},setup(){const{t}=Y(),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 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(ce.RouterLink,{to:g,target:h},{default:()=>s.label})}else return s.label}function m(s){var g,h;if(s.key){const d=(g=r.menuLooks[s.key])==null?void 0:g.icon;return d?e.h(Se,{path:d,class:"menu-icon"}):(h=s.children)!=null&&h.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(g){console.error(g)}}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=te(Yc,[["render",Qc]]),qc=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}=Y(),a=e.ref(new Array),c=e.ref(new Array),f=e.ref(new Array);function m(A,j){for(const T of A){if(T.key==j)return{node:T,path:[T.key]};if(T.key!=null&&T.key!=null&&T.children&&!T.isLeaf){const b=m(T.children,j);if(b)return{node:b,path:[T.key,...b.path]}}}return null}function i(A,j){for(let T=0;T<A.length;T++){const b=A[T];if(b.key==j)return{nodes:A,index:T};if(b.children){const E=i(b.children,j);if(E)return E}}return null}function s(A){const j=m(a.value,A);return j?j.path:[]}function g(A,j){const T=new Array;for(const b of A)if(b.key&&(!j||j(b.key))&&T.push(b.key),b.children){const E=g(b.children,j);E.length&&T.push(...E)}return T}function h(A){c.value=A}function d(A){f.value=A;const j=A.length?A[0]:null;l.emit("update:selectedId",j);const T=j?s(j):[];l.emit("update:path",T)}function w(A){return t.treeNodeMapper?t.treeNodeMapper.call(void 0,A):{key:A.id,label:A.title,isLeaf:!A.hasSubitems}}async function B(A){const j=t.childrenAction,T=t.parentKey;if(!(!j||!T))try{const b=U(j,{parentKey:T,parentId:A}),E=await n.get(b);if(E.isSuccess&&E.value!=null)return E.value.map(w);o.error(r(E.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 O(A){const j=A.key;if(j!=null){if(A.children){const b=c.value,E=g(A.children,R=>b.includes(R));c.value=c.value.filter(R=>!E.includes(R))}const T=await B(j);T&&(A.isLeaf=!T.length,A.children=T.length?T:void 0)}}function I(A){return e.h("span",null,A.option.label)}function y(A){if(!A.option.isLeaf)return e.h(u.NIcon,null,{default:()=>e.h(ht)})}function k(A){const j=A.option.key;if(j!=null&&f.value.includes(j))return e.h(u.NButton,{text:!0,onClick:T=>{T.stopPropagation(),O(A.option)}},{default:()=>e.h(u.NIcon,null,{default:()=>e.h(dt)})})}function x(A){!t.moveAction&&!t.sortAction||(A.dropPosition=="before"||A.dropPosition=="after"?A.dragNode.key&&typeof A.node.key&&H(A.dragNode,A.node,A.dropPosition):A.dropPosition=="inside"&&typeof A.dragNode.key=="number"&&typeof A.node.key=="number"&&_(A.dragNode,A.node))}async function _(A,j){const T=t.moveAction;if(!T)return;const b=A.key,E=[A.key],R=j.key;if(!(!b||!R||A==j))try{const L=await n.post(T,{menuItemIds:E,targetId:R});if(L.isSuccess){o.success(r("Successful operation."));const G=i(a.value,b);G&&(G.nodes.splice(G.index,1),j.children?j.children.push(A):O(j))}else o.error(r(L.errorMessage||"Error"))}catch(L){console.log(L),o.error((L==null?void 0:L.toString())||"Error")}}async function H(A,j,T){const b=t.sortAction;if(!b)return;console.log(`dragNode: ${A.key} ${A.label}, targetNode: ${j.key} ${j.label}, dropPosition: ${T}`);const E=A.key;let R=j.key;if(!E||!R||E==R)return;const L=i(a.value,E);if(L){if(T=="after"){const G=L.nodes.indexOf(j);if(G>-1&&G<L.nodes.length-1&&(j=L.nodes[G+1],R=j.key,!R||E==R))return}try{const G=await n.post(b,{menuId:E,nextSiblingId:R});if(G.isSuccess){o.success(r("Successful operation.")),L.nodes.splice(L.index,1);const M=L.nodes.indexOf(j);M>-1?L.nodes.splice(M,0,A):L.nodes.push(A)}else o.error(r(G.errorMessage||"Error"))}catch(G){console.log(G),o.error((G==null?void 0:G.toString())||"Error")}}}async function z(A){var j;if(A.length){let T=(j=a.value)==null?void 0:j.find(L=>L.key==A[0]);T==null&&(T={key:A[0],label:r(t.rootName||"Root"),isLeaf:!1},a.value.push(T));let b=A[0],E=T;for(let L=1;L<A.length-1&&E;L++)if(E.children||(E.children=await B(b)),E.children){const G=A[L];E=E.children.find(M=>M.key==G),b=G}const R=c.value;for(let L=0;L<A.length-1;L++)R.includes(A[L])||R.push(A[L]);c.value=R,f.value=[A[A.length-1]]}}return e.onMounted(()=>{V()}),e.watch(()=>t.childrenAction,()=>{V()}),e.watch(()=>t.path,A=>{A&&z(A)}),{data:a,expandedKeys:c,expandedKeysChanged:h,loadChildren:O,dragDrop:x,renderLabel:I,renderPrefix:y,renderSuffix:k,selectedKeys:f,selectedKeysChanged:d}}});function Xc(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=te(qc,[["render",Xc]]),Jc={style:{margin:"0 20px 10px 0",cursor:"pointer"}},Uc={class:"user-name-box"},vc={class:"user-name-label"},Zn="/img/user_avatar.png",Yn=te(e.defineComponent({__name:"UserMenu",setup(t){var d;const l=ce.useRouter(),{t:o}=Y(),n=u.useDialog(),r=xe(),a=Ie(),c=nt(),f=e.computed(()=>a.userInfo),m=e.ref(!1),i=e.computed(()=>{var w,B;return(w=a.userInfo)!=null&&w.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 g(w){switch(w){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:(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(Xa)})}},{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(w,B)=>{const V=e.resolveComponent("n-avatar"),O=e.resolveComponent("n-dropdown"),I=e.resolveComponent("n-space");return e.openBlock(),e.createBlock(I,{style:{"align-items":"center"}},{default:e.withCtx(()=>[e.createVNode(O,{trigger:"click",options:h,placement:"bottom-end",onSelect:g,size:"medium"},{default:e.withCtx(()=>{var y,k;return[e.createElementVNode("div",Jc,[e.createVNode(V,{round:"",size:"medium",title:(y=f.value)==null?void 0:y.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-d85ebb4a"]]),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=ce.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 g;return((g=s.url)==null?void 0:g.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(Js))]),_: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)}}),qn=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}=Y(),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(){X(this,"token");X(this,"userId");X(this,"startupTime")}}class ld{constructor(){X(this,"guid","");X(this,"title","");X(this,"icon");X(this,"color");X(this,"url");X(this,"isSeparator",!1);X(this,"isEnabled",!0);X(this,"groupName");X(this,"description");X(this,"items");X(this,"tabBehavior");X(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,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 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 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:c,clearAllConfig:f,loadFromLocalStorage:i}}),sd={AppLogoBox:Jt,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:qn},id={install(t,l){const o={...Jo,...l};for(const[n,r]of Object.entries(sd))t.component(n,r);l!=null&&l.langCode&&t.use(Xt,l==null?void 0:l.langCode,!0),t.provide("axios",ne),t.provide(ft,o)}};S.axios=ne,S.AppLogoBox=Jt,S.AppTabs=Uo,S.AutoScrollView=vo,S.BarcodeImage=tn,S.ChangePassword=pt,S.Collapsable=pn,S.ColorInput=mt,S.DataPage=Pc,S.DateFormat=ye,S.DateTimeFormat=Ee,S.DefaultPropertyForm=Bt,S.DetailPage=Cn,S.EmptyDetailView=kn,S.ExportModal=Mt,S.FormInput=Be,S.FullscreenSwitch=bn,S.GridConfigModal=At,S.HaloButtonSelect=xn,S.HaloDatePicker=He,S.HaloForm=In,S.HaloGrid=Ke,S.HaloModal=Bn,S.HaloModalInput=It,S.HaloSelect=Vn,S.HaloTagsInput=xt,S.HaloTimePicker=kt,S.HaloTransfer=Mn,S.HalovConfigKey=ft,S.I18nPlugin=Xt,S.ImportModal=Lt,S.InputModal=zt,S.ListInputModal=St,S.MainDetailPanel=Tn,S.MenuIcon=Se,S.NullableBooleanInput=bt,S.NumberInputModal=An,S.ObjectTreeView=En,S.PhotoBox=_n,S.PrintModal=Ln,S.PropertyGrid=Vt,S.QrModal=zn,S.QuickSearchBox=qn,S.SearchCard=$n,S.SearchForm=Ge,S.SearchModal=_t,S.SearchPanel=We,S.SelectIconBox=$t,S.SelectObjectModal=jn,S.SessionSummary=nd,S.SideMenu=Fn,S.SystemIconInput=Hn,S.SystemMenu=ld,S.TabMenu=Qn,S.TagsView=Et,S.TimeFormat=_e,S.ToolButton=Gn,S.TopMenu=Kn,S.TreeView=Wn,S.UserMenu=Yn,S.addDays=ya,S.appendParamsToUrl=U,S.arrayDistinct=zo,S.arrayGroupBy=sa,S.arrayMove=Lo,S.arrayRemoveIf=_o,S.buildBarcodeUrl=en,S.buildSearchItems=wn,S.camelToWords=v,S.clearObject=xi,S.convertItems=yn,S.convertPercentValue=Ko,S.convertTo=Pe,S.copyEntity=gn,S.copyToEntity=hn,S.createGridColumns=wt,S.createI18n=qt,S.dateTimeToString=it,S.dateToNumber=jo,S.dateToString=st,S.default=id,S.defaultHalovOptions=Jo,S.defaultValue=Go,S.downloadFile=pe,S.findMenuById=Pn,S.firstDayOfMonth=wa,S.formatTimespan=Fo,S.getColumnWidth=yt,S.getConfig=ut,S.iconRender=Ct,S.iconRenderIf=Bi,S.initEntity=mn,S.instanceOfColumnValueSource=To,S.instanceOfHaloColumn=Ae,S.instanceOfTime=Do,S.isNullOrWhiteSpace=Wo,S.lastDayOfMonth=Ca,S.linesToArray=ba,S.loadItemSources=Fe,S.mergeCssClass=Yo,S.mergeCssStyles=Zo,S.mergeRoutes=ca,S.msToTime=pa,S.onNullOrWhiteSpace=xa,S.openFile=Eo,S.renderDifference=Mi,S.renderIconButton=Vi,S.renderLabel=Ii,S.searchField=ia,S.secondsToTime=Ro,S.splitNumberByCount=da,S.splitNumberBySize=fa,S.stringToArray=ka,S.stringToTime=Oo,S.sumNumbers=ua,S.timeToString=Po,S.timestamp=ha,S.toBool=de,S.toBoolDefault=je,S.toDate=$o,S.toViewModel=ga,S.useAccountStore=Ie,S.useCommonStore=xe,S.useFontSizeStore=rd,S.useHttpTools=ie,S.useI18n=Y,S.useMenus=Dt,S.usePermissions=Tt,S.useTabsStore=nt,S.useUiTools=Nt,S.useUserConfigStore=ad,S.validateEmail=Na,Object.defineProperties(S,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
7
|
+
`):o.value},f=()=>{var s,g,h;return m.value?((h=(g=(s=m.value)==null?void 0:s.split(/\r?\n/))==null?void 0:g.map(d=>d.trim()))==null?void 0:h.filter((d,w,B)=>d&&B.indexOf(d)==w)).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]=g=>m.value=g),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"]))}}),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}=Y(),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]=g=>i.$emit("update:value",g))},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]=g=>a.value=g),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]=g=>m(g))},null,40,["style"])):e.createCommentVNode("",!0)]),_:1},8,["show","title","style"])]),_:1}))}}),Ei={key:0,style:{"flex-grow":"1"}},_i={key:0,style:{"text-align":"right"}},Li=["readonly","disabled"],zi=["readonly","disabled"],Ie=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}=Y(),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":w=>{r.value=w}})},g=d=>{if(d.target instanceof HTMLInputElement){const w=d.target.files;w!=null&&w.length?r.value=w[0]:r.value=null}},h=d=>{var B,V;const w=(B=o.formItem)==null?void 0:B.valueSource;w&&w.type=="remote"&&w.sourceUrl&&w.filterable&&He(c,w,{searchWords:d},O=>w.i18n?a(O):O,((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,w;(w=(d=o.formItem)==null?void 0:d.role)!=null&&w.length&&(m.value=o.formItem.role.includes("list"),f.value=o.formItem.role.map(B=>`halo-form-${B}`).join(" "))}),(d,w)=>{var B,V,O,I,y,k,x,A,H,L,T,j,_,b,M,R,$,G;return d.formItem?(e.openBlock(),e.createElementBlock("div",Ei,[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":w[0]||(w[0]=E=>r.value=E)},null,40,["value"]))],1024)):((B=d.formItem.editor)==null?void 0:B.startsWith("@"))==!0?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.formItem.editor.substring(1)),{key:1,value:r.value,"onUpdate:value":w[1]||(w[1]=E=>r.value=E),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(Bt,{key:2,value:r.value,"onUpdate:value":w[2]||(w[2]=E=>r.value=E),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(e.unref(u.NSwitch),{key:3,value:r.value,"onUpdate:value":w[3]||(w[3]=E=>r.value=E),style:e.normalizeStyle((V=d.formItem.editorConfig)==null?void 0:V.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(e.unref(u.NSelect),{key:4,value:r.value,"onUpdate:value":w[4]||(w[4]=E=>r.value=E),remote:d.formItem.valueSource.type=="remote",loading:d.formItem.valueSource.isLoading,options:d.formItem.valueSource.values,filterable:d.formItem.valueSource.filterable,multiple:((O=d.formItem.role)==null?void 0:O.includes("list"))==!0,placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((I=d.formItem.editorConfig)==null?void 0:I.style),onSearch:h},{action:e.withCtx(()=>[d.formItem.valueSource.filterable?(e.openBlock(),e.createElementBlock("div",_i,[e.createVNode(e.unref(u.NText),{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(e.unref(u.NInputNumber),{key:5,value:r.value,"onUpdate:value":w[5]||(w[5]=E=>r.value=E),min:d.formItem.minValue,max:d.formItem.maxValue,clearable:d.formItem.nullable,readonly:d.readonly,placeholder:d.placeholder,style:e.normalizeStyle((y=d.formItem.editorConfig)==null?void 0:y.style)},null,8,["value","min","max","clearable","readonly","placeholder","style"])):d.formItem.editor=="boolean"&&d.formItem.nullable?(e.openBlock(),e.createBlock(Nt,{key:6,value:r.value,"onUpdate:value":w[6]||(w[6]=E=>r.value=E),placeholder:"",disabled:d.readonly,style:e.normalizeStyle((k=d.formItem.editorConfig)==null?void 0:k.style)},null,8,["value","disabled","style"])):d.formItem.editor=="boolean"?(e.openBlock(),e.createBlock(e.unref(u.NCheckbox),{key:7,checked:r.value,"onUpdate:checked":w[7]||(w[7]=E=>r.value=E),disabled:d.readonly,style:e.normalizeStyle((x=d.formItem.editorConfig)==null?void 0:x.style)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:1},8,["checked","disabled","style"])):d.formItem.editor=="datetime"?(e.openBlock(),e.createBlock(Ge,{key:8,value:r.value,"onUpdate:value":w[8]||(w[8]=E=>r.value=E),type:"datetime",placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((A=d.formItem.editorConfig)==null?void 0:A.style),"default-time":"00:00:00"},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="date"?(e.openBlock(),e.createBlock(Ge,{key:9,value:r.value,"onUpdate:value":w[9]||(w[9]=E=>r.value=E),type:"date",placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((H=d.formItem.editorConfig)==null?void 0:H.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="time"?(e.openBlock(),e.createBlock(bt,{key:10,value:r.value,"onUpdate:value":w[10]||(w[10]=E=>r.value=E),placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((L=d.formItem.editorConfig)==null?void 0:L.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="color"?(e.openBlock(),e.createBlock(ht,{key:11,value:r.value,"onUpdate:value":w[11]||(w[11]=E=>r.value=E),placeholder:"",disabled:d.readonly,readonly:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((T=d.formItem.editorConfig)==null?void 0:T.style)},null,8,["value","disabled","readonly","clearable","style"])):d.formItem.editor=="tags"?(e.openBlock(),e.createBlock(St,{key:12,value:r.value,"onUpdate:value":w[12]||(w[12]=E=>r.value=E),tagSource:d.formItem.tagSource,placeholder:"",disabled:d.readonly,style:e.normalizeStyle((j=d.formItem.editorConfig)==null?void 0:j.style)},null,8,["value","tagSource","disabled","style"])):d.formItem.editor=="image"?(e.openBlock(),e.createElementBlock("input",{key:13,type:"file",onChange:g,readonly:d.readonly,disabled:d.readonly,style:e.normalizeStyle((_=d.formItem.editorConfig)==null?void 0:_.style)},null,44,Li)):d.formItem.editor=="file"?(e.openBlock(),e.createElementBlock("input",{key:14,type:"file",onChange:g,readonly:d.readonly,disabled:d.readonly,style:e.normalizeStyle((b=d.formItem.editorConfig)==null?void 0:b.style)},null,44,zi)):d.formItem.editor=="password"?(e.openBlock(),e.createBlock(e.unref(u.NInput),{key:15,value:r.value,"onUpdate:value":w[13]||(w[13]=E=>r.value=E),class:e.normalizeClass(f.value),placeholder:d.placeholder??"",type:"password",readonly:d.readonly,style:e.normalizeStyle((M=d.formItem.editorConfig)==null?void 0:M.style)},null,8,["value","class","placeholder","readonly","style"])):d.formItem.editor=="textarea"?(e.openBlock(),e.createBlock(e.unref(u.NInput),{key:16,value:r.value,"onUpdate:value":w[14]||(w[14]=E=>r.value=E),class:e.normalizeClass(f.value),type:"textarea",placeholder:d.placeholder??"",readonly:d.readonly,style:e.normalizeStyle((R=d.formItem.editorConfig)==null?void 0:R.style)},null,8,["value","class","placeholder","readonly","style"])):(e.openBlock(),e.createBlock(e.unref(u.NInput),{key:17,value:r.value,"onUpdate:value":w[16]||(w[16]=E=>r.value=E),class:e.normalizeClass(f.value),placeholder:d.placeholder??"",readonly:d.readonly,clearable:d.formItem.nullable,type:d.formItem.editor,style:e.normalizeStyle(($=d.formItem.editorConfig)==null?void 0:$.style)},{suffix:e.withCtx(()=>[m.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,text:"",title:e.unref(a)("If there are multiple items, separate them with commas."),onClick:w[15]||(w[15]=()=>i.value=!0)},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ls))]),_: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:i.value,"onUpdate:show":w[17]||(w[17]=E=>i.value=E),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":w[18]||(w[18]=E=>r.value=E),style:e.normalizeStyle((G=d.formItem.editorConfig)==null?void 0:G.style)},null,8,["show","title","readonly","message","value","style"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}}),$i=e.defineComponent({name:"DefaultPropertyForm",components:{FormInput:Ie,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}=Y(),n=e.inject("axios"),r=e.ref(null),a=e.ref([]),c=e.ref(t.columns||1),f=e.ref({}),m=e.ref(g(t.formItems)),i=d(t.formItems),s=e.ref(void 0);function g(y){return y?[...new Set(y.map(x=>x.group))].map(x=>({label:x||"General",items:y.filter(A=>A.group==x)})):[]}function h(y){return y.dataType=="boolean"&&!y.nullable?" ":y.label}function d(y){const k={};if(y&&y.length)for(const x of y){const A=[];x.nullable==!1&&x.dataType!="boolean"&&A.push({required:!0,message:o("Must be filled here.")}),A.length&&(k[x.name]=A)}return k}async function w(y,k){var x;if(k.type=="remote"&&k.sourceUrl)He(n,k,null,A=>k.i18n?o(A):A,y.nullable);else if(k.type=="function"&&k.func){k.isLoading=!0;try{const A=(x=k.func)==null?void 0:x.call(void 0);A&&(k.values=A)}finally{k.isLoading=!1}}}function B(){var y;(y=t.formItems)==null||y.forEach(k=>{k.valueSource&&(k.valueSource.type=="remote"||k.valueSource.type=="function")&&w(k,k.valueSource)})}function V(y,k){l.emit("itemChange",{item:y,data:t.data,value:k})}function O(y){return!!(y.readonly==!0||t.readOnly==!0||t.method&&Array.isArray(y.readonly)&&y.readonly.includes(t.method))}function I(y){return!!(y.visibility==!0||t.method&&Array.isArray(y.visibility)&&y.visibility.includes(t.method))}return e.onMounted(()=>{B(),t.data&&(f.value=t.data)}),e.watch(()=>t.data,y=>f.value=y||{}),{t:o,formRef:r,formItemsRef:a,getItemLabel:h,originalModel:s,model:f,rules:i,formColumns:c,updateValue:V,formGroups:m,isReadonly:O,isVisible:I}}}),Di={class:"item-box"},Ri={class:"item-box"},Oi={class:"item-box"};function ji(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"),g=e.resolveComponent("n-tabs"),h=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(g,{key:0,type:"line"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formGroups,w=>(e.openBlock(),e.createBlock(s,{key:w,name:w.label,tab:t.t(w.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(w.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},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,w=>(e.openBlock(),e.createBlock(h,{key:w},{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(w.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",Ri,[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,w=>e.withDirectives((e.openBlock(),e.createBlock(m,{ref_for:!0,ref:"formItemsRef",key:w.name,label:t.getItemLabel(w),path:w.name,feedback:w.errorMessage,"validation-status":w.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",Oi,[e.createVNode(c,{"form-item":w,value:t.model[w.name],"onUpdate:value":[B=>t.model[w.name]=B,B=>t.updateValue(w,B)],readonly:t.isReadonly(w),label:w.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),w.description?(e.openBlock(),e.createBlock(f,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(w.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(w)]])),128))]),_:1},8,["cols"]))]),_:3},8,["model","rules"])}const Vt=oe($i,[["render",ji],["__scopeId","data-v-e7319d81"]]),Pi={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}=Y(),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 g of m)if(typeof g=="string")(!i||f[g])&&c.push({name:g,label:o(v(g)),value:f[g],span:1});else{const h={name:g.name??g.label,label:o(g.label||v(g.name)),value:f[g.name],span:g.span||1,dataType:g.dataType,role:g.role};h.value!=null&&(h.dataType=="boolean"?h.value=de(h.value)?o("Yes"):o("No"):g.i18n&&(h.value=o((s=h.value)==null?void 0:s.toString()))),(!i||h.value)&&c.push(h)}else if(Array.isArray(f))for(const g of f)(!i||g.value)&&c.push({name:g.label,label:o(v(g.label)),value:g.value,span:1});else for(const g in f)(!i||f[g])&&c.push({name:g,label:o(v(g)),value:f[g],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",Pi,[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"]))}}),Fi={style:{"align-items":"center"},class:"flex-row gap05"},Hi={class:"flex-row gap05"},Gi={class:"flex-column flex-1 gap05"},Ki={key:0,class:"flex-row",style:{"justify-content":"space-between"}},Wi={class:"text-monospace",style:{"font-size":"24pt"}},Zi={key:0},Yi=["src"],Qi=["src"],qi={class:"flex-row gap05",style:{"justify-content":"flex-end"}},kn=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}=Y(),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",Hi,[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(di))]),_: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(ai))]),_:1})]),_:1},8,["title"])])]),default:e.withCtx(()=>[e.createElementVNode("div",Gi,[m.subject?(e.openBlock(),e.createElementBlock("div",Ki,[e.createElementVNode("div",null,[e.createElementVNode("div",Wi,e.toDisplayString(m.subject),1),m.showBarcode?(e.openBlock(),e.createElementBlock("div",Zi,[e.createElementVNode("img",{src:"/api/core/Barcode/Image?code="+m.subject+"&format=CODE_128&height=30&margin=4,2"},null,8,Yi)])):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,Qi)):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(ze))]),_:1})):(e.openBlock(),e.createBlock(e.unref(u.NIcon),{key:1,size:24},{default:e.withCtx(()=>[e.createVNode(e.unref($s))]),_: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",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(an))]),_: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",Fi,[e.renderSlot(m.$slots,"icon",{},()=>[e.createVNode(e.unref(u.NIcon),{size:24},{default:e.withCtx(()=>[e.createVNode(e.unref(Fs))]),_: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"]]),Xi={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}=Y(),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(g=>s.includes(g.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(g=>i.includes(g.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(cn))]),_: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]=g=>n.value=g)},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]=g=>a.value=g)},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"}},bn=e.defineComponent({__name:"EmptyDetailView",props:{message:{default:"Please select a object."}},setup(t){const{t:l}=Y();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(mi))]),_: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})]))}}),Ui=e.defineComponent({components:{FullscreenIcon:Wa,ExitFullscreenIcon:Ga},emits:["change"],setup(t,l){const{t:o}=Y(),n=Ne(),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 g=(s=i.target)==null?void 0:s.closest(".fullscreen-view");a(g)}}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 vi(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 Nn=oe(Ui,[["render",vi]]),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 c(g){a||await m(g)}function f(){for(let g in o)o[g]=!1}async function m(g){f();const h=n.filter(d=>(d==null?void 0:d.length)==32);if(h.length)try{let d=await l.get(`/api/core/Account/CheckPermissions?permissions=${encodeURIComponent(h.join())}`);d.isSuccess&&d.value!=null?(a++,d.value.forEach(w=>{o[w]=!0;const B=r.find(V=>V.id==w);B&&(o[B.name]=!0)}),g==null||g.call(null,o)):console.error(d.errorMessage)}catch(d){console.error(d)}}function i(){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:c,all:i,any:s}},ec={key:0,class:"flex-row",style:{"align-items":"center","justify-content":"space-between",gap:"0.25em","margin-bottom":"1em"}},tc={style:{display:"grid","grid-template-columns":"auto 1fr",gap:"0.5em","margin-top":"1em","align-items":"center"}},xn=200,Et=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}=Y(),a=ie(),c=e.inject("axios"),f=u.useMessage(),m=At(["2E2466DDD34847C8B33460E4277A6528"]),i=e.ref(o.pageSize),s=e.ref(!1),g=e.ref(!1),h=k=>k?k.map((x,A)=>({columnId:x.name,title:x.title?r(x.title):r(v(x.name)),visible:!0,sortIndex:A})).sort((x,A)=>x.sortIndex-A.sortIndex):[],d=k=>(x,A)=>{let H=null;if(k=="visible"){const L=Pe(x[k]);H=e.h(u.NIcon,{size:"20"},{default:()=>L?e.h(rn):e.h(ln)})}else k=="move_up"?H=e.h(u.NIcon,{size:"20"},{default:()=>e.h(Ms)}):k=="move_down"&&(H=e.h(u.NIcon,{size:"20"},{default:()=>e.h(Ns)}));return e.h(u.NButton,{text:!0,onClick:L=>{w(x,A,k),L.stopPropagation()}},{default:()=>H})};function w(k,x,A){switch(A){case"visible":k.visible=!k.visible;break;case"move_up":if(x>0&&I.value){const H=I.value.splice(x,1);I.value.splice(x-1,0,H[0])}break;case"move_down":if(I.value&&x<I.value.length-1){const H=I.value.splice(x,1);I.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:I.value.filter(x=>x.columnId).map((x,A)=>({columnId:x.columnId,visible:x.visible,sortIndex:A}))};k.pageSize&&(k.pageSize=Math.max(1,Math.min(xn,k.pageSize)));try{const x=s.value&&g.value,A=await c.post(`/api/core/UserDataGrids/Save?isDefault=${x}`,k);(A==null?void 0:A.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((A==null?void 0:A.errorMessage)||r("Error"))}catch(x){f.error((x==null?void 0:x.toString())||r("Error"))}}async function O(){if(o.gridId&&I.value.length)try{const k=s.value&&g.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 A of x.value.columns){const H=I.value.find(L=>L.columnId==A.columnId);H&&(H.visible=A.visible,H.sortIndex=A.sortIndex),I.value.sort((L,T)=>L.sortIndex-T.sortIndex)}}else I.value=h(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=>{g.value=x["2E2466DDD34847C8B33460E4277A6528"]}),O())}),e.watch(()=>o.gridColumns,()=>I.value=h(o.gridColumns)),e.watch(s,()=>O());const I=e.ref(h(o.gridColumns)),y=[{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 A=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(A,{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(()=>[g.value?(e.openBlock(),e.createElementBlock("div",ec,[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:y,data:I.value,"max-height":450,size:"small"},null,8,["data"]),e.createElementVNode("div",tc,[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:xn,min:1,style:{"max-width":"200px"}},null,8,["value"])])]),_:1},8,["show","title"])}}}),Sn=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}=Y(),a=e.inject("axios"),c=e.ref(!1),f=e.ref([]);async function m(s){let g=o.sourceUrl;if(g){const h=o.labelFormatter,d=o.keyField,w=o.labelField,B=o.subLabelField,V=o.additionalQuery;c.value=!0,f.value=[];try{V&&(g=U(g,V,!0));const O=await a.get(g);if(O.isSuccess&&O.value!=null){let I=O.value;if(!Array.isArray(I)&&"rows"in I&&Array.isArray(I.rows)&&(I=I.rows),Array.isArray(I)){const y=I.filter(k=>k&&!0).map(k=>{if(typeof k=="string")return{value:k,label:h?h(k):r(k)};{let x=k[w||"label"];if(h&&(x=h(x)),B){const A=k[B];typeof A=="string"&&(x+=" "+(h?h(A):A))}return{value:k[d||"value"],label:x}}});f.value=y}}}finally{c.value=!1}}}function i(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"),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,w=>(e.openBlock(),e.createBlock(h,{key:w.value,value:w.value,label:w.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}=Y(),c=e.inject("axios"),f=I=>I==null?void 0:I.map(y=>typeof y=="string"?{label:a(y),value:y}:y),m=()=>{const I=new Array;if(n.searchItems)for(const y of n.searchItems)if(typeof y=="string")I.push({name:y,label:v(y),editor:"text",nullable:!0,visibility:!0,searchMethod:"normal"});else{let k=y;y.searchField&&(k=Object.assign({},y),k.name=y.searchField),I.push(k)}return I},i=()=>{const I={};if(B.forEach(y=>{I[y.name]=null,y.searchMethod=="range"&&(I[y.name+"From"]=null,I[y.name+"To"]=null)}),n.searchArgs)for(const y in I)n.searchArgs[y]!=null&&(I[y]=n.searchArgs[y]);return I},s=()=>{for(const I in V)V[I]=null},g=async I=>{var k,x;const y=I.valueSource;if(y){if(y.type=="remote"&&y.sourceUrl)await He(c,y,null,A=>y.i18n?a(A):A,!1),I.nullable==!1&&((k=y.values)!=null&&k.length)&&(V[I.name]=y.values[0].value);else if(y.type=="function"&&y.func){y.isLoading=!0;try{const A=(x=y.func)==null?void 0:x.call(void 0);A&&(y.values=A)}finally{y.isLoading=!1}}}},h=()=>{var y;const I={};for(const k of B){const x=k.searchField??k.name;if(k.searchMethod=="range"){const A=d(x+"From",k);A!=null&&(I[x+"From"]=A);let H=d(x+"To",k);H!=null&&(k.editor=="date"&&typeof H=="string"&&(H=ae(H,ge).add(1,"days").format(ge)),I[x+"To"]=H)}else{const A=d(x,k);A!=null&&(((y=k.role)==null?void 0:y.includes("list"))==!0&&typeof A=="string"?A.includes(",")?I[x]=A.split(","):I[x]=[A]:I[x]=A)}}return I},d=(I,y)=>{var x,A;let k=V[I];if(!(typeof k=="string"&&(k=k.trim(),k==""&&!y.valueSource))){if(Array.isArray((x=y.valueSource)==null?void 0:x.values)){const H=(A=y.valueSource)==null?void 0:A.values;if(H){if(H.some(L=>L.value==V[I]))k=V[I];else if(k=="")return;if(y.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:Fe(k,y.dataType,y.role)}}}return Fe(k,y.dataType,y.role)}},w=()=>{r("update:searchArgs",h())},B=m(),V=e.reactive(i()),O=e.ref(f(n.groupOptions));return e.watch(()=>n.groupOptions,()=>O.value=f(n.groupOptions)),e.onMounted(()=>{i(),B.forEach(I=>{I.valueSource&&(I.valueSource.type=="remote"||I.valueSource.type=="function"?g(I):I.valueSource.type=="static")})}),l({reset:s,updateValues:w,pickValues:h}),(I,y)=>(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(Ie,{"form-item":k,value:V[k.name+"From"],"onUpdate:value":x=>V[k.name+"From"]=x,style:{"flex-grow":"1"},onInput:y[0]||(y[0]=()=>w())},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(Ie,{"form-item":k,value:V[k.name+"To"],"onUpdate:value":x=>V[k.name+"To"]=x,style:{"flex-grow":"1"},onInput:y[1]||(y[1]=()=>w())},null,8,["form-item","value","onUpdate:value"])]),_:2},1024)):(e.openBlock(),e.createBlock(Ie,{key:1,"form-item":k,value:V[k.name],"onUpdate:value":x=>V[k.name]=x,onInput:y[2]||(y[2]=()=>w())},null,8,["form-item","value","onUpdate:value"]))]),_:2},1032,["label","path"])]),_:2},1024))),128))]),_:1}),O.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:I.groupBy,options:O.value,"onUpdate:value":y[3]||(y[3]=k=>I.$emit("update:groupBy",k))},null,8,["value","options"])]),_:1},8,["label"])]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["model"]))}}),[["__scopeId","data-v-3f7ad8bc"]]),oc={class:"flex-row gap05"},_t=e.defineComponent({__name:"TagsView",props:{tags:{},tagSource:{},size:{default:"small"}},setup(t){const l=t,o=Ne(),n=ie(),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(g=>g.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",oc,[(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))]))}}),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}=Y(),c=ce.useRouter(),f=xt(),m=e.ref(void 0),i=e.ref([]),s=e.ref(void 0),g=()=>{const b={};return typeof n.height=="number"?b.height=`${n.height}px`:typeof n.height=="string"&&(b.height=n.height),b},h=e.ref(g()),d=()=>{var R;const b=i.value,M=(R=n.data)==null?void 0:R.filter($=>b.includes($[n.keyField]));r("update:selectedIds",b,M),b.length&&r("update:selectedId",b[0])},w=b=>b[n.keyField],B=(b,M)=>{let R=0,$=0;const G=new Set;for(const E of M){let K,X,ee;if(typeof E=="string")ee=E,K={key:E,title:a(v(E))};else if(ee=E.name||`column_${R}`,!(E.behavior=="none"||E.visible==!1))if(E.behavior=="link"||E.behavior=="router-link")K={key:ee,title:E.title?a(E.title):void 0,align:E.align,fixed:E.fixed||void 0,width:E.width,sorter:E.sortable==!0,cssStyle:E.cssStyle,render:E.render||O(E)};else if(E.behavior=="button")K={key:ee,title:E.title?a(E.title):void 0,align:E.align||"center",fixed:E.fixed||void 0,width:E.width,sorter:E.sortable==!0,cssStyle:E.cssStyle,render:E.render||O(E)};else{let ne=E.align,se=[];if(!E.display)switch(E.dataType){case"number":ne=ne||"right",X=60,se.push("text-num");break;case"boolean":ne=ne||"center",X=60;break;case"date":X=100;break;case"datetime":X=180;break;case"timespan":ne=ne||"center",X=80;break;case"time":X=80,se.push(`text-${E.dataType}`);break}if(K={key:ee,title:E.title==null?a(v(E.name)):E?a(E.title):void 0,titleAlign:"center",align:ne,width:E.width||X,sorter:E.sortable==!0,cssStyle:E.cssStyle,minWidth:E.minWidth,resizable:!0,fixed:E.fixed,render:E.render||O(E)},typeof E.className=="string"?se.push(E.className):Array.isArray(E.className)&&se.push(...E.className),se.length&&(K.className=se.join(" ")),!K.width&&K.minWidth&&(K.width=K.minWidth),E.referencePage&&typeof K.width=="number"&&(K.width+=30),E.role&&E.role.includes("qr")&&typeof K.width=="number"&&(K.width+=30),E.role&&E.role.includes("percent")&&typeof K.width=="number"&&(K.width+=30,K.align||(K.align="right")),(E.textOverflow=="ellipsis"||E.textOverflow=="clip")&&(K.ellipsis={tooltip:!0},K.resizable=!0,X||(X=400)),E.children&&E.children.length){const W=[];B(W,E.children),K.children=W,W.some(te=>te.width)&&(K.width=void 0)}}K&&!G.has(ee)&&(G.add(ee),b.push(K),typeof E=="object"&&typeof E.width=="number"?$+=E.width:$+=X||150)}return $},V=()=>{if(console.log("buildGridColumns"),n.columns){const b=[];let M=0;return n.checkable&&(b.push({type:"selection",fixed:"left"}),M+=30),M+=B(b,n.columns),n.withEdit&&(b.push({key:"btn-edit",width:30,fixed:"right",render(R,$){return e.h(u.NButton,{text:!0,titie:a("Edit"),onClick:G=>{r("editRow",R,$),G.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#5C6BC0",size:"20"},{default:()=>e.h(Xo)})})}}),M+=30),n.withDelete&&(b.push({key:"btn-delete",width:30,fixed:"right",render(R,$){return e.h(u.NButton,{text:!0,titie:a("Delete"),onClick:G=>{r("deleteRow",R,$),G.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#f44336",size:"20"},{default:()=>e.h(qo)})})}}),M+=30),n.withDetails&&(b.push({key:"btn-details",width:30,fixed:"right",render(R,$){return e.h(u.NButton,{text:!0,titie:a("Details"),onClick:G=>{r("showDetails",R,$),G.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#4CAF50",size:"20"},{default:()=>e.h(ds)})})}}),M+=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(un)})}}),M+=30),m.value=M,b}else return[]},O=b=>(M,R)=>{var ee,ne,se;let $=null;const G=b.display||b.name;if(b.template&&typeof b.template=="function")$=b.template.call(null,M,R);else if(b.dataType=="bool"||b.dataType=="boolean"){const W=Pe(M[G]);if(b.values&&b.values.length>1)return b.i18n?a(W?b.values[0]:b.values[1]):W?b.values[0]:b.values[1];W!=null?$=e.h(u.NIcon,{size:"20",class:W?"cell-checked":"cell-unchecked"},{default:()=>W?e.h(_s):e.h(li)}):$=e.h("span")}else if(b.dataType=="date")$=it(Do(M[G]));else if(b.dataType=="time")$=Fo(Oo(M[G]));else if(b.dataType=="timespan")$=Ho(M[G]);else{let W=M[G];b.formatter?W=b.formatter(W,M):b.template&&(W=Ce.render(b.template,M)),typeof W=="string"&&(b.prefix&&(W=b.prefix+W),b.suffix&&(W=W+b.suffix),b.i18n&&(W=a(W))),$=W}let E=b.role;if(E&&!Array.isArray(E)&&(E=[E]),E!=null&&E.length)if(E.includes("tag")){let W;Array.isArray(M[G])?W=M[G]:W=(se=(ne=(ee=M[G])==null?void 0:ee.toString())==null?void 0:ne.split(","))==null?void 0:se.filter(te=>te.length),W&&W.length&&($=e.h(_t,{tags:W,tagSource:b.tagSource},{}))}else $&&($=e.h("span",{class:E.map(W=>{switch(W){case"status":return`status-tag status-${M[G]}`;default:return`halo-form-${W}`}}).join(" "),style:b.cssStyle},[$]));const K=typeof b.href=="function"?b.href(M):b.href;if(b.behavior=="link")K?$=e.h("a",{href:Ce.render(K,M),target:"_blank"},[$]):$=e.h("a",{href:"#",onClick:W=>{var te;r("columnButtonClick",b.name,M,R),(te=b==null?void 0:b.click)==null||te.call(null,M,R),W.stopPropagation()}},[$]);else if(b.behavior=="router-link"&&K){const W=$;$=e.h(ce.RouterLink,{to:Ce.render(K,M)},{default:()=>W})}else if(b.behavior=="button"){const W=$;$=e.h(u.NButton,{size:"tiny",tag:"a",onClick:te=>{var Be;r("columnButtonClick",b.name,M,R),(Be=b==null?void 0:b.click)==null||Be.call(null,M,R),te.stopPropagation()}},{default:()=>W})}const X=[];if(b.role&&(b.role.includes("qr")&&X.push(e.h(u.NButton,{quaternary:!0,size:"tiny",class:"btn-cell-qr",title:a("QR Code"),onClick:()=>y(b,R)},{default:()=>e.h(u.NIcon,{},{default:()=>e.h(ii)})})),b.role.includes("percent"))){const W=Wo(M[G]);X.push(e.h(u.NProgress,{showIndicator:!1,type:"circle",status:W&&W>100?"error":"success",percentage:W||0,class:"percent-mark",style:"width: 1em; margin-bottom: auto; margin-top: auto"}))}return b.referencePage&&X.push(e.h(u.NButton,{quaternary:!0,size:"tiny",class:"btn-cell-ref",title:a("Details"),onClick:()=>I(b,R)},{default:()=>e.h(u.NIcon,{},{default:()=>e.h(yt)})})),X.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",{},...X)]):$},I=(b,M)=>{if(Array.isArray(n.data)&&M!=null&&M>=0&&M<n.data.length&&b.referencePage){const R=n.data[M],$=Ce.render(b.referencePage,R);$.startsWith("/")&&c.push({path:$})}},y=(b,M)=>{if(Array.isArray(n.data)&&M!=null&&M>=0&&M<n.data.length){const R=n.data[M][b.name];if(typeof R=="string"){const $=a(b.title??v(b.name));f.showQrModal(R,$)}}},k=(b,M)=>({onClick:R=>{if(R.target instanceof HTMLElement&&R.target.classList.contains("n-checkbox-box__border")==!1){const $=w(b);$!==void 0&&!i.value.includes($)&&(i.value=[$],d())}},ondblclick:R=>{R.target instanceof HTMLTableCellElement&&r("editRow",b,M)}}),x=(b,M)=>{M!=!1||!n.multiSelect?(i.value=[b],d()):i.value.includes(b)||(i.value.push(b),d())},A=(b,M)=>{if(M!=!1||!n.multiSelect)i.value=b,d();else{const R=i.value.slice();for(const $ of b)R.includes($)||R.push($);i.value.length<R.length&&(i.value=R,d())}},H=b=>{n.multiSelect?i.value=b:i.value=b.slice(0,1),d()},L=()=>i.value,T=(b,M)=>{Array.isArray(n.data)&&b>-1&&zo(n.data,b,M)},j=()=>{var R;const b=(R=s.value)==null?void 0:R.$el,M=b==null?void 0:b.querySelector("tbody.n-data-table-tbody");if(M&&Array.isArray(n.data)){const $=e.ref(n.data);Yt.useDraggable(M,$,{animation:150,ghostClass:"draging-ghost",handle:".drag-sorting-handle",onUpdate(G){var X;const E=G.oldIndex,K=G.newIndex;if(E!=null&&K!=null&&n.data&&E<((X=n.data)==null?void 0:X.length)){const ee=n.data[E];r("rowSorting",{oldIndex:E,newIndex:K,source:ee,updateGrid:()=>T(E,K)})}}})}},_=e.ref(V());return e.watch(()=>n.data,b=>{const R=b.map($=>$[n.keyField]);i.value=i.value.filter($=>R.includes($)),d()}),e.watch(()=>n.columns,()=>_.value=V()),e.watch(()=>n.height,()=>h.value=g()),e.onMounted(()=>{n.dragSorting&&setTimeout(()=>{j()},500)}),l({selectRow:x,selectRows:A,getSelectedRowKeys:L}),(b,M)=>(e.openBlock(),e.createBlock(e.unref(u.NDataTable),{ref_key:"nTableRef",ref:s,class:"flex-1",columns:_.value,data:b.data,size:"small","row-key":w,"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(h.value),"checked-row-keys":i.value,"onUpdate:checkedRowKeys":[M[0]||(M[0]=R=>i.value=R),H],"scrollbar-props":{trigger:"none"},"onUpdate:sorter":M[1]||(M[1]=R=>b.$emit("update:sorter",R))},null,8,["columns","data","loading","max-height","scroll-x","flex-height","style","checked-row-keys"]))}}),nc={class:"flex-column gap05"},lc={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}=Y(),c=u.useMessage(),f=e.inject("axios"),m=e.ref(null),i=e.ref(1),s=e.ref(0),g=e.ref(!1),h=e.ref(Array()),d=e.ref(Array());let w=!0;function B(x){if(x){const A=x.rows;A.forEach((H,L)=>{H.__key__=L}),h.value=A,s.value=x.pageCount||1,i.value=x.pageIndex+1}}function V(){h.value=[],s.value=0,i.value=1}function O(x){I(x)}async function I(x){var L,T,j;const A=((L=m.value)==null?void 0:L.pickValues())||{},H=(T=n.config)==null?void 0:T.searchAction;if(A&&H){const _={pageSize:((j=n.config)==null?void 0:j.pageSize)||10,pageIndex:(x||i.value)-1};Object.assign(_,A),n.additionQuery&&(typeof n.additionQuery=="function"?Object.assign(_,n.additionQuery.call(null)):Object.assign(_,n.additionQuery));try{g.value=!0;const b=await f.post(H,_);b.isSuccess&&b.value!=null?(w=!1,B(b.value)):c.error(a(b.errorMessage||"Error"))}catch(b){c.error(b==null?void 0:b.toString())}finally{g.value=!1}}}function y(){const x=d.value;if(x!=null&&x.length){const A=h.value.filter(H=>x.includes(H.__key__));r("searchBack",A,n.config),n.autoClose==!0&&close()}}function k(){n.searchOnMounted&&w&&I(1)}return e.watch(()=>n.config,x=>{x&&(w=!0),V()}),e.onMounted(()=>k()),l({searchPage:I,returnAndClose:y}),(x,A)=>(e.openBlock(),e.createElementBlock("div",nc,[e.createVNode(Ke,{ref_key:"searchFormRef",ref:m,cols:2,"search-items":x.config.searchFields},null,8,["search-items"]),e.createElementVNode("div",lc,[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:A[0]||(A[0]=()=>I(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:A[1]||(A[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(We,{class:"flex-grow-1",style:{height:"200px"},columns:x.config.gridColumns,loading:g.value,data:h.value,multiSelect:x.multiSelect,selectedIds:d.value,"onUpdate:selectedIds":[A[2]||(A[2]=H=>d.value=H),A[3]||(A[3]=(H,L)=>x.$emit("resultSelected",H,L))],onDblclickRow:A[4]||(A[4]=H=>x.$emit("searchBack",[H]))},null,8,["columns","loading","data","multiSelect","selectedIds"]),e.createVNode(e.unref(u.NPagination),{page:i.value,"onUpdate:page":[A[5]||(A[5]=H=>i.value=H),O],"page-count":s.value,"show-quick-jumper":"",style:{"align-self":"self-end"}},null,8,["page","page-count"])]))}}),rc={key:0,class:"flex-column flex-grow-1"},ac={class:"flex-row",style:{"align-items":"center"}},sc={style:{"margin-left":"0.5em"}},ic={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}=Y(),a=e.ref(void 0);let c=!0;const f=e.ref([]);function m(h,d){f.value=d??[]}function i(h){h&&h.length&&n("searchBack",h,o.config)}function s(){f.value&&f.value.length&&(n("searchBack",f.value,o.config),o.autoClose==!0&&g())}function g(){n("update:show",!1)}return e.watch(()=>o.config,h=>{h&&(c=!0)}),e.watch(a,()=>{var h;o.searchOnMounted&&c&&(c=!1,(h=a.value)==null||h.searchPage(1))}),e.watch(()=>o.show,h=>{var d;h&&o.searchOnMounted&&c&&(c=!1,(d=a.value)==null||d.searchPage(1))}),(h,d)=>(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:d[0]||(d[0]=()=>g())},{header:e.withCtx(()=>[e.createElementVNode("div",ac,[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1}),e.createElementVNode("span",sc,e.toDisplayString(e.unref(r)(h.title)),1)])]),action:e.withCtx(()=>[e.createElementVNode("div",ic,[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",rc,[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:i},null,8,["config","multi-select","auto-close","addition-query"])])):e.createCommentVNode("",!0)]),_:1},8,["show","style"]))}}),cc={style:{"margin-bottom":"12px","min-height":"100px"}},zt=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}=Y(),a=u.useMessage(),c=u.useLoadingBar(),f=e.inject("axios"),m=ie(),i=e.reactive({}),s=e.ref(!1),g=e.ref(new Array),h=e.ref(!1),d=e.ref(void 0),w=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(h.value)return a.warning("Is uploading..."),!1;let y=typeof o.action=="function"?o.action.call(void 0):o.action;if(y&&o.templateCode&&(y=U(y,{templateCode:o.templateCode})),(k=g.value)!=null&&k.length&&y){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(A=>A.status=="pending"||A.status=="error").map(A=>O(A,y));await Promise.all(x),g.value.every(A=>A.status=="finished")&&(g.value.length=0,a.success(r("Upload Success.")),s.value=!1)}catch(x){d.value=(x==null?void 0:x.toString())||r("Error")}finally{h.value=!1}}}async function O(y,k){const x=new FormData;x.append("file",y.file);const A={timeout:o.timeout||1e3*60*10,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:L=>{y.percentage=Math.round(L.loaded*100/L.total)}};y.percentage=0,y.status="uploading";let H=k;o.additionParams&&(H=U(k,o.additionParams)),i&&(H=U(H,i));try{const L=await f.post(H,x,A);L.isSuccess?(y.status="finished",n("uploaded",L.value),n("update:show",!1)):(y.status="error",y.errorMessage=L.errorMessage,d.value=r(L.errorMessage||"Error"))}catch(L){y.status="error",y.errorMessage=L==null?void 0:L.toString(),d.value=(L==null?void 0:L.toString())||r("Error")}}async function I(){const y=w.value;if(y)try{c.start(),await ue(y)}catch(k){a.error(await m.getHttpErrorMessage(k,"Error"))}finally{c.finish()}}return e.watch(()=>o.show,()=>{d.value=void 0,g.value=[]}),(y,k)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:y.show,"onUpdate:show":k[3]||(k[3]=x=>y.$emit("update:show",x)),preset:"card",title:e.unref(r)(y.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:y.disabled||!y.action||h.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ki))]),_: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(()=>[w.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,style:{"min-width":"100px"},onClick:I},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(cn))]),_: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]=()=>y.$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:y.multiple,"default-upload":!1,"file-list":g.value,"onUpdate:fileList":k[0]||(k[0]=x=>g.value=x),accept:y.accept,disabled:!y.action,"show-retry-button":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NUploadDragger),null,{default:e.withCtx(()=>[e.createElementVNode("div",cc,[e.createVNode(e.unref(u.NIcon),{size:"48",depth:3},{default:e.withCtx(()=>[e.createVNode(e.unref(ms))]),_: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(y.$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-18129d6e"]]),$t=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}=Y(),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]=g=>a.value=g),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"]))}}),dc={class:"flex-column gap05"},fc={key:0,class:"flex-row",style:{"align-items":"center","justify-content":"space-between",gap:"0.25em","margin-bottom":"1em"}},uc={style:{display:"grid","grid-template-columns":"auto 1fr",gap:"0.5em","align-items":"center"}},pc={class:"flex-row gap05",style:{"justify-content":"space-between"}},In=200,mc=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}=Y(),a=ie(),c=At(["2E2466DDD34847C8B33460E4277A6528"]),f=ce.useRouter(),m=e.ref(o.pageSize),i=e.ref(!1),s=e.ref(void 0),g=e.ref(void 0),h=e.ref(!1),d=L=>L?L.map((T,j)=>({columnId:T.name,title:T.title?r(T.title):r(v(T.name)),visible:!0,sortIndex:j})).sort((T,j)=>T.sortIndex-j.sortIndex):[],w=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:w.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(In,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)}})},O=()=>{var j;const L=(j=s.value)==null?void 0:j.$el,T=L==null?void 0:L.querySelector("tbody.n-data-table-tbody");T&&w&&Yt.useDraggable(T,w,{animation:150,ghostClass:"draging-ghost",handle:".drag-sorting-handle",onUpdate:()=>{const _=w.value;for(let b=0;b<_.length;b++)_[b].sortIndex=b;console.log(w.value)}})},I=L=>{h.value=!1,g.value&&(g.value.customTitle=L)},y=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:()=>{g.value=L,h.value=!0}},{default:()=>e.h(u.NIcon,{size:16},{default:()=>e.h(wi)})})]),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(rn):e.h(ln)})}),x=()=>{var T;const L={dataGridId:o.gridId,pageSize:o.pageSize,columns:(T=o.gridColumns)==null?void 0:T.map(j=>({columnId:j.name,sortIndex:j.sortIndex,visible:j.visible,title:j.title}))};L.dataGridId&&a.post({url:"/api/core/DataGrids/getOrCreate",data:L,success:j=>{j&&(f.push({name:"DataGrid",params:{dataGridId:j}}),n("close"))}})},A=()=>{var T;const L={dataGridId:o.gridId,pageSize:o.pageSize,columns:(T=o.gridColumns)==null?void 0:T.map(j=>({columnId:j.name,sortIndex:j.sortIndex,visible:j.visible,title:j.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:j=>{j&&(f.push({name:"DataGrid",params:{dataGridId:j}}),n("close"))}})},H=[{title:r("Name"),key:"title",render:y},{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(un)})},{key:"empty",width:20,fixed:"right"}];return e.watch(()=>o.gridColumns,()=>w.value=d(o.gridColumns)),e.watch(w,()=>O()),e.onMounted(()=>{setTimeout(()=>{O()},500),c.checkOnce(L=>{i.value=L["2E2466DDD34847C8B33460E4277A6528"]})}),(L,T)=>{var j;return e.openBlock(),e.createElementBlock("div",dc,[i.value?(e.openBlock(),e.createElementBlock("div",fc,[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(ei))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Config System Default")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:A},{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:w.value,"max-height":"60vh",size:"small"},null,8,["data"]),e.createElementVNode("div",uc,[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.value=_),max:In,min:1,style:{"max-width":"200px"}},null,8,["value"])]),e.createVNode($t,{show:h.value,"onUpdate:show":T[1]||(T[1]=_=>h.value=_),value:((j=g.value)==null?void 0:j.customTitle)??"",title:e.unref(r)("Custom Title"),clearable:"","onUpdate:value":I},null,8,["show","value","title"]),e.createElementVNode("div",pc,[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})])])}}}),hc=t=>{const l=u.useModal(),{t:o}=Y(),n=ie(),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(mc,{gridId:i,pageSize:m.pageSize,gridColumns:m.gridColumns,class:"flex-grow-1",onClose:()=>s.destroy(),onReset:()=>{var g;(g=t.onReset)==null||g.call(null),s.destroy()},"onUpdate:pageSize":g=>{var h;g>0&&((h=t.onPageSizeChanged)==null||h.call(null,g))},"onUpdate:config":g=>{var h;(h=t.onConfigChanged)==null||h.call(null,g),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)}})}}},gc={class:"flex-column flex-grow-1",style:{gap:"0.25em"}},yc={key:0,class:"flex-row",style:{"justify-content":"space-between"}},wc={style:{"margin-left":"8px"}},Cc={style:{display:"flex"}},kc={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:{},loadingTimeout:{}},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}=Y(),c=e.inject("axios"),f=e.ref(Array()),m=u.useDialog(),i=u.useMessage(),s=u.useLoadingBar(),g=ce.useRouter();let h=[];const d=e.ref([]),w=e.ref([]),B=e.ref([]);let V=1;const O=e.ref(1),I=e.ref(0),y=e.ref(0),k=e.ref(n.pageSize),x=e.ref(!0),A=e.ref(!1),H=e.ref(!1),L=e.ref(""),T=e.computed(()=>{var p;return!!n.searchAction&&!!((p=B.value)!=null&&p.length)}),j=e.computed(()=>T.value&&!n.getListAction),_=e.ref(!1),b=e.computed(()=>j.value||_.value),M=e.ref(!1),R=e.ref(null),$=e.ref(null),G=e.ref(new Array),E=e.ref(!1),K=e.ref(void 0),X=e.ref(void 0),ee=e.ref(void 0),ne=e.ref(!1),se=e.ref(n.readOnly),W=e.ref(a("Property")),te=e.ref(!1),Be=e.ref(!1),Ve=e.ref([]),Ot=e.ref(Pt("page")),Jn=e.ref(fd()),jt=e.ref(void 0),me=e.ref([]),Me=e.ref(void 0),Qe=e.ref(!1);let ye;const Un=e.ref(void 0),he=e.ref(void 0),we=e.ref(void 0);let $e=[],De=0;const dd=e.ref({width:ud(n.modalColumns)});function fd(){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 Pt(p){return n.exportRanges&&n.exportRanges.length&&!n.exportRanges.includes(p)?n.exportRanges[0]:p}function ud(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 h){let N;if(typeof C=="string")N=C;else if(Ee(C))N=C.name;else continue;N&&!(N in p)&&(p[N]=null)}}function vn(p){if(p){r("beforeRenderPage",{data:p});const N=p.rows;N.forEach(z=>Xe(z)),f.value=N,r("update:data",f.value),y.value=p.totalRecords||0,I.value=p.pageCount||1,O.value=p.pageIndex+1,x.value=!0}}function el(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),I.value=1,O.value=1,x.value=!1}}async function fe(p){var C,N;if(!(A.value||n.disabled)&&n.getListAction){const z={pageSize:k.value,pageIndex:p},F=(C=L.value)==null?void 0:C.trim();if(n.quickSearch&&F&&(z.searchWords=F),n.additionKeys&&Object.assign(z,n.additionKeys),n.parentKey&&!re(z))return;(he.value||n.defaultSortBy)&&(z.sortBy=he.value??n.defaultSortBy,z.sortDirection=we.value??n.defaultSortDirection);try{A.value=!0;let D=n.getListAction;typeof D=="function"&&(D=D.call(void 0));const Z={};n.loadingTimeout!=null&&(Z.timeout=n.loadingTimeout);const P=U(D,z),Q=await c.get(P,Z);Q!=null&&Q.isSuccess&&Q.value?(De++,Q.value&&(Array.isArray(Q.value)?el(Q.value):vn(Q.value))):i.error(a((Q==null?void 0:Q.errorMessage)??((N=Q==null?void 0:Q.value)==null?void 0:N.toString())??"Error"))}catch(D){i.error((D==null?void 0:D.toString())??a("Error")),console.error(D)}finally{A.value=!1}}}function Re(p){if(!n.disabled)if(b.value&&ye){const C=Object.assign({},ye);C.sortBy=he.value,C.sortDirection=we.value,Gt(C)}else p!=null?fe(p):fe(O.value-1)}function Ft(){fe(0)}function pd(){L.value="",fe(0)}function md(p){if(n.additionKeys)for(const C in n.additionKeys){const N=n.additionKeys[C];N!=null&&(p[C]=N)}}function tl(){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 re(p){if(n.verifyParentKey&&tl()==!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 Ht(){var C;if(n.disabled)return;const p=(C=R.value)==null?void 0:C.pickValues();if(p&&n.searchAction){const N={};Object.assign(N,p),md(N),N.pageSize=k.value,N.pageIndex=0,N.sortBy=he.value??n.defaultSortBy,N.sortDirection=we.value??n.defaultSortDirection,N.groupBy=jt.value,Gt(N)}}async function Gt(p){if(!A.value)try{A.value=!0;let C=n.searchAction;if(typeof C=="function"&&(C=C.call(void 0,p)),!C)return;const N={};if(!re(N))return;C=U(C,N);const z={};n.loadingTimeout!=null&&(z.timeout=n.loadingTimeout);const F=await c.post(C,p,z);F.isSuccess&&F.value!=null?(De++,ye=p,r("searchReturn",{data:F.value,query:p,action:C}),Array.isArray(F.value)?el(F.value):vn(F.value)):i.error(a(F.errorMessage||"Error"))}catch(C){i.error(C==null?void 0:C.toString())}finally{A.value=!1}}function ol(p,C){const N={};if(re(N)){if(typeof n.keys=="string"?N[n.keys]=p[n.keys]:n.keys.forEach(F=>N[F]=p[F]),Array.isArray(n.detailsKeys))n.detailsKeys.map(F=>F.toString()).forEach(F=>N[F]=p[F]);else if(typeof n.detailsKeys=="object"){const F=n.detailsKeys;for(const D in F){var z=F[D];z&&(N[D]=p[z])}}else typeof n.detailsKeys=="function"?n.detailsKeys.call(null,N):n.detailsKeys&&(N.id=p[n.detailsKeys]);if(n.detailsPageName)g.push({name:n.detailsPageName,params:N});else if(n.detailsPage)if(typeof n.detailsPage=="function"){const F=n.detailsPage(p,C);(typeof F=="string"||typeof F=="object")&&g.push(F)}else g.push({path:n.detailsPage,query:N})}}async function Kt(p,C){var N;if(!n.disabled)if(n.getEntityAction){const z={};if(n.additionKeys&&Object.assign(z,n.additionKeys),!re(z))return;typeof n.keys=="string"?z[n.keys]=p[n.keys]:n.keys.forEach(F=>z[F]=p[F]);try{let F=n.getEntityAction;typeof F=="function"&&(F=F.call(void 0,p,C));const D={};n.loadingTimeout!=null&&(D.timeout=n.loadingTimeout);const Z=U(F,z),P=await c.get(Z,D);P.isSuccess&&P.value!=null?Je(P.value,n.readOnly||!n.saveAction||!n.allowEdit?"view":"edit"):i.error(a((P==null?void 0:P.errorMessage)??((N=P==null?void 0:P.value)==null?void 0:N.toString())??"Error"))}catch(F){i.error((F==null?void 0:F.toString())??a("Error")),console.error(F)}}else Je(p,n.readOnly||!n.saveAction||!n.allowEdit?"view":"edit")}function Wt(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:()=>{hd(p,C)}})}async function hd(p,C){var N;if(n.deleteAction&&n.keys.length)try{const z={};if(n.additionKeys&&Object.assign(z,n.additionKeys),!re(z))return;typeof n.keys=="string"?z[n.keys]=p[n.keys]:n.keys.forEach(Q=>z[Q]=p[Q]);const F=p.__key__;let D=n.deleteAction;typeof D=="function"&&(D=D.call(void 0,p,C));const Z=U(D,z);let P;if(n.deleteMethod=="POST"?P=await c.post(Z):P=await c.delete(Z),P.isSuccess){let Q=f.value.indexOf(p);if(Q>-1&&(f.value.splice(Q,1),i.success(a("The data has been deleted."))),G.value&&(Q=G.value.findIndex(q=>q==F),Q>-1)){G.value.splice(Q,1);const q=(N=f.value)==null?void 0:N.filter(Od=>G.value.includes(Od["__key__]"]));r("update:selectedIds",G.value,q),G.value.length?r("update:selectedId",G.value[0],q!=null&&q.length?q[0]:void 0):r("update:selectedId",void 0,void 0)}}else i.error(a(P.errorMessage||"Error"))}catch(z){console.error(z),i.error(z==null?void 0:z.toString())}}function gd(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:()=>{yd(p)}})}async function yd(p){if(n.deleteBatchAction&&p.length)try{const C={ids:p.join()};if(n.additionKeys&&Object.assign(C,n.additionKeys),!re(C))return;let N=n.deleteBatchAction;typeof N=="function"&&(N=N.call(void 0));const z=U(N,C);let F;if(n.deleteMethod=="POST"?F=await c.post(z):F=await c.delete(z),F.isSuccess){for(const D of p){const Z=f.value.findIndex(P=>P.__key__==D);Z>-1&&f.value.splice(Z,1)}G.value=G.value.filter(D=>!p.includes(D)),i.success(a("The data has been deleted."))}else i.error(a(F.errorMessage||"Error"))}catch(C){i.error(C),console.error(C==null?void 0:C.toString())}}function nl(){if(G.value.length){const p=f.value.find(C=>C.__key__==G.value[0]);p&&Kt(p,f.value.indexOf(p))}}function ll(){if(G.value.length>1&&n.deleteBatchAction)gd(G.value);else if(G.value.length){const p=f.value.find(C=>C.__key__==G.value[0]);p&&Wt(p,f.value.indexOf(p))}}function Je(p,C){const N={method:C,original:p,value:yn(p,d.value)};switch(r("beforeShow",N),ee.value=p,K.value=N.value,X.value=C,ne.value=!0,se.value=C!="create"&&C!="edit",C){case"create":W.value=a("New");break;case"edit":W.value=a("Edit");break;default:W.value=a("Property");break}}function rl(){ee.value=void 0,K.value=void 0,X.value=void 0,ne.value=!1,W.value=a("Property")}async function Zt(){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),!re(z))return;N=U(N,z);try{const F={};n.loadingTimeout!=null&&(F.timeout=n.loadingTimeout);const D=await c.get(N,F);D!=null&&D.isSuccess&&D.value?Je(D.value||{},"create"):i.error(a((D==null?void 0:D.errorMessage)??((p=D==null?void 0:D.value)==null?void 0:p.toString())??"Error"))}catch(F){i.error(a((F==null?void 0:F.toString())??"Error")),console.error(F)}}else{const C=hn(d.value);Je(C,"create")}}async function wd(p,C){var F;if(n.readOnly||n.disabled)return;const N=Me.value;if(!N||N.searchConfig!=C||!N.actionUrl)return;let z;if(N.dataBuilder)z=N.dataBuilder(p);else{let D;if(N.keyPicker?D=N.keyPicker(p):D=p.map(Z=>Z.id),!D||!D.length)return;z={},z[N.keyName||"ids"]=D}if(z){let D=N.actionUrl;n.additionKeys&&Object.assign(z,n.additionKeys);const Z={};re(Z)&&(D=U(D,Z),Object.assign(z,Z));try{const P=await c.post(D,z);if(P.isSuccess){if(P.value){for(const q of P.value)Ue(q);const Q=P.value.map(q=>qe(q));(F=$.value)==null||F.selectRows(Q),Qe.value=!1}}else i.error(a(P.errorMessage||"Error"))}catch(P){i.error(a((P==null?void 0:P.toString())||"Error")),console.error(P)}}}function al(p){Me.value=p,Qe.value=!0}function Cd(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 kd(){if(n.readOnly||n.disabled)return;const p=d.value;if(!p||!p.length)return;const C=X.value;if(C!="create"&&C!="edit")return;const N=K.value,z=ee.value;if(N&&z){const F=Object.assign({},z);for(let D of p){if(D.readonly==!0||Array.isArray(D.readonly)&&D.readonly.includes(C))continue;let Z=Fe(N[D.name],D.dataType,D.role);F[D.name]=Z}if(r("commitEdit",{data:F,current:N,original:z,method:C}),n.beforeSave&&n.beforeSave(F,C)===!1)return;Cd(F)?sl({data:F,original:z,method:C}):i.error(a("Form validation failed."))}}async function sl(p){var C;if(!(n.readOnly||n.disabled||!n.saveAction))try{let N;const z={};if(n.additionKeys)for(const Q in n.additionKeys)n.additionKeys[Q]!=null&&(p.data[Q]=n.additionKeys[Q]);const F={};if(!re(F))return;if(Object.assign(p.data,F),n.enctype=="multipart/form-data"){N=new FormData;const Q=Object.keys(p.data);for(const q of Q)p.data[q]&&N.set(q,p.data[q]);z["Content-Type"]="multipart/form-data"}else N=p.data,z["Content-Type"]="application/json;charset=utf-8";let D=n.saveAction;typeof D=="function"&&(D=D.call(void 0));let Z=U(D,F);H.value=!0;const P=await c.post(Z,N,{headers:z});if(P.isSuccess){if(i.success(a("The data is saved.")),P.value){p.method=="create"?Ue(P.value):p.method=="edit"&&il(P.value),(C=$.value)==null||C.selectRow(qe(P.value)),p.method=="create"&&n.chainCreating?Zt():rl();try{r("saved",{value:P.value,method:p.method})}catch(Q){console.error("emit(saved) fail."+(Q==null?void 0:Q.toString()))}}}else i.error(a(P.errorMessage||"Error")),P.errors&&bd(d.value,P.errors)}catch(N){i.error((N==null?void 0:N.toString())||a("Error")),console.error(N)}finally{H.value=!1}}function bd(p,C){if(p&&p.length)for(const N of C){const z=p.find(F=>F.name.toLowerCase()==N.key.toLowerCase());z&&(z.validationStatus="error",z.errorMessage=N.value)}}function Ue(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 il(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 Nd(p){if(b.value&&ye){const C=Object.assign({},ye);C.pageIndex=Math.max(0,p-1),Gt(C)}else p>0?fe(p-1):fe(0)}function xd(p){p&&(k.value=p)}function Sd(p,C){G.value=p,r("update:selectedIds",p,C),r("update:selectedId",p.length?p[0]:void 0,C.length?C[0]:void 0)}async function Id(p,C){n.exportAction?await Bd(p,C)&&(te.value=!1):n.dataExchangeCode&&(dl(p,C),te.value=!1)}function cl(p,C,N){const z={outputType:p,dataRange:C,searchArgs:JSON.stringify(ye)};if(n.importTemplateCode&&(z.templateCode=n.importTemplateCode),!ye&&(n.additionKeys||n.parentKey)){const F={pageSize:k.value,pageIndex:O.value,sortBy:he.value,sortDirection:we.value};n.additionKeys&&Object.assign(F,n.additionKeys),re(F),z.searchArgs=JSON.stringify(F)}switch(N&&Object.assign(z,N),C){case"selection":if(!G.value||!G.value.length)throw a("Please select the rows to be exported.");z.selectedKeys=G.value;break;case"page":z.pageSize=k.value,z.pageIndex=Math.max(0,O.value-1);break}return z}async function Bd(p,C){let N=n.exportAction;if(typeof N=="function"&&(N=N.call(void 0)),N){try{if(!tl())return console.error("Invalid parent key."),!1;const z=cl(p,C,n.exportOptions);re(z),s.start(),N=U(N,z),await ue(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 Vd(){n.importAction&&(E.value=!0)}async function Md(){const p=n.importTemplateCode;if(p){const C=`/api/core/DataExchangeTemplates/ImportTemplate?templateCode=${p}`;try{s.start(),await ue(C)}finally{s.finish()}}}async function dl(p,C,N=!1){var Q;const z=n.dataExchangeCode;if(!z)return;if(C.toLowerCase()=="empty"){const q=`/api/core/dataExchange/importTemplate?templateCode=${z}&engineName=${p}`;try{s.start(),await ue(q)}finally{s.finish()}return}const F={name:z,engineName:p,dataRange:C};n.importTemplateCode&&(F.templateCode=n.importTemplateCode);const D={pageSize:k.value,pageIndex:O.value-1};switch(C.toLowerCase()){case"empty":D.pageSize=0,D.pageIndex=0;break;case"all":D.pageSize=2e3,D.pageIndex=0;break}if(!re(D)){console.error("Invalid parent key.");return}let Z=n.exportAction||n.getListAction;typeof Z=="function"&&(Z=Z.call(void 0));let P=Z;if(N)try{const q=await c.post("/api/core/tempData/add",{value:JSON.stringify(F)});if(q.isSuccess){if(D.exportOptionId=q.value,P){P=U(P,D);try{s.start(),await ue(P)}finally{s.finish()}}}else i.error((q==null?void 0:q.errorMessage)??((Q=q==null?void 0:q.value)==null?void 0:Q.toString())??a("Error"))}catch(q){i.error((q==null?void 0:q.toString())??a("Error")),console.error(q)}else if(D.exportOption=btoa(JSON.stringify(F)),P){P=U(P,D);try{s.start(),await ue(P)}finally{s.finish()}}}function fl(p){if(p)switch(p){case"menu_export_action":G.value&&G.value.length?Ot.value=Pt("selection"):Ot.value=Pt("page"),te.value=!0;break;case"menu_export_template_action":Md();break;case"menu_import_action":Vd();break;case"menu_export":te.value=!0;break;case"menu_export_template":dl("Excel","Empty");break;case"menu_import":break;default:{const C=$e.find(N=>N.key==p);C&&ul(C)}break}}function ul(p){var z;const C=G.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 Td(p){const C=[];n.exportAction&&C.push({label:a("Export")+"…",key:"menu_export_action",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(dn)})}),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(fn)})}),n.dataExchangeCode&&(C.push({label:a("Export")+"…",key:"menu_export",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(dn)})}),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(fn)})}))),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=kt(N.icon):N.renderIcon&&(z.icon=N.renderIcon),C.push(z)})),Ve.value=C}const ve=hc({gridId:n.name,onConfigChanged:p=>pl(p),onPageSizeChanged:p=>k.value=p||n.pageSize,onReset:()=>Ad});function pl(p){et(),p!=null&&p.sortColumns&&(he.value=p==null?void 0:p.sortColumns,we.value=n.defaultSortDirection??"Asc"),k.value=p!=null&&p.pageSize?p.pageSize:n.pageSize,Be.value=!1}const Ad=()=>{et(),k.value=n.pageSize},Ed=()=>{n.name&&ve.showConfigModal({gridId:n.name,gridColumns:w.value,pageSize:k.value})};function _d(p,C){var N;for(const z of p)Ue(z);if(C){const z=p.map(F=>qe(F));(N=$.value)==null||N.selectRows(z)}}function ml(p){if(!p)return;const C=$e==null?void 0:$e.find(N=>N.key==p);C&&ul(C)}function Ld(p){var C,N;Array.isArray(p)?(he.value=(C=p[0].columnKey)==null?void 0:C.toString(),we.value=p[0].order=="ascend"?"Asc":"Desc"):p&&(he.value=(N=p.columnKey)==null?void 0:N.toString(),we.value=p.order=="ascend"?"Asc":"Desc"),Re()}function hl(){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));$e=p,zd(p);const C=p.filter(N=>N.group=="import"||N.group=="export");Td(C)}function zd(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:kt(N.icon)}:N.renderIcon?{label:N.label,key:N.key,icon:N.renderIcon()}:{label:N.label,key:N.key});me.value=C}else me.value=[]}function gl(){const p={};return n.parentKey&&re(p),n.additionKeys&&Object.assign(p,n.additionKeys),p}function yl(){const p=Object.assign({},gl(),n.importOptions);Un.value=Object.keys(p).length?p:void 0}function $d(){j?M.value=!M.value:M.value=!1}const Dd=p=>p.map(C=>typeof C=="string"?{name:C,title:v(C)}:Object.assign({},C)),Rd=(p,C)=>{var F;C.forEach(D=>{D.sortIndex=-1});const N=["left","center","right"];for(const D of p){const Z=C.find(P=>P.name==D.columnId);if(Z){Z.visible=D.visible,Z.sortIndex=D.sortIndex;const P=(F=D.alignment)==null?void 0:F.toLowerCase();P&&N.includes(P)&&(Z.align=P),D.title&&(Z.title=D.title),D.suffix&&(Z.suffix=D.suffix),D.prefix&&(Z.prefix=D.prefix),D.renderTemplate&&(Z.template=D.renderTemplate),Z.cssStyle=Yo(Z.cssStyle,D.cssStyle),Z.className=Qo(Z.className,D.cssClass)}}let z=Math.max(...C.filter(D=>D.sortIndex!=null&&D.sortIndex>=0).map(D=>D.sortIndex))||0;for(const D of C.filter(Z=>Z.sortIndex==null||Z.sortIndex<0))D.sortIndex=z++;C.sort((D,Z)=>(D.sortIndex||0)-(Z.sortIndex||0))},et=p=>{h=Dd(p??n.columns??[]);const C=ve.getConfig();C!=null&&C.columns&&Rd(C.columns,h),d.value=wn(h,a),w.value=Ct(h),B.value=Cn(h,a)},wl=()=>{n.autoLoad!=!1&&(j.value?n.autoLoad&&Ht():fe(0))};return e.onMounted(()=>{yl(),ve.hasGridId()?ve.loadGridConfig(()=>{wl()}):(et(),wl()),hl()}),e.watch(e.computed(gl),(p,C)=>{JSON.stringify(p)!=JSON.stringify(C)&&(yl(),n.autoLoad!=!1&&De>0&&Re())}),e.watch(()=>n.extendedMenus,()=>hl()),e.watch(()=>n.parentValue,()=>{(n.autoLoad!=!1||De>0)&&fe(0)}),e.watch(()=>n.getListAction,(p,C)=>{C&&(n.autoLoad!=!1||De>0)&&fe(0)}),e.watch(k,(p,C)=>{if(p&&C){var N=void 0,z=O.value,F=y.value;if(z>0&&F){const D=Math.ceil(F/p);D<z&&(N=Math.max(0,D-1))}Re(N)}}),e.watch(()=>n.columns,p=>et(p)),l({reloadPage:Re,addRow:Zt,addBatch:al,editSelectedRow:nl,deleteSelectedRows:ll,saveData:sl,doQuickSearch:Ft,clearQuickSearch:pd,advancedSerach:Ht,checkedRowKeys:G,editRow:Kt,deleteRow:Wt,showDetails:ol,insertRow:Ue,updateRow:il,appendRows:_d,buildExportArgs:cl}),(p,C)=>{var N,z,F,D,Z;return e.openBlock(),e.createElementBlock("div",gc,[e.renderSlot(p.$slots,"header"),j.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",yc,[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,P=>(e.openBlock(),e.createBlock(e.unref(u.NButton),{onClick:()=>al(P),disabled:p.readOnly||p.disabled,key:P.id},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#388e3c"},{default:e.withCtx(()=>[e.createVNode(e.unref(as))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)(P.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:Zt,disabled:p.readOnly||p.disabled},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#388e3c"},{default:e.withCtx(()=>[e.createVNode(e.unref(oi))]),_: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:nl,disabled:p.readOnly||p.disabled||!G.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:ll,disabled:p.readOnly||p.disabled||!G.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]=()=>Re()),disabled:p.disabled},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#689f38"},{default:e.withCtx(()=>[e.createVNode(e.unref(ft))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Refresh")),1)]),_:1},8,["disabled"]),e.renderSlot(p.$slots,"suffix-tools"),Ve.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:4,options:Ve.value,disabled:p.disabled,onSelect:fl},{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(Ya))]),_: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),me.value&&me.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:5,options:me.value,disabled:p.disabled,onSelect:ml},{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(dt))]),_: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:L.value,"onUpdate:value":C[1]||(C[1]=P=>L.value=P),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,!b.value]]),e.withDirectives(e.createVNode(e.unref(u.NButton),{title:e.unref(a)("Search"),onClick:C[2]||(C[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,!b.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]=()=>_.value=!_.value)},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(Pa),{key:0})),b.value?(e.openBlock(),e.createBlock(e.unref(Oa),{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:!j.value,onClose:C[8]||(C[8]=()=>_.value=!1)},{header:e.withCtx(()=>[e.createElementVNode("div",{class:"flex-row",style:e.normalizeStyle([{"align-items":"center"},{cursor:j.value?"pointer":"unset"}]),onClick:$d},[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",wc," … ",512),[[e.vShow,M.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:Ht},{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:C[6]||(C[6]=()=>{var P;return(P=R.value)==null?void 0:P.reset()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Reset")),1)]),_:1}),Ve.value.length==1&&j.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,style:{"min-width":"100px"},onClick:C[7]||(C[7]=()=>te.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Export")),1)]),_:1})):e.createCommentVNode("",!0),Ve.value.length>1&&j.value?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:1,options:Ve.value,onSelect:fl},{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"),j.value&&me.value&&me.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:2,options:me.value,onSelect:ml},{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(dt))]),_: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":B.value,ref_key:"searchFormRef",ref:R,"search-args":Jn.value,"onUpdate:searchArgs":C[4]||(C[4]=P=>Jn.value=P),"group-options":p.searchGroupOptions,"group-by":jt.value,"onUpdate:groupBy":C[5]||(C[5]=P=>jt.value=P)},null,8,["search-items","search-args","group-options","group-by"]),[[e.vShow,!M.value]])]),_:3},8,["closable"])),[[e.vShow,b.value]]):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"grid",{data:f.value,columns:w.value,loading:A.value,style:"background-color: chartreuse"},()=>[e.createVNode(We,{ref_key:"dataGridRef",ref:$,data:f.value,columns:w.value,loading:A.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:Kt,onDeleteRow:Wt,onShowDetails:ol,"onUpdate:selectedIds":Sd,onColumnButtonClick:C[9]||(C[9]=(P,Q,q)=>p.$emit("columnButtonClick",P,Q,q)),"onUpdate:sorter":C[10]||(C[10]=P=>Ld(P)),onRowSorting:C[11]||(C[11]=P=>p.$emit("rowSorting",P))},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:O.value,"onUpdate:page":[C[12]||(C[12]=P=>O.value=P),Nd],"item-count":y.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":xd},{suffix:e.withCtx(({startIndex:P,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(P+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:C[13]||(C[13]=()=>Ed())},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(gi))]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.renderSlot(p.$slots,"default"),e.renderSlot(p.$slots,"bottom",{formItems:d.value,currentData:K.value,list:f.value,selectedKeys:G.value}),e.createVNode(e.unref(u.NModal),{class:"custom-card",show:ne.value,"onUpdate:show":C[15]||(C[15]=P=>ne.value=P),preset:"card",draggable:"",style:e.normalizeStyle([dd.value,p.modalStyle]),title:W.value,"close-on-esc":!1,"mask-closable":!1},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[X.value=="create"||X.value=="edit"?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,onClick:kd,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:rl,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",Cc,[e.createElementVNode("div",null,[e.renderSlot(p.$slots,"entity-form-left",{data:K.value,original:ee.value,method:X.value})]),e.createElementVNode("div",kc,[e.renderSlot(p.$slots,"entity-form",{formItems:d.value,data:K.value,original:ee.value,method:X.value},()=>[e.createVNode(Vt,{"form-items":d.value,columns:p.modalColumns,data:K.value,original:ee.value,method:X.value,"group-layout":p.formGroupLayout,"read-only":se.value,onItemChange:C[14]||(C[14]=P=>p.$emit("itemChange",P))},null,8,["form-items","columns","data","original","method","group-layout","read-only"])])]),e.createElementVNode("div",null,[e.renderSlot(p.$slots,"entity-form-right",{data:K.value,original:ee.value,method:X.value})])])]),_:3},8,["show"])]),_:3},8,["show","style","title"]),(N=p.batchAdds)!=null&&N.length?(e.openBlock(),e.createBlock(Lt,{key:2,show:Qe.value,"onUpdate:show":C[16]||(C[16]=P=>Qe.value=P),draggable:"",config:(z=Me.value)==null?void 0:z.searchConfig,title:(F=Me.value)==null?void 0:F.searchTitle,"multi-select":((D=Me.value)==null?void 0:D.singleOne)!=!0,"addition-query":(Z=Me.value)==null?void 0:Z.additionQuery,onSearchBack:wd},null,8,["show","config","title","multi-select","addition-query"])):e.createCommentVNode("",!0),p.importAction?(e.openBlock(),e.createBlock(zt,{key:3,show:E.value,"onUpdate:show":C[17]||(C[17]=P=>E.value=P),draggable:"",action:p.importAction,"addition-params":Un.value,timeout:p.importTimeout,"template-code":p.importTemplateCode},{options:e.withCtx(({options:P})=>[e.renderSlot(p.$slots,"import-options",{options:P})]),_:3},8,["show","action","addition-params","timeout","template-code"])):e.createCommentVNode("",!0),p.dataExchangeCode||p.exportAction?(e.openBlock(),e.createBlock(Tt,{key:4,show:te.value,draggable:"","supported-formats":p.exportFormats,"supported-ranges":p.exportRanges,onClose:C[18]||(C[18]=()=>te.value=!1),onExport:Id,range:Ot.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(Et,{key:5,"grid-id":p.name,draggable:"","grid-columns":w.value,pageSize:k.value,"onUpdate:pageSize":C[19]||(C[19]=P=>k.value=P),show:Be.value,onClose:C[20]||(C[20]=()=>Be.value=!1),"onUpdate:config":pl},null,8,["grid-id","grid-columns","pageSize","show"])):e.createCommentVNode("",!0)])}}}),bc={class:"flex-row gap05",style:{"align-items":"center"}},Vn=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}=Y();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",bc,[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"]))}}),Nc={key:0,style:{"text-align":"right"}},Mn=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}=Y(),a=e.inject("axios"),c=e.ref(!1),f=e.ref([]);let m;const i=h=>{(!m||m!=h)&&(m=h,s(h))},s=async h=>{let d=o.sourceUrl;if(d){const w=o.labelFormatter,B=o.keyField,V=o.labelField,O=o.subLabelField,I=o.insertBlank,y=o.additionalQuery;c.value=!0,f.value=[];try{h&&(d=U(d,{searchWords:h})),y&&(d=U(d,y,!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 A=x.filter(H=>H&&!0).map(H=>{if(typeof H=="string")return{value:H,label:w?w(H):r(H)};{let L=H[V||"label"];if(w&&(L=w(L)),o.prefix&&(L=o.prefix+L),o.suffix&&(L=L+o.suffix),o.i18n&&(L=r(L)),O){let T=H[O];typeof T=="string"&&(w&&(T=w(T)),o.i18n&&(T=r(T)),T&&(L+=" "+T))}return{value:H[B||"value"],label:L,data:H}}});I&&A.splice(0,0,{value:"",label:""}),f.value=A,o.autoSelect&&!o.value&&A.length&&n("update:value",A[0].value,A[0],A[0].data)}}}finally{c.value=!1}}},g=(h,d)=>{var B;const w=(B=f.value.find(V=>V.value==h))==null?void 0:B.data;n("update:value",h,d,w)};return e.watch(()=>o.sourceUrl,()=>s()),e.watch(()=>o.additionalQuery,(h,d)=>{JSON.stringify(d)!=JSON.stringify(h)&&s()}),e.onMounted(()=>s()),(h,d)=>(e.openBlock(),e.createBlock(e.unref(u.NSelect),{value:h.value,remote:"",loading:c.value,options:f.value,filterable:h.filterable,multiple:h.multiple,placeholder:"",disabled:h.readonly,clearable:h.clearable,onSearch:i,"onUpdate:value":g},{action:e.withCtx(()=>[h.filterable?(e.openBlock(),e.createElementBlock("div",Nc,[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"]))}}),xc=e.defineComponent({components:{SearchIcon:yt,LeftIcon:Ss,RightIcon:Bs},props:{sourceList:Object,selectedItems:Object,loading:Boolean,placeholder:{type:String,default:"Search"}},emits:["search","update:selectedItems"],setup(t,l){const{t:o}=Y(),n=e.ref(void 0),r=e.ref(c(t.sourceList)),a=e.ref([]);function c(h){return h?h.map(d=>({isSelected:!1,value:d})):[]}function f(){n.value&&l.emit("search",n.value)}function m(){Lo(a.value,h=>h.isSelected)>0&&l.emit("update:selectedItems",a.value.map(h=>h.value))}function i(){a.value.forEach(d=>d.isSelected=!1);let h=!1;r.value.forEach(d=>{d.isSelected&&!a.value.some(w=>w.value==d.value)&&(a.value.push({value:d.value,isSelected:!1}),h=!0)}),h&&l.emit("update:selectedItems",a.value.map(d=>d.value))}function s(h){h.forEach(d=>d.isSelected=!0)}function g(h){h.forEach(d=>d.isSelected=!d.isSelected)}return e.watch(()=>t.sourceList,h=>r.value=c(h)),{t:o,searchWords:n,searchMaterials:f,source:r,target:a,moveRight:i,moveLeft:m,selectAll:s,inverseSelect:g}}}),Sc={class:"flex-row gap1"},Ic={class:"flex-column flex-grow-1 gap25",style:{width:"100px",height:"400px"}},Bc={class:"flex-row gap1",style:{"justify-content":"flex-end"}},Vc={class:"flex-column gap1",style:{width:"60px","justify-content":"center"}},Mc={class:"flex-column flex-grow-1 gap25",style:{width:"100px",height:"400px"}},Tc={class:"flex-row gap1",style:{"justify-content":"flex-end"}};function Ac(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"),g=e.resolveComponent("n-spin"),h=e.resolveComponent("n-button"),d=e.resolveComponent("right-icon"),w=e.resolveComponent("left-icon");return e.openBlock(),e.createElementBlock("div",Sc,[e.createElementVNode("div",Ic,[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(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,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",Bc,[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",Vc,[e.createVNode(h,{onClick:t.moveRight},{default:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(d)]),_:1})]),_:1},8,["onClick"]),e.createVNode(h,{onClick:t.moveLeft},{default:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(w)]),_:1})]),_:1},8,["onClick"])]),e.createElementVNode("div",Mc,[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",Tc,[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 Tn=oe(xc,[["render",Ac]]),An=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%"}),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 g=r.value.getBoundingClientRect();let h;l.direction==="horizontal"?h=(s.clientX-g.left)/g.width:h=(s.clientY-g.top)/g.height;const d=l.minSize/(l.direction==="horizontal"?g.width:g.height),w=1-d;o.value=Math.max(d,Math.min(w,h))},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,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: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-ca4664e2"]]),En=e.defineComponent({__name:"NumberInputModal",props:{title:{},message:{},value:{},show:{type:Boolean}},emits:["update:show","commit"],setup(t,{emit:l}){const o=t,{t:n}=Y(),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"]))}}),Ec={class:"flex-column"},_n=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 j;const o=t,n=l,{t:r}=Y(),a=ie(),c=e.ref(new Array),f=e.ref(void 0),m=(_,b)=>{for(const M of _){if(M.key==b)return[M];if(M.key!=null&&M.key!=null&&M.children&&!M.isLeaf){const R=m(M.children,b);if(R.length)return R.push(M),R}}return[]},i=(_,b)=>{for(let M=0;M<_.length;M++){const R=_[M];if(R.key==b)return{nodes:_,index:M};if(R.children){const $=i(R.children,b);if($)return $}}return null},s=_=>{const b=m(L.value,_);return b?b.reverse():[]},g=_=>_,h=(_,b=!0)=>{let M=[];if(Array.isArray(_)){const R=(o==null?void 0:o.treeNodeMapper)??g;M=_.map(R)}return b?[{key:o.rootId,label:r(o.rootName),isLeaf:!Array.isArray(M)||M.length==0,children:M}]:M},d=()=>{let _=o.loadTreeAction;_&&(o.additionKeys&&(_=U(_,o.additionKeys)),a.get({url:_,callback:b=>{if(b){const M=h(b);L.value=M,T.value=M.map(R=>R.key)}}}))},w=_=>{const b=L.value;if(b){const M=b.map(R=>R.children?V(R.children):[]);T.value=M.flat()}},B=_=>{const b=L.value;b&&(T.value=b.map(M=>M.key))},V=(_,b)=>{const M=new Array;for(const R of _)if(R.key&&M.push(R.key),R.children){const $=V(R.children);$.length&&M.push(...$)}return M},O=_=>{c.value=_;const b=_.length?_[0]:void 0;n("update:selectedId",b==o.rootId?void 0:b);const M=b?s(b):[];n("update:path",M)},I=_=>e.h("span",null,_.option.label),y=_=>o.iconRender?e.h(u.NIcon,null,{default:()=>{var b;return(b=o.iconRender)==null?void 0:b.call(null,_)}}):_.option.isLeaf?e.h(u.NIcon,null,{default:()=>e.h(sn)}):e.h(u.NIcon,null,{default:()=>e.h(gt)}),k=_=>{!o.moveAction&&!o.sortAction||(_.dropPosition=="before"||_.dropPosition=="after"?_.dragNode.key&&typeof _.node.key&&A(_.dragNode,_.node,_.dropPosition):_.dropPosition=="inside"&&typeof _.dragNode.key=="number"&&typeof _.node.key=="number"&&x(_.dragNode,_.node))},x=(_,b)=>{const M=o.moveAction;if(!M)return;const R=_.key,$=[_.key],G=b.key;!R||!G||_==b||a.post({url:M,data:{menuItemIds:$,targetId:G},successMessage:"Successful operation.",success:()=>{const E=i(L.value,R);E&&(E.nodes.splice(E.index,1),b.children&&b.children.push(_))}})};async function A(_,b,M){const R=o.sortAction;if(!R)return;const $=_.key;let G=b.key;if(!$||!G||$==G)return;const E=i(L.value,$);if(E){if(M=="after"){const K=E.nodes.indexOf(b);if(K>-1&&K<E.nodes.length-1&&(b=E.nodes[K+1],G=b.key,!G||$==G))return}a.post({url:R,data:{menuId:$,nextSiblingId:G},successMessage:"Successful operation.",success:()=>{E.nodes.splice(E.index,1);const K=E.nodes.indexOf(b);K>-1?E.nodes.splice(K,0,_):E.nodes.push(_)}})}}const H=_=>{if(_==null&&(_=o.rootId),c.value.includes(_))return;const b=m(L.value,_);b.length&&(T.value=b.map(M=>M.key),c.value=[_])},L=e.ref(h(o.data??[])),T=e.ref(((j=L.value)==null?void 0:j.map(_=>_.key))??[]);return e.watch(()=>o.additionKeys,()=>d()),e.watch(()=>o.loadTreeAction,()=>d()),e.watch(()=>o.data,_=>{_?L.value=h(_):L.value=[]}),e.watch(()=>o.selectedId,_=>{H(_)}),e.onMounted(()=>{d()}),(_,b)=>(e.openBlock(),e.createElementBlock("div",Ec,[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]=M=>f.value=M)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pn))]),_: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(ft))]),_:1})]),_:1},8,["title"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:b[1]||(b[1]=()=>w()),title:e.unref(r)("Expand All")},{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),{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(an))]),_: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:_.sortAction!=null||_.moveAction!=null,data:L.value,pattern:f.value,"render-label":I,"render-prefix":y,onDrop:k,"selected-keys":c.value,"default-expanded-keys":T.value,"onUpdate:selectedKeys":O},null,8,["draggable","data","pattern","selected-keys","default-expanded-keys"])]))}}),_c=["src"],Ln=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,_c))}}),Lc={class:"flex-column gap05"},zc={key:0},$c={class:"flex-row gap05",style:{"align-items":"center"}},zn=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}=Y(),a=ie(),c=e.ref(!1),f=e.ref(s()),m=e.ref(g()),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 g(){if(o.name){const d=localStorage.getItem(`${o.name}:print-collate`);if(d&&(d=="Collated"||d=="Uncollated"))return d}return"Collated"}function h(){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 w=d.action;w&&(w=U(w,[{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:w,loadingStatus:B=>c.value=B,callback:()=>{c.value=!1,n("update:show",!1)}}))}return(d,w)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{class:"custom-card",show:d.show,preset:"card",style:e.normalizeStyle({width:d.width}),onClose:w[3]||(w[3]=()=>d.$emit("update:show",!1))},{header:e.withCtx(()=>[e.createElementVNode("div",$c,[e.createVNode(e.unref(u.NIcon),{size:"16"},{default:e.withCtx(()=>[e.createVNode(e.unref(is))]),_: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:h,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:w[2]||(w[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",Lc,[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":w[0]||(w[0]=B=>f.value=B),min:"1"},null,8,["value"])]),f.value>1?(e.openBlock(),e.createElementBlock("div",zc,[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":w[1]||(w[1]=B=>m.value=B)},null,8,["value"])])):e.createCommentVNode("",!0)])]),_:3},8,["show","style"]))}}),Dc={key:0,style:{"text-align":"center"}},Rc=["src"],Oc={key:1,style:{"text-align":"center"}},$n=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}=Y(),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",Dc,[e.createElementVNode("img",{src:r.value},null,8,Rc),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",Oc,[e.createVNode(e.unref(u.NEmpty))]))]),_:1},8,["show","title"])}}}),jc={class:"flex-row",style:{"align-items":"center"}},Pc={style:{"margin-left":"0.5em"}},Dn=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}=Y(),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",jc,[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1}),e.createElementVNode("span",Pc,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(Ze,{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 Fc{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 Hc={class:"flex-grow-1 flex-column"},Gc={class:"icon-container"},Kc=["title"],Ye="browse_icon_directory",Rn="page_index",On="search_words",jn=32,Dt=oe(e.defineComponent({__name:"SelectIconBox",emits:["update:selected"],setup(t,{emit:l}){const o=l,{t:n}=Y(),r=ie(),a=e.ref(sessionStorage.getItem(Ye)),c=e.ref(h(void 0)),f=e.ref([]),m=e.ref(1),i=e.ref(0),s=e.ref(!1),g=e.ref(sessionStorage.getItem(On));function h(I){const y=[{name:n("Root"),path:"/"}];if(I){for(;I.startsWith("/")||I.startsWith("\\");)I=I.substring(1);const k=I.split(/[\\/]+/);let x="/";for(const A of k){x+=A;const H={name:A,path:x};y.push(H),x+="/"}}return y}function d(I){I.isDirectory?a.value=I.path:I.path&&o("update:selected",I.path)}function w(){V(0)}function B(I){V(I-1)}function V(I){I=Math.max(0,I);let y=`/api/core/SystemIcons/page?pageSize=${jn}&pageIndex=${I}`;var k=g.value;k&&(y+=`&searchWords=${encodeURIComponent(k)}`);const x=a.value;x&&(y+=`&directory=${encodeURIComponent(x)}`),r.get({url:y,callback:A=>{A&&(f.value=A.rows,i.value=A.totalRecords,m.value=A.pageIndex+1,O(A.pageIndex,x,k))},loadingStatus:A=>s.value=A})}function O(I,y,k){sessionStorage.setItem(Rn,I.toString()),y?sessionStorage.setItem(Ye,y):sessionStorage.removeItem(Ye),k?sessionStorage.setItem(On,k):sessionStorage.removeItem(Ye)}return e.watch(a,I=>{c.value=h(I),V(0)}),e.onMounted(()=>{c.value=h(a.value);let I=Number(sessionStorage.getItem(Rn));V(I||0)}),(I,y)=>(e.openBlock(),e.createElementBlock("div",Hc,[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:w,value:g.value,"onUpdate:value":y[0]||(y[0]=k=>g.value=k)},{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:w,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":[y[1]||(y[1]=k=>m.value=k),B],"item-count":i.value??0,"page-size":jn},{suffix:e.withCtx(({startIndex:k,endIndex:x,itemCount:A})=>[A?(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(A),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",Gc,[(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,Kc)]),_:2},1032,["onClick"]))),256))])]),_:1})]),_:1},8,["show"])]),_:1})]))}}),[["__scopeId","data-v-ff87aac6"]]),Pn=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}=Y(),a=ie(),c=e.ref(i(o.items)),f=e.ref(!1),m=e.ref(o.selectedValue);function i(h){if(h){if(!h.length||typeof h[0]=="object")return h}else return[];const d=[];for(let w of h)typeof w=="string"||typeof w=="number"?d.push({id:w.toString(),code:r(w.toString())}):d.push(w);return d}const s=()=>{if(f.value)return;const h=o.getListAction;if(!h){c.value=[];return}a.get({url:h,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})},g=()=>{m.value&&n("valueSelected",m.value)};return e.onMounted(()=>{o.getListAction&&s()}),e.watch(()=>o.getListAction,()=>{s()}),(h,d)=>(e.openBlock(),e.createBlock(e.unref(u.NSpin),{show:f.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:d[2]||(d[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":d[0]||(d[0]=w=>m.value=w),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,w=>(e.openBlock(),e.createBlock(e.unref(u.NRadio),{key:w[h.keyName],value:w[h.keyName]},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"default",{data:w},()=>[e.createTextVNode(e.toDisplayString(w.code)+" "+e.toDisplayString(w.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:d[1]||(d[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 Fn(t,l){for(let o of t){if(o.guid==l)return o;if(Array.isArray(o.items)){const n=Fn(o.items,l);if(n)return n}}}const Rt=()=>{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 g of r)if(g.isEnabled!==!1)if(g.isSeparator)s||(f.push({type:"divider",key:`_${a}_${i++}`}),s=!0);else{const h=n(g.title),d={key:g.guid,id:g.guid,label:h,disabled:!g.isEnabled,href:g.url,tabBehavior:g.tabBehavior};if(g.items&&g.items.length)d.children=o(n,g.items,g.guid,c);else if(c&&!l(g,h,c))continue;g.guid&&g.icon&&(t[g.guid]={icon:g.icon,color:g.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}},Hn=e.defineComponent({__name:"SideMenu",props:{collapsed:{type:Boolean},currentMenuId:{}},setup(t){const{t:l}=Y(),o=e.inject("axios"),n=Se(),r=/^https?:\/\//i,a=e.ref([]),c=e.ref(void 0),f=Rt(),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 w=d.href.startsWith("~")?d.href.substring(1):d.href;d.id&&(w=U(w,{_menuid:d.id}));let B;return d.tabBehavior=="NewTab"?B="_blank":d.tabBehavior=="NamedTab"&&(B=d.id),r.test(w)?e.h("a",{href:w,target:"_blank"},{default:()=>d.label}):e.h(ce.RouterLink,{to:w,target:B},{default:()=>d.label})}else return typeof d.label=="string"?d.label:""}function g(d){var w,B,V;if(d.key){const O=(w=f.menuLooks[d.key])==null?void 0:w.icon;if(O)return e.h(xe,{path:O,class:"menu-icon"});if((B=d.children)!=null&&B.length){const I=(V=d.key)==null?void 0:V.toString();return I&&a.value.includes(I)?e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(Xs)}):e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(gt)})}else return e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(sn)})}}function h(d){if(d)try{o.post(`/api/core/UserRecentMenus/add?menuId=${encodeURIComponent(d)}`)}catch(w){console.error(w)}}return e.onMounted(()=>{!n.menus&&!n.isLoadingMenu&&n.sessionToken&&n.loadMenus()}),e.watch(()=>n.sessionToken,()=>n.loadMenus()),(d,w)=>{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":g,value:d.currentMenuId,accordion:!0,"onUpdate:expandedKeys":w[0]||(w[0]=O=>a.value=O),"onUpdate:value":h},null,8,["collapsed","options","value"])]),_:1}),e.withDirectives(e.createVNode(V,{style:{width:"250px"},placeholder:e.unref(l)("Search Menu"),clearable:"",onChange:w[1]||(w[1]=O=>c.value=O)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pn))]),_:1})]),_:1},8,["placeholder"]),[[e.vShow,!d.collapsed]])]),_:1},8,["show"])}}}),Wc=["src"],Gn=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}=Y(),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,Wc)):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]=g=>i.$emit("update:value",g)),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]=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(Dt,{"onUpdate:selected":s[1]||(s[1]=g=>m(g))})]),_:1},8,["show","title"])]),_:1}))}}),Zc=e.defineComponent({components:{NButton:u.NButton,NIcon:u.NIcon},props:{title:String,iconColor:String,icon:Object},setup(){const{t}=Y();return{t}}});function Yc(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 Kn=oe(Zc,[["render",Yc]]),Qc=e.defineComponent({name:"TopMenu",components:{NMenu:u.NMenu,NSpin:u.NSpin},setup(){const{t}=Y(),l=e.inject("axios"),o=Se(),n=/^https?:\/\//i,r=Rt(),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 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(ce.RouterLink,{to:g,target:h},{default:()=>s.label})}else return s.label}function m(s){var g,h;if(s.key){const d=(g=r.menuLooks[s.key])==null?void 0:g.icon;return d?e.h(xe,{path:d,class:"menu-icon"}):(h=s.children)!=null&&h.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(g){console.error(g)}}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 Wn=oe(Qc,[["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}=Y(),a=e.ref(new Array),c=e.ref(new Array),f=e.ref(new Array);function m(T,j){for(const _ of T){if(_.key==j)return{node:_,path:[_.key]};if(_.key!=null&&_.key!=null&&_.children&&!_.isLeaf){const b=m(_.children,j);if(b)return{node:b,path:[_.key,...b.path]}}}return null}function i(T,j){for(let _=0;_<T.length;_++){const b=T[_];if(b.key==j)return{nodes:T,index:_};if(b.children){const M=i(b.children,j);if(M)return M}}return null}function s(T){const j=m(a.value,T);return j?j.path:[]}function g(T,j){const _=new Array;for(const b of T)if(b.key&&(!j||j(b.key))&&_.push(b.key),b.children){const M=g(b.children,j);M.length&&_.push(...M)}return _}function h(T){c.value=T}function d(T){f.value=T;const j=T.length?T[0]:null;l.emit("update:selectedId",j);const _=j?s(j):[];l.emit("update:path",_)}function w(T){return t.treeNodeMapper?t.treeNodeMapper.call(void 0,T):{key:T.id,label:T.title,isLeaf:!T.hasSubitems}}async function B(T){const j=t.childrenAction,_=t.parentKey;if(!(!j||!_))try{const b=U(j,{parentKey:_,parentId:T}),M=await n.get(b);if(M.isSuccess&&M.value!=null)return M.value.map(w);o.error(r(M.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 O(T){const j=T.key;if(j!=null){if(T.children){const b=c.value,M=g(T.children,R=>b.includes(R));c.value=c.value.filter(R=>!M.includes(R))}const _=await B(j);_&&(T.isLeaf=!_.length,T.children=_.length?_:void 0)}}function I(T){return e.h("span",null,T.option.label)}function y(T){if(!T.option.isLeaf)return e.h(u.NIcon,null,{default:()=>e.h(gt)})}function k(T){const j=T.option.key;if(j!=null&&f.value.includes(j))return e.h(u.NButton,{text:!0,onClick:_=>{_.stopPropagation(),O(T.option)}},{default:()=>e.h(u.NIcon,null,{default:()=>e.h(ft)})})}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"&&A(T.dragNode,T.node))}async function A(T,j){const _=t.moveAction;if(!_)return;const b=T.key,M=[T.key],R=j.key;if(!(!b||!R||T==j))try{const $=await n.post(_,{menuItemIds:M,targetId:R});if($.isSuccess){o.success(r("Successful operation."));const G=i(a.value,b);G&&(G.nodes.splice(G.index,1),j.children?j.children.push(T):O(j))}else o.error(r($.errorMessage||"Error"))}catch($){console.log($),o.error(($==null?void 0:$.toString())||"Error")}}async function H(T,j,_){const b=t.sortAction;if(!b)return;console.log(`dragNode: ${T.key} ${T.label}, targetNode: ${j.key} ${j.label}, dropPosition: ${_}`);const M=T.key;let R=j.key;if(!M||!R||M==R)return;const $=i(a.value,M);if($){if(_=="after"){const G=$.nodes.indexOf(j);if(G>-1&&G<$.nodes.length-1&&(j=$.nodes[G+1],R=j.key,!R||M==R))return}try{const G=await n.post(b,{menuId:M,nextSiblingId:R});if(G.isSuccess){o.success(r("Successful operation.")),$.nodes.splice($.index,1);const E=$.nodes.indexOf(j);E>-1?$.nodes.splice(E,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 j;if(T.length){let _=(j=a.value)==null?void 0:j.find($=>$.key==T[0]);_==null&&(_={key:T[0],label:r(t.rootName||"Root"),isLeaf:!1},a.value.push(_));let b=T[0],M=_;for(let $=1;$<T.length-1&&M;$++)if(M.children||(M.children=await B(b)),M.children){const G=T[$];M=M.children.find(E=>E.key==G),b=G}const R=c.value;for(let $=0;$<T.length-1;$++)R.includes(T[$])||R.push(T[$]);c.value=R,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:h,loadChildren:O,dragDrop:x,renderLabel:I,renderPrefix:y,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 Zn=oe(Xc,[["render",Jc]]),Uc={style:{margin:"0 20px 10px 0",cursor:"pointer"}},vc={class:"user-name-box"},ed={class:"user-name-label"},Yn="/img/user_avatar.png",Qn=oe(e.defineComponent({__name:"UserMenu",setup(t){var d;const l=ce.useRouter(),{t:o}=Y(),n=u.useDialog(),r=Ne(),a=Se(),c=lt(),f=e.computed(()=>a.userInfo),m=e.ref(!1),i=e.computed(()=>{var w,B;return(w=a.userInfo)!=null&&w.avatar?`/api/core/avatar?id=${(B=a.userInfo)==null?void 0:B.avatar}`:Yn});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 g(w){switch(w){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:(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(os)})}}]},{label:o("Toggle Theme"),key:"toggle_theme",icon(){return e.h(u.NIcon,null,{default:()=>e.h($a)})}},{type:"divider"},{label:o("Logout"),key:"logout",icon(){return e.h(u.NIcon,null,{default:()=>e.h(qa)})}}];return(w,B)=>{const V=e.resolveComponent("n-avatar"),O=e.resolveComponent("n-dropdown"),I=e.resolveComponent("n-space");return e.openBlock(),e.createBlock(I,{style:{"align-items":"center"}},{default:e.withCtx(()=>[e.createVNode(O,{trigger:"click",options:h,placement:"bottom-end",onSelect:g,size:"medium"},{default:e.withCtx(()=>{var y,k;return[e.createElementVNode("div",Uc,[e.createVNode(V,{round:"",size:"medium",title:(y=f.value)==null?void 0:y.userName,src:i.value,"fallback-src":Yn,bordered:"",style:{position:"absolute","z-index":"10"}},null,8,["title","src"]),e.createElementVNode("div",vc,[e.createElementVNode("div",ed,e.toDisplayString((k=f.value)==null?void 0:k.name),1)])])]}),_:1}),e.createVNode(mt,{show:m.value,onClose:B[0]||(B[0]=()=>m.value=!1)},null,8,["show"])]),_:1})}}}),[["__scopeId","data-v-d85ebb4a"]]),td={class:"flex-row"},od={class:"app-tab-label"},nd={style:{"margin-left":"4px"}},qn=e.defineComponent({__name:"TabMenu",props:{type:{default:"card"}},setup(t){const l=ce.useRouter(),o=Se(),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 g;return((g=s.url)==null?void 0:g.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",td,[e.createElementVNode("div",null,[i.icon?(e.openBlock(),e.createBlock(xe,{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(Us))]),_:1}))]),e.createElementVNode("div",od,[e.createElementVNode("span",nd,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}=Y(),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(yt))]),_:1})]),_:1},8,["title"])]),_:1}))}});class ld{constructor(){J(this,"token");J(this,"userId");J(this,"startupTime")}}class rd{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 ad=Te.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]}}),sd=Te.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 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 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:c,clearAllConfig:f,loadFromLocalStorage:i}}),id={AppLogoBox:Ut,AppTabs:vo,AutoScrollView:en,BarcodeImage:on,ChangePassword:mt,ColorInput:ht,Collapsable:mn,DefaultPropertyForm:Vt,DetailPage:kn,ExportModal:Tt,EmptyDetailView:bn,FormInput:Ie,FullscreenSwitch:Nn,GridConfigModal:Et,HaloButtonSelect:Sn,HaloDatePicker:Ge,HaloForm:Bn,HaloGrid:We,HaloModal:Vn,HaloModalInput:Bt,HaloSelect:Mn,HaloTagsInput:St,HaloTimePicker:bt,HaloTransfer:Tn,ImportModal:zt,InputModal:$t,ListInputModal:It,MainDetailPanel:An,MenuIcon:xe,NullableBooleanInput:Nt,NumberInputModal:En,ObjectTreeView:_n,PhotoBox:Ln,PrintModal:zn,PropertyGrid:Mt,QrModal:$n,SearchCard:Dn,SearchForm:Ke,SearchModal:Lt,SearchPanel:Ze,SelectIconBox:Dt,SelectObjectModal:Pn,SideMenu:Hn,SystemIconInput:Gn,TagsView:_t,ToolButton:Kn,TopMenu:Wn,TreeView:Zn,UserMenu:Qn,TabMenu:qn,QuickSearchBox:Xn},cd={install(t,l){const o={...Uo,...l};for(const[n,r]of Object.entries(id))t.component(n,r);l!=null&&l.langCode&&t.use(Jt,l==null?void 0:l.langCode,!0),t.provide("axios",le),t.provide(ut,o)}};S.axios=le,S.AppLogoBox=Ut,S.AppTabs=vo,S.AutoScrollView=en,S.BarcodeImage=on,S.ChangePassword=mt,S.Collapsable=mn,S.ColorInput=ht,S.DataPage=Fc,S.DateFormat=ge,S.DateTimeFormat=_e,S.DefaultPropertyForm=Vt,S.DetailPage=kn,S.EmptyDetailView=bn,S.ExportModal=Tt,S.FormInput=Ie,S.FullscreenSwitch=Nn,S.GridConfigModal=Et,S.HaloButtonSelect=Sn,S.HaloDatePicker=Ge,S.HaloForm=Bn,S.HaloGrid=We,S.HaloModal=Vn,S.HaloModalInput=Bt,S.HaloSelect=Mn,S.HaloTagsInput=St,S.HaloTimePicker=bt,S.HaloTransfer=Tn,S.HalovConfigKey=ut,S.I18nPlugin=Jt,S.ImportModal=zt,S.InputModal=$t,S.ListInputModal=It,S.MainDetailPanel=An,S.MenuIcon=xe,S.NullableBooleanInput=Nt,S.NumberInputModal=En,S.ObjectTreeView=_n,S.PhotoBox=Ln,S.PrintModal=zn,S.PropertyGrid=Mt,S.QrModal=$n,S.QuickSearchBox=Xn,S.SearchCard=Dn,S.SearchForm=Ke,S.SearchModal=Lt,S.SearchPanel=Ze,S.SelectIconBox=Dt,S.SelectObjectModal=Pn,S.SessionSummary=ld,S.SideMenu=Hn,S.SystemIconInput=Gn,S.SystemMenu=rd,S.TabMenu=qn,S.TagsView=_t,S.TimeFormat=Le,S.ToolButton=Kn,S.TopMenu=Wn,S.TreeView=Zn,S.UserMenu=Qn,S.addDays=wa,S.appendParamsToUrl=U,S.arrayDistinct=$o,S.arrayGroupBy=ia,S.arrayMove=zo,S.arrayRemoveIf=Lo,S.buildBarcodeUrl=tn,S.buildSearchItems=Cn,S.camelToWords=v,S.clearObject=Si,S.convertItems=wn,S.convertPercentValue=Wo,S.convertTo=Fe,S.copyEntity=yn,S.copyToEntity=gn,S.createGridColumns=Ct,S.createI18n=Xt,S.dateTimeToString=ct,S.dateToNumber=Po,S.dateToString=it,S.default=cd,S.defaultHalovOptions=Uo,S.defaultValue=Ko,S.downloadFile=ue,S.findMenuById=Fn,S.firstDayOfMonth=Ca,S.formatTimespan=Ho,S.getColumnWidth=wt,S.getConfig=pt,S.iconRender=kt,S.iconRenderIf=Vi,S.initEntity=hn,S.instanceOfColumnValueSource=Ao,S.instanceOfHaloColumn=Ee,S.instanceOfTime=Ro,S.isNullOrWhiteSpace=Zo,S.lastDayOfMonth=ka,S.linesToArray=Na,S.loadItemSources=He,S.mergeCssClass=Qo,S.mergeCssStyles=Yo,S.mergeRoutes=da,S.msToTime=ma,S.onNullOrWhiteSpace=Sa,S.openFile=_o,S.renderDifference=Ti,S.renderIconButton=Mi,S.renderLabel=Bi,S.searchField=ca,S.secondsToTime=Oo,S.splitNumberByCount=fa,S.splitNumberBySize=ua,S.stringToArray=ba,S.stringToTime=jo,S.sumNumbers=pa,S.timeToString=Fo,S.timestamp=ga,S.toBool=de,S.toBoolDefault=Pe,S.toDate=Do,S.toViewModel=ya,S.useAccountStore=Se,S.useCommonStore=Ne,S.useFontSizeStore=ad,S.useHttpTools=ie,S.useI18n=Y,S.useMenus=Rt,S.usePermissions=At,S.useTabsStore=lt,S.useUiTools=xt,S.useUserConfigStore=sd,S.validateEmail=xa,Object.defineProperties(S,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|