eservices-core 1.3.89 → 1.3.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/src/types/auth-type.d.ts +5 -0
- package/dist/eservices-core.cjs.js +2 -2
- package/dist/eservices-core.es.js +29 -36
- package/dist/eservices-core.umd.js +3 -3
- package/dist/frontend/core/index.d.ts +4 -4
- package/dist/frontend/src/hooks/use-list-select.d.ts +15 -0
- package/dist/frontend/src/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -7,6 +7,11 @@ export interface IAuthOptions {
|
|
|
7
7
|
loginURLPathname?: string;
|
|
8
8
|
logoutURLPathname?: string;
|
|
9
9
|
sessionKey?: string;
|
|
10
|
+
/**
|
|
11
|
+
* @description Необходимо ли использовать логаут на ID сервере. По умолчанию
|
|
12
|
+
* true.
|
|
13
|
+
*/
|
|
14
|
+
useLogoutIdentityServer?: boolean;
|
|
10
15
|
}
|
|
11
16
|
export interface IAuthClientState {
|
|
12
17
|
codeVerifier: string;
|
|
@@ -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-b3ed6089]{padding:18px;text-align:start}.widget-table__head-label[data-v-b3ed6089]{font-weight:600;font-size:14px;line-height:19px}[dir=rtl] .icon[data-v-0eae75d4]{transform:scaleX(-1)}.widget-spinner[data-v-0ae13719],.widget-spinner[data-v-0ae13719]:after{border-radius:50%;width:14px;height:14px}.widget-spinner[data-v-0ae13719]{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-0ae13719 1.1s infinite linear}@keyframes spinnerAnimation-0ae13719{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.widget-button[data-v-76d0d8eb]{position:relative}.widget-button-spinner[data-v-76d0d8eb]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.widget-multi-button-wrap[data-v-2034ac0b]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-2034ac0b]{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-2034ac0b]{grid-template-rows:calc(var(--button-size) * var(--8e9f9746))}.widget-multi-button-body[data-v-2034ac0b]{min-width:80px}.widget-multi-button-body-label[data-v-2034ac0b]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-2034ac0b]:hover{background-color:#223296}.widget-multi-button-side[data-v-2034ac0b]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-2034ac0b]{transform:rotate(180deg)}.widget-multi-button-side[data-v-2034ac0b]:hover{background-color:#223296}tr[data-v-aa0613cb]{border:1px solid #F3F4FC;height:30px}th[data-v-aa0613cb],td[data-v-aa0613cb]{position:relative;padding:0 11px}th[data-v-aa0613cb]{text-align:left}p[data-v-aa0613cb]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.widget-list-head-cell[data-v-85ce2e65]{padding:0 0 0 10px;display:flex}.widget-list-head-cell[data-v-85ce2e65]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-85ce2e65]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-85ce2e65]{position:absolute;inset-inline-end:22px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-85ce2e65]{transform:rotate(180deg)}.head-cell-resize[data-v-85ce2e65]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-85ce2e65]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-85ce2e65]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-6173c14c]{position:sticky;top:-1px;z-index:1}.test-block[data-v-6173c14c]{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-6173c14c]{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.
|
|
3
|
+
* eservices-core v1.3.90
|
|
4
4
|
* (c) 2024 ESERVICES
|
|
5
5
|
*/Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),I=require("jenesius-vue-form"),ot=require("vue-router"),Be=require("debug"),Ot=require("date-and-time"),Te=require("jenesius-vue-modal");function It(n,e){return!!n&&n===e||"password is not equal"}function st(n){return Number(n.replace(/[^0-9.]/g,""))}function Rt(n,e=null){let r=String(st(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 Lt=Object.freeze(Object.defineProperty({__proto__:null,numeric:st,prettyNumeric:Rt,validPassword:It},Symbol.toStringTag,{value:"Module"})),$t={inputs:Lt};function be(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?be(n[r],e.substr(t+1)):void 0}return n[e]}function ke(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 at(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const ct=class v extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=v.ID++}static ParentFormNotFound(){return new v("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new v("Composite object name is undefined",e)}static EntityWithoutName(e){return new v("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new v(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new v("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new v("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new v(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return v.ApiNotAvailable()}static ApiError(e){return new v("Request error",e)}static ApiNotAvailable(){return new v(`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?v.ApiNotAvailable():new v(e||"Authorization Error",t)}static ApiResponseParseFailed(){return v.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new v("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new v(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new v("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new v("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new v(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new v(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new v(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new v(`Metadata for the ${e} is not currently available.`)}static RequestTookToLong(){return new v("The request took too long to complete. Try again later.")}};ct.ID=0;let Y=ct;const Pt="Please try again later or submit a feedback if problem doesn't go.";class lt{static getClientData(){return y("/close-api/client-content")}static getNavigation(){return y("/close-api/client/navigation")}}const Dt=new class{constructor(){this.store=o.reactive([])}add(e,t,{children:r,timeout:i=10,click:s=()=>{}}={}){const u=new xt(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.")}},ut=class dt{constructor(e,t,r,i,s){this.type=e,this.msg=t,this.timeout=r,this.children=i,this.click=s,this.id=dt.cardId++}};ut.cardId=1;let xt=ut;/*!
|
|
7
7
|
* jenesius-event-emitter v1.0.2
|
|
8
8
|
* (c) 2022 Jenesius
|
|
9
9
|
* @license MIT
|
|
10
|
-
*/const Je=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},He=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},Xe=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 V{constructor(){this.events={}}on(e,t){return Je.call(this,e,t)}emit(e,t){return He.call(this,e,t)}off(e,t){return Xe.call(this,e,t)}cleanEvents(){Qe.call(this)}static on(e,t){return Je.call(V,e,t)}static emit(e,t){return He.call(V,e,t)}static off(e,t){return Xe.call(V,e,t)}static cleanEvents(){Qe.call(V)}}V.events={};var ft=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},pe=(n,e,t)=>(ft(n,e,"read from private field"),t?t.call(n):e.get(n)),Pe=(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)},De=(n,e,t,r)=>(ft(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),re,he,ge;const J=class N extends V{constructor(){super(...arguments),Pe(this,re,void 0),Pe(this,he,"front"),this.organizations=[],Pe(this,ge,!1)}set language(e){localStorage.setItem(N.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(N.LOCALSTORAGE_LANGUAGE_KEY)||N.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(N.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){De(this,re,e)}get router(){if(!pe(this,re))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return pe(this,re)}set type(e){De(this,he,e)}get type(){return pe(this,he)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){De(this,ge,e),this.emit(N.EVENT_READY_UPDATE,e)}get ready(){return pe(this,ge)}onReady(e){return this.on(N.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(N.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(N.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(N.CURRENT_CONTEXT_KEY,String(e)),this.emit(N.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(N.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{Dt.add("error",Y.ApiNotAvailable().message)}}loadCustomerData(){return lt.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))}};re=new WeakMap;he=new WeakMap;ge=new WeakMap;J.DEFAULT_LANGUAGE="en";J.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";J.EVENT_CONTEXT_UPDATE="event:context-update";J.EVENT_READY_UPDATE="event:ready-update";J.EVENT_DATA_UPDATE="event:data-update";J.CURRENT_CONTEXT_KEY="CurrentContext";let Mt=J;const Ze=new Mt;function Vt(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Pt}})}function y(n,e={}){return Ze.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=Ze.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw Y.ApiNotAvailable()}).then(t=>Vt(t).then(r=>{if(!t.ok)throw r;return r}))}class Ne{constructor(){}static parseNamesFromListConfig(e){let t=Ne.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),a=i.substring(0,s);a in r||(r[a]={}),t(r[a],u)}else r[i]=!0;return r}return e.reduce(t,{})}}class Bt{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 Ft=new Bt;function pt(n){return n&&n[0].toLowerCase()+n.slice(1)}function Fe(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=Fe(r)),e[i]=r,e},{})}function Ut(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 jt={Request:y,clickOutside:ke,getPropFromObject:be,runPromiseQueue:at,GraphQL:Ne,firstChapterToLowerCase:pt,valuesToUpperCase:Fe,prettyMoney:Ut},Wt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Ne,Journal:Ft,Request:y,clickOutside:ke,default:jt,firstChapterToLowerCase:pt,getPropFromObject:be,runPromiseQueue:at,valuesToUpperCase:Fe},Symbol.toStringTag,{value:"Module"})),qt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Gt{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(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...s,changes:u}});return{...r,history:i}})}}class zt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return y(`/open-api/internationalization/language/${e}`)}}let K={};function Z(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=I.utils.getPropFromObject((this==null?void 0:this.vocabulary)||K,n);if(typeof t=="string")return et(t,e);const r=I.utils.getPropFromObject(K==null?void 0:K.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}Z.setGlobalVocabulary=function(n){K=n};Z.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),Z.bind({vocabulary:I.utils.getPropFromObject(K,e.toLowerCase())})};Z.setVocabulary=function(n){return typeof n=="string"&&(n=I.utils.getPropFromObject(K,n)),Z.bind({vocabulary:n})};const Kt=function(){let n=!1;const e=[];function t(){return n}function r(l,d){t()&&console[l](...d),e.push(d)}function i(...l){r("log",l)}function s(...l){r("warn",l)}function u(...l){r("error",l)}function a(l=!0){n=l}return{info:i,warn:s,history:e,display:a,error:u}}();function Yt(){return Kt}function Jt(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Ht="masterId",Xt="masterEntity";function Me(n,e){if(!Array.isArray(e))return;if(Jt(e))return t(e);e.forEach(t);function t(r){n.append(Xt,r[0]),n.append(Ht,r[1].toString())}}class ce{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(([a,l="desc"])=>`@${a} ${l}`).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=ce.getSearchParamsForEntityListRead(t||{});return await y(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=ce.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 Me(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 Me(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 ce.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 ht=class ie{static async create(e){return y(ie.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(ie.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return y(`${ie.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return y(`${ie.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};ht.url="/close-api/communications";let Qt=ht;function tt(n){return{...n,createdEntities:n.createdEntites}}const gt=class ye{static async getStartConfig(e,t){return y([ye.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return y([ye.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(tt)}static async runStep(e,t,r,i,s){return y([ye.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(tt)}};gt.url="/close-api/views/process-wizard";let me=gt;class Zt{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 en{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 Ue{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return y(Ue.url+e,{method:"POST",body:JSON.stringify(t)})}}class tn{static getConfiguration(){return y("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}const nn={class:"widget-table__head"},rn={class:"widget-table__head-label margin_0 text_overflow"},on=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",nn,[(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",rn,o.toDisplayString(r.label),1)]))),128))]))}});const U=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},sn=U(on,[["__scopeId","data-v-b3ed6089"]]);function yt(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function mt(n,e){const t=yt(n);let r=t?I.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):n.value===null?null:r}function je(n){return["eservices-core",n].join(":")}function Et(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 Ot.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const an={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}`})}},le=U(an,[["__scopeId","data-v-0eae75d4"]]),cn=Be(je("setup-list-row"));function ln(n,e){const t=n.config.map(r=>un(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function un(n,e,t){const r=e.values;let i=mt(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(h){s.onClick.push(()=>h(r))}function a(h){Array.isArray(h)?s.class.push(...h):s.class.push(h)}const l=[],d=[];if(n.hide&&n.hide(r))return[o.h("td")];if(n.type)switch(a(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=We(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Et(typeof i=="string"?i:null);break}case"money":{i=_t(i);break}case"multi-select":{d.push(o.h(I.FormField,{type:"single-checkbox",modelValue:e.selected})),u(nt.bind(null,t,!0));break}case"select":{d.push(o.h(I.FormField,{type:"single-radio",modelValue:e.selected})),u(nt.bind(null,t,!1));break}}if(n.onClick&&u(n.onClick),n.link)try{const h=n.link(r);if(h){const T=o.h(ot.RouterLink,{to:h});d.push(T),a("widget-table-cell_link")}}catch(h){cn("Can't add router link",h)}if(n.href&&(d.push(o.h("a",{href:n.href(r),target:"_blank"})),a("widget-table-cell_link")),typeof i=="boolean"&&(i=i?"✓":"—"),(typeof i=="string"||typeof i=="number")&&d.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&(typeof n.icon=="string"&&d.push(o.h(le,{name:n.icon})),typeof n.icon=="function")){const h=n.icon(r);h!==null&&d.push(o.h(le,{name:h}))}return n.class&&(typeof n.class=="function"?a(n.class(r)):a(n.class)),l.push(o.h("td",s,d)),l}function nt(n,e){n.emit("select",e)}function vt(n,e){return()=>{try{return ln(n,e)}catch(t){return console.warn(t),null}}}const dn={props:{values:Object,config:Object,selected:Boolean},setup:vt},fn=["colspan"],rt=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,fn)],512))}}),w={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",TIME_TO_LIVE_SOCKET_REQUEST:3e4},pn={class:"widget-table"},it="update:selectedRows",hn=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 a;return(a=r==null?void 0:r.default)==null?void 0:a.call(r)[0]});function s(a,l=!0){if(!t.selectedRows)return;if(!l)return e(it,t.selectedRows.includes(a)?[]:[a]);const d=[...t.selectedRows],h=d.indexOf(a);return h===-1?d.push(a):d.splice(h,1),e(it,d)}function u(a){e("save",a),e("update:activeRow",null)}return(a,l)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",pn,[o.createVNode(sn,{config:a.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(d,h)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:h},[o.createVNode(dn,{config:a.config,values:d,selected:a.selectedRows.includes(d),onSelect:T=>s(d,T),class:o.normalizeClass(a.classCallback?a.classCallback(d):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&a.activeRow===d?(o.openBlock(),o.createBlock(rt,{key:0,component:i.value,"row-length":a.config.length,values:d,onClose:l[0]||(l[0]=T=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),a.activeRow===o.unref(w).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(rt,{key:0,component:i.value,"row-length":a.config.length,onClose:l[1]||(l[1]=d=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),gn=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))}});const Oe=U(gn,[["__scopeId","data-v-0ae13719"]]),yn={class:"widget-button"},mn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",yn,[e.wait?(o.openBlock(),o.createBlock(Oe,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const En=U(mn,[["__scopeId","data-v-76d0d8eb"]]),vn={class:"widget-multi-button-wrap position_relative cursor_pointer"},_n={class:"widget-multi-button-body grid"},wn=["onClick"],Tn={class:"widget-multi-button-side-wrap"},Cn=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(u=>({"8e9f9746":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,a)=>(o.openBlock(),o.createElementBlock("div",vn,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",_n,[u.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:a[0]||(a[0]=l=>s())},o.toDisplayString(u.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(l,d)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:d,onClick:h=>{i(l.callback),s(!1)}},o.toDisplayString(l.label),9,wn))),128))]),o.createElementVNode("div",Tn,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:a[1]||(a[1]=l=>s())},[t.wait?(o.openBlock(),o.createBlock(o.unref(Oe),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(le),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}});const Sn=U(Cn,[["__scopeId","data-v-2034ac0b"]]),An={class:"widget-loader flex flex-align_center gap_10 padding_15"},bn={class:"text_md"},kn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",An,[o.createVNode(Oe,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",bn,o.toDisplayString(e.label),1)]))}}),Nn=["alt","src"],On=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,Nn))}}),In={props:{config:Array,values:Object,selected:Boolean},setup:vt};const Rn=U(In,[["__scopeId","data-v-aa0613cb"]]),Ln=n=>(o.pushScopeId("data-v-85ce2e65"),n=n(),o.popScopeId(),n),$n={class:"widget-list-head-cell"},Pn=Ln(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Dn=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",$n,[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(I.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(le),{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),Pn])]))}});const xn=U(Dn,[["__scopeId","data-v-85ce2e65"]]),Mn=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 l(_,m){let E=-1;do E++,m-=_[E];while(m>0&&E<_.length);return E}function d(_,m){let E=0;for(;m>0&&m>_[E]&&E<_.length;)m-=_[E],E++;return console.log(m,E),E>0?E:0}function h(_){try{i.value.style.insetInlineStart=_+"px"}catch(m){console.log(m)}}function T(_){try{i.value.style.width=_+"px",i.value.style.minWidth=_+"px",i.value.style.maxWidth=_+"px"}catch(m){console.log(m)}}function R(_){return _===null?!1:_.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(m){var Ye;function E(k){return k.screenX+f-b}const p=r.value,c=[...p.children].filter(k=>k.localName==="th"),f=((Ye=p.offsetParent)==null?void 0:Ye.scrollLeft)||0,g=c.map(k=>k.clientWidth),A=R(m.target),b=p.getBoundingClientRect().left,H=E(m),C=l(g,H),j=g.slice(0,C).reduce((k,P)=>k+P,0),ee=H-j,Le=p.offsetWidth,te=c[C].clientWidth;if(t.config[C].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",m.screenX),console.log("Widths",g),console.log("max width",Le),console.log("Start Position",H),console.log("Position From",C),console.log("Start Position",C),console.log("Global offset (Отступ самой таблицы от края экрана)",b),console.log("Del",ee),console.groupEnd(),i.value.innerText=c[C].textContent||"",i.value.style.display="grid",i.value.style.width=te+"px",i.value.style.cursor="grabbing",h(j),T(te),document.addEventListener("pointermove",Ke,{passive:!0}),document.addEventListener("pointerup",ze);function ze(k){if(console.group("END"),document.removeEventListener("pointermove",Ke),document.removeEventListener("pointerup",ze),A&&(t.config[C].width=i.value.style.width,t.config[C].minWidth=i.value.style.width,t.config[C].maxWidth=i.value.style.width,s(t.config)),!A){const P=k.screenX+f-b;console.log("ENP Position",P);const fe=d(g,P);if(console.log(C,"->",fe),fe!==C){const ne=t.config[C],$e=t.config;$e.splice(C,1),$e.splice(fe,0,ne),s($e)}else{const ne=t.config[C].name;u(ne)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Ke(k){if(A){const ne=E(k)-H+te;T(ne);return}let P=k.screenX+f-b-ee;P<0&&(P=0),P+te>Le&&(P=Le-te),h(P)}})});function s(l){e("update:config",l)}function u(l){if(!l)return;if(Array.isArray(l)){if(l.length<1)return;l=l[0]}if(t.order.length===0||t.order[0]!==l)return void a([l]);const d=t.order.length===1||t.order[1]==="asc"?"asc":"desc";a([l,d==="asc"?"desc":"asc"])}function a(l){e("update:order",l)}return(l,d)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.config,(h,T)=>(o.openBlock(),o.createBlock(xn,o.mergeProps({key:h},h,{onOrder:R=>u(h.name),onSelect:d[0]||(d[0]=R=>e("select")),order:l.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}});const Vn=U(Mn,[["__scopeId","data-v-6173c14c"]]),Bn={class:"widget-list"},Fn={class:"widget-list-body position_relative"},Un=50,jn=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(a,l=!0){if(t.selectedRows)if(!l)s(t.selectedRows.includes(a)?[]:[a]);else{const d=[...t.selectedRows],h=d.indexOf(a);h===-1?d.push(a):d==null||d.splice(h,1),s(d)}}function i(){var a;if(((a=t.selectedRows)==null?void 0:a.length)!==t.array.length)return s([...t.array]);s([])}function s(a){e("update:selectedRows",a)}function u(a){if(!a)return;const l=a.target;l.scrollTop+l.clientHeight+Un>l.scrollHeight&&e("scrollEnd")}return(a,l)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[o.createElementVNode("table",Bn,[o.createElementVNode("thead",null,[o.createVNode(Vn,{onSelect:l[0]||(l[0]=d=>i()),"onUpdate:order":l[1]||(l[1]=d=>e("update:order",d)),"onUpdate:config":l[2]||(l[2]=d=>e("update:config",d)),config:a.config,order:a.order},null,8,["config","order"])]),o.createElementVNode("tbody",Fn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(d,h)=>{var T;return o.openBlock(),o.createBlock(Rn,{key:h,class:"widget-list-row",values:d,config:a.config,selected:(T=a.selectedRows)==null?void 0:T.includes(d),onSelect:R=>r(d,R)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),D={};function Wn(n){for(let e in n)D[e]=n[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function qn(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 Ce(n){return typeof n=="string"?xe(n):Gn(n)?xe(n.message):xe(w.DEFAULT_ERROR_MESSAGE)}function Gn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function xe(n){return{message:n}}function L(n="error"){return function(e){const{message:t}=Ce(e);ue.add(n,t)}}function Se(n,e={}){return S().emit("entity:read",{...e,entity:n})}function qe(n,e){return S().emit("entity:update",{...e,entity:n})}function zn(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function _t(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 Ge(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=Ge(r)),e[i]=r,e},{})}function Kn(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 Yn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Jn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return w.DEFAULT_ERROR_MESSAGE}})}function M(n,e={}){return O.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=O.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw new Error(w.DEFAULT_ERROR_MESSAGE)}).then(t=>Jn(t).then(r=>{if(!t.ok)throw r;return r}))}function Hn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Xn(n,e){let t=!1;return(...r)=>{if(!t)return t=!0,setTimeout(()=>t=!1,e),n(...r)}}const Qn=Be(je("pretty-value-field-by-entity"));function Zn(n,e,t){try{const r=Ae.get(n);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${n} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch(r){return Qn('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,n,e,t),t}}const er=1,tr=5e3,W=Be(je("use-socket"));function S(){return rr}function nr(n){return typeof n=="object"&&Object.prototype.toString.call(n)==="[object Blob]"}const rr=function(){let n=1,e,t;const r=new Set;let i=0;const s=new Set;function u(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},tr*2);const c=new Uint8Array(1);c[0]=er,e.send(c)}setInterval(()=>{Array.from(r).forEach(c=>{p(c)&&(W("Handler for event %s requestId %d was expired",c.event,c.requestId),c.requestId?l({requestId:c.requestId,event:"request-error",data:{message:Y.RequestTookToLong().message}}):r.delete(c))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&d()},w.DELAY_SOCKET_RECONNECT);function a(){return{safeQueue:s,requestId:n,handlers:r,socketInstance:e}}function l(c){const f=[...r.values()];W("Handlers array length is %d. Response event: %s. Request id: %d",r.size,c.event,c.requestId),f.forEach(g=>{const A=c.requestId;(g.requestId&&g.requestId===A||!g.requestId&&g.event===c.event)&&(W("Find appropriated handler: %d, event: %s",n,g.event),g.callback(c.data,c),g.once&&(r.delete(g),W("Handler was removed by *once* params was passed. %o",g)))})}function d(){if(typeof t!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${t}`,"color: purple","color: black"),e=new WebSocket(t),e.onclose=function(c){W("Connection to server was stopped: %d %s",c.code,c.reason),Array.from(r).forEach(f=>{f.guaranteedAnswer&&f.serializeString&&s.add(f.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(c=>{h(c),s.delete(c)})},e.onerror=function(c){console.warn(c)},e.onmessage=c=>{var f;try{if(nr(c.data)){u();return}const g=JSON.parse(c.data);if(!wt(g)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(g);return}(f=g==null?void 0:g.data)!=null&&f.refresh&&location.reload(),l(g)}catch(g){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(g)}}}function h(c){e.send(c)}function T(c,f){E({event:c,callback:f})}function R(c,f){E({event:c,callback:f,once:!0})}function _(){return e&&(e==null?void 0:e.readyState)===1}function m(c,f,g){const A=++n,b=JSON.stringify({requestId:A,event:c,data:f,contextId:O.contextId,url:window.location.href});return _()?h(b):(s.add(b),W("Socket is not connected. Message was send to save-queue")),new Promise((H,C)=>{E({event:c,requestId:A,once:!0,guaranteedAnswer:!0,serializeString:b,callback:(j,ee)=>{if(W("Promise was resolve with next data:",j),ir(ee))return void C(j);g&&g(j,ee),H(j)},timeToLive:w.TIME_TO_LIVE_SOCKET_REQUEST})})}function E(c){const f={timeToLive:0,...c,created:new Date().getTime()};r.add(f)}function p(c){return c.timeToLive===0||typeof c.timeToLive!="number"?!1:new Date().getTime()-c.created>c.timeToLive}return{get socket(){return e},on:T,once:R,emit:m,initialization(c){t=c},getDevInfo:a}}(),ir=n=>!!wt(n)&&n.event==="request-error",wt=n=>typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function or(n,e){return S().emit("list-setting:read",{entity:n,mark:e})}function sr(n,e){return S().emit("metadata-field:treat",{entity:n,fieldName:e})}function Tt(n,e){return S().emit("entity:create",{...e,entity:n})}function Ct(n,e){return S().emit("entity:delete",{...e,entity:n})}function ar(n,e){return S().emit("usage-context:read",{...e,entity:n})}function St(n={}){return S().emit("tool:read",n)}function cr(n,e={},t={}){const r=o.inject(w.PROVIDE_NAME_ACTIONS,null),i=typeof n=="string"?n:e,s=typeof e=="string"?t:e;return o.computed(()=>{var l;const a=((typeof n=="string"?(l=r==null?void 0:r.actions)==null?void 0:l.value:o.unref(n))||[]).find(d=>d.name===i);return a?{...a,...s}:null})}function lr(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}function ur(n,e,t={}){const r=o.reactive([]);let i=0;const s=o.ref(!1);function u(){if(s.value)return Promise.reject("The process has already started.");const p=m();return s.value=!0,typeof p.limit!="number"&&(p.limit=100),p.offset=i,(t.request||Se)(n,p).then(f=>(i+=f.length,f)).finally(()=>{s.value=!1})}function a(p,c){var g;return typeof p.Version=="number"?p.Version:(g=r.find(A=>A.Id===c))==null?void 0:g.Version}function l(p,c){const f=r.findIndex(g=>g.Id===p);if(f===-1)throw new Error(`Can't found item with Id ${p}`);r.splice(f,1,c)}function d(p){const c=r.findIndex(f=>f.Id===p);if(c===-1)throw new Error(`Can't found item with Id ${p}`);r.splice(c,1)}async function h(p,c){try{const f=m(),g=a(c,p);delete c.Version,await qe(n,{id:p,values:c,version:g});const A=await Se(n,{fields:f.fields||"",id:p});l(p,A)}catch(f){L()(f)}}async function T(p,c){try{const f=m(),g=a(c,p);delete c.Version,await Ct(n,{id:p,version:g}),d(p)}catch(f){L()(f)}}async function R(p){try{await Tt(n,{values:p}),await E()}catch(c){L()(c)}}async function _(){try{const p=await u();r.push(...p)}catch(p){L()(p)}}function m(){return typeof e=="function"?e():e}async function E(){try{i=0;const p=await u();r.splice(0,r.length,...p)}catch(p){L()(p)}}return{array:r,updateById:h,next:_,reload:E,wait:s,create:R,deleteById:T}}function dr(){function n(){return{organizations:O.organizations,currentContextId:O.contextId,person:O.person,context:O.context,contextType:O.contextType,userId:O.userId}}const e=o.reactive(n());return O.onupdateContext(()=>{Object.assign(e,n())}),e}function fr(n,e,t){return S().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function pr(n,e,t){return S().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function hr(n,e){return S().emit("communication-message:create",{communicationId:n,text:e})}function gr(n){return S().emit("communication-message:read",{communicationId:n})}function yr(n){const e=I.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>gr(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function mr(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw Y.EntityWithoutName(n);return Se(n.name,r)}).then(Ge).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(L())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw Y.EntityWithoutName(n);return qe(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw L()(i),i})};function t(){return typeof e=="function"?e():e}}function Er(n){if(!n)return o.inject(w.PROVIDE_NAME_METADATA);Ae.initEntity(n);const e=o.computed(()=>Ae.state[n]);return o.provide(w.PROVIDE_NAME_METADATA,e),e}function vr(n,e={}){if(!n)return o.inject(w.PROVIDE_NAME_USAGE_CONTEXT);const t=o.ref(null);return o.provide(w.PROVIDE_NAME_USAGE_CONTEXT,t),{state:t,update:async function(){t.value=await ar(n,_r(e||{}))}}}function _r(n){return typeof n=="function"?n():n}function wr(n){if(!n)return o.inject(w.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),t=o.computed(()=>e.map(s=>Tr(n,s))),r={actions:t,update:i};o.provide(w.PROVIDE_NAME_ACTIONS,r),n.router=ot.useRouter(),n.handleConfirmation||(n.handleConfirmation=Sr),n.handleAffectedEntity||(n.handleAffectedEntity=br),n.handleCloseForm||(n.handleCloseForm=kr),n.handleValidationResult||(n.handleValidationResult=Ar);function i(s={}){return e.splice(0,e.length),St(s).then(u=>e.splice(0,0,...u)).catch(L("error"))}return{actions:t,update:i}}function Tr(n,e){return{...e,label:e.title,callback(){const t=typeof n.values=="function"?n.values(e,n):n.values,r=()=>M(e.url,{method:"POST",body:JSON.stringify({keys:t,contextId:O.contextId}),headers:{"Content-Type":"application/json"}}).then(async i=>{var s,u;if(!Nr(i))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(n.handlers))for await(const a of n.handlers)await a(e,i,n);if(!i.success)throw n.handleValidationResult&&i.validationEffect&&((u=(s=i.validationEffect)==null?void 0:s.results)!=null&&u.length)&&n.handleValidationResult(e,i.validationEffect,n),new Error(i.message);return i.message&&ue.add("info",i.message),Array.isArray(i.affectedEntities)&&n.handleAffectedEntity&&i.affectedEntities.forEach(a=>{var l;return(l=n.handleAffectedEntity)==null?void 0:l.call(n,e,a,n)}),e.closeHostForm&&n.handleCloseForm&&n.handleCloseForm(e,n),i}).catch(L("error"));return e.requireSave&&n.form&&n.form.changed?n.form.save().then(r):!e.confirmation||!n.handleConfirmation?r():n.handleConfirmation(e,r)}}}function Cr(n){const e="Are you sure?";return n===!0||typeof n=="string"&&n.toLowerCase()==="true"||n==="1"?e:typeof n=="string"?n:e}async function Sr(n,e){const t=Cr(n.confirmation);if(!Te.getComponentFromStore(w.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await Te.promptModal(w.MODAL_CONFIRM,{message:t}))return e()}function Ar(n,e){const t=w.MODAL_VALIDATION_EFFECT;if(!Te.getComponentFromStore(t))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{Te.pushModal(t,e)})}function br(n,e,t){var u;const{router:r,form:i}=t,s=(u=e.primaryKey)==null?void 0:u.Id;if(r&&e&&e.name===n.redirectEntity)return r.push({name:e.name,params:{id:s}});i&&e.name===i.name&&e.updated&&s===i.id&&i.read()}function kr(n,e){const{router:t}=e;t&&n.closeHostForm&&t.back()}function Nr(n){return!!(n&&typeof n=="object"&&"affectedEntities"in n&&"success"in n)}function Or(n){function e(t){t.key==="Enter"&&n()}o.onMounted(()=>{document.addEventListener("keypress",e)}),o.onUnmounted(()=>{document.removeEventListener("keypress",e)})}const ue=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=Ir(r),s=new Rr(e,t,i.timeout,i.children,i.click);return this.store.push(s),i.timeout&&setTimeout(this.remove.bind(this,s.id),i.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 Ir(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 At=class bt{constructor(e,t,r,i,s){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=s,this.id=bt.cardId++}};At.cardId=1;let Rr=At;class Lr extends V{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return hr(this.id,e)}static checkAndGenerate(e,t,r){return pr(e,t,r).then(i=>i.length===0?fr(e,t,r):i[0])}}function $r(){return S().emit("client:read",{})}var kt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},Pr=(n,e,t)=>(kt(n,e,"read from private field"),t?t.call(n):e.get(n)),Dr=(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)},xr=(n,e,t,r)=>(kt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ee;const Ie=class X extends V{constructor(){super(...arguments),this.type="front",this.organizations=[],Dr(this,Ee,!1)}set language(e){localStorage.setItem(w.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(w.LOCALSTORAGE_LANGUAGE_KEY)||X.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){xr(this,Ee,e),this.emit(X.EVENT_READY_UPDATE,e)}get ready(){return Pr(this,Ee)}onReady(e){return this.on(X.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(X.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(w.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(X.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.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){L()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(w.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return $r()}validateContextId(e){var t;try{return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};Ee=new WeakMap;Ie.DEFAULT_LANGUAGE="en";Ie.EVENT_CONTEXT_UPDATE="event:context-update";Ie.EVENT_READY_UPDATE="event:ready-update";let Mr=Ie;function Vr(n){return S().emit("metadata:read",{entity:n})}const Ae=function(){const e=o.reactive({}),t=new Map;function r(a){return e[a]}async function i(a){if(t.has(a)&&await t.get(a),e[a])return;const l=await s(a);u(a,l)}function s(a){const l=Vr(a).finally(()=>{t.delete(a)});return t.set(a,l),l}function u(a,l){e[a]=l}return{state:e,initEntity:i,get:r}}();class x{static login(e){return M(D.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:D.applicationName})})}static parseProcessAnswer(e){if(e.statusCode>4)throw new Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return x.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return x.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return x.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return x.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return M(`${D.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)})}static startLoginProcess(e){return x.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return x.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return x.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return M(`${D.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).then(x.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startPasswordReset(e,t){return M(`${D.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:t,AppName:e})})}static confirmPhoneNumberByAccessRecovery(e,t,r,i){return M(`${D.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:t,Prefix:r,Code:i})})}static confirmEmailByAccessRecovery(e,t,r,i){return M(`${D.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:t,Prefix:r,Code:i})})}static finishAccessRecovery(e,t,r){return M(`${D.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:t,Password:r,ConfirmedPassword:r})})}}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 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($.is(t,r)),e)},[]).join(" and ")}function de(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${de(t)}`};$.beginWith=function(e,t){return`@${e} BeginWith ${de(t)}`};$.notEq=function(e,t){return`@${e} nq ${de(t)}`};$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${de(t)}`};$.in=function(e,t){const r=t.map(de).join(", ");return`@${e} in (${r})`};$.and=function(...e){return e.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(t=>`(${t})`).join(" and ")};$.is=function(e,t){return`@${e} is ${t}`};$.or=function(...e){return e.join(" or ")};const O=new Mr;class Fr{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 Me(i,r),M([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function Ur(n,e="images"){return`/static-folder/${e}/${n}`}class jr{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 Q{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Q.url()}/calculator/${e}`)}static calculate(e,t){return y(`/${Q.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]):Y.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(`/${Q.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return y(`/${Q.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}var Nt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},B=(n,e,t)=>(Nt(n,e,"read from private field"),t?t.call(n):e.get(n)),q=(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)=>(Nt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),ve,oe,_e,we,se,ae,Ve;const z="_______LIST_______ROW_______INDEX________NAME_______",Re=class F extends V{constructor(e){super(),this.LIST_ROW_KEY=1,q(this,ve,void 0),this.array=[],q(this,oe,[]),q(this,_e,[]),q(this,we,new Proxy({},{set:(t,r,i,s)=>(t[r]=i,this.emit(F.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(F.EVENT_FILTERS_UPDATE,t),!0)})),q(this,se,!1),q(this,ae,(...t)=>Promise),q(this,Ve,()=>{}),G(this,ve,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&G(this,oe,e.config)}set config(e){G(this,oe,e.map(I.utils.copyObject)),this.emitUpdateConfig()}get config(){return B(this,oe)}emitUpdateConfig(){this.emit(F.EVENT_CONFIG_UPDATE,this.config)}get order(){return B(this,_e)}set order(e){G(this,_e,e),this.emit(F.EVENT_ORDER_UPDATE,this.order)}get filters(){return B(this,we)}set filters(e){qr(B(this,we),e)}set wait(e){G(this,se,e),this.emit(I.Form.EVENT_WAIT,B(this,se))}get wait(){return B(this,se)}get primaryKeys(){return B(this,ve)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[z]===e)}indexByKey(e){return this.array.findIndex(t=>t[z]===e)}static getKey(e){return e[z]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,z)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(F.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(F.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(F.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[z]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,z)}set read(e){G(this,ae,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=B(this,ae).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){G(this,ae,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>B(this,Ve).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,[z]: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=F.getCellName(e),i=(()=>{let s=r?be(t,r):null;return s===void 0&&(s=null),e.value?e.value(s,t):s})();return{name:r,value:i}}};ve=new WeakMap;oe=new WeakMap;_e=new WeakMap;we=new WeakMap;se=new WeakMap;ae=new WeakMap;Ve=new WeakMap;Re.EVENT_DATA="list-data: update";Re.EVENT_CONFIG_UPDATE="list-config:update";Re.EVENT_ORDER_UPDATE="list-order:update";Re.EVENT_FILTERS_UPDATE="list-filters:update";function Wr(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 qr(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Gr(n){const e=o.reactive([]);function t(a){return e.includes(a)}function r(a){t(a)||e.push(a)}function i(a){const l=e.findIndex(d=>d===a);l!==-1&&e.splice(l,1)}function s(a){const l=o.unref(n);if(a===void 0){e.length===0?l.forEach(r):l.forEach(i);return}t(a)?i(a):r(a)}const u=o.computed(()=>{const a=o.unref(n);return e.length===a.length&&a.length!==0});return[e,s,u,r,i]}function zr(n){return n.statusName==="Completed"}function Kr(n){return n.statusName==="FinalStepWithConfirmation"}function Yr(n){return n.statusName==="ValidationError"}function Jr(n,e,t){let r=null;const i=o.reactive({wait:null});let s=[],u=null;const a=o.ref(null);function l(){a.value=s.find(c=>c.name===u)||null}function d(){var c;return u?((c=s.find(f=>f.name===u))==null?void 0:c.fields)||[]:[]}function h(c){if(l(),Yr(c))return void t.onValidation(c.validationResults);if((c.statusName==="FinalStep"||c.statusName==="NextStep")&&(!d().length||Hr(d(),t.presets)))return p(t.presets||{});zr(c)&&t.onCompleted(c),Kr(c)&&t.onConfirmation(c)}async function T(){try{await R(),await E()}catch(c){const{message:f}=Ce(c);ue.add("error",f)}}function R(){return i.wait="Loading process information.",me.getStartConfig(e,n).then(c=>{s=c.steps.map(f=>({label:f.title,name:f.stepName,number:f.number,fields:f.frontendEntity.objectTypes.reduce((g,A)=>(A.properties.forEach(b=>{g.push({name:b.name,label:b.title,type:b.refEntityName||b.dataType})}),g),[])}))}).then(c=>(i.wait=!1,c))}function _(c){return u=c.nextStepName,r=c.token,c}function m(c){const f=Ce(c);ue.add("error",f.message)}function E(){return i.wait="Starting process",me.startProcess(e,n).then(_).then(h).catch(m).finally(()=>{i.wait=null})}function p(c={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Waiting for result...",me.runStep(e,n,u,r,c).then(_).then(h).catch(m).finally(()=>{i.wait=!1}))}return{initialize:T,state:i,currentStepConfig:o.readonly(a),next:p}}function Hr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!I.utils.getPropFromObject(e,r.name))return!1}return!0}const Xr="close-api/proxy/Equipment/Search";class Qr{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 a=`/${Xr}?${u.toString()}`;return y(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Zr={clickOutside:ke,staticLink:Ur},ei={usage:$t,utils:Wt,types:qt};exports.Communication=Lr;exports.CoreError=Y;exports.Filter=$;exports.Manager=O;exports.MetadataStore=Ae;exports.NotificationSystem=ue;exports.WidgetButton=En;exports.WidgetIcon=le;exports.WidgetImage=On;exports.WidgetList=jn;exports.WidgetLoader=kn;exports.WidgetMultiButton=Sn;exports.WidgetSpinner=Oe;exports.WidgetTable=hn;exports.actionService=Fr;exports.asyncProcess=qn;exports.authService=x;exports.billingService=Q;exports.catchUniversal=L;exports.clickOutside=ke;exports.clientService=lt;exports.communicationService=Qt;exports.config=Wn;exports.configuration=D;exports.constants=w;exports.dataService=ce;exports.debounce=Hn;exports.default=ei;exports.documentsService=jr;exports.equipmentService=Qr;exports.fileService=Zt;exports.getCellName=yt;exports.getCellValue=mt;exports.getNamesFromListConfig=zn;exports.groupArrayByField=Kn;exports.historyService=Gt;exports.injectAction=cr;exports.internationalizationService=zt;exports.invitationService=en;exports.openService=tn;exports.parseError=Ce;exports.prettyDate=We;exports.prettyDateWithTime=Et;exports.prettyMoney=_t;exports.prettyValueFieldByEntity=Zn;exports.processWizardService=me;exports.request=M;exports.ruleValidationService=Ue;exports.t=Z;exports.throttle=Xn;exports.universalEntityCreate=Tt;exports.universalEntityDelete=Ct;exports.universalEntityRead=Se;exports.universalEntityUpdate=qe;exports.universalListSettingRead=or;exports.universalMetadataFieldTreat=sr;exports.universalToolRead=St;exports.useActions=wr;exports.useCommunication=yr;exports.useEnter=Or;exports.useFormEntity=mr;exports.useListActiveRow=lr;exports.useListEntity=ur;exports.useListSearch=Wr;exports.useListSelect=Gr;exports.useLogger=Yt;exports.useManagerState=dr;exports.useMetadata=Er;exports.useSocket=S;exports.useUsageContext=vr;exports.useWizard=Jr;exports.utils=Zr;exports.uuidv4=Yn;exports.valuesToUpperCase=Ge;
|
|
10
|
+
*/const Je=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},He=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},Xe=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 V{constructor(){this.events={}}on(e,t){return Je.call(this,e,t)}emit(e,t){return He.call(this,e,t)}off(e,t){return Xe.call(this,e,t)}cleanEvents(){Qe.call(this)}static on(e,t){return Je.call(V,e,t)}static emit(e,t){return He.call(V,e,t)}static off(e,t){return Xe.call(V,e,t)}static cleanEvents(){Qe.call(V)}}V.events={};var ft=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},pe=(n,e,t)=>(ft(n,e,"read from private field"),t?t.call(n):e.get(n)),Pe=(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)},De=(n,e,t,r)=>(ft(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),re,he,ge;const J=class N extends V{constructor(){super(...arguments),Pe(this,re,void 0),Pe(this,he,"front"),this.organizations=[],Pe(this,ge,!1)}set language(e){localStorage.setItem(N.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(N.LOCALSTORAGE_LANGUAGE_KEY)||N.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(N.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){De(this,re,e)}get router(){if(!pe(this,re))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return pe(this,re)}set type(e){De(this,he,e)}get type(){return pe(this,he)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){De(this,ge,e),this.emit(N.EVENT_READY_UPDATE,e)}get ready(){return pe(this,ge)}onReady(e){return this.on(N.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(N.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(N.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(N.CURRENT_CONTEXT_KEY,String(e)),this.emit(N.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(N.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{Dt.add("error",Y.ApiNotAvailable().message)}}loadCustomerData(){return lt.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))}};re=new WeakMap;he=new WeakMap;ge=new WeakMap;J.DEFAULT_LANGUAGE="en";J.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";J.EVENT_CONTEXT_UPDATE="event:context-update";J.EVENT_READY_UPDATE="event:ready-update";J.EVENT_DATA_UPDATE="event:data-update";J.CURRENT_CONTEXT_KEY="CurrentContext";let Mt=J;const Ze=new Mt;function Vt(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Pt}})}function y(n,e={}){return Ze.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=Ze.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw Y.ApiNotAvailable()}).then(t=>Vt(t).then(r=>{if(!t.ok)throw r;return r}))}class Ne{constructor(){}static parseNamesFromListConfig(e){let t=Ne.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),a=i.substring(0,s);a in r||(r[a]={}),t(r[a],u)}else r[i]=!0;return r}return e.reduce(t,{})}}class Bt{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 Ft=new Bt;function pt(n){return n&&n[0].toLowerCase()+n.slice(1)}function Fe(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=Fe(r)),e[i]=r,e},{})}function Ut(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 jt={Request:y,clickOutside:ke,getPropFromObject:be,runPromiseQueue:at,GraphQL:Ne,firstChapterToLowerCase:pt,valuesToUpperCase:Fe,prettyMoney:Ut},Wt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Ne,Journal:Ft,Request:y,clickOutside:ke,default:jt,firstChapterToLowerCase:pt,getPropFromObject:be,runPromiseQueue:at,valuesToUpperCase:Fe},Symbol.toStringTag,{value:"Module"})),qt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Gt{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(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...s,changes:u}});return{...r,history:i}})}}class zt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return y(`/open-api/internationalization/language/${e}`)}}let K={};function Z(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=I.utils.getPropFromObject((this==null?void 0:this.vocabulary)||K,n);if(typeof t=="string")return et(t,e);const r=I.utils.getPropFromObject(K==null?void 0:K.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}Z.setGlobalVocabulary=function(n){K=n};Z.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),Z.bind({vocabulary:I.utils.getPropFromObject(K,e.toLowerCase())})};Z.setVocabulary=function(n){return typeof n=="string"&&(n=I.utils.getPropFromObject(K,n)),Z.bind({vocabulary:n})};const Kt=function(){let n=!1;const e=[];function t(){return n}function r(l,d){t()&&console[l](...d),e.push(d)}function i(...l){r("log",l)}function s(...l){r("warn",l)}function u(...l){r("error",l)}function a(l=!0){n=l}return{info:i,warn:s,history:e,display:a,error:u}}();function Yt(){return Kt}function Jt(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Ht="masterId",Xt="masterEntity";function Me(n,e){if(!Array.isArray(e))return;if(Jt(e))return t(e);e.forEach(t);function t(r){n.append(Xt,r[0]),n.append(Ht,r[1].toString())}}class ce{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(([a,l="desc"])=>`@${a} ${l}`).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=ce.getSearchParamsForEntityListRead(t||{});return await y(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=ce.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 Me(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 Me(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 ce.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 ht=class ie{static async create(e){return y(ie.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(ie.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return y(`${ie.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return y(`${ie.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};ht.url="/close-api/communications";let Qt=ht;function tt(n){return{...n,createdEntities:n.createdEntites}}const gt=class ye{static async getStartConfig(e,t){return y([ye.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return y([ye.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(tt)}static async runStep(e,t,r,i,s){return y([ye.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(tt)}};gt.url="/close-api/views/process-wizard";let me=gt;class Zt{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 en{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 Ue{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return y(Ue.url+e,{method:"POST",body:JSON.stringify(t)})}}class tn{static getConfiguration(){return y("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}const nn={class:"widget-table__head"},rn={class:"widget-table__head-label margin_0 text_overflow"},on=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",nn,[(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",rn,o.toDisplayString(r.label),1)]))),128))]))}});const U=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},sn=U(on,[["__scopeId","data-v-b3ed6089"]]);function yt(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function mt(n,e){const t=yt(n);let r=t?I.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):n.value===null?null:r}function je(n){return["eservices-core",n].join(":")}function Et(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 Ot.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const an={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}`})}},le=U(an,[["__scopeId","data-v-0eae75d4"]]),cn=Be(je("setup-list-row"));function ln(n,e){const t=n.config.map(r=>un(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function un(n,e,t){const r=e.values;let i=mt(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(h){s.onClick.push(()=>h(r))}function a(h){Array.isArray(h)?s.class.push(...h):s.class.push(h)}const l=[],d=[];if(n.hide&&n.hide(r))return[o.h("td")];if(n.type)switch(a(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=We(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Et(typeof i=="string"?i:null);break}case"money":{i=_t(i);break}case"multi-select":{d.push(o.h(I.FormField,{type:"single-checkbox",modelValue:e.selected})),u(nt.bind(null,t,!0));break}case"select":{d.push(o.h(I.FormField,{type:"single-radio",modelValue:e.selected})),u(nt.bind(null,t,!1));break}}if(n.onClick&&u(n.onClick),n.link)try{const h=n.link(r);if(h){const T=o.h(ot.RouterLink,{to:h});d.push(T),a("widget-table-cell_link")}}catch(h){cn("Can't add router link",h)}if(n.href&&(d.push(o.h("a",{href:n.href(r),target:"_blank"})),a("widget-table-cell_link")),typeof i=="boolean"&&(i=i?"✓":"—"),(typeof i=="string"||typeof i=="number")&&d.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&(typeof n.icon=="string"&&d.push(o.h(le,{name:n.icon})),typeof n.icon=="function")){const h=n.icon(r);h!==null&&d.push(o.h(le,{name:h}))}return n.class&&(typeof n.class=="function"?a(n.class(r)):a(n.class)),l.push(o.h("td",s,d)),l}function nt(n,e){n.emit("select",e)}function vt(n,e){return()=>{try{return ln(n,e)}catch(t){return console.warn(t),null}}}const dn={props:{values:Object,config:Object,selected:Boolean},setup:vt},fn=["colspan"],rt=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,fn)],512))}}),w={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",TIME_TO_LIVE_SOCKET_REQUEST:3e4},pn={class:"widget-table"},it="update:selectedRows",hn=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 a;return(a=r==null?void 0:r.default)==null?void 0:a.call(r)[0]});function s(a,l=!0){if(!t.selectedRows)return;if(!l)return e(it,t.selectedRows.includes(a)?[]:[a]);const d=[...t.selectedRows],h=d.indexOf(a);return h===-1?d.push(a):d.splice(h,1),e(it,d)}function u(a){e("save",a),e("update:activeRow",null)}return(a,l)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",pn,[o.createVNode(sn,{config:a.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(d,h)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:h},[o.createVNode(dn,{config:a.config,values:d,selected:a.selectedRows.includes(d),onSelect:T=>s(d,T),class:o.normalizeClass(a.classCallback?a.classCallback(d):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&a.activeRow===d?(o.openBlock(),o.createBlock(rt,{key:0,component:i.value,"row-length":a.config.length,values:d,onClose:l[0]||(l[0]=T=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),a.activeRow===o.unref(w).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(rt,{key:0,component:i.value,"row-length":a.config.length,onClose:l[1]||(l[1]=d=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),gn=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))}});const Oe=U(gn,[["__scopeId","data-v-0ae13719"]]),yn={class:"widget-button"},mn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",yn,[e.wait?(o.openBlock(),o.createBlock(Oe,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const En=U(mn,[["__scopeId","data-v-76d0d8eb"]]),vn={class:"widget-multi-button-wrap position_relative cursor_pointer"},_n={class:"widget-multi-button-body grid"},wn=["onClick"],Tn={class:"widget-multi-button-side-wrap"},Cn=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(u=>({"8e9f9746":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,a)=>(o.openBlock(),o.createElementBlock("div",vn,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",_n,[u.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:a[0]||(a[0]=l=>s())},o.toDisplayString(u.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(l,d)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:d,onClick:h=>{i(l.callback),s(!1)}},o.toDisplayString(l.label),9,wn))),128))]),o.createElementVNode("div",Tn,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:a[1]||(a[1]=l=>s())},[t.wait?(o.openBlock(),o.createBlock(o.unref(Oe),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(le),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}});const Sn=U(Cn,[["__scopeId","data-v-2034ac0b"]]),An={class:"widget-loader flex flex-align_center gap_10 padding_15"},bn={class:"text_md"},kn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",An,[o.createVNode(Oe,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",bn,o.toDisplayString(e.label),1)]))}}),Nn=["alt","src"],On=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,Nn))}}),In={props:{config:Array,values:Object,selected:Boolean},setup:vt};const Rn=U(In,[["__scopeId","data-v-aa0613cb"]]),Ln=n=>(o.pushScopeId("data-v-85ce2e65"),n=n(),o.popScopeId(),n),$n={class:"widget-list-head-cell"},Pn=Ln(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Dn=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",$n,[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(I.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(le),{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),Pn])]))}});const xn=U(Dn,[["__scopeId","data-v-85ce2e65"]]),Mn=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 l(_,m){let E=-1;do E++,m-=_[E];while(m>0&&E<_.length);return E}function d(_,m){let E=0;for(;m>0&&m>_[E]&&E<_.length;)m-=_[E],E++;return console.log(m,E),E>0?E:0}function h(_){try{i.value.style.insetInlineStart=_+"px"}catch(m){console.log(m)}}function T(_){try{i.value.style.width=_+"px",i.value.style.minWidth=_+"px",i.value.style.maxWidth=_+"px"}catch(m){console.log(m)}}function R(_){return _===null?!1:_.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(m){var Ye;function E(k){return k.screenX+f-b}const p=r.value,c=[...p.children].filter(k=>k.localName==="th"),f=((Ye=p.offsetParent)==null?void 0:Ye.scrollLeft)||0,g=c.map(k=>k.clientWidth),A=R(m.target),b=p.getBoundingClientRect().left,H=E(m),C=l(g,H),j=g.slice(0,C).reduce((k,P)=>k+P,0),ee=H-j,Le=p.offsetWidth,te=c[C].clientWidth;if(t.config[C].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",m.screenX),console.log("Widths",g),console.log("max width",Le),console.log("Start Position",H),console.log("Position From",C),console.log("Start Position",C),console.log("Global offset (Отступ самой таблицы от края экрана)",b),console.log("Del",ee),console.groupEnd(),i.value.innerText=c[C].textContent||"",i.value.style.display="grid",i.value.style.width=te+"px",i.value.style.cursor="grabbing",h(j),T(te),document.addEventListener("pointermove",Ke,{passive:!0}),document.addEventListener("pointerup",ze);function ze(k){if(console.group("END"),document.removeEventListener("pointermove",Ke),document.removeEventListener("pointerup",ze),A&&(t.config[C].width=i.value.style.width,t.config[C].minWidth=i.value.style.width,t.config[C].maxWidth=i.value.style.width,s(t.config)),!A){const P=k.screenX+f-b;console.log("ENP Position",P);const fe=d(g,P);if(console.log(C,"->",fe),fe!==C){const ne=t.config[C],$e=t.config;$e.splice(C,1),$e.splice(fe,0,ne),s($e)}else{const ne=t.config[C].name;u(ne)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Ke(k){if(A){const ne=E(k)-H+te;T(ne);return}let P=k.screenX+f-b-ee;P<0&&(P=0),P+te>Le&&(P=Le-te),h(P)}})});function s(l){e("update:config",l)}function u(l){if(!l)return;if(Array.isArray(l)){if(l.length<1)return;l=l[0]}if(t.order.length===0||t.order[0]!==l)return void a([l]);const d=t.order.length===1||t.order[1]==="asc"?"asc":"desc";a([l,d==="asc"?"desc":"asc"])}function a(l){e("update:order",l)}return(l,d)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.config,(h,T)=>(o.openBlock(),o.createBlock(xn,o.mergeProps({key:h},h,{onOrder:R=>u(h.name),onSelect:d[0]||(d[0]=R=>e("select")),order:l.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}});const Vn=U(Mn,[["__scopeId","data-v-6173c14c"]]),Bn={class:"widget-list"},Fn={class:"widget-list-body position_relative"},Un=50,jn=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(a,l=!0){if(t.selectedRows)if(!l)s(t.selectedRows.includes(a)?[]:[a]);else{const d=[...t.selectedRows],h=d.indexOf(a);h===-1?d.push(a):d==null||d.splice(h,1),s(d)}}function i(){var a;if(((a=t.selectedRows)==null?void 0:a.length)!==t.array.length)return s([...t.array]);s([])}function s(a){e("update:selectedRows",a)}function u(a){if(!a)return;const l=a.target;l.scrollTop+l.clientHeight+Un>l.scrollHeight&&e("scrollEnd")}return(a,l)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[o.createElementVNode("table",Bn,[o.createElementVNode("thead",null,[o.createVNode(Vn,{onSelect:l[0]||(l[0]=d=>i()),"onUpdate:order":l[1]||(l[1]=d=>e("update:order",d)),"onUpdate:config":l[2]||(l[2]=d=>e("update:config",d)),config:a.config,order:a.order},null,8,["config","order"])]),o.createElementVNode("tbody",Fn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(d,h)=>{var T;return o.openBlock(),o.createBlock(Rn,{key:h,class:"widget-list-row",values:d,config:a.config,selected:(T=a.selectedRows)==null?void 0:T.includes(d),onSelect:R=>r(d,R)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),D={};function Wn(n){for(let e in n)D[e]=n[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function qn(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 Ce(n){return typeof n=="string"?xe(n):Gn(n)?xe(n.message):xe(w.DEFAULT_ERROR_MESSAGE)}function Gn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function xe(n){return{message:n}}function L(n="error"){return function(e){const{message:t}=Ce(e);ue.add(n,t)}}function Se(n,e={}){return S().emit("entity:read",{...e,entity:n})}function qe(n,e){return S().emit("entity:update",{...e,entity:n})}function zn(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function _t(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 Ge(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=Ge(r)),e[i]=r,e},{})}function Kn(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 Yn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Jn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return w.DEFAULT_ERROR_MESSAGE}})}function M(n,e={}){return O.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=O.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw new Error(w.DEFAULT_ERROR_MESSAGE)}).then(t=>Jn(t).then(r=>{if(!t.ok)throw r;return r}))}function Hn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Xn(n,e){let t=!1;return(...r)=>{if(!t)return t=!0,setTimeout(()=>t=!1,e),n(...r)}}const Qn=Be(je("pretty-value-field-by-entity"));function Zn(n,e,t){try{const r=Ae.get(n);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${n} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch(r){return Qn('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,n,e,t),t}}const er=1,tr=5e3,W=Be(je("use-socket"));function S(){return rr}function nr(n){return typeof n=="object"&&Object.prototype.toString.call(n)==="[object Blob]"}const rr=function(){let n=1,e,t;const r=new Set;let i=0;const s=new Set;function u(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},tr*2);const c=new Uint8Array(1);c[0]=er,e.send(c)}setInterval(()=>{Array.from(r).forEach(c=>{p(c)&&(W("Handler for event %s requestId %d was expired",c.event,c.requestId),c.requestId?l({requestId:c.requestId,event:"request-error",data:{message:Y.RequestTookToLong().message}}):r.delete(c))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&d()},w.DELAY_SOCKET_RECONNECT);function a(){return{safeQueue:s,requestId:n,handlers:r,socketInstance:e}}function l(c){const f=[...r.values()];W("Handlers array length is %d. Response event: %s. Request id: %d",r.size,c.event,c.requestId),f.forEach(g=>{const A=c.requestId;(g.requestId&&g.requestId===A||!g.requestId&&g.event===c.event)&&(W("Find appropriated handler: %d, event: %s",n,g.event),g.callback(c.data,c),g.once&&(r.delete(g),W("Handler was removed by *once* params was passed. %o",g)))})}function d(){if(typeof t!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${t}`,"color: purple","color: black"),e=new WebSocket(t),e.onclose=function(c){W("Connection to server was stopped: %d %s",c.code,c.reason),Array.from(r).forEach(f=>{f.guaranteedAnswer&&f.serializeString&&s.add(f.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(c=>{h(c),s.delete(c)})},e.onerror=function(c){console.warn(c)},e.onmessage=c=>{var f;try{if(nr(c.data)){u();return}const g=JSON.parse(c.data);if(!wt(g)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(g);return}(f=g==null?void 0:g.data)!=null&&f.refresh&&location.reload(),l(g)}catch(g){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(g)}}}function h(c){e.send(c)}function T(c,f){E({event:c,callback:f})}function R(c,f){E({event:c,callback:f,once:!0})}function _(){return e&&(e==null?void 0:e.readyState)===1}function m(c,f,g){const A=++n,b=JSON.stringify({requestId:A,event:c,data:f,contextId:O.contextId,url:window.location.href});return _()?h(b):(s.add(b),W("Socket is not connected. Message was send to save-queue")),new Promise((H,C)=>{E({event:c,requestId:A,once:!0,guaranteedAnswer:!0,serializeString:b,callback:(j,ee)=>{if(W("Promise was resolve with next data:",j),ir(ee))return void C(j);g&&g(j,ee),H(j)},timeToLive:w.TIME_TO_LIVE_SOCKET_REQUEST})})}function E(c){const f={timeToLive:0,...c,created:new Date().getTime()};r.add(f)}function p(c){return c.timeToLive===0||typeof c.timeToLive!="number"?!1:new Date().getTime()-c.created>c.timeToLive}return{get socket(){return e},on:T,once:R,emit:m,initialization(c){t=c},getDevInfo:a}}(),ir=n=>!!wt(n)&&n.event==="request-error",wt=n=>typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function or(n,e){return S().emit("list-setting:read",{entity:n,mark:e})}function sr(n,e){return S().emit("metadata-field:treat",{entity:n,fieldName:e})}function Tt(n,e){return S().emit("entity:create",{...e,entity:n})}function Ct(n,e){return S().emit("entity:delete",{...e,entity:n})}function ar(n,e){return S().emit("usage-context:read",{...e,entity:n})}function St(n={}){return S().emit("tool:read",n)}function cr(n,e={},t={}){const r=o.inject(w.PROVIDE_NAME_ACTIONS,null),i=typeof n=="string"?n:e,s=typeof e=="string"?t:e;return o.computed(()=>{var l;const a=((typeof n=="string"?(l=r==null?void 0:r.actions)==null?void 0:l.value:o.unref(n))||[]).find(d=>d.name===i);return a?{...a,...s}:null})}function lr(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}function ur(n,e,t={}){const r=o.reactive([]);let i=0;const s=o.ref(!1);function u(){if(s.value)return Promise.reject("The process has already started.");const p=m();return s.value=!0,typeof p.limit!="number"&&(p.limit=100),p.offset=i,(t.request||Se)(n,p).then(f=>(i+=f.length,f)).finally(()=>{s.value=!1})}function a(p,c){var g;return typeof p.Version=="number"?p.Version:(g=r.find(A=>A.Id===c))==null?void 0:g.Version}function l(p,c){const f=r.findIndex(g=>g.Id===p);if(f===-1)throw new Error(`Can't found item with Id ${p}`);r.splice(f,1,c)}function d(p){const c=r.findIndex(f=>f.Id===p);if(c===-1)throw new Error(`Can't found item with Id ${p}`);r.splice(c,1)}async function h(p,c){try{const f=m(),g=a(c,p);delete c.Version,await qe(n,{id:p,values:c,version:g});const A=await Se(n,{fields:f.fields||"",id:p});l(p,A)}catch(f){L()(f)}}async function T(p,c){try{const f=m(),g=a(c,p);delete c.Version,await Ct(n,{id:p,version:g}),d(p)}catch(f){L()(f)}}async function R(p){try{await Tt(n,{values:p}),await E()}catch(c){L()(c)}}async function _(){try{const p=await u();r.push(...p)}catch(p){L()(p)}}function m(){return typeof e=="function"?e():e}async function E(){try{i=0;const p=await u();r.splice(0,r.length,...p)}catch(p){L()(p)}}return{array:r,updateById:h,next:_,reload:E,wait:s,create:R,deleteById:T}}function dr(){function n(){return{organizations:O.organizations,currentContextId:O.contextId,person:O.person,context:O.context,contextType:O.contextType,userId:O.userId}}const e=o.reactive(n());return O.onupdateContext(()=>{Object.assign(e,n())}),e}function fr(n,e,t){return S().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function pr(n,e,t){return S().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function hr(n,e){return S().emit("communication-message:create",{communicationId:n,text:e})}function gr(n){return S().emit("communication-message:read",{communicationId:n})}function yr(n){const e=I.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>gr(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function mr(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw Y.EntityWithoutName(n);return Se(n.name,r)}).then(Ge).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(L())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw Y.EntityWithoutName(n);return qe(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw L()(i),i})};function t(){return typeof e=="function"?e():e}}function Er(n){if(!n)return o.inject(w.PROVIDE_NAME_METADATA);Ae.initEntity(n);const e=o.computed(()=>Ae.state[n]);return o.provide(w.PROVIDE_NAME_METADATA,e),e}function vr(n,e={}){if(!n)return o.inject(w.PROVIDE_NAME_USAGE_CONTEXT);const t=o.ref(null);return o.provide(w.PROVIDE_NAME_USAGE_CONTEXT,t),{state:t,update:async function(){t.value=await ar(n,_r(e||{}))}}}function _r(n){return typeof n=="function"?n():n}function wr(n){if(!n)return o.inject(w.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),t=o.computed(()=>e.map(s=>Tr(n,s))),r={actions:t,update:i};o.provide(w.PROVIDE_NAME_ACTIONS,r),n.router=ot.useRouter(),n.handleConfirmation||(n.handleConfirmation=Sr),n.handleAffectedEntity||(n.handleAffectedEntity=br),n.handleCloseForm||(n.handleCloseForm=kr),n.handleValidationResult||(n.handleValidationResult=Ar);function i(s={}){return e.splice(0,e.length),St(s).then(u=>e.splice(0,0,...u)).catch(L("error"))}return{actions:t,update:i}}function Tr(n,e){return{...e,label:e.title,callback(){const t=typeof n.values=="function"?n.values(e,n):n.values,r=()=>M(e.url,{method:"POST",body:JSON.stringify({keys:t,contextId:O.contextId}),headers:{"Content-Type":"application/json"}}).then(async i=>{var s,u;if(!Nr(i))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(n.handlers))for await(const a of n.handlers)await a(e,i,n);if(!i.success)throw n.handleValidationResult&&i.validationEffect&&((u=(s=i.validationEffect)==null?void 0:s.results)!=null&&u.length)&&n.handleValidationResult(e,i.validationEffect,n),new Error(i.message);return i.message&&ue.add("info",i.message),Array.isArray(i.affectedEntities)&&n.handleAffectedEntity&&i.affectedEntities.forEach(a=>{var l;return(l=n.handleAffectedEntity)==null?void 0:l.call(n,e,a,n)}),e.closeHostForm&&n.handleCloseForm&&n.handleCloseForm(e,n),i}).catch(L("error"));return e.requireSave&&n.form&&n.form.changed?n.form.save().then(r):!e.confirmation||!n.handleConfirmation?r():n.handleConfirmation(e,r)}}}function Cr(n){const e="Are you sure?";return n===!0||typeof n=="string"&&n.toLowerCase()==="true"||n==="1"?e:typeof n=="string"?n:e}async function Sr(n,e){const t=Cr(n.confirmation);if(!Te.getComponentFromStore(w.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await Te.promptModal(w.MODAL_CONFIRM,{message:t}))return e()}function Ar(n,e){const t=w.MODAL_VALIDATION_EFFECT;if(!Te.getComponentFromStore(t))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{Te.pushModal(t,e)})}function br(n,e,t){var u;const{router:r,form:i}=t,s=(u=e.primaryKey)==null?void 0:u.Id;if(r&&e&&e.name===n.redirectEntity)return r.push({name:e.name,params:{id:s}});i&&e.name===i.name&&e.updated&&s===i.id&&i.read()}function kr(n,e){const{router:t}=e;t&&n.closeHostForm&&t.back()}function Nr(n){return!!(n&&typeof n=="object"&&"affectedEntities"in n&&"success"in n)}function Or(n){function e(t){t.key==="Enter"&&n()}o.onMounted(()=>{document.addEventListener("keypress",e)}),o.onUnmounted(()=>{document.removeEventListener("keypress",e)})}function Ir(n){const e=o.reactive([]),t=a=>{const l=o.unref(n);if(a===void 0){e.length===0?l.forEach(i):l.forEach(s);return}r(a)?s(a):i(a)},r=a=>e.includes(a),i=a=>{r(a)||e.push(a)},s=a=>{const l=e.findIndex(d=>d===a);l!==-1&&e.splice(l,1)},u=o.computed(()=>{const a=o.unref(n);return e.length===a.length&&a.length!==0});return[e,t,u,i,s]}const ue=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),i.timeout&&setTimeout(this.remove.bind(this,s.id),i.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 At=class bt{constructor(e,t,r,i,s){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=s,this.id=bt.cardId++}};At.cardId=1;let Lr=At;class $r extends V{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return hr(this.id,e)}static checkAndGenerate(e,t,r){return pr(e,t,r).then(i=>i.length===0?fr(e,t,r):i[0])}}function Pr(){return S().emit("client:read",{})}var kt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},Dr=(n,e,t)=>(kt(n,e,"read from private field"),t?t.call(n):e.get(n)),xr=(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)},Mr=(n,e,t,r)=>(kt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ee;const Ie=class X extends V{constructor(){super(...arguments),this.type="front",this.organizations=[],xr(this,Ee,!1)}set language(e){localStorage.setItem(w.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(w.LOCALSTORAGE_LANGUAGE_KEY)||X.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Mr(this,Ee,e),this.emit(X.EVENT_READY_UPDATE,e)}get ready(){return Dr(this,Ee)}onReady(e){return this.on(X.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(X.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(w.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(X.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.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){L()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(w.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Pr()}validateContextId(e){var t;try{return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};Ee=new WeakMap;Ie.DEFAULT_LANGUAGE="en";Ie.EVENT_CONTEXT_UPDATE="event:context-update";Ie.EVENT_READY_UPDATE="event:ready-update";let Vr=Ie;function Br(n){return S().emit("metadata:read",{entity:n})}const Ae=function(){const e=o.reactive({}),t=new Map;function r(a){return e[a]}async function i(a){if(t.has(a)&&await t.get(a),e[a])return;const l=await s(a);u(a,l)}function s(a){const l=Br(a).finally(()=>{t.delete(a)});return t.set(a,l),l}function u(a,l){e[a]=l}return{state:e,initEntity:i,get:r}}();class x{static login(e){return M(D.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:D.applicationName})})}static parseProcessAnswer(e){if(e.statusCode>4)throw new Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return x.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return x.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return x.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return x.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return M(`${D.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)})}static startLoginProcess(e){return x.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return x.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return x.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return M(`${D.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).then(x.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startPasswordReset(e,t){return M(`${D.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:t,AppName:e})})}static confirmPhoneNumberByAccessRecovery(e,t,r,i){return M(`${D.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:t,Prefix:r,Code:i})})}static confirmEmailByAccessRecovery(e,t,r,i){return M(`${D.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:t,Prefix:r,Code:i})})}static finishAccessRecovery(e,t,r){return M(`${D.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:t,Password:r,ConfirmedPassword:r})})}}function Fr(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function $(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(Fr(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($.is(t,r)),e)},[]).join(" and ")}function de(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${de(t)}`};$.beginWith=function(e,t){return`@${e} BeginWith ${de(t)}`};$.notEq=function(e,t){return`@${e} nq ${de(t)}`};$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${de(t)}`};$.in=function(e,t){const r=t.map(de).join(", ");return`@${e} in (${r})`};$.and=function(...e){return e.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(t=>`(${t})`).join(" and ")};$.is=function(e,t){return`@${e} is ${t}`};$.or=function(...e){return e.join(" or ")};const O=new Vr;class Ur{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 Me(i,r),M([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function jr(n,e="images"){return`/static-folder/${e}/${n}`}class Wr{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 Q{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Q.url()}/calculator/${e}`)}static calculate(e,t){return y(`/${Q.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]):Y.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(`/${Q.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return y(`/${Q.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}var Nt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},B=(n,e,t)=>(Nt(n,e,"read from private field"),t?t.call(n):e.get(n)),q=(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)=>(Nt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),ve,oe,_e,we,se,ae,Ve;const z="_______LIST_______ROW_______INDEX________NAME_______",Re=class F extends V{constructor(e){super(),this.LIST_ROW_KEY=1,q(this,ve,void 0),this.array=[],q(this,oe,[]),q(this,_e,[]),q(this,we,new Proxy({},{set:(t,r,i,s)=>(t[r]=i,this.emit(F.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(F.EVENT_FILTERS_UPDATE,t),!0)})),q(this,se,!1),q(this,ae,(...t)=>Promise),q(this,Ve,()=>{}),G(this,ve,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&G(this,oe,e.config)}set config(e){G(this,oe,e.map(I.utils.copyObject)),this.emitUpdateConfig()}get config(){return B(this,oe)}emitUpdateConfig(){this.emit(F.EVENT_CONFIG_UPDATE,this.config)}get order(){return B(this,_e)}set order(e){G(this,_e,e),this.emit(F.EVENT_ORDER_UPDATE,this.order)}get filters(){return B(this,we)}set filters(e){Gr(B(this,we),e)}set wait(e){G(this,se,e),this.emit(I.Form.EVENT_WAIT,B(this,se))}get wait(){return B(this,se)}get primaryKeys(){return B(this,ve)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[z]===e)}indexByKey(e){return this.array.findIndex(t=>t[z]===e)}static getKey(e){return e[z]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,z)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(F.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(F.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(F.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[z]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,z)}set read(e){G(this,ae,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=B(this,ae).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){G(this,ae,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>B(this,Ve).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,[z]: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=F.getCellName(e),i=(()=>{let s=r?be(t,r):null;return s===void 0&&(s=null),e.value?e.value(s,t):s})();return{name:r,value:i}}};ve=new WeakMap;oe=new WeakMap;_e=new WeakMap;we=new WeakMap;se=new WeakMap;ae=new WeakMap;Ve=new WeakMap;Re.EVENT_DATA="list-data: update";Re.EVENT_CONFIG_UPDATE="list-config:update";Re.EVENT_ORDER_UPDATE="list-order:update";Re.EVENT_FILTERS_UPDATE="list-filters:update";function qr(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 Gr(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function zr(n){return n.statusName==="Completed"}function Kr(n){return n.statusName==="FinalStepWithConfirmation"}function Yr(n){return n.statusName==="ValidationError"}function Jr(n,e,t){let r=null;const i=o.reactive({wait:null});let s=[],u=null;const a=o.ref(null);function l(){a.value=s.find(c=>c.name===u)||null}function d(){var c;return u?((c=s.find(f=>f.name===u))==null?void 0:c.fields)||[]:[]}function h(c){if(l(),Yr(c))return void t.onValidation(c.validationResults);if((c.statusName==="FinalStep"||c.statusName==="NextStep")&&(!d().length||Hr(d(),t.presets)))return p(t.presets||{});zr(c)&&t.onCompleted(c),Kr(c)&&t.onConfirmation(c)}async function T(){try{await R(),await E()}catch(c){const{message:f}=Ce(c);ue.add("error",f)}}function R(){return i.wait="Loading process information.",me.getStartConfig(e,n).then(c=>{s=c.steps.map(f=>({label:f.title,name:f.stepName,number:f.number,fields:f.frontendEntity.objectTypes.reduce((g,A)=>(A.properties.forEach(b=>{g.push({name:b.name,label:b.title,type:b.refEntityName||b.dataType})}),g),[])}))}).then(c=>(i.wait=!1,c))}function _(c){return u=c.nextStepName,r=c.token,c}function m(c){const f=Ce(c);ue.add("error",f.message)}function E(){return i.wait="Starting process",me.startProcess(e,n).then(_).then(h).catch(m).finally(()=>{i.wait=null})}function p(c={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Waiting for result...",me.runStep(e,n,u,r,c).then(_).then(h).catch(m).finally(()=>{i.wait=!1}))}return{initialize:T,state:i,currentStepConfig:o.readonly(a),next:p}}function Hr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!I.utils.getPropFromObject(e,r.name))return!1}return!0}const Xr="close-api/proxy/Equipment/Search";class Qr{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 a=`/${Xr}?${u.toString()}`;return y(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Zr={clickOutside:ke,staticLink:jr},ei={usage:$t,utils:Wt,types:qt};exports.Communication=$r;exports.CoreError=Y;exports.Filter=$;exports.Manager=O;exports.MetadataStore=Ae;exports.NotificationSystem=ue;exports.WidgetButton=En;exports.WidgetIcon=le;exports.WidgetImage=On;exports.WidgetList=jn;exports.WidgetLoader=kn;exports.WidgetMultiButton=Sn;exports.WidgetSpinner=Oe;exports.WidgetTable=hn;exports.actionService=Ur;exports.asyncProcess=qn;exports.authService=x;exports.billingService=Q;exports.catchUniversal=L;exports.clickOutside=ke;exports.clientService=lt;exports.communicationService=Qt;exports.config=Wn;exports.configuration=D;exports.constants=w;exports.dataService=ce;exports.debounce=Hn;exports.default=ei;exports.documentsService=Wr;exports.equipmentService=Qr;exports.fileService=Zt;exports.getCellName=yt;exports.getCellValue=mt;exports.getNamesFromListConfig=zn;exports.groupArrayByField=Kn;exports.historyService=Gt;exports.injectAction=cr;exports.internationalizationService=zt;exports.invitationService=en;exports.openService=tn;exports.parseError=Ce;exports.prettyDate=We;exports.prettyDateWithTime=Et;exports.prettyMoney=_t;exports.prettyValueFieldByEntity=Zn;exports.processWizardService=me;exports.request=M;exports.ruleValidationService=Ue;exports.t=Z;exports.throttle=Xn;exports.universalEntityCreate=Tt;exports.universalEntityDelete=Ct;exports.universalEntityRead=Se;exports.universalEntityUpdate=qe;exports.universalListSettingRead=or;exports.universalMetadataFieldTreat=sr;exports.universalToolRead=St;exports.useActions=wr;exports.useCommunication=yr;exports.useEnter=Or;exports.useFormEntity=mr;exports.useListActiveRow=lr;exports.useListEntity=ur;exports.useListSearch=qr;exports.useListSelect=Ir;exports.useLogger=Yt;exports.useManagerState=dr;exports.useMetadata=Er;exports.useSocket=S;exports.useUsageContext=vr;exports.useWizard=Jr;exports.utils=Zr;exports.uuidv4=Yn;exports.valuesToUpperCase=Ge;
|
|
11
11
|
//# sourceMappingURL=eservices-core.cjs.js.map
|
|
@@ -6,7 +6,7 @@ import tt from "debug";
|
|
|
6
6
|
import tn from "date-and-time";
|
|
7
7
|
import { getComponentFromStore as At, promptModal as nn, pushModal as rn } from "jenesius-vue-modal";
|
|
8
8
|
/*!
|
|
9
|
-
* eservices-core v1.3.
|
|
9
|
+
* eservices-core v1.3.90
|
|
10
10
|
* (c) 2024 ESERVICES
|
|
11
11
|
*/
|
|
12
12
|
function on(n, e) {
|
|
@@ -2103,6 +2103,25 @@ function Pi(n) {
|
|
|
2103
2103
|
document.removeEventListener("keypress", e);
|
|
2104
2104
|
});
|
|
2105
2105
|
}
|
|
2106
|
+
function Di(n) {
|
|
2107
|
+
const e = P([]), t = (s) => {
|
|
2108
|
+
const c = K(n);
|
|
2109
|
+
if (s === void 0) {
|
|
2110
|
+
e.length === 0 ? c.forEach(i) : c.forEach(o);
|
|
2111
|
+
return;
|
|
2112
|
+
}
|
|
2113
|
+
r(s) ? o(s) : i(s);
|
|
2114
|
+
}, r = (s) => e.includes(s), i = (s) => {
|
|
2115
|
+
r(s) || e.push(s);
|
|
2116
|
+
}, o = (s) => {
|
|
2117
|
+
const c = e.findIndex((l) => l === s);
|
|
2118
|
+
c !== -1 && e.splice(c, 1);
|
|
2119
|
+
}, u = ne(() => {
|
|
2120
|
+
const s = K(n);
|
|
2121
|
+
return e.length === s.length && s.length !== 0;
|
|
2122
|
+
});
|
|
2123
|
+
return [e, t, u, i, o];
|
|
2124
|
+
}
|
|
2106
2125
|
const De = new class {
|
|
2107
2126
|
constructor() {
|
|
2108
2127
|
this.store = P([]);
|
|
@@ -2150,7 +2169,7 @@ const Vt = class jt {
|
|
|
2150
2169
|
};
|
|
2151
2170
|
Vt.cardId = 1;
|
|
2152
2171
|
let Pr = Vt;
|
|
2153
|
-
class
|
|
2172
|
+
class Mi extends U {
|
|
2154
2173
|
constructor(e) {
|
|
2155
2174
|
super(), this.name = "Communication", this.read = () => {
|
|
2156
2175
|
}, this.id = e;
|
|
@@ -2496,7 +2515,7 @@ V.or = function(...e) {
|
|
|
2496
2515
|
return e.join(" or ");
|
|
2497
2516
|
};
|
|
2498
2517
|
const $ = new Fr();
|
|
2499
|
-
class
|
|
2518
|
+
class Ui {
|
|
2500
2519
|
static url() {
|
|
2501
2520
|
return "/close-api/actions";
|
|
2502
2521
|
}
|
|
@@ -2516,7 +2535,7 @@ class Mi {
|
|
|
2516
2535
|
function Wr(n, e = "images") {
|
|
2517
2536
|
return `/static-folder/${e}/${n}`;
|
|
2518
2537
|
}
|
|
2519
|
-
class
|
|
2538
|
+
class Fi {
|
|
2520
2539
|
static getRequiredDocuments(e, t, r) {
|
|
2521
2540
|
const i = new URLSearchParams({
|
|
2522
2541
|
entity: e,
|
|
@@ -2790,7 +2809,7 @@ je.EVENT_DATA = "list-data: update";
|
|
|
2790
2809
|
je.EVENT_CONFIG_UPDATE = "list-config:update";
|
|
2791
2810
|
je.EVENT_ORDER_UPDATE = "list-order:update";
|
|
2792
2811
|
je.EVENT_FILTERS_UPDATE = "list-filters:update";
|
|
2793
|
-
function
|
|
2812
|
+
function Vi(n) {
|
|
2794
2813
|
const e = z(""), t = ne(() => {
|
|
2795
2814
|
const r = e.value.toLowerCase();
|
|
2796
2815
|
return K(n).filter((i) => e.value.length ? Object.values(i).join().toLowerCase().includes(r) : !0);
|
|
@@ -2805,32 +2824,6 @@ function qr(n, e) {
|
|
|
2805
2824
|
n[t] = r;
|
|
2806
2825
|
});
|
|
2807
2826
|
}
|
|
2808
|
-
function Vi(n) {
|
|
2809
|
-
const e = P([]);
|
|
2810
|
-
function t(s) {
|
|
2811
|
-
return e.includes(s);
|
|
2812
|
-
}
|
|
2813
|
-
function r(s) {
|
|
2814
|
-
t(s) || e.push(s);
|
|
2815
|
-
}
|
|
2816
|
-
function i(s) {
|
|
2817
|
-
const c = e.findIndex((l) => l === s);
|
|
2818
|
-
c !== -1 && e.splice(c, 1);
|
|
2819
|
-
}
|
|
2820
|
-
function o(s) {
|
|
2821
|
-
const c = K(n);
|
|
2822
|
-
if (s === void 0) {
|
|
2823
|
-
e.length === 0 ? c.forEach(r) : c.forEach(i);
|
|
2824
|
-
return;
|
|
2825
|
-
}
|
|
2826
|
-
t(s) ? i(s) : r(s);
|
|
2827
|
-
}
|
|
2828
|
-
const u = ne(() => {
|
|
2829
|
-
const s = K(n);
|
|
2830
|
-
return e.length === s.length && s.length !== 0;
|
|
2831
|
-
});
|
|
2832
|
-
return [e, o, u, r, i];
|
|
2833
|
-
}
|
|
2834
2827
|
function Gr(n) {
|
|
2835
2828
|
return n.statusName === "Completed";
|
|
2836
2829
|
}
|
|
@@ -2940,7 +2933,7 @@ const qi = {
|
|
|
2940
2933
|
types: wn
|
|
2941
2934
|
};
|
|
2942
2935
|
export {
|
|
2943
|
-
|
|
2936
|
+
Mi as Communication,
|
|
2944
2937
|
ce as CoreError,
|
|
2945
2938
|
V as Filter,
|
|
2946
2939
|
$ as Manager,
|
|
@@ -2954,7 +2947,7 @@ export {
|
|
|
2954
2947
|
di as WidgetMultiButton,
|
|
2955
2948
|
ot as WidgetSpinner,
|
|
2956
2949
|
ui as WidgetTable,
|
|
2957
|
-
|
|
2950
|
+
Ui as actionService,
|
|
2958
2951
|
yi as asyncProcess,
|
|
2959
2952
|
q as authService,
|
|
2960
2953
|
he as billingService,
|
|
@@ -2968,7 +2961,7 @@ export {
|
|
|
2968
2961
|
be as dataService,
|
|
2969
2962
|
wi as debounce,
|
|
2970
2963
|
Gi as default,
|
|
2971
|
-
|
|
2964
|
+
Fi as documentsService,
|
|
2972
2965
|
Wi as equipmentService,
|
|
2973
2966
|
si as fileService,
|
|
2974
2967
|
Nn as getCellName,
|
|
@@ -3003,8 +2996,8 @@ export {
|
|
|
3003
2996
|
Ri as useFormEntity,
|
|
3004
2997
|
bi as useListActiveRow,
|
|
3005
2998
|
Oi as useListEntity,
|
|
3006
|
-
|
|
3007
|
-
|
|
2999
|
+
Vi as useListSearch,
|
|
3000
|
+
Di as useListSelect,
|
|
3008
3001
|
ii as useLogger,
|
|
3009
3002
|
Ii as useManagerState,
|
|
3010
3003
|
ki as useMetadata,
|
|
@@ -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-b3ed6089]{padding:18px;text-align:start}.widget-table__head-label[data-v-b3ed6089]{font-weight:600;font-size:14px;line-height:19px}[dir=rtl] .icon[data-v-0eae75d4]{transform:scaleX(-1)}.widget-spinner[data-v-0ae13719],.widget-spinner[data-v-0ae13719]:after{border-radius:50%;width:14px;height:14px}.widget-spinner[data-v-0ae13719]{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-0ae13719 1.1s infinite linear}@keyframes spinnerAnimation-0ae13719{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.widget-button[data-v-76d0d8eb]{position:relative}.widget-button-spinner[data-v-76d0d8eb]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.widget-multi-button-wrap[data-v-2034ac0b]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-2034ac0b]{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-2034ac0b]{grid-template-rows:calc(var(--button-size) * var(--8e9f9746))}.widget-multi-button-body[data-v-2034ac0b]{min-width:80px}.widget-multi-button-body-label[data-v-2034ac0b]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-2034ac0b]:hover{background-color:#223296}.widget-multi-button-side[data-v-2034ac0b]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-2034ac0b]{transform:rotate(180deg)}.widget-multi-button-side[data-v-2034ac0b]:hover{background-color:#223296}tr[data-v-aa0613cb]{border:1px solid #F3F4FC;height:30px}th[data-v-aa0613cb],td[data-v-aa0613cb]{position:relative;padding:0 11px}th[data-v-aa0613cb]{text-align:left}p[data-v-aa0613cb]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.widget-list-head-cell[data-v-85ce2e65]{padding:0 0 0 10px;display:flex}.widget-list-head-cell[data-v-85ce2e65]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-85ce2e65]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-85ce2e65]{position:absolute;inset-inline-end:22px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-85ce2e65]{transform:rotate(180deg)}.head-cell-resize[data-v-85ce2e65]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-85ce2e65]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-85ce2e65]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-6173c14c]{position:sticky;top:-1px;z-index:1}.test-block[data-v-6173c14c]{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-6173c14c]{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(l,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("jenesius-vue-form"),require("vue-router"),require("debug"),require("date-and-time"),require("jenesius-vue-modal")):typeof define=="function"&&define.amd?define(["exports","vue","jenesius-vue-form","vue-router","debug","date-and-time","jenesius-vue-modal"],o):(l=typeof globalThis<"u"?globalThis:l||self,o(l["eservices-core"]={},l.Vue,l.JenesiusVueForm,l.VueRouter,l.Debug,l.DateAndTime,l.JenesiusVueModal))})(this,function(l,o,O,Ke,$e,vt,pe){"use strict";/*!
|
|
3
|
-
* eservices-core v1.3.
|
|
3
|
+
* eservices-core v1.3.90
|
|
4
4
|
* (c) 2024 ESERVICES
|
|
5
5
|
*/function Rt(n,e){return!!n&&n===e||"password is not equal"}function Je(n){return Number(n.replace(/[^0-9.]/g,""))}function Lt(n,e=null){let r=String(Je(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 $t={inputs:Object.freeze(Object.defineProperty({__proto__:null,numeric:Je,prettyNumeric:Lt,validPassword:Rt},Symbol.toStringTag,{value:"Module"}))};function he(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?he(n[r],e.substr(t+1)):void 0}return n[e]}function ge(n,e){if(!n)return console.warn("Element is not provided.");function t(i,a){return i==a.target||i.contains(a.target)}const r=i=>{t(n,i)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function Ye(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const He=class w extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=w.ID++}static ParentFormNotFound(){return new w("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new w("Composite object name is undefined",e)}static EntityWithoutName(e){return new w("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new w(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new w("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new w("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new w(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return w.ApiNotAvailable()}static ApiError(e){return new w("Request error",e)}static ApiNotAvailable(){return new w(`Sorry, we experience difficulties here.
|
|
6
|
-
Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,t){return!e&&!t?w.ApiNotAvailable():new w(e||"Authorization Error",t)}static ApiResponseParseFailed(){return w.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new w("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new w(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new w("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new w("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new w(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new w(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new w(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new w(`Metadata for the ${e} is not currently available.`)}static RequestTookToLong(){return new w("The request took too long to complete. Try again later.")}};He.ID=0;let j=He;const Pt="Please try again later or submit a feedback if problem doesn't go.";class Xe{static getClientData(){return m("/close-api/client-content")}static getNavigation(){return m("/close-api/client/navigation")}}const Dt=new class{constructor(){this.store=o.reactive([])}add(e,t,{children:r,timeout:i=10,click:a=()=>{}}={}){const
|
|
6
|
+
Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,t){return!e&&!t?w.ApiNotAvailable():new w(e||"Authorization Error",t)}static ApiResponseParseFailed(){return w.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new w("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new w(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new w("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new w("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new w(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new w(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new w(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new w(`Metadata for the ${e} is not currently available.`)}static RequestTookToLong(){return new w("The request took too long to complete. Try again later.")}};He.ID=0;let j=He;const Pt="Please try again later or submit a feedback if problem doesn't go.";class Xe{static getClientData(){return m("/close-api/client-content")}static getNavigation(){return m("/close-api/client/navigation")}}const Dt=new class{constructor(){this.store=o.reactive([])}add(e,t,{children:r,timeout:i=10,click:a=()=>{}}={}){const u=new Bt(e,t,i,r||[],a);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.")}},Qe=class Ot{constructor(e,t,r,i,a){this.type=e,this.msg=t,this.timeout=r,this.children=i,this.click=a,this.id=Ot.cardId++}};Qe.cardId=1;let Bt=Qe;/*!
|
|
7
7
|
* jenesius-event-emitter v1.0.2
|
|
8
8
|
* (c) 2022 Jenesius
|
|
9
9
|
* @license MIT
|
|
10
|
-
*/const Ze=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},et=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},tt=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},nt=function(){this.events={}};class D{constructor(){this.events={}}on(e,t){return Ze.call(this,e,t)}emit(e,t){return et.call(this,e,t)}off(e,t){return tt.call(this,e,t)}cleanEvents(){nt.call(this)}static on(e,t){return Ze.call(D,e,t)}static emit(e,t){return et.call(D,e,t)}static off(e,t){return tt.call(D,e,t)}static cleanEvents(){nt.call(D)}}D.events={};var rt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},ye=(n,e,t)=>(rt(n,e,"read from private field"),t?t.call(n):e.get(n)),Pe=(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)},De=(n,e,t,r)=>(rt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),te,me,Ee;const G=class R extends D{constructor(){super(...arguments),Pe(this,te,void 0),Pe(this,me,"front"),this.organizations=[],Pe(this,Ee,!1)}set language(e){localStorage.setItem(R.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(R.LOCALSTORAGE_LANGUAGE_KEY)||R.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(R.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){De(this,te,e)}get router(){if(!ye(this,te))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return ye(this,te)}set type(e){De(this,me,e)}get type(){return ye(this,me)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){De(this,Ee,e),this.emit(R.EVENT_READY_UPDATE,e)}get ready(){return ye(this,Ee)}onReady(e){return this.on(R.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(R.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(R.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(R.CURRENT_CONTEXT_KEY,String(e)),this.emit(R.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(R.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{Dt.add("error",j.ApiNotAvailable().message)}}loadCustomerData(){return Xe.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var t;return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const t=localStorage.getItem(this.getListKeyById(e));return t&&JSON.parse(t)}setListInformationToLocalStorage(e,t){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(t))}};te=new WeakMap,me=new WeakMap,Ee=new WeakMap,G.DEFAULT_LANGUAGE="en",G.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",G.EVENT_CONTEXT_UPDATE="event:context-update",G.EVENT_READY_UPDATE="event:ready-update",G.EVENT_DATA_UPDATE="event:data-update",G.CURRENT_CONTEXT_KEY="CurrentContext";let Mt=G;const it=new Mt;function Ut(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Pt}})}function m(n,e={}){return it.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=it.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw j.ApiNotAvailable()}).then(t=>Ut(t).then(r=>{if(!t.ok)throw r;return r}))}class _e{constructor(){}static parseNamesFromListConfig(e){let t=_e.parseFieldsToGraphQL(e.reduce((i,a)=>(a.name&&i.push(a.name),i),[]));function r(i){let a="";for(let d in i)typeof i[d]=="boolean"?a+=` ${d} `:a+=` ${d} { ${r(i[d])} }`;return a}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 a=i.indexOf("."),d=i.substring(a+1),s=i.substring(0,a);s in r||(r[s]={}),t(r[s],d)}else r[i]=!0;return r}return e.reduce(t,{})}}class Vt{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 Ft=new Vt;function ot(n){return n&&n[0].toLowerCase()+n.slice(1)}function Be(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=Be(r)),e[i]=r,e},{})}function Wt(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 qt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:_e,Journal:Ft,Request:m,clickOutside:ge,default:{Request:m,clickOutside:ge,getPropFromObject:he,runPromiseQueue:Ye,GraphQL:_e,firstChapterToLowerCase:ot,valuesToUpperCase:Be,prettyMoney:Wt},firstChapterToLowerCase:ot,getPropFromObject:he,runPromiseQueue:Ye,valuesToUpperCase:Be},Symbol.toStringTag,{value:"Module"})),jt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),ti="";class Gt{static readHistoryById(e,t){return m(`/close-api/audits/history/${e}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(r=>{const i=r.history.map(a=>{if(!a.changes)return a;const d=a.changes.map(s=>({...s,oldValue:s.originalValue,name:s.fieldName}));return{...a,changes:d}});return{...r,history:i}})}}class xt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return m(`/open-api/internationalization/language/${e}`)}}let x={};function X(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=O.utils.getPropFromObject((this==null?void 0:this.vocabulary)||x,n);if(typeof t=="string")return at(t,e);const r=O.utils.getPropFromObject(x==null?void 0:x.root,n);return typeof r=="string"?at(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function at(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}X.setGlobalVocabulary=function(n){x=n},X.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),X.bind({vocabulary:O.utils.getPropFromObject(x,e.toLowerCase())})},X.setVocabulary=function(n){return typeof n=="string"&&(n=O.utils.getPropFromObject(x,n)),X.bind({vocabulary:n})};const zt=function(){let n=!1;const e=[];function t(){return n}function r(u,f){t()&&console[u](...f),e.push(f)}function i(...u){r("log",u)}function a(...u){r("warn",u)}function d(...u){r("error",u)}function s(u=!0){n=u}return{info:i,warn:a,history:e,display:s,error:d}}();function Kt(){return zt}function Jt(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Yt="masterId",Ht="masterEntity";function Me(n,e){if(!Array.isArray(e))return;if(Jt(e))return t(e);e.forEach(t);function t(r){n.append(Ht,r[0]),n.append(Yt,r[1].toString())}}class ne{static async anonymousGetList(e){return await m(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,a)=>r.append(i,a),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 d=(Array.isArray(i)?[i]:Object.entries(i)).map(([s,u="desc"])=>`@${s} ${u}`).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=ne.getSearchParamsForEntityListRead(t||{});return await m(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=ne.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 i=new URLSearchParams;return Me(i,r==null?void 0:r.masterEntities),m(`/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 m(`/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 a=r.fields;typeof a=="string"&&(a=[a]),i.append("fields",a.join(" "))}return m(`/close-api/data/entities/${e}/id/${t}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,t,r,i){const a=new URLSearchParams;return Me(a,i==null?void 0:i.masterEntities),m(`/close-api/data/entities/${e}/id/${t}?${a.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 ne.removeByKeys(e,i,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 st=class fe{static async create(e){return m(fe.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(fe.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return m(`${fe.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return m(`${fe.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};st.url="/close-api/communications";let Xt=st;function ct(n){return{...n,createdEntities:n.createdEntites}}const lt=class Le{static async getStartConfig(e,t){return m([Le.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return m([Le.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(ct)}static async runStep(e,t,r,i,a){return m([Le.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:a})}).then(ct)}};lt.url="/close-api/views/process-wizard";let we=lt;class Qt{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(a=>a.json()).then(a=>(a.filename=e.name,a))}}class Zt{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 Ue{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return m(Ue.url+e,{method:"POST",body:JSON.stringify(t)})}}class en{static getConfiguration(){return m("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}const tn={class:"widget-table__head"},nn={class:"widget-table__head-label margin_0 text_overflow"},rn=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",tn,[(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",nn,o.toDisplayString(r.label),1)]))),128))]))}}),ni="",q=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},on=q(rn,[["__scopeId","data-v-b3ed6089"]]);function ut(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function dt(n,e){const t=ut(n);let r=t?O.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):n.value===null?null:r}function Ve(n){return["eservices-core",n].join(":")}function ft(n){return Fe(n,"YYYY/MM/DD HH:mm:ss")}function Fe(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return vt.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const ri="",re=q({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-0eae75d4"]]),an=$e(Ve("setup-list-row"));function sn(n,e){const t=n.config.map(r=>cn(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function cn(n,e,t){const r=e.values;let i=dt(n,r);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function d(g){a.onClick.push(()=>g(r))}function s(g){Array.isArray(g)?a.class.push(...g):a.class.push(g)}const u=[],f=[];if(n.hide&&n.hide(r))return[o.h("td")];if(n.type)switch(s(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Fe(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=ft(typeof i=="string"?i:null);break}case"money":{i=mt(i);break}case"multi-select":{f.push(o.h(O.FormField,{type:"single-checkbox",modelValue:e.selected})),d(pt.bind(null,t,!0));break}case"select":{f.push(o.h(O.FormField,{type:"single-radio",modelValue:e.selected})),d(pt.bind(null,t,!1));break}}if(n.onClick&&d(n.onClick),n.link)try{const g=n.link(r);if(g){const S=o.h(Ke.RouterLink,{to:g});f.push(S),s("widget-table-cell_link")}}catch(g){an("Can't add router link",g)}if(n.href&&(f.push(o.h("a",{href:n.href(r),target:"_blank"})),s("widget-table-cell_link")),typeof i=="boolean"&&(i=i?"✓":"—"),(typeof i=="string"||typeof i=="number")&&f.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&(typeof n.icon=="string"&&f.push(o.h(re,{name:n.icon})),typeof n.icon=="function")){const g=n.icon(r);g!==null&&f.push(o.h(re,{name:g}))}return n.class&&(typeof n.class=="function"?s(n.class(r)):s(n.class)),u.push(o.h("td",a,f)),u}function pt(n,e){n.emit("select",e)}function ht(n,e){return()=>{try{return sn(n,e)}catch(t){return console.warn(t),null}}}const ln={props:{values:Object,config:Object,selected:Boolean},setup:ht},un=["colspan"],gt=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]=a=>e("close")),onSave:i[1]||(i[1]=a=>e("save",a))}),null,16,["values","new"]))],8,un)],512))}}),C={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",TIME_TO_LIVE_SOCKET_REQUEST:3e4},dn={class:"widget-table"},yt="update:selectedRows",fn=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 s;return(s=r==null?void 0:r.default)==null?void 0:s.call(r)[0]});function a(s,u=!0){if(!t.selectedRows)return;if(!u)return e(yt,t.selectedRows.includes(s)?[]:[s]);const f=[...t.selectedRows],g=f.indexOf(s);return g===-1?f.push(s):f.splice(g,1),e(yt,f)}function d(s){e("save",s),e("update:activeRow",null)}return(s,u)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",dn,[o.createVNode(on,{config:s.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.array,(f,g)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:g},[o.createVNode(ln,{config:s.config,values:f,selected:s.selectedRows.includes(f),onSelect:S=>a(f,S),class:o.normalizeClass(s.classCallback?s.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&s.activeRow===f?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":s.config.length,values:f,onClose:u[0]||(u[0]=S=>e("update:activeRow",null)),onSave:d,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),s.activeRow===o.unref(C).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":s.config.length,onClose:u[1]||(u[1]=f=>e("update:activeRow",null)),onSave:d,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),pn=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))}}),oi="",Te=q(pn,[["__scopeId","data-v-0ae13719"]]),hn={class:"widget-button"},gn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",hn,[e.wait?(o.openBlock(),o.createBlock(Te,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),ai="",yn=q(gn,[["__scopeId","data-v-76d0d8eb"]]),mn={class:"widget-multi-button-wrap position_relative cursor_pointer"},En={class:"widget-multi-button-body grid"},_n=["onClick"],wn={class:"widget-multi-button-side-wrap"},Tn=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(d=>({"8e9f9746":r.value}));const t=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(d){if(!(typeof d!="function"||t.wait))return t.wait=!0,Promise.resolve().then(d).finally(()=>{t.wait=!1})}function a(d=!t.active){t.active=d}return(d,s)=>(o.openBlock(),o.createElementBlock("div",mn,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",En,[d.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:s[0]||(s[0]=u=>a())},o.toDisplayString(d.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.array,(u,f)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:g=>{i(u.callback),a(!1)}},o.toDisplayString(u.label),9,_n))),128))]),o.createElementVNode("div",wn,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:s[1]||(s[1]=u=>a())},[t.wait?(o.openBlock(),o.createBlock(o.unref(Te),{key:0,class:"widget-multi-button-side-spinner"})):d.array.length>1?(o.openBlock(),o.createBlock(o.unref(re),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),si="",Cn=q(Tn,[["__scopeId","data-v-2034ac0b"]]),Sn={class:"widget-loader flex flex-align_center gap_10 padding_15"},An={class:"text_md"},kn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",Sn,[o.createVNode(Te,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",An,o.toDisplayString(e.label),1)]))}}),bn=["alt","src"],Nn=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,bn))}}),On={props:{config:Array,values:Object,selected:Boolean},setup:ht},ci="",In=q(On,[["__scopeId","data-v-aa0613cb"]]),vn=n=>(o.pushScopeId("data-v-85ce2e65"),n=n(),o.popScopeId(),n),Rn={class:"widget-list-head-cell"},Ln=vn(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),$n=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",Rn,[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(O.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(a=>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]=a=>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(re),{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),Ln])]))}}),li="",Pn=q($n,[["__scopeId","data-v-85ce2e65"]]),Dn=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 u(T,E){let _=-1;do _++,E-=T[_];while(E>0&&_<T.length);return _}function f(T,E){let _=0;for(;E>0&&E>T[_]&&_<T.length;)E-=T[_],_++;return console.log(E,_),_>0?_:0}function g(T){try{i.value.style.insetInlineStart=T+"px"}catch(E){console.log(E)}}function S(T){try{i.value.style.width=T+"px",i.value.style.minWidth=T+"px",i.value.style.maxWidth=T+"px"}catch(E){console.log(E)}}function P(T){return T===null?!1:T.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(E){var Nt;function _(v){return v.screenX+p-N}const h=r.value,c=[...h.children].filter(v=>v.localName==="th"),p=((Nt=h.offsetParent)==null?void 0:Nt.scrollLeft)||0,y=c.map(v=>v.clientWidth),b=P(E.target),N=h.getBoundingClientRect().left,Z=_(E),A=u(y,Z),H=y.slice(0,A).reduce((v,V)=>v+V,0),le=Z-H,xe=h.offsetWidth,ue=c[A].clientWidth;if(t.config[A].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",E.screenX),console.log("Widths",y),console.log("max width",xe),console.log("Start Position",Z),console.log("Position From",A),console.log("Start Position",A),console.log("Global offset (Отступ самой таблицы от края экрана)",N),console.log("Del",le),console.groupEnd(),i.value.innerText=c[A].textContent||"",i.value.style.display="grid",i.value.style.width=ue+"px",i.value.style.cursor="grabbing",g(H),S(ue),document.addEventListener("pointermove",bt,{passive:!0}),document.addEventListener("pointerup",kt);function kt(v){if(console.group("END"),document.removeEventListener("pointermove",bt),document.removeEventListener("pointerup",kt),b&&(t.config[A].width=i.value.style.width,t.config[A].minWidth=i.value.style.width,t.config[A].maxWidth=i.value.style.width,a(t.config)),!b){const V=v.screenX+p-N;console.log("ENP Position",V);const Re=f(y,V);if(console.log(A,"->",Re),Re!==A){const de=t.config[A],ze=t.config;ze.splice(A,1),ze.splice(Re,0,de),a(ze)}else{const de=t.config[A].name;d(de)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function bt(v){if(b){const de=_(v)-Z+ue;S(de);return}let V=v.screenX+p-N-le;V<0&&(V=0),V+ue>xe&&(V=xe-ue),g(V)}})});function a(u){e("update:config",u)}function d(u){if(!u)return;if(Array.isArray(u)){if(u.length<1)return;u=u[0]}if(t.order.length===0||t.order[0]!==u)return void s([u]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";s([u,f==="asc"?"desc":"asc"])}function s(u){e("update:order",u)}return(u,f)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.config,(g,S)=>(o.openBlock(),o.createBlock(Pn,o.mergeProps({key:g},g,{onOrder:P=>d(g.name),onSelect:f[0]||(f[0]=P=>e("select")),order:u.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),ui="",Bn=q(Dn,[["__scopeId","data-v-6173c14c"]]),Mn={class:"widget-list"},Un={class:"widget-list-body position_relative"},Vn=50,Fn=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(s,u=!0){if(t.selectedRows)if(!u)a(t.selectedRows.includes(s)?[]:[s]);else{const f=[...t.selectedRows],g=f.indexOf(s);g===-1?f.push(s):f==null||f.splice(g,1),a(f)}}function i(){var s;if(((s=t.selectedRows)==null?void 0:s.length)!==t.array.length)return a([...t.array]);a([])}function a(s){e("update:selectedRows",s)}function d(s){if(!s)return;const u=s.target;u.scrollTop+u.clientHeight+Vn>u.scrollHeight&&e("scrollEnd")}return(s,u)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:d},[o.createElementVNode("table",Mn,[o.createElementVNode("thead",null,[o.createVNode(Bn,{onSelect:u[0]||(u[0]=f=>i()),"onUpdate:order":u[1]||(u[1]=f=>e("update:order",f)),"onUpdate:config":u[2]||(u[2]=f=>e("update:config",f)),config:s.config,order:s.order},null,8,["config","order"])]),o.createElementVNode("tbody",Un,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.array,(f,g)=>{var S;return o.openBlock(),o.createBlock(In,{key:g,class:"widget-list-row",values:f,config:s.config,selected:(S=s.selectedRows)==null?void 0:S.includes(f),onSelect:P=>r(f,P)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),B={};function Wn(n){for(let e in n)B[e]=n[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function qn(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 Ce(n){return typeof n=="string"?We(n):jn(n)?We(n.message):We(C.DEFAULT_ERROR_MESSAGE)}function jn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function We(n){return{message:n}}function L(n="error"){return function(e){const{message:t}=Ce(e);ie.add(n,t)}}function Se(n,e={}){return k().emit("entity:read",{...e,entity:n})}function qe(n,e){return k().emit("entity:update",{...e,entity:n})}function Gn(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function mt(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 je(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=je(r)),e[i]=r,e},{})}function xn(n,e){const t=new Map;return n.forEach(r=>{var a;const i=e(r);t.has(i)||t.set(i,[]),(a=t.get(i))==null||a.push(r)}),t}function zn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Kn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return C.DEFAULT_ERROR_MESSAGE}})}function M(n,e={}){return I.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=I.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw new Error(C.DEFAULT_ERROR_MESSAGE)}).then(t=>Kn(t).then(r=>{if(!t.ok)throw r;return r}))}function Jn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Yn(n,e){let t=!1;return(...r)=>{if(!t)return t=!0,setTimeout(()=>t=!1,e),n(...r)}}const Hn=$e(Ve("pretty-value-field-by-entity"));function Xn(n,e,t){try{const r=be.get(n);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${n} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch(r){return Hn('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,n,e,t),t}}const Qn=1,Zn=5e3,z=$e(Ve("use-socket"));function k(){return tr}function er(n){return typeof n=="object"&&Object.prototype.toString.call(n)==="[object Blob]"}const tr=function(){let n=1,e,t;const r=new Set;let i=0;const a=new Set;function d(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},Zn*2);const c=new Uint8Array(1);c[0]=Qn,e.send(c)}setInterval(()=>{Array.from(r).forEach(c=>{h(c)&&(z("Handler for event %s requestId %d was expired",c.event,c.requestId),c.requestId?u({requestId:c.requestId,event:"request-error",data:{message:j.RequestTookToLong().message}}):r.delete(c))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&f()},C.DELAY_SOCKET_RECONNECT);function s(){return{safeQueue:a,requestId:n,handlers:r,socketInstance:e}}function u(c){const p=[...r.values()];z("Handlers array length is %d. Response event: %s. Request id: %d",r.size,c.event,c.requestId),p.forEach(y=>{const b=c.requestId;(y.requestId&&y.requestId===b||!y.requestId&&y.event===c.event)&&(z("Find appropriated handler: %d, event: %s",n,y.event),y.callback(c.data,c),y.once&&(r.delete(y),z("Handler was removed by *once* params was passed. %o",y)))})}function f(){if(typeof t!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${t}`,"color: purple","color: black"),e=new WebSocket(t),e.onclose=function(c){z("Connection to server was stopped: %d %s",c.code,c.reason),Array.from(r).forEach(p=>{p.guaranteedAnswer&&p.serializeString&&a.add(p.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(c=>{g(c),a.delete(c)})},e.onerror=function(c){console.warn(c)},e.onmessage=c=>{var p;try{if(er(c.data)){d();return}const y=JSON.parse(c.data);if(!Et(y)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(y);return}(p=y==null?void 0:y.data)!=null&&p.refresh&&location.reload(),u(y)}catch(y){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(y)}}}function g(c){e.send(c)}function S(c,p){_({event:c,callback:p})}function P(c,p){_({event:c,callback:p,once:!0})}function T(){return e&&(e==null?void 0:e.readyState)===1}function E(c,p,y){const b=++n,N=JSON.stringify({requestId:b,event:c,data:p,contextId:I.contextId,url:window.location.href});return T()?g(N):(a.add(N),z("Socket is not connected. Message was send to save-queue")),new Promise((Z,A)=>{_({event:c,requestId:b,once:!0,guaranteedAnswer:!0,serializeString:N,callback:(H,le)=>{if(z("Promise was resolve with next data:",H),nr(le))return void A(H);y&&y(H,le),Z(H)},timeToLive:C.TIME_TO_LIVE_SOCKET_REQUEST})})}function _(c){const p={timeToLive:0,...c,created:new Date().getTime()};r.add(p)}function h(c){return c.timeToLive===0||typeof c.timeToLive!="number"?!1:new Date().getTime()-c.created>c.timeToLive}return{get socket(){return e},on:S,once:P,emit:E,initialization(c){t=c},getDevInfo:s}}(),nr=n=>!!Et(n)&&n.event==="request-error",Et=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){return k().emit("list-setting:read",{entity:n,mark:e})}function ir(n,e){return k().emit("metadata-field:treat",{entity:n,fieldName:e})}function _t(n,e){return k().emit("entity:create",{...e,entity:n})}function wt(n,e){return k().emit("entity:delete",{...e,entity:n})}function or(n,e){return k().emit("usage-context:read",{...e,entity:n})}function Tt(n={}){return k().emit("tool:read",n)}function ar(n,e={},t={}){const r=o.inject(C.PROVIDE_NAME_ACTIONS,null),i=typeof n=="string"?n:e,a=typeof e=="string"?t:e;return o.computed(()=>{var u;const s=((typeof n=="string"?(u=r==null?void 0:r.actions)==null?void 0:u.value:o.unref(n))||[]).find(f=>f.name===i);return s?{...s,...a}:null})}function sr(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}function cr(n,e,t={}){const r=o.reactive([]);let i=0;const a=o.ref(!1);function d(){if(a.value)return Promise.reject("The process has already started.");const h=E();return a.value=!0,typeof h.limit!="number"&&(h.limit=100),h.offset=i,(t.request||Se)(n,h).then(p=>(i+=p.length,p)).finally(()=>{a.value=!1})}function s(h,c){var y;return typeof h.Version=="number"?h.Version:(y=r.find(b=>b.Id===c))==null?void 0:y.Version}function u(h,c){const p=r.findIndex(y=>y.Id===h);if(p===-1)throw new Error(`Can't found item with Id ${h}`);r.splice(p,1,c)}function f(h){const c=r.findIndex(p=>p.Id===h);if(c===-1)throw new Error(`Can't found item with Id ${h}`);r.splice(c,1)}async function g(h,c){try{const p=E(),y=s(c,h);delete c.Version,await qe(n,{id:h,values:c,version:y});const b=await Se(n,{fields:p.fields||"",id:h});u(h,b)}catch(p){L()(p)}}async function S(h,c){try{const p=E(),y=s(c,h);delete c.Version,await wt(n,{id:h,version:y}),f(h)}catch(p){L()(p)}}async function P(h){try{await _t(n,{values:h}),await _()}catch(c){L()(c)}}async function T(){try{const h=await d();r.push(...h)}catch(h){L()(h)}}function E(){return typeof e=="function"?e():e}async function _(){try{i=0;const h=await d();r.splice(0,r.length,...h)}catch(h){L()(h)}}return{array:r,updateById:g,next:T,reload:_,wait:a,create:P,deleteById:S}}function lr(){function n(){return{organizations:I.organizations,currentContextId:I.contextId,person:I.person,context:I.context,contextType:I.contextType,userId:I.userId}}const e=o.reactive(n());return I.onupdateContext(()=>{Object.assign(e,n())}),e}function ur(n,e,t){return k().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function dr(n,e,t){return k().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function fr(n,e){return k().emit("communication-message:create",{communicationId:n,text:e})}function pr(n){return k().emit("communication-message:read",{communicationId:n})}function hr(n){const e=O.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>pr(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function gr(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw j.EntityWithoutName(n);return Se(n.name,r)}).then(je).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(L())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw j.EntityWithoutName(n);return qe(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw L()(i),i})};function t(){return typeof e=="function"?e():e}}function yr(n){if(!n)return o.inject(C.PROVIDE_NAME_METADATA);be.initEntity(n);const e=o.computed(()=>be.state[n]);return o.provide(C.PROVIDE_NAME_METADATA,e),e}function mr(n,e={}){if(!n)return o.inject(C.PROVIDE_NAME_USAGE_CONTEXT);const t=o.ref(null);return o.provide(C.PROVIDE_NAME_USAGE_CONTEXT,t),{state:t,update:async function(){t.value=await or(n,Er(e||{}))}}}function Er(n){return typeof n=="function"?n():n}function _r(n){if(!n)return o.inject(C.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),t=o.computed(()=>e.map(a=>wr(n,a))),r={actions:t,update:i};o.provide(C.PROVIDE_NAME_ACTIONS,r),n.router=Ke.useRouter(),n.handleConfirmation||(n.handleConfirmation=Cr),n.handleAffectedEntity||(n.handleAffectedEntity=Ar),n.handleCloseForm||(n.handleCloseForm=kr),n.handleValidationResult||(n.handleValidationResult=Sr);function i(a={}){return e.splice(0,e.length),Tt(a).then(d=>e.splice(0,0,...d)).catch(L("error"))}return{actions:t,update:i}}function wr(n,e){return{...e,label:e.title,callback(){const t=typeof n.values=="function"?n.values(e,n):n.values,r=()=>M(e.url,{method:"POST",body:JSON.stringify({keys:t,contextId:I.contextId}),headers:{"Content-Type":"application/json"}}).then(async i=>{var a,d;if(!br(i))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(n.handlers))for await(const s of n.handlers)await s(e,i,n);if(!i.success)throw n.handleValidationResult&&i.validationEffect&&((d=(a=i.validationEffect)==null?void 0:a.results)!=null&&d.length)&&n.handleValidationResult(e,i.validationEffect,n),new Error(i.message);return i.message&&ie.add("info",i.message),Array.isArray(i.affectedEntities)&&n.handleAffectedEntity&&i.affectedEntities.forEach(s=>{var u;return(u=n.handleAffectedEntity)==null?void 0:u.call(n,e,s,n)}),e.closeHostForm&&n.handleCloseForm&&n.handleCloseForm(e,n),i}).catch(L("error"));return e.requireSave&&n.form&&n.form.changed?n.form.save().then(r):!e.confirmation||!n.handleConfirmation?r():n.handleConfirmation(e,r)}}}function Tr(n){const e="Are you sure?";return n===!0||typeof n=="string"&&n.toLowerCase()==="true"||n==="1"?e:typeof n=="string"?n:e}async function Cr(n,e){const t=Tr(n.confirmation);if(!pe.getComponentFromStore(C.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await pe.promptModal(C.MODAL_CONFIRM,{message:t}))return e()}function Sr(n,e){const t=C.MODAL_VALIDATION_EFFECT;if(!pe.getComponentFromStore(t))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{pe.pushModal(t,e)})}function Ar(n,e,t){var d;const{router:r,form:i}=t,a=(d=e.primaryKey)==null?void 0:d.Id;if(r&&e&&e.name===n.redirectEntity)return r.push({name:e.name,params:{id:a}});i&&e.name===i.name&&e.updated&&a===i.id&&i.read()}function kr(n,e){const{router:t}=e;t&&n.closeHostForm&&t.back()}function br(n){return!!(n&&typeof n=="object"&&"affectedEntities"in n&&"success"in n)}function Nr(n){function e(t){t.key==="Enter"&&n()}o.onMounted(()=>{document.addEventListener("keypress",e)}),o.onUnmounted(()=>{document.removeEventListener("keypress",e)})}const ie=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=Or(r),a=new Ir(e,t,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function Or(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 Ct=class It{constructor(e,t,r,i,a){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=a,this.id=It.cardId++}};Ct.cardId=1;let Ir=Ct;class vr extends D{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return fr(this.id,e)}static checkAndGenerate(e,t,r){return dr(e,t,r).then(i=>i.length===0?ur(e,t,r):i[0])}}function Rr(){return k().emit("client:read",{})}var St=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},Lr=(n,e,t)=>(St(n,e,"read from private field"),t?t.call(n):e.get(n)),$r=(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)},Pr=(n,e,t,r)=>(St(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ae;const ke=class ee extends D{constructor(){super(...arguments),this.type="front",this.organizations=[],$r(this,Ae,!1)}set language(e){localStorage.setItem(C.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(C.LOCALSTORAGE_LANGUAGE_KEY)||ee.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Pr(this,Ae,e),this.emit(ee.EVENT_READY_UPDATE,e)}get ready(){return Lr(this,Ae)}onReady(e){return this.on(ee.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(ee.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(C.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(ee.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.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){L()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(C.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Rr()}validateContextId(e){var t;try{return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};Ae=new WeakMap,ke.DEFAULT_LANGUAGE="en",ke.EVENT_CONTEXT_UPDATE="event:context-update",ke.EVENT_READY_UPDATE="event:ready-update";let Dr=ke;function Br(n){return k().emit("metadata:read",{entity:n})}const be=function(){const e=o.reactive({}),t=new Map;function r(s){return e[s]}async function i(s){if(t.has(s)&&await t.get(s),e[s])return;const u=await a(s);d(s,u)}function a(s){const u=Br(s).finally(()=>{t.delete(s)});return t.set(s,u),u}function d(s,u){e[s]=u}return{state:e,initEntity:i,get:r}}();class U{static login(e){return M(B.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:B.applicationName})})}static parseProcessAnswer(e){if(e.statusCode>4)throw new Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return U.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return U.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return U.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return U.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return M(`${B.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)})}static startLoginProcess(e){return U.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return U.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return U.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return M(`${B.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).then(U.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startPasswordReset(e,t){return M(`${B.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:t,AppName:e})})}static confirmPhoneNumberByAccessRecovery(e,t,r,i){return M(`${B.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:t,Prefix:r,Code:i})})}static confirmEmailByAccessRecovery(e,t,r,i){return M(`${B.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:t,Prefix:r,Code:i})})}static finishAccessRecovery(e,t,r){return M(`${B.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:t,Password:r,ConfirmedPassword:r})})}}function Mr(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function $(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(Mr(r)){let i=function(a){var d;return((d=a.match(/([^Z]*)/))==null?void 0:d[0])+"0000Z"};return r.start&&e.push(`@${t} ge ${i(r.start)}`),r.end&&e.push(`@${t} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${t} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${t} eq '${r}'`),e):(r===null&&e.push($.is(t,r)),e)},[]).join(" and ")}function oe(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${oe(t)}`},$.beginWith=function(e,t){return`@${e} BeginWith ${oe(t)}`},$.notEq=function(e,t){return`@${e} nq ${oe(t)}`},$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${oe(t)}`},$.in=function(e,t){const r=t.map(oe).join(", ");return`@${e} in (${r})`},$.and=function(...e){return e.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(t=>`(${t})`).join(" and ")},$.is=function(e,t){return`@${e} is ${t}`},$.or=function(...e){return e.join(" or ")};const I=new Dr;class Ur{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 Me(i,r),M([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function Vr(n,e="images"){return`/static-folder/${e}/${n}`}class Fr{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(a=>a.json())}}class Q{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Q.url()}/calculator/${e}`)}static calculate(e,t){return m(`/${Q.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]):j.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(`/${Q.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return m(`/${Q.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}var At=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},F=(n,e,t)=>(At(n,e,"read from private field"),t?t.call(n):e.get(n)),K=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},J=(n,e,t,r)=>(At(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ne,ae,Oe,Ie,se,ce,Ge;const Y="_______LIST_______ROW_______INDEX________NAME_______",ve=class W extends D{constructor(e){super(),this.LIST_ROW_KEY=1,K(this,Ne,void 0),this.array=[],K(this,ae,[]),K(this,Oe,[]),K(this,Ie,new Proxy({},{set:(t,r,i,a)=>(t[r]=i,this.emit(W.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(W.EVENT_FILTERS_UPDATE,t),!0)})),K(this,se,!1),K(this,ce,(...t)=>Promise),K(this,Ge,()=>{}),J(this,Ne,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&J(this,ae,e.config)}set config(e){J(this,ae,e.map(O.utils.copyObject)),this.emitUpdateConfig()}get config(){return F(this,ae)}emitUpdateConfig(){this.emit(W.EVENT_CONFIG_UPDATE,this.config)}get order(){return F(this,Oe)}set order(e){J(this,Oe,e),this.emit(W.EVENT_ORDER_UPDATE,this.order)}get filters(){return F(this,Ie)}set filters(e){qr(F(this,Ie),e)}set wait(e){J(this,se,e),this.emit(O.Form.EVENT_WAIT,F(this,se))}get wait(){return F(this,se)}get primaryKeys(){return F(this,Ne)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[Y]===e)}indexByKey(e){return this.array.findIndex(t=>t[Y]===e)}static getKey(e){return e[Y]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,Y)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(W.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(W.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(W.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[Y]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,Y)}set read(e){J(this,ce,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=F(this,ce).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){J(this,ce,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>F(this,Ge).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,[Y]: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=W.getCellName(e),i=(()=>{let a=r?he(t,r):null;return a===void 0&&(a=null),e.value?e.value(a,t):a})();return{name:r,value:i}}};Ne=new WeakMap,ae=new WeakMap,Oe=new WeakMap,Ie=new WeakMap,se=new WeakMap,ce=new WeakMap,Ge=new WeakMap,ve.EVENT_DATA="list-data: update",ve.EVENT_CONFIG_UPDATE="list-config:update",ve.EVENT_ORDER_UPDATE="list-order:update",ve.EVENT_FILTERS_UPDATE="list-filters:update";function Wr(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 qr(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function jr(n){const e=o.reactive([]);function t(s){return e.includes(s)}function r(s){t(s)||e.push(s)}function i(s){const u=e.findIndex(f=>f===s);u!==-1&&e.splice(u,1)}function a(s){const u=o.unref(n);if(s===void 0){e.length===0?u.forEach(r):u.forEach(i);return}t(s)?i(s):r(s)}const d=o.computed(()=>{const s=o.unref(n);return e.length===s.length&&s.length!==0});return[e,a,d,r,i]}function Gr(n){return n.statusName==="Completed"}function xr(n){return n.statusName==="FinalStepWithConfirmation"}function zr(n){return n.statusName==="ValidationError"}function Kr(n,e,t){let r=null;const i=o.reactive({wait:null});let a=[],d=null;const s=o.ref(null);function u(){s.value=a.find(c=>c.name===d)||null}function f(){var c;return d?((c=a.find(p=>p.name===d))==null?void 0:c.fields)||[]:[]}function g(c){if(u(),zr(c))return void t.onValidation(c.validationResults);if((c.statusName==="FinalStep"||c.statusName==="NextStep")&&(!f().length||Jr(f(),t.presets)))return h(t.presets||{});Gr(c)&&t.onCompleted(c),xr(c)&&t.onConfirmation(c)}async function S(){try{await P(),await _()}catch(c){const{message:p}=Ce(c);ie.add("error",p)}}function P(){return i.wait="Loading process information.",we.getStartConfig(e,n).then(c=>{a=c.steps.map(p=>({label:p.title,name:p.stepName,number:p.number,fields:p.frontendEntity.objectTypes.reduce((y,b)=>(b.properties.forEach(N=>{y.push({name:N.name,label:N.title,type:N.refEntityName||N.dataType})}),y),[])}))}).then(c=>(i.wait=!1,c))}function T(c){return d=c.nextStepName,r=c.token,c}function E(c){const p=Ce(c);ie.add("error",p.message)}function _(){return i.wait="Starting process",we.startProcess(e,n).then(T).then(g).catch(E).finally(()=>{i.wait=null})}function h(c={}){return!r||!d?Promise.reject("Not step or token."):(i.wait="Waiting for result...",we.runStep(e,n,d,r,c).then(T).then(g).catch(E).finally(()=>{i.wait=!1}))}return{initialize:S,state:i,currentStepConfig:o.readonly(s),next:h}}function Jr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!O.utils.getPropFromObject(e,r.name))return!1}return!0}const Yr="close-api/proxy/Equipment/Search";class Hr{static search(e,t,r,i,a){const d=new URLSearchParams;d.append("pattern",e||""),t&&d.append("categoryId",t),r&&d.append("useType",String(r)),i&&d.append("statusCode",i),a&&(d.append("limit",String(a.limit)),d.append("offset",String(a.offset)));const s=`/${Yr}?${d.toString()}`;return m(s,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Xr={clickOutside:ge,staticLink:Vr},Qr={usage:$t,utils:qt,types:jt};l.Communication=vr,l.CoreError=j,l.Filter=$,l.Manager=I,l.MetadataStore=be,l.NotificationSystem=ie,l.WidgetButton=yn,l.WidgetIcon=re,l.WidgetImage=Nn,l.WidgetList=Fn,l.WidgetLoader=kn,l.WidgetMultiButton=Cn,l.WidgetSpinner=Te,l.WidgetTable=fn,l.actionService=Ur,l.asyncProcess=qn,l.authService=U,l.billingService=Q,l.catchUniversal=L,l.clickOutside=ge,l.clientService=Xe,l.communicationService=Xt,l.config=Wn,l.configuration=B,l.constants=C,l.dataService=ne,l.debounce=Jn,l.default=Qr,l.documentsService=Fr,l.equipmentService=Hr,l.fileService=Qt,l.getCellName=ut,l.getCellValue=dt,l.getNamesFromListConfig=Gn,l.groupArrayByField=xn,l.historyService=Gt,l.injectAction=ar,l.internationalizationService=xt,l.invitationService=Zt,l.openService=en,l.parseError=Ce,l.prettyDate=Fe,l.prettyDateWithTime=ft,l.prettyMoney=mt,l.prettyValueFieldByEntity=Xn,l.processWizardService=we,l.request=M,l.ruleValidationService=Ue,l.t=X,l.throttle=Yn,l.universalEntityCreate=_t,l.universalEntityDelete=wt,l.universalEntityRead=Se,l.universalEntityUpdate=qe,l.universalListSettingRead=rr,l.universalMetadataFieldTreat=ir,l.universalToolRead=Tt,l.useActions=_r,l.useCommunication=hr,l.useEnter=Nr,l.useFormEntity=gr,l.useListActiveRow=sr,l.useListEntity=cr,l.useListSearch=Wr,l.useListSelect=jr,l.useLogger=Kt,l.useManagerState=lr,l.useMetadata=yr,l.useSocket=k,l.useUsageContext=mr,l.useWizard=Kr,l.utils=Xr,l.uuidv4=zn,l.valuesToUpperCase=je,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
10
|
+
*/const Ze=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},et=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},tt=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},nt=function(){this.events={}};class D{constructor(){this.events={}}on(e,t){return Ze.call(this,e,t)}emit(e,t){return et.call(this,e,t)}off(e,t){return tt.call(this,e,t)}cleanEvents(){nt.call(this)}static on(e,t){return Ze.call(D,e,t)}static emit(e,t){return et.call(D,e,t)}static off(e,t){return tt.call(D,e,t)}static cleanEvents(){nt.call(D)}}D.events={};var rt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},ye=(n,e,t)=>(rt(n,e,"read from private field"),t?t.call(n):e.get(n)),Pe=(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)},De=(n,e,t,r)=>(rt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),te,me,Ee;const G=class R extends D{constructor(){super(...arguments),Pe(this,te,void 0),Pe(this,me,"front"),this.organizations=[],Pe(this,Ee,!1)}set language(e){localStorage.setItem(R.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(R.LOCALSTORAGE_LANGUAGE_KEY)||R.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(R.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){De(this,te,e)}get router(){if(!ye(this,te))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return ye(this,te)}set type(e){De(this,me,e)}get type(){return ye(this,me)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){De(this,Ee,e),this.emit(R.EVENT_READY_UPDATE,e)}get ready(){return ye(this,Ee)}onReady(e){return this.on(R.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(R.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(R.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(R.CURRENT_CONTEXT_KEY,String(e)),this.emit(R.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(R.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{Dt.add("error",j.ApiNotAvailable().message)}}loadCustomerData(){return Xe.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var t;return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const t=localStorage.getItem(this.getListKeyById(e));return t&&JSON.parse(t)}setListInformationToLocalStorage(e,t){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(t))}};te=new WeakMap,me=new WeakMap,Ee=new WeakMap,G.DEFAULT_LANGUAGE="en",G.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",G.EVENT_CONTEXT_UPDATE="event:context-update",G.EVENT_READY_UPDATE="event:ready-update",G.EVENT_DATA_UPDATE="event:data-update",G.CURRENT_CONTEXT_KEY="CurrentContext";let Mt=G;const it=new Mt;function Ut(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Pt}})}function m(n,e={}){return it.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=it.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw j.ApiNotAvailable()}).then(t=>Ut(t).then(r=>{if(!t.ok)throw r;return r}))}class _e{constructor(){}static parseNamesFromListConfig(e){let t=_e.parseFieldsToGraphQL(e.reduce((i,a)=>(a.name&&i.push(a.name),i),[]));function r(i){let a="";for(let u in i)typeof i[u]=="boolean"?a+=` ${u} `:a+=` ${u} { ${r(i[u])} }`;return a}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 a=i.indexOf("."),u=i.substring(a+1),s=i.substring(0,a);s in r||(r[s]={}),t(r[s],u)}else r[i]=!0;return r}return e.reduce(t,{})}}class Vt{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 Ft=new Vt;function ot(n){return n&&n[0].toLowerCase()+n.slice(1)}function Be(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=Be(r)),e[i]=r,e},{})}function Wt(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 qt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:_e,Journal:Ft,Request:m,clickOutside:ge,default:{Request:m,clickOutside:ge,getPropFromObject:he,runPromiseQueue:Ye,GraphQL:_e,firstChapterToLowerCase:ot,valuesToUpperCase:Be,prettyMoney:Wt},firstChapterToLowerCase:ot,getPropFromObject:he,runPromiseQueue:Ye,valuesToUpperCase:Be},Symbol.toStringTag,{value:"Module"})),jt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),ti="";class Gt{static readHistoryById(e,t){return m(`/close-api/audits/history/${e}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(r=>{const i=r.history.map(a=>{if(!a.changes)return a;const u=a.changes.map(s=>({...s,oldValue:s.originalValue,name:s.fieldName}));return{...a,changes:u}});return{...r,history:i}})}}class xt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return m(`/open-api/internationalization/language/${e}`)}}let x={};function X(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=O.utils.getPropFromObject((this==null?void 0:this.vocabulary)||x,n);if(typeof t=="string")return at(t,e);const r=O.utils.getPropFromObject(x==null?void 0:x.root,n);return typeof r=="string"?at(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function at(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}X.setGlobalVocabulary=function(n){x=n},X.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),X.bind({vocabulary:O.utils.getPropFromObject(x,e.toLowerCase())})},X.setVocabulary=function(n){return typeof n=="string"&&(n=O.utils.getPropFromObject(x,n)),X.bind({vocabulary:n})};const zt=function(){let n=!1;const e=[];function t(){return n}function r(d,f){t()&&console[d](...f),e.push(f)}function i(...d){r("log",d)}function a(...d){r("warn",d)}function u(...d){r("error",d)}function s(d=!0){n=d}return{info:i,warn:a,history:e,display:s,error:u}}();function Kt(){return zt}function Jt(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Yt="masterId",Ht="masterEntity";function Me(n,e){if(!Array.isArray(e))return;if(Jt(e))return t(e);e.forEach(t);function t(r){n.append(Ht,r[0]),n.append(Yt,r[1].toString())}}class ne{static async anonymousGetList(e){return await m(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,a)=>r.append(i,a),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(([s,d="desc"])=>`@${s} ${d}`).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=ne.getSearchParamsForEntityListRead(t||{});return await m(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=ne.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 i=new URLSearchParams;return Me(i,r==null?void 0:r.masterEntities),m(`/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 m(`/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 a=r.fields;typeof a=="string"&&(a=[a]),i.append("fields",a.join(" "))}return m(`/close-api/data/entities/${e}/id/${t}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,t,r,i){const a=new URLSearchParams;return Me(a,i==null?void 0:i.masterEntities),m(`/close-api/data/entities/${e}/id/${t}?${a.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 ne.removeByKeys(e,i,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 st=class fe{static async create(e){return m(fe.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(fe.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return m(`${fe.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return m(`${fe.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};st.url="/close-api/communications";let Xt=st;function ct(n){return{...n,createdEntities:n.createdEntites}}const lt=class Le{static async getStartConfig(e,t){return m([Le.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return m([Le.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(ct)}static async runStep(e,t,r,i,a){return m([Le.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:a})}).then(ct)}};lt.url="/close-api/views/process-wizard";let we=lt;class Qt{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(a=>a.json()).then(a=>(a.filename=e.name,a))}}class Zt{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 Ue{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return m(Ue.url+e,{method:"POST",body:JSON.stringify(t)})}}class en{static getConfiguration(){return m("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}const tn={class:"widget-table__head"},nn={class:"widget-table__head-label margin_0 text_overflow"},rn=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",tn,[(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",nn,o.toDisplayString(r.label),1)]))),128))]))}}),ni="",q=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},on=q(rn,[["__scopeId","data-v-b3ed6089"]]);function dt(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function ut(n,e){const t=dt(n);let r=t?O.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):n.value===null?null:r}function Ve(n){return["eservices-core",n].join(":")}function ft(n){return Fe(n,"YYYY/MM/DD HH:mm:ss")}function Fe(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return vt.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const ri="",re=q({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-0eae75d4"]]),an=$e(Ve("setup-list-row"));function sn(n,e){const t=n.config.map(r=>cn(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function cn(n,e,t){const r=e.values;let i=ut(n,r);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(g){a.onClick.push(()=>g(r))}function s(g){Array.isArray(g)?a.class.push(...g):a.class.push(g)}const d=[],f=[];if(n.hide&&n.hide(r))return[o.h("td")];if(n.type)switch(s(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Fe(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=ft(typeof i=="string"?i:null);break}case"money":{i=mt(i);break}case"multi-select":{f.push(o.h(O.FormField,{type:"single-checkbox",modelValue:e.selected})),u(pt.bind(null,t,!0));break}case"select":{f.push(o.h(O.FormField,{type:"single-radio",modelValue:e.selected})),u(pt.bind(null,t,!1));break}}if(n.onClick&&u(n.onClick),n.link)try{const g=n.link(r);if(g){const S=o.h(Ke.RouterLink,{to:g});f.push(S),s("widget-table-cell_link")}}catch(g){an("Can't add router link",g)}if(n.href&&(f.push(o.h("a",{href:n.href(r),target:"_blank"})),s("widget-table-cell_link")),typeof i=="boolean"&&(i=i?"✓":"—"),(typeof i=="string"||typeof i=="number")&&f.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&(typeof n.icon=="string"&&f.push(o.h(re,{name:n.icon})),typeof n.icon=="function")){const g=n.icon(r);g!==null&&f.push(o.h(re,{name:g}))}return n.class&&(typeof n.class=="function"?s(n.class(r)):s(n.class)),d.push(o.h("td",a,f)),d}function pt(n,e){n.emit("select",e)}function ht(n,e){return()=>{try{return sn(n,e)}catch(t){return console.warn(t),null}}}const ln={props:{values:Object,config:Object,selected:Boolean},setup:ht},dn=["colspan"],gt=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]=a=>e("close")),onSave:i[1]||(i[1]=a=>e("save",a))}),null,16,["values","new"]))],8,dn)],512))}}),C={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",TIME_TO_LIVE_SOCKET_REQUEST:3e4},un={class:"widget-table"},yt="update:selectedRows",fn=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 s;return(s=r==null?void 0:r.default)==null?void 0:s.call(r)[0]});function a(s,d=!0){if(!t.selectedRows)return;if(!d)return e(yt,t.selectedRows.includes(s)?[]:[s]);const f=[...t.selectedRows],g=f.indexOf(s);return g===-1?f.push(s):f.splice(g,1),e(yt,f)}function u(s){e("save",s),e("update:activeRow",null)}return(s,d)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",un,[o.createVNode(on,{config:s.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.array,(f,g)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:g},[o.createVNode(ln,{config:s.config,values:f,selected:s.selectedRows.includes(f),onSelect:S=>a(f,S),class:o.normalizeClass(s.classCallback?s.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&s.activeRow===f?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":s.config.length,values:f,onClose:d[0]||(d[0]=S=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),s.activeRow===o.unref(C).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":s.config.length,onClose:d[1]||(d[1]=f=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),pn=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))}}),oi="",Te=q(pn,[["__scopeId","data-v-0ae13719"]]),hn={class:"widget-button"},gn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",hn,[e.wait?(o.openBlock(),o.createBlock(Te,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),ai="",yn=q(gn,[["__scopeId","data-v-76d0d8eb"]]),mn={class:"widget-multi-button-wrap position_relative cursor_pointer"},En={class:"widget-multi-button-body grid"},_n=["onClick"],wn={class:"widget-multi-button-side-wrap"},Tn=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(u=>({"8e9f9746":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 a(u=!t.active){t.active=u}return(u,s)=>(o.openBlock(),o.createElementBlock("div",mn,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",En,[u.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:s[0]||(s[0]=d=>a())},o.toDisplayString(u.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(d,f)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:g=>{i(d.callback),a(!1)}},o.toDisplayString(d.label),9,_n))),128))]),o.createElementVNode("div",wn,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:s[1]||(s[1]=d=>a())},[t.wait?(o.openBlock(),o.createBlock(o.unref(Te),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(re),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),si="",Cn=q(Tn,[["__scopeId","data-v-2034ac0b"]]),Sn={class:"widget-loader flex flex-align_center gap_10 padding_15"},An={class:"text_md"},kn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",Sn,[o.createVNode(Te,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",An,o.toDisplayString(e.label),1)]))}}),bn=["alt","src"],Nn=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,bn))}}),On={props:{config:Array,values:Object,selected:Boolean},setup:ht},ci="",In=q(On,[["__scopeId","data-v-aa0613cb"]]),vn=n=>(o.pushScopeId("data-v-85ce2e65"),n=n(),o.popScopeId(),n),Rn={class:"widget-list-head-cell"},Ln=vn(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),$n=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",Rn,[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(O.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(a=>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]=a=>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(re),{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),Ln])]))}}),li="",Pn=q($n,[["__scopeId","data-v-85ce2e65"]]),Dn=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 d(T,E){let _=-1;do _++,E-=T[_];while(E>0&&_<T.length);return _}function f(T,E){let _=0;for(;E>0&&E>T[_]&&_<T.length;)E-=T[_],_++;return console.log(E,_),_>0?_:0}function g(T){try{i.value.style.insetInlineStart=T+"px"}catch(E){console.log(E)}}function S(T){try{i.value.style.width=T+"px",i.value.style.minWidth=T+"px",i.value.style.maxWidth=T+"px"}catch(E){console.log(E)}}function P(T){return T===null?!1:T.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(E){var Nt;function _(v){return v.screenX+p-N}const h=r.value,c=[...h.children].filter(v=>v.localName==="th"),p=((Nt=h.offsetParent)==null?void 0:Nt.scrollLeft)||0,y=c.map(v=>v.clientWidth),b=P(E.target),N=h.getBoundingClientRect().left,Z=_(E),A=d(y,Z),H=y.slice(0,A).reduce((v,V)=>v+V,0),le=Z-H,xe=h.offsetWidth,de=c[A].clientWidth;if(t.config[A].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",E.screenX),console.log("Widths",y),console.log("max width",xe),console.log("Start Position",Z),console.log("Position From",A),console.log("Start Position",A),console.log("Global offset (Отступ самой таблицы от края экрана)",N),console.log("Del",le),console.groupEnd(),i.value.innerText=c[A].textContent||"",i.value.style.display="grid",i.value.style.width=de+"px",i.value.style.cursor="grabbing",g(H),S(de),document.addEventListener("pointermove",bt,{passive:!0}),document.addEventListener("pointerup",kt);function kt(v){if(console.group("END"),document.removeEventListener("pointermove",bt),document.removeEventListener("pointerup",kt),b&&(t.config[A].width=i.value.style.width,t.config[A].minWidth=i.value.style.width,t.config[A].maxWidth=i.value.style.width,a(t.config)),!b){const V=v.screenX+p-N;console.log("ENP Position",V);const Re=f(y,V);if(console.log(A,"->",Re),Re!==A){const ue=t.config[A],ze=t.config;ze.splice(A,1),ze.splice(Re,0,ue),a(ze)}else{const ue=t.config[A].name;u(ue)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function bt(v){if(b){const ue=_(v)-Z+de;S(ue);return}let V=v.screenX+p-N-le;V<0&&(V=0),V+de>xe&&(V=xe-de),g(V)}})});function a(d){e("update:config",d)}function u(d){if(!d)return;if(Array.isArray(d)){if(d.length<1)return;d=d[0]}if(t.order.length===0||t.order[0]!==d)return void s([d]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";s([d,f==="asc"?"desc":"asc"])}function s(d){e("update:order",d)}return(d,f)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.config,(g,S)=>(o.openBlock(),o.createBlock(Pn,o.mergeProps({key:g},g,{onOrder:P=>u(g.name),onSelect:f[0]||(f[0]=P=>e("select")),order:d.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),di="",Bn=q(Dn,[["__scopeId","data-v-6173c14c"]]),Mn={class:"widget-list"},Un={class:"widget-list-body position_relative"},Vn=50,Fn=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(s,d=!0){if(t.selectedRows)if(!d)a(t.selectedRows.includes(s)?[]:[s]);else{const f=[...t.selectedRows],g=f.indexOf(s);g===-1?f.push(s):f==null||f.splice(g,1),a(f)}}function i(){var s;if(((s=t.selectedRows)==null?void 0:s.length)!==t.array.length)return a([...t.array]);a([])}function a(s){e("update:selectedRows",s)}function u(s){if(!s)return;const d=s.target;d.scrollTop+d.clientHeight+Vn>d.scrollHeight&&e("scrollEnd")}return(s,d)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[o.createElementVNode("table",Mn,[o.createElementVNode("thead",null,[o.createVNode(Bn,{onSelect:d[0]||(d[0]=f=>i()),"onUpdate:order":d[1]||(d[1]=f=>e("update:order",f)),"onUpdate:config":d[2]||(d[2]=f=>e("update:config",f)),config:s.config,order:s.order},null,8,["config","order"])]),o.createElementVNode("tbody",Un,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.array,(f,g)=>{var S;return o.openBlock(),o.createBlock(In,{key:g,class:"widget-list-row",values:f,config:s.config,selected:(S=s.selectedRows)==null?void 0:S.includes(f),onSelect:P=>r(f,P)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),B={};function Wn(n){for(let e in n)B[e]=n[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function qn(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 Ce(n){return typeof n=="string"?We(n):jn(n)?We(n.message):We(C.DEFAULT_ERROR_MESSAGE)}function jn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function We(n){return{message:n}}function L(n="error"){return function(e){const{message:t}=Ce(e);ie.add(n,t)}}function Se(n,e={}){return k().emit("entity:read",{...e,entity:n})}function qe(n,e){return k().emit("entity:update",{...e,entity:n})}function Gn(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function mt(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 je(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=je(r)),e[i]=r,e},{})}function xn(n,e){const t=new Map;return n.forEach(r=>{var a;const i=e(r);t.has(i)||t.set(i,[]),(a=t.get(i))==null||a.push(r)}),t}function zn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Kn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return C.DEFAULT_ERROR_MESSAGE}})}function M(n,e={}){return I.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=I.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw new Error(C.DEFAULT_ERROR_MESSAGE)}).then(t=>Kn(t).then(r=>{if(!t.ok)throw r;return r}))}function Jn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Yn(n,e){let t=!1;return(...r)=>{if(!t)return t=!0,setTimeout(()=>t=!1,e),n(...r)}}const Hn=$e(Ve("pretty-value-field-by-entity"));function Xn(n,e,t){try{const r=be.get(n);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${n} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch(r){return Hn('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,n,e,t),t}}const Qn=1,Zn=5e3,z=$e(Ve("use-socket"));function k(){return tr}function er(n){return typeof n=="object"&&Object.prototype.toString.call(n)==="[object Blob]"}const tr=function(){let n=1,e,t;const r=new Set;let i=0;const a=new Set;function u(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},Zn*2);const c=new Uint8Array(1);c[0]=Qn,e.send(c)}setInterval(()=>{Array.from(r).forEach(c=>{h(c)&&(z("Handler for event %s requestId %d was expired",c.event,c.requestId),c.requestId?d({requestId:c.requestId,event:"request-error",data:{message:j.RequestTookToLong().message}}):r.delete(c))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&f()},C.DELAY_SOCKET_RECONNECT);function s(){return{safeQueue:a,requestId:n,handlers:r,socketInstance:e}}function d(c){const p=[...r.values()];z("Handlers array length is %d. Response event: %s. Request id: %d",r.size,c.event,c.requestId),p.forEach(y=>{const b=c.requestId;(y.requestId&&y.requestId===b||!y.requestId&&y.event===c.event)&&(z("Find appropriated handler: %d, event: %s",n,y.event),y.callback(c.data,c),y.once&&(r.delete(y),z("Handler was removed by *once* params was passed. %o",y)))})}function f(){if(typeof t!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${t}`,"color: purple","color: black"),e=new WebSocket(t),e.onclose=function(c){z("Connection to server was stopped: %d %s",c.code,c.reason),Array.from(r).forEach(p=>{p.guaranteedAnswer&&p.serializeString&&a.add(p.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(c=>{g(c),a.delete(c)})},e.onerror=function(c){console.warn(c)},e.onmessage=c=>{var p;try{if(er(c.data)){u();return}const y=JSON.parse(c.data);if(!Et(y)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(y);return}(p=y==null?void 0:y.data)!=null&&p.refresh&&location.reload(),d(y)}catch(y){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(y)}}}function g(c){e.send(c)}function S(c,p){_({event:c,callback:p})}function P(c,p){_({event:c,callback:p,once:!0})}function T(){return e&&(e==null?void 0:e.readyState)===1}function E(c,p,y){const b=++n,N=JSON.stringify({requestId:b,event:c,data:p,contextId:I.contextId,url:window.location.href});return T()?g(N):(a.add(N),z("Socket is not connected. Message was send to save-queue")),new Promise((Z,A)=>{_({event:c,requestId:b,once:!0,guaranteedAnswer:!0,serializeString:N,callback:(H,le)=>{if(z("Promise was resolve with next data:",H),nr(le))return void A(H);y&&y(H,le),Z(H)},timeToLive:C.TIME_TO_LIVE_SOCKET_REQUEST})})}function _(c){const p={timeToLive:0,...c,created:new Date().getTime()};r.add(p)}function h(c){return c.timeToLive===0||typeof c.timeToLive!="number"?!1:new Date().getTime()-c.created>c.timeToLive}return{get socket(){return e},on:S,once:P,emit:E,initialization(c){t=c},getDevInfo:s}}(),nr=n=>!!Et(n)&&n.event==="request-error",Et=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){return k().emit("list-setting:read",{entity:n,mark:e})}function ir(n,e){return k().emit("metadata-field:treat",{entity:n,fieldName:e})}function _t(n,e){return k().emit("entity:create",{...e,entity:n})}function wt(n,e){return k().emit("entity:delete",{...e,entity:n})}function or(n,e){return k().emit("usage-context:read",{...e,entity:n})}function Tt(n={}){return k().emit("tool:read",n)}function ar(n,e={},t={}){const r=o.inject(C.PROVIDE_NAME_ACTIONS,null),i=typeof n=="string"?n:e,a=typeof e=="string"?t:e;return o.computed(()=>{var d;const s=((typeof n=="string"?(d=r==null?void 0:r.actions)==null?void 0:d.value:o.unref(n))||[]).find(f=>f.name===i);return s?{...s,...a}:null})}function sr(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}function cr(n,e,t={}){const r=o.reactive([]);let i=0;const a=o.ref(!1);function u(){if(a.value)return Promise.reject("The process has already started.");const h=E();return a.value=!0,typeof h.limit!="number"&&(h.limit=100),h.offset=i,(t.request||Se)(n,h).then(p=>(i+=p.length,p)).finally(()=>{a.value=!1})}function s(h,c){var y;return typeof h.Version=="number"?h.Version:(y=r.find(b=>b.Id===c))==null?void 0:y.Version}function d(h,c){const p=r.findIndex(y=>y.Id===h);if(p===-1)throw new Error(`Can't found item with Id ${h}`);r.splice(p,1,c)}function f(h){const c=r.findIndex(p=>p.Id===h);if(c===-1)throw new Error(`Can't found item with Id ${h}`);r.splice(c,1)}async function g(h,c){try{const p=E(),y=s(c,h);delete c.Version,await qe(n,{id:h,values:c,version:y});const b=await Se(n,{fields:p.fields||"",id:h});d(h,b)}catch(p){L()(p)}}async function S(h,c){try{const p=E(),y=s(c,h);delete c.Version,await wt(n,{id:h,version:y}),f(h)}catch(p){L()(p)}}async function P(h){try{await _t(n,{values:h}),await _()}catch(c){L()(c)}}async function T(){try{const h=await u();r.push(...h)}catch(h){L()(h)}}function E(){return typeof e=="function"?e():e}async function _(){try{i=0;const h=await u();r.splice(0,r.length,...h)}catch(h){L()(h)}}return{array:r,updateById:g,next:T,reload:_,wait:a,create:P,deleteById:S}}function lr(){function n(){return{organizations:I.organizations,currentContextId:I.contextId,person:I.person,context:I.context,contextType:I.contextType,userId:I.userId}}const e=o.reactive(n());return I.onupdateContext(()=>{Object.assign(e,n())}),e}function dr(n,e,t){return k().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function ur(n,e,t){return k().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function fr(n,e){return k().emit("communication-message:create",{communicationId:n,text:e})}function pr(n){return k().emit("communication-message:read",{communicationId:n})}function hr(n){const e=O.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>pr(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function gr(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw j.EntityWithoutName(n);return Se(n.name,r)}).then(je).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(L())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw j.EntityWithoutName(n);return qe(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw L()(i),i})};function t(){return typeof e=="function"?e():e}}function yr(n){if(!n)return o.inject(C.PROVIDE_NAME_METADATA);be.initEntity(n);const e=o.computed(()=>be.state[n]);return o.provide(C.PROVIDE_NAME_METADATA,e),e}function mr(n,e={}){if(!n)return o.inject(C.PROVIDE_NAME_USAGE_CONTEXT);const t=o.ref(null);return o.provide(C.PROVIDE_NAME_USAGE_CONTEXT,t),{state:t,update:async function(){t.value=await or(n,Er(e||{}))}}}function Er(n){return typeof n=="function"?n():n}function _r(n){if(!n)return o.inject(C.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),t=o.computed(()=>e.map(a=>wr(n,a))),r={actions:t,update:i};o.provide(C.PROVIDE_NAME_ACTIONS,r),n.router=Ke.useRouter(),n.handleConfirmation||(n.handleConfirmation=Cr),n.handleAffectedEntity||(n.handleAffectedEntity=Ar),n.handleCloseForm||(n.handleCloseForm=kr),n.handleValidationResult||(n.handleValidationResult=Sr);function i(a={}){return e.splice(0,e.length),Tt(a).then(u=>e.splice(0,0,...u)).catch(L("error"))}return{actions:t,update:i}}function wr(n,e){return{...e,label:e.title,callback(){const t=typeof n.values=="function"?n.values(e,n):n.values,r=()=>M(e.url,{method:"POST",body:JSON.stringify({keys:t,contextId:I.contextId}),headers:{"Content-Type":"application/json"}}).then(async i=>{var a,u;if(!br(i))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(n.handlers))for await(const s of n.handlers)await s(e,i,n);if(!i.success)throw n.handleValidationResult&&i.validationEffect&&((u=(a=i.validationEffect)==null?void 0:a.results)!=null&&u.length)&&n.handleValidationResult(e,i.validationEffect,n),new Error(i.message);return i.message&&ie.add("info",i.message),Array.isArray(i.affectedEntities)&&n.handleAffectedEntity&&i.affectedEntities.forEach(s=>{var d;return(d=n.handleAffectedEntity)==null?void 0:d.call(n,e,s,n)}),e.closeHostForm&&n.handleCloseForm&&n.handleCloseForm(e,n),i}).catch(L("error"));return e.requireSave&&n.form&&n.form.changed?n.form.save().then(r):!e.confirmation||!n.handleConfirmation?r():n.handleConfirmation(e,r)}}}function Tr(n){const e="Are you sure?";return n===!0||typeof n=="string"&&n.toLowerCase()==="true"||n==="1"?e:typeof n=="string"?n:e}async function Cr(n,e){const t=Tr(n.confirmation);if(!pe.getComponentFromStore(C.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await pe.promptModal(C.MODAL_CONFIRM,{message:t}))return e()}function Sr(n,e){const t=C.MODAL_VALIDATION_EFFECT;if(!pe.getComponentFromStore(t))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{pe.pushModal(t,e)})}function Ar(n,e,t){var u;const{router:r,form:i}=t,a=(u=e.primaryKey)==null?void 0:u.Id;if(r&&e&&e.name===n.redirectEntity)return r.push({name:e.name,params:{id:a}});i&&e.name===i.name&&e.updated&&a===i.id&&i.read()}function kr(n,e){const{router:t}=e;t&&n.closeHostForm&&t.back()}function br(n){return!!(n&&typeof n=="object"&&"affectedEntities"in n&&"success"in n)}function Nr(n){function e(t){t.key==="Enter"&&n()}o.onMounted(()=>{document.addEventListener("keypress",e)}),o.onUnmounted(()=>{document.removeEventListener("keypress",e)})}function Or(n){const e=o.reactive([]),t=s=>{const d=o.unref(n);if(s===void 0){e.length===0?d.forEach(i):d.forEach(a);return}r(s)?a(s):i(s)},r=s=>e.includes(s),i=s=>{r(s)||e.push(s)},a=s=>{const d=e.findIndex(f=>f===s);d!==-1&&e.splice(d,1)},u=o.computed(()=>{const s=o.unref(n);return e.length===s.length&&s.length!==0});return[e,t,u,i,a]}const ie=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=Ir(r),a=new vr(e,t,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function Ir(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 Ct=class It{constructor(e,t,r,i,a){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=a,this.id=It.cardId++}};Ct.cardId=1;let vr=Ct;class Rr extends D{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return fr(this.id,e)}static checkAndGenerate(e,t,r){return ur(e,t,r).then(i=>i.length===0?dr(e,t,r):i[0])}}function Lr(){return k().emit("client:read",{})}var St=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},$r=(n,e,t)=>(St(n,e,"read from private field"),t?t.call(n):e.get(n)),Pr=(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)},Dr=(n,e,t,r)=>(St(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ae;const ke=class ee extends D{constructor(){super(...arguments),this.type="front",this.organizations=[],Pr(this,Ae,!1)}set language(e){localStorage.setItem(C.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(C.LOCALSTORAGE_LANGUAGE_KEY)||ee.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Dr(this,Ae,e),this.emit(ee.EVENT_READY_UPDATE,e)}get ready(){return $r(this,Ae)}onReady(e){return this.on(ee.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(ee.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(C.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(ee.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.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){L()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(C.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Lr()}validateContextId(e){var t;try{return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};Ae=new WeakMap,ke.DEFAULT_LANGUAGE="en",ke.EVENT_CONTEXT_UPDATE="event:context-update",ke.EVENT_READY_UPDATE="event:ready-update";let Br=ke;function Mr(n){return k().emit("metadata:read",{entity:n})}const be=function(){const e=o.reactive({}),t=new Map;function r(s){return e[s]}async function i(s){if(t.has(s)&&await t.get(s),e[s])return;const d=await a(s);u(s,d)}function a(s){const d=Mr(s).finally(()=>{t.delete(s)});return t.set(s,d),d}function u(s,d){e[s]=d}return{state:e,initEntity:i,get:r}}();class U{static login(e){return M(B.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:B.applicationName})})}static parseProcessAnswer(e){if(e.statusCode>4)throw new Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return U.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return U.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return U.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return U.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return M(`${B.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)})}static startLoginProcess(e){return U.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return U.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return U.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return M(`${B.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).then(U.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startPasswordReset(e,t){return M(`${B.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:t,AppName:e})})}static confirmPhoneNumberByAccessRecovery(e,t,r,i){return M(`${B.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:t,Prefix:r,Code:i})})}static confirmEmailByAccessRecovery(e,t,r,i){return M(`${B.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:t,Prefix:r,Code:i})})}static finishAccessRecovery(e,t,r){return M(`${B.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:t,Password:r,ConfirmedPassword:r})})}}function Ur(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function $(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(Ur(r)){let i=function(a){var u;return((u=a.match(/([^Z]*)/))==null?void 0:u[0])+"0000Z"};return r.start&&e.push(`@${t} ge ${i(r.start)}`),r.end&&e.push(`@${t} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${t} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${t} eq '${r}'`),e):(r===null&&e.push($.is(t,r)),e)},[]).join(" and ")}function oe(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${oe(t)}`},$.beginWith=function(e,t){return`@${e} BeginWith ${oe(t)}`},$.notEq=function(e,t){return`@${e} nq ${oe(t)}`},$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${oe(t)}`},$.in=function(e,t){const r=t.map(oe).join(", ");return`@${e} in (${r})`},$.and=function(...e){return e.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(t=>`(${t})`).join(" and ")},$.is=function(e,t){return`@${e} is ${t}`},$.or=function(...e){return e.join(" or ")};const I=new Br;class Vr{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 Me(i,r),M([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function Fr(n,e="images"){return`/static-folder/${e}/${n}`}class Wr{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(a=>a.json())}}class Q{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Q.url()}/calculator/${e}`)}static calculate(e,t){return m(`/${Q.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]):j.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(`/${Q.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return m(`/${Q.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}var At=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},F=(n,e,t)=>(At(n,e,"read from private field"),t?t.call(n):e.get(n)),K=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},J=(n,e,t,r)=>(At(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ne,ae,Oe,Ie,se,ce,Ge;const Y="_______LIST_______ROW_______INDEX________NAME_______",ve=class W extends D{constructor(e){super(),this.LIST_ROW_KEY=1,K(this,Ne,void 0),this.array=[],K(this,ae,[]),K(this,Oe,[]),K(this,Ie,new Proxy({},{set:(t,r,i,a)=>(t[r]=i,this.emit(W.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(W.EVENT_FILTERS_UPDATE,t),!0)})),K(this,se,!1),K(this,ce,(...t)=>Promise),K(this,Ge,()=>{}),J(this,Ne,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&J(this,ae,e.config)}set config(e){J(this,ae,e.map(O.utils.copyObject)),this.emitUpdateConfig()}get config(){return F(this,ae)}emitUpdateConfig(){this.emit(W.EVENT_CONFIG_UPDATE,this.config)}get order(){return F(this,Oe)}set order(e){J(this,Oe,e),this.emit(W.EVENT_ORDER_UPDATE,this.order)}get filters(){return F(this,Ie)}set filters(e){jr(F(this,Ie),e)}set wait(e){J(this,se,e),this.emit(O.Form.EVENT_WAIT,F(this,se))}get wait(){return F(this,se)}get primaryKeys(){return F(this,Ne)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[Y]===e)}indexByKey(e){return this.array.findIndex(t=>t[Y]===e)}static getKey(e){return e[Y]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,Y)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(W.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(W.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(W.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[Y]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,Y)}set read(e){J(this,ce,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=F(this,ce).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){J(this,ce,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>F(this,Ge).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,[Y]: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=W.getCellName(e),i=(()=>{let a=r?he(t,r):null;return a===void 0&&(a=null),e.value?e.value(a,t):a})();return{name:r,value:i}}};Ne=new WeakMap,ae=new WeakMap,Oe=new WeakMap,Ie=new WeakMap,se=new WeakMap,ce=new WeakMap,Ge=new WeakMap,ve.EVENT_DATA="list-data: update",ve.EVENT_CONFIG_UPDATE="list-config:update",ve.EVENT_ORDER_UPDATE="list-order:update",ve.EVENT_FILTERS_UPDATE="list-filters:update";function qr(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 jr(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Gr(n){return n.statusName==="Completed"}function xr(n){return n.statusName==="FinalStepWithConfirmation"}function zr(n){return n.statusName==="ValidationError"}function Kr(n,e,t){let r=null;const i=o.reactive({wait:null});let a=[],u=null;const s=o.ref(null);function d(){s.value=a.find(c=>c.name===u)||null}function f(){var c;return u?((c=a.find(p=>p.name===u))==null?void 0:c.fields)||[]:[]}function g(c){if(d(),zr(c))return void t.onValidation(c.validationResults);if((c.statusName==="FinalStep"||c.statusName==="NextStep")&&(!f().length||Jr(f(),t.presets)))return h(t.presets||{});Gr(c)&&t.onCompleted(c),xr(c)&&t.onConfirmation(c)}async function S(){try{await P(),await _()}catch(c){const{message:p}=Ce(c);ie.add("error",p)}}function P(){return i.wait="Loading process information.",we.getStartConfig(e,n).then(c=>{a=c.steps.map(p=>({label:p.title,name:p.stepName,number:p.number,fields:p.frontendEntity.objectTypes.reduce((y,b)=>(b.properties.forEach(N=>{y.push({name:N.name,label:N.title,type:N.refEntityName||N.dataType})}),y),[])}))}).then(c=>(i.wait=!1,c))}function T(c){return u=c.nextStepName,r=c.token,c}function E(c){const p=Ce(c);ie.add("error",p.message)}function _(){return i.wait="Starting process",we.startProcess(e,n).then(T).then(g).catch(E).finally(()=>{i.wait=null})}function h(c={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Waiting for result...",we.runStep(e,n,u,r,c).then(T).then(g).catch(E).finally(()=>{i.wait=!1}))}return{initialize:S,state:i,currentStepConfig:o.readonly(s),next:h}}function Jr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!O.utils.getPropFromObject(e,r.name))return!1}return!0}const Yr="close-api/proxy/Equipment/Search";class Hr{static search(e,t,r,i,a){const u=new URLSearchParams;u.append("pattern",e||""),t&&u.append("categoryId",t),r&&u.append("useType",String(r)),i&&u.append("statusCode",i),a&&(u.append("limit",String(a.limit)),u.append("offset",String(a.offset)));const s=`/${Yr}?${u.toString()}`;return m(s,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Xr={clickOutside:ge,staticLink:Fr},Qr={usage:$t,utils:qt,types:jt};l.Communication=Rr,l.CoreError=j,l.Filter=$,l.Manager=I,l.MetadataStore=be,l.NotificationSystem=ie,l.WidgetButton=yn,l.WidgetIcon=re,l.WidgetImage=Nn,l.WidgetList=Fn,l.WidgetLoader=kn,l.WidgetMultiButton=Cn,l.WidgetSpinner=Te,l.WidgetTable=fn,l.actionService=Vr,l.asyncProcess=qn,l.authService=U,l.billingService=Q,l.catchUniversal=L,l.clickOutside=ge,l.clientService=Xe,l.communicationService=Xt,l.config=Wn,l.configuration=B,l.constants=C,l.dataService=ne,l.debounce=Jn,l.default=Qr,l.documentsService=Wr,l.equipmentService=Hr,l.fileService=Qt,l.getCellName=dt,l.getCellValue=ut,l.getNamesFromListConfig=Gn,l.groupArrayByField=xn,l.historyService=Gt,l.injectAction=ar,l.internationalizationService=xt,l.invitationService=Zt,l.openService=en,l.parseError=Ce,l.prettyDate=Fe,l.prettyDateWithTime=ft,l.prettyMoney=mt,l.prettyValueFieldByEntity=Xn,l.processWizardService=we,l.request=M,l.ruleValidationService=Ue,l.t=X,l.throttle=Yn,l.universalEntityCreate=_t,l.universalEntityDelete=wt,l.universalEntityRead=Se,l.universalEntityUpdate=qe,l.universalListSettingRead=rr,l.universalMetadataFieldTreat=ir,l.universalToolRead=Tt,l.useActions=_r,l.useCommunication=hr,l.useEnter=Nr,l.useFormEntity=gr,l.useListActiveRow=sr,l.useListEntity=cr,l.useListSearch=qr,l.useListSelect=Or,l.useLogger=Kt,l.useManagerState=lr,l.useMetadata=yr,l.useSocket=k,l.useUsageContext=mr,l.useWizard=Kr,l.utils=Xr,l.uuidv4=zn,l.valuesToUpperCase=je,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
11
11
|
//# sourceMappingURL=eservices-core.umd.js.map
|
|
@@ -25,7 +25,7 @@ import staticLink from "./utils/static-link";
|
|
|
25
25
|
import documentsService from "./services/documents-service";
|
|
26
26
|
import billingService from "./services/billing-service";
|
|
27
27
|
import { IListSettings } from "./services/configuration-service";
|
|
28
|
-
import {
|
|
28
|
+
import { IListFilter, useListSearch } from "./classes/new/List";
|
|
29
29
|
import { useWizard } from "./hooks/use-wizard";
|
|
30
30
|
import equipmentService from "./services/equipment-service";
|
|
31
31
|
export type { IListSettings, INotificationConfig, IListFilter, };
|
|
@@ -33,7 +33,7 @@ export { useLogger, billingService, documentsService, internationalizationServic
|
|
|
33
33
|
/**
|
|
34
34
|
* @deprecated
|
|
35
35
|
* */
|
|
36
|
-
clickOutside, useListSearch, equipmentService,
|
|
36
|
+
clickOutside, useListSearch, equipmentService, };
|
|
37
37
|
export { CoreError, IActionResponse, historyService };
|
|
38
38
|
export { fileService, processWizardService, dataService, communicationService, invitationService, ruleValidationService, openService, IParsedHistoryResponse, actionService, };
|
|
39
39
|
/**
|
|
@@ -61,8 +61,8 @@ import { WidgetButton, WidgetMultiButton, WidgetIcon, WidgetSpinner, WidgetTable
|
|
|
61
61
|
import { injectAction, universalToolRead, getCellName, universalEntityDelete, universalEntityCreate, universalMetadataFieldTreat, universalListSettingRead, prettyValueFieldByEntity, throttle, debounce, request, uuidv4, groupArrayByField, valuesToUpperCase, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, getCellValue, universalEntityRead, universalEntityUpdate, getNamesFromListConfig } from "./../src/index";
|
|
62
62
|
import type { IValidationEffectItem, IAffectedEntity, IActionOptions, IActionReadOptions, ITool, IToolResult, IUsageContext, ILoginValues, IListTreatmentField, IMasterEntity, IExtendedMetadata, INavigationRecord, IListCell, INotificationType, IMultiButtonItem, IEntityId, IEntityVersion, IUniversalEntityReadListOptions, IUniversalEntityReadSingleOptions, IUniversalEntityUpdateOptions, IUniversalEntityReadOptions, IValues, IListOrder, IUniversalEntityCreateOptions, IUniversalEntityCreatingResult, IUniversalEntityUpdatingResult } from "./../src/index";
|
|
63
63
|
import { constants, config, configuration } from "./../src/index";
|
|
64
|
-
import { useEnter, useActions, useUsageContext, useMetadata, useFormEntity, useCommunication, useListActiveRow, useSocket, useListEntity, useManagerState } from "./../src/index";
|
|
64
|
+
import { useListSelect, useEnter, useActions, useUsageContext, useMetadata, useFormEntity, useCommunication, useListActiveRow, useSocket, useListEntity, useManagerState } from "./../src/index";
|
|
65
65
|
import { NotificationSystem, Manager, Communication, MetadataStore } from "./../src/index";
|
|
66
66
|
import { Filter } from "./../src/index";
|
|
67
67
|
import { authService } from "./../src/index";
|
|
68
|
-
export { authService, NotificationSystem, Manager, Communication, MetadataStore, constants, config, configuration, WidgetButton, WidgetMultiButton, WidgetIcon, WidgetSpinner, WidgetTable, WidgetLoader, WidgetImage, WidgetList, prettyValueFieldByEntity, throttle, debounce, request, groupArrayByField, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, universalListSettingRead, universalEntityDelete, universalMetadataFieldTreat, universalEntityCreate, getNamesFromListConfig, getCellValue, valuesToUpperCase, uuidv4, getCellName, universalToolRead, injectAction, IListCell, IListOrder, INotificationType, IMultiButtonItem, IEntityId, IEntityVersion, IUniversalEntityReadListOptions, IUniversalEntityReadSingleOptions, IUniversalEntityReadOptions, IUniversalEntityUpdateOptions, IValues, INavigationRecord, IMasterEntity, IExtendedMetadata, IListTreatmentField, IUniversalEntityCreateOptions, IUniversalEntityCreatingResult, IUniversalEntityUpdatingResult, ILoginValues, IUsageContext, IAffectedEntity, IActionOptions, IActionReadOptions, ITool, IToolResult, IValidationEffectItem, useActions, useListActiveRow, useSocket, useListEntity, useManagerState, useFormEntity, useMetadata, useCommunication, useUsageContext, useEnter, Filter, };
|
|
68
|
+
export { authService, NotificationSystem, Manager, Communication, MetadataStore, constants, config, configuration, WidgetButton, WidgetMultiButton, WidgetIcon, WidgetSpinner, WidgetTable, WidgetLoader, WidgetImage, WidgetList, prettyValueFieldByEntity, throttle, debounce, request, groupArrayByField, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, universalListSettingRead, universalEntityDelete, universalMetadataFieldTreat, universalEntityCreate, getNamesFromListConfig, getCellValue, valuesToUpperCase, uuidv4, getCellName, universalToolRead, injectAction, IListCell, IListOrder, INotificationType, IMultiButtonItem, IEntityId, IEntityVersion, IUniversalEntityReadListOptions, IUniversalEntityReadSingleOptions, IUniversalEntityReadOptions, IUniversalEntityUpdateOptions, IValues, INavigationRecord, IMasterEntity, IExtendedMetadata, IListTreatmentField, IUniversalEntityCreateOptions, IUniversalEntityCreatingResult, IUniversalEntityUpdatingResult, ILoginValues, IUsageContext, IAffectedEntity, IActionOptions, IActionReadOptions, ITool, IToolResult, IValidationEffectItem, useActions, useListActiveRow, useSocket, useListEntity, useManagerState, useFormEntity, useMetadata, useCommunication, useUsageContext, useEnter, useListSelect, Filter, };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Ref, ComputedRef } from "vue";
|
|
2
|
+
/**
|
|
3
|
+
* @description Данный хук используется для того, чтобы создать выборку из массива.
|
|
4
|
+
* Данный хук позволяет хранить и работать с выделенными элементами. В первом элементе
|
|
5
|
+
* возвращаемого массива хранятся выделенные элементы. Для удобства работы и всеобщего
|
|
6
|
+
* использования в массиве не хранятся идентификаторы, а хранятся целиком объекты.
|
|
7
|
+
* @param storedItems - Реактивный объект значений. Может передаваться как ref и как reactive(обычный массив)
|
|
8
|
+
*/
|
|
9
|
+
export default function useListSelect<T>(storedItems: Ref<T[]> | T[]): [
|
|
10
|
+
T[],
|
|
11
|
+
((value?: T) => void),
|
|
12
|
+
ComputedRef<boolean>,
|
|
13
|
+
((value: T) => void),
|
|
14
|
+
((value: T) => void)
|
|
15
|
+
];
|
|
@@ -73,7 +73,8 @@ import { useMetadata } from './hooks/use-metadata';
|
|
|
73
73
|
import { useUsageContext } from './hooks/use-usage-context';
|
|
74
74
|
import { useActions } from './hooks/use-actions';
|
|
75
75
|
import { useEnter } from './hooks/use-enter';
|
|
76
|
-
|
|
76
|
+
import useListSelect from './hooks/use-list-select';
|
|
77
|
+
export { useListActiveRow, useSocket, useListEntity, useManagerState, useCommunication, useFormEntity, useMetadata, useUsageContext, useActions, useEnter, useListSelect };
|
|
77
78
|
/******
|
|
78
79
|
CLASSES
|
|
79
80
|
******/
|