eservices-core 1.3.13 → 1.3.15
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/eservices-core.cjs.js +4 -4
- package/dist/eservices-core.es.js +236 -225
- package/dist/eservices-core.umd.js +5 -5
- package/dist/frontend/core/index.d.ts +2 -2
- package/dist/frontend/src/hooks/use-list-entity.d.ts +2 -2
- package/dist/frontend/src/index.d.ts +2 -1
- package/dist/frontend/src/types/list-type.d.ts +2 -2
- package/dist/frontend/src/widgets/list/list-head/widget-list-head.vue.d.ts +1 -1
- package/dist/frontend/src/widgets/list/widget-list.vue.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.es-list-container{overflow:auto}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.widget-table__head-cell[data-v-25198f4a]{padding:18px;text-align:start}.widget-table__head-label[data-v-25198f4a]{font-weight:600;font-size:14px;line-height:19px}[dir=rtl] .icon[data-v-e287c8d9]{transform:scaleX(-1)}.widget-spinner[data-v-0ef9ae88],.widget-spinner[data-v-0ef9ae88]:after{border-radius:50%;width:14px;height:14px}.widget-spinner[data-v-0ef9ae88]{font-size:2px;position:relative;text-indent:-9999em;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid #ffffff;transform:translateZ(0);animation:spinnerAnimation-0ef9ae88 1.1s infinite linear}@keyframes spinnerAnimation-0ef9ae88{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.widget-button[data-v-450dc564]{position:relative}.widget-button-spinner[data-v-450dc564]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.widget-multi-button-wrap[data-v-a8d711d1]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-a8d711d1]{grid-template-columns:1fr var(--button-size);background-color:var(--primary);grid-template-rows:var(--button-size);transition:var(--fast)}.widget-multi-button_active[data-v-a8d711d1]{grid-template-rows:calc(var(--button-size) * var(--7025434e))}.widget-multi-button-body[data-v-a8d711d1]{min-width:80px}.widget-multi-button-body-label[data-v-a8d711d1]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-a8d711d1]:hover{background-color:#223296}.widget-multi-button-side[data-v-a8d711d1]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-a8d711d1]{transform:rotate(180deg)}.widget-multi-button-side[data-v-a8d711d1]:hover{background-color:#223296}tr[data-v-344a8cc1]{border:1px solid #F3F4FC;height:30px}th[data-v-344a8cc1],td[data-v-344a8cc1]{position:relative;padding:0 11px}th[data-v-344a8cc1]{text-align:left}p[data-v-344a8cc1]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.head-cell[data-v-4e1d87c8]{padding:0 15px 0 10px;display:flex}.head-cell[data-v-4e1d87c8]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-4e1d87c8]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-4e1d87c8]{position:absolute;inset-inline-end:4px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-4e1d87c8]{transform:rotate(180deg)}.head-cell-resize[data-v-4e1d87c8]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-4e1d87c8]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-4e1d87c8]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-ccffc6bd]{position:sticky;top:-1px;z-index:1}.test-block[data-v-ccffc6bd]{position:absolute;z-index:2;display:none;height:calc(100% + 1px);place-content:center;inset-block-start:-1px;padding-inline:10px;background-color:#e7f2ff;-webkit-user-select:none;user-select:none;white-space:nowrap}.widget-list-head th[data-v-ccffc6bd]{position:sticky;top:0;z-index:2;-webkit-user-select:none;user-select:none}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
(function(
|
|
3
|
-
* eservices-core v1.3.
|
|
2
|
+
(function(d,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue"),require("jenesius-vue-form"),require("object-hash"),require("jenesius-vue-modal"),require("vue-router"),require("date-and-time")):typeof define=="function"&&define.amd?define(["exports","vue","jenesius-vue-form","object-hash","jenesius-vue-modal","vue-router","date-and-time"],s):(d=typeof globalThis<"u"?globalThis:d||self,s(d["eservices-core"]={},d.Vue,d.JenesiusVueForm,d.ObjectHash,d.JenesiusVueModal,d.VueRouter,d.DateAndTime))})(this,function(d,s,S,en,tn,nt,nn){"use strict";/*!
|
|
3
|
+
* eservices-core v1.3.15
|
|
4
4
|
* (c) 2023 ESERVICES
|
|
5
|
-
*/function
|
|
6
|
-
Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,t){return!e&&!t?b.ApiNotAvailable():new b(e||"Authorization Error",t)}static ApiResponseParseFailed(){return b.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new b("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new b(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new b("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new b("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new b(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new b(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new b(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new b(`Metadata for the ${e} is not currently available.`)}};it.ID=0;let F=it;const st="Please try again later or submit a feedback if problem doesn't go.";function ot(n){return typeof n=="string"?Be(n):
|
|
5
|
+
*/function rn(n,e){return!!n&&n===e||"password is not equal"}function rt(n){return Number(n.replace(/[^0-9.]/g,""))}function sn(n,e=null){let r=String(rt(n)).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length>1&&e!==null&&r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const on={inputs:Object.freeze(Object.defineProperty({__proto__:null,numeric:rt,prettyNumeric:sn,validPassword:rn},Symbol.toStringTag,{value:"Module"}))};function ee(n,e){if(typeof n!="object"||n===null)return;if(e in n)return n[e];let t=e.indexOf(".");if(t>-1){const r=e.substring(0,t);return r in n?ee(n[r],e.substr(t+1)):void 0}return n[e]}function ge(n,e){if(!n)return console.warn("Element is not provided.");function t(i,o){return i==o.target||i.contains(o.target)}const r=i=>{t(n,i)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function De(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const it=class b extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=b.ID++}static ParentFormNotFound(){return new b("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new b("Composite object name is undefined",e)}static EntityWithoutName(e){return new b("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new b(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new b("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new b("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new b(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return b.ApiNotAvailable()}static ApiError(e){return new b("Request error",e)}static ApiNotAvailable(){return new b(`Sorry, we experience difficulties here.
|
|
6
|
+
Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,t){return!e&&!t?b.ApiNotAvailable():new b(e||"Authorization Error",t)}static ApiResponseParseFailed(){return b.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new b("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new b(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new b("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new b("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new b(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new b(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new b(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new b(`Metadata for the ${e} is not currently available.`)}};it.ID=0;let F=it;const st="Please try again later or submit a feedback if problem doesn't go.";function ot(n){return typeof n=="string"?Be(n):an(n)?Be(n.message):Be(st)}function an(n){return!!(typeof n=="object"&&Object.hasOwnProperty.call(n,"message")&&n!==null)}function Be(n,e=[]){return{message:n,details:e}}class at{static getClientData(){return y("/close-api/client-content")}static getNavigation(){return y("/close-api/client/navigation")}}const K=new class{constructor(){this.store=s.reactive([])}add(e,t,{children:r,timeout:i=10,click:o=()=>{}}={}){const u=new cn(e,t,i,r||[],o);return this.store.push(u),i&&setTimeout(this.remove.bind(this,u.id),i*1e3),u}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}removeChild(e,t){throw new Error("Removing children error.")}},ct=class Xt{constructor(e,t,r,i,o){this.type=e,this.msg=t,this.timeout=r,this.children=i,this.click=o,this.id=Xt.cardId++}};ct.cardId=1;let cn=ct;/*!
|
|
7
7
|
* jenesius-event-emitter v1.0.2
|
|
8
8
|
* (c) 2022 Jenesius
|
|
9
9
|
* @license MIT
|
|
10
|
-
*/const lt=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},ut=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},dt=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},ft=function(){this.events={}};class I{constructor(){this.events={}}on(e,t){return lt.call(this,e,t)}emit(e,t){return ut.call(this,e,t)}off(e,t){return dt.call(this,e,t)}cleanEvents(){ft.call(this)}static on(e,t){return lt.call(I,e,t)}static emit(e,t){return ut.call(I,e,t)}static off(e,t){return dt.call(I,e,t)}static cleanEvents(){ft.call(I)}}I.events={};var ht=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},me=(n,e,t)=>(ht(n,e,"read from private field"),t?t.call(n):e.get(n)),Ve=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Me=(n,e,t,r)=>(ht(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),te,ye,we;const q=class P extends I{constructor(){super(...arguments),Ve(this,te,void 0),Ve(this,ye,"front"),this.organizations=[],Ve(this,we,!1)}set language(e){localStorage.setItem(P.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(P.LOCALSTORAGE_LANGUAGE_KEY)||P.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(P.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){Me(this,te,e)}get router(){if(!me(this,te))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return me(this,te)}set type(e){Me(this,ye,e)}get type(){return me(this,ye)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Me(this,we,e),this.emit(P.EVENT_READY_UPDATE,e)}get ready(){return me(this,we)}onReady(e){return this.on(P.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(P.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(P.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(P.CURRENT_CONTEXT_KEY,String(e)),this.emit(P.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const t=Number.parseInt(localStorage.getItem(P.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{K.add("error",F.ApiNotAvailable().message)}}loadCustomerData(){return at.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var t;return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const t=localStorage.getItem(this.getListKeyById(e));return t&&JSON.parse(t)}setListInformationToLocalStorage(e,t){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(t))}};te=new WeakMap,ye=new WeakMap,we=new WeakMap,q.DEFAULT_LANGUAGE="en",q.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",q.EVENT_CONTEXT_UPDATE="event:context-update",q.EVENT_READY_UPDATE="event:ready-update",q.EVENT_DATA_UPDATE="event:data-update",q.CURRENT_CONTEXT_KEY="CurrentContext";let pt=q;const C=new pt;function an(){const n=s.reactive({contextType:C.contextType,contextId:C.contextId,context:C.context});return C.onupdateContext(()=>{n.contextType=C.contextType,n.contextId=C.contextId,n.context=C.context}),n}function cn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return st}})}function y(n,e={}){return C.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=C.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw F.ApiNotAvailable()}).then(t=>cn(t).then(r=>{if(!t.ok)throw r;return r}))}class Ee{constructor(){}static parseNamesFromListConfig(e){let t=Ee.parseFieldsToGraphQL(e.reduce((i,o)=>(o.name&&i.push(o.name),i),[]));function r(i){let o="";for(let u in i)typeof i[u]=="boolean"?o+=` ${u} `:o+=` ${u} { ${r(i[u])} }`;return o}return r(t)}static parseSortFromListConfig(e){let t={};for(let r in e)t[r]=e[r]?"ASC":"DESC";return t}static parseFieldsToGraphQL(e){function t(r,i){if(i.includes(".")){const o=i.indexOf("."),u=i.substring(o+1),a=i.substring(0,o);a in r||(r[a]={}),t(r[a],u)}else r[i]=!0;return r}return e.reduce(t,{})}}class ln{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,t,r)=>(t!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[t]=r,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}const gt=new ln;function mt(n){return n&&n[0].toLowerCase()+n.slice(1)}function Ce(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Ce(r)),e[i]=r,e},{})}function un(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const ne={Request:y,clickOutside:ge,getPropFromObject:ee,runPromiseQueue:De,GraphQL:Ee,firstChapterToLowerCase:mt,valuesToUpperCase:Ce,prettyMoney:un},dn=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Ee,Journal:gt,Request:y,clickOutside:ge,default:ne,firstChapterToLowerCase:mt,getPropFromObject:ee,runPromiseQueue:De,valuesToUpperCase:Ce},Symbol.toStringTag,{value:"Module"}));function yt(n,e=""){for(let t in n){if(typeof n[t]=="object"){yt(n[t],(e.length?`${e}-`:"")+t);continue}let r="--"+((e.length?`${e}-`:"")+t).replace(/([A-Z])/g,i=>`-${i}`.toLowerCase());document.documentElement.style.setProperty(r,n[t])}}const M={};function fn(n){for(let e in n)M[e]=n[e];n.styles&&yt(n.styles),gt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=M}const hn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function pn(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const gn="masterId",mn="masterEntity";function _e(n,e){if(!Array.isArray(e))return;if(pn(e))return t(e);e.forEach(t);function t(r){n.append(mn,r[0]),n.append(gn,r[1].toString())}}class v{static async anonymousGetList(e){return await y(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,o)=>r.append(i,o),r=new URLSearchParams;if(e.fields){const i=e.fields;typeof i=="string"?t("fields",i):Array.isArray(i)?t("fields",i.join(" ")):typeof i=="object"&&t("fields",Object.keys(i).join(" "))}if(e.order){let i=e.order;const u=(Array.isArray(i)?[i]:Object.entries(i)).map(([a,c="desc"])=>`@${a} ${c}`).join(",");t("order",u)}return e.limit&&t("limit",e.limit.toString()),e.offset&&t("offset",e.offset.toString()),e.filter&&t("filter",e.filter.toString()),e.useUsageContext&&r.append("useUsageContext",e.useUsageContext.toString()),r}static async getList(e,t){const r=v.getSearchParamsForEntityListRead(t||{});return await y(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=v.getSearchParamsForEntityListRead(t||{});return y(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,t,r){const i=new URLSearchParams;return _e(i,r==null?void 0:r.masterEntities),y(`/close-api/data/${e}?${i.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:t})})}static update(e,t,r,i={}){return y(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static readById(e,t,r={}){const i=new URLSearchParams;if(r.fields){let o=r.fields;typeof o=="string"&&(o=[o]),i.append("fields",o.join(" "))}return y(`/close-api/data/entities/${e}/id/${t}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,t,r,i){const o=new URLSearchParams;return _e(o,i==null?void 0:i.masterEntities),y(`/close-api/data/entities/${e}/id/${t}?${o.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r,version:i==null?void 0:i.version})})}static removeById(e,t,r){const i=typeof t=="number"?{Id:t}:t;return v.removeByKeys(e,i,r)}static removeByKeys(e,t,r){return y(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}var wt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},We=(n,e,t)=>(wt(n,e,"read from private field"),t?t.call(n):e.get(n)),Et=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Ct=(n,e,t,r)=>(wt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),re,Se;const Ue=class Q extends I{constructor(e){super(),Et(this,re,[]),Et(this,Se,!1),this.hashParams="",this.offset=0,this.name=e.name}set wait(e){Ct(this,Se,e),this.emit(Q.EVENT_CHANGE_WAIT,e)}get wait(){return We(this,Se)}read(e){var i,o;this.wait=!0;const t={};e.order&&(t.order={[(i=e.order)==null?void 0:i.name]:(o=e.order)==null?void 0:o.duration}),e.fields&&(t.fields=e.fields),e.filter&&(t.filter=e.filter);const r=JSON.stringify(t.order)+JSON.stringify(t.filter);return r!==this.hashParams&&(this.offset=0,this.hashParams=r),e.limit&&(t.limit=e.limit),e.offset&&(t.offset=e.offset||this.offset),v.getList(this.name,t).then(u=>(this.offset===0&&(this.array=[]),this.offset+=t.limit,u)).then(u=>{this.array.push(...u)}).then(()=>this.emit(Q.EVENT_DATA,this.array)).finally(()=>{this.wait=!1})}set array(e){Ct(this,re,e),this.emit(Q.EVENT_DATA,this.array)}add(e){We(this,re).push(...e),this.emit(Q.EVENT_DATA,this.array)}get array(){return We(this,re)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static getCellInfo(e,t){const r=Q.getCellName(e),i=(()=>{let o=r?ee(t,r):null;return o===void 0&&(o=null),e.value?e.value(o,t):o})();return{name:r,value:i}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}};re=new WeakMap,Se=new WeakMap,Ue.EVENT_DATA="LIST:DATA",Ue.EVENT_CHANGE_WAIT="LIST:UPDATE-WAIT";let _t=Ue;const z=Symbol("__ROW_INDEX__");let je=class extends _t{constructor(e){super(e),this.rowIndex=1,this.changes={new:{},edit:{},remove:[]},this.save=()=>{}}get changed(){return Object.keys(this.changes.new).length||Object.keys(this.changes.edit).length||this.changes.remove.length}create(e){const t=this.wrapData(e);this.changes.new[t[z]]=t,this.emitChanges()}cleanChanges(){this.changes.new={},this.changes.edit={},this.changes.remove=[],this.emitChanges()}edit(e,t){const r=this.wrapData(t,e);if(this.changes.new[e])return this.changes.new[e]=r,this.emitChanges();this.array.find(i=>i[z]===e)&&(this.changes.edit[e]={...this.changes.edit[e],...r},this.emitChanges())}remove(e){if(this.changes.new[e])return delete this.changes.new[e],this.emitChanges();this.array.find(t=>t[z]===e)&&(delete this.changes.edit[e],this.changes.remove.includes(e)||this.changes.remove.push(e),this.emitChanges())}wrapData(e,t){return t===void 0&&!Object.prototype.hasOwnProperty.call(e,z.toString())&&(t=++this.rowIndex),{...e,[z]:t}}emitChanges(){this.emit(_.Form.EVENT_CHANGED,!0)}set array(e){super.array=e.map(t=>this.wrapData(t))}get array(){return super.array}log(e){console.log(`[table] ${e}`)}};je.PROVIDE_NAME="table-controller";function yn(n){const e=s.reactive(n.array);s.provide(je.PROVIDE_NAME,n);const t=s.reactive(n.changes);n.on(_t.EVENT_DATA,u=>e.splice(0,e.length,...u)),n.on(_.Form.EVENT_CHANGED,()=>{t.new=Object.keys(n.changes.new).reduce((u,a)=>{const c=Number(a);return u[c]=n.changes.new[c],u},{})});const r=s.computed(()=>[...e.reduce((u,a)=>{const c=a[z];return n.changes.remove.includes(c)||u.push({...a,...n.changes.edit[c]}),u},[]),...Object.values(t.new)]),i=_.Form.getParentForm();return i==null||i.subscribe(n),{activeRow:s.ref(null),array:r}}function wn(n,e){n.read=()=>v.getList(n.name,{fields:e==null?void 0:e.fields}).then(t=>n.array=t).then(()=>n.emit(_.Form.EVENT_READ,n.array)),n.save=()=>{const t=n.name;Object.values(n.changes.new).forEach(async i=>{await v.create(t,i)}),Object.entries(n.changes.edit).forEach(async([i,o])=>{await v.updateById(n.name,r(Number(i)),o)});function r(i){const o=n.array.find(u=>u[z]===i);return o.id|o.Id}n.changes.remove.forEach(async i=>{await v.removeById(t,r(i),0)}),n.emit(_.Form.EVENT_SAVE)}}const hi="",En=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Cn{static readHistoryById(e,t){return y(`/close-api/audits/history/${e}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(r=>{const i=r.history.map(o=>{if(!o.changes)return o;const u=o.changes.map(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...o,changes:u}});return{...r,history:i}})}}var St=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},B=(n,e,t)=>(St(n,e,"read from private field"),t?t.call(n):e.get(n)),G=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},J=(n,e,t,r)=>(St(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),be,ie,Te,Ne,se,oe,qe;const x="_______LIST_______ROW_______INDEX________NAME_______",ae=class V extends I{constructor(e){super(),this.LIST_ROW_KEY=1,G(this,be,void 0),this.array=[],G(this,ie,[]),G(this,Te,[]),G(this,Ne,new Proxy({},{set:(t,r,i,o)=>(t[r]=i,this.emit(V.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(V.EVENT_FILTERS_UPDATE,t),!0)})),G(this,se,!1),G(this,oe,(...t)=>Promise),G(this,qe,()=>{}),J(this,be,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&J(this,ie,e.config)}set config(e){J(this,ie,e.map(_.utils.copyObject)),this.emitUpdateConfig()}get config(){return B(this,ie)}emitUpdateConfig(){this.emit(V.EVENT_CONFIG_UPDATE,this.config)}get order(){return B(this,Te)}set order(e){J(this,Te,e),this.emit(V.EVENT_ORDER_UPDATE,this.order)}get filters(){return B(this,Ne)}set filters(e){At(B(this,Ne),e)}set wait(e){J(this,se,e),this.emit(_.Form.EVENT_WAIT,B(this,se))}get wait(){return B(this,se)}get primaryKeys(){return B(this,be)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[x]===e)}indexByKey(e){return this.array.findIndex(t=>t[x]===e)}static getKey(e){return e[x]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,x)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(V.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const t=this.indexByKey(e);t!==-1&&(this.array.splice(t,1),this.emit(V.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(V.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[x]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,x)}set read(e){J(this,oe,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=B(this,oe).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){J(this,oe,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>B(this,qe).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static mergeWithKey(e,t){return{...e,[x]:t}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,t){const r=V.getCellName(e),i=(()=>{let o=r?ee(t,r):null;return o===void 0&&(o=null),e.value?e.value(o,t):o})();return{name:r,value:i}}};be=new WeakMap,ie=new WeakMap,Te=new WeakMap,Ne=new WeakMap,se=new WeakMap,oe=new WeakMap,qe=new WeakMap,ae.EVENT_DATA="list-data: update",ae.EVENT_CONFIG_UPDATE="list-config:update",ae.EVENT_ORDER_UPDATE="list-order:update",ae.EVENT_FILTERS_UPDATE="list-filters:update";let W=ae;function bt(n,e){let t="",r=0,i=!1,o;n.read=(u={})=>{if(n.wait)return o;if(u.clean&&(t="",r=0,i=!1),i)return Promise.resolve([]);let a=e;typeof a=="function"&&(a=a());const c={};if(!n.name)throw new Error("Reading list`s data without name is not available.");a.order&&Array.isArray(a.order)&&a.order.length&&(c.order={[a.order[0]]:a.order[1]||"asc"}),a.fields&&(c.fields=a.fields),a.filter&&(c.filter=a.filter);const h=JSON.stringify(c.order)+JSON.stringify(c.filter)+JSON.stringify(c.fields);return h!==t&&!Number.isNaN(h)&&(r=0,t=h),"limit"in a&&(c.limit=a.limit),c.offset=r||a.offset||0,o=v.getList(n.name,c).then(l=>((r===0||u.clean)&&n.set([]),r+=c.limit,l)).then(l=>(n.add(...l),l.length===0&&(i=!0),l)),o}}function Tt(n){const e=s.reactive({wait:n.wait,array:[]});return n.on(W.EVENT_DATA,t=>{e.array.splice(0,e.array.length,...t.map(r=>Object.freeze(JSON.parse(JSON.stringify(r)))))}),n.on(_.Form.EVENT_WAIT,()=>{e.wait=n.wait}),e}function Nt(n,e){const t="list-flex-config",r=s.inject(t,void 0);if(r)return r;if(!n||!e)throw new Error("Hook useProvideList has two required params: list and defaultSettings");n.on(W.EVENT_CONFIG_UPDATE,()=>{n.read()});const i={list:n,defaultSettings:e};return s.provide(t,i),i}function _n(n){const e=s.reactive([...n.config]);return n.on(W.EVENT_CONFIG_UPDATE,t=>{e.splice(0,e.length,...t)}),e}function vt(n){const e=n.order||[],t=s.reactive(e);return n.on(W.EVENT_ORDER_UPDATE,r=>{t.splice(0,t.length,...r),n.read()}),t}function Sn(n){const e=s.ref(""),t=s.computed(()=>{const r=e.value.toLowerCase();return s.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function At(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function bn(n){const e=s.reactive(_.utils.copyObject(n.filters));return n.on(W.EVENT_FILTERS_UPDATE,t=>{At(e,t),n.read()}),e}function Tn(n){const e=s.reactive([]);function t(a){return e.includes(a)}function r(a){t(a)||e.push(a)}function i(a){const c=e.findIndex(h=>h===a);c!==-1&&e.splice(c,1)}function o(a){const c=s.unref(n);if(a===void 0){e.length===0?c.forEach(r):c.forEach(i);return}t(a)?i(a):r(a)}const u=s.computed(()=>{const a=s.unref(n);return e.length===a.length&&a.length!==0});return[e,o,u,r,i]}class Nn extends W{constructor(e){super(e),this.changes=[],this.save=vn.bind(this)}get changed(){return!!this.changes.find(e=>e.status==="active")}addChange(e,t){this.changes.push({type:e,status:"active",data:this.wrapItem(t)})}}function vn(){const n=this.changes.filter(e=>e.status==="active");return De(n.map(e=>{console.log("++")}))}function An(){const n=s.ref(null);function e(t){n.value=t&&Zt(t)}return{activeRow:n,activateRow:e}}const kn=Object.freeze(Object.defineProperty({__proto__:null,List:W,Table:Nn,useListOrder:vt,useListProvide:Nt,useListRead:bt,useListState:Tt,useTableActiveRow:An},Symbol.toStringTag,{value:"Module"}));class On extends I{constructor(){super(),this.EVENT_NEW="event:new-metadata",this.store={}}get(e){return this.store[e]}async load(e){return this.store[e]||this.set(e,await this.loadEntityInformation(e)),this.store[e]}set(e,t){this.store[e]=t,this.emit(this.EVENT_NEW,{entityName:e})}async loadEntityInformation(e){return await ze.get(e)}}const ce=new On;function In(n){const e=s.ref(ce.get(n));return ce.on(ce.EVENT_NEW,t=>{n===t.entityName&&(e.value=ce.get(n))}),e}function $n(n,e){try{return e.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(t){Ot().error("prettify value by metadata",n,t)}}class Ln{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return y(`/open-api/internationalization/language/${e}`)}}let H={};function Y(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=_.utils.getPropFromObject((this==null?void 0:this.vocabulary)||H,n);if(typeof t=="string")return kt(t,e);const r=_.utils.getPropFromObject(H==null?void 0:H.root,n);return typeof r=="string"?kt(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function kt(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}Y.setGlobalVocabulary=function(n){H=n},Y.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),Y.bind({vocabulary:_.utils.getPropFromObject(H,e.toLowerCase())})},Y.setVocabulary=function(n){return typeof n=="string"&&(n=_.utils.getPropFromObject(H,n)),Y.bind({vocabulary:n})};const Pn=function(){let n=!1;const e=[];function t(){return n}function r(c,h){t()&&console[c](...h),e.push(h)}function i(...c){r("log",c)}function o(...c){r("warn",c)}function u(...c){r("error",c)}function a(c=!0){n=c}return{info:i,warn:o,history:e,display:a,error:u}}();function Ot(){return Pn}class A{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw F.AuthServiceError(e.title,t)}static login(e){return y(M.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:M.applicationName})}).catch(A.parseError)}static registration(e){return e.AppName=M.applicationName,y(M.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(A.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw F.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return A.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return A.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return A.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return A.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return y(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(A.parseError)}static startLoginProcess(e){return A.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return A.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return A.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return y(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(A.parseError).then(A.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw F.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}const It=class pe{static async create(e){return y(pe.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const t=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return y(pe.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return y(`${pe.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return y(`${pe.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};It.url="/close-api/communications";let le=It;class Fn{static async getDefaultView(e){return y("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function $t(n){return{...n,createdEntities:n.createdEntites}}const Lt=class Re{static async getStartConfig(e,t){return y([Re.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return y([Re.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then($t)}static async runStep(e,t,r,i,o){return y([Re.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:o})}).then($t)}};Lt.url="/close-api/views/process-wizard";let ve=Lt;class ze{static get url(){return"/close-api/metadata"}static async get(e,t,r){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const i=new URLSearchParams;return t&&i.append("criteria",t),r&&i.append("id",String(r)),await fetch(this.url+`/${e}?${i.toString()}`,{method:"GET"}).then(o=>o.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return _e(i,r),t&&i.append("id",t),y([this.url,e].join("/")+`?${i.toString()}`)}static getFieldInformation(e,t){return y(`/open-api/metadata/${e}/fields/${t}`)}static getTreatmentListField(e,t){return y(`/open-api/metadata/${e}/list-fields/${t}`)}}class Rn{static async upload(e,t){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${t}`;return await fetch(i,{method:"POST",body:r}).then(o=>o.json()).then(o=>(o.filename=e.name,o))}}class Dn{static invite(e,t,r){return y("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:t,relatedRoleCode:r})})}static accept(e,t){return y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!0})})}static decline(e,t){return y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class Ge{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return y(Ge.url+e,{method:"POST",body:JSON.stringify(t)})}}class Bn{static getConfiguration(){return y("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class Pt{static url(){return"/close-api/actions"}static async get({criterion:e}){const t=new URLSearchParams;return e&&t.append("criterion",e),await fetch(this.url()+`?${t.toString()}`,{method:"GET"}).then(r=>r.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return _e(i,r),y([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}const Ft=class Yt extends I{constructor(e=[]){super(),this.array=s.reactive([]),this.defaultArray=[],this.setDefault(e)}emitUpdate(){this.emit(Yt.EVENT_DATA,this.array)}setDefault(e){const t=JSON.parse(JSON.stringify(e));this.defaultArray=t,this.set(t)}revert(){this.set(this.defaultArray)}set(e){this.array.splice(0,this.array.length,...e),this.emitUpdate()}append(e){this.array.push(e),this.emitUpdate()}moveTo(e,t){if(this.isOutOfRange(e)||this.isOutOfRange(t))throw new Error(`Provided position is out of range: ${e}, ${t}`);const r=this.array[e];this.array.splice(e,1),this.array.splice(t,0,r),this.emitUpdate()}remove(e){this.array.splice(e,1),this.emitUpdate()}isOutOfRange(e){return!(e>=0&&e<this.array.length)}};Ft.EVENT_DATA="list-config:update";let Vn=Ft;class Mn extends I{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return le.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return le.read(e).then(t=>t.length===0?le.create(e):t[0])}}function Wn(n){const e=_.Form.getParentForm();e?e.subscribe(n):console.warn(F.ParentFormNotFound());const t=s.reactive([]);return n.read=()=>le.readMessages(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function Un(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function $(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(o=>typeof o=="string"?`'${o}'`:o).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(Un(r)){let i=function(o){var u;return((u=o.match(/([^Z]*)/))==null?void 0:u[0])+"0000Z"};return r.start&&e.push(`@${t} ge ${i(r.start)}`),r.end&&e.push(`@${t} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${t} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${t} eq '${r}'`),e):(r===null&&e.push($.is(t,r)),e)},[]).join(" and ")}function ue(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${ue(t)}`},$.beginWith=function(e,t){return`@${e} BeginWith ${ue(t)}`},$.notEq=function(e,t){return`@${e} nq ${ue(t)}`},$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${ue(t)}`},$.in=function(e,t){const r=t.map(ue).join(", ");return`@${e} in (${r})`},$.and=function(...e){return e.join(" and ")},$.is=function(e,t){return`@${e} is ${t}`},$.or=function(...e){return e.join(" or ")};function jn(n,e="images"){return`/static-folder/${e}/${n}`}function qn(n,e,t){return n.reduce((r,i)=>{var a;let o=typeof e=="function"?e(i):i[e];const u=(a=r[r.length-1])==null?void 0:a.value;return u&&t(u,o)?r[r.length-1].array.push(i):r.push({value:o,array:[i]}),r},[])}function zn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Gn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Jn(n,e){const t=s.ref(null);function r(){return n.name?ze.getById(n.name,e,[]).then(i=>{t.value=i,i.fields.forEach(o=>{o.canSet?n.enable(o.name):n.disable(o.name)})}).catch(()=>{t.value=null;const i=F.MetadataEntityIsNotAvailable(n.name||"FORM_WITHOUT_NAME");K.add("error",i.message)}):Promise.reject()}return n.on(_.Form.EVENT_READ,r),{metadata:t,update:r}}class Je extends Error{static UndefinedStatus(){return new Je("Status is undefined.")}}class xn extends Je{}function Hn(n,e){const t=s.reactive([]);async function r(o,u){if(!o)throw xn.UndefinedStatus();const a=await Pt.get({criterion:o});t.splice(0,t.length),t.push(...a.map(c=>i(c,u)))}return{actions:t,update:r};function i(o,u){return{title:o.title,callback:()=>(()=>Promise.resolve().then(()=>{if(n.changed)return n.save()}).then(()=>fetch(o.url,{method:"POST",body:JSON.stringify({keys:{Id:u},contextId:C.contextId}),headers:{"Content-Type":"application/json"}})).then(c=>c.json()).then(c=>{if(!c.success)throw e!=null&&e.ModalValidationResult&&c.validationEffect?Qt.openModal(e.ModalValidationResult,{rules:c.validationEffect.results}):K.add("error",c.message),new Error;return c}).then(c=>{c.message&&K.add("info",c.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(c.affectedEntities)}).then(()=>n.read()))()}}}class Ae{static url(){return"/close-api/presentation"}static getStatuses(e,t){return fetch(`${Ae.url()}/status/${e}/${t}`).then(r=>r.json())}}function Kn(n){const e=s.reactive({title:"Loading",type:"wait"});function t(r){if(n.name&&Number.isInteger(r))return Ae.getStatuses(n.name,r).then(i=>{e.type=i.type,e.title=i.name})}return n.on(_.Form.EVENT_READ,r=>{var u,a;const{code:i,name:o}={code:(u=r.Status)==null?void 0:u.Code,name:(a=r.Status)==null?void 0:a.Name};return n.name?!Number.isInteger(i)&&!o?void console.log("Undefined code or name is Status prop."):Ae.getStatuses(n.name,i).then(c=>{e.type=c.type,e.title=o}):void console.log("Form without name.")}),{label:e,update:t}}function Yn(n,e){const t=nt.useRoute(),r=s.computed(()=>Number(t.params.id)),i=s.reactive({ready:!1,show:!1});return s.watch(()=>r.value,()=>{i.ready=!1}),s.watch(()=>r.value,()=>{Number.isInteger(r.value)&&n.read()},{immediate:!0}),n.read=ne.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return v.readById(n.name,r.value,{fields:e.fields})}).then(ne.valuesToUpperCase).then(o=>(Number.isInteger(o.Version)&&(n.version=o.Version),n.setValues(o),i.show=!0,o)).catch(o=>{throw Object.prototype.hasOwnProperty.call(o,"status")&&[403,404].includes(o.status)&&(i.show=!1),o}).finally(()=>{i.ready=!0})),n.save=ne.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return v.updateById(n.name,r.value,n.changes,{version:n.version})}).then(o=>{n.version=o.version})),n.on(_.Form.EVENT_SAVE,n.read.bind(n)),{formShadowState:i}}function Xn(){const n=s.reactive({contextId:C.contextId,person:C.person,organizations:C.organizations,ready:C.ready,user:C.user}),e=s.computed(()=>{if(!C.ready||!C.person)return null;const r=n.contextId;return C.person.id===r?C.person:C.organizations.find(i=>i.id===r)||null}),t=s.computed(()=>{var r;return n.contextId===((r=n.person)==null?void 0:r.id)});return C.onupdateContext(r=>{n.contextId=r}),C.onupdateData(()=>{n.person=C.person,n.organizations=C.organizations,n.user=C.user}),C.onReady(r=>{n.ready=r}),{state:s.readonly(n),currentContext:e,isPerson:t}}function Zn(n,e){const t=s.reactive({ready:!1,show:!1});function r(){t.ready=!1,t.show=!1}return n.read=()=>{let i=e();return Promise.resolve().then(()=>{if(!n.name)throw F.EntityWithoutName("Use Form Request");return v.readById(n.name,i.id,{fields:i.fields})}).then(ne.valuesToUpperCase).then(o=>(o.hasOwnProperty("Version")&&(n.version=Number(o.Version)),n.setValues(o),t.show=!0,o)).catch(o=>{const u=ot(o);throw K.add("error",u.message),u}).finally(()=>{t.ready=!0})},n.save=()=>{let i=e();return Promise.resolve().then(()=>{if(!n.name)throw F.EntityWithoutName("Use Form Request");return v.updateById(n.name,i.id,n.changes,{version:n.version})}).then(o=>{n.version=o.version||o.Version}).catch(o=>{const u=ot(o);throw K.add("error",u.message),u})},n.on(_.Form.EVENT_SAVE,n.read.bind(n)),{shadowFormState:t,initShadow:r}}class Qn{static getRequiredDocuments(e,t,r){const i=new URLSearchParams({entity:e,primaryKey:t,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(o=>o.json())}}class X{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${X.url()}/calculator/${e}`)}static calculate(e,t){return y(`/${X.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:t})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):F.ApiNotAvailable()})}static parseMetadataField(e){function t(r){switch(r.type){case"ValueType":switch(r.dataType){case"Integer":return"number";default:return r.dataType}case"EntityReference":return r.dataType}}return{name:e.name,label:e.title,required:e.required,type:t(e)}}static createOnlinePayment(e,t){return y(`/${X.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return y(`/${X.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class er{static getListSettings(e,t){const r=new URLSearchParams;r.set("entity",e),t&&r.set("mark",t);const i=`/close-api/views/list/configs?${r.toString()}`;return y(i)}}function tr(n){return n.statusName==="Completed"}function nr(n){return n.statusName==="FinalStepWithConfirmation"}function rr(n){return n.statusName==="ValidationError"}function ir(n,e,t){let r=null;const i=s.reactive({wait:null});let o=[],u=null;const a=s.ref(null);function c(){a.value=o.find(w=>w.name===u)||null}function h(){var w;return u?((w=o.find(T=>T.name===u))==null?void 0:w.fields)||[]:[]}function l(w){if(c(),rr(w))return void t.onValidation(w.validationResults);if((w.statusName==="FinalStep"||w.statusName==="NextStep")&&(!h().length||sr(h(),t.presets)))return S(t.presets||{});tr(w)&&t.onCompleted(w),nr(w)&&t.onConfirmation(w)}async function d(){try{await p(),await E()}catch(w){const{message:T}=Ie(w);Le.add("error",T)}}function p(){return i.wait="Loading process information.",ve.getStartConfig(e,n).then(w=>{o=w.steps.map(T=>({label:T.title,name:T.stepName,number:T.number,fields:T.frontendEntity.objectTypes.reduce((k,O)=>(O.properties.forEach(R=>{k.push({name:R.name,label:R.title,type:R.refEntityName||R.dataType})}),k),[])}))}).then(w=>(i.wait=!1,w))}function g(w){return u=w.nextStepName,r=w.token,w}function m(w){const T=Ie(w);Le.add("error",T.message)}function E(){return i.wait="Starting process",ve.startProcess(e,n).then(g).then(l).catch(m).finally(()=>{i.wait=null})}function S(w={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Expect the result",ve.runStep(e,n,u,r,w).then(g).then(l).catch(m).finally(()=>{i.wait=!1}))}return{initialize:d,state:i,currentStepConfig:s.readonly(a),next:S}}function sr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!_.utils.getPropFromObject(e,r.name))return!1}return!0}const or="close-api/proxy/Equipment/Search";class ar{static search(e,t,r,i,o){const u=new URLSearchParams;u.append("pattern",e||""),t&&u.append("categoryId",t),r&&u.append("useType",String(r)),i&&u.append("statusCode",i),o&&(u.append("limit",String(o.limit)),u.append("offset",String(o.offset)));const a=`/${or}?${u.toString()}`;return y(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const cr={class:"widget-table__head"},lr={class:"widget-table__head-label margin_0 text_overflow"},ur=s.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("tr",cr,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.config,(r,i)=>(s.openBlock(),s.createElementBlock("th",{class:"widget-table__head-cell",key:i},[s.createElementVNode("p",lr,s.toDisplayString(r.label),1)]))),128))]))}}),pi="",U=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},dr=U(ur,[["__scopeId","data-v-25198f4a"]]);function fr(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function hr(n,e){const t=fr(n);let r=t?_.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function pr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var xe={exports:{}},He,Rt;function gr(){if(Rt)return He;Rt=1;var n=1e3,e=n*60,t=e*60,r=t*24,i=r*7,o=r*365.25;He=function(l,d){d=d||{};var p=typeof l;if(p==="string"&&l.length>0)return u(l);if(p==="number"&&isFinite(l))return d.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function u(l){if(l=String(l),!(l.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(d){var p=parseFloat(d[1]),g=(d[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return p*o;case"weeks":case"week":case"w":return p*i;case"days":case"day":case"d":return p*r;case"hours":case"hour":case"hrs":case"hr":case"h":return p*t;case"minutes":case"minute":case"mins":case"min":case"m":return p*e;case"seconds":case"second":case"secs":case"sec":case"s":return p*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return p;default:return}}}}function a(l){var d=Math.abs(l);return d>=r?Math.round(l/r)+"d":d>=t?Math.round(l/t)+"h":d>=e?Math.round(l/e)+"m":d>=n?Math.round(l/n)+"s":l+"ms"}function c(l){var d=Math.abs(l);return d>=r?h(l,d,r,"day"):d>=t?h(l,d,t,"hour"):d>=e?h(l,d,e,"minute"):d>=n?h(l,d,n,"second"):l+" ms"}function h(l,d,p,g){var m=d>=p*1.5;return Math.round(l/p)+" "+g+(m?"s":"")}return He}function mr(n){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=u,t.humanize=gr(),t.destroy=h,Object.keys(n).forEach(l=>{t[l]=n[l]}),t.names=[],t.skips=[],t.formatters={};function e(l){let d=0;for(let p=0;p<l.length;p++)d=(d<<5)-d+l.charCodeAt(p),d|=0;return t.colors[Math.abs(d)%t.colors.length]}t.selectColor=e;function t(l){let d,p=null,g,m;function E(...S){if(!E.enabled)return;const w=E,T=Number(new Date),k=T-(d||T);w.diff=k,w.prev=d,w.curr=T,d=T,S[0]=t.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let O=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(j,N)=>{if(j==="%%")return"%";O++;const de=t.formatters[N];if(typeof de=="function"){const Pe=S[O];j=de.call(w,Pe),S.splice(O,1),O--}return j}),t.formatArgs.call(w,S),(w.log||t.log).apply(w,S)}return E.namespace=l,E.useColors=t.useColors(),E.color=t.selectColor(l),E.extend=r,E.destroy=t.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(g!==t.namespaces&&(g=t.namespaces,m=t.enabled(l)),m),set:S=>{p=S}}),typeof t.init=="function"&&t.init(E),E}function r(l,d){const p=t(this.namespace+(typeof d>"u"?":":d)+l);return p.log=this.log,p}function i(l){t.save(l),t.namespaces=l,t.names=[],t.skips=[];let d;const p=(typeof l=="string"?l:"").split(/[\s,]+/),g=p.length;for(d=0;d<g;d++)p[d]&&(l=p[d].replace(/\*/g,".*?"),l[0]==="-"?t.skips.push(new RegExp("^"+l.slice(1)+"$")):t.names.push(new RegExp("^"+l+"$")))}function o(){const l=[...t.names.map(a),...t.skips.map(a).map(d=>"-"+d)].join(",");return t.enable(""),l}function u(l){if(l[l.length-1]==="*")return!0;let d,p;for(d=0,p=t.skips.length;d<p;d++)if(t.skips[d].test(l))return!1;for(d=0,p=t.names.length;d<p;d++)if(t.names[d].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function c(l){return l instanceof Error?l.stack||l.message:l}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}var yr=mr;(function(n,e){e.formatArgs=r,e.save=i,e.load=o,e.useColors=t,e.storage=u(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const h="color: "+this.color;c.splice(1,0,h,"color: inherit");let l=0,d=0;c[0].replace(/%[a-zA-Z%]/g,p=>{p!=="%%"&&(l++,p==="%c"&&(d=l))}),c.splice(d,0,h)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function o(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c=process.env.DEBUG),c}function u(){try{return localStorage}catch{}}n.exports=yr(e);const{formatters:a}=n.exports;a.j=function(c){try{return JSON.stringify(c)}catch(h){return"[UnexpectedJSONParseError]: "+h.message}}})(xe,xe.exports);var wr=xe.exports;const Dt=pr(wr);function Bt(n){return["eservices-core",n].join(":")}function Vt(n){return Ke(n,"YYYY/MM/DD HH:mm:ss")}function Ke(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return en.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const gi="",ke=U({props:{name:String},setup(n,e){let t="unknown";try{t=e.slots.default()[0].children}catch{t=n.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>s.h("i",{class:`icon icon-${t}`})}},[["__scopeId","data-v-e287c8d9"]]),Er=Dt(Bt("setup-list-row"));function Cr(n,e){const t=n.config.map(r=>_r(r,n,e));return s.h("tr",{class:"widget-table__row widget-table-row"},t)}function _r(n,e,t){const r=e.values;let i=hr(n,r);const o={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(l){o.onClick.push(()=>l(r))}function a(l){Array.isArray(l)?o.class.push(...l):o.class.push(l)}const c=[],h=[];if(n.hide&&n.hide(r))return[s.h("td")];if(n.type)switch(a(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Ke(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Vt(typeof i=="string"?i:null);break}case"multi-select":{h.push(s.h(_.FormField,{type:"single-checkbox",modelValue:e.selected})),u(Mt.bind(null,t,!0));break}case"select":{h.push(s.h(_.FormField,{type:"single-radio",modelValue:e.selected})),u(Mt.bind(null,t,!1));break}}if(n.onClick&&u(n.onClick),n.link)try{const l=n.link(r);if(l){const d=s.h(nt.RouterLink,{to:l});h.push(d),a("widget-table-cell_link")}}catch(l){Er("Can't add router link",l)}return n.href&&(h.push(s.h("a",{href:n.href(r),target:"_blank"})),a("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&h.push(s.h("p",{class:"widget-list-cell-text"},i)),n.icon&&h.push(s.h(ke,{name:n.icon})),n.class&&(typeof n.class=="function"?a(n.class(r)):a(n.class)),c.push(s.h("td",o,h)),c}function Mt(n,e){n.emit("select",e)}function Wt(n,e){return()=>{try{return Cr(n,e)}catch(t){return console.warn(t),null}}}const Sr={props:{values:Object,config:Object,selected:Boolean},setup:Wt},br=["colspan"],Ut=s.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=s.ref();return s.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(s.openBlock(),s.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[s.createElementVNode("td",{colspan:r.rowLength},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(r.component),s.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=o=>e("close")),onSave:i[1]||(i[1]=o=>e("save",o))}),null,16,["values","new"]))],8,br)],512))}}),Ye={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go."},Tr={class:"widget-table"},jt="update:selectedRows",Nr=s.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{}},emits:["update:activeRow","save"],setup(n,{emit:e}){const t=n,r=s.useSlots(),i=s.computed(()=>{var a;return(a=r==null?void 0:r.default)==null?void 0:a.call(r)[0]});function o(a,c=!0){if(!t.selectedRows)return;if(!c)return e(jt,t.selectedRows.includes(a)?[]:[a]);const h=[...t.selectedRows],l=h.indexOf(a);return l===-1?h.push(a):h.splice(l,1),e(jt,h)}function u(a){e("save",a),e("update:activeRow",null)}return(a,c)=>(s.openBlock(),s.createElementBlock("div",null,[s.createElementVNode("table",Tr,[s.createVNode(dr,{config:a.config},null,8,["config"]),s.createElementVNode("tbody",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.array,(h,l)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:l},[s.createVNode(Sr,{config:a.config,values:h,selected:a.selectedRows.includes(h),onSelect:d=>o(h,d),class:s.normalizeClass(a.classCallback?a.classCallback(h):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&a.activeRow===h?(s.openBlock(),s.createBlock(Ut,{key:0,component:i.value,"row-length":a.config.length,values:h,onClose:c[0]||(c[0]=d=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):s.createCommentVNode("",!0)],64))),128)),a.activeRow===s.unref(Ye).LIST_ACTIVE_NEW?(s.openBlock(),s.createBlock(Ut,{key:0,component:i.value,"row-length":a.config.length,onClose:c[1]||(c[1]=h=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):s.createCommentVNode("",!0)])])]))}}),vr=s.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("div",{class:"widget-spinner",style:s.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}}),yi="",Oe=U(vr,[["__scopeId","data-v-0ef9ae88"]]),Ar={class:"widget-button"},kr=s.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("button",Ar,[e.wait?(s.openBlock(),s.createBlock(Oe,{key:0,class:"widget-button-spinner"})):s.createCommentVNode("",!0),s.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),wi="",Or=U(kr,[["__scopeId","data-v-450dc564"]]),Ir={class:"widget-multi-button-wrap position_relative cursor_pointer"},$r={class:"widget-multi-button-body grid"},Lr=["onClick"],Pr={class:"widget-multi-button-side-wrap"},Fr=s.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;s.useCssVars(u=>({"7025434e":r.value}));const t=s.reactive({active:!1,wait:!1}),r=s.computed(()=>e.array.length+(e.label?1:0));function i(u){if(!(typeof u!="function"||t.wait))return t.wait=!0,Promise.resolve().then(u).finally(()=>{t.wait=!1})}function o(u=!t.active){t.active=u}return(u,a)=>(s.openBlock(),s.createElementBlock("div",Ir,[s.createElementVNode("div",{class:s.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[s.createElementVNode("div",$r,[u.label?(s.openBlock(),s.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:a[0]||(a[0]=c=>o())},s.toDisplayString(u.label),1)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(u.array,(c,h)=>(s.openBlock(),s.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:h,onClick:l=>{i(c.callback),o(!1)}},s.toDisplayString(c.label),9,Lr))),128))]),s.createElementVNode("div",Pr,[s.createElementVNode("div",{class:s.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:a[1]||(a[1]=c=>o())},[t.wait?(s.openBlock(),s.createBlock(s.unref(Oe),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(s.openBlock(),s.createBlock(s.unref(ke),{key:1,class:"widget-multi-button-side-icon"},{default:s.withCtx(()=>[s.createTextVNode("angle-small-down")]),_:1})):s.createCommentVNode("",!0)],2)])],2)]))}}),Ei="",Rr=U(Fr,[["__scopeId","data-v-a8d711d1"]]),Dr={class:"widget-loader flex flex-align_center gap_10 padding_15"},Br={class:"text_md"},Vr=s.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("div",Dr,[s.createVNode(Oe,{color:"var(--primary)",class:"padding_10"}),s.createElementVNode("span",Br,s.toDisplayString(e.label),1)]))}}),Mr=["alt","src"],Wr=s.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=s.ref();return s.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(s.openBlock(),s.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,Mr))}}),Ur={props:{config:Array,values:Object,selected:Boolean},setup:Wt},Ci="",jr=U(Ur,[["__scopeId","data-v-344a8cc1"]]),qr=n=>(s.pushScopeId("data-v-4e1d87c8"),n=n(),s.popScopeId(),n),zr={class:"head-cell"},Gr=qr(()=>s.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Jr=s.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(n,{emit:e}){const t=n;return t.title&&console.warn(`For cell ${t.name} using title,it should be replaced with label.`),(r,i)=>(s.openBlock(),s.createElementBlock("th",null,[s.createElementVNode("div",zr,[s.createElementVNode("div",{class:"head-cell-content flex_grow",style:s.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(s.openBlock(),s.createBlock(s.unref(_.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=s.withModifiers(o=>e("select"),["stop","prevent"]))})):(s.openBlock(),s.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=o=>e("order"))},s.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(s.openBlock(),s.createBlock(s.unref(ke),{key:0,class:s.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:s.withCtx(()=>[s.createTextVNode("core-arrow-up")]),_:1},8,["class"])):s.createCommentVNode("",!0),Gr])]))}}),_i="",xr=U(Jr,[["__scopeId","data-v-4e1d87c8"]]),Hr=s.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=s.ref(),i=s.ref();s.onMounted(()=>{function c(g,m){let E=-1;do E++,m-=g[E];while(m>0&&E<g.length);return E}function h(g,m){let E=0;for(;m>0&&m>g[E]&&E<g.length;)m-=g[E],E++;return console.log(m,E),E>0?E:0}function l(g){try{i.value.style.insetInlineStart=g+"px"}catch(m){console.log(m)}}function d(g){try{i.value.style.width=g+"px",i.value.style.minWidth=g+"px",i.value.style.maxWidth=g+"px"}catch(m){console.log(m)}}function p(g){return g===null?!1:g.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(m){var Ht;function E(L){return L.screenX+T-R}const S=r.value,w=[...S.children].filter(L=>L.localName==="th"),T=((Ht=S.offsetParent)==null?void 0:Ht.scrollLeft)||0,k=w.map(L=>L.clientWidth),O=p(m.target),R=S.getBoundingClientRect().left,j=E(m),N=c(k,j),de=k.slice(0,N).reduce((L,D)=>L+D,0),Pe=j-de,et=S.offsetWidth,fe=w[N].clientWidth;if(t.config[N].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",m.screenX),console.log("Widths",k),console.log("max width",et),console.log("Start Position",j),console.log("Position From",N),console.log("Start Position",N),console.log("Global offset (Отступ самой таблицы от края экрана)",R),console.log("Del",Pe),console.groupEnd(),i.value.innerText=w[N].textContent||"",i.value.style.display="grid",i.value.style.width=fe+"px",i.value.style.cursor="grabbing",l(de),d(fe),document.addEventListener("pointermove",xt,{passive:!0}),document.addEventListener("pointerup",Jt);function Jt(L){if(console.group("END"),document.removeEventListener("pointermove",xt),document.removeEventListener("pointerup",Jt),O&&(t.config[N].width=i.value.style.width,t.config[N].minWidth=i.value.style.width,t.config[N].maxWidth=i.value.style.width,o(t.config)),!O){const D=L.screenX+T-R;console.log("ENP Position",D);const Fe=h(k,D);if(console.log(N,"->",Fe),Fe!==N){const he=t.config[N],tt=t.config;tt.splice(N,1),tt.splice(Fe,0,he),o(tt)}else{const he=t.config[N].name;u(he)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function xt(L){if(O){const he=E(L)-j+fe;d(he);return}let D=L.screenX+T-R-Pe;D<0&&(D=0),D+fe>et&&(D=et-fe),l(D)}})});function o(c){e("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(t.order.length===0||t.order[0]!==c)return void a([c]);const h=t.order.length===1||t.order[1]==="asc"?"asc":"desc";a([c,h==="asc"?"desc":"asc"])}function a(c){e("update:order",c)}return(c,h)=>(s.openBlock(),s.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(c.config,(l,d)=>(s.openBlock(),s.createBlock(xr,s.mergeProps({key:l},l,{onOrder:p=>u(l.name),onSelect:h[0]||(h[0]=p=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),s.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),Si="",Kr=U(Hr,[["__scopeId","data-v-ccffc6bd"]]),Yr={class:"widget-list"},Xr={class:"widget-list-body position_relative"},Zr=50,Qr=s.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(n,{emit:e}){const t=n;function r(a,c=!0){if(t.selectedRows)if(!c)o(t.selectedRows.includes(a)?[]:[a]);else{const h=[...t.selectedRows],l=h.indexOf(a);l===-1?h.push(a):h==null||h.splice(l,1),o(h)}}function i(){var a;if(((a=t.selectedRows)==null?void 0:a.length)!==t.array.length)return o([...t.array]);o([])}function o(a){e("update:selectedRows",a)}function u(a){if(!a)return;const c=a.target;c.scrollTop+c.clientHeight+Zr>c.scrollHeight&&e("scrollEnd")}return(a,c)=>(s.openBlock(),s.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[s.createElementVNode("table",Yr,[s.createElementVNode("thead",null,[s.createVNode(Kr,{onSelect:c[0]||(c[0]=h=>i()),"onUpdate:order":c[1]||(c[1]=h=>e("update:order",h)),"onUpdate:config":c[2]||(c[2]=h=>e("update:config",h)),config:a.config,order:a.order},null,8,["config","order"])]),s.createElementVNode("tbody",Xr,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.array,(h,l)=>{var d;return s.openBlock(),s.createBlock(jr,{key:l,class:"widget-list-row",values:h,config:a.config,selected:(d=a.selectedRows)==null?void 0:d.includes(h),onSelect:p=>r(h,p)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function ei(n){function e(...r){return t.wait?Promise.reject("The process has already started."):(t.wait=!0,Promise.resolve().then(()=>n(...r)).finally(()=>{t.wait=!1}))}const t=s.reactive({wait:!1,call:e});return t}function Ie(n){return typeof n=="string"?Xe(n):ti(n)?Xe(n.message):Xe(Ye.DEFAULT_ERROR_MESSAGE)}function ti(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function Xe(n){return{message:n}}function $e(n="error"){return function(e){const{message:t}=Ie(e);Le.add(n,t)}}function Ze(n,e){return Qe().emit("entity:read",{...e,entity:n})}function qt(n,e){return Qe().emit("entity:update",{...e,entity:n})}function ni(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function ri(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}function ii(){const n=s.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const Z=Dt(Bt("use-socket"));function Qe(){return si}const si=function(){let n=1,e;const t=new Set,r=new Set;function i(){return{safeQueue:r,requestId:n,handlers:t}}function o(p){const g=[...t.values()];Z("Handlers array length is %d. Response event: %s. Request id: %d",t.size,p.event,p.requestId),g.forEach(m=>{const E=p.requestId;(m.requestId&&m.requestId===E||!m.requestId&&m.event===p.event)&&(Z("Find appropriated handler: %d, event: %s",n,m.event),m.callback(p.data,p),m.once&&(t.delete(m),Z("Handler was removed by *once* params was passed. %o",m)))})}function u(p){console.log(`%cInitializing sockets: %c${p}`,"color: purple","color: black"),e=new WebSocket(p),e.onclose=function(g){Z("Connection to server was stopped: %d %s",g.code,g.reason),setTimeout(()=>u(p))},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...r.values()].forEach(g=>{a(g),r.delete(g)})},e.onerror=function(g){console.warn(g)},e.onmessage=g=>{try{const m=JSON.parse(g.data);if(!zt(m)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(m);return}o(m)}catch(m){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(m)}}}function a(p){e.send(p)}function c(p,g){t.add({event:p,callback:g})}function h(p,g){t.add({event:p,callback:g,once:!0})}function l(){return e&&(e==null?void 0:e.readyState)===1}function d(p,g,m){const E=++n,S=JSON.stringify({requestId:E,event:p,data:g,contextId:C.contextId,url:window.location.href});return l()?a(S):(r.add(S),Z("Socket is not connected. Message was send to save-queue. %s")),new Promise((w,T)=>{t.add({event:p,requestId:E,once:!0,callback:(k,O)=>{if(Z("Promise was resolve with next data:",k),oi(O))return void T(k);m&&m(k,O),w(k)}})})}return{get socket(){return e},on:c,once:h,emit:d,initialization:u,getDevInfo:i}}(),oi=n=>!!zt(n)&&n.event==="request-error",zt=n=>!!n&&typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function ai(n,e){const t=s.reactive([]);let r=0;const i=s.ref(!1);function o(){return i.value?Promise.reject("The process has already started."):(i.value=!0,typeof e.limit!="number"&&(e.limit=100),e.offset=r,Ze(n,e).then(d=>(r+=d.length,d)).finally(()=>{i.value=!1}))}function u(d,p){var m;const g=d.Version||((m=t.find(E=>E.Id===p))==null?void 0:m.Version);if(g===void 0)throw new Error("Object without version.");return g}function a(d,p){const g=t.findIndex(m=>m.Id===d);if(g===-1)throw new Error(`Can't found item with Id ${d}`);t.splice(g,1,p)}async function c(d,p){try{const g=u(p,d);delete p.Version,await qt(n,{id:d,values:p,version:g});const m=await Ze(n,{fields:e.fields||"",id:d});a(d,m)}catch(g){$e()(g)}}async function h(){try{const d=await o();t.push(...d)}catch(d){$e()(d)}}async function l(){try{r=0;const d=await o();t.splice(0,t.length,...d)}catch(d){$e()(d)}}return{array:t,updateById:c,next:h,reload:l,wait:i}}const Le=new class{constructor(){this.store=s.reactive([])}add(e,t,r={}){const i=ci(r),o=new li(e,t,i.timeout,i.children,i.click);return this.store.push(o),r.timeout&&setTimeout(this.remove.bind(this,o.id),r.timeout*1e3),o}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function ci(n){function e(r){return!!r&&typeof r=="object"}const t={timeout:10,click:()=>null,children:[]};return e(n)?{timeout:n.timeout||t.timeout,click:n.click||t.click,children:n.children||t.children}:t}const Gt=class Xt{constructor(e,t,r,i,o){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=o,this.id=Xt.cardId++}};Gt.cardId=1;let li=Gt;const ui={clickOutside:ge,valuesToUpperCase:Ce,Filter:$,staticLink:jn,groupArrayByField:qn,uuidv4:zn,Request:y},di={usage:rn,utils:dn,config:fn,types:hn};f.ApplicationManager=pt,f.Communication=Mn,f.ComputedMetadata=In,f.CoreError=F,f.Filter=$,f.List=W,f.ListConfig=Vn,f.Manager=C,f.MetadataStore=ce,f.NotificationSystem=Le,f.Request=y,f.Table=je,f.WidgetButton=Or,f.WidgetIcon=ke,f.WidgetImage=Wr,f.WidgetList=Qr,f.WidgetLoader=Vr,f.WidgetMultiButton=Rr,f.WidgetSpinner=Oe,f.WidgetTable=Nr,f.actionService=Pt,f.asyncProcess=ei,f.authService=A,f.billingService=X,f.catchUniversal=$e,f.clickOutside=ge,f.clientService=at,f.communicationService=le,f.configurationService=er,f.constants=Ye,f.dataService=v,f.debounce=Gn,f.default=di,f.documentsService=Qn,f.equipmentService=ar,f.fileService=Rn,f.getNamesFromListConfig=ni,f.historyService=Cn,f.internationalizationService=Ln,f.invitationService=Dn,f.metadataService=ze,f.newImport=kn,f.openService=Bn,f.parseError=Ie,f.prettifyValueByMetadata=$n,f.prettyDate=Ke,f.prettyDateWithTime=Vt,f.prettyMoney=ri,f.processWizardService=ve,f.ruleValidationService=Ge,f.t=Y,f.testTypes=En,f.universalEntityRead=Ze,f.universalEntityUpdate=qt,f.useCommunication=Wn,f.useCustomerState=Xn,f.useFormAction=Hn,f.useFormLabel=Kn,f.useFormMetadata=Jn,f.useFormRequest=Zn,f.useFormRequestData=Yn,f.useListActiveRow=ii,f.useListConfig=_n,f.useListEntity=ai,f.useListFilter=bn,f.useListOrder=vt,f.useListProvide=Nt,f.useListRead=bt,f.useListSearch=Sn,f.useListSelect=Tn,f.useListState=Tt,f.useLogger=Ot,f.useManagerState=an,f.useSocket=Qe,f.useTableRequest=wn,f.useTableState=yn,f.useWizard=ir,f.utils=ui,f.viewService=Fn,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
10
|
+
*/const lt=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},ut=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},dt=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},ft=function(){this.events={}};class I{constructor(){this.events={}}on(e,t){return lt.call(this,e,t)}emit(e,t){return ut.call(this,e,t)}off(e,t){return dt.call(this,e,t)}cleanEvents(){ft.call(this)}static on(e,t){return lt.call(I,e,t)}static emit(e,t){return ut.call(I,e,t)}static off(e,t){return dt.call(I,e,t)}static cleanEvents(){ft.call(I)}}I.events={};var ht=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},me=(n,e,t)=>(ht(n,e,"read from private field"),t?t.call(n):e.get(n)),Ve=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Me=(n,e,t,r)=>(ht(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),te,ye,we;const q=class P extends I{constructor(){super(...arguments),Ve(this,te,void 0),Ve(this,ye,"front"),this.organizations=[],Ve(this,we,!1)}set language(e){localStorage.setItem(P.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(P.LOCALSTORAGE_LANGUAGE_KEY)||P.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(P.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){Me(this,te,e)}get router(){if(!me(this,te))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return me(this,te)}set type(e){Me(this,ye,e)}get type(){return me(this,ye)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Me(this,we,e),this.emit(P.EVENT_READY_UPDATE,e)}get ready(){return me(this,we)}onReady(e){return this.on(P.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(P.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(P.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(P.CURRENT_CONTEXT_KEY,String(e)),this.emit(P.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const t=Number.parseInt(localStorage.getItem(P.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{K.add("error",F.ApiNotAvailable().message)}}loadCustomerData(){return at.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var t;return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const t=localStorage.getItem(this.getListKeyById(e));return t&&JSON.parse(t)}setListInformationToLocalStorage(e,t){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(t))}};te=new WeakMap,ye=new WeakMap,we=new WeakMap,q.DEFAULT_LANGUAGE="en",q.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",q.EVENT_CONTEXT_UPDATE="event:context-update",q.EVENT_READY_UPDATE="event:ready-update",q.EVENT_DATA_UPDATE="event:data-update",q.CURRENT_CONTEXT_KEY="CurrentContext";let pt=q;const C=new pt;function ln(){const n=s.reactive({contextType:C.contextType,contextId:C.contextId,context:C.context});return C.onupdateContext(()=>{n.contextType=C.contextType,n.contextId=C.contextId,n.context=C.context}),n}function un(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return st}})}function y(n,e={}){return C.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=C.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw F.ApiNotAvailable()}).then(t=>un(t).then(r=>{if(!t.ok)throw r;return r}))}class Ee{constructor(){}static parseNamesFromListConfig(e){let t=Ee.parseFieldsToGraphQL(e.reduce((i,o)=>(o.name&&i.push(o.name),i),[]));function r(i){let o="";for(let u in i)typeof i[u]=="boolean"?o+=` ${u} `:o+=` ${u} { ${r(i[u])} }`;return o}return r(t)}static parseSortFromListConfig(e){let t={};for(let r in e)t[r]=e[r]?"ASC":"DESC";return t}static parseFieldsToGraphQL(e){function t(r,i){if(i.includes(".")){const o=i.indexOf("."),u=i.substring(o+1),a=i.substring(0,o);a in r||(r[a]={}),t(r[a],u)}else r[i]=!0;return r}return e.reduce(t,{})}}class dn{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,t,r)=>(t!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[t]=r,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}const gt=new dn;function mt(n){return n&&n[0].toLowerCase()+n.slice(1)}function Ce(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Ce(r)),e[i]=r,e},{})}function fn(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const ne={Request:y,clickOutside:ge,getPropFromObject:ee,runPromiseQueue:De,GraphQL:Ee,firstChapterToLowerCase:mt,valuesToUpperCase:Ce,prettyMoney:fn},hn=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Ee,Journal:gt,Request:y,clickOutside:ge,default:ne,firstChapterToLowerCase:mt,getPropFromObject:ee,runPromiseQueue:De,valuesToUpperCase:Ce},Symbol.toStringTag,{value:"Module"}));function yt(n,e=""){for(let t in n){if(typeof n[t]=="object"){yt(n[t],(e.length?`${e}-`:"")+t);continue}let r="--"+((e.length?`${e}-`:"")+t).replace(/([A-Z])/g,i=>`-${i}`.toLowerCase());document.documentElement.style.setProperty(r,n[t])}}const M={};function pn(n){for(let e in n)M[e]=n[e];n.styles&&yt(n.styles),gt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=M}const gn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function mn(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const yn="masterId",wn="masterEntity";function _e(n,e){if(!Array.isArray(e))return;if(mn(e))return t(e);e.forEach(t);function t(r){n.append(wn,r[0]),n.append(yn,r[1].toString())}}class v{static async anonymousGetList(e){return await y(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,o)=>r.append(i,o),r=new URLSearchParams;if(e.fields){const i=e.fields;typeof i=="string"?t("fields",i):Array.isArray(i)?t("fields",i.join(" ")):typeof i=="object"&&t("fields",Object.keys(i).join(" "))}if(e.order){let i=e.order;const u=(Array.isArray(i)?[i]:Object.entries(i)).map(([a,c="desc"])=>`@${a} ${c}`).join(",");t("order",u)}return e.limit&&t("limit",e.limit.toString()),e.offset&&t("offset",e.offset.toString()),e.filter&&t("filter",e.filter.toString()),e.useUsageContext&&r.append("useUsageContext",e.useUsageContext.toString()),r}static async getList(e,t){const r=v.getSearchParamsForEntityListRead(t||{});return await y(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=v.getSearchParamsForEntityListRead(t||{});return y(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,t,r){const i=new URLSearchParams;return _e(i,r==null?void 0:r.masterEntities),y(`/close-api/data/${e}?${i.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:t})})}static update(e,t,r,i={}){return y(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static readById(e,t,r={}){const i=new URLSearchParams;if(r.fields){let o=r.fields;typeof o=="string"&&(o=[o]),i.append("fields",o.join(" "))}return y(`/close-api/data/entities/${e}/id/${t}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,t,r,i){const o=new URLSearchParams;return _e(o,i==null?void 0:i.masterEntities),y(`/close-api/data/entities/${e}/id/${t}?${o.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r,version:i==null?void 0:i.version})})}static removeById(e,t,r){const i=typeof t=="number"?{Id:t}:t;return v.removeByKeys(e,i,r)}static removeByKeys(e,t,r){return y(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}var wt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},We=(n,e,t)=>(wt(n,e,"read from private field"),t?t.call(n):e.get(n)),Et=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Ct=(n,e,t,r)=>(wt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),re,Se;const Ue=class Q extends I{constructor(e){super(),Et(this,re,[]),Et(this,Se,!1),this.hashParams="",this.offset=0,this.name=e.name}set wait(e){Ct(this,Se,e),this.emit(Q.EVENT_CHANGE_WAIT,e)}get wait(){return We(this,Se)}read(e){var i,o;this.wait=!0;const t={};e.order&&(t.order={[(i=e.order)==null?void 0:i.name]:(o=e.order)==null?void 0:o.duration}),e.fields&&(t.fields=e.fields),e.filter&&(t.filter=e.filter);const r=JSON.stringify(t.order)+JSON.stringify(t.filter);return r!==this.hashParams&&(this.offset=0,this.hashParams=r),e.limit&&(t.limit=e.limit),e.offset&&(t.offset=e.offset||this.offset),v.getList(this.name,t).then(u=>(this.offset===0&&(this.array=[]),this.offset+=t.limit,u)).then(u=>{this.array.push(...u)}).then(()=>this.emit(Q.EVENT_DATA,this.array)).finally(()=>{this.wait=!1})}set array(e){Ct(this,re,e),this.emit(Q.EVENT_DATA,this.array)}add(e){We(this,re).push(...e),this.emit(Q.EVENT_DATA,this.array)}get array(){return We(this,re)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static getCellInfo(e,t){const r=Q.getCellName(e),i=(()=>{let o=r?ee(t,r):null;return o===void 0&&(o=null),e.value?e.value(o,t):o})();return{name:r,value:i}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}};re=new WeakMap,Se=new WeakMap,Ue.EVENT_DATA="LIST:DATA",Ue.EVENT_CHANGE_WAIT="LIST:UPDATE-WAIT";let _t=Ue;const z=Symbol("__ROW_INDEX__");let je=class extends _t{constructor(e){super(e),this.rowIndex=1,this.changes={new:{},edit:{},remove:[]},this.save=()=>{}}get changed(){return Object.keys(this.changes.new).length||Object.keys(this.changes.edit).length||this.changes.remove.length}create(e){const t=this.wrapData(e);this.changes.new[t[z]]=t,this.emitChanges()}cleanChanges(){this.changes.new={},this.changes.edit={},this.changes.remove=[],this.emitChanges()}edit(e,t){const r=this.wrapData(t,e);if(this.changes.new[e])return this.changes.new[e]=r,this.emitChanges();this.array.find(i=>i[z]===e)&&(this.changes.edit[e]={...this.changes.edit[e],...r},this.emitChanges())}remove(e){if(this.changes.new[e])return delete this.changes.new[e],this.emitChanges();this.array.find(t=>t[z]===e)&&(delete this.changes.edit[e],this.changes.remove.includes(e)||this.changes.remove.push(e),this.emitChanges())}wrapData(e,t){return t===void 0&&!Object.prototype.hasOwnProperty.call(e,z.toString())&&(t=++this.rowIndex),{...e,[z]:t}}emitChanges(){this.emit(S.Form.EVENT_CHANGED,!0)}set array(e){super.array=e.map(t=>this.wrapData(t))}get array(){return super.array}log(e){console.log(`[table] ${e}`)}};je.PROVIDE_NAME="table-controller";function En(n){const e=s.reactive(n.array);s.provide(je.PROVIDE_NAME,n);const t=s.reactive(n.changes);n.on(_t.EVENT_DATA,u=>e.splice(0,e.length,...u)),n.on(S.Form.EVENT_CHANGED,()=>{t.new=Object.keys(n.changes.new).reduce((u,a)=>{const c=Number(a);return u[c]=n.changes.new[c],u},{})});const r=s.computed(()=>[...e.reduce((u,a)=>{const c=a[z];return n.changes.remove.includes(c)||u.push({...a,...n.changes.edit[c]}),u},[]),...Object.values(t.new)]),i=S.Form.getParentForm();return i==null||i.subscribe(n),{activeRow:s.ref(null),array:r}}function Cn(n,e){n.read=()=>v.getList(n.name,{fields:e==null?void 0:e.fields}).then(t=>n.array=t).then(()=>n.emit(S.Form.EVENT_READ,n.array)),n.save=()=>{const t=n.name;Object.values(n.changes.new).forEach(async i=>{await v.create(t,i)}),Object.entries(n.changes.edit).forEach(async([i,o])=>{await v.updateById(n.name,r(Number(i)),o)});function r(i){const o=n.array.find(u=>u[z]===i);return o.id|o.Id}n.changes.remove.forEach(async i=>{await v.removeById(t,r(i),0)}),n.emit(S.Form.EVENT_SAVE)}}const hi="",_n=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Sn{static readHistoryById(e,t){return y(`/close-api/audits/history/${e}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(r=>{const i=r.history.map(o=>{if(!o.changes)return o;const u=o.changes.map(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...o,changes:u}});return{...r,history:i}})}}var St=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},B=(n,e,t)=>(St(n,e,"read from private field"),t?t.call(n):e.get(n)),G=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},J=(n,e,t,r)=>(St(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),be,ie,Te,Ne,se,oe,qe;const H="_______LIST_______ROW_______INDEX________NAME_______",ae=class V extends I{constructor(e){super(),this.LIST_ROW_KEY=1,G(this,be,void 0),this.array=[],G(this,ie,[]),G(this,Te,[]),G(this,Ne,new Proxy({},{set:(t,r,i,o)=>(t[r]=i,this.emit(V.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(V.EVENT_FILTERS_UPDATE,t),!0)})),G(this,se,!1),G(this,oe,(...t)=>Promise),G(this,qe,()=>{}),J(this,be,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&J(this,ie,e.config)}set config(e){J(this,ie,e.map(S.utils.copyObject)),this.emitUpdateConfig()}get config(){return B(this,ie)}emitUpdateConfig(){this.emit(V.EVENT_CONFIG_UPDATE,this.config)}get order(){return B(this,Te)}set order(e){J(this,Te,e),this.emit(V.EVENT_ORDER_UPDATE,this.order)}get filters(){return B(this,Ne)}set filters(e){At(B(this,Ne),e)}set wait(e){J(this,se,e),this.emit(S.Form.EVENT_WAIT,B(this,se))}get wait(){return B(this,se)}get primaryKeys(){return B(this,be)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[H]===e)}indexByKey(e){return this.array.findIndex(t=>t[H]===e)}static getKey(e){return e[H]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,H)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(V.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const t=this.indexByKey(e);t!==-1&&(this.array.splice(t,1),this.emit(V.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(V.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[H]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,H)}set read(e){J(this,oe,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=B(this,oe).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){J(this,oe,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>B(this,qe).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static mergeWithKey(e,t){return{...e,[H]:t}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,t){const r=V.getCellName(e),i=(()=>{let o=r?ee(t,r):null;return o===void 0&&(o=null),e.value?e.value(o,t):o})();return{name:r,value:i}}};be=new WeakMap,ie=new WeakMap,Te=new WeakMap,Ne=new WeakMap,se=new WeakMap,oe=new WeakMap,qe=new WeakMap,ae.EVENT_DATA="list-data: update",ae.EVENT_CONFIG_UPDATE="list-config:update",ae.EVENT_ORDER_UPDATE="list-order:update",ae.EVENT_FILTERS_UPDATE="list-filters:update";let W=ae;function bt(n,e){let t="",r=0,i=!1,o;n.read=(u={})=>{if(n.wait)return o;if(u.clean&&(t="",r=0,i=!1),i)return Promise.resolve([]);let a=e;typeof a=="function"&&(a=a());const c={};if(!n.name)throw new Error("Reading list`s data without name is not available.");a.order&&Array.isArray(a.order)&&a.order.length&&(c.order={[a.order[0]]:a.order[1]||"asc"}),a.fields&&(c.fields=a.fields),a.filter&&(c.filter=a.filter);const h=JSON.stringify(c.order)+JSON.stringify(c.filter)+JSON.stringify(c.fields);return h!==t&&!Number.isNaN(h)&&(r=0,t=h),"limit"in a&&(c.limit=a.limit),c.offset=r||a.offset||0,o=v.getList(n.name,c).then(l=>((r===0||u.clean)&&n.set([]),r+=c.limit,l)).then(l=>(n.add(...l),l.length===0&&(i=!0),l)),o}}function Tt(n){const e=s.reactive({wait:n.wait,array:[]});return n.on(W.EVENT_DATA,t=>{e.array.splice(0,e.array.length,...t.map(r=>Object.freeze(JSON.parse(JSON.stringify(r)))))}),n.on(S.Form.EVENT_WAIT,()=>{e.wait=n.wait}),e}function Nt(n,e){const t="list-flex-config",r=s.inject(t,void 0);if(r)return r;if(!n||!e)throw new Error("Hook useProvideList has two required params: list and defaultSettings");n.on(W.EVENT_CONFIG_UPDATE,()=>{n.read()});const i={list:n,defaultSettings:e};return s.provide(t,i),i}function bn(n){const e=s.reactive([...n.config]);return n.on(W.EVENT_CONFIG_UPDATE,t=>{e.splice(0,e.length,...t)}),e}function vt(n){const e=n.order||[],t=s.reactive(e);return n.on(W.EVENT_ORDER_UPDATE,r=>{t.splice(0,t.length,...r),n.read()}),t}function Tn(n){const e=s.ref(""),t=s.computed(()=>{const r=e.value.toLowerCase();return s.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function At(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Nn(n){const e=s.reactive(S.utils.copyObject(n.filters));return n.on(W.EVENT_FILTERS_UPDATE,t=>{At(e,t),n.read()}),e}function vn(n){const e=s.reactive([]);function t(a){return e.includes(a)}function r(a){t(a)||e.push(a)}function i(a){const c=e.findIndex(h=>h===a);c!==-1&&e.splice(c,1)}function o(a){const c=s.unref(n);if(a===void 0){e.length===0?c.forEach(r):c.forEach(i);return}t(a)?i(a):r(a)}const u=s.computed(()=>{const a=s.unref(n);return e.length===a.length&&a.length!==0});return[e,o,u,r,i]}class An extends W{constructor(e){super(e),this.changes=[],this.save=kn.bind(this)}get changed(){return!!this.changes.find(e=>e.status==="active")}addChange(e,t){this.changes.push({type:e,status:"active",data:this.wrapItem(t)})}}function kn(){const n=this.changes.filter(e=>e.status==="active");return De(n.map(e=>{console.log("++")}))}function On(){const n=s.ref(null);function e(t){n.value=t&&en(t)}return{activeRow:n,activateRow:e}}const In=Object.freeze(Object.defineProperty({__proto__:null,List:W,Table:An,useListOrder:vt,useListProvide:Nt,useListRead:bt,useListState:Tt,useTableActiveRow:On},Symbol.toStringTag,{value:"Module"}));class $n extends I{constructor(){super(),this.EVENT_NEW="event:new-metadata",this.store={}}get(e){return this.store[e]}async load(e){return this.store[e]||this.set(e,await this.loadEntityInformation(e)),this.store[e]}set(e,t){this.store[e]=t,this.emit(this.EVENT_NEW,{entityName:e})}async loadEntityInformation(e){return await ze.get(e)}}const ce=new $n;function Ln(n){const e=s.ref(ce.get(n));return ce.on(ce.EVENT_NEW,t=>{n===t.entityName&&(e.value=ce.get(n))}),e}function Pn(n,e){try{return e.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(t){Ot().error("prettify value by metadata",n,t)}}class Fn{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return y(`/open-api/internationalization/language/${e}`)}}let x={};function Y(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=S.utils.getPropFromObject((this==null?void 0:this.vocabulary)||x,n);if(typeof t=="string")return kt(t,e);const r=S.utils.getPropFromObject(x==null?void 0:x.root,n);return typeof r=="string"?kt(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function kt(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}Y.setGlobalVocabulary=function(n){x=n},Y.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),Y.bind({vocabulary:S.utils.getPropFromObject(x,e.toLowerCase())})},Y.setVocabulary=function(n){return typeof n=="string"&&(n=S.utils.getPropFromObject(x,n)),Y.bind({vocabulary:n})};const Rn=function(){let n=!1;const e=[];function t(){return n}function r(c,h){t()&&console[c](...h),e.push(h)}function i(...c){r("log",c)}function o(...c){r("warn",c)}function u(...c){r("error",c)}function a(c=!0){n=c}return{info:i,warn:o,history:e,display:a,error:u}}();function Ot(){return Rn}class A{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw F.AuthServiceError(e.title,t)}static login(e){return y(M.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:M.applicationName})}).catch(A.parseError)}static registration(e){return e.AppName=M.applicationName,y(M.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(A.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw F.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return A.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return A.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return A.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return A.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return y(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(A.parseError)}static startLoginProcess(e){return A.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return A.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return A.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return y(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(A.parseError).then(A.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw F.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}const It=class pe{static async create(e){return y(pe.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const t=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return y(pe.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return y(`${pe.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return y(`${pe.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};It.url="/close-api/communications";let le=It;class Dn{static async getDefaultView(e){return y("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function $t(n){return{...n,createdEntities:n.createdEntites}}const Lt=class Re{static async getStartConfig(e,t){return y([Re.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return y([Re.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then($t)}static async runStep(e,t,r,i,o){return y([Re.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:o})}).then($t)}};Lt.url="/close-api/views/process-wizard";let ve=Lt;class ze{static get url(){return"/close-api/metadata"}static async get(e,t,r){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const i=new URLSearchParams;return t&&i.append("criteria",t),r&&i.append("id",String(r)),await fetch(this.url+`/${e}?${i.toString()}`,{method:"GET"}).then(o=>o.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return _e(i,r),t&&i.append("id",t),y([this.url,e].join("/")+`?${i.toString()}`)}static getFieldInformation(e,t){return y(`/open-api/metadata/${e}/fields/${t}`)}static getTreatmentListField(e,t){return y(`/open-api/metadata/${e}/list-fields/${t}`)}}class Bn{static async upload(e,t){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${t}`;return await fetch(i,{method:"POST",body:r}).then(o=>o.json()).then(o=>(o.filename=e.name,o))}}class Vn{static invite(e,t,r){return y("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:t,relatedRoleCode:r})})}static accept(e,t){return y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!0})})}static decline(e,t){return y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class Ge{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return y(Ge.url+e,{method:"POST",body:JSON.stringify(t)})}}class Mn{static getConfiguration(){return y("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class Pt{static url(){return"/close-api/actions"}static async get({criterion:e}){const t=new URLSearchParams;return e&&t.append("criterion",e),await fetch(this.url()+`?${t.toString()}`,{method:"GET"}).then(r=>r.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return _e(i,r),y([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}const Ft=class Zt extends I{constructor(e=[]){super(),this.array=s.reactive([]),this.defaultArray=[],this.setDefault(e)}emitUpdate(){this.emit(Zt.EVENT_DATA,this.array)}setDefault(e){const t=JSON.parse(JSON.stringify(e));this.defaultArray=t,this.set(t)}revert(){this.set(this.defaultArray)}set(e){this.array.splice(0,this.array.length,...e),this.emitUpdate()}append(e){this.array.push(e),this.emitUpdate()}moveTo(e,t){if(this.isOutOfRange(e)||this.isOutOfRange(t))throw new Error(`Provided position is out of range: ${e}, ${t}`);const r=this.array[e];this.array.splice(e,1),this.array.splice(t,0,r),this.emitUpdate()}remove(e){this.array.splice(e,1),this.emitUpdate()}isOutOfRange(e){return!(e>=0&&e<this.array.length)}};Ft.EVENT_DATA="list-config:update";let Wn=Ft;class Un extends I{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return le.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return le.read(e).then(t=>t.length===0?le.create(e):t[0])}}function jn(n){const e=S.Form.getParentForm();e?e.subscribe(n):console.warn(F.ParentFormNotFound());const t=s.reactive([]);return n.read=()=>le.readMessages(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function qn(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function $(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(o=>typeof o=="string"?`'${o}'`:o).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(qn(r)){let i=function(o){var u;return((u=o.match(/([^Z]*)/))==null?void 0:u[0])+"0000Z"};return r.start&&e.push(`@${t} ge ${i(r.start)}`),r.end&&e.push(`@${t} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${t} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${t} eq '${r}'`),e):(r===null&&e.push($.is(t,r)),e)},[]).join(" and ")}function ue(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${ue(t)}`},$.beginWith=function(e,t){return`@${e} BeginWith ${ue(t)}`},$.notEq=function(e,t){return`@${e} nq ${ue(t)}`},$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${ue(t)}`},$.in=function(e,t){const r=t.map(ue).join(", ");return`@${e} in (${r})`},$.and=function(...e){return e.join(" and ")},$.is=function(e,t){return`@${e} is ${t}`},$.or=function(...e){return e.join(" or ")};function zn(n,e="images"){return`/static-folder/${e}/${n}`}function Gn(n,e,t){return n.reduce((r,i)=>{var a;let o=typeof e=="function"?e(i):i[e];const u=(a=r[r.length-1])==null?void 0:a.value;return u&&t(u,o)?r[r.length-1].array.push(i):r.push({value:o,array:[i]}),r},[])}function Jn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Hn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function xn(n,e){const t=s.ref(null);function r(){return n.name?ze.getById(n.name,e,[]).then(i=>{t.value=i,i.fields.forEach(o=>{o.canSet?n.enable(o.name):n.disable(o.name)})}).catch(()=>{t.value=null;const i=F.MetadataEntityIsNotAvailable(n.name||"FORM_WITHOUT_NAME");K.add("error",i.message)}):Promise.reject()}return n.on(S.Form.EVENT_READ,r),{metadata:t,update:r}}class Je extends Error{static UndefinedStatus(){return new Je("Status is undefined.")}}class Kn extends Je{}function Yn(n,e){const t=s.reactive([]);async function r(o,u){if(!o)throw Kn.UndefinedStatus();const a=await Pt.get({criterion:o});t.splice(0,t.length),t.push(...a.map(c=>i(c,u)))}return{actions:t,update:r};function i(o,u){return{title:o.title,callback:()=>(()=>Promise.resolve().then(()=>{if(n.changed)return n.save()}).then(()=>fetch(o.url,{method:"POST",body:JSON.stringify({keys:{Id:u},contextId:C.contextId}),headers:{"Content-Type":"application/json"}})).then(c=>c.json()).then(c=>{if(!c.success)throw e!=null&&e.ModalValidationResult&&c.validationEffect?tn.openModal(e.ModalValidationResult,{rules:c.validationEffect.results}):K.add("error",c.message),new Error;return c}).then(c=>{c.message&&K.add("info",c.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(c.affectedEntities)}).then(()=>n.read()))()}}}class Ae{static url(){return"/close-api/presentation"}static getStatuses(e,t){return fetch(`${Ae.url()}/status/${e}/${t}`).then(r=>r.json())}}function Xn(n){const e=s.reactive({title:"Loading",type:"wait"});function t(r){if(n.name&&Number.isInteger(r))return Ae.getStatuses(n.name,r).then(i=>{e.type=i.type,e.title=i.name})}return n.on(S.Form.EVENT_READ,r=>{var u,a;const{code:i,name:o}={code:(u=r.Status)==null?void 0:u.Code,name:(a=r.Status)==null?void 0:a.Name};return n.name?!Number.isInteger(i)&&!o?void console.log("Undefined code or name is Status prop."):Ae.getStatuses(n.name,i).then(c=>{e.type=c.type,e.title=o}):void console.log("Form without name.")}),{label:e,update:t}}function Zn(n,e){const t=nt.useRoute(),r=s.computed(()=>Number(t.params.id)),i=s.reactive({ready:!1,show:!1});return s.watch(()=>r.value,()=>{i.ready=!1}),s.watch(()=>r.value,()=>{Number.isInteger(r.value)&&n.read()},{immediate:!0}),n.read=ne.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return v.readById(n.name,r.value,{fields:e.fields})}).then(ne.valuesToUpperCase).then(o=>(Number.isInteger(o.Version)&&(n.version=o.Version),n.setValues(o),i.show=!0,o)).catch(o=>{throw Object.prototype.hasOwnProperty.call(o,"status")&&[403,404].includes(o.status)&&(i.show=!1),o}).finally(()=>{i.ready=!0})),n.save=ne.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return v.updateById(n.name,r.value,n.changes,{version:n.version})}).then(o=>{n.version=o.version})),n.on(S.Form.EVENT_SAVE,n.read.bind(n)),{formShadowState:i}}function Qn(){const n=s.reactive({contextId:C.contextId,person:C.person,organizations:C.organizations,ready:C.ready,user:C.user}),e=s.computed(()=>{if(!C.ready||!C.person)return null;const r=n.contextId;return C.person.id===r?C.person:C.organizations.find(i=>i.id===r)||null}),t=s.computed(()=>{var r;return n.contextId===((r=n.person)==null?void 0:r.id)});return C.onupdateContext(r=>{n.contextId=r}),C.onupdateData(()=>{n.person=C.person,n.organizations=C.organizations,n.user=C.user}),C.onReady(r=>{n.ready=r}),{state:s.readonly(n),currentContext:e,isPerson:t}}function er(n,e){const t=s.reactive({ready:!1,show:!1});function r(){t.ready=!1,t.show=!1}return n.read=()=>{let i=e();return Promise.resolve().then(()=>{if(!n.name)throw F.EntityWithoutName("Use Form Request");return v.readById(n.name,i.id,{fields:i.fields})}).then(ne.valuesToUpperCase).then(o=>(o.hasOwnProperty("Version")&&(n.version=Number(o.Version)),n.setValues(o),t.show=!0,o)).catch(o=>{const u=ot(o);throw K.add("error",u.message),u}).finally(()=>{t.ready=!0})},n.save=()=>{let i=e();return Promise.resolve().then(()=>{if(!n.name)throw F.EntityWithoutName("Use Form Request");return v.updateById(n.name,i.id,n.changes,{version:n.version})}).then(o=>{n.version=o.version||o.Version}).catch(o=>{const u=ot(o);throw K.add("error",u.message),u})},n.on(S.Form.EVENT_SAVE,n.read.bind(n)),{shadowFormState:t,initShadow:r}}class tr{static getRequiredDocuments(e,t,r){const i=new URLSearchParams({entity:e,primaryKey:t,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(o=>o.json())}}class X{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${X.url()}/calculator/${e}`)}static calculate(e,t){return y(`/${X.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:t})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):F.ApiNotAvailable()})}static parseMetadataField(e){function t(r){switch(r.type){case"ValueType":switch(r.dataType){case"Integer":return"number";default:return r.dataType}case"EntityReference":return r.dataType}}return{name:e.name,label:e.title,required:e.required,type:t(e)}}static createOnlinePayment(e,t){return y(`/${X.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return y(`/${X.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class nr{static getListSettings(e,t){const r=new URLSearchParams;r.set("entity",e),t&&r.set("mark",t);const i=`/close-api/views/list/configs?${r.toString()}`;return y(i)}}function rr(n){return n.statusName==="Completed"}function ir(n){return n.statusName==="FinalStepWithConfirmation"}function sr(n){return n.statusName==="ValidationError"}function or(n,e,t){let r=null;const i=s.reactive({wait:null});let o=[],u=null;const a=s.ref(null);function c(){a.value=o.find(w=>w.name===u)||null}function h(){var w;return u?((w=o.find(T=>T.name===u))==null?void 0:w.fields)||[]:[]}function l(w){if(c(),sr(w))return void t.onValidation(w.validationResults);if((w.statusName==="FinalStep"||w.statusName==="NextStep")&&(!h().length||ar(h(),t.presets)))return _(t.presets||{});rr(w)&&t.onCompleted(w),ir(w)&&t.onConfirmation(w)}async function p(){try{await f(),await E()}catch(w){const{message:T}=Ie(w);Le.add("error",T)}}function f(){return i.wait="Loading process information.",ve.getStartConfig(e,n).then(w=>{o=w.steps.map(T=>({label:T.title,name:T.stepName,number:T.number,fields:T.frontendEntity.objectTypes.reduce((k,O)=>(O.properties.forEach(R=>{k.push({name:R.name,label:R.title,type:R.refEntityName||R.dataType})}),k),[])}))}).then(w=>(i.wait=!1,w))}function g(w){return u=w.nextStepName,r=w.token,w}function m(w){const T=Ie(w);Le.add("error",T.message)}function E(){return i.wait="Starting process",ve.startProcess(e,n).then(g).then(l).catch(m).finally(()=>{i.wait=null})}function _(w={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Expect the result",ve.runStep(e,n,u,r,w).then(g).then(l).catch(m).finally(()=>{i.wait=!1}))}return{initialize:p,state:i,currentStepConfig:s.readonly(a),next:_}}function ar(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!S.utils.getPropFromObject(e,r.name))return!1}return!0}const cr="close-api/proxy/Equipment/Search";class lr{static search(e,t,r,i,o){const u=new URLSearchParams;u.append("pattern",e||""),t&&u.append("categoryId",t),r&&u.append("useType",String(r)),i&&u.append("statusCode",i),o&&(u.append("limit",String(o.limit)),u.append("offset",String(o.offset)));const a=`/${cr}?${u.toString()}`;return y(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const ur={class:"widget-table__head"},dr={class:"widget-table__head-label margin_0 text_overflow"},fr=s.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("tr",ur,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.config,(r,i)=>(s.openBlock(),s.createElementBlock("th",{class:"widget-table__head-cell",key:i},[s.createElementVNode("p",dr,s.toDisplayString(r.label),1)]))),128))]))}}),pi="",U=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},hr=U(fr,[["__scopeId","data-v-25198f4a"]]);function pr(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function Rt(n,e){const t=pr(n);let r=t?S.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function gr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var He={exports:{}},xe,Dt;function mr(){if(Dt)return xe;Dt=1;var n=1e3,e=n*60,t=e*60,r=t*24,i=r*7,o=r*365.25;xe=function(l,p){p=p||{};var f=typeof l;if(f==="string"&&l.length>0)return u(l);if(f==="number"&&isFinite(l))return p.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function u(l){if(l=String(l),!(l.length>100)){var p=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(p){var f=parseFloat(p[1]),g=(p[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*i;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*t;case"minutes":case"minute":case"mins":case"min":case"m":return f*e;case"seconds":case"second":case"secs":case"sec":case"s":return f*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function a(l){var p=Math.abs(l);return p>=r?Math.round(l/r)+"d":p>=t?Math.round(l/t)+"h":p>=e?Math.round(l/e)+"m":p>=n?Math.round(l/n)+"s":l+"ms"}function c(l){var p=Math.abs(l);return p>=r?h(l,p,r,"day"):p>=t?h(l,p,t,"hour"):p>=e?h(l,p,e,"minute"):p>=n?h(l,p,n,"second"):l+" ms"}function h(l,p,f,g){var m=p>=f*1.5;return Math.round(l/f)+" "+g+(m?"s":"")}return xe}function yr(n){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=u,t.humanize=mr(),t.destroy=h,Object.keys(n).forEach(l=>{t[l]=n[l]}),t.names=[],t.skips=[],t.formatters={};function e(l){let p=0;for(let f=0;f<l.length;f++)p=(p<<5)-p+l.charCodeAt(f),p|=0;return t.colors[Math.abs(p)%t.colors.length]}t.selectColor=e;function t(l){let p,f=null,g,m;function E(..._){if(!E.enabled)return;const w=E,T=Number(new Date),k=T-(p||T);w.diff=k,w.prev=p,w.curr=T,p=T,_[0]=t.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");let O=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(j,N)=>{if(j==="%%")return"%";O++;const de=t.formatters[N];if(typeof de=="function"){const Pe=_[O];j=de.call(w,Pe),_.splice(O,1),O--}return j}),t.formatArgs.call(w,_),(w.log||t.log).apply(w,_)}return E.namespace=l,E.useColors=t.useColors(),E.color=t.selectColor(l),E.extend=r,E.destroy=t.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(g!==t.namespaces&&(g=t.namespaces,m=t.enabled(l)),m),set:_=>{f=_}}),typeof t.init=="function"&&t.init(E),E}function r(l,p){const f=t(this.namespace+(typeof p>"u"?":":p)+l);return f.log=this.log,f}function i(l){t.save(l),t.namespaces=l,t.names=[],t.skips=[];let p;const f=(typeof l=="string"?l:"").split(/[\s,]+/),g=f.length;for(p=0;p<g;p++)f[p]&&(l=f[p].replace(/\*/g,".*?"),l[0]==="-"?t.skips.push(new RegExp("^"+l.slice(1)+"$")):t.names.push(new RegExp("^"+l+"$")))}function o(){const l=[...t.names.map(a),...t.skips.map(a).map(p=>"-"+p)].join(",");return t.enable(""),l}function u(l){if(l[l.length-1]==="*")return!0;let p,f;for(p=0,f=t.skips.length;p<f;p++)if(t.skips[p].test(l))return!1;for(p=0,f=t.names.length;p<f;p++)if(t.names[p].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function c(l){return l instanceof Error?l.stack||l.message:l}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}var wr=yr;(function(n,e){e.formatArgs=r,e.save=i,e.load=o,e.useColors=t,e.storage=u(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const h="color: "+this.color;c.splice(1,0,h,"color: inherit");let l=0,p=0;c[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(l++,f==="%c"&&(p=l))}),c.splice(p,0,h)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function o(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c=process.env.DEBUG),c}function u(){try{return localStorage}catch{}}n.exports=wr(e);const{formatters:a}=n.exports;a.j=function(c){try{return JSON.stringify(c)}catch(h){return"[UnexpectedJSONParseError]: "+h.message}}})(He,He.exports);var Er=He.exports;const Bt=gr(Er);function Vt(n){return["eservices-core",n].join(":")}function Mt(n){return Ke(n,"YYYY/MM/DD HH:mm:ss")}function Ke(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return nn.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const gi="",ke=U({props:{name:String},setup(n,e){let t="unknown";try{t=e.slots.default()[0].children}catch{t=n.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>s.h("i",{class:`icon icon-${t}`})}},[["__scopeId","data-v-e287c8d9"]]),Cr=Bt(Vt("setup-list-row"));function _r(n,e){const t=n.config.map(r=>Sr(r,n,e));return s.h("tr",{class:"widget-table__row widget-table-row"},t)}function Sr(n,e,t){const r=e.values;let i=Rt(n,r);const o={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(l){o.onClick.push(()=>l(r))}function a(l){Array.isArray(l)?o.class.push(...l):o.class.push(l)}const c=[],h=[];if(n.hide&&n.hide(r))return[s.h("td")];if(n.type)switch(a(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Ke(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Mt(typeof i=="string"?i:null);break}case"money":{i=Gt(i);break}case"multi-select":{h.push(s.h(S.FormField,{type:"single-checkbox",modelValue:e.selected})),u(Wt.bind(null,t,!0));break}case"select":{h.push(s.h(S.FormField,{type:"single-radio",modelValue:e.selected})),u(Wt.bind(null,t,!1));break}}if(n.onClick&&u(n.onClick),n.link)try{const l=n.link(r);if(l){const p=s.h(nt.RouterLink,{to:l});h.push(p),a("widget-table-cell_link")}}catch(l){Cr("Can't add router link",l)}return n.href&&(h.push(s.h("a",{href:n.href(r),target:"_blank"})),a("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&h.push(s.h("p",{class:"widget-list-cell-text"},i)),n.icon&&h.push(s.h(ke,{name:n.icon})),n.class&&(typeof n.class=="function"?a(n.class(r)):a(n.class)),c.push(s.h("td",o,h)),c}function Wt(n,e){n.emit("select",e)}function Ut(n,e){return()=>{try{return _r(n,e)}catch(t){return console.warn(t),null}}}const br={props:{values:Object,config:Object,selected:Boolean},setup:Ut},Tr=["colspan"],jt=s.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=s.ref();return s.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(s.openBlock(),s.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[s.createElementVNode("td",{colspan:r.rowLength},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(r.component),s.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=o=>e("close")),onSave:i[1]||(i[1]=o=>e("save",o))}),null,16,["values","new"]))],8,Tr)],512))}}),Ye={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go."},Nr={class:"widget-table"},qt="update:selectedRows",vr=s.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{}},emits:["update:activeRow","save"],setup(n,{emit:e}){const t=n,r=s.useSlots(),i=s.computed(()=>{var a;return(a=r==null?void 0:r.default)==null?void 0:a.call(r)[0]});function o(a,c=!0){if(!t.selectedRows)return;if(!c)return e(qt,t.selectedRows.includes(a)?[]:[a]);const h=[...t.selectedRows],l=h.indexOf(a);return l===-1?h.push(a):h.splice(l,1),e(qt,h)}function u(a){e("save",a),e("update:activeRow",null)}return(a,c)=>(s.openBlock(),s.createElementBlock("div",null,[s.createElementVNode("table",Nr,[s.createVNode(hr,{config:a.config},null,8,["config"]),s.createElementVNode("tbody",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.array,(h,l)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:l},[s.createVNode(br,{config:a.config,values:h,selected:a.selectedRows.includes(h),onSelect:p=>o(h,p),class:s.normalizeClass(a.classCallback?a.classCallback(h):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&a.activeRow===h?(s.openBlock(),s.createBlock(jt,{key:0,component:i.value,"row-length":a.config.length,values:h,onClose:c[0]||(c[0]=p=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):s.createCommentVNode("",!0)],64))),128)),a.activeRow===s.unref(Ye).LIST_ACTIVE_NEW?(s.openBlock(),s.createBlock(jt,{key:0,component:i.value,"row-length":a.config.length,onClose:c[1]||(c[1]=h=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):s.createCommentVNode("",!0)])])]))}}),Ar=s.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("div",{class:"widget-spinner",style:s.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}}),yi="",Oe=U(Ar,[["__scopeId","data-v-0ef9ae88"]]),kr={class:"widget-button"},Or=s.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("button",kr,[e.wait?(s.openBlock(),s.createBlock(Oe,{key:0,class:"widget-button-spinner"})):s.createCommentVNode("",!0),s.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),wi="",Ir=U(Or,[["__scopeId","data-v-450dc564"]]),$r={class:"widget-multi-button-wrap position_relative cursor_pointer"},Lr={class:"widget-multi-button-body grid"},Pr=["onClick"],Fr={class:"widget-multi-button-side-wrap"},Rr=s.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;s.useCssVars(u=>({"7025434e":r.value}));const t=s.reactive({active:!1,wait:!1}),r=s.computed(()=>e.array.length+(e.label?1:0));function i(u){if(!(typeof u!="function"||t.wait))return t.wait=!0,Promise.resolve().then(u).finally(()=>{t.wait=!1})}function o(u=!t.active){t.active=u}return(u,a)=>(s.openBlock(),s.createElementBlock("div",$r,[s.createElementVNode("div",{class:s.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[s.createElementVNode("div",Lr,[u.label?(s.openBlock(),s.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:a[0]||(a[0]=c=>o())},s.toDisplayString(u.label),1)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(u.array,(c,h)=>(s.openBlock(),s.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:h,onClick:l=>{i(c.callback),o(!1)}},s.toDisplayString(c.label),9,Pr))),128))]),s.createElementVNode("div",Fr,[s.createElementVNode("div",{class:s.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:a[1]||(a[1]=c=>o())},[t.wait?(s.openBlock(),s.createBlock(s.unref(Oe),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(s.openBlock(),s.createBlock(s.unref(ke),{key:1,class:"widget-multi-button-side-icon"},{default:s.withCtx(()=>[s.createTextVNode("angle-small-down")]),_:1})):s.createCommentVNode("",!0)],2)])],2)]))}}),Ei="",Dr=U(Rr,[["__scopeId","data-v-a8d711d1"]]),Br={class:"widget-loader flex flex-align_center gap_10 padding_15"},Vr={class:"text_md"},Mr=s.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(s.openBlock(),s.createElementBlock("div",Br,[s.createVNode(Oe,{color:"var(--primary)",class:"padding_10"}),s.createElementVNode("span",Vr,s.toDisplayString(e.label),1)]))}}),Wr=["alt","src"],Ur=s.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=s.ref();return s.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(s.openBlock(),s.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,Wr))}}),jr={props:{config:Array,values:Object,selected:Boolean},setup:Ut},Ci="",qr=U(jr,[["__scopeId","data-v-344a8cc1"]]),zr=n=>(s.pushScopeId("data-v-4e1d87c8"),n=n(),s.popScopeId(),n),Gr={class:"head-cell"},Jr=zr(()=>s.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Hr=s.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(n,{emit:e}){const t=n;return t.title&&console.warn(`For cell ${t.name} using title,it should be replaced with label.`),(r,i)=>(s.openBlock(),s.createElementBlock("th",null,[s.createElementVNode("div",Gr,[s.createElementVNode("div",{class:"head-cell-content flex_grow",style:s.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(s.openBlock(),s.createBlock(s.unref(S.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=s.withModifiers(o=>e("select"),["stop","prevent"]))})):(s.openBlock(),s.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=o=>e("order"))},s.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(s.openBlock(),s.createBlock(s.unref(ke),{key:0,class:s.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:s.withCtx(()=>[s.createTextVNode("core-arrow-up")]),_:1},8,["class"])):s.createCommentVNode("",!0),Jr])]))}}),_i="",xr=U(Hr,[["__scopeId","data-v-4e1d87c8"]]),Kr=s.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=s.ref(),i=s.ref();s.onMounted(()=>{function c(g,m){let E=-1;do E++,m-=g[E];while(m>0&&E<g.length);return E}function h(g,m){let E=0;for(;m>0&&m>g[E]&&E<g.length;)m-=g[E],E++;return console.log(m,E),E>0?E:0}function l(g){try{i.value.style.insetInlineStart=g+"px"}catch(m){console.log(m)}}function p(g){try{i.value.style.width=g+"px",i.value.style.minWidth=g+"px",i.value.style.maxWidth=g+"px"}catch(m){console.log(m)}}function f(g){return g===null?!1:g.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(m){var Yt;function E(L){return L.screenX+T-R}const _=r.value,w=[..._.children].filter(L=>L.localName==="th"),T=((Yt=_.offsetParent)==null?void 0:Yt.scrollLeft)||0,k=w.map(L=>L.clientWidth),O=f(m.target),R=_.getBoundingClientRect().left,j=E(m),N=c(k,j),de=k.slice(0,N).reduce((L,D)=>L+D,0),Pe=j-de,et=_.offsetWidth,fe=w[N].clientWidth;if(t.config[N].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",m.screenX),console.log("Widths",k),console.log("max width",et),console.log("Start Position",j),console.log("Position From",N),console.log("Start Position",N),console.log("Global offset (Отступ самой таблицы от края экрана)",R),console.log("Del",Pe),console.groupEnd(),i.value.innerText=w[N].textContent||"",i.value.style.display="grid",i.value.style.width=fe+"px",i.value.style.cursor="grabbing",l(de),p(fe),document.addEventListener("pointermove",Kt,{passive:!0}),document.addEventListener("pointerup",xt);function xt(L){if(console.group("END"),document.removeEventListener("pointermove",Kt),document.removeEventListener("pointerup",xt),O&&(t.config[N].width=i.value.style.width,t.config[N].minWidth=i.value.style.width,t.config[N].maxWidth=i.value.style.width,o(t.config)),!O){const D=L.screenX+T-R;console.log("ENP Position",D);const Fe=h(k,D);if(console.log(N,"->",Fe),Fe!==N){const he=t.config[N],tt=t.config;tt.splice(N,1),tt.splice(Fe,0,he),o(tt)}else{const he=t.config[N].name;u(he)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Kt(L){if(O){const he=E(L)-j+fe;p(he);return}let D=L.screenX+T-R-Pe;D<0&&(D=0),D+fe>et&&(D=et-fe),l(D)}})});function o(c){e("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(t.order.length===0||t.order[0]!==c)return void a([c]);const h=t.order.length===1||t.order[1]==="asc"?"asc":"desc";a([c,h==="asc"?"desc":"asc"])}function a(c){e("update:order",c)}return(c,h)=>(s.openBlock(),s.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(c.config,(l,p)=>(s.openBlock(),s.createBlock(xr,s.mergeProps({key:l},l,{onOrder:f=>u(l.name),onSelect:h[0]||(h[0]=f=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),s.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),Si="",Yr=U(Kr,[["__scopeId","data-v-ccffc6bd"]]),Xr={class:"widget-list"},Zr={class:"widget-list-body position_relative"},Qr=50,ei=s.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(n,{emit:e}){const t=n;function r(a,c=!0){if(t.selectedRows)if(!c)o(t.selectedRows.includes(a)?[]:[a]);else{const h=[...t.selectedRows],l=h.indexOf(a);l===-1?h.push(a):h==null||h.splice(l,1),o(h)}}function i(){var a;if(((a=t.selectedRows)==null?void 0:a.length)!==t.array.length)return o([...t.array]);o([])}function o(a){e("update:selectedRows",a)}function u(a){if(!a)return;const c=a.target;c.scrollTop+c.clientHeight+Qr>c.scrollHeight&&e("scrollEnd")}return(a,c)=>(s.openBlock(),s.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[s.createElementVNode("table",Xr,[s.createElementVNode("thead",null,[s.createVNode(Yr,{onSelect:c[0]||(c[0]=h=>i()),"onUpdate:order":c[1]||(c[1]=h=>e("update:order",h)),"onUpdate:config":c[2]||(c[2]=h=>e("update:config",h)),config:a.config,order:a.order},null,8,["config","order"])]),s.createElementVNode("tbody",Zr,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.array,(h,l)=>{var p;return s.openBlock(),s.createBlock(qr,{key:l,class:"widget-list-row",values:h,config:a.config,selected:(p=a.selectedRows)==null?void 0:p.includes(h),onSelect:f=>r(h,f)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function ti(n){function e(...r){return t.wait?Promise.reject("The process has already started."):(t.wait=!0,Promise.resolve().then(()=>n(...r)).finally(()=>{t.wait=!1}))}const t=s.reactive({wait:!1,call:e});return t}function Ie(n){return typeof n=="string"?Xe(n):ni(n)?Xe(n.message):Xe(Ye.DEFAULT_ERROR_MESSAGE)}function ni(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function Xe(n){return{message:n}}function $e(n="error"){return function(e){const{message:t}=Ie(e);Le.add(n,t)}}function Ze(n,e){return Qe().emit("entity:read",{...e,entity:n})}function zt(n,e){return Qe().emit("entity:update",{...e,entity:n})}function ri(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function Gt(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}function ii(){const n=s.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const Z=Bt(Vt("use-socket"));function Qe(){return si}const si=function(){let n=1,e;const t=new Set,r=new Set;function i(){return{safeQueue:r,requestId:n,handlers:t}}function o(f){const g=[...t.values()];Z("Handlers array length is %d. Response event: %s. Request id: %d",t.size,f.event,f.requestId),g.forEach(m=>{const E=f.requestId;(m.requestId&&m.requestId===E||!m.requestId&&m.event===f.event)&&(Z("Find appropriated handler: %d, event: %s",n,m.event),m.callback(f.data,f),m.once&&(t.delete(m),Z("Handler was removed by *once* params was passed. %o",m)))})}function u(f){console.log(`%cInitializing sockets: %c${f}`,"color: purple","color: black"),e=new WebSocket(f),e.onclose=function(g){Z("Connection to server was stopped: %d %s",g.code,g.reason),setTimeout(()=>u(f))},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...r.values()].forEach(g=>{a(g),r.delete(g)})},e.onerror=function(g){console.warn(g)},e.onmessage=g=>{try{const m=JSON.parse(g.data);if(!Jt(m)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(m);return}o(m)}catch(m){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(m)}}}function a(f){e.send(f)}function c(f,g){t.add({event:f,callback:g})}function h(f,g){t.add({event:f,callback:g,once:!0})}function l(){return e&&(e==null?void 0:e.readyState)===1}function p(f,g,m){const E=++n,_=JSON.stringify({requestId:E,event:f,data:g,contextId:C.contextId,url:window.location.href});return l()?a(_):(r.add(_),Z("Socket is not connected. Message was send to save-queue. %s")),new Promise((w,T)=>{t.add({event:f,requestId:E,once:!0,callback:(k,O)=>{if(Z("Promise was resolve with next data:",k),oi(O))return void T(k);m&&m(k,O),w(k)}})})}return{get socket(){return e},on:c,once:h,emit:p,initialization:u,getDevInfo:i}}(),oi=n=>!!Jt(n)&&n.event==="request-error",Jt=n=>!!n&&typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function ai(n,e){const t=s.reactive([]);let r=0;const i=s.ref(!1);function o(){if(i.value)return Promise.reject("The process has already started.");const f=l();return i.value=!0,typeof f.limit!="number"&&(f.limit=100),f.offset=r,Ze(n,f).then(g=>(r+=g.length,g)).finally(()=>{i.value=!1})}function u(f,g){var E;const m=f.Version||((E=t.find(_=>_.Id===g))==null?void 0:E.Version);if(m===void 0)throw new Error("Object without version.");return m}function a(f,g){const m=t.findIndex(E=>E.Id===f);if(m===-1)throw new Error(`Can't found item with Id ${f}`);t.splice(m,1,g)}async function c(f,g){try{const m=l(),E=u(g,f);delete g.Version,await zt(n,{id:f,values:g,version:E});const _=await Ze(n,{fields:m.fields||"",id:f});a(f,_)}catch(m){$e()(m)}}async function h(){try{const f=await o();t.push(...f)}catch(f){$e()(f)}}function l(){return typeof e=="function"?e():e}async function p(){try{r=0;const f=await o();t.splice(0,t.length,...f)}catch(f){$e()(f)}}return{array:t,updateById:c,next:h,reload:p,wait:i}}const Le=new class{constructor(){this.store=s.reactive([])}add(e,t,r={}){const i=ci(r),o=new li(e,t,i.timeout,i.children,i.click);return this.store.push(o),r.timeout&&setTimeout(this.remove.bind(this,o.id),r.timeout*1e3),o}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function ci(n){function e(r){return!!r&&typeof r=="object"}const t={timeout:10,click:()=>null,children:[]};return e(n)?{timeout:n.timeout||t.timeout,click:n.click||t.click,children:n.children||t.children}:t}const Ht=class Qt{constructor(e,t,r,i,o){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=o,this.id=Qt.cardId++}};Ht.cardId=1;let li=Ht;const ui={clickOutside:ge,valuesToUpperCase:Ce,Filter:$,staticLink:zn,groupArrayByField:Gn,uuidv4:Jn,Request:y},di={usage:on,utils:hn,config:pn,types:gn};d.ApplicationManager=pt,d.Communication=Un,d.ComputedMetadata=Ln,d.CoreError=F,d.Filter=$,d.List=W,d.ListConfig=Wn,d.Manager=C,d.MetadataStore=ce,d.NotificationSystem=Le,d.Request=y,d.Table=je,d.WidgetButton=Ir,d.WidgetIcon=ke,d.WidgetImage=Ur,d.WidgetList=ei,d.WidgetLoader=Mr,d.WidgetMultiButton=Dr,d.WidgetSpinner=Oe,d.WidgetTable=vr,d.actionService=Pt,d.asyncProcess=ti,d.authService=A,d.billingService=X,d.catchUniversal=$e,d.clickOutside=ge,d.clientService=at,d.communicationService=le,d.configurationService=nr,d.constants=Ye,d.dataService=v,d.debounce=Hn,d.default=di,d.documentsService=tr,d.equipmentService=lr,d.fileService=Bn,d.getCellValue=Rt,d.getNamesFromListConfig=ri,d.historyService=Sn,d.internationalizationService=Fn,d.invitationService=Vn,d.metadataService=ze,d.newImport=In,d.openService=Mn,d.parseError=Ie,d.prettifyValueByMetadata=Pn,d.prettyDate=Ke,d.prettyDateWithTime=Mt,d.prettyMoney=Gt,d.processWizardService=ve,d.ruleValidationService=Ge,d.t=Y,d.testTypes=_n,d.universalEntityRead=Ze,d.universalEntityUpdate=zt,d.useCommunication=jn,d.useCustomerState=Qn,d.useFormAction=Yn,d.useFormLabel=Xn,d.useFormMetadata=xn,d.useFormRequest=er,d.useFormRequestData=Zn,d.useListActiveRow=ii,d.useListConfig=bn,d.useListEntity=ai,d.useListFilter=Nn,d.useListOrder=vt,d.useListProvide=Nt,d.useListRead=bt,d.useListSearch=Tn,d.useListSelect=vn,d.useListState=Tt,d.useLogger=Ot,d.useManagerState=ln,d.useSocket=Qe,d.useTableRequest=Cn,d.useTableState=En,d.useWizard=or,d.utils=ui,d.viewService=Dn,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
11
11
|
//# sourceMappingURL=eservices-core.umd.js.map
|
|
@@ -97,9 +97,9 @@ declare const _default: {
|
|
|
97
97
|
export default _default;
|
|
98
98
|
export { StylesInterface, };
|
|
99
99
|
import { WidgetButton, WidgetMultiButton, WidgetIcon, WidgetSpinner, WidgetTable, WidgetLoader, WidgetImage, WidgetList } from "./../src/index";
|
|
100
|
-
import { prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, getNamesFromListConfig } from "./../src/index";
|
|
100
|
+
import { prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, getCellValue, universalEntityRead, universalEntityUpdate, getNamesFromListConfig } from "./../src/index";
|
|
101
101
|
import type { IListCell, INotificationType, IMultiButtonItem, IEntityId, IEntityVersion, IUniversalEntityReadListOptions, IUniversalEntityReadSingleOptions, IUniversalEntityUpdateOptions, IUniversalEntityReadOptions, IValues, IListOrder } from "./../src/index";
|
|
102
102
|
import { constants } from "./../src/index";
|
|
103
103
|
import { useListActiveRow, useSocket, useListEntity } from "./../src/index";
|
|
104
104
|
import { NotificationSystem } from "./../src/index";
|
|
105
|
-
export { NotificationSystem, constants, WidgetButton, WidgetMultiButton, WidgetIcon, WidgetSpinner, WidgetTable, WidgetLoader, WidgetImage, WidgetList, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, getNamesFromListConfig, IListCell, IListOrder, INotificationType, IMultiButtonItem, IEntityId, IEntityVersion, IUniversalEntityReadListOptions, IUniversalEntityReadSingleOptions, IUniversalEntityReadOptions, IUniversalEntityUpdateOptions, IValues, useListActiveRow, useSocket, useListEntity };
|
|
105
|
+
export { NotificationSystem, constants, WidgetButton, WidgetMultiButton, WidgetIcon, WidgetSpinner, WidgetTable, WidgetLoader, WidgetImage, WidgetList, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, getNamesFromListConfig, getCellValue, IListCell, IListOrder, INotificationType, IMultiButtonItem, IEntityId, IEntityVersion, IUniversalEntityReadListOptions, IUniversalEntityReadSingleOptions, IUniversalEntityReadOptions, IUniversalEntityUpdateOptions, IValues, useListActiveRow, useSocket, useListEntity };
|
|
@@ -2,12 +2,12 @@ import { IEntityId, IEntityVersion, IUniversalEntityReadListOptions } from '../i
|
|
|
2
2
|
/**
|
|
3
3
|
* @description Хук, которые используется для реактивной работы со списком сущностей.
|
|
4
4
|
* @param {string} entity Имя сущности для которой будет строиться список
|
|
5
|
-
* @param {IUniversalEntityReadOptions}
|
|
5
|
+
* @param {IUniversalEntityReadOptions} listOptions Универсальные параметры чтения
|
|
6
6
|
* */
|
|
7
7
|
export default function useListEntity<T extends {
|
|
8
8
|
Id: IEntityId;
|
|
9
9
|
Version: IEntityVersion;
|
|
10
|
-
}>(entity: string,
|
|
10
|
+
}>(entity: string, listOptions: IUniversalEntityReadListOptions | (() => IUniversalEntityReadListOptions)): {
|
|
11
11
|
array: T[];
|
|
12
12
|
updateById: (id: IEntityId, values: Partial<T>) => Promise<void>;
|
|
13
13
|
next: () => Promise<void>;
|
|
@@ -35,7 +35,8 @@ import universalEntityRead from './methods/universal-entity-read';
|
|
|
35
35
|
import universalEntityUpdate from './methods/universal-entity-update';
|
|
36
36
|
import getNamesFromListConfig from './methods/get-names-from-list-config';
|
|
37
37
|
import prettyMoney from './methods/pretty-money';
|
|
38
|
-
|
|
38
|
+
import getCellValue from './methods/get-cell-value';
|
|
39
|
+
export { prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, getNamesFromListConfig, getCellValue };
|
|
39
40
|
/****
|
|
40
41
|
HOOKS
|
|
41
42
|
****/
|
|
@@ -16,7 +16,7 @@ export interface IListCell<T = IPrimitiveListData> {
|
|
|
16
16
|
/**
|
|
17
17
|
* @description Тип ячейки. Добавляет дополнительные обработчики для ячейки.
|
|
18
18
|
*/
|
|
19
|
-
type:
|
|
19
|
+
type: IListCellType;
|
|
20
20
|
/**
|
|
21
21
|
* @description Используется для добавления классов к ячейке. Принимает строку, массив или функцию
|
|
22
22
|
*/
|
|
@@ -48,7 +48,7 @@ export interface IListCell<T = IPrimitiveListData> {
|
|
|
48
48
|
}
|
|
49
49
|
export declare type IListOrder = [] | [string] | [string, 'desc' | 'asc'];
|
|
50
50
|
export declare type IPrimitiveListData = Record<string, unknown>;
|
|
51
|
-
declare type
|
|
51
|
+
declare type IListCellType = 'date' | 'dateWithTime' | 'dateTime' | 'select' | 'multi-select' | 'number' | 'money';
|
|
52
52
|
export interface IRowProps {
|
|
53
53
|
config: IListCell[];
|
|
54
54
|
values: IPrimitiveListData;
|
|
@@ -23,7 +23,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
23
23
|
};
|
|
24
24
|
}>> & {
|
|
25
25
|
onSelect?: (() => any) | undefined;
|
|
26
|
-
"onUpdate:order"?: ((data: IListCell<import('../../../types/list-type').IPrimitiveListData>[]) => any) | undefined;
|
|
27
26
|
"onUpdate:config"?: ((data: Partial<IListCell<import('../../../types/list-type').IPrimitiveListData>>[]) => any) | undefined;
|
|
27
|
+
"onUpdate:order"?: ((data: IListCell<import('../../../types/list-type').IPrimitiveListData>[]) => any) | undefined;
|
|
28
28
|
}, {}, {}>;
|
|
29
29
|
export default _default;
|
|
@@ -42,9 +42,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
42
42
|
};
|
|
43
43
|
}>> & {
|
|
44
44
|
"onUpdate:selectedRows"?: ((data: IPrimitiveListData[]) => any) | undefined;
|
|
45
|
-
onScrollEnd?: (() => any) | undefined;
|
|
46
|
-
"onUpdate:order"?: ((data: IListOrder[]) => any) | undefined;
|
|
47
45
|
"onUpdate:config"?: ((data: Partial<IListCell<IPrimitiveListData>>[]) => any) | undefined;
|
|
46
|
+
"onUpdate:order"?: ((data: IListOrder[]) => any) | undefined;
|
|
47
|
+
onScrollEnd?: (() => any) | undefined;
|
|
48
48
|
}, {
|
|
49
49
|
config: Partial<IListCell<IPrimitiveListData>>[];
|
|
50
50
|
selectedRows: IPrimitiveListData[];
|