eservices-core 1.3.17 → 1.3.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,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
2
  "use strict";/*!
3
- * eservices-core v1.3.17
3
+ * eservices-core v1.3.18
4
4
  * (c) 2023 ESERVICES
5
- */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),S=require("jenesius-vue-form"),Lt=require("jenesius-vue-modal"),st=require("vue-router"),Bt=require("date-and-time");function xt(n,e){return!!n&&n===e||"password is not equal"}function at(n){return Number(n.replace(/[^0-9.]/g,""))}function Dt(n,e=null){let r=String(at(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 jt=Object.freeze(Object.defineProperty({__proto__:null,numeric:at,prettyNumeric:Dt,validPassword:xt},Symbol.toStringTag,{value:"Module"})),Vt={inputs:jt};function _e(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?_e(n[r],e.substr(t+1)):void 0}return n[e]}function Se(n,e){if(!n)return console.warn("Element is not provided.");function t(o,s){return o==s.target||o.contains(s.target)}const r=o=>{t(n,o)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function ct(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const lt=class E extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=E.ID++}static ParentFormNotFound(){return new E("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new E("Composite object name is undefined",e)}static EntityWithoutName(e){return new E("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new E(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new E("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new E("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new E(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return E.ApiNotAvailable()}static ApiError(e){return new E("Request error",e)}static ApiNotAvailable(){return new E(`Sorry, we experience difficulties here.
5
+ */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),S=require("jenesius-vue-form"),Lt=require("jenesius-vue-modal"),st=require("vue-router"),Bt=require("date-and-time");function xt(n,e){return!!n&&n===e||"password is not equal"}function at(n){return Number(n.replace(/[^0-9.]/g,""))}function Dt(n,e=null){let r=String(at(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 Vt=Object.freeze(Object.defineProperty({__proto__:null,numeric:at,prettyNumeric:Dt,validPassword:xt},Symbol.toStringTag,{value:"Module"})),jt={inputs:Vt};function _e(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?_e(n[r],e.substr(t+1)):void 0}return n[e]}function Se(n,e){if(!n)return console.warn("Element is not provided.");function t(o,s){return o==s.target||o.contains(s.target)}const r=o=>{t(n,o)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function ct(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const lt=class E extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=E.ID++}static ParentFormNotFound(){return new E("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new E("Composite object name is undefined",e)}static EntityWithoutName(e){return new E("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new E(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new E("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new E("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new E(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return E.ApiNotAvailable()}static ApiError(e){return new E("Request error",e)}static ApiNotAvailable(){return new E(`Sorry, we experience difficulties here.
6
6
  Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,t){return!e&&!t?E.ApiNotAvailable():new E(e||"Authorization Error",t)}static ApiResponseParseFailed(){return E.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new E("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new E(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new E("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new E("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new E(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new E(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new E(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new E(`Metadata for the ${e} is not currently available.`)}};lt.ID=0;let I=lt;const ut="Please try again later or submit a feedback if problem doesn't go.";function He(n){return typeof n=="string"?$e(n):Mt(n)?$e(n.message):$e(ut)}function Mt(n){return!!(typeof n=="object"&&Object.hasOwnProperty.call(n,"message")&&n!==null)}function $e(n,e=[]){return{message:n,details:e}}class dt{static getClientData(){return m("/close-api/client-content")}static getNavigation(){return m("/close-api/client/navigation")}}const K=new class{constructor(){this.store=i.reactive([])}add(e,t,{children:r,timeout:o=10,click:s=()=>{}}={}){const d=new Ut(e,t,o,r||[],s);return this.store.push(d),o&&setTimeout(this.remove.bind(this,d.id),o*1e3),d}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.")}},ft=class pt{constructor(e,t,r,o,s){this.type=e,this.msg=t,this.timeout=r,this.children=o,this.click=s,this.id=pt.cardId++}};ft.cardId=1;let Ut=ft;/*!
7
7
  * jenesius-event-emitter v1.0.2
8
8
  * (c) 2022 Jenesius
9
9
  * @license MIT
10
- */const Ye=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},Xe=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},Ze=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},Qe=function(){this.events={}};class R{constructor(){this.events={}}on(e,t){return Ye.call(this,e,t)}emit(e,t){return Xe.call(this,e,t)}off(e,t){return Ze.call(this,e,t)}cleanEvents(){Qe.call(this)}static on(e,t){return Ye.call(R,e,t)}static emit(e,t){return Xe.call(R,e,t)}static off(e,t){return Ze.call(R,e,t)}static cleanEvents(){Qe.call(R)}}R.events={};var ht=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},ue=(n,e,t)=>(ht(n,e,"read from private field"),t?t.call(n):e.get(n)),Oe=(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)},Pe=(n,e,t,r)=>(ht(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Q,de,fe;const z=class F extends R{constructor(){super(...arguments),Oe(this,Q,void 0),Oe(this,de,"front"),this.organizations=[],Oe(this,fe,!1)}set language(e){localStorage.setItem(F.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(F.LOCALSTORAGE_LANGUAGE_KEY)||F.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(F.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){Pe(this,Q,e)}get router(){if(!ue(this,Q))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return ue(this,Q)}set type(e){Pe(this,de,e)}get type(){return ue(this,de)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Pe(this,fe,e),this.emit(F.EVENT_READY_UPDATE,e)}get ready(){return ue(this,fe)}onReady(e){return this.on(F.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(F.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(F.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(F.CURRENT_CONTEXT_KEY,String(e)),this.emit(F.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(F.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{K.add("error",I.ApiNotAvailable().message)}}loadCustomerData(){return dt.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))}};Q=new WeakMap;de=new WeakMap;fe=new WeakMap;z.DEFAULT_LANGUAGE="en";z.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";z.EVENT_CONTEXT_UPDATE="event:context-update";z.EVENT_READY_UPDATE="event:ready-update";z.EVENT_DATA_UPDATE="event:data-update";z.CURRENT_CONTEXT_KEY="CurrentContext";let gt=z;const v=new gt;function Wt(){const n=i.reactive({contextType:v.contextType,contextId:v.contextId,context:v.context});return v.onupdateContext(()=>{n.contextType=v.contextType,n.contextId=v.contextId,n.context=v.context}),n}function qt(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return ut}})}function m(n,e={}){return v.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=v.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw I.ApiNotAvailable()}).then(t=>qt(t).then(r=>{if(!t.ok)throw r;return r}))}class Te{constructor(){}static parseNamesFromListConfig(e){let t=Te.parseFieldsToGraphQL(e.reduce((o,s)=>(s.name&&o.push(s.name),o),[]));function r(o){let s="";for(let d in o)typeof o[d]=="boolean"?s+=` ${d} `:s+=` ${d} { ${r(o[d])} }`;return s}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,o){if(o.includes(".")){const s=o.indexOf("."),d=o.substring(s+1),l=o.substring(0,s);l in r||(r[l]={}),t(r[l],d)}else r[o]=!0;return r}return e.reduce(t,{})}}class zt{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 mt=new zt;function yt(n){return n&&n[0].toLowerCase()+n.slice(1)}function je(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const o=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=je(r)),e[o]=r,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(".")}const ie={Request:m,clickOutside:Se,getPropFromObject:_e,runPromiseQueue:ct,GraphQL:Te,firstChapterToLowerCase:yt,valuesToUpperCase:je,prettyMoney:Gt},Jt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Te,Journal:mt,Request:m,clickOutside:Se,default:ie,firstChapterToLowerCase:yt,getPropFromObject:_e,runPromiseQueue:ct,valuesToUpperCase:je},Symbol.toStringTag,{value:"Module"}));function wt(n,e=""){for(let t in n){if(typeof n[t]=="object"){wt(n[t],(e.length?`${e}-`:"")+t);continue}let r="--"+((e.length?`${e}-`:"")+t).replace(/([A-Z])/g,o=>`-${o}`.toLowerCase());document.documentElement.style.setProperty(r,n[t])}}const j={};function Kt(n){for(let e in n)j[e]=n[e];n.styles&&wt(n.styles),mt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=j}const Ht=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));const Yt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Xt{static readHistoryById(e,t){return m(`/close-api/audits/history/${e}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(r=>{const o=r.history.map(s=>{if(!s.changes)return s;const d=s.changes.map(l=>({...l,oldValue:l.originalValue,name:l.fieldName}));return{...s,changes:d}});return{...r,history:o}})}}class Zt extends R{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 Ve.get(e)}}const ee=new Zt;function Qt(n){const e=i.ref(ee.get(n));return ee.on(ee.EVENT_NEW,t=>{n===t.entityName&&(e.value=ee.get(n))}),e}function en(n,e){try{return e.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(t){vt().error("prettify value by metadata",n,t)}}class tn{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return m(`/open-api/internationalization/language/${e}`)}}let q={};function H(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)||q,n);if(typeof t=="string")return et(t,e);const r=S.utils.getPropFromObject(q==null?void 0:q.root,n);return typeof r=="string"?et(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function et(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}H.setGlobalVocabulary=function(n){q=n};H.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),H.bind({vocabulary:S.utils.getPropFromObject(q,e.toLowerCase())})};H.setVocabulary=function(n){return typeof n=="string"&&(n=S.utils.getPropFromObject(q,n)),H.bind({vocabulary:n})};const nn=function(){let n=!1;const e=[];function t(){return n}function r(a,p){t()&&console[a](...p),e.push(p)}function o(...a){r("log",a)}function s(...a){r("warn",a)}function d(...a){r("error",a)}function l(a=!0){n=a}return{info:o,warn:s,history:e,display:l,error:d}}();function vt(){return nn}class k{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw I.AuthServiceError(e.title,t)}static login(e){return m(j.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:j.applicationName})}).catch(k.parseError)}static registration(e){return e.AppName=j.applicationName,m(j.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(k.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw I.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return k.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return k.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return k.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return k.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return m(`${j.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(k.parseError)}static startLoginProcess(e){return k.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return k.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return k.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return m(`${j.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(k.parseError).then(k.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw I.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}function rn(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const on="masterId",sn="masterEntity";function ve(n,e){if(!Array.isArray(e))return;if(rn(e))return t(e);e.forEach(t);function t(r){n.append(sn,r[0]),n.append(on,r[1].toString())}}class x{static async anonymousGetList(e){return await m(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(o,s)=>r.append(o,s),r=new URLSearchParams;if(e.fields){const o=e.fields;typeof o=="string"?t("fields",o):Array.isArray(o)?t("fields",o.join(" ")):typeof o=="object"&&t("fields",Object.keys(o).join(" "))}if(e.order){let o=e.order;const d=(Array.isArray(o)?[o]:Object.entries(o)).map(([l,a="desc"])=>`@${l} ${a}`).join(",");t("order",d)}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=x.getSearchParamsForEntityListRead(t||{});return await m(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=x.getSearchParamsForEntityListRead(t||{});return m(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,t,r){const o=new URLSearchParams;return ve(o,r==null?void 0:r.masterEntities),m(`/close-api/data/${e}?${o.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:t})})}static update(e,t,r,o={}){return m(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static readById(e,t,r={}){const o=new URLSearchParams;if(r.fields){let s=r.fields;typeof s=="string"&&(s=[s]),o.append("fields",s.join(" "))}return m(`/close-api/data/entities/${e}/id/${t}?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,t,r,o){const s=new URLSearchParams;return ve(s,o==null?void 0:o.masterEntities),m(`/close-api/data/entities/${e}/id/${t}?${s.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r,version:o==null?void 0:o.version})})}static removeById(e,t,r){const o=typeof t=="number"?{Id:t}:t;return x.removeByKeys(e,o,r)}static removeByKeys(e,t,r){return m(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}const Ct=class te{static async create(e){return m(te.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 m(te.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return m(`${te.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return m(`${te.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};Ct.url="/close-api/communications";let se=Ct;class an{static async getDefaultView(e){return m("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function tt(n){return{...n,createdEntities:n.createdEntites}}const Et=class pe{static async getStartConfig(e,t){return m([pe.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return m([pe.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(tt)}static async runStep(e,t,r,o,s){return m([pe.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:o,values:s})}).then(tt)}};Et.url="/close-api/views/process-wizard";let he=Et;class Ve{static get url(){return"/close-api/metadata"}static async get(e,t,r){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const o=new URLSearchParams;return t&&o.append("criteria",t),r&&o.append("id",String(r)),await fetch(this.url+`/${e}?${o.toString()}`,{method:"GET"}).then(s=>s.json())}static getById(e,t,r=[]){const o=new URLSearchParams;return ve(o,r),t&&o.append("id",t),m([this.url,e].join("/")+`?${o.toString()}`)}static getFieldInformation(e,t){return m(`/open-api/metadata/${e}/fields/${t}`)}static getTreatmentListField(e,t){return m(`/open-api/metadata/${e}/list-fields/${t}`)}}class cn{static async upload(e,t){const r=new FormData;r.append("file",e);const o=`/close-api/files?entityName=${t}`;return await fetch(o,{method:"POST",body:r}).then(s=>s.json()).then(s=>(s.filename=e.name,s))}}class ln{static invite(e,t,r){return m("/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 m("/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 m("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class Me{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return m(Me.url+e,{method:"POST",body:JSON.stringify(t)})}}class un{static getConfiguration(){return m("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class bt{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 o=new URLSearchParams;return ve(o,r),m([this.url(),e,t].join("/")+`?${o.toString()}`,{method:"GET"})}}class dn extends R{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return se.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return se.read(e).then(t=>t.length===0?se.create(e):t[0])}}function fn(n){const e=S.Form.getParentForm();e?e.subscribe(n):console.warn(I.ParentFormNotFound());const t=i.reactive([]);return n.read=()=>se.readMessages(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function pn(n,e="images"){return`/static-folder/${e}/${n}`}function hn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function gn(n,e){const t=i.ref(null);function r(){return n.name?Ve.getById(n.name,e,[]).then(o=>{t.value=o,o.fields.forEach(s=>{s.canSet?n.enable(s.name):n.disable(s.name)})}).catch(()=>{t.value=null;const o=I.MetadataEntityIsNotAvailable(n.name||"FORM_WITHOUT_NAME");K.add("error",o.message)}):Promise.reject()}return n.on(S.Form.EVENT_READ,r),{metadata:t,update:r}}class Ue extends Error{static UndefinedStatus(){return new Ue("Status is undefined.")}}class mn extends Ue{}function yn(n,e){const t=i.reactive([]);async function r(s,d){if(!s)throw mn.UndefinedStatus();const l=await bt.get({criterion:s});t.splice(0,t.length),t.push(...l.map(a=>o(a,d)))}return{actions:t,update:r};function o(s,d){return{title:s.title,callback:()=>(()=>Promise.resolve().then(()=>{if(n.changed)return n.save()}).then(()=>fetch(s.url,{method:"POST",body:JSON.stringify({keys:{Id:d},contextId:v.contextId}),headers:{"Content-Type":"application/json"}})).then(a=>a.json()).then(a=>{if(!a.success)throw e!=null&&e.ModalValidationResult&&a.validationEffect?Lt.openModal(e.ModalValidationResult,{rules:a.validationEffect.results}):K.add("error",a.message),new Error;return a}).then(a=>{a.message&&K.add("info",a.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(a.affectedEntities)}).then(()=>n.read()))()}}}class Ce{static url(){return"/close-api/presentation"}static getStatuses(e,t){return fetch(`${Ce.url()}/status/${e}/${t}`).then(r=>r.json())}}function wn(n){const e=i.reactive({title:"Loading",type:"wait"});function t(r){if(n.name&&Number.isInteger(r))return Ce.getStatuses(n.name,r).then(o=>{e.type=o.type,e.title=o.name})}return n.on(S.Form.EVENT_READ,r=>{var d,l;const{code:o,name:s}={code:(d=r.Status)==null?void 0:d.Code,name:(l=r.Status)==null?void 0:l.Name};return n.name?!Number.isInteger(o)&&!s?void console.log("Undefined code or name is Status prop."):Ce.getStatuses(n.name,o).then(a=>{e.type=a.type,e.title=s}):void console.log("Form without name.")}),{label:e,update:t}}function vn(n,e){const t=st.useRoute(),r=i.computed(()=>Number(t.params.id)),o=i.reactive({ready:!1,show:!1});return i.watch(()=>r.value,()=>{o.ready=!1}),i.watch(()=>r.value,()=>{Number.isInteger(r.value)&&n.read()},{immediate:!0}),n.read=ie.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return x.readById(n.name,r.value,{fields:e.fields})}).then(ie.valuesToUpperCase).then(s=>(Number.isInteger(s.Version)&&(n.version=s.Version),n.setValues(s),o.show=!0,s)).catch(s=>{throw Object.prototype.hasOwnProperty.call(s,"status")&&[403,404].includes(s.status)&&(o.show=!1),s}).finally(()=>{o.ready=!0})),n.save=ie.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return x.updateById(n.name,r.value,n.changes,{version:n.version})}).then(s=>{n.version=s.version})),n.on(S.Form.EVENT_SAVE,n.read.bind(n)),{formShadowState:o}}function Cn(){const n=i.reactive({contextId:v.contextId,person:v.person,organizations:v.organizations,ready:v.ready,user:v.user}),e=i.computed(()=>{if(!v.ready||!v.person)return null;const r=n.contextId;return v.person.id===r?v.person:v.organizations.find(o=>o.id===r)||null}),t=i.computed(()=>{var r;return n.contextId===((r=n.person)==null?void 0:r.id)});return v.onupdateContext(r=>{n.contextId=r}),v.onupdateData(()=>{n.person=v.person,n.organizations=v.organizations,n.user=v.user}),v.onReady(r=>{n.ready=r}),{state:i.readonly(n),currentContext:e,isPerson:t}}function En(n,e){const t=i.reactive({ready:!1,show:!1});function r(){t.ready=!1,t.show=!1}return n.read=()=>{let o=e();return Promise.resolve().then(()=>{if(!n.name)throw I.EntityWithoutName("Use Form Request");return x.readById(n.name,o.id,{fields:o.fields})}).then(ie.valuesToUpperCase).then(s=>(s.hasOwnProperty("Version")&&(n.version=Number(s.Version)),n.setValues(s),t.show=!0,s)).catch(s=>{const d=He(s);throw K.add("error",d.message),d}).finally(()=>{t.ready=!0})},n.save=()=>{let o=e();return Promise.resolve().then(()=>{if(!n.name)throw I.EntityWithoutName("Use Form Request");return x.updateById(n.name,o.id,n.changes,{version:n.version})}).then(s=>{n.version=s.version||s.Version}).catch(s=>{const d=He(s);throw K.add("error",d.message),d})},n.on(S.Form.EVENT_SAVE,n.read.bind(n)),{shadowFormState:t,initShadow:r}}class bn{static getRequiredDocuments(e,t,r){const o=new URLSearchParams({entity:e,primaryKey:t,statusCode:r});return fetch(`/close-api/views/required-documents?${o.toString()}`).then(s=>s.json())}}class J{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${J.url()}/calculator/${e}`)}static calculate(e,t){return m(`/${J.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]):I.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 m(`/${J.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return m(`/${J.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class _n{static getListSettings(e,t){const r=new URLSearchParams;r.set("entity",e),t&&r.set("mark",t);const o=`/close-api/views/list/configs?${r.toString()}`;return m(o)}}var _t=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},L=(n,e,t)=>(_t(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(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)},U=(n,e,t,r)=>(_t(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),ge,ne,me,ye,re,oe,Be;const W="_______LIST_______ROW_______INDEX________NAME_______",ke=class B extends R{constructor(e){super(),this.LIST_ROW_KEY=1,M(this,ge,void 0),this.array=[],M(this,ne,[]),M(this,me,[]),M(this,ye,new Proxy({},{set:(t,r,o,s)=>(t[r]=o,this.emit(B.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(B.EVENT_FILTERS_UPDATE,t),!0)})),M(this,re,!1),M(this,oe,(...t)=>Promise),M(this,Be,()=>{}),U(this,ge,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&U(this,ne,e.config)}set config(e){U(this,ne,e.map(S.utils.copyObject)),this.emitUpdateConfig()}get config(){return L(this,ne)}emitUpdateConfig(){this.emit(B.EVENT_CONFIG_UPDATE,this.config)}get order(){return L(this,me)}set order(e){U(this,me,e),this.emit(B.EVENT_ORDER_UPDATE,this.order)}get filters(){return L(this,ye)}set filters(e){Tn(L(this,ye),e)}set wait(e){U(this,re,e),this.emit(S.Form.EVENT_WAIT,L(this,re))}get wait(){return L(this,re)}get primaryKeys(){return L(this,ge)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[W]===e)}indexByKey(e){return this.array.findIndex(t=>t[W]===e)}static getKey(e){return e[W]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,W)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(B.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(B.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(B.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[W]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,W)}set read(e){U(this,oe,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=L(this,oe).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){U(this,oe,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>L(this,Be).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,[W]: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=B.getCellName(e),o=(()=>{let s=r?_e(t,r):null;return s===void 0&&(s=null),e.value?e.value(s,t):s})();return{name:r,value:o}}};ge=new WeakMap;ne=new WeakMap;me=new WeakMap;ye=new WeakMap;re=new WeakMap;oe=new WeakMap;Be=new WeakMap;ke.EVENT_DATA="list-data: update";ke.EVENT_CONFIG_UPDATE="list-config:update";ke.EVENT_ORDER_UPDATE="list-order:update";ke.EVENT_FILTERS_UPDATE="list-filters:update";function Sn(n){const e=i.ref(""),t=i.computed(()=>{const r=e.value.toLowerCase();return i.unref(n).filter(o=>e.value.length?Object.values(o).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function Tn(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function kn(n){const e=i.reactive([]);function t(l){return e.includes(l)}function r(l){t(l)||e.push(l)}function o(l){const a=e.findIndex(p=>p===l);a!==-1&&e.splice(a,1)}function s(l){const a=i.unref(n);if(l===void 0){e.length===0?a.forEach(r):a.forEach(o);return}t(l)?o(l):r(l)}const d=i.computed(()=>{const l=i.unref(n);return e.length===l.length&&l.length!==0});return[e,s,d,r,o]}function Nn(n){return n.statusName==="Completed"}function An(n){return n.statusName==="FinalStepWithConfirmation"}function Fn(n){return n.statusName==="ValidationError"}function In(n,e,t){let r=null;const o=i.reactive({wait:null});let s=[],d=null;const l=i.ref(null);function a(){l.value=s.find(y=>y.name===d)||null}function p(){var y;return d?((y=s.find(b=>b.name===d))==null?void 0:y.fields)||[]:[]}function c(y){if(a(),Fn(y))return void t.onValidation(y.validationResults);if((y.statusName==="FinalStep"||y.statusName==="NextStep")&&(!p().length||$n(p(),t.presets)))return C(t.presets||{});Nn(y)&&t.onCompleted(y),An(y)&&t.onConfirmation(y)}async function f(){try{await u(),await w()}catch(y){const{message:b}=Ee(y);be.add("error",b)}}function u(){return o.wait="Loading process information.",he.getStartConfig(e,n).then(y=>{s=y.steps.map(b=>({label:b.title,name:b.stepName,number:b.number,fields:b.frontendEntity.objectTypes.reduce((T,N)=>(N.properties.forEach(O=>{T.push({name:O.name,label:O.title,type:O.refEntityName||O.dataType})}),T),[])}))}).then(y=>(o.wait=!1,y))}function h(y){return d=y.nextStepName,r=y.token,y}function g(y){const b=Ee(y);be.add("error",b.message)}function w(){return o.wait="Starting process",he.startProcess(e,n).then(h).then(c).catch(g).finally(()=>{o.wait=null})}function C(y={}){return!r||!d?Promise.reject("Not step or token."):(o.wait="Expect the result",he.runStep(e,n,d,r,y).then(h).then(c).catch(g).finally(()=>{o.wait=!1}))}return{initialize:f,state:o,currentStepConfig:i.readonly(l),next:C}}function $n(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 On="close-api/proxy/Equipment/Search";class Pn{static search(e,t,r,o,s){const d=new URLSearchParams;d.append("pattern",e||""),t&&d.append("categoryId",t),r&&d.append("useType",String(r)),o&&d.append("statusCode",o),s&&(d.append("limit",String(s.limit)),d.append("offset",String(s.offset)));const l=`/${On}?${d.toString()}`;return m(l,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Rn={class:"widget-table__head"},Ln={class:"widget-table__head-label margin_0 text_overflow"},Bn=i.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(i.openBlock(),i.createElementBlock("tr",Rn,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.config,(r,o)=>(i.openBlock(),i.createElementBlock("th",{class:"widget-table__head-cell",key:o},[i.createElementVNode("p",Ln,i.toDisplayString(r.label),1)]))),128))]))}});const V=(n,e)=>{const t=n.__vccOpts||n;for(const[r,o]of e)t[r]=o;return t},xn=V(Bn,[["__scopeId","data-v-25198f4a"]]);function Dn(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function St(n,e){const t=Dn(n);let r=t?S.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function jn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var xe={exports:{}},Re,nt;function Vn(){if(nt)return Re;nt=1;var n=1e3,e=n*60,t=e*60,r=t*24,o=r*7,s=r*365.25;Re=function(c,f){f=f||{};var u=typeof c;if(u==="string"&&c.length>0)return d(c);if(u==="number"&&isFinite(c))return f.long?a(c):l(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))};function d(c){if(c=String(c),!(c.length>100)){var f=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(f){var u=parseFloat(f[1]),h=(f[2]||"ms").toLowerCase();switch(h){case"years":case"year":case"yrs":case"yr":case"y":return u*s;case"weeks":case"week":case"w":return u*o;case"days":case"day":case"d":return u*r;case"hours":case"hour":case"hrs":case"hr":case"h":return u*t;case"minutes":case"minute":case"mins":case"min":case"m":return u*e;case"seconds":case"second":case"secs":case"sec":case"s":return u*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}}}function l(c){var f=Math.abs(c);return f>=r?Math.round(c/r)+"d":f>=t?Math.round(c/t)+"h":f>=e?Math.round(c/e)+"m":f>=n?Math.round(c/n)+"s":c+"ms"}function a(c){var f=Math.abs(c);return f>=r?p(c,f,r,"day"):f>=t?p(c,f,t,"hour"):f>=e?p(c,f,e,"minute"):f>=n?p(c,f,n,"second"):c+" ms"}function p(c,f,u,h){var g=f>=u*1.5;return Math.round(c/u)+" "+h+(g?"s":"")}return Re}function Mn(n){t.debug=t,t.default=t,t.coerce=a,t.disable=s,t.enable=o,t.enabled=d,t.humanize=Vn(),t.destroy=p,Object.keys(n).forEach(c=>{t[c]=n[c]}),t.names=[],t.skips=[],t.formatters={};function e(c){let f=0;for(let u=0;u<c.length;u++)f=(f<<5)-f+c.charCodeAt(u),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(c){let f,u=null,h,g;function w(...C){if(!w.enabled)return;const y=w,b=Number(new Date),T=b-(f||b);y.diff=T,y.prev=f,y.curr=b,f=b,C[0]=t.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let N=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(D,_)=>{if(D==="%%")return"%";N++;const Y=t.formatters[_];if(typeof Y=="function"){const ce=C[N];D=Y.call(y,ce),C.splice(N,1),N--}return D}),t.formatArgs.call(y,C),(y.log||t.log).apply(y,C)}return w.namespace=c,w.useColors=t.useColors(),w.color=t.selectColor(c),w.extend=r,w.destroy=t.destroy,Object.defineProperty(w,"enabled",{enumerable:!0,configurable:!1,get:()=>u!==null?u:(h!==t.namespaces&&(h=t.namespaces,g=t.enabled(c)),g),set:C=>{u=C}}),typeof t.init=="function"&&t.init(w),w}function r(c,f){const u=t(this.namespace+(typeof f>"u"?":":f)+c);return u.log=this.log,u}function o(c){t.save(c),t.namespaces=c,t.names=[],t.skips=[];let f;const u=(typeof c=="string"?c:"").split(/[\s,]+/),h=u.length;for(f=0;f<h;f++)u[f]&&(c=u[f].replace(/\*/g,".*?"),c[0]==="-"?t.skips.push(new RegExp("^"+c.slice(1)+"$")):t.names.push(new RegExp("^"+c+"$")))}function s(){const c=[...t.names.map(l),...t.skips.map(l).map(f=>"-"+f)].join(",");return t.enable(""),c}function d(c){if(c[c.length-1]==="*")return!0;let f,u;for(f=0,u=t.skips.length;f<u;f++)if(t.skips[f].test(c))return!1;for(f=0,u=t.names.length;f<u;f++)if(t.names[f].test(c))return!0;return!1}function l(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function a(c){return c instanceof Error?c.stack||c.message:c}function p(){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 Un=Mn;(function(n,e){e.formatArgs=r,e.save=o,e.load=s,e.useColors=t,e.storage=d(),e.destroy=(()=>{let a=!1;return()=>{a||(a=!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(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;a.splice(1,0,p,"color: inherit");let c=0,f=0;a[0].replace(/%[a-zA-Z%]/g,u=>{u!=="%%"&&(c++,u==="%c"&&(f=c))}),a.splice(f,0,p)}e.log=console.debug||console.log||(()=>{});function o(a){try{a?e.storage.setItem("debug",a):e.storage.removeItem("debug")}catch{}}function s(){let a;try{a=e.storage.getItem("debug")}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=process.env.DEBUG),a}function d(){try{return localStorage}catch{}}n.exports=Un(e);const{formatters:l}=n.exports;l.j=function(a){try{return JSON.stringify(a)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(xe,xe.exports);var Wn=xe.exports;const Tt=jn(Wn);function kt(n){return["eservices-core",n].join(":")}function Nt(n){return We(n,"YYYY/MM/DD HH:mm:ss")}function We(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return Bt.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const qn={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()=>i.h("i",{class:`icon icon-${t}`})}},Ne=V(qn,[["__scopeId","data-v-e287c8d9"]]),zn=Tt(kt("setup-list-row"));function Gn(n,e){const t=n.config.map(r=>Jn(r,n,e));return i.h("tr",{class:"widget-table__row widget-table-row"},t)}function Jn(n,e,t){const r=e.values;let o=St(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function d(c){s.onClick.push(()=>c(r))}function l(c){Array.isArray(c)?s.class.push(...c):s.class.push(c)}const a=[],p=[];if(n.hide&&n.hide(r))return[i.h("td")];if(n.type)switch(l(`widget-table-cell_${n.type}`),n.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=We(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=Nt(typeof o=="string"?o:null);break}case"money":{o=It(o);break}case"multi-select":{p.push(i.h(S.FormField,{type:"single-checkbox",modelValue:e.selected})),d(rt.bind(null,t,!0));break}case"select":{p.push(i.h(S.FormField,{type:"single-radio",modelValue:e.selected})),d(rt.bind(null,t,!1));break}}if(n.onClick&&d(n.onClick),n.link)try{const c=n.link(r);if(c){const f=i.h(st.RouterLink,{to:c});p.push(f),l("widget-table-cell_link")}}catch(c){zn("Can't add router link",c)}return n.href&&(p.push(i.h("a",{href:n.href(r),target:"_blank"})),l("widget-table-cell_link")),(typeof o=="string"||typeof o=="number")&&p.push(i.h("p",{class:"widget-list-cell-text"},o)),n.icon&&p.push(i.h(Ne,{name:n.icon})),n.class&&(typeof n.class=="function"?l(n.class(r)):l(n.class)),a.push(i.h("td",s,p)),a}function rt(n,e){n.emit("select",e)}function At(n,e){return()=>{try{return Gn(n,e)}catch(t){return console.warn(t),null}}}const Kn={props:{values:Object,config:Object,selected:Boolean},setup:At},Hn=["colspan"],ot=i.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=i.ref();return i.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,o)=>(i.openBlock(),i.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[i.createElementVNode("td",{colspan:r.rowLength},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(r.component),i.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:o[0]||(o[0]=s=>e("close")),onSave:o[1]||(o[1]=s=>e("save",s))}),null,16,["values","new"]))],8,Hn)],512))}}),qe={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go."},Yn={class:"widget-table"},it="update:selectedRows",Xn=i.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=i.useSlots(),o=i.computed(()=>{var l;return(l=r==null?void 0:r.default)==null?void 0:l.call(r)[0]});function s(l,a=!0){if(!t.selectedRows)return;if(!a)return e(it,t.selectedRows.includes(l)?[]:[l]);const p=[...t.selectedRows],c=p.indexOf(l);return c===-1?p.push(l):p.splice(c,1),e(it,p)}function d(l){e("save",l),e("update:activeRow",null)}return(l,a)=>(i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("table",Yn,[i.createVNode(xn,{config:l.config},null,8,["config"]),i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.array,(p,c)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:c},[i.createVNode(Kn,{config:l.config,values:p,selected:l.selectedRows.includes(p),onSelect:f=>s(p,f),class:i.normalizeClass(l.classCallback?l.classCallback(p):"")},null,8,["config","values","selected","onSelect","class"]),o.value&&l.activeRow===p?(i.openBlock(),i.createBlock(ot,{key:0,component:o.value,"row-length":l.config.length,values:p,onClose:a[0]||(a[0]=f=>e("update:activeRow",null)),onSave:d,"is-new":!1},null,8,["component","row-length","values"])):i.createCommentVNode("",!0)],64))),128)),l.activeRow===i.unref(qe).LIST_ACTIVE_NEW?(i.openBlock(),i.createBlock(ot,{key:0,component:o.value,"row-length":l.config.length,onClose:a[1]||(a[1]=p=>e("update:activeRow",null)),onSave:d,"is-new":!0},null,8,["component","row-length"])):i.createCommentVNode("",!0)])])]))}}),Zn=i.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(i.openBlock(),i.createElementBlock("div",{class:"widget-spinner",style:i.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}});const Ae=V(Zn,[["__scopeId","data-v-0ef9ae88"]]),Qn={class:"widget-button"},er=i.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(i.openBlock(),i.createElementBlock("button",Qn,[e.wait?(i.openBlock(),i.createBlock(Ae,{key:0,class:"widget-button-spinner"})):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const tr=V(er,[["__scopeId","data-v-450dc564"]]),nr={class:"widget-multi-button-wrap position_relative cursor_pointer"},rr={class:"widget-multi-button-body grid"},or=["onClick"],ir={class:"widget-multi-button-side-wrap"},sr=i.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;i.useCssVars(d=>({"7025434e":r.value}));const t=i.reactive({active:!1,wait:!1}),r=i.computed(()=>e.array.length+(e.label?1:0));function o(d){if(!(typeof d!="function"||t.wait))return t.wait=!0,Promise.resolve().then(d).finally(()=>{t.wait=!1})}function s(d=!t.active){t.active=d}return(d,l)=>(i.openBlock(),i.createElementBlock("div",nr,[i.createElementVNode("div",{class:i.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[i.createElementVNode("div",rr,[d.label?(i.openBlock(),i.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:l[0]||(l[0]=a=>s())},i.toDisplayString(d.label),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.array,(a,p)=>(i.openBlock(),i.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:p,onClick:c=>{o(a.callback),s(!1)}},i.toDisplayString(a.label),9,or))),128))]),i.createElementVNode("div",ir,[i.createElementVNode("div",{class:i.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:l[1]||(l[1]=a=>s())},[t.wait?(i.openBlock(),i.createBlock(i.unref(Ae),{key:0,class:"widget-multi-button-side-spinner"})):d.array.length>1?(i.openBlock(),i.createBlock(i.unref(Ne),{key:1,class:"widget-multi-button-side-icon"},{default:i.withCtx(()=>[i.createTextVNode("angle-small-down")]),_:1})):i.createCommentVNode("",!0)],2)])],2)]))}});const ar=V(sr,[["__scopeId","data-v-a8d711d1"]]),cr={class:"widget-loader flex flex-align_center gap_10 padding_15"},lr={class:"text_md"},ur=i.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(i.openBlock(),i.createElementBlock("div",cr,[i.createVNode(Ae,{color:"var(--primary)",class:"padding_10"}),i.createElementVNode("span",lr,i.toDisplayString(e.label),1)]))}}),dr=["alt","src"],fr=i.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=i.ref();return i.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,o)=>(i.openBlock(),i.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,dr))}}),pr={props:{config:Array,values:Object,selected:Boolean},setup:At};const hr=V(pr,[["__scopeId","data-v-344a8cc1"]]),gr=n=>(i.pushScopeId("data-v-4e1d87c8"),n=n(),i.popScopeId(),n),mr={class:"head-cell"},yr=gr(()=>i.createElementVNode("div",{class:"head-cell-resize"},null,-1)),wr=i.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,o)=>(i.openBlock(),i.createElementBlock("th",null,[i.createElementVNode("div",mr,[i.createElementVNode("div",{class:"head-cell-content flex_grow",style:i.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(i.openBlock(),i.createBlock(i.unref(S.FormField),{key:0,type:"single-checkbox",onClick:o[0]||(o[0]=i.withModifiers(s=>e("select"),["stop","prevent"]))})):(i.openBlock(),i.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:o[1]||(o[1]=s=>e("order"))},i.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(i.openBlock(),i.createBlock(i.unref(Ne),{key:0,class:i.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:i.withCtx(()=>[i.createTextVNode("core-arrow-up")]),_:1},8,["class"])):i.createCommentVNode("",!0),yr])]))}});const vr=V(wr,[["__scopeId","data-v-4e1d87c8"]]),Cr=i.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=i.ref(),o=i.ref();i.onMounted(()=>{function a(h,g){let w=-1;do w++,g-=h[w];while(g>0&&w<h.length);return w}function p(h,g){let w=0;for(;g>0&&g>h[w]&&w<h.length;)g-=h[w],w++;return console.log(g,w),w>0?w:0}function c(h){try{o.value.style.insetInlineStart=h+"px"}catch(g){console.log(g)}}function f(h){try{o.value.style.width=h+"px",o.value.style.minWidth=h+"px",o.value.style.maxWidth=h+"px"}catch(g){console.log(g)}}function u(h){return h===null?!1:h.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(g){var Ke;function w(A){return A.screenX+b-O}const C=r.value,y=[...C.children].filter(A=>A.localName==="th"),b=((Ke=C.offsetParent)==null?void 0:Ke.scrollLeft)||0,T=y.map(A=>A.clientWidth),N=u(g.target),O=C.getBoundingClientRect().left,D=w(g),_=a(T,D),Y=T.slice(0,_).reduce((A,P)=>A+P,0),ce=D-Y,Fe=C.offsetWidth,X=y[_].clientWidth;if(t.config[_].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",g.screenX),console.log("Widths",T),console.log("max width",Fe),console.log("Start Position",D),console.log("Position From",_),console.log("Start Position",_),console.log("Global offset (Отступ самой таблицы от края экрана)",O),console.log("Del",ce),console.groupEnd(),o.value.innerText=y[_].textContent||"",o.value.style.display="grid",o.value.style.width=X+"px",o.value.style.cursor="grabbing",c(Y),f(X),document.addEventListener("pointermove",Je,{passive:!0}),document.addEventListener("pointerup",Ge);function Ge(A){if(console.group("END"),document.removeEventListener("pointermove",Je),document.removeEventListener("pointerup",Ge),N&&(t.config[_].width=o.value.style.width,t.config[_].minWidth=o.value.style.width,t.config[_].maxWidth=o.value.style.width,s(t.config)),!N){const P=A.screenX+b-O;console.log("ENP Position",P);const le=p(T,P);if(console.log(_,"->",le),le!==_){const Z=t.config[_],Ie=t.config;Ie.splice(_,1),Ie.splice(le,0,Z),s(Ie)}else{const Z=t.config[_].name;d(Z)}}o.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Je(A){if(N){const Z=w(A)-D+X;f(Z);return}let P=A.screenX+b-O-ce;P<0&&(P=0),P+X>Fe&&(P=Fe-X),c(P)}})});function s(a){e("update:config",a)}function d(a){if(!a)return;if(Array.isArray(a)){if(a.length<1)return;a=a[0]}if(t.order.length===0||t.order[0]!==a)return void l([a]);const p=t.order.length===1||t.order[1]==="asc"?"asc":"desc";l([a,p==="asc"?"desc":"asc"])}function l(a){e("update:order",a)}return(a,p)=>(i.openBlock(),i.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.config,(c,f)=>(i.openBlock(),i.createBlock(vr,i.mergeProps({key:c},c,{onOrder:u=>d(c.name),onSelect:p[0]||(p[0]=u=>e("select")),order:a.order}),null,16,["onOrder","order"]))),128)),i.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:o},"test",512)],512))}});const Er=V(Cr,[["__scopeId","data-v-ccffc6bd"]]),br={class:"widget-list"},_r={class:"widget-list-body position_relative"},Sr=50,Tr=i.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(l,a=!0){if(t.selectedRows)if(!a)s(t.selectedRows.includes(l)?[]:[l]);else{const p=[...t.selectedRows],c=p.indexOf(l);c===-1?p.push(l):p==null||p.splice(c,1),s(p)}}function o(){var l;if(((l=t.selectedRows)==null?void 0:l.length)!==t.array.length)return s([...t.array]);s([])}function s(l){e("update:selectedRows",l)}function d(l){if(!l)return;const a=l.target;a.scrollTop+a.clientHeight+Sr>a.scrollHeight&&e("scrollEnd")}return(l,a)=>(i.openBlock(),i.createElementBlock("div",{class:"es-list-container",onScrollPassive:d},[i.createElementVNode("table",br,[i.createElementVNode("thead",null,[i.createVNode(Er,{onSelect:a[0]||(a[0]=p=>o()),"onUpdate:order":a[1]||(a[1]=p=>e("update:order",p)),"onUpdate:config":a[2]||(a[2]=p=>e("update:config",p)),config:l.config,order:l.order},null,8,["config","order"])]),i.createElementVNode("tbody",_r,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.array,(p,c)=>{var f;return i.openBlock(),i.createBlock(hr,{key:c,class:"widget-list-row",values:p,config:l.config,selected:(f=l.selectedRows)==null?void 0:f.includes(p),onSelect:u=>r(p,u)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function kr(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=i.reactive({wait:!1,call:e});return t}function Ee(n){return typeof n=="string"?Le(n):Nr(n)?Le(n.message):Le(qe.DEFAULT_ERROR_MESSAGE)}function Nr(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function Le(n){return{message:n}}function we(n="error"){return function(e){const{message:t}=Ee(e);be.add(n,t)}}function De(n,e){return ze().emit("entity:read",{...e,entity:n})}function Ft(n,e){return ze().emit("entity:update",{...e,entity:n})}function Ar(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function It(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 $t(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const o=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=$t(r)),e[o]=r,e},{})}function Fr(n,e){const t=new Map;return n.forEach(r=>{var s;const o=e(r);t.has(o)||t.set(o,[]),(s=t.get(o))==null||s.push(r)}),t}function Ir(){const n=i.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const G=Tt(kt("use-socket"));function ze(){return $r}const $r=function(){let n=1,e;const t=new Set,r=new Set;function o(){return{safeQueue:r,requestId:n,handlers:t}}function s(u){const h=[...t.values()];G("Handlers array length is %d. Response event: %s. Request id: %d",t.size,u.event,u.requestId),h.forEach(g=>{const w=u.requestId;(g.requestId&&g.requestId===w||!g.requestId&&g.event===u.event)&&(G("Find appropriated handler: %d, event: %s",n,g.event),g.callback(u.data,u),g.once&&(t.delete(g),G("Handler was removed by *once* params was passed. %o",g)))})}function d(u){console.log(`%cInitializing sockets: %c${u}`,"color: purple","color: black"),e=new WebSocket(u),e.onclose=function(h){G("Connection to server was stopped: %d %s",h.code,h.reason),setTimeout(()=>d(u))},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...r.values()].forEach(h=>{l(h),r.delete(h)})},e.onerror=function(h){console.warn(h)},e.onmessage=h=>{try{const g=JSON.parse(h.data);if(!Ot(g)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(g);return}s(g)}catch(g){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(g)}}}function l(u){e.send(u)}function a(u,h){t.add({event:u,callback:h})}function p(u,h){t.add({event:u,callback:h,once:!0})}function c(){return e&&(e==null?void 0:e.readyState)===1}function f(u,h,g){const w=++n,C=JSON.stringify({requestId:w,event:u,data:h,contextId:v.contextId,url:window.location.href});return c()?l(C):(r.add(C),G("Socket is not connected. Message was send to save-queue. %s")),new Promise((y,b)=>{t.add({event:u,requestId:w,once:!0,callback:(T,N)=>{if(G("Promise was resolve with next data:",T),Or(N))return void b(T);g&&g(T,N),y(T)}})})}return{get socket(){return e},on:a,once:p,emit:f,initialization:d,getDevInfo:o}}(),Or=n=>!!Ot(n)&&n.event==="request-error",Ot=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 Pr(n,e){const t=i.reactive([]);let r=0;const o=i.ref(!1);function s(){if(o.value)return Promise.reject("The process has already started.");const u=c();return o.value=!0,typeof u.limit!="number"&&(u.limit=100),u.offset=r,De(n,u).then(h=>(r+=h.length,h)).finally(()=>{o.value=!1})}function d(u,h){var w;const g=u.Version||((w=t.find(C=>C.Id===h))==null?void 0:w.Version);if(g===void 0)throw new Error("Object without version.");return g}function l(u,h){const g=t.findIndex(w=>w.Id===u);if(g===-1)throw new Error(`Can't found item with Id ${u}`);t.splice(g,1,h)}async function a(u,h){try{const g=c(),w=d(h,u);delete h.Version,await Ft(n,{id:u,values:h,version:w});const C=await De(n,{fields:g.fields||"",id:u});l(u,C)}catch(g){we()(g)}}async function p(){try{const u=await s();t.push(...u)}catch(u){we()(u)}}function c(){return typeof e=="function"?e():e}async function f(){try{r=0;const u=await s();t.splice(0,t.length,...u)}catch(u){we()(u)}}return{array:t,updateById:a,next:p,reload:f,wait:o}}const be=new class{constructor(){this.store=i.reactive([])}add(e,t,r={}){const o=Rr(r),s=new Lr(e,t,o.timeout,o.children,o.click);return this.store.push(s),r.timeout&&setTimeout(this.remove.bind(this,s.id),r.timeout*1e3),s}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function Rr(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 Pt=class Rt{constructor(e,t,r,o,s){this.type=e,this.message=t,this.timeout=r,this.children=o,this.click=s,this.id=Rt.cardId++}};Pt.cardId=1;let Lr=Pt;function Br(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 o=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${t} in (${o})`),e}if(Br(r)){let o=function(s){var d;return((d=s.match(/([^Z]*)/))==null?void 0:d[0])+"0000Z"};return r.start&&e.push(`@${t} ge ${o(r.start)}`),r.end&&e.push(`@${t} le ${o(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 ae(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${ae(t)}`};$.beginWith=function(e,t){return`@${e} BeginWith ${ae(t)}`};$.notEq=function(e,t){return`@${e} nq ${ae(t)}`};$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${ae(t)}`};$.in=function(e,t){const r=t.map(ae).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 ")};const xr={clickOutside:Se,staticLink:pn,Request:m},Dr={usage:Vt,utils:Jt,config:Kt,types:Ht};exports.ApplicationManager=gt;exports.Communication=dn;exports.ComputedMetadata=Qt;exports.CoreError=I;exports.Filter=$;exports.Manager=v;exports.MetadataStore=ee;exports.NotificationSystem=be;exports.Request=m;exports.WidgetButton=tr;exports.WidgetIcon=Ne;exports.WidgetImage=fr;exports.WidgetList=Tr;exports.WidgetLoader=ur;exports.WidgetMultiButton=ar;exports.WidgetSpinner=Ae;exports.WidgetTable=Xn;exports.actionService=bt;exports.asyncProcess=kr;exports.authService=k;exports.billingService=J;exports.catchUniversal=we;exports.clickOutside=Se;exports.clientService=dt;exports.communicationService=se;exports.configurationService=_n;exports.constants=qe;exports.dataService=x;exports.debounce=hn;exports.default=Dr;exports.documentsService=bn;exports.equipmentService=Pn;exports.fileService=cn;exports.getCellValue=St;exports.getNamesFromListConfig=Ar;exports.groupArrayByField=Fr;exports.historyService=Xt;exports.internationalizationService=tn;exports.invitationService=ln;exports.metadataService=Ve;exports.openService=un;exports.parseError=Ee;exports.prettifyValueByMetadata=en;exports.prettyDate=We;exports.prettyDateWithTime=Nt;exports.prettyMoney=It;exports.processWizardService=he;exports.ruleValidationService=Me;exports.t=H;exports.testTypes=Yt;exports.universalEntityRead=De;exports.universalEntityUpdate=Ft;exports.useCommunication=fn;exports.useCustomerState=Cn;exports.useFormAction=yn;exports.useFormLabel=wn;exports.useFormMetadata=gn;exports.useFormRequest=En;exports.useFormRequestData=vn;exports.useListActiveRow=Ir;exports.useListEntity=Pr;exports.useListSearch=Sn;exports.useListSelect=kn;exports.useLogger=vt;exports.useManagerState=Wt;exports.useSocket=ze;exports.useWizard=In;exports.utils=xr;exports.valuesToUpperCase=$t;exports.viewService=an;
10
+ */const Ye=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},Xe=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},Ze=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},Qe=function(){this.events={}};class R{constructor(){this.events={}}on(e,t){return Ye.call(this,e,t)}emit(e,t){return Xe.call(this,e,t)}off(e,t){return Ze.call(this,e,t)}cleanEvents(){Qe.call(this)}static on(e,t){return Ye.call(R,e,t)}static emit(e,t){return Xe.call(R,e,t)}static off(e,t){return Ze.call(R,e,t)}static cleanEvents(){Qe.call(R)}}R.events={};var ht=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},ue=(n,e,t)=>(ht(n,e,"read from private field"),t?t.call(n):e.get(n)),Oe=(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)},Pe=(n,e,t,r)=>(ht(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Q,de,fe;const z=class F extends R{constructor(){super(...arguments),Oe(this,Q,void 0),Oe(this,de,"front"),this.organizations=[],Oe(this,fe,!1)}set language(e){localStorage.setItem(F.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(F.LOCALSTORAGE_LANGUAGE_KEY)||F.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(F.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){Pe(this,Q,e)}get router(){if(!ue(this,Q))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return ue(this,Q)}set type(e){Pe(this,de,e)}get type(){return ue(this,de)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Pe(this,fe,e),this.emit(F.EVENT_READY_UPDATE,e)}get ready(){return ue(this,fe)}onReady(e){return this.on(F.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(F.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(F.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(F.CURRENT_CONTEXT_KEY,String(e)),this.emit(F.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(F.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{K.add("error",I.ApiNotAvailable().message)}}loadCustomerData(){return dt.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))}};Q=new WeakMap;de=new WeakMap;fe=new WeakMap;z.DEFAULT_LANGUAGE="en";z.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";z.EVENT_CONTEXT_UPDATE="event:context-update";z.EVENT_READY_UPDATE="event:ready-update";z.EVENT_DATA_UPDATE="event:data-update";z.CURRENT_CONTEXT_KEY="CurrentContext";let gt=z;const v=new gt;function Wt(){const n=i.reactive({contextType:v.contextType,contextId:v.contextId,context:v.context});return v.onupdateContext(()=>{n.contextType=v.contextType,n.contextId=v.contextId,n.context=v.context}),n}function qt(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return ut}})}function m(n,e={}){return v.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=v.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw I.ApiNotAvailable()}).then(t=>qt(t).then(r=>{if(!t.ok)throw r;return r}))}class Te{constructor(){}static parseNamesFromListConfig(e){let t=Te.parseFieldsToGraphQL(e.reduce((o,s)=>(s.name&&o.push(s.name),o),[]));function r(o){let s="";for(let d in o)typeof o[d]=="boolean"?s+=` ${d} `:s+=` ${d} { ${r(o[d])} }`;return s}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,o){if(o.includes(".")){const s=o.indexOf("."),d=o.substring(s+1),l=o.substring(0,s);l in r||(r[l]={}),t(r[l],d)}else r[o]=!0;return r}return e.reduce(t,{})}}class zt{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 mt=new zt;function yt(n){return n&&n[0].toLowerCase()+n.slice(1)}function Ve(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const o=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Ve(r)),e[o]=r,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(".")}const ie={Request:m,clickOutside:Se,getPropFromObject:_e,runPromiseQueue:ct,GraphQL:Te,firstChapterToLowerCase:yt,valuesToUpperCase:Ve,prettyMoney:Gt},Jt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Te,Journal:mt,Request:m,clickOutside:Se,default:ie,firstChapterToLowerCase:yt,getPropFromObject:_e,runPromiseQueue:ct,valuesToUpperCase:Ve},Symbol.toStringTag,{value:"Module"}));function wt(n,e=""){for(let t in n){if(typeof n[t]=="object"){wt(n[t],(e.length?`${e}-`:"")+t);continue}let r="--"+((e.length?`${e}-`:"")+t).replace(/([A-Z])/g,o=>`-${o}`.toLowerCase());document.documentElement.style.setProperty(r,n[t])}}const V={};function Kt(n){for(let e in n)V[e]=n[e];n.styles&&wt(n.styles),mt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=V}const Ht=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));const Yt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Xt{static readHistoryById(e,t){return m(`/close-api/audits/history/${e}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(r=>{const o=r.history.map(s=>{if(!s.changes)return s;const d=s.changes.map(l=>({...l,oldValue:l.originalValue,name:l.fieldName}));return{...s,changes:d}});return{...r,history:o}})}}class Zt extends R{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 je.get(e)}}const ee=new Zt;function Qt(n){const e=i.ref(ee.get(n));return ee.on(ee.EVENT_NEW,t=>{n===t.entityName&&(e.value=ee.get(n))}),e}function en(n,e){try{return e.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(t){vt().error("prettify value by metadata",n,t)}}class tn{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return m(`/open-api/internationalization/language/${e}`)}}let q={};function H(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)||q,n);if(typeof t=="string")return et(t,e);const r=S.utils.getPropFromObject(q==null?void 0:q.root,n);return typeof r=="string"?et(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function et(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}H.setGlobalVocabulary=function(n){q=n};H.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),H.bind({vocabulary:S.utils.getPropFromObject(q,e.toLowerCase())})};H.setVocabulary=function(n){return typeof n=="string"&&(n=S.utils.getPropFromObject(q,n)),H.bind({vocabulary:n})};const nn=function(){let n=!1;const e=[];function t(){return n}function r(a,p){t()&&console[a](...p),e.push(p)}function o(...a){r("log",a)}function s(...a){r("warn",a)}function d(...a){r("error",a)}function l(a=!0){n=a}return{info:o,warn:s,history:e,display:l,error:d}}();function vt(){return nn}class k{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw I.AuthServiceError(e.title,t)}static login(e){return m(V.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:V.applicationName})}).catch(k.parseError)}static registration(e){return e.AppName=V.applicationName,m(V.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(k.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw I.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return k.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return k.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return k.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return k.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return m(`${V.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(k.parseError)}static startLoginProcess(e){return k.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return k.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return k.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return m(`${V.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(k.parseError).then(k.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw I.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}function rn(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const on="masterId",sn="masterEntity";function ve(n,e){if(!Array.isArray(e))return;if(rn(e))return t(e);e.forEach(t);function t(r){n.append(sn,r[0]),n.append(on,r[1].toString())}}class x{static async anonymousGetList(e){return await m(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(o,s)=>r.append(o,s),r=new URLSearchParams;if(e.fields){const o=e.fields;typeof o=="string"?t("fields",o):Array.isArray(o)?t("fields",o.join(" ")):typeof o=="object"&&t("fields",Object.keys(o).join(" "))}if(e.order){let o=e.order;const d=(Array.isArray(o)?[o]:Object.entries(o)).map(([l,a="desc"])=>`@${l} ${a}`).join(",");t("order",d)}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=x.getSearchParamsForEntityListRead(t||{});return await m(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=x.getSearchParamsForEntityListRead(t||{});return m(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,t,r){const o=new URLSearchParams;return ve(o,r==null?void 0:r.masterEntities),m(`/close-api/data/${e}?${o.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:t})})}static update(e,t,r,o={}){return m(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static readById(e,t,r={}){const o=new URLSearchParams;if(r.fields){let s=r.fields;typeof s=="string"&&(s=[s]),o.append("fields",s.join(" "))}return m(`/close-api/data/entities/${e}/id/${t}?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,t,r,o){const s=new URLSearchParams;return ve(s,o==null?void 0:o.masterEntities),m(`/close-api/data/entities/${e}/id/${t}?${s.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r,version:o==null?void 0:o.version})})}static removeById(e,t,r){const o=typeof t=="number"?{Id:t}:t;return x.removeByKeys(e,o,r)}static removeByKeys(e,t,r){return m(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}const Ct=class te{static async create(e){return m(te.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 m(te.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return m(`${te.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return m(`${te.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};Ct.url="/close-api/communications";let se=Ct;class an{static async getDefaultView(e){return m("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function tt(n){return{...n,createdEntities:n.createdEntites}}const Et=class pe{static async getStartConfig(e,t){return m([pe.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return m([pe.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(tt)}static async runStep(e,t,r,o,s){return m([pe.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:o,values:s})}).then(tt)}};Et.url="/close-api/views/process-wizard";let he=Et;class je{static get url(){return"/close-api/metadata"}static async get(e,t,r){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const o=new URLSearchParams;return t&&o.append("criteria",t),r&&o.append("id",String(r)),await fetch(this.url+`/${e}?${o.toString()}`,{method:"GET"}).then(s=>s.json())}static getById(e,t,r=[]){const o=new URLSearchParams;return ve(o,r),t&&o.append("id",t),m([this.url,e].join("/")+`?${o.toString()}`)}static getFieldInformation(e,t){return m(`/open-api/metadata/${e}/fields/${t}`)}static getTreatmentListField(e,t){return m(`/open-api/metadata/${e}/list-fields/${t}`)}}class cn{static async upload(e,t){const r=new FormData;r.append("file",e);const o=`/close-api/files?entityName=${t}`;return await fetch(o,{method:"POST",body:r}).then(s=>s.json()).then(s=>(s.filename=e.name,s))}}class ln{static invite(e,t,r){return m("/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 m("/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 m("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class Me{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return m(Me.url+e,{method:"POST",body:JSON.stringify(t)})}}class un{static getConfiguration(){return m("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class bt{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 o=new URLSearchParams;return ve(o,r),m([this.url(),e,t].join("/")+`?${o.toString()}`,{method:"GET"})}}class dn extends R{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return se.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return se.read(e).then(t=>t.length===0?se.create(e):t[0])}}function fn(n){const e=S.Form.getParentForm();e?e.subscribe(n):console.warn(I.ParentFormNotFound());const t=i.reactive([]);return n.read=()=>se.readMessages(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function pn(n,e="images"){return`/static-folder/${e}/${n}`}function hn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function gn(n,e){const t=i.ref(null);function r(){return n.name?je.getById(n.name,e,[]).then(o=>{t.value=o,o.fields.forEach(s=>{s.canSet?n.enable(s.name):n.disable(s.name)})}).catch(()=>{t.value=null;const o=I.MetadataEntityIsNotAvailable(n.name||"FORM_WITHOUT_NAME");K.add("error",o.message)}):Promise.reject()}return n.on(S.Form.EVENT_READ,r),{metadata:t,update:r}}class Ue extends Error{static UndefinedStatus(){return new Ue("Status is undefined.")}}class mn extends Ue{}function yn(n,e){const t=i.reactive([]);async function r(s,d){if(!s)throw mn.UndefinedStatus();const l=await bt.get({criterion:s});t.splice(0,t.length),t.push(...l.map(a=>o(a,d)))}return{actions:t,update:r};function o(s,d){return{title:s.title,callback:()=>(()=>Promise.resolve().then(()=>{if(n.changed)return n.save()}).then(()=>fetch(s.url,{method:"POST",body:JSON.stringify({keys:{Id:d},contextId:v.contextId}),headers:{"Content-Type":"application/json"}})).then(a=>a.json()).then(a=>{if(!a.success)throw e!=null&&e.ModalValidationResult&&a.validationEffect?Lt.openModal(e.ModalValidationResult,{rules:a.validationEffect.results}):K.add("error",a.message),new Error;return a}).then(a=>{a.message&&K.add("info",a.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(a.affectedEntities)}).then(()=>n.read()))()}}}class Ce{static url(){return"/close-api/presentation"}static getStatuses(e,t){return fetch(`${Ce.url()}/status/${e}/${t}`).then(r=>r.json())}}function wn(n){const e=i.reactive({title:"Loading",type:"wait"});function t(r){if(n.name&&Number.isInteger(r))return Ce.getStatuses(n.name,r).then(o=>{e.type=o.type,e.title=o.name})}return n.on(S.Form.EVENT_READ,r=>{var d,l;const{code:o,name:s}={code:(d=r.Status)==null?void 0:d.Code,name:(l=r.Status)==null?void 0:l.Name};return n.name?!Number.isInteger(o)&&!s?void console.log("Undefined code or name is Status prop."):Ce.getStatuses(n.name,o).then(a=>{e.type=a.type,e.title=s}):void console.log("Form without name.")}),{label:e,update:t}}function vn(n,e){const t=st.useRoute(),r=i.computed(()=>Number(t.params.id)),o=i.reactive({ready:!1,show:!1});return i.watch(()=>r.value,()=>{o.ready=!1}),i.watch(()=>r.value,()=>{Number.isInteger(r.value)&&n.read()},{immediate:!0}),n.read=ie.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return x.readById(n.name,r.value,{fields:e.fields})}).then(ie.valuesToUpperCase).then(s=>(Number.isInteger(s.Version)&&(n.version=s.Version),n.setValues(s),o.show=!0,s)).catch(s=>{throw Object.prototype.hasOwnProperty.call(s,"status")&&[403,404].includes(s.status)&&(o.show=!1),s}).finally(()=>{o.ready=!0})),n.save=ie.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return x.updateById(n.name,r.value,n.changes,{version:n.version})}).then(s=>{n.version=s.version})),n.on(S.Form.EVENT_SAVE,n.read.bind(n)),{formShadowState:o}}function Cn(){const n=i.reactive({contextId:v.contextId,person:v.person,organizations:v.organizations,ready:v.ready,user:v.user}),e=i.computed(()=>{if(!v.ready||!v.person)return null;const r=n.contextId;return v.person.id===r?v.person:v.organizations.find(o=>o.id===r)||null}),t=i.computed(()=>{var r;return n.contextId===((r=n.person)==null?void 0:r.id)});return v.onupdateContext(r=>{n.contextId=r}),v.onupdateData(()=>{n.person=v.person,n.organizations=v.organizations,n.user=v.user}),v.onReady(r=>{n.ready=r}),{state:i.readonly(n),currentContext:e,isPerson:t}}function En(n,e){const t=i.reactive({ready:!1,show:!1});function r(){t.ready=!1,t.show=!1}return n.read=()=>{let o=e();return Promise.resolve().then(()=>{if(!n.name)throw I.EntityWithoutName("Use Form Request");return x.readById(n.name,o.id,{fields:o.fields})}).then(ie.valuesToUpperCase).then(s=>(s.hasOwnProperty("Version")&&(n.version=Number(s.Version)),n.setValues(s),t.show=!0,s)).catch(s=>{const d=He(s);throw K.add("error",d.message),d}).finally(()=>{t.ready=!0})},n.save=()=>{let o=e();return Promise.resolve().then(()=>{if(!n.name)throw I.EntityWithoutName("Use Form Request");return x.updateById(n.name,o.id,n.changes,{version:n.version})}).then(s=>{n.version=s.version||s.Version}).catch(s=>{const d=He(s);throw K.add("error",d.message),d})},n.on(S.Form.EVENT_SAVE,n.read.bind(n)),{shadowFormState:t,initShadow:r}}class bn{static getRequiredDocuments(e,t,r){const o=new URLSearchParams({entity:e,primaryKey:t,statusCode:r});return fetch(`/close-api/views/required-documents?${o.toString()}`).then(s=>s.json())}}class J{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${J.url()}/calculator/${e}`)}static calculate(e,t){return m(`/${J.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]):I.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 m(`/${J.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return m(`/${J.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class _n{static getListSettings(e,t){const r=new URLSearchParams;r.set("entity",e),t&&r.set("mark",t);const o=`/close-api/views/list/configs?${r.toString()}`;return m(o)}}var _t=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},L=(n,e,t)=>(_t(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(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)},U=(n,e,t,r)=>(_t(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),ge,ne,me,ye,re,oe,Be;const W="_______LIST_______ROW_______INDEX________NAME_______",ke=class B extends R{constructor(e){super(),this.LIST_ROW_KEY=1,M(this,ge,void 0),this.array=[],M(this,ne,[]),M(this,me,[]),M(this,ye,new Proxy({},{set:(t,r,o,s)=>(t[r]=o,this.emit(B.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(B.EVENT_FILTERS_UPDATE,t),!0)})),M(this,re,!1),M(this,oe,(...t)=>Promise),M(this,Be,()=>{}),U(this,ge,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&U(this,ne,e.config)}set config(e){U(this,ne,e.map(S.utils.copyObject)),this.emitUpdateConfig()}get config(){return L(this,ne)}emitUpdateConfig(){this.emit(B.EVENT_CONFIG_UPDATE,this.config)}get order(){return L(this,me)}set order(e){U(this,me,e),this.emit(B.EVENT_ORDER_UPDATE,this.order)}get filters(){return L(this,ye)}set filters(e){Tn(L(this,ye),e)}set wait(e){U(this,re,e),this.emit(S.Form.EVENT_WAIT,L(this,re))}get wait(){return L(this,re)}get primaryKeys(){return L(this,ge)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[W]===e)}indexByKey(e){return this.array.findIndex(t=>t[W]===e)}static getKey(e){return e[W]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,W)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(B.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(B.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(B.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[W]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,W)}set read(e){U(this,oe,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=L(this,oe).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){U(this,oe,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>L(this,Be).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,[W]: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=B.getCellName(e),o=(()=>{let s=r?_e(t,r):null;return s===void 0&&(s=null),e.value?e.value(s,t):s})();return{name:r,value:o}}};ge=new WeakMap;ne=new WeakMap;me=new WeakMap;ye=new WeakMap;re=new WeakMap;oe=new WeakMap;Be=new WeakMap;ke.EVENT_DATA="list-data: update";ke.EVENT_CONFIG_UPDATE="list-config:update";ke.EVENT_ORDER_UPDATE="list-order:update";ke.EVENT_FILTERS_UPDATE="list-filters:update";function Sn(n){const e=i.ref(""),t=i.computed(()=>{const r=e.value.toLowerCase();return i.unref(n).filter(o=>e.value.length?Object.values(o).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function Tn(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function kn(n){const e=i.reactive([]);function t(l){return e.includes(l)}function r(l){t(l)||e.push(l)}function o(l){const a=e.findIndex(p=>p===l);a!==-1&&e.splice(a,1)}function s(l){const a=i.unref(n);if(l===void 0){e.length===0?a.forEach(r):a.forEach(o);return}t(l)?o(l):r(l)}const d=i.computed(()=>{const l=i.unref(n);return e.length===l.length&&l.length!==0});return[e,s,d,r,o]}function Nn(n){return n.statusName==="Completed"}function An(n){return n.statusName==="FinalStepWithConfirmation"}function Fn(n){return n.statusName==="ValidationError"}function In(n,e,t){let r=null;const o=i.reactive({wait:null});let s=[],d=null;const l=i.ref(null);function a(){l.value=s.find(y=>y.name===d)||null}function p(){var y;return d?((y=s.find(b=>b.name===d))==null?void 0:y.fields)||[]:[]}function c(y){if(a(),Fn(y))return void t.onValidation(y.validationResults);if((y.statusName==="FinalStep"||y.statusName==="NextStep")&&(!p().length||$n(p(),t.presets)))return C(t.presets||{});Nn(y)&&t.onCompleted(y),An(y)&&t.onConfirmation(y)}async function f(){try{await u(),await w()}catch(y){const{message:b}=Ee(y);be.add("error",b)}}function u(){return o.wait="Loading process information.",he.getStartConfig(e,n).then(y=>{s=y.steps.map(b=>({label:b.title,name:b.stepName,number:b.number,fields:b.frontendEntity.objectTypes.reduce((T,N)=>(N.properties.forEach(O=>{T.push({name:O.name,label:O.title,type:O.refEntityName||O.dataType})}),T),[])}))}).then(y=>(o.wait=!1,y))}function h(y){return d=y.nextStepName,r=y.token,y}function g(y){const b=Ee(y);be.add("error",b.message)}function w(){return o.wait="Starting process",he.startProcess(e,n).then(h).then(c).catch(g).finally(()=>{o.wait=null})}function C(y={}){return!r||!d?Promise.reject("Not step or token."):(o.wait="Expect the result",he.runStep(e,n,d,r,y).then(h).then(c).catch(g).finally(()=>{o.wait=!1}))}return{initialize:f,state:o,currentStepConfig:i.readonly(l),next:C}}function $n(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 On="close-api/proxy/Equipment/Search";class Pn{static search(e,t,r,o,s){const d=new URLSearchParams;d.append("pattern",e||""),t&&d.append("categoryId",t),r&&d.append("useType",String(r)),o&&d.append("statusCode",o),s&&(d.append("limit",String(s.limit)),d.append("offset",String(s.offset)));const l=`/${On}?${d.toString()}`;return m(l,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Rn={class:"widget-table__head"},Ln={class:"widget-table__head-label margin_0 text_overflow"},Bn=i.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(i.openBlock(),i.createElementBlock("tr",Rn,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.config,(r,o)=>(i.openBlock(),i.createElementBlock("th",{class:"widget-table__head-cell",key:o},[i.createElementVNode("p",Ln,i.toDisplayString(r.label),1)]))),128))]))}});const j=(n,e)=>{const t=n.__vccOpts||n;for(const[r,o]of e)t[r]=o;return t},xn=j(Bn,[["__scopeId","data-v-25198f4a"]]);function Dn(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function St(n,e){const t=Dn(n);let r=t?S.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function Vn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var xe={exports:{}},Re,nt;function jn(){if(nt)return Re;nt=1;var n=1e3,e=n*60,t=e*60,r=t*24,o=r*7,s=r*365.25;Re=function(c,f){f=f||{};var u=typeof c;if(u==="string"&&c.length>0)return d(c);if(u==="number"&&isFinite(c))return f.long?a(c):l(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))};function d(c){if(c=String(c),!(c.length>100)){var f=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(f){var u=parseFloat(f[1]),h=(f[2]||"ms").toLowerCase();switch(h){case"years":case"year":case"yrs":case"yr":case"y":return u*s;case"weeks":case"week":case"w":return u*o;case"days":case"day":case"d":return u*r;case"hours":case"hour":case"hrs":case"hr":case"h":return u*t;case"minutes":case"minute":case"mins":case"min":case"m":return u*e;case"seconds":case"second":case"secs":case"sec":case"s":return u*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}}}function l(c){var f=Math.abs(c);return f>=r?Math.round(c/r)+"d":f>=t?Math.round(c/t)+"h":f>=e?Math.round(c/e)+"m":f>=n?Math.round(c/n)+"s":c+"ms"}function a(c){var f=Math.abs(c);return f>=r?p(c,f,r,"day"):f>=t?p(c,f,t,"hour"):f>=e?p(c,f,e,"minute"):f>=n?p(c,f,n,"second"):c+" ms"}function p(c,f,u,h){var g=f>=u*1.5;return Math.round(c/u)+" "+h+(g?"s":"")}return Re}function Mn(n){t.debug=t,t.default=t,t.coerce=a,t.disable=s,t.enable=o,t.enabled=d,t.humanize=jn(),t.destroy=p,Object.keys(n).forEach(c=>{t[c]=n[c]}),t.names=[],t.skips=[],t.formatters={};function e(c){let f=0;for(let u=0;u<c.length;u++)f=(f<<5)-f+c.charCodeAt(u),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(c){let f,u=null,h,g;function w(...C){if(!w.enabled)return;const y=w,b=Number(new Date),T=b-(f||b);y.diff=T,y.prev=f,y.curr=b,f=b,C[0]=t.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let N=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(D,_)=>{if(D==="%%")return"%";N++;const Y=t.formatters[_];if(typeof Y=="function"){const ce=C[N];D=Y.call(y,ce),C.splice(N,1),N--}return D}),t.formatArgs.call(y,C),(y.log||t.log).apply(y,C)}return w.namespace=c,w.useColors=t.useColors(),w.color=t.selectColor(c),w.extend=r,w.destroy=t.destroy,Object.defineProperty(w,"enabled",{enumerable:!0,configurable:!1,get:()=>u!==null?u:(h!==t.namespaces&&(h=t.namespaces,g=t.enabled(c)),g),set:C=>{u=C}}),typeof t.init=="function"&&t.init(w),w}function r(c,f){const u=t(this.namespace+(typeof f>"u"?":":f)+c);return u.log=this.log,u}function o(c){t.save(c),t.namespaces=c,t.names=[],t.skips=[];let f;const u=(typeof c=="string"?c:"").split(/[\s,]+/),h=u.length;for(f=0;f<h;f++)u[f]&&(c=u[f].replace(/\*/g,".*?"),c[0]==="-"?t.skips.push(new RegExp("^"+c.slice(1)+"$")):t.names.push(new RegExp("^"+c+"$")))}function s(){const c=[...t.names.map(l),...t.skips.map(l).map(f=>"-"+f)].join(",");return t.enable(""),c}function d(c){if(c[c.length-1]==="*")return!0;let f,u;for(f=0,u=t.skips.length;f<u;f++)if(t.skips[f].test(c))return!1;for(f=0,u=t.names.length;f<u;f++)if(t.names[f].test(c))return!0;return!1}function l(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function a(c){return c instanceof Error?c.stack||c.message:c}function p(){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 Un=Mn;(function(n,e){e.formatArgs=r,e.save=o,e.load=s,e.useColors=t,e.storage=d(),e.destroy=(()=>{let a=!1;return()=>{a||(a=!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(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;a.splice(1,0,p,"color: inherit");let c=0,f=0;a[0].replace(/%[a-zA-Z%]/g,u=>{u!=="%%"&&(c++,u==="%c"&&(f=c))}),a.splice(f,0,p)}e.log=console.debug||console.log||(()=>{});function o(a){try{a?e.storage.setItem("debug",a):e.storage.removeItem("debug")}catch{}}function s(){let a;try{a=e.storage.getItem("debug")}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=process.env.DEBUG),a}function d(){try{return localStorage}catch{}}n.exports=Un(e);const{formatters:l}=n.exports;l.j=function(a){try{return JSON.stringify(a)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(xe,xe.exports);var Wn=xe.exports;const Tt=Vn(Wn);function kt(n){return["eservices-core",n].join(":")}function Nt(n){return We(n,"YYYY/MM/DD HH:mm:ss")}function We(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return Bt.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const qn={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()=>i.h("i",{class:`icon icon-${t}`})}},Ne=j(qn,[["__scopeId","data-v-e287c8d9"]]),zn=Tt(kt("setup-list-row"));function Gn(n,e){const t=n.config.map(r=>Jn(r,n,e));return i.h("tr",{class:"widget-table__row widget-table-row"},t)}function Jn(n,e,t){const r=e.values;let o=St(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function d(c){s.onClick.push(()=>c(r))}function l(c){Array.isArray(c)?s.class.push(...c):s.class.push(c)}const a=[],p=[];if(n.hide&&n.hide(r))return[i.h("td")];if(n.type)switch(l(`widget-table-cell_${n.type}`),n.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=We(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=Nt(typeof o=="string"?o:null);break}case"money":{o=It(o);break}case"multi-select":{p.push(i.h(S.FormField,{type:"single-checkbox",modelValue:e.selected})),d(rt.bind(null,t,!0));break}case"select":{p.push(i.h(S.FormField,{type:"single-radio",modelValue:e.selected})),d(rt.bind(null,t,!1));break}}if(n.onClick&&d(n.onClick),n.link)try{const c=n.link(r);if(c){const f=i.h(st.RouterLink,{to:c});p.push(f),l("widget-table-cell_link")}}catch(c){zn("Can't add router link",c)}return n.href&&(p.push(i.h("a",{href:n.href(r),target:"_blank"})),l("widget-table-cell_link")),(typeof o=="string"||typeof o=="number")&&p.push(i.h("p",{class:"widget-list-cell-text"},o)),n.icon&&p.push(i.h(Ne,{name:n.icon})),n.class&&(typeof n.class=="function"?l(n.class(r)):l(n.class)),a.push(i.h("td",s,p)),a}function rt(n,e){n.emit("select",e)}function At(n,e){return()=>{try{return Gn(n,e)}catch(t){return console.warn(t),null}}}const Kn={props:{values:Object,config:Object,selected:Boolean},setup:At},Hn=["colspan"],ot=i.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=i.ref();return i.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,o)=>(i.openBlock(),i.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[i.createElementVNode("td",{colspan:r.rowLength},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(r.component),i.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:o[0]||(o[0]=s=>e("close")),onSave:o[1]||(o[1]=s=>e("save",s))}),null,16,["values","new"]))],8,Hn)],512))}}),qe={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go."},Yn={class:"widget-table"},it="update:selectedRows",Xn=i.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=i.useSlots(),o=i.computed(()=>{var l;return(l=r==null?void 0:r.default)==null?void 0:l.call(r)[0]});function s(l,a=!0){if(!t.selectedRows)return;if(!a)return e(it,t.selectedRows.includes(l)?[]:[l]);const p=[...t.selectedRows],c=p.indexOf(l);return c===-1?p.push(l):p.splice(c,1),e(it,p)}function d(l){e("save",l),e("update:activeRow",null)}return(l,a)=>(i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("table",Yn,[i.createVNode(xn,{config:l.config},null,8,["config"]),i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.array,(p,c)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:c},[i.createVNode(Kn,{config:l.config,values:p,selected:l.selectedRows.includes(p),onSelect:f=>s(p,f),class:i.normalizeClass(l.classCallback?l.classCallback(p):"")},null,8,["config","values","selected","onSelect","class"]),o.value&&l.activeRow===p?(i.openBlock(),i.createBlock(ot,{key:0,component:o.value,"row-length":l.config.length,values:p,onClose:a[0]||(a[0]=f=>e("update:activeRow",null)),onSave:d,"is-new":!1},null,8,["component","row-length","values"])):i.createCommentVNode("",!0)],64))),128)),l.activeRow===i.unref(qe).LIST_ACTIVE_NEW?(i.openBlock(),i.createBlock(ot,{key:0,component:o.value,"row-length":l.config.length,onClose:a[1]||(a[1]=p=>e("update:activeRow",null)),onSave:d,"is-new":!0},null,8,["component","row-length"])):i.createCommentVNode("",!0)])])]))}}),Zn=i.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(i.openBlock(),i.createElementBlock("div",{class:"widget-spinner",style:i.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}});const Ae=j(Zn,[["__scopeId","data-v-0ef9ae88"]]),Qn={class:"widget-button"},er=i.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(i.openBlock(),i.createElementBlock("button",Qn,[e.wait?(i.openBlock(),i.createBlock(Ae,{key:0,class:"widget-button-spinner"})):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const tr=j(er,[["__scopeId","data-v-450dc564"]]),nr={class:"widget-multi-button-wrap position_relative cursor_pointer"},rr={class:"widget-multi-button-body grid"},or=["onClick"],ir={class:"widget-multi-button-side-wrap"},sr=i.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;i.useCssVars(d=>({"7025434e":r.value}));const t=i.reactive({active:!1,wait:!1}),r=i.computed(()=>e.array.length+(e.label?1:0));function o(d){if(!(typeof d!="function"||t.wait))return t.wait=!0,Promise.resolve().then(d).finally(()=>{t.wait=!1})}function s(d=!t.active){t.active=d}return(d,l)=>(i.openBlock(),i.createElementBlock("div",nr,[i.createElementVNode("div",{class:i.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[i.createElementVNode("div",rr,[d.label?(i.openBlock(),i.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:l[0]||(l[0]=a=>s())},i.toDisplayString(d.label),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.array,(a,p)=>(i.openBlock(),i.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:p,onClick:c=>{o(a.callback),s(!1)}},i.toDisplayString(a.label),9,or))),128))]),i.createElementVNode("div",ir,[i.createElementVNode("div",{class:i.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:l[1]||(l[1]=a=>s())},[t.wait?(i.openBlock(),i.createBlock(i.unref(Ae),{key:0,class:"widget-multi-button-side-spinner"})):d.array.length>1?(i.openBlock(),i.createBlock(i.unref(Ne),{key:1,class:"widget-multi-button-side-icon"},{default:i.withCtx(()=>[i.createTextVNode("angle-small-down")]),_:1})):i.createCommentVNode("",!0)],2)])],2)]))}});const ar=j(sr,[["__scopeId","data-v-a8d711d1"]]),cr={class:"widget-loader flex flex-align_center gap_10 padding_15"},lr={class:"text_md"},ur=i.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(i.openBlock(),i.createElementBlock("div",cr,[i.createVNode(Ae,{color:"var(--primary)",class:"padding_10"}),i.createElementVNode("span",lr,i.toDisplayString(e.label),1)]))}}),dr=["alt","src"],fr=i.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=i.ref();return i.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,o)=>(i.openBlock(),i.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,dr))}}),pr={props:{config:Array,values:Object,selected:Boolean},setup:At};const hr=j(pr,[["__scopeId","data-v-344a8cc1"]]),gr=n=>(i.pushScopeId("data-v-4e1d87c8"),n=n(),i.popScopeId(),n),mr={class:"head-cell"},yr=gr(()=>i.createElementVNode("div",{class:"head-cell-resize"},null,-1)),wr=i.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,o)=>(i.openBlock(),i.createElementBlock("th",null,[i.createElementVNode("div",mr,[i.createElementVNode("div",{class:"head-cell-content flex_grow",style:i.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(i.openBlock(),i.createBlock(i.unref(S.FormField),{key:0,type:"single-checkbox",onClick:o[0]||(o[0]=i.withModifiers(s=>e("select"),["stop","prevent"]))})):(i.openBlock(),i.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:o[1]||(o[1]=s=>e("order"))},i.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(i.openBlock(),i.createBlock(i.unref(Ne),{key:0,class:i.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:i.withCtx(()=>[i.createTextVNode("core-arrow-up")]),_:1},8,["class"])):i.createCommentVNode("",!0),yr])]))}});const vr=j(wr,[["__scopeId","data-v-4e1d87c8"]]),Cr=i.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=i.ref(),o=i.ref();i.onMounted(()=>{function a(h,g){let w=-1;do w++,g-=h[w];while(g>0&&w<h.length);return w}function p(h,g){let w=0;for(;g>0&&g>h[w]&&w<h.length;)g-=h[w],w++;return console.log(g,w),w>0?w:0}function c(h){try{o.value.style.insetInlineStart=h+"px"}catch(g){console.log(g)}}function f(h){try{o.value.style.width=h+"px",o.value.style.minWidth=h+"px",o.value.style.maxWidth=h+"px"}catch(g){console.log(g)}}function u(h){return h===null?!1:h.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(g){var Ke;function w(A){return A.screenX+b-O}const C=r.value,y=[...C.children].filter(A=>A.localName==="th"),b=((Ke=C.offsetParent)==null?void 0:Ke.scrollLeft)||0,T=y.map(A=>A.clientWidth),N=u(g.target),O=C.getBoundingClientRect().left,D=w(g),_=a(T,D),Y=T.slice(0,_).reduce((A,P)=>A+P,0),ce=D-Y,Fe=C.offsetWidth,X=y[_].clientWidth;if(t.config[_].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",g.screenX),console.log("Widths",T),console.log("max width",Fe),console.log("Start Position",D),console.log("Position From",_),console.log("Start Position",_),console.log("Global offset (Отступ самой таблицы от края экрана)",O),console.log("Del",ce),console.groupEnd(),o.value.innerText=y[_].textContent||"",o.value.style.display="grid",o.value.style.width=X+"px",o.value.style.cursor="grabbing",c(Y),f(X),document.addEventListener("pointermove",Je,{passive:!0}),document.addEventListener("pointerup",Ge);function Ge(A){if(console.group("END"),document.removeEventListener("pointermove",Je),document.removeEventListener("pointerup",Ge),N&&(t.config[_].width=o.value.style.width,t.config[_].minWidth=o.value.style.width,t.config[_].maxWidth=o.value.style.width,s(t.config)),!N){const P=A.screenX+b-O;console.log("ENP Position",P);const le=p(T,P);if(console.log(_,"->",le),le!==_){const Z=t.config[_],Ie=t.config;Ie.splice(_,1),Ie.splice(le,0,Z),s(Ie)}else{const Z=t.config[_].name;d(Z)}}o.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Je(A){if(N){const Z=w(A)-D+X;f(Z);return}let P=A.screenX+b-O-ce;P<0&&(P=0),P+X>Fe&&(P=Fe-X),c(P)}})});function s(a){e("update:config",a)}function d(a){if(!a)return;if(Array.isArray(a)){if(a.length<1)return;a=a[0]}if(t.order.length===0||t.order[0]!==a)return void l([a]);const p=t.order.length===1||t.order[1]==="asc"?"asc":"desc";l([a,p==="asc"?"desc":"asc"])}function l(a){e("update:order",a)}return(a,p)=>(i.openBlock(),i.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.config,(c,f)=>(i.openBlock(),i.createBlock(vr,i.mergeProps({key:c},c,{onOrder:u=>d(c.name),onSelect:p[0]||(p[0]=u=>e("select")),order:a.order}),null,16,["onOrder","order"]))),128)),i.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:o},"test",512)],512))}});const Er=j(Cr,[["__scopeId","data-v-ccffc6bd"]]),br={class:"widget-list"},_r={class:"widget-list-body position_relative"},Sr=50,Tr=i.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(l,a=!0){if(t.selectedRows)if(!a)s(t.selectedRows.includes(l)?[]:[l]);else{const p=[...t.selectedRows],c=p.indexOf(l);c===-1?p.push(l):p==null||p.splice(c,1),s(p)}}function o(){var l;if(((l=t.selectedRows)==null?void 0:l.length)!==t.array.length)return s([...t.array]);s([])}function s(l){e("update:selectedRows",l)}function d(l){if(!l)return;const a=l.target;a.scrollTop+a.clientHeight+Sr>a.scrollHeight&&e("scrollEnd")}return(l,a)=>(i.openBlock(),i.createElementBlock("div",{class:"es-list-container",onScrollPassive:d},[i.createElementVNode("table",br,[i.createElementVNode("thead",null,[i.createVNode(Er,{onSelect:a[0]||(a[0]=p=>o()),"onUpdate:order":a[1]||(a[1]=p=>e("update:order",p)),"onUpdate:config":a[2]||(a[2]=p=>e("update:config",p)),config:l.config,order:l.order},null,8,["config","order"])]),i.createElementVNode("tbody",_r,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.array,(p,c)=>{var f;return i.openBlock(),i.createBlock(hr,{key:c,class:"widget-list-row",values:p,config:l.config,selected:(f=l.selectedRows)==null?void 0:f.includes(p),onSelect:u=>r(p,u)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function kr(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=i.reactive({wait:!1,call:e});return t}function Ee(n){return typeof n=="string"?Le(n):Nr(n)?Le(n.message):Le(qe.DEFAULT_ERROR_MESSAGE)}function Nr(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function Le(n){return{message:n}}function we(n="error"){return function(e){const{message:t}=Ee(e);be.add(n,t)}}function De(n,e){return ze().emit("entity:read",{...e,entity:n})}function Ft(n,e){return ze().emit("entity:update",{...e,entity:n})}function Ar(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function It(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 $t(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const o=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=$t(r)),e[o]=r,e},{})}function Fr(n,e){const t=new Map;return n.forEach(r=>{var s;const o=e(r);t.has(o)||t.set(o,[]),(s=t.get(o))==null||s.push(r)}),t}function Ir(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function $r(){const n=i.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const G=Tt(kt("use-socket"));function ze(){return Or}const Or=function(){let n=1,e;const t=new Set,r=new Set;function o(){return{safeQueue:r,requestId:n,handlers:t}}function s(u){const h=[...t.values()];G("Handlers array length is %d. Response event: %s. Request id: %d",t.size,u.event,u.requestId),h.forEach(g=>{const w=u.requestId;(g.requestId&&g.requestId===w||!g.requestId&&g.event===u.event)&&(G("Find appropriated handler: %d, event: %s",n,g.event),g.callback(u.data,u),g.once&&(t.delete(g),G("Handler was removed by *once* params was passed. %o",g)))})}function d(u){console.log(`%cInitializing sockets: %c${u}`,"color: purple","color: black"),e=new WebSocket(u),e.onclose=function(h){G("Connection to server was stopped: %d %s",h.code,h.reason),setTimeout(()=>d(u))},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...r.values()].forEach(h=>{l(h),r.delete(h)})},e.onerror=function(h){console.warn(h)},e.onmessage=h=>{try{const g=JSON.parse(h.data);if(!Ot(g)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(g);return}s(g)}catch(g){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(g)}}}function l(u){e.send(u)}function a(u,h){t.add({event:u,callback:h})}function p(u,h){t.add({event:u,callback:h,once:!0})}function c(){return e&&(e==null?void 0:e.readyState)===1}function f(u,h,g){const w=++n,C=JSON.stringify({requestId:w,event:u,data:h,contextId:v.contextId,url:window.location.href});return c()?l(C):(r.add(C),G("Socket is not connected. Message was send to save-queue. %s")),new Promise((y,b)=>{t.add({event:u,requestId:w,once:!0,callback:(T,N)=>{if(G("Promise was resolve with next data:",T),Pr(N))return void b(T);g&&g(T,N),y(T)}})})}return{get socket(){return e},on:a,once:p,emit:f,initialization:d,getDevInfo:o}}(),Pr=n=>!!Ot(n)&&n.event==="request-error",Ot=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 Rr(n,e){const t=i.reactive([]);let r=0;const o=i.ref(!1);function s(){if(o.value)return Promise.reject("The process has already started.");const u=c();return o.value=!0,typeof u.limit!="number"&&(u.limit=100),u.offset=r,De(n,u).then(h=>(r+=h.length,h)).finally(()=>{o.value=!1})}function d(u,h){var w;const g=u.Version||((w=t.find(C=>C.Id===h))==null?void 0:w.Version);if(g===void 0)throw new Error("Object without version.");return g}function l(u,h){const g=t.findIndex(w=>w.Id===u);if(g===-1)throw new Error(`Can't found item with Id ${u}`);t.splice(g,1,h)}async function a(u,h){try{const g=c(),w=d(h,u);delete h.Version,await Ft(n,{id:u,values:h,version:w});const C=await De(n,{fields:g.fields||"",id:u});l(u,C)}catch(g){we()(g)}}async function p(){try{const u=await s();t.push(...u)}catch(u){we()(u)}}function c(){return typeof e=="function"?e():e}async function f(){try{r=0;const u=await s();t.splice(0,t.length,...u)}catch(u){we()(u)}}return{array:t,updateById:a,next:p,reload:f,wait:o}}const be=new class{constructor(){this.store=i.reactive([])}add(e,t,r={}){const o=Lr(r),s=new Br(e,t,o.timeout,o.children,o.click);return this.store.push(s),r.timeout&&setTimeout(this.remove.bind(this,s.id),r.timeout*1e3),s}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function Lr(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 Pt=class Rt{constructor(e,t,r,o,s){this.type=e,this.message=t,this.timeout=r,this.children=o,this.click=s,this.id=Rt.cardId++}};Pt.cardId=1;let Br=Pt;function xr(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 o=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${t} in (${o})`),e}if(xr(r)){let o=function(s){var d;return((d=s.match(/([^Z]*)/))==null?void 0:d[0])+"0000Z"};return r.start&&e.push(`@${t} ge ${o(r.start)}`),r.end&&e.push(`@${t} le ${o(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 ae(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${ae(t)}`};$.beginWith=function(e,t){return`@${e} BeginWith ${ae(t)}`};$.notEq=function(e,t){return`@${e} nq ${ae(t)}`};$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${ae(t)}`};$.in=function(e,t){const r=t.map(ae).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 ")};const Dr={clickOutside:Se,staticLink:pn,Request:m},Vr={usage:jt,utils:Jt,config:Kt,types:Ht};exports.ApplicationManager=gt;exports.Communication=dn;exports.ComputedMetadata=Qt;exports.CoreError=I;exports.Filter=$;exports.Manager=v;exports.MetadataStore=ee;exports.NotificationSystem=be;exports.Request=m;exports.WidgetButton=tr;exports.WidgetIcon=Ne;exports.WidgetImage=fr;exports.WidgetList=Tr;exports.WidgetLoader=ur;exports.WidgetMultiButton=ar;exports.WidgetSpinner=Ae;exports.WidgetTable=Xn;exports.actionService=bt;exports.asyncProcess=kr;exports.authService=k;exports.billingService=J;exports.catchUniversal=we;exports.clickOutside=Se;exports.clientService=dt;exports.communicationService=se;exports.configurationService=_n;exports.constants=qe;exports.dataService=x;exports.debounce=hn;exports.default=Vr;exports.documentsService=bn;exports.equipmentService=Pn;exports.fileService=cn;exports.getCellValue=St;exports.getNamesFromListConfig=Ar;exports.groupArrayByField=Fr;exports.historyService=Xt;exports.internationalizationService=tn;exports.invitationService=ln;exports.metadataService=je;exports.openService=un;exports.parseError=Ee;exports.prettifyValueByMetadata=en;exports.prettyDate=We;exports.prettyDateWithTime=Nt;exports.prettyMoney=It;exports.processWizardService=he;exports.ruleValidationService=Me;exports.t=H;exports.testTypes=Yt;exports.universalEntityRead=De;exports.universalEntityUpdate=Ft;exports.useCommunication=fn;exports.useCustomerState=Cn;exports.useFormAction=yn;exports.useFormLabel=wn;exports.useFormMetadata=gn;exports.useFormRequest=En;exports.useFormRequestData=vn;exports.useListActiveRow=$r;exports.useListEntity=Rr;exports.useListSearch=Sn;exports.useListSelect=kn;exports.useLogger=vt;exports.useManagerState=Wt;exports.useSocket=ze;exports.useWizard=In;exports.utils=Dr;exports.uuidv4=Ir;exports.valuesToUpperCase=$t;exports.viewService=an;
11
11
  //# sourceMappingURL=eservices-core.cjs.js.map
@@ -5,7 +5,7 @@ import { openModal as nn } from "jenesius-vue-modal";
5
5
  import { useRoute as rn, RouterLink as sn } from "vue-router";
6
6
  import on from "date-and-time";
7
7
  /*!
8
- * eservices-core v1.3.17
8
+ * eservices-core v1.3.18
9
9
  * (c) 2023 ESERVICES
10
10
  */
11
11
  function an(n, e) {
@@ -2753,6 +2753,12 @@ function ws(n, e) {
2753
2753
  }), t;
2754
2754
  }
2755
2755
  function vs() {
2756
+ return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(
2757
+ /[018]/g,
2758
+ (n) => (n ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> n / 4).toString(16)
2759
+ );
2760
+ }
2761
+ function Cs() {
2756
2762
  const n = j(null);
2757
2763
  function e(t) {
2758
2764
  n.value = t;
@@ -2849,7 +2855,7 @@ const Ir = function() {
2849
2855
  getDevInfo: s
2850
2856
  };
2851
2857
  }(), $r = (n) => !!Gt(n) && n.event === "request-error", Gt = (n) => !!n && typeof n == "object" && n !== null && "event" in n && typeof n.event == "string" && "requestId" in n && typeof n.requestId == "number" && "data" in n;
2852
- function Cs(n, e) {
2858
+ function Es(n, e) {
2853
2859
  const t = N([]);
2854
2860
  let r = 0;
2855
2861
  const s = j(!1);
@@ -3010,13 +3016,13 @@ U.is = function(e, t) {
3010
3016
  U.or = function(...e) {
3011
3017
  return e.join(" or ");
3012
3018
  };
3013
- const _s = {
3019
+ const bs = {
3014
3020
  clickOutside: Qe,
3015
3021
  //!!!!!!!!!!!!!!!!
3016
3022
  staticLink: In,
3017
3023
  //!!!!!!!!!!!!!!!!
3018
3024
  Request: y
3019
- }, bs = {
3025
+ }, Ss = {
3020
3026
  usage: un,
3021
3027
  utils: wn,
3022
3028
  config: vn,
@@ -3052,7 +3058,7 @@ export {
3052
3058
  Bt as constants,
3053
3059
  z as dataService,
3054
3060
  Xr as debounce,
3055
- bs as default,
3061
+ Ss as default,
3056
3062
  ss as documentsService,
3057
3063
  ls as equipmentService,
3058
3064
  Gr as fileService,
@@ -3082,15 +3088,16 @@ export {
3082
3088
  Zr as useFormMetadata,
3083
3089
  rs as useFormRequest,
3084
3090
  ts as useFormRequestData,
3085
- vs as useListActiveRow,
3086
- Cs as useListEntity,
3091
+ Cs as useListActiveRow,
3092
+ Es as useListEntity,
3087
3093
  os as useListSearch,
3088
3094
  as as useListSelect,
3089
3095
  bn as useLogger,
3090
3096
  Mr as useManagerState,
3091
3097
  zt as useSocket,
3092
3098
  cs as useWizard,
3093
- _s as utils,
3099
+ bs as utils,
3100
+ vs as uuidv4,
3094
3101
  Nr as valuesToUpperCase,
3095
3102
  zr as viewService
3096
3103
  };
@@ -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
2
  (function(f,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("jenesius-vue-form"),require("jenesius-vue-modal"),require("vue-router"),require("date-and-time")):typeof define=="function"&&define.amd?define(["exports","vue","jenesius-vue-form","jenesius-vue-modal","vue-router","date-and-time"],o):(f=typeof globalThis<"u"?globalThis:f||self,o(f["eservices-core"]={},f.Vue,f.JenesiusVueForm,f.JenesiusVueModal,f.VueRouter,f.DateAndTime))})(this,function(f,o,T,Bt,Je,Dt){"use strict";/*!
3
- * eservices-core v1.3.17
3
+ * eservices-core v1.3.18
4
4
  * (c) 2023 ESERVICES
5
5
  */function Mt(n,e){return!!n&&n===e||"password is not equal"}function Ke(n){return Number(n.replace(/[^0-9.]/g,""))}function jt(n,e=null){let r=String(Ke(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 Vt={inputs:Object.freeze(Object.defineProperty({__proto__:null,numeric:Ke,prettyNumeric:jt,validPassword:Mt},Symbol.toStringTag,{value:"Module"}))};function le(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?le(n[r],e.substr(t+1)):void 0}return n[e]}function de(n,e){if(!n)return console.warn("Element is not provided.");function t(i,s){return i==s.target||i.contains(s.target)}const r=i=>{t(n,i)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function He(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const Ye=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
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.`)}};Ye.ID=0;let O=Ye;const Xe="Please try again later or submit a feedback if problem doesn't go.";function Ze(n){return typeof n=="string"?$e(n):Ut(n)?$e(n.message):$e(Xe)}function Ut(n){return!!(typeof n=="object"&&Object.hasOwnProperty.call(n,"message")&&n!==null)}function $e(n,e=[]){return{message:n,details:e}}class Qe{static getClientData(){return y("/close-api/client-content")}static getNavigation(){return y("/close-api/client/navigation")}}const J=new class{constructor(){this.store=o.reactive([])}add(e,t,{children:r,timeout:i=10,click:s=()=>{}}={}){const u=new Wt(e,t,i,r||[],s);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.")}},et=class Rt{constructor(e,t,r,i,s){this.type=e,this.msg=t,this.timeout=r,this.children=i,this.click=s,this.id=Rt.cardId++}};et.cardId=1;let Wt=et;/*!
7
7
  * jenesius-event-emitter v1.0.2
8
8
  * (c) 2022 Jenesius
9
9
  * @license MIT
10
- */const tt=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},nt=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},rt=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},it=function(){this.events={}};class P{constructor(){this.events={}}on(e,t){return tt.call(this,e,t)}emit(e,t){return nt.call(this,e,t)}off(e,t){return rt.call(this,e,t)}cleanEvents(){it.call(this)}static on(e,t){return tt.call(P,e,t)}static emit(e,t){return nt.call(P,e,t)}static off(e,t){return rt.call(P,e,t)}static cleanEvents(){it.call(P)}}P.events={};var ot=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},ue=(n,e,t)=>(ot(n,e,"read from private field"),t?t.call(n):e.get(n)),Oe=(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)},Fe=(n,e,t,r)=>(ot(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),X,fe,pe;const W=class $ extends P{constructor(){super(...arguments),Oe(this,X,void 0),Oe(this,fe,"front"),this.organizations=[],Oe(this,pe,!1)}set language(e){localStorage.setItem($.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem($.LOCALSTORAGE_LANGUAGE_KEY)||$.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem($.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){Fe(this,X,e)}get router(){if(!ue(this,X))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return ue(this,X)}set type(e){Fe(this,fe,e)}get type(){return ue(this,fe)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Fe(this,pe,e),this.emit($.EVENT_READY_UPDATE,e)}get ready(){return ue(this,pe)}onReady(e){return this.on($.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on($.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on($.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($.CURRENT_CONTEXT_KEY,String(e)),this.emit($.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($.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{J.add("error",O.ApiNotAvailable().message)}}loadCustomerData(){return Qe.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))}};X=new WeakMap,fe=new WeakMap,pe=new WeakMap,W.DEFAULT_LANGUAGE="en",W.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",W.EVENT_CONTEXT_UPDATE="event:context-update",W.EVENT_READY_UPDATE="event:ready-update",W.EVENT_DATA_UPDATE="event:data-update",W.CURRENT_CONTEXT_KEY="CurrentContext";let st=W;const E=new st;function qt(){const n=o.reactive({contextType:E.contextType,contextId:E.contextId,context:E.context});return E.onupdateContext(()=>{n.contextType=E.contextType,n.contextId=E.contextId,n.context=E.context}),n}function zt(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Xe}})}function y(n,e={}){return E.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=E.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw O.ApiNotAvailable()}).then(t=>zt(t).then(r=>{if(!t.ok)throw r;return r}))}class he{constructor(){}static parseNamesFromListConfig(e){let t=he.parseFieldsToGraphQL(e.reduce((i,s)=>(s.name&&i.push(s.name),i),[]));function r(i){let s="";for(let u in i)typeof i[u]=="boolean"?s+=` ${u} `:s+=` ${u} { ${r(i[u])} }`;return s}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 s=i.indexOf("."),u=i.substring(s+1),l=i.substring(0,s);l in r||(r[l]={}),t(r[l],u)}else r[i]=!0;return r}return e.reduce(t,{})}}class xt{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 at=new xt;function ct(n){return n&&n[0].toLowerCase()+n.slice(1)}function Pe(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=Pe(r)),e[i]=r,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(".")}const Z={Request:y,clickOutside:de,getPropFromObject:le,runPromiseQueue:He,GraphQL:he,firstChapterToLowerCase:ct,valuesToUpperCase:Pe,prettyMoney:Gt},Jt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:he,Journal:at,Request:y,clickOutside:de,default:Z,firstChapterToLowerCase:ct,getPropFromObject:le,runPromiseQueue:He,valuesToUpperCase:Pe},Symbol.toStringTag,{value:"Module"}));function lt(n,e=""){for(let t in n){if(typeof n[t]=="object"){lt(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 j={};function Kt(n){for(let e in n)j[e]=n[e];n.styles&&lt(n.styles),at.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=j}const Ht=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),jr="",Yt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Xt{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(s=>{if(!s.changes)return s;const u=s.changes.map(l=>({...l,oldValue:l.originalValue,name:l.fieldName}));return{...s,changes:u}});return{...r,history:i}})}}class Zt extends P{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 Re.get(e)}}const Q=new Zt;function Qt(n){const e=o.ref(Q.get(n));return Q.on(Q.EVENT_NEW,t=>{n===t.entityName&&(e.value=Q.get(n))}),e}function en(n,e){try{return e.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(t){ut().error("prettify value by metadata",n,t)}}class tn{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return y(`/open-api/internationalization/language/${e}`)}}let q={};function K(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=T.utils.getPropFromObject((this==null?void 0:this.vocabulary)||q,n);if(typeof t=="string")return dt(t,e);const r=T.utils.getPropFromObject(q==null?void 0:q.root,n);return typeof r=="string"?dt(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function dt(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}K.setGlobalVocabulary=function(n){q=n},K.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),K.bind({vocabulary:T.utils.getPropFromObject(q,e.toLowerCase())})},K.setVocabulary=function(n){return typeof n=="string"&&(n=T.utils.getPropFromObject(q,n)),K.bind({vocabulary:n})};const nn=function(){let n=!1;const e=[];function t(){return n}function r(a,h){t()&&console[a](...h),e.push(h)}function i(...a){r("log",a)}function s(...a){r("warn",a)}function u(...a){r("error",a)}function l(a=!0){n=a}return{info:i,warn:s,history:e,display:l,error:u}}();function ut(){return nn}class N{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw O.AuthServiceError(e.title,t)}static login(e){return y(j.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:j.applicationName})}).catch(N.parseError)}static registration(e){return e.AppName=j.applicationName,y(j.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(N.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw O.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return N.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return N.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return N.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return N.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return y(`${j.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(N.parseError)}static startLoginProcess(e){return N.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return N.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return N.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return y(`${j.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(N.parseError).then(N.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw O.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}function rn(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const on="masterId",sn="masterEntity";function ge(n,e){if(!Array.isArray(e))return;if(rn(e))return t(e);e.forEach(t);function t(r){n.append(sn,r[0]),n.append(on,r[1].toString())}}class B{static async anonymousGetList(e){return await y(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,s)=>r.append(i,s),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(([l,a="desc"])=>`@${l} ${a}`).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=B.getSearchParamsForEntityListRead(t||{});return await y(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=B.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 ge(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 s=r.fields;typeof s=="string"&&(s=[s]),i.append("fields",s.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 s=new URLSearchParams;return ge(s,i==null?void 0:i.masterEntities),y(`/close-api/data/entities/${e}/id/${t}?${s.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 B.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})})}}const ft=class ce{static async create(e){return y(ce.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(ce.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return y(`${ce.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return y(`${ce.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};ft.url="/close-api/communications";let ee=ft;class an{static async getDefaultView(e){return y("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function pt(n){return{...n,createdEntities:n.createdEntites}}const ht=class Ie{static async getStartConfig(e,t){return y([Ie.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return y([Ie.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(pt)}static async runStep(e,t,r,i,s){return y([Ie.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(pt)}};ht.url="/close-api/views/process-wizard";let me=ht;class Re{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(s=>s.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return ge(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 cn{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(s=>s.json()).then(s=>(s.filename=e.name,s))}}class ln{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 Le{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return y(Le.url+e,{method:"POST",body:JSON.stringify(t)})}}class dn{static getConfiguration(){return y("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class gt{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 ge(i,r),y([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}class un extends P{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return ee.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return ee.read(e).then(t=>t.length===0?ee.create(e):t[0])}}function fn(n){const e=T.Form.getParentForm();e?e.subscribe(n):console.warn(O.ParentFormNotFound());const t=o.reactive([]);return n.read=()=>ee.readMessages(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function pn(n,e="images"){return`/static-folder/${e}/${n}`}function hn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function gn(n,e){const t=o.ref(null);function r(){return n.name?Re.getById(n.name,e,[]).then(i=>{t.value=i,i.fields.forEach(s=>{s.canSet?n.enable(s.name):n.disable(s.name)})}).catch(()=>{t.value=null;const i=O.MetadataEntityIsNotAvailable(n.name||"FORM_WITHOUT_NAME");J.add("error",i.message)}):Promise.reject()}return n.on(T.Form.EVENT_READ,r),{metadata:t,update:r}}class Be extends Error{static UndefinedStatus(){return new Be("Status is undefined.")}}class mn extends Be{}function yn(n,e){const t=o.reactive([]);async function r(s,u){if(!s)throw mn.UndefinedStatus();const l=await gt.get({criterion:s});t.splice(0,t.length),t.push(...l.map(a=>i(a,u)))}return{actions:t,update:r};function i(s,u){return{title:s.title,callback:()=>(()=>Promise.resolve().then(()=>{if(n.changed)return n.save()}).then(()=>fetch(s.url,{method:"POST",body:JSON.stringify({keys:{Id:u},contextId:E.contextId}),headers:{"Content-Type":"application/json"}})).then(a=>a.json()).then(a=>{if(!a.success)throw e!=null&&e.ModalValidationResult&&a.validationEffect?Bt.openModal(e.ModalValidationResult,{rules:a.validationEffect.results}):J.add("error",a.message),new Error;return a}).then(a=>{a.message&&J.add("info",a.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(a.affectedEntities)}).then(()=>n.read()))()}}}class ye{static url(){return"/close-api/presentation"}static getStatuses(e,t){return fetch(`${ye.url()}/status/${e}/${t}`).then(r=>r.json())}}function wn(n){const e=o.reactive({title:"Loading",type:"wait"});function t(r){if(n.name&&Number.isInteger(r))return ye.getStatuses(n.name,r).then(i=>{e.type=i.type,e.title=i.name})}return n.on(T.Form.EVENT_READ,r=>{var u,l;const{code:i,name:s}={code:(u=r.Status)==null?void 0:u.Code,name:(l=r.Status)==null?void 0:l.Name};return n.name?!Number.isInteger(i)&&!s?void console.log("Undefined code or name is Status prop."):ye.getStatuses(n.name,i).then(a=>{e.type=a.type,e.title=s}):void console.log("Form without name.")}),{label:e,update:t}}function Cn(n,e){const t=Je.useRoute(),r=o.computed(()=>Number(t.params.id)),i=o.reactive({ready:!1,show:!1});return o.watch(()=>r.value,()=>{i.ready=!1}),o.watch(()=>r.value,()=>{Number.isInteger(r.value)&&n.read()},{immediate:!0}),n.read=Z.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return B.readById(n.name,r.value,{fields:e.fields})}).then(Z.valuesToUpperCase).then(s=>(Number.isInteger(s.Version)&&(n.version=s.Version),n.setValues(s),i.show=!0,s)).catch(s=>{throw Object.prototype.hasOwnProperty.call(s,"status")&&[403,404].includes(s.status)&&(i.show=!1),s}).finally(()=>{i.ready=!0})),n.save=Z.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return B.updateById(n.name,r.value,n.changes,{version:n.version})}).then(s=>{n.version=s.version})),n.on(T.Form.EVENT_SAVE,n.read.bind(n)),{formShadowState:i}}function En(){const n=o.reactive({contextId:E.contextId,person:E.person,organizations:E.organizations,ready:E.ready,user:E.user}),e=o.computed(()=>{if(!E.ready||!E.person)return null;const r=n.contextId;return E.person.id===r?E.person:E.organizations.find(i=>i.id===r)||null}),t=o.computed(()=>{var r;return n.contextId===((r=n.person)==null?void 0:r.id)});return E.onupdateContext(r=>{n.contextId=r}),E.onupdateData(()=>{n.person=E.person,n.organizations=E.organizations,n.user=E.user}),E.onReady(r=>{n.ready=r}),{state:o.readonly(n),currentContext:e,isPerson:t}}function _n(n,e){const t=o.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 O.EntityWithoutName("Use Form Request");return B.readById(n.name,i.id,{fields:i.fields})}).then(Z.valuesToUpperCase).then(s=>(s.hasOwnProperty("Version")&&(n.version=Number(s.Version)),n.setValues(s),t.show=!0,s)).catch(s=>{const u=Ze(s);throw J.add("error",u.message),u}).finally(()=>{t.ready=!0})},n.save=()=>{let i=e();return Promise.resolve().then(()=>{if(!n.name)throw O.EntityWithoutName("Use Form Request");return B.updateById(n.name,i.id,n.changes,{version:n.version})}).then(s=>{n.version=s.version||s.Version}).catch(s=>{const u=Ze(s);throw J.add("error",u.message),u})},n.on(T.Form.EVENT_SAVE,n.read.bind(n)),{shadowFormState:t,initShadow:r}}class bn{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(s=>s.json())}}class H{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${H.url()}/calculator/${e}`)}static calculate(e,t){return y(`/${H.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]):O.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(`/${H.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return y(`/${H.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class Sn{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)}}var mt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},D=(n,e,t)=>(mt(n,e,"read from private field"),t?t.call(n):e.get(n)),z=(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)},x=(n,e,t,r)=>(mt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),we,te,Ce,Ee,ne,re,De;const G="_______LIST_______ROW_______INDEX________NAME_______",_e=class M extends P{constructor(e){super(),this.LIST_ROW_KEY=1,z(this,we,void 0),this.array=[],z(this,te,[]),z(this,Ce,[]),z(this,Ee,new Proxy({},{set:(t,r,i,s)=>(t[r]=i,this.emit(M.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(M.EVENT_FILTERS_UPDATE,t),!0)})),z(this,ne,!1),z(this,re,(...t)=>Promise),z(this,De,()=>{}),x(this,we,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&x(this,te,e.config)}set config(e){x(this,te,e.map(T.utils.copyObject)),this.emitUpdateConfig()}get config(){return D(this,te)}emitUpdateConfig(){this.emit(M.EVENT_CONFIG_UPDATE,this.config)}get order(){return D(this,Ce)}set order(e){x(this,Ce,e),this.emit(M.EVENT_ORDER_UPDATE,this.order)}get filters(){return D(this,Ee)}set filters(e){kn(D(this,Ee),e)}set wait(e){x(this,ne,e),this.emit(T.Form.EVENT_WAIT,D(this,ne))}get wait(){return D(this,ne)}get primaryKeys(){return D(this,we)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[G]===e)}indexByKey(e){return this.array.findIndex(t=>t[G]===e)}static getKey(e){return e[G]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,G)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(M.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(M.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(M.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[G]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,G)}set read(e){x(this,re,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=D(this,re).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){x(this,re,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>D(this,De).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,[G]: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=M.getCellName(e),i=(()=>{let s=r?le(t,r):null;return s===void 0&&(s=null),e.value?e.value(s,t):s})();return{name:r,value:i}}};we=new WeakMap,te=new WeakMap,Ce=new WeakMap,Ee=new WeakMap,ne=new WeakMap,re=new WeakMap,De=new WeakMap,_e.EVENT_DATA="list-data: update",_e.EVENT_CONFIG_UPDATE="list-config:update",_e.EVENT_ORDER_UPDATE="list-order:update",_e.EVENT_FILTERS_UPDATE="list-filters:update";function Tn(n){const e=o.ref(""),t=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function kn(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Nn(n){const e=o.reactive([]);function t(l){return e.includes(l)}function r(l){t(l)||e.push(l)}function i(l){const a=e.findIndex(h=>h===l);a!==-1&&e.splice(a,1)}function s(l){const a=o.unref(n);if(l===void 0){e.length===0?a.forEach(r):a.forEach(i);return}t(l)?i(l):r(l)}const u=o.computed(()=>{const l=o.unref(n);return e.length===l.length&&l.length!==0});return[e,s,u,r,i]}function vn(n){return n.statusName==="Completed"}function An(n){return n.statusName==="FinalStepWithConfirmation"}function In(n){return n.statusName==="ValidationError"}function $n(n,e,t){let r=null;const i=o.reactive({wait:null});let s=[],u=null;const l=o.ref(null);function a(){l.value=s.find(w=>w.name===u)||null}function h(){var w;return u?((w=s.find(S=>S.name===u))==null?void 0:w.fields)||[]:[]}function c(w){if(a(),In(w))return void t.onValidation(w.validationResults);if((w.statusName==="FinalStep"||w.statusName==="NextStep")&&(!h().length||On(h(),t.presets)))return _(t.presets||{});vn(w)&&t.onCompleted(w),An(w)&&t.onConfirmation(w)}async function p(){try{await d(),await C()}catch(w){const{message:S}=Te(w);Ne.add("error",S)}}function d(){return i.wait="Loading process information.",me.getStartConfig(e,n).then(w=>{s=w.steps.map(S=>({label:S.title,name:S.stepName,number:S.number,fields:S.frontendEntity.objectTypes.reduce((v,A)=>(A.properties.forEach(R=>{v.push({name:R.name,label:R.title,type:R.refEntityName||R.dataType})}),v),[])}))}).then(w=>(i.wait=!1,w))}function g(w){return u=w.nextStepName,r=w.token,w}function m(w){const S=Te(w);Ne.add("error",S.message)}function C(){return i.wait="Starting process",me.startProcess(e,n).then(g).then(c).catch(m).finally(()=>{i.wait=null})}function _(w={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Expect the result",me.runStep(e,n,u,r,w).then(g).then(c).catch(m).finally(()=>{i.wait=!1}))}return{initialize:p,state:i,currentStepConfig:o.readonly(l),next:_}}function On(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!T.utils.getPropFromObject(e,r.name))return!1}return!0}const Fn="close-api/proxy/Equipment/Search";class Pn{static search(e,t,r,i,s){const u=new URLSearchParams;u.append("pattern",e||""),t&&u.append("categoryId",t),r&&u.append("useType",String(r)),i&&u.append("statusCode",i),s&&(u.append("limit",String(s.limit)),u.append("offset",String(s.offset)));const l=`/${Fn}?${u.toString()}`;return y(l,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Rn={class:"widget-table__head"},Ln={class:"widget-table__head-label margin_0 text_overflow"},Bn=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",Rn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.config,(r,i)=>(o.openBlock(),o.createElementBlock("th",{class:"widget-table__head-cell",key:i},[o.createElementVNode("p",Ln,o.toDisplayString(r.label),1)]))),128))]))}}),Vr="",V=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},Dn=V(Bn,[["__scopeId","data-v-25198f4a"]]);function Mn(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function yt(n,e){const t=Mn(n);let r=t?T.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function jn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Me={exports:{}},je,wt;function Vn(){if(wt)return je;wt=1;var n=1e3,e=n*60,t=e*60,r=t*24,i=r*7,s=r*365.25;je=function(c,p){p=p||{};var d=typeof c;if(d==="string"&&c.length>0)return u(c);if(d==="number"&&isFinite(c))return p.long?a(c):l(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))};function u(c){if(c=String(c),!(c.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(c);if(p){var d=parseFloat(p[1]),g=(p[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return d*s;case"weeks":case"week":case"w":return d*i;case"days":case"day":case"d":return d*r;case"hours":case"hour":case"hrs":case"hr":case"h":return d*t;case"minutes":case"minute":case"mins":case"min":case"m":return d*e;case"seconds":case"second":case"secs":case"sec":case"s":return d*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:return}}}}function l(c){var p=Math.abs(c);return p>=r?Math.round(c/r)+"d":p>=t?Math.round(c/t)+"h":p>=e?Math.round(c/e)+"m":p>=n?Math.round(c/n)+"s":c+"ms"}function a(c){var p=Math.abs(c);return p>=r?h(c,p,r,"day"):p>=t?h(c,p,t,"hour"):p>=e?h(c,p,e,"minute"):p>=n?h(c,p,n,"second"):c+" ms"}function h(c,p,d,g){var m=p>=d*1.5;return Math.round(c/d)+" "+g+(m?"s":"")}return je}function Un(n){t.debug=t,t.default=t,t.coerce=a,t.disable=s,t.enable=i,t.enabled=u,t.humanize=Vn(),t.destroy=h,Object.keys(n).forEach(c=>{t[c]=n[c]}),t.names=[],t.skips=[],t.formatters={};function e(c){let p=0;for(let d=0;d<c.length;d++)p=(p<<5)-p+c.charCodeAt(d),p|=0;return t.colors[Math.abs(p)%t.colors.length]}t.selectColor=e;function t(c){let p,d=null,g,m;function C(..._){if(!C.enabled)return;const w=C,S=Number(new Date),v=S-(p||S);w.diff=v,w.prev=p,w.curr=S,p=S,_[0]=t.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");let A=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(U,k)=>{if(U==="%%")return"%";A++;const oe=t.formatters[k];if(typeof oe=="function"){const ve=_[A];U=oe.call(w,ve),_.splice(A,1),A--}return U}),t.formatArgs.call(w,_),(w.log||t.log).apply(w,_)}return C.namespace=c,C.useColors=t.useColors(),C.color=t.selectColor(c),C.extend=r,C.destroy=t.destroy,Object.defineProperty(C,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(g!==t.namespaces&&(g=t.namespaces,m=t.enabled(c)),m),set:_=>{d=_}}),typeof t.init=="function"&&t.init(C),C}function r(c,p){const d=t(this.namespace+(typeof p>"u"?":":p)+c);return d.log=this.log,d}function i(c){t.save(c),t.namespaces=c,t.names=[],t.skips=[];let p;const d=(typeof c=="string"?c:"").split(/[\s,]+/),g=d.length;for(p=0;p<g;p++)d[p]&&(c=d[p].replace(/\*/g,".*?"),c[0]==="-"?t.skips.push(new RegExp("^"+c.slice(1)+"$")):t.names.push(new RegExp("^"+c+"$")))}function s(){const c=[...t.names.map(l),...t.skips.map(l).map(p=>"-"+p)].join(",");return t.enable(""),c}function u(c){if(c[c.length-1]==="*")return!0;let p,d;for(p=0,d=t.skips.length;p<d;p++)if(t.skips[p].test(c))return!1;for(p=0,d=t.names.length;p<d;p++)if(t.names[p].test(c))return!0;return!1}function l(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function a(c){return c instanceof Error?c.stack||c.message:c}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 Wn=Un;(function(n,e){e.formatArgs=r,e.save=i,e.load=s,e.useColors=t,e.storage=u(),e.destroy=(()=>{let a=!1;return()=>{a||(a=!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(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const h="color: "+this.color;a.splice(1,0,h,"color: inherit");let c=0,p=0;a[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(c++,d==="%c"&&(p=c))}),a.splice(p,0,h)}e.log=console.debug||console.log||(()=>{});function i(a){try{a?e.storage.setItem("debug",a):e.storage.removeItem("debug")}catch{}}function s(){let a;try{a=e.storage.getItem("debug")}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=process.env.DEBUG),a}function u(){try{return localStorage}catch{}}n.exports=Wn(e);const{formatters:l}=n.exports;l.j=function(a){try{return JSON.stringify(a)}catch(h){return"[UnexpectedJSONParseError]: "+h.message}}})(Me,Me.exports);var qn=Me.exports;const Ct=jn(qn);function Et(n){return["eservices-core",n].join(":")}function _t(n){return Ve(n,"YYYY/MM/DD HH:mm:ss")}function Ve(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return Dt.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const Ur="",be=V({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()=>o.h("i",{class:`icon icon-${t}`})}},[["__scopeId","data-v-e287c8d9"]]),zn=Ct(Et("setup-list-row"));function xn(n,e){const t=n.config.map(r=>Gn(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function Gn(n,e,t){const r=e.values;let i=yt(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(c){s.onClick.push(()=>c(r))}function l(c){Array.isArray(c)?s.class.push(...c):s.class.push(c)}const a=[],h=[];if(n.hide&&n.hide(r))return[o.h("td")];if(n.type)switch(l(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Ve(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=_t(typeof i=="string"?i:null);break}case"money":{i=vt(i);break}case"multi-select":{h.push(o.h(T.FormField,{type:"single-checkbox",modelValue:e.selected})),u(bt.bind(null,t,!0));break}case"select":{h.push(o.h(T.FormField,{type:"single-radio",modelValue:e.selected})),u(bt.bind(null,t,!1));break}}if(n.onClick&&u(n.onClick),n.link)try{const c=n.link(r);if(c){const p=o.h(Je.RouterLink,{to:c});h.push(p),l("widget-table-cell_link")}}catch(c){zn("Can't add router link",c)}return n.href&&(h.push(o.h("a",{href:n.href(r),target:"_blank"})),l("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&h.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&h.push(o.h(be,{name:n.icon})),n.class&&(typeof n.class=="function"?l(n.class(r)):l(n.class)),a.push(o.h("td",s,h)),a}function bt(n,e){n.emit("select",e)}function St(n,e){return()=>{try{return xn(n,e)}catch(t){return console.warn(t),null}}}const Jn={props:{values:Object,config:Object,selected:Boolean},setup:St},Kn=["colspan"],Tt=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=o.ref();return o.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=s=>e("close")),onSave:i[1]||(i[1]=s=>e("save",s))}),null,16,["values","new"]))],8,Kn)],512))}}),Ue={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go."},Hn={class:"widget-table"},kt="update:selectedRows",Yn=o.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=o.useSlots(),i=o.computed(()=>{var l;return(l=r==null?void 0:r.default)==null?void 0:l.call(r)[0]});function s(l,a=!0){if(!t.selectedRows)return;if(!a)return e(kt,t.selectedRows.includes(l)?[]:[l]);const h=[...t.selectedRows],c=h.indexOf(l);return c===-1?h.push(l):h.splice(c,1),e(kt,h)}function u(l){e("save",l),e("update:activeRow",null)}return(l,a)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",Hn,[o.createVNode(Dn,{config:l.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.array,(h,c)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:c},[o.createVNode(Jn,{config:l.config,values:h,selected:l.selectedRows.includes(h),onSelect:p=>s(h,p),class:o.normalizeClass(l.classCallback?l.classCallback(h):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&l.activeRow===h?(o.openBlock(),o.createBlock(Tt,{key:0,component:i.value,"row-length":l.config.length,values:h,onClose:a[0]||(a[0]=p=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),l.activeRow===o.unref(Ue).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(Tt,{key:0,component:i.value,"row-length":l.config.length,onClose:a[1]||(a[1]=h=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),Xn=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}}),qr="",Se=V(Xn,[["__scopeId","data-v-0ef9ae88"]]),Zn={class:"widget-button"},Qn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",Zn,[e.wait?(o.openBlock(),o.createBlock(Se,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),zr="",er=V(Qn,[["__scopeId","data-v-450dc564"]]),tr={class:"widget-multi-button-wrap position_relative cursor_pointer"},nr={class:"widget-multi-button-body grid"},rr=["onClick"],ir={class:"widget-multi-button-side-wrap"},or=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(u=>({"7025434e":r.value}));const t=o.reactive({active:!1,wait:!1}),r=o.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 s(u=!t.active){t.active=u}return(u,l)=>(o.openBlock(),o.createElementBlock("div",tr,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",nr,[u.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:l[0]||(l[0]=a=>s())},o.toDisplayString(u.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(a,h)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:h,onClick:c=>{i(a.callback),s(!1)}},o.toDisplayString(a.label),9,rr))),128))]),o.createElementVNode("div",ir,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:l[1]||(l[1]=a=>s())},[t.wait?(o.openBlock(),o.createBlock(o.unref(Se),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(be),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),xr="",sr=V(or,[["__scopeId","data-v-a8d711d1"]]),ar={class:"widget-loader flex flex-align_center gap_10 padding_15"},cr={class:"text_md"},lr=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",ar,[o.createVNode(Se,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",cr,o.toDisplayString(e.label),1)]))}}),dr=["alt","src"],ur=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=o.ref();return o.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,dr))}}),fr={props:{config:Array,values:Object,selected:Boolean},setup:St},Gr="",pr=V(fr,[["__scopeId","data-v-344a8cc1"]]),hr=n=>(o.pushScopeId("data-v-4e1d87c8"),n=n(),o.popScopeId(),n),gr={class:"head-cell"},mr=hr(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),yr=o.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)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",gr,[o.createElementVNode("div",{class:"head-cell-content flex_grow",style:o.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(o.openBlock(),o.createBlock(o.unref(T.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(s=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.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]=s=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(be),{key:0,class:o.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:o.withCtx(()=>[o.createTextVNode("core-arrow-up")]),_:1},8,["class"])):o.createCommentVNode("",!0),mr])]))}}),Jr="",wr=V(yr,[["__scopeId","data-v-4e1d87c8"]]),Cr=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=o.ref(),i=o.ref();o.onMounted(()=>{function a(g,m){let C=-1;do C++,m-=g[C];while(m>0&&C<g.length);return C}function h(g,m){let C=0;for(;m>0&&m>g[C]&&C<g.length;)m-=g[C],C++;return console.log(m,C),C>0?C:0}function c(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 d(g){return g===null?!1:g.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(m){var Pt;function C(I){return I.screenX+S-R}const _=r.value,w=[..._.children].filter(I=>I.localName==="th"),S=((Pt=_.offsetParent)==null?void 0:Pt.scrollLeft)||0,v=w.map(I=>I.clientWidth),A=d(m.target),R=_.getBoundingClientRect().left,U=C(m),k=a(v,U),oe=v.slice(0,k).reduce((I,L)=>I+L,0),ve=U-oe,xe=_.offsetWidth,se=w[k].clientWidth;if(t.config[k].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",m.screenX),console.log("Widths",v),console.log("max width",xe),console.log("Start Position",U),console.log("Position From",k),console.log("Start Position",k),console.log("Global offset (Отступ самой таблицы от края экрана)",R),console.log("Del",ve),console.groupEnd(),i.value.innerText=w[k].textContent||"",i.value.style.display="grid",i.value.style.width=se+"px",i.value.style.cursor="grabbing",c(oe),p(se),document.addEventListener("pointermove",Ft,{passive:!0}),document.addEventListener("pointerup",Ot);function Ot(I){if(console.group("END"),document.removeEventListener("pointermove",Ft),document.removeEventListener("pointerup",Ot),A&&(t.config[k].width=i.value.style.width,t.config[k].minWidth=i.value.style.width,t.config[k].maxWidth=i.value.style.width,s(t.config)),!A){const L=I.screenX+S-R;console.log("ENP Position",L);const Ae=h(v,L);if(console.log(k,"->",Ae),Ae!==k){const ae=t.config[k],Ge=t.config;Ge.splice(k,1),Ge.splice(Ae,0,ae),s(Ge)}else{const ae=t.config[k].name;u(ae)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Ft(I){if(A){const ae=C(I)-U+se;p(ae);return}let L=I.screenX+S-R-ve;L<0&&(L=0),L+se>xe&&(L=xe-se),c(L)}})});function s(a){e("update:config",a)}function u(a){if(!a)return;if(Array.isArray(a)){if(a.length<1)return;a=a[0]}if(t.order.length===0||t.order[0]!==a)return void l([a]);const h=t.order.length===1||t.order[1]==="asc"?"asc":"desc";l([a,h==="asc"?"desc":"asc"])}function l(a){e("update:order",a)}return(a,h)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.config,(c,p)=>(o.openBlock(),o.createBlock(wr,o.mergeProps({key:c},c,{onOrder:d=>u(c.name),onSelect:h[0]||(h[0]=d=>e("select")),order:a.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),Kr="",Er=V(Cr,[["__scopeId","data-v-ccffc6bd"]]),_r={class:"widget-list"},br={class:"widget-list-body position_relative"},Sr=50,Tr=o.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(l,a=!0){if(t.selectedRows)if(!a)s(t.selectedRows.includes(l)?[]:[l]);else{const h=[...t.selectedRows],c=h.indexOf(l);c===-1?h.push(l):h==null||h.splice(c,1),s(h)}}function i(){var l;if(((l=t.selectedRows)==null?void 0:l.length)!==t.array.length)return s([...t.array]);s([])}function s(l){e("update:selectedRows",l)}function u(l){if(!l)return;const a=l.target;a.scrollTop+a.clientHeight+Sr>a.scrollHeight&&e("scrollEnd")}return(l,a)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[o.createElementVNode("table",_r,[o.createElementVNode("thead",null,[o.createVNode(Er,{onSelect:a[0]||(a[0]=h=>i()),"onUpdate:order":a[1]||(a[1]=h=>e("update:order",h)),"onUpdate:config":a[2]||(a[2]=h=>e("update:config",h)),config:l.config,order:l.order},null,8,["config","order"])]),o.createElementVNode("tbody",br,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.array,(h,c)=>{var p;return o.openBlock(),o.createBlock(pr,{key:c,class:"widget-list-row",values:h,config:l.config,selected:(p=l.selectedRows)==null?void 0:p.includes(h),onSelect:d=>r(h,d)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function kr(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=o.reactive({wait:!1,call:e});return t}function Te(n){return typeof n=="string"?We(n):Nr(n)?We(n.message):We(Ue.DEFAULT_ERROR_MESSAGE)}function Nr(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function We(n){return{message:n}}function ke(n="error"){return function(e){const{message:t}=Te(e);Ne.add(n,t)}}function qe(n,e){return ze().emit("entity:read",{...e,entity:n})}function Nt(n,e){return ze().emit("entity:update",{...e,entity:n})}function vr(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function vt(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 At(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=At(r)),e[i]=r,e},{})}function Ar(n,e){const t=new Map;return n.forEach(r=>{var s;const i=e(r);t.has(i)||t.set(i,[]),(s=t.get(i))==null||s.push(r)}),t}function Ir(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const Y=Ct(Et("use-socket"));function ze(){return $r}const $r=function(){let n=1,e;const t=new Set,r=new Set;function i(){return{safeQueue:r,requestId:n,handlers:t}}function s(d){const g=[...t.values()];Y("Handlers array length is %d. Response event: %s. Request id: %d",t.size,d.event,d.requestId),g.forEach(m=>{const C=d.requestId;(m.requestId&&m.requestId===C||!m.requestId&&m.event===d.event)&&(Y("Find appropriated handler: %d, event: %s",n,m.event),m.callback(d.data,d),m.once&&(t.delete(m),Y("Handler was removed by *once* params was passed. %o",m)))})}function u(d){console.log(`%cInitializing sockets: %c${d}`,"color: purple","color: black"),e=new WebSocket(d),e.onclose=function(g){Y("Connection to server was stopped: %d %s",g.code,g.reason),setTimeout(()=>u(d))},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...r.values()].forEach(g=>{l(g),r.delete(g)})},e.onerror=function(g){console.warn(g)},e.onmessage=g=>{try{const m=JSON.parse(g.data);if(!It(m)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(m);return}s(m)}catch(m){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(m)}}}function l(d){e.send(d)}function a(d,g){t.add({event:d,callback:g})}function h(d,g){t.add({event:d,callback:g,once:!0})}function c(){return e&&(e==null?void 0:e.readyState)===1}function p(d,g,m){const C=++n,_=JSON.stringify({requestId:C,event:d,data:g,contextId:E.contextId,url:window.location.href});return c()?l(_):(r.add(_),Y("Socket is not connected. Message was send to save-queue. %s")),new Promise((w,S)=>{t.add({event:d,requestId:C,once:!0,callback:(v,A)=>{if(Y("Promise was resolve with next data:",v),Or(A))return void S(v);m&&m(v,A),w(v)}})})}return{get socket(){return e},on:a,once:h,emit:p,initialization:u,getDevInfo:i}}(),Or=n=>!!It(n)&&n.event==="request-error",It=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 Fr(n,e){const t=o.reactive([]);let r=0;const i=o.ref(!1);function s(){if(i.value)return Promise.reject("The process has already started.");const d=c();return i.value=!0,typeof d.limit!="number"&&(d.limit=100),d.offset=r,qe(n,d).then(g=>(r+=g.length,g)).finally(()=>{i.value=!1})}function u(d,g){var C;const m=d.Version||((C=t.find(_=>_.Id===g))==null?void 0:C.Version);if(m===void 0)throw new Error("Object without version.");return m}function l(d,g){const m=t.findIndex(C=>C.Id===d);if(m===-1)throw new Error(`Can't found item with Id ${d}`);t.splice(m,1,g)}async function a(d,g){try{const m=c(),C=u(g,d);delete g.Version,await Nt(n,{id:d,values:g,version:C});const _=await qe(n,{fields:m.fields||"",id:d});l(d,_)}catch(m){ke()(m)}}async function h(){try{const d=await s();t.push(...d)}catch(d){ke()(d)}}function c(){return typeof e=="function"?e():e}async function p(){try{r=0;const d=await s();t.splice(0,t.length,...d)}catch(d){ke()(d)}}return{array:t,updateById:a,next:h,reload:p,wait:i}}const Ne=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=Pr(r),s=new Rr(e,t,i.timeout,i.children,i.click);return this.store.push(s),r.timeout&&setTimeout(this.remove.bind(this,s.id),r.timeout*1e3),s}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function Pr(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 $t=class Lt{constructor(e,t,r,i,s){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=s,this.id=Lt.cardId++}};$t.cardId=1;let Rr=$t;function Lr(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function F(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(Lr(r)){let i=function(s){var u;return((u=s.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(F.is(t,r)),e)},[]).join(" and ")}function ie(n){return typeof n=="string"?`'${n}'`:`${n}`}F.includes=function(e,t){return`@${e} Contains ${ie(t)}`},F.beginWith=function(e,t){return`@${e} BeginWith ${ie(t)}`},F.notEq=function(e,t){return`@${e} nq ${ie(t)}`},F.eq=function(e,t){return Array.isArray(t)?F.in(e,t):`@${e} eq ${ie(t)}`},F.in=function(e,t){const r=t.map(ie).join(", ");return`@${e} in (${r})`},F.and=function(...e){return e.join(" and ")},F.is=function(e,t){return`@${e} is ${t}`},F.or=function(...e){return e.join(" or ")};const Br={clickOutside:de,staticLink:pn,Request:y},Dr={usage:Vt,utils:Jt,config:Kt,types:Ht};f.ApplicationManager=st,f.Communication=un,f.ComputedMetadata=Qt,f.CoreError=O,f.Filter=F,f.Manager=E,f.MetadataStore=Q,f.NotificationSystem=Ne,f.Request=y,f.WidgetButton=er,f.WidgetIcon=be,f.WidgetImage=ur,f.WidgetList=Tr,f.WidgetLoader=lr,f.WidgetMultiButton=sr,f.WidgetSpinner=Se,f.WidgetTable=Yn,f.actionService=gt,f.asyncProcess=kr,f.authService=N,f.billingService=H,f.catchUniversal=ke,f.clickOutside=de,f.clientService=Qe,f.communicationService=ee,f.configurationService=Sn,f.constants=Ue,f.dataService=B,f.debounce=hn,f.default=Dr,f.documentsService=bn,f.equipmentService=Pn,f.fileService=cn,f.getCellValue=yt,f.getNamesFromListConfig=vr,f.groupArrayByField=Ar,f.historyService=Xt,f.internationalizationService=tn,f.invitationService=ln,f.metadataService=Re,f.openService=dn,f.parseError=Te,f.prettifyValueByMetadata=en,f.prettyDate=Ve,f.prettyDateWithTime=_t,f.prettyMoney=vt,f.processWizardService=me,f.ruleValidationService=Le,f.t=K,f.testTypes=Yt,f.universalEntityRead=qe,f.universalEntityUpdate=Nt,f.useCommunication=fn,f.useCustomerState=En,f.useFormAction=yn,f.useFormLabel=wn,f.useFormMetadata=gn,f.useFormRequest=_n,f.useFormRequestData=Cn,f.useListActiveRow=Ir,f.useListEntity=Fr,f.useListSearch=Tn,f.useListSelect=Nn,f.useLogger=ut,f.useManagerState=qt,f.useSocket=ze,f.useWizard=$n,f.utils=Br,f.valuesToUpperCase=At,f.viewService=an,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
10
+ */const tt=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},nt=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},rt=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},it=function(){this.events={}};class P{constructor(){this.events={}}on(e,t){return tt.call(this,e,t)}emit(e,t){return nt.call(this,e,t)}off(e,t){return rt.call(this,e,t)}cleanEvents(){it.call(this)}static on(e,t){return tt.call(P,e,t)}static emit(e,t){return nt.call(P,e,t)}static off(e,t){return rt.call(P,e,t)}static cleanEvents(){it.call(P)}}P.events={};var ot=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},ue=(n,e,t)=>(ot(n,e,"read from private field"),t?t.call(n):e.get(n)),Oe=(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)},Fe=(n,e,t,r)=>(ot(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),X,fe,pe;const W=class $ extends P{constructor(){super(...arguments),Oe(this,X,void 0),Oe(this,fe,"front"),this.organizations=[],Oe(this,pe,!1)}set language(e){localStorage.setItem($.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem($.LOCALSTORAGE_LANGUAGE_KEY)||$.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem($.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){Fe(this,X,e)}get router(){if(!ue(this,X))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return ue(this,X)}set type(e){Fe(this,fe,e)}get type(){return ue(this,fe)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Fe(this,pe,e),this.emit($.EVENT_READY_UPDATE,e)}get ready(){return ue(this,pe)}onReady(e){return this.on($.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on($.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on($.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($.CURRENT_CONTEXT_KEY,String(e)),this.emit($.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($.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{J.add("error",O.ApiNotAvailable().message)}}loadCustomerData(){return Qe.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))}};X=new WeakMap,fe=new WeakMap,pe=new WeakMap,W.DEFAULT_LANGUAGE="en",W.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",W.EVENT_CONTEXT_UPDATE="event:context-update",W.EVENT_READY_UPDATE="event:ready-update",W.EVENT_DATA_UPDATE="event:data-update",W.CURRENT_CONTEXT_KEY="CurrentContext";let st=W;const E=new st;function qt(){const n=o.reactive({contextType:E.contextType,contextId:E.contextId,context:E.context});return E.onupdateContext(()=>{n.contextType=E.contextType,n.contextId=E.contextId,n.context=E.context}),n}function zt(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Xe}})}function y(n,e={}){return E.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=E.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw O.ApiNotAvailable()}).then(t=>zt(t).then(r=>{if(!t.ok)throw r;return r}))}class he{constructor(){}static parseNamesFromListConfig(e){let t=he.parseFieldsToGraphQL(e.reduce((i,s)=>(s.name&&i.push(s.name),i),[]));function r(i){let s="";for(let u in i)typeof i[u]=="boolean"?s+=` ${u} `:s+=` ${u} { ${r(i[u])} }`;return s}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 s=i.indexOf("."),u=i.substring(s+1),l=i.substring(0,s);l in r||(r[l]={}),t(r[l],u)}else r[i]=!0;return r}return e.reduce(t,{})}}class Gt{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 at=new Gt;function ct(n){return n&&n[0].toLowerCase()+n.slice(1)}function Pe(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=Pe(r)),e[i]=r,e},{})}function xt(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 Z={Request:y,clickOutside:de,getPropFromObject:le,runPromiseQueue:He,GraphQL:he,firstChapterToLowerCase:ct,valuesToUpperCase:Pe,prettyMoney:xt},Jt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:he,Journal:at,Request:y,clickOutside:de,default:Z,firstChapterToLowerCase:ct,getPropFromObject:le,runPromiseQueue:He,valuesToUpperCase:Pe},Symbol.toStringTag,{value:"Module"}));function lt(n,e=""){for(let t in n){if(typeof n[t]=="object"){lt(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 j={};function Kt(n){for(let e in n)j[e]=n[e];n.styles&&lt(n.styles),at.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=j}const Ht=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Vr="",Yt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Xt{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(s=>{if(!s.changes)return s;const u=s.changes.map(l=>({...l,oldValue:l.originalValue,name:l.fieldName}));return{...s,changes:u}});return{...r,history:i}})}}class Zt extends P{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 Re.get(e)}}const Q=new Zt;function Qt(n){const e=o.ref(Q.get(n));return Q.on(Q.EVENT_NEW,t=>{n===t.entityName&&(e.value=Q.get(n))}),e}function en(n,e){try{return e.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(t){ut().error("prettify value by metadata",n,t)}}class tn{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return y(`/open-api/internationalization/language/${e}`)}}let q={};function K(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=T.utils.getPropFromObject((this==null?void 0:this.vocabulary)||q,n);if(typeof t=="string")return dt(t,e);const r=T.utils.getPropFromObject(q==null?void 0:q.root,n);return typeof r=="string"?dt(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function dt(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}K.setGlobalVocabulary=function(n){q=n},K.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),K.bind({vocabulary:T.utils.getPropFromObject(q,e.toLowerCase())})},K.setVocabulary=function(n){return typeof n=="string"&&(n=T.utils.getPropFromObject(q,n)),K.bind({vocabulary:n})};const nn=function(){let n=!1;const e=[];function t(){return n}function r(a,h){t()&&console[a](...h),e.push(h)}function i(...a){r("log",a)}function s(...a){r("warn",a)}function u(...a){r("error",a)}function l(a=!0){n=a}return{info:i,warn:s,history:e,display:l,error:u}}();function ut(){return nn}class N{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw O.AuthServiceError(e.title,t)}static login(e){return y(j.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:j.applicationName})}).catch(N.parseError)}static registration(e){return e.AppName=j.applicationName,y(j.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(N.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw O.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return N.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return N.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return N.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return N.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return y(`${j.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(N.parseError)}static startLoginProcess(e){return N.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return N.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return N.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return y(`${j.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(N.parseError).then(N.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw O.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}function rn(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const on="masterId",sn="masterEntity";function ge(n,e){if(!Array.isArray(e))return;if(rn(e))return t(e);e.forEach(t);function t(r){n.append(sn,r[0]),n.append(on,r[1].toString())}}class B{static async anonymousGetList(e){return await y(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,s)=>r.append(i,s),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(([l,a="desc"])=>`@${l} ${a}`).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=B.getSearchParamsForEntityListRead(t||{});return await y(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=B.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 ge(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 s=r.fields;typeof s=="string"&&(s=[s]),i.append("fields",s.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 s=new URLSearchParams;return ge(s,i==null?void 0:i.masterEntities),y(`/close-api/data/entities/${e}/id/${t}?${s.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 B.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})})}}const ft=class ce{static async create(e){return y(ce.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(ce.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return y(`${ce.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return y(`${ce.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};ft.url="/close-api/communications";let ee=ft;class an{static async getDefaultView(e){return y("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function pt(n){return{...n,createdEntities:n.createdEntites}}const ht=class Ie{static async getStartConfig(e,t){return y([Ie.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return y([Ie.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(pt)}static async runStep(e,t,r,i,s){return y([Ie.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(pt)}};ht.url="/close-api/views/process-wizard";let me=ht;class Re{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(s=>s.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return ge(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 cn{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(s=>s.json()).then(s=>(s.filename=e.name,s))}}class ln{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 Le{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return y(Le.url+e,{method:"POST",body:JSON.stringify(t)})}}class dn{static getConfiguration(){return y("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class gt{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 ge(i,r),y([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}class un extends P{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return ee.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return ee.read(e).then(t=>t.length===0?ee.create(e):t[0])}}function fn(n){const e=T.Form.getParentForm();e?e.subscribe(n):console.warn(O.ParentFormNotFound());const t=o.reactive([]);return n.read=()=>ee.readMessages(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function pn(n,e="images"){return`/static-folder/${e}/${n}`}function hn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function gn(n,e){const t=o.ref(null);function r(){return n.name?Re.getById(n.name,e,[]).then(i=>{t.value=i,i.fields.forEach(s=>{s.canSet?n.enable(s.name):n.disable(s.name)})}).catch(()=>{t.value=null;const i=O.MetadataEntityIsNotAvailable(n.name||"FORM_WITHOUT_NAME");J.add("error",i.message)}):Promise.reject()}return n.on(T.Form.EVENT_READ,r),{metadata:t,update:r}}class Be extends Error{static UndefinedStatus(){return new Be("Status is undefined.")}}class mn extends Be{}function yn(n,e){const t=o.reactive([]);async function r(s,u){if(!s)throw mn.UndefinedStatus();const l=await gt.get({criterion:s});t.splice(0,t.length),t.push(...l.map(a=>i(a,u)))}return{actions:t,update:r};function i(s,u){return{title:s.title,callback:()=>(()=>Promise.resolve().then(()=>{if(n.changed)return n.save()}).then(()=>fetch(s.url,{method:"POST",body:JSON.stringify({keys:{Id:u},contextId:E.contextId}),headers:{"Content-Type":"application/json"}})).then(a=>a.json()).then(a=>{if(!a.success)throw e!=null&&e.ModalValidationResult&&a.validationEffect?Bt.openModal(e.ModalValidationResult,{rules:a.validationEffect.results}):J.add("error",a.message),new Error;return a}).then(a=>{a.message&&J.add("info",a.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(a.affectedEntities)}).then(()=>n.read()))()}}}class ye{static url(){return"/close-api/presentation"}static getStatuses(e,t){return fetch(`${ye.url()}/status/${e}/${t}`).then(r=>r.json())}}function wn(n){const e=o.reactive({title:"Loading",type:"wait"});function t(r){if(n.name&&Number.isInteger(r))return ye.getStatuses(n.name,r).then(i=>{e.type=i.type,e.title=i.name})}return n.on(T.Form.EVENT_READ,r=>{var u,l;const{code:i,name:s}={code:(u=r.Status)==null?void 0:u.Code,name:(l=r.Status)==null?void 0:l.Name};return n.name?!Number.isInteger(i)&&!s?void console.log("Undefined code or name is Status prop."):ye.getStatuses(n.name,i).then(a=>{e.type=a.type,e.title=s}):void console.log("Form without name.")}),{label:e,update:t}}function Cn(n,e){const t=Je.useRoute(),r=o.computed(()=>Number(t.params.id)),i=o.reactive({ready:!1,show:!1});return o.watch(()=>r.value,()=>{i.ready=!1}),o.watch(()=>r.value,()=>{Number.isInteger(r.value)&&n.read()},{immediate:!0}),n.read=Z.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return B.readById(n.name,r.value,{fields:e.fields})}).then(Z.valuesToUpperCase).then(s=>(Number.isInteger(s.Version)&&(n.version=s.Version),n.setValues(s),i.show=!0,s)).catch(s=>{throw Object.prototype.hasOwnProperty.call(s,"status")&&[403,404].includes(s.status)&&(i.show=!1),s}).finally(()=>{i.ready=!0})),n.save=Z.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!n.name)throw new Error("Form without entity name. Please set form.name");return B.updateById(n.name,r.value,n.changes,{version:n.version})}).then(s=>{n.version=s.version})),n.on(T.Form.EVENT_SAVE,n.read.bind(n)),{formShadowState:i}}function En(){const n=o.reactive({contextId:E.contextId,person:E.person,organizations:E.organizations,ready:E.ready,user:E.user}),e=o.computed(()=>{if(!E.ready||!E.person)return null;const r=n.contextId;return E.person.id===r?E.person:E.organizations.find(i=>i.id===r)||null}),t=o.computed(()=>{var r;return n.contextId===((r=n.person)==null?void 0:r.id)});return E.onupdateContext(r=>{n.contextId=r}),E.onupdateData(()=>{n.person=E.person,n.organizations=E.organizations,n.user=E.user}),E.onReady(r=>{n.ready=r}),{state:o.readonly(n),currentContext:e,isPerson:t}}function _n(n,e){const t=o.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 O.EntityWithoutName("Use Form Request");return B.readById(n.name,i.id,{fields:i.fields})}).then(Z.valuesToUpperCase).then(s=>(s.hasOwnProperty("Version")&&(n.version=Number(s.Version)),n.setValues(s),t.show=!0,s)).catch(s=>{const u=Ze(s);throw J.add("error",u.message),u}).finally(()=>{t.ready=!0})},n.save=()=>{let i=e();return Promise.resolve().then(()=>{if(!n.name)throw O.EntityWithoutName("Use Form Request");return B.updateById(n.name,i.id,n.changes,{version:n.version})}).then(s=>{n.version=s.version||s.Version}).catch(s=>{const u=Ze(s);throw J.add("error",u.message),u})},n.on(T.Form.EVENT_SAVE,n.read.bind(n)),{shadowFormState:t,initShadow:r}}class bn{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(s=>s.json())}}class H{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${H.url()}/calculator/${e}`)}static calculate(e,t){return y(`/${H.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]):O.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(`/${H.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return y(`/${H.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class Sn{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)}}var mt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},D=(n,e,t)=>(mt(n,e,"read from private field"),t?t.call(n):e.get(n)),z=(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)},G=(n,e,t,r)=>(mt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),we,te,Ce,Ee,ne,re,De;const x="_______LIST_______ROW_______INDEX________NAME_______",_e=class M extends P{constructor(e){super(),this.LIST_ROW_KEY=1,z(this,we,void 0),this.array=[],z(this,te,[]),z(this,Ce,[]),z(this,Ee,new Proxy({},{set:(t,r,i,s)=>(t[r]=i,this.emit(M.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(M.EVENT_FILTERS_UPDATE,t),!0)})),z(this,ne,!1),z(this,re,(...t)=>Promise),z(this,De,()=>{}),G(this,we,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&G(this,te,e.config)}set config(e){G(this,te,e.map(T.utils.copyObject)),this.emitUpdateConfig()}get config(){return D(this,te)}emitUpdateConfig(){this.emit(M.EVENT_CONFIG_UPDATE,this.config)}get order(){return D(this,Ce)}set order(e){G(this,Ce,e),this.emit(M.EVENT_ORDER_UPDATE,this.order)}get filters(){return D(this,Ee)}set filters(e){kn(D(this,Ee),e)}set wait(e){G(this,ne,e),this.emit(T.Form.EVENT_WAIT,D(this,ne))}get wait(){return D(this,ne)}get primaryKeys(){return D(this,we)}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(M.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(M.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(M.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){G(this,re,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=D(this,re).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){G(this,re,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>D(this,De).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=M.getCellName(e),i=(()=>{let s=r?le(t,r):null;return s===void 0&&(s=null),e.value?e.value(s,t):s})();return{name:r,value:i}}};we=new WeakMap,te=new WeakMap,Ce=new WeakMap,Ee=new WeakMap,ne=new WeakMap,re=new WeakMap,De=new WeakMap,_e.EVENT_DATA="list-data: update",_e.EVENT_CONFIG_UPDATE="list-config:update",_e.EVENT_ORDER_UPDATE="list-order:update",_e.EVENT_FILTERS_UPDATE="list-filters:update";function Tn(n){const e=o.ref(""),t=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function kn(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Nn(n){const e=o.reactive([]);function t(l){return e.includes(l)}function r(l){t(l)||e.push(l)}function i(l){const a=e.findIndex(h=>h===l);a!==-1&&e.splice(a,1)}function s(l){const a=o.unref(n);if(l===void 0){e.length===0?a.forEach(r):a.forEach(i);return}t(l)?i(l):r(l)}const u=o.computed(()=>{const l=o.unref(n);return e.length===l.length&&l.length!==0});return[e,s,u,r,i]}function vn(n){return n.statusName==="Completed"}function An(n){return n.statusName==="FinalStepWithConfirmation"}function In(n){return n.statusName==="ValidationError"}function $n(n,e,t){let r=null;const i=o.reactive({wait:null});let s=[],u=null;const l=o.ref(null);function a(){l.value=s.find(w=>w.name===u)||null}function h(){var w;return u?((w=s.find(S=>S.name===u))==null?void 0:w.fields)||[]:[]}function c(w){if(a(),In(w))return void t.onValidation(w.validationResults);if((w.statusName==="FinalStep"||w.statusName==="NextStep")&&(!h().length||On(h(),t.presets)))return _(t.presets||{});vn(w)&&t.onCompleted(w),An(w)&&t.onConfirmation(w)}async function p(){try{await d(),await C()}catch(w){const{message:S}=Te(w);Ne.add("error",S)}}function d(){return i.wait="Loading process information.",me.getStartConfig(e,n).then(w=>{s=w.steps.map(S=>({label:S.title,name:S.stepName,number:S.number,fields:S.frontendEntity.objectTypes.reduce((v,A)=>(A.properties.forEach(R=>{v.push({name:R.name,label:R.title,type:R.refEntityName||R.dataType})}),v),[])}))}).then(w=>(i.wait=!1,w))}function g(w){return u=w.nextStepName,r=w.token,w}function m(w){const S=Te(w);Ne.add("error",S.message)}function C(){return i.wait="Starting process",me.startProcess(e,n).then(g).then(c).catch(m).finally(()=>{i.wait=null})}function _(w={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Expect the result",me.runStep(e,n,u,r,w).then(g).then(c).catch(m).finally(()=>{i.wait=!1}))}return{initialize:p,state:i,currentStepConfig:o.readonly(l),next:_}}function On(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!T.utils.getPropFromObject(e,r.name))return!1}return!0}const Fn="close-api/proxy/Equipment/Search";class Pn{static search(e,t,r,i,s){const u=new URLSearchParams;u.append("pattern",e||""),t&&u.append("categoryId",t),r&&u.append("useType",String(r)),i&&u.append("statusCode",i),s&&(u.append("limit",String(s.limit)),u.append("offset",String(s.offset)));const l=`/${Fn}?${u.toString()}`;return y(l,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Rn={class:"widget-table__head"},Ln={class:"widget-table__head-label margin_0 text_overflow"},Bn=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",Rn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.config,(r,i)=>(o.openBlock(),o.createElementBlock("th",{class:"widget-table__head-cell",key:i},[o.createElementVNode("p",Ln,o.toDisplayString(r.label),1)]))),128))]))}}),Ur="",V=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},Dn=V(Bn,[["__scopeId","data-v-25198f4a"]]);function Mn(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function yt(n,e){const t=Mn(n);let r=t?T.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function jn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Me={exports:{}},je,wt;function Vn(){if(wt)return je;wt=1;var n=1e3,e=n*60,t=e*60,r=t*24,i=r*7,s=r*365.25;je=function(c,p){p=p||{};var d=typeof c;if(d==="string"&&c.length>0)return u(c);if(d==="number"&&isFinite(c))return p.long?a(c):l(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))};function u(c){if(c=String(c),!(c.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(c);if(p){var d=parseFloat(p[1]),g=(p[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return d*s;case"weeks":case"week":case"w":return d*i;case"days":case"day":case"d":return d*r;case"hours":case"hour":case"hrs":case"hr":case"h":return d*t;case"minutes":case"minute":case"mins":case"min":case"m":return d*e;case"seconds":case"second":case"secs":case"sec":case"s":return d*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:return}}}}function l(c){var p=Math.abs(c);return p>=r?Math.round(c/r)+"d":p>=t?Math.round(c/t)+"h":p>=e?Math.round(c/e)+"m":p>=n?Math.round(c/n)+"s":c+"ms"}function a(c){var p=Math.abs(c);return p>=r?h(c,p,r,"day"):p>=t?h(c,p,t,"hour"):p>=e?h(c,p,e,"minute"):p>=n?h(c,p,n,"second"):c+" ms"}function h(c,p,d,g){var m=p>=d*1.5;return Math.round(c/d)+" "+g+(m?"s":"")}return je}function Un(n){t.debug=t,t.default=t,t.coerce=a,t.disable=s,t.enable=i,t.enabled=u,t.humanize=Vn(),t.destroy=h,Object.keys(n).forEach(c=>{t[c]=n[c]}),t.names=[],t.skips=[],t.formatters={};function e(c){let p=0;for(let d=0;d<c.length;d++)p=(p<<5)-p+c.charCodeAt(d),p|=0;return t.colors[Math.abs(p)%t.colors.length]}t.selectColor=e;function t(c){let p,d=null,g,m;function C(..._){if(!C.enabled)return;const w=C,S=Number(new Date),v=S-(p||S);w.diff=v,w.prev=p,w.curr=S,p=S,_[0]=t.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");let A=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(U,k)=>{if(U==="%%")return"%";A++;const oe=t.formatters[k];if(typeof oe=="function"){const ve=_[A];U=oe.call(w,ve),_.splice(A,1),A--}return U}),t.formatArgs.call(w,_),(w.log||t.log).apply(w,_)}return C.namespace=c,C.useColors=t.useColors(),C.color=t.selectColor(c),C.extend=r,C.destroy=t.destroy,Object.defineProperty(C,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(g!==t.namespaces&&(g=t.namespaces,m=t.enabled(c)),m),set:_=>{d=_}}),typeof t.init=="function"&&t.init(C),C}function r(c,p){const d=t(this.namespace+(typeof p>"u"?":":p)+c);return d.log=this.log,d}function i(c){t.save(c),t.namespaces=c,t.names=[],t.skips=[];let p;const d=(typeof c=="string"?c:"").split(/[\s,]+/),g=d.length;for(p=0;p<g;p++)d[p]&&(c=d[p].replace(/\*/g,".*?"),c[0]==="-"?t.skips.push(new RegExp("^"+c.slice(1)+"$")):t.names.push(new RegExp("^"+c+"$")))}function s(){const c=[...t.names.map(l),...t.skips.map(l).map(p=>"-"+p)].join(",");return t.enable(""),c}function u(c){if(c[c.length-1]==="*")return!0;let p,d;for(p=0,d=t.skips.length;p<d;p++)if(t.skips[p].test(c))return!1;for(p=0,d=t.names.length;p<d;p++)if(t.names[p].test(c))return!0;return!1}function l(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function a(c){return c instanceof Error?c.stack||c.message:c}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 Wn=Un;(function(n,e){e.formatArgs=r,e.save=i,e.load=s,e.useColors=t,e.storage=u(),e.destroy=(()=>{let a=!1;return()=>{a||(a=!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(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const h="color: "+this.color;a.splice(1,0,h,"color: inherit");let c=0,p=0;a[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(c++,d==="%c"&&(p=c))}),a.splice(p,0,h)}e.log=console.debug||console.log||(()=>{});function i(a){try{a?e.storage.setItem("debug",a):e.storage.removeItem("debug")}catch{}}function s(){let a;try{a=e.storage.getItem("debug")}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=process.env.DEBUG),a}function u(){try{return localStorage}catch{}}n.exports=Wn(e);const{formatters:l}=n.exports;l.j=function(a){try{return JSON.stringify(a)}catch(h){return"[UnexpectedJSONParseError]: "+h.message}}})(Me,Me.exports);var qn=Me.exports;const Ct=jn(qn);function Et(n){return["eservices-core",n].join(":")}function _t(n){return Ve(n,"YYYY/MM/DD HH:mm:ss")}function Ve(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return Dt.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const Wr="",be=V({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()=>o.h("i",{class:`icon icon-${t}`})}},[["__scopeId","data-v-e287c8d9"]]),zn=Ct(Et("setup-list-row"));function Gn(n,e){const t=n.config.map(r=>xn(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function xn(n,e,t){const r=e.values;let i=yt(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(c){s.onClick.push(()=>c(r))}function l(c){Array.isArray(c)?s.class.push(...c):s.class.push(c)}const a=[],h=[];if(n.hide&&n.hide(r))return[o.h("td")];if(n.type)switch(l(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Ve(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=_t(typeof i=="string"?i:null);break}case"money":{i=vt(i);break}case"multi-select":{h.push(o.h(T.FormField,{type:"single-checkbox",modelValue:e.selected})),u(bt.bind(null,t,!0));break}case"select":{h.push(o.h(T.FormField,{type:"single-radio",modelValue:e.selected})),u(bt.bind(null,t,!1));break}}if(n.onClick&&u(n.onClick),n.link)try{const c=n.link(r);if(c){const p=o.h(Je.RouterLink,{to:c});h.push(p),l("widget-table-cell_link")}}catch(c){zn("Can't add router link",c)}return n.href&&(h.push(o.h("a",{href:n.href(r),target:"_blank"})),l("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&h.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&h.push(o.h(be,{name:n.icon})),n.class&&(typeof n.class=="function"?l(n.class(r)):l(n.class)),a.push(o.h("td",s,h)),a}function bt(n,e){n.emit("select",e)}function St(n,e){return()=>{try{return Gn(n,e)}catch(t){return console.warn(t),null}}}const Jn={props:{values:Object,config:Object,selected:Boolean},setup:St},Kn=["colspan"],Tt=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=o.ref();return o.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=s=>e("close")),onSave:i[1]||(i[1]=s=>e("save",s))}),null,16,["values","new"]))],8,Kn)],512))}}),Ue={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go."},Hn={class:"widget-table"},kt="update:selectedRows",Yn=o.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=o.useSlots(),i=o.computed(()=>{var l;return(l=r==null?void 0:r.default)==null?void 0:l.call(r)[0]});function s(l,a=!0){if(!t.selectedRows)return;if(!a)return e(kt,t.selectedRows.includes(l)?[]:[l]);const h=[...t.selectedRows],c=h.indexOf(l);return c===-1?h.push(l):h.splice(c,1),e(kt,h)}function u(l){e("save",l),e("update:activeRow",null)}return(l,a)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",Hn,[o.createVNode(Dn,{config:l.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.array,(h,c)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:c},[o.createVNode(Jn,{config:l.config,values:h,selected:l.selectedRows.includes(h),onSelect:p=>s(h,p),class:o.normalizeClass(l.classCallback?l.classCallback(h):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&l.activeRow===h?(o.openBlock(),o.createBlock(Tt,{key:0,component:i.value,"row-length":l.config.length,values:h,onClose:a[0]||(a[0]=p=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),l.activeRow===o.unref(Ue).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(Tt,{key:0,component:i.value,"row-length":l.config.length,onClose:a[1]||(a[1]=h=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),Xn=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}}),zr="",Se=V(Xn,[["__scopeId","data-v-0ef9ae88"]]),Zn={class:"widget-button"},Qn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",Zn,[e.wait?(o.openBlock(),o.createBlock(Se,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),Gr="",er=V(Qn,[["__scopeId","data-v-450dc564"]]),tr={class:"widget-multi-button-wrap position_relative cursor_pointer"},nr={class:"widget-multi-button-body grid"},rr=["onClick"],ir={class:"widget-multi-button-side-wrap"},or=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(u=>({"7025434e":r.value}));const t=o.reactive({active:!1,wait:!1}),r=o.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 s(u=!t.active){t.active=u}return(u,l)=>(o.openBlock(),o.createElementBlock("div",tr,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",nr,[u.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:l[0]||(l[0]=a=>s())},o.toDisplayString(u.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(a,h)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:h,onClick:c=>{i(a.callback),s(!1)}},o.toDisplayString(a.label),9,rr))),128))]),o.createElementVNode("div",ir,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:l[1]||(l[1]=a=>s())},[t.wait?(o.openBlock(),o.createBlock(o.unref(Se),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(be),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),xr="",sr=V(or,[["__scopeId","data-v-a8d711d1"]]),ar={class:"widget-loader flex flex-align_center gap_10 padding_15"},cr={class:"text_md"},lr=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",ar,[o.createVNode(Se,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",cr,o.toDisplayString(e.label),1)]))}}),dr=["alt","src"],ur=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=o.ref();return o.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,dr))}}),fr={props:{config:Array,values:Object,selected:Boolean},setup:St},Jr="",pr=V(fr,[["__scopeId","data-v-344a8cc1"]]),hr=n=>(o.pushScopeId("data-v-4e1d87c8"),n=n(),o.popScopeId(),n),gr={class:"head-cell"},mr=hr(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),yr=o.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)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",gr,[o.createElementVNode("div",{class:"head-cell-content flex_grow",style:o.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(o.openBlock(),o.createBlock(o.unref(T.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(s=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.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]=s=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(be),{key:0,class:o.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:o.withCtx(()=>[o.createTextVNode("core-arrow-up")]),_:1},8,["class"])):o.createCommentVNode("",!0),mr])]))}}),Kr="",wr=V(yr,[["__scopeId","data-v-4e1d87c8"]]),Cr=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=o.ref(),i=o.ref();o.onMounted(()=>{function a(g,m){let C=-1;do C++,m-=g[C];while(m>0&&C<g.length);return C}function h(g,m){let C=0;for(;m>0&&m>g[C]&&C<g.length;)m-=g[C],C++;return console.log(m,C),C>0?C:0}function c(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 d(g){return g===null?!1:g.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(m){var Pt;function C(I){return I.screenX+S-R}const _=r.value,w=[..._.children].filter(I=>I.localName==="th"),S=((Pt=_.offsetParent)==null?void 0:Pt.scrollLeft)||0,v=w.map(I=>I.clientWidth),A=d(m.target),R=_.getBoundingClientRect().left,U=C(m),k=a(v,U),oe=v.slice(0,k).reduce((I,L)=>I+L,0),ve=U-oe,Ge=_.offsetWidth,se=w[k].clientWidth;if(t.config[k].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",m.screenX),console.log("Widths",v),console.log("max width",Ge),console.log("Start Position",U),console.log("Position From",k),console.log("Start Position",k),console.log("Global offset (Отступ самой таблицы от края экрана)",R),console.log("Del",ve),console.groupEnd(),i.value.innerText=w[k].textContent||"",i.value.style.display="grid",i.value.style.width=se+"px",i.value.style.cursor="grabbing",c(oe),p(se),document.addEventListener("pointermove",Ft,{passive:!0}),document.addEventListener("pointerup",Ot);function Ot(I){if(console.group("END"),document.removeEventListener("pointermove",Ft),document.removeEventListener("pointerup",Ot),A&&(t.config[k].width=i.value.style.width,t.config[k].minWidth=i.value.style.width,t.config[k].maxWidth=i.value.style.width,s(t.config)),!A){const L=I.screenX+S-R;console.log("ENP Position",L);const Ae=h(v,L);if(console.log(k,"->",Ae),Ae!==k){const ae=t.config[k],xe=t.config;xe.splice(k,1),xe.splice(Ae,0,ae),s(xe)}else{const ae=t.config[k].name;u(ae)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Ft(I){if(A){const ae=C(I)-U+se;p(ae);return}let L=I.screenX+S-R-ve;L<0&&(L=0),L+se>Ge&&(L=Ge-se),c(L)}})});function s(a){e("update:config",a)}function u(a){if(!a)return;if(Array.isArray(a)){if(a.length<1)return;a=a[0]}if(t.order.length===0||t.order[0]!==a)return void l([a]);const h=t.order.length===1||t.order[1]==="asc"?"asc":"desc";l([a,h==="asc"?"desc":"asc"])}function l(a){e("update:order",a)}return(a,h)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.config,(c,p)=>(o.openBlock(),o.createBlock(wr,o.mergeProps({key:c},c,{onOrder:d=>u(c.name),onSelect:h[0]||(h[0]=d=>e("select")),order:a.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),Hr="",Er=V(Cr,[["__scopeId","data-v-ccffc6bd"]]),_r={class:"widget-list"},br={class:"widget-list-body position_relative"},Sr=50,Tr=o.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(l,a=!0){if(t.selectedRows)if(!a)s(t.selectedRows.includes(l)?[]:[l]);else{const h=[...t.selectedRows],c=h.indexOf(l);c===-1?h.push(l):h==null||h.splice(c,1),s(h)}}function i(){var l;if(((l=t.selectedRows)==null?void 0:l.length)!==t.array.length)return s([...t.array]);s([])}function s(l){e("update:selectedRows",l)}function u(l){if(!l)return;const a=l.target;a.scrollTop+a.clientHeight+Sr>a.scrollHeight&&e("scrollEnd")}return(l,a)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[o.createElementVNode("table",_r,[o.createElementVNode("thead",null,[o.createVNode(Er,{onSelect:a[0]||(a[0]=h=>i()),"onUpdate:order":a[1]||(a[1]=h=>e("update:order",h)),"onUpdate:config":a[2]||(a[2]=h=>e("update:config",h)),config:l.config,order:l.order},null,8,["config","order"])]),o.createElementVNode("tbody",br,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.array,(h,c)=>{var p;return o.openBlock(),o.createBlock(pr,{key:c,class:"widget-list-row",values:h,config:l.config,selected:(p=l.selectedRows)==null?void 0:p.includes(h),onSelect:d=>r(h,d)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function kr(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=o.reactive({wait:!1,call:e});return t}function Te(n){return typeof n=="string"?We(n):Nr(n)?We(n.message):We(Ue.DEFAULT_ERROR_MESSAGE)}function Nr(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function We(n){return{message:n}}function ke(n="error"){return function(e){const{message:t}=Te(e);Ne.add(n,t)}}function qe(n,e){return ze().emit("entity:read",{...e,entity:n})}function Nt(n,e){return ze().emit("entity:update",{...e,entity:n})}function vr(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function vt(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 At(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=At(r)),e[i]=r,e},{})}function Ar(n,e){const t=new Map;return n.forEach(r=>{var s;const i=e(r);t.has(i)||t.set(i,[]),(s=t.get(i))==null||s.push(r)}),t}function Ir(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function $r(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const Y=Ct(Et("use-socket"));function ze(){return Or}const Or=function(){let n=1,e;const t=new Set,r=new Set;function i(){return{safeQueue:r,requestId:n,handlers:t}}function s(d){const g=[...t.values()];Y("Handlers array length is %d. Response event: %s. Request id: %d",t.size,d.event,d.requestId),g.forEach(m=>{const C=d.requestId;(m.requestId&&m.requestId===C||!m.requestId&&m.event===d.event)&&(Y("Find appropriated handler: %d, event: %s",n,m.event),m.callback(d.data,d),m.once&&(t.delete(m),Y("Handler was removed by *once* params was passed. %o",m)))})}function u(d){console.log(`%cInitializing sockets: %c${d}`,"color: purple","color: black"),e=new WebSocket(d),e.onclose=function(g){Y("Connection to server was stopped: %d %s",g.code,g.reason),setTimeout(()=>u(d))},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...r.values()].forEach(g=>{l(g),r.delete(g)})},e.onerror=function(g){console.warn(g)},e.onmessage=g=>{try{const m=JSON.parse(g.data);if(!It(m)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(m);return}s(m)}catch(m){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(m)}}}function l(d){e.send(d)}function a(d,g){t.add({event:d,callback:g})}function h(d,g){t.add({event:d,callback:g,once:!0})}function c(){return e&&(e==null?void 0:e.readyState)===1}function p(d,g,m){const C=++n,_=JSON.stringify({requestId:C,event:d,data:g,contextId:E.contextId,url:window.location.href});return c()?l(_):(r.add(_),Y("Socket is not connected. Message was send to save-queue. %s")),new Promise((w,S)=>{t.add({event:d,requestId:C,once:!0,callback:(v,A)=>{if(Y("Promise was resolve with next data:",v),Fr(A))return void S(v);m&&m(v,A),w(v)}})})}return{get socket(){return e},on:a,once:h,emit:p,initialization:u,getDevInfo:i}}(),Fr=n=>!!It(n)&&n.event==="request-error",It=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 Pr(n,e){const t=o.reactive([]);let r=0;const i=o.ref(!1);function s(){if(i.value)return Promise.reject("The process has already started.");const d=c();return i.value=!0,typeof d.limit!="number"&&(d.limit=100),d.offset=r,qe(n,d).then(g=>(r+=g.length,g)).finally(()=>{i.value=!1})}function u(d,g){var C;const m=d.Version||((C=t.find(_=>_.Id===g))==null?void 0:C.Version);if(m===void 0)throw new Error("Object without version.");return m}function l(d,g){const m=t.findIndex(C=>C.Id===d);if(m===-1)throw new Error(`Can't found item with Id ${d}`);t.splice(m,1,g)}async function a(d,g){try{const m=c(),C=u(g,d);delete g.Version,await Nt(n,{id:d,values:g,version:C});const _=await qe(n,{fields:m.fields||"",id:d});l(d,_)}catch(m){ke()(m)}}async function h(){try{const d=await s();t.push(...d)}catch(d){ke()(d)}}function c(){return typeof e=="function"?e():e}async function p(){try{r=0;const d=await s();t.splice(0,t.length,...d)}catch(d){ke()(d)}}return{array:t,updateById:a,next:h,reload:p,wait:i}}const Ne=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=Rr(r),s=new Lr(e,t,i.timeout,i.children,i.click);return this.store.push(s),r.timeout&&setTimeout(this.remove.bind(this,s.id),r.timeout*1e3),s}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function Rr(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 $t=class Lt{constructor(e,t,r,i,s){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=s,this.id=Lt.cardId++}};$t.cardId=1;let Lr=$t;function Br(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function F(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(Br(r)){let i=function(s){var u;return((u=s.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(F.is(t,r)),e)},[]).join(" and ")}function ie(n){return typeof n=="string"?`'${n}'`:`${n}`}F.includes=function(e,t){return`@${e} Contains ${ie(t)}`},F.beginWith=function(e,t){return`@${e} BeginWith ${ie(t)}`},F.notEq=function(e,t){return`@${e} nq ${ie(t)}`},F.eq=function(e,t){return Array.isArray(t)?F.in(e,t):`@${e} eq ${ie(t)}`},F.in=function(e,t){const r=t.map(ie).join(", ");return`@${e} in (${r})`},F.and=function(...e){return e.join(" and ")},F.is=function(e,t){return`@${e} is ${t}`},F.or=function(...e){return e.join(" or ")};const Dr={clickOutside:de,staticLink:pn,Request:y},Mr={usage:Vt,utils:Jt,config:Kt,types:Ht};f.ApplicationManager=st,f.Communication=un,f.ComputedMetadata=Qt,f.CoreError=O,f.Filter=F,f.Manager=E,f.MetadataStore=Q,f.NotificationSystem=Ne,f.Request=y,f.WidgetButton=er,f.WidgetIcon=be,f.WidgetImage=ur,f.WidgetList=Tr,f.WidgetLoader=lr,f.WidgetMultiButton=sr,f.WidgetSpinner=Se,f.WidgetTable=Yn,f.actionService=gt,f.asyncProcess=kr,f.authService=N,f.billingService=H,f.catchUniversal=ke,f.clickOutside=de,f.clientService=Qe,f.communicationService=ee,f.configurationService=Sn,f.constants=Ue,f.dataService=B,f.debounce=hn,f.default=Mr,f.documentsService=bn,f.equipmentService=Pn,f.fileService=cn,f.getCellValue=yt,f.getNamesFromListConfig=vr,f.groupArrayByField=Ar,f.historyService=Xt,f.internationalizationService=tn,f.invitationService=ln,f.metadataService=Re,f.openService=dn,f.parseError=Te,f.prettifyValueByMetadata=en,f.prettyDate=Ve,f.prettyDateWithTime=_t,f.prettyMoney=vt,f.processWizardService=me,f.ruleValidationService=Le,f.t=K,f.testTypes=Yt,f.universalEntityRead=qe,f.universalEntityUpdate=Nt,f.useCommunication=fn,f.useCustomerState=En,f.useFormAction=yn,f.useFormLabel=wn,f.useFormMetadata=gn,f.useFormRequest=_n,f.useFormRequestData=Cn,f.useListActiveRow=$r,f.useListEntity=Pr,f.useListSearch=Tn,f.useListSelect=Nn,f.useLogger=ut,f.useManagerState=qt,f.useSocket=ze,f.useWizard=$n,f.utils=Dr,f.uuidv4=Ir,f.valuesToUpperCase=At,f.viewService=an,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
11
11
  //# sourceMappingURL=eservices-core.umd.js.map
@@ -86,10 +86,10 @@ declare const _default: {
86
86
  export default _default;
87
87
  export { StylesInterface, };
88
88
  import { WidgetButton, WidgetMultiButton, WidgetIcon, WidgetSpinner, WidgetTable, WidgetLoader, WidgetImage, WidgetList } from "./../src/index";
89
- import { groupArrayByField, valuesToUpperCase, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, getCellValue, universalEntityRead, universalEntityUpdate, getNamesFromListConfig } from "./../src/index";
89
+ import { uuidv4, groupArrayByField, valuesToUpperCase, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, getCellValue, universalEntityRead, universalEntityUpdate, getNamesFromListConfig } from "./../src/index";
90
90
  import type { IListCell, INotificationType, IMultiButtonItem, IEntityId, IEntityVersion, IUniversalEntityReadListOptions, IUniversalEntityReadSingleOptions, IUniversalEntityUpdateOptions, IUniversalEntityReadOptions, IValues, IListOrder } from "./../src/index";
91
91
  import { constants } from "./../src/index";
92
92
  import { useListActiveRow, useSocket, useListEntity } from "./../src/index";
93
93
  import { NotificationSystem } from "./../src/index";
94
94
  import { Filter } from "./../src/index";
95
- export { NotificationSystem, constants, WidgetButton, WidgetMultiButton, WidgetIcon, WidgetSpinner, WidgetTable, WidgetLoader, WidgetImage, WidgetList, groupArrayByField, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, getNamesFromListConfig, getCellValue, valuesToUpperCase, IListCell, IListOrder, INotificationType, IMultiButtonItem, IEntityId, IEntityVersion, IUniversalEntityReadListOptions, IUniversalEntityReadSingleOptions, IUniversalEntityReadOptions, IUniversalEntityUpdateOptions, IValues, useListActiveRow, useSocket, useListEntity, Filter };
95
+ export { NotificationSystem, constants, WidgetButton, WidgetMultiButton, WidgetIcon, WidgetSpinner, WidgetTable, WidgetLoader, WidgetImage, WidgetList, groupArrayByField, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, getNamesFromListConfig, getCellValue, valuesToUpperCase, uuidv4, IListCell, IListOrder, INotificationType, IMultiButtonItem, IEntityId, IEntityVersion, IUniversalEntityReadListOptions, IUniversalEntityReadSingleOptions, IUniversalEntityReadOptions, IUniversalEntityUpdateOptions, IValues, useListActiveRow, useSocket, useListEntity, Filter, };
@@ -38,7 +38,8 @@ import prettyMoney from './methods/pretty-money';
38
38
  import getCellValue from './methods/get-cell-value';
39
39
  import valuesToUpperCase from './methods/values-to-upper-case';
40
40
  import groupArrayByField from './methods/group-array-by-field';
41
- export { groupArrayByField, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, getNamesFromListConfig, getCellValue, valuesToUpperCase };
41
+ import uuidv4 from './methods/uuid';
42
+ export { groupArrayByField, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, getNamesFromListConfig, getCellValue, valuesToUpperCase, uuidv4 };
42
43
  /****
43
44
  HOOKS
44
45
  ****/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eservices-core",
3
- "version": "1.3.17",
3
+ "version": "1.3.18",
4
4
  "description": "Core library",
5
5
  "author": "",
6
6
  "scripts": {