eservices-core 1.3.45 → 1.3.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.es-list-container{overflow:auto}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.widget-table__head-cell[data-v-25198f4a]{padding:18px;text-align:start}.widget-table__head-label[data-v-25198f4a]{font-weight:600;font-size:14px;line-height:19px}[dir=rtl] .icon[data-v-e287c8d9]{transform:scaleX(-1)}.widget-spinner[data-v-0ef9ae88],.widget-spinner[data-v-0ef9ae88]:after{border-radius:50%;width:14px;height:14px}.widget-spinner[data-v-0ef9ae88]{font-size:2px;position:relative;text-indent:-9999em;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid #ffffff;transform:translateZ(0);animation:spinnerAnimation-0ef9ae88 1.1s infinite linear}@keyframes spinnerAnimation-0ef9ae88{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.widget-button[data-v-450dc564]{position:relative}.widget-button-spinner[data-v-450dc564]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.widget-multi-button-wrap[data-v-a8d711d1]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-a8d711d1]{grid-template-columns:1fr var(--button-size);background-color:var(--primary);grid-template-rows:var(--button-size);transition:var(--fast)}.widget-multi-button_active[data-v-a8d711d1]{grid-template-rows:calc(var(--button-size) * var(--7025434e))}.widget-multi-button-body[data-v-a8d711d1]{min-width:80px}.widget-multi-button-body-label[data-v-a8d711d1]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-a8d711d1]:hover{background-color:#223296}.widget-multi-button-side[data-v-a8d711d1]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-a8d711d1]{transform:rotate(180deg)}.widget-multi-button-side[data-v-a8d711d1]:hover{background-color:#223296}tr[data-v-344a8cc1]{border:1px solid #F3F4FC;height:30px}th[data-v-344a8cc1],td[data-v-344a8cc1]{position:relative;padding:0 11px}th[data-v-344a8cc1]{text-align:left}p[data-v-344a8cc1]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.widget-list-head-cell[data-v-bf495d6a]{padding:0 0 0 10px;display:flex}.widget-list-head-cell[data-v-bf495d6a]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-bf495d6a]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-bf495d6a]{position:absolute;inset-inline-end:22px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-bf495d6a]{transform:rotate(180deg)}.head-cell-resize[data-v-bf495d6a]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-bf495d6a]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-bf495d6a]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-ccffc6bd]{position:sticky;top:-1px;z-index:1}.test-block[data-v-ccffc6bd]{position:absolute;z-index:2;display:none;height:calc(100% + 1px);place-content:center;inset-block-start:-1px;padding-inline:10px;background-color:#e7f2ff;-webkit-user-select:none;user-select:none;white-space:nowrap}.widget-list-head th[data-v-ccffc6bd]{position:sticky;top:0;z-index:2;-webkit-user-select:none;user-select:none}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
2
|
"use strict";/*!
|
|
3
|
-
* eservices-core v1.3.
|
|
3
|
+
* eservices-core v1.3.47
|
|
4
4
|
* (c) 2023 ESERVICES
|
|
5
5
|
*/Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),I=require("jenesius-vue-form"),kt=require("vue-router"),Ve=require("debug"),Nt=require("date-and-time");function It(n,e){return!!n&&n===e||"password is not equal"}function st(n){return Number(n.replace(/[^0-9.]/g,""))}function Ot(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 $t=Object.freeze(Object.defineProperty({__proto__:null,numeric:st,prettyNumeric:Ot,validPassword:It},Symbol.toStringTag,{value:"Module"})),Rt={inputs:$t};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 Ae(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 D=ct;const Lt="Please try again later or submit a feedback if problem doesn't go.";class lt{static getClientData(){return p("/close-api/client-content")}static getNavigation(){return p("/close-api/client/navigation")}}const Pt=new class{constructor(){this.store=o.reactive([])}add(e,t,{children:r,timeout:i=10,click:s=()=>{}}={}){const u=new Dt(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 Dt=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 P{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(P,e,t)}static emit(e,t){return He.call(P,e,t)}static off(e,t){return Xe.call(P,e,t)}static cleanEvents(){Qe.call(P)}}P.events={};var ft=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},fe=(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,pe,he;const Y=class N extends P{constructor(){super(...arguments),Pe(this,re,void 0),Pe(this,pe,"front"),this.organizations=[],Pe(this,he,!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(!fe(this,re))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return fe(this,re)}set type(e){De(this,pe,e)}get type(){return fe(this,pe)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){De(this,he,e),this.emit(N.EVENT_READY_UPDATE,e)}get ready(){return fe(this,he)}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{Pt.add("error",D.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;pe=new WeakMap;he=new WeakMap;Y.DEFAULT_LANGUAGE="en";Y.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";Y.EVENT_CONTEXT_UPDATE="event:context-update";Y.EVENT_READY_UPDATE="event:ready-update";Y.EVENT_DATA_UPDATE="event:data-update";Y.CURRENT_CONTEXT_KEY="CurrentContext";let xt=Y;const Ze=new xt;function Bt(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Lt}})}function p(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 D.ApiNotAvailable()}).then(t=>Bt(t).then(r=>{if(!t.ok)throw r;return r}))}class ke{constructor(){}static parseNamesFromListConfig(e){let t=ke.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 Ut{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 pt=new Ut;function ht(n){return n&&n[0].toLowerCase()+n.slice(1)}function Me(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=Me(r)),e[i]=r,e},{})}function Vt(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const Mt={Request:p,clickOutside:Ae,getPropFromObject:be,runPromiseQueue:at,GraphQL:ke,firstChapterToLowerCase:ht,valuesToUpperCase:Me,prettyMoney:Vt},Ft=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:ke,Journal:pt,Request:p,clickOutside:Ae,default:Mt,firstChapterToLowerCase:ht,getPropFromObject:be,runPromiseQueue:at,valuesToUpperCase:Me},Symbol.toStringTag,{value:"Module"}));function gt(n,e=""){for(let t in n){if(typeof n[t]=="object"){gt(n[t],(e.length?`${e}-`:"")+t);continue}let r="--"+((e.length?`${e}-`:"")+t).replace(/([A-Z])/g,i=>`-${i}`.toLowerCase());document.documentElement.style.setProperty(r,n[t])}}const V={};function Wt(n){for(let e in n)V[e]=n[e];n.styles&>(n.styles),pt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=V}const jt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class qt{static readHistoryById(e,t){return p(`/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 Gt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return p(`/open-api/internationalization/language/${e}`)}}let z={};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)||z,n);if(typeof t=="string")return et(t,e);const r=I.utils.getPropFromObject(z==null?void 0:z.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){z=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(z,e.toLowerCase())})};Z.setVocabulary=function(n){return typeof n=="string"&&(n=I.utils.getPropFromObject(z,n)),Z.bind({vocabulary:n})};const zt=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 Kt(){return zt}class S{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw D.AuthServiceError(e.title,t)}static login(e){return p(V.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:V.applicationName})}).catch(S.parseError)}static registration(e){return e.AppName=V.applicationName,p(V.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(S.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw D.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return S.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return S.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return S.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return S.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return p(`${V.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(S.parseError)}static startLoginProcess(e){return S.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return S.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return S.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return p(`${V.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(S.parseError).then(S.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw D.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}function Yt(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Jt="masterId",Ht="masterEntity";function _e(n,e){if(!Array.isArray(e))return;if(Yt(e))return t(e);e.forEach(t);function t(r){n.append(Ht,r[0]),n.append(Jt,r[1].toString())}}class ce{static async anonymousGetList(e){return await p(`/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 p(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=ce.getSearchParamsForEntityListRead(t||{});return p(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,t,r){const i=new URLSearchParams;return _e(i,r==null?void 0:r.masterEntities),p(`/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 p(`/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 p(`/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 _e(s,i==null?void 0:i.masterEntities),p(`/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 p(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}const yt=class ie{static async create(e){return p(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 p(ie.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return p(`${ie.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return p(`${ie.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};yt.url="/close-api/communications";let Xt=yt;class Qt{static async getDefaultView(e){return p("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function tt(n){return{...n,createdEntities:n.createdEntites}}const mt=class ge{static async getStartConfig(e,t){return p([ge.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return p([ge.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(tt)}static async runStep(e,t,r,i,s){return p([ge.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(tt)}};mt.url="/close-api/views/process-wizard";let ye=mt;const Zt={class:"widget-table__head"},en={class:"widget-table__head-label margin_0 text_overflow"},tn=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",Zt,[(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",en,o.toDisplayString(r.label),1)]))),128))]))}});const M=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},nn=M(tn,[["__scopeId","data-v-25198f4a"]]);function rn(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function Et(n,e){const t=rn(n);let r=t?I.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function Fe(n){return["eservices-core",n].join(":")}function wt(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 Nt.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const on={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}`})}},Ne=M(on,[["__scopeId","data-v-e287c8d9"]]),sn=Ve(Fe("setup-list-row"));function an(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=Et(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(f){s.onClick.push(()=>f(r))}function a(f){Array.isArray(f)?s.class.push(...f):s.class.push(f)}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=wt(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 f=n.link(r);if(f){const _=o.h(kt.RouterLink,{to:f});d.push(_),a("widget-table-cell_link")}}catch(f){sn("Can't add router link",f)}return n.href&&(d.push(o.h("a",{href:n.href(r),target:"_blank"})),a("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&d.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&d.push(o.h(Ne,{name:n.icon})),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 an(n,e)}catch(t){return console.warn(t),null}}}const ln={props:{values:Object,config:Object,selected:Boolean},setup:vt},un=["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,un)],512))}}),A={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",TIME_TO_LIVE_SOCKET_REQUEST:1e4},dn={class:"widget-table"},it="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 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],f=d.indexOf(a);return f===-1?d.push(a):d.splice(f,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",dn,[o.createVNode(nn,{config:a.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(d,f)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:f},[o.createVNode(ln,{config:a.config,values:d,selected:a.selectedRows.includes(d),onSelect:_=>s(d,_),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]=_=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),a.activeRow===o.unref(A).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)])])]))}}),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))}});const Ie=M(pn,[["__scopeId","data-v-0ef9ae88"]]),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(Ie,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const yn=M(gn,[["__scopeId","data-v-450dc564"]]),mn={class:"widget-multi-button-wrap position_relative cursor_pointer"},En={class:"widget-multi-button-body grid"},wn=["onClick"],vn={class:"widget-multi-button-side-wrap"},_n=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(u=>({"7025434e":r.value}));const t=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(u){if(!(typeof u!="function"||t.wait))return t.wait=!0,Promise.resolve().then(u).finally(()=>{t.wait=!1})}function s(u=!t.active){t.active=u}return(u,a)=>(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: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:f=>{i(l.callback),s(!1)}},o.toDisplayString(l.label),9,wn))),128))]),o.createElementVNode("div",vn,[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(Ie),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(Ne),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}});const Tn=M(_n,[["__scopeId","data-v-a8d711d1"]]),Sn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Cn={class:"text_md"},bn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",Sn,[o.createVNode(Ie,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",Cn,o.toDisplayString(e.label),1)]))}}),An=["alt","src"],kn=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,An))}}),Nn={props:{config:Array,values:Object,selected:Boolean},setup:vt};const In=M(Nn,[["__scopeId","data-v-344a8cc1"]]),On=n=>(o.pushScopeId("data-v-bf495d6a"),n=n(),o.popScopeId(),n),$n={class:"widget-list-head-cell"},Rn=On(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Ln=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(Ne),{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),Rn])]))}});const Pn=M(Ln,[["__scopeId","data-v-bf495d6a"]]),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 l(g,m){let w=-1;do w++,m-=g[w];while(m>0&&w<g.length);return w}function d(g,m){let w=0;for(;m>0&&m>g[w]&&w<g.length;)m-=g[w],w++;return console.log(m,w),w>0?w:0}function f(g){try{i.value.style.insetInlineStart=g+"px"}catch(m){console.log(m)}}function _(g){try{i.value.style.width=g+"px",i.value.style.minWidth=g+"px",i.value.style.maxWidth=g+"px"}catch(m){console.log(m)}}function h(g){return g===null?!1:g.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(m){var Ye;function w(k){return k.screenX+y-b}const C=r.value,c=[...C.children].filter(k=>k.localName==="th"),y=((Ye=C.offsetParent)==null?void 0:Ye.scrollLeft)||0,E=c.map(k=>k.clientWidth),R=h(m.target),b=C.getBoundingClientRect().left,J=w(m),T=l(E,J),F=E.slice(0,T).reduce((k,L)=>k+L,0),ee=J-F,Re=C.offsetWidth,te=c[T].clientWidth;if(t.config[T].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",m.screenX),console.log("Widths",E),console.log("max width",Re),console.log("Start Position",J),console.log("Position From",T),console.log("Start Position",T),console.log("Global offset (Отступ самой таблицы от края экрана)",b),console.log("Del",ee),console.groupEnd(),i.value.innerText=c[T].textContent||"",i.value.style.display="grid",i.value.style.width=te+"px",i.value.style.cursor="grabbing",f(F),_(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),R&&(t.config[T].width=i.value.style.width,t.config[T].minWidth=i.value.style.width,t.config[T].maxWidth=i.value.style.width,s(t.config)),!R){const L=k.screenX+y-b;console.log("ENP Position",L);const de=d(E,L);if(console.log(T,"->",de),de!==T){const ne=t.config[T],Le=t.config;Le.splice(T,1),Le.splice(de,0,ne),s(Le)}else{const ne=t.config[T].name;u(ne)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Ke(k){if(R){const ne=w(k)-J+te;_(ne);return}let L=k.screenX+y-b-ee;L<0&&(L=0),L+te>Re&&(L=Re-te),f(L)}})});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,(f,_)=>(o.openBlock(),o.createBlock(Pn,o.mergeProps({key:f},f,{onOrder:h=>u(f.name),onSelect:d[0]||(d[0]=h=>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 xn=M(Dn,[["__scopeId","data-v-ccffc6bd"]]),Bn={class:"widget-list"},Un={class:"widget-list-body position_relative"},Vn=50,Mn=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],f=d.indexOf(a);f===-1?d.push(a):d==null||d.splice(f,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+Vn>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(xn,{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",Un,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(d,f)=>{var _;return o.openBlock(),o.createBlock(In,{key:f,class:"widget-list-row",values:d,config:a.config,selected:(_=a.selectedRows)==null?void 0:_.includes(d),onSelect:h=>r(d,h)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function Fn(n){function e(...r){return t.wait?Promise.reject("The process has already started."):(t.wait=!0,Promise.resolve().then(()=>n(...r)).finally(()=>{t.wait=!1}))}const t=o.reactive({wait:!1,call:e});return t}function Te(n){return typeof n=="string"?xe(n):Wn(n)?xe(n.message):xe(A.DEFAULT_ERROR_MESSAGE)}function Wn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function xe(n){return{message:n}}function K(n="error"){return function(e){const{message:t}=Te(e);Ce.add(n,t)}}function Se(n,e={}){return U().emit("entity:read",{...e,entity:n})}function je(n,e){return U().emit("entity:update",{...e,entity:n})}function jn(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 qe(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=qe(r)),e[i]=r,e},{})}function qn(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 Gn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function zn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return A.DEFAULT_ERROR_MESSAGE}})}function X(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(A.DEFAULT_ERROR_MESSAGE)}).then(t=>zn(t).then(r=>{if(!t.ok)throw r;return r}))}function Kn(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 Jn=Ve(Fe("pretty-value-field-by-entity"));function Hn(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{return Jn('Error by parse pretty value for entity "%s", field "%s" with value "%s"',n,e,t),""}}function Xn(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const Qn=1,Zn=5e3,W=Ve(Fe("use-socket"));function U(){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 s=new Set;function u(){if(e)e&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},Zn+1e3);const c=new Uint8Array(1);c[0]=Qn,e.send(c)}setInterval(()=>{Array.from(r).forEach(c=>{C(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:D.RequestTookToLong().message}}):r.delete(c))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&d()},A.DELAY_SOCKET_RECONNECT);function a(){return{safeQueue:s,requestId:n,handlers:r,socketInstance:e}}function l(c){const y=[...r.values()];W("Handlers array length is %d. Response event: %s. Request id: %d",r.size,c.event,c.requestId),y.forEach(E=>{const R=c.requestId;(E.requestId&&E.requestId===R||!E.requestId&&E.event===c.event)&&(W("Find appropriated handler: %d, event: %s",n,E.event),E.callback(c.data,c),E.once&&(r.delete(E),W("Handler was removed by *once* params was passed. %o",E)))})}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(y=>{y.guaranteedAnswer&&y.serializeString&&s.add(y.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(c=>{f(c),s.delete(c)})},e.onerror=function(c){console.warn(c)},e.onmessage=c=>{var y;try{if(er(c)){u();return}const E=JSON.parse(c.data);if(!Tt(E)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(E);return}(y=E==null?void 0:E.data)!=null&&y.refresh&&location.reload(),l(E)}catch(E){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(E)}}}function f(c){e.send(c)}function _(c,y){w({event:c,callback:y})}function h(c,y){w({event:c,callback:y,once:!0})}function g(){return e&&(e==null?void 0:e.readyState)===1}function m(c,y,E){const R=++n,b=JSON.stringify({requestId:R,event:c,data:y,contextId:O.contextId,url:window.location.href});return g()?f(b):(s.add(b),W("Socket is not connected. Message was send to save-queue")),new Promise((J,T)=>{w({event:c,requestId:R,once:!0,guaranteedAnswer:!0,serializeString:b,callback:(F,ee)=>{if(W("Promise was resolve with next data:",F),nr(ee))return void T(F);E&&E(F,ee),J(F)},timeToLive:A.TIME_TO_LIVE_SOCKET_REQUEST})})}function w(c){const y={timeToLive:0,...c,created:new Date().getTime()};r.add(y)}function C(c){return c.timeToLive===0||typeof c.timeToLive!="number"?!1:new Date().getTime()-c.created>c.timeToLive}return{get socket(){return e},on:_,once:h,emit:m,initialization(c){t=c},getDevInfo:a}}(),nr=n=>!!Tt(n)&&n.event==="request-error",Tt=n=>typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function rr(n,e){const t=o.reactive([]);let r=0;const i=o.ref(!1);function s(){if(i.value)return Promise.reject("The process has already started.");const h=f();return i.value=!0,typeof h.limit!="number"&&(h.limit=100),h.offset=r,Se(n,h).then(g=>(r+=g.length,g)).finally(()=>{i.value=!1})}function u(h,g){var w;const m=h.Version||((w=t.find(C=>C.Id===g))==null?void 0:w.Version);if(m===void 0)throw new Error("Object without version.");return m}function a(h,g){const m=t.findIndex(w=>w.Id===h);if(m===-1)throw new Error(`Can't found item with Id ${h}`);t.splice(m,1,g)}async function l(h,g){try{const m=f(),w=u(g,h);delete g.Version,await je(n,{id:h,values:g,version:w});const C=await Se(n,{fields:m.fields||"",id:h});a(h,C)}catch(m){K()(m)}}async function d(){try{const h=await s();t.push(...h)}catch(h){K()(h)}}function f(){return typeof e=="function"?e():e}async function _(){try{r=0;const h=await s();t.splice(0,t.length,...h)}catch(h){K()(h)}}return{array:t,updateById:l,next:d,reload:_,wait:i}}function ir(){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 or(n,e,t){return U().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function sr(n,e,t){return U().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function ar(n,e){return U().emit("communication-message:create",{communicationId:n,text:e})}function cr(n){return U().emit("communication-message:read",{communicationId:n})}function lr(n){const e=I.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>cr(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function ur(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw D.EntityWithoutName(n);return Se(n.name,r)}).then(qe).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(K())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw D.EntityWithoutName(n);return je(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw K()(i),i})};function t(){return typeof e=="function"?e():e}}function dr(n,e){return U().emit("metadata:read",{...e,entity:n})}class le{constructor(){this.state=o.reactive({})}set(e,t,r){this.state[le.getKey(e,t)]=r}get(e,t={}){return this.state[le.getKey(e,t)]}getByKey(e){return this.state[e]}update(e,t){return dr(e,t).then(this.set.bind(this,e,t))}static getKey(e,t){const r={entity:e,entityId:t.id,masterEntities:fr(t.masterEntities)};return JSON.stringify(r)}}function fr(n){return!n||!Array.isArray(n)?[]:n.length===0?[]:pr(n)?[n]:n}function pr(n){return!!n&&Array.isArray(n)&&typeof n[0]=="string"&&typeof n[1]=="number"}function hr(n,e={}){if(!n)return o.inject(A.PROVIDE_NAME_METADATA);const t=o.ref(null),r=o.computed(()=>t.value?Be.getByKey(t.value):null);o.provide(A.PROVIDE_NAME_METADATA,r);function i(){if(!n)throw new Error("Entity is not provided for metadata.");t.value=le.getKey(n,ot(e||{}))}const s=function(){return i(),Be.update(n,ot(e||{}))};return i(),{state:r,update:s}}function ot(n){return typeof n=="function"?n():n}const Ce=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=gr(r),s=new yr(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 gr(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 St=class Ct{constructor(e,t,r,i,s){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=s,this.id=Ct.cardId++}};St.cardId=1;let yr=St;class mr extends P{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return ar(this.id,e)}static checkAndGenerate(e,t,r){return sr(e,t,r).then(i=>i.length===0?or(e,t,r):i[0])}}function Er(){return U().emit("client:read",{})}var bt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},wr=(n,e,t)=>(bt(n,e,"read from private field"),t?t.call(n):e.get(n)),vr=(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)},_r=(n,e,t,r)=>(bt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),me;const Oe=class H extends P{constructor(){super(...arguments),this.type="front",this.organizations=[],vr(this,me,!1)}set language(e){localStorage.setItem(A.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(A.LOCALSTORAGE_LANGUAGE_KEY)||H.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){_r(this,me,e),this.emit(H.EVENT_READY_UPDATE,e)}get ready(){return wr(this,me)}onReady(e){return this.on(H.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(H.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(A.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(H.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){K()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(A.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 Er()}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}}};me=new WeakMap;Oe.DEFAULT_LANGUAGE="en";Oe.EVENT_CONTEXT_UPDATE="event:context-update";Oe.EVENT_READY_UPDATE="event:ready-update";let Tr=Oe;function Sr(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(Sr(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 ue(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${ue(t)}`};$.beginWith=function(e,t){return`@${e} BeginWith ${ue(t)}`};$.notEq=function(e,t){return`@${e} nq ${ue(t)}`};$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${ue(t)}`};$.in=function(e,t){const r=t.map(ue).join(", ");return`@${e} in (${r})`};$.and=function(...e){return e.join(" and ")};$.is=function(e,t){return`@${e} is ${t}`};$.or=function(...e){return e.join(" or ")};const O=new Tr,Be=new le;class Cr{static get url(){return"/close-api/metadata"}static async get(e,t,r){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const i=new URLSearchParams;return t&&i.append("criteria",t),r&&i.append("id",String(r)),await X(this.url+`/${e}?${i.toString()}`,{method:"GET"})}static getById(e,t,r=[]){const i=new URLSearchParams;return _e(i,r),t&&i.append("id",t),X([this.url,e].join("/")+`?${i.toString()}`)}static getFieldInformation(e,t){return X(`/open-api/metadata/${e}/fields/${t}`)}static getTreatmentListField(e,t){return X(`/open-api/metadata/${e}/list-fields/${t}`)}}class br{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 Ar{static invite(e,t,r){return p("/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 p("/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 p("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class Ge{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return p(Ge.url+e,{method:"POST",body:JSON.stringify(t)})}}class kr{static getConfiguration(){return p("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class Nr{static url(){return"/close-api/actions"}static async get({criterion:e}){const t=new URLSearchParams;return e&&t.append("criterion",e),await fetch(this.url()+`?${t.toString()}`,{method:"GET"}).then(r=>r.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return _e(i,r),X([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function Ir(n,e="images"){return`/static-folder/${e}/${n}`}class Or{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 p(`/${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]):D.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 p(`/${Q.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return p(`/${Q.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class $r{static getListSettings(e,t){const r=new URLSearchParams;r.set("entity",e),t&&r.set("mark",t);const i=`/close-api/views/list/configs?${r.toString()}`;return p(i)}}var At=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},x=(n,e,t)=>(At(n,e,"read from private field"),t?t.call(n):e.get(n)),j=(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)},q=(n,e,t,r)=>(At(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ee,oe,we,ve,se,ae,Ue;const G="_______LIST_______ROW_______INDEX________NAME_______",$e=class B extends P{constructor(e){super(),this.LIST_ROW_KEY=1,j(this,Ee,void 0),this.array=[],j(this,oe,[]),j(this,we,[]),j(this,ve,new Proxy({},{set:(t,r,i,s)=>(t[r]=i,this.emit(B.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(B.EVENT_FILTERS_UPDATE,t),!0)})),j(this,se,!1),j(this,ae,(...t)=>Promise),j(this,Ue,()=>{}),q(this,Ee,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&q(this,oe,e.config)}set config(e){q(this,oe,e.map(I.utils.copyObject)),this.emitUpdateConfig()}get config(){return x(this,oe)}emitUpdateConfig(){this.emit(B.EVENT_CONFIG_UPDATE,this.config)}get order(){return x(this,we)}set order(e){q(this,we,e),this.emit(B.EVENT_ORDER_UPDATE,this.order)}get filters(){return x(this,ve)}set filters(e){Lr(x(this,ve),e)}set wait(e){q(this,se,e),this.emit(I.Form.EVENT_WAIT,x(this,se))}get wait(){return x(this,se)}get primaryKeys(){return x(this,Ee)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[G]===e)}indexByKey(e){return this.array.findIndex(t=>t[G]===e)}static getKey(e){return e[G]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,G)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(B.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const t=this.indexByKey(e);t!==-1&&(this.array.splice(t,1),this.emit(B.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(B.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[G]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,G)}set read(e){q(this,ae,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=x(this,ae).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){q(this,ae,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>x(this,Ue).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static mergeWithKey(e,t){return{...e,[G]:t}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,t){const r=B.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}}};Ee=new WeakMap;oe=new WeakMap;we=new WeakMap;ve=new WeakMap;se=new WeakMap;ae=new WeakMap;Ue=new WeakMap;$e.EVENT_DATA="list-data: update";$e.EVENT_CONFIG_UPDATE="list-config:update";$e.EVENT_ORDER_UPDATE="list-order:update";$e.EVENT_FILTERS_UPDATE="list-filters:update";function Rr(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 Lr(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Pr(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 Dr(n){return n.statusName==="Completed"}function xr(n){return n.statusName==="FinalStepWithConfirmation"}function Br(n){return n.statusName==="ValidationError"}function Ur(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(y=>y.name===u))==null?void 0:c.fields)||[]:[]}function f(c){if(l(),Br(c))return void t.onValidation(c.validationResults);if((c.statusName==="FinalStep"||c.statusName==="NextStep")&&(!d().length||Vr(d(),t.presets)))return C(t.presets||{});Dr(c)&&t.onCompleted(c),xr(c)&&t.onConfirmation(c)}async function _(){try{await h(),await w()}catch(c){const{message:y}=Te(c);Ce.add("error",y)}}function h(){return i.wait="Loading process information.",ye.getStartConfig(e,n).then(c=>{s=c.steps.map(y=>({label:y.title,name:y.stepName,number:y.number,fields:y.frontendEntity.objectTypes.reduce((E,R)=>(R.properties.forEach(b=>{E.push({name:b.name,label:b.title,type:b.refEntityName||b.dataType})}),E),[])}))}).then(c=>(i.wait=!1,c))}function g(c){return u=c.nextStepName,r=c.token,c}function m(c){const y=Te(c);Ce.add("error",y.message)}function w(){return i.wait="Starting process",ye.startProcess(e,n).then(g).then(f).catch(m).finally(()=>{i.wait=null})}function C(c={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Expect the result",ye.runStep(e,n,u,r,c).then(g).then(f).catch(m).finally(()=>{i.wait=!1}))}return{initialize:_,state:i,currentStepConfig:o.readonly(a),next:C}}function Vr(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 Mr="close-api/proxy/Equipment/Search";class Fr{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=`/${Mr}?${u.toString()}`;return p(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Wr={clickOutside:Ae,staticLink:Ir},jr={usage:Rt,utils:Ft,config:Wt,types:jt};exports.Communication=mr;exports.CoreError=D;exports.Filter=$;exports.Manager=O;exports.NotificationSystem=Ce;exports.WidgetButton=yn;exports.WidgetIcon=Ne;exports.WidgetImage=kn;exports.WidgetList=Mn;exports.WidgetLoader=bn;exports.WidgetMultiButton=Tn;exports.WidgetSpinner=Ie;exports.WidgetTable=fn;exports.actionService=Nr;exports.asyncProcess=Fn;exports.authService=S;exports.billingService=Q;exports.catchUniversal=K;exports.clickOutside=Ae;exports.clientService=lt;exports.communicationService=Xt;exports.configurationService=$r;exports.constants=A;exports.dataService=ce;exports.debounce=Kn;exports.default=jr;exports.documentsService=Or;exports.equipmentService=Fr;exports.fileService=br;exports.getCellValue=Et;exports.getNamesFromListConfig=jn;exports.groupArrayByField=qn;exports.historyService=qt;exports.internationalizationService=Gt;exports.invitationService=Ar;exports.metadataService=Cr;exports.openService=kr;exports.parseError=Te;exports.prettyDate=We;exports.prettyDateWithTime=wt;exports.prettyMoney=_t;exports.prettyValueFieldByEntity=Hn;exports.processWizardService=ye;exports.request=X;exports.ruleValidationService=Ge;exports.t=Z;exports.throttle=Yn;exports.universalEntityRead=Se;exports.universalEntityUpdate=je;exports.useCommunication=lr;exports.useFormEntity=ur;exports.useListActiveRow=Xn;exports.useListEntity=rr;exports.useListSearch=Rr;exports.useListSelect=Pr;exports.useLogger=Kt;exports.useManagerState=ir;exports.useMetadata=hr;exports.useSocket=U;exports.useWizard=Ur;exports.utils=Wr;exports.uuidv4=Gn;exports.valuesToUpperCase=qe;exports.viewService=Qt;
|
|
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 P{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(P,e,t)}static emit(e,t){return He.call(P,e,t)}static off(e,t){return Xe.call(P,e,t)}static cleanEvents(){Qe.call(P)}}P.events={};var ft=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},fe=(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,pe,he;const Y=class N extends P{constructor(){super(...arguments),Pe(this,re,void 0),Pe(this,pe,"front"),this.organizations=[],Pe(this,he,!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(!fe(this,re))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return fe(this,re)}set type(e){De(this,pe,e)}get type(){return fe(this,pe)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){De(this,he,e),this.emit(N.EVENT_READY_UPDATE,e)}get ready(){return fe(this,he)}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{Pt.add("error",D.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;pe=new WeakMap;he=new WeakMap;Y.DEFAULT_LANGUAGE="en";Y.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";Y.EVENT_CONTEXT_UPDATE="event:context-update";Y.EVENT_READY_UPDATE="event:ready-update";Y.EVENT_DATA_UPDATE="event:data-update";Y.CURRENT_CONTEXT_KEY="CurrentContext";let xt=Y;const Ze=new xt;function Bt(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Lt}})}function p(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 D.ApiNotAvailable()}).then(t=>Bt(t).then(r=>{if(!t.ok)throw r;return r}))}class ke{constructor(){}static parseNamesFromListConfig(e){let t=ke.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 Ut{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 pt=new Ut;function ht(n){return n&&n[0].toLowerCase()+n.slice(1)}function Me(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=Me(r)),e[i]=r,e},{})}function Vt(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const Mt={Request:p,clickOutside:Ae,getPropFromObject:be,runPromiseQueue:at,GraphQL:ke,firstChapterToLowerCase:ht,valuesToUpperCase:Me,prettyMoney:Vt},Ft=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:ke,Journal:pt,Request:p,clickOutside:Ae,default:Mt,firstChapterToLowerCase:ht,getPropFromObject:be,runPromiseQueue:at,valuesToUpperCase:Me},Symbol.toStringTag,{value:"Module"}));function gt(n,e=""){for(let t in n){if(typeof n[t]=="object"){gt(n[t],(e.length?`${e}-`:"")+t);continue}let r="--"+((e.length?`${e}-`:"")+t).replace(/([A-Z])/g,i=>`-${i}`.toLowerCase());document.documentElement.style.setProperty(r,n[t])}}const V={};function Wt(n){for(let e in n)V[e]=n[e];n.styles&>(n.styles),pt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=V}const jt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class qt{static readHistoryById(e,t){return p(`/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 Gt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return p(`/open-api/internationalization/language/${e}`)}}let z={};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)||z,n);if(typeof t=="string")return et(t,e);const r=I.utils.getPropFromObject(z==null?void 0:z.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){z=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(z,e.toLowerCase())})};Z.setVocabulary=function(n){return typeof n=="string"&&(n=I.utils.getPropFromObject(z,n)),Z.bind({vocabulary:n})};const zt=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 Kt(){return zt}class S{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw D.AuthServiceError(e.title,t)}static login(e){return p(V.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:V.applicationName})}).catch(S.parseError)}static registration(e){return e.AppName=V.applicationName,p(V.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(S.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw D.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return S.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return S.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return S.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return S.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return p(`${V.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(S.parseError)}static startLoginProcess(e){return S.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return S.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return S.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return p(`${V.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(S.parseError).then(S.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw D.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}function Yt(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Jt="masterId",Ht="masterEntity";function _e(n,e){if(!Array.isArray(e))return;if(Yt(e))return t(e);e.forEach(t);function t(r){n.append(Ht,r[0]),n.append(Jt,r[1].toString())}}class ce{static async anonymousGetList(e){return await p(`/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 p(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=ce.getSearchParamsForEntityListRead(t||{});return p(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,t,r){const i=new URLSearchParams;return _e(i,r==null?void 0:r.masterEntities),p(`/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 p(`/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 p(`/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 _e(s,i==null?void 0:i.masterEntities),p(`/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 p(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}const yt=class ie{static async create(e){return p(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 p(ie.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return p(`${ie.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return p(`${ie.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};yt.url="/close-api/communications";let Xt=yt;class Qt{static async getDefaultView(e){return p("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function tt(n){return{...n,createdEntities:n.createdEntites}}const mt=class ge{static async getStartConfig(e,t){return p([ge.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return p([ge.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(tt)}static async runStep(e,t,r,i,s){return p([ge.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(tt)}};mt.url="/close-api/views/process-wizard";let ye=mt;const Zt={class:"widget-table__head"},en={class:"widget-table__head-label margin_0 text_overflow"},tn=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",Zt,[(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",en,o.toDisplayString(r.label),1)]))),128))]))}});const M=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},nn=M(tn,[["__scopeId","data-v-25198f4a"]]);function rn(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function Et(n,e){const t=rn(n);let r=t?I.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function Fe(n){return["eservices-core",n].join(":")}function wt(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 Nt.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const on={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}`})}},Ne=M(on,[["__scopeId","data-v-e287c8d9"]]),sn=Ve(Fe("setup-list-row"));function an(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=Et(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(f){s.onClick.push(()=>f(r))}function a(f){Array.isArray(f)?s.class.push(...f):s.class.push(f)}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=wt(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 f=n.link(r);if(f){const _=o.h(kt.RouterLink,{to:f});d.push(_),a("widget-table-cell_link")}}catch(f){sn("Can't add router link",f)}return n.href&&(d.push(o.h("a",{href:n.href(r),target:"_blank"})),a("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&d.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&d.push(o.h(Ne,{name:n.icon})),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 an(n,e)}catch(t){return console.warn(t),null}}}const ln={props:{values:Object,config:Object,selected:Boolean},setup:vt},un=["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,un)],512))}}),A={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",TIME_TO_LIVE_SOCKET_REQUEST:1e4},dn={class:"widget-table"},it="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 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],f=d.indexOf(a);return f===-1?d.push(a):d.splice(f,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",dn,[o.createVNode(nn,{config:a.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(d,f)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:f},[o.createVNode(ln,{config:a.config,values:d,selected:a.selectedRows.includes(d),onSelect:_=>s(d,_),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]=_=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),a.activeRow===o.unref(A).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)])])]))}}),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))}});const Ie=M(pn,[["__scopeId","data-v-0ef9ae88"]]),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(Ie,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const yn=M(gn,[["__scopeId","data-v-450dc564"]]),mn={class:"widget-multi-button-wrap position_relative cursor_pointer"},En={class:"widget-multi-button-body grid"},wn=["onClick"],vn={class:"widget-multi-button-side-wrap"},_n=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(u=>({"7025434e":r.value}));const t=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(u){if(!(typeof u!="function"||t.wait))return t.wait=!0,Promise.resolve().then(u).finally(()=>{t.wait=!1})}function s(u=!t.active){t.active=u}return(u,a)=>(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: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:f=>{i(l.callback),s(!1)}},o.toDisplayString(l.label),9,wn))),128))]),o.createElementVNode("div",vn,[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(Ie),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(Ne),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}});const Tn=M(_n,[["__scopeId","data-v-a8d711d1"]]),Sn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Cn={class:"text_md"},bn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",Sn,[o.createVNode(Ie,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",Cn,o.toDisplayString(e.label),1)]))}}),An=["alt","src"],kn=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,An))}}),Nn={props:{config:Array,values:Object,selected:Boolean},setup:vt};const In=M(Nn,[["__scopeId","data-v-344a8cc1"]]),On=n=>(o.pushScopeId("data-v-bf495d6a"),n=n(),o.popScopeId(),n),$n={class:"widget-list-head-cell"},Rn=On(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Ln=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(Ne),{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),Rn])]))}});const Pn=M(Ln,[["__scopeId","data-v-bf495d6a"]]),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 l(g,m){let w=-1;do w++,m-=g[w];while(m>0&&w<g.length);return w}function d(g,m){let w=0;for(;m>0&&m>g[w]&&w<g.length;)m-=g[w],w++;return console.log(m,w),w>0?w:0}function f(g){try{i.value.style.insetInlineStart=g+"px"}catch(m){console.log(m)}}function _(g){try{i.value.style.width=g+"px",i.value.style.minWidth=g+"px",i.value.style.maxWidth=g+"px"}catch(m){console.log(m)}}function h(g){return g===null?!1:g.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(m){var Ye;function w(k){return k.screenX+y-b}const C=r.value,c=[...C.children].filter(k=>k.localName==="th"),y=((Ye=C.offsetParent)==null?void 0:Ye.scrollLeft)||0,E=c.map(k=>k.clientWidth),R=h(m.target),b=C.getBoundingClientRect().left,J=w(m),T=l(E,J),F=E.slice(0,T).reduce((k,L)=>k+L,0),ee=J-F,Re=C.offsetWidth,te=c[T].clientWidth;if(t.config[T].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",m.screenX),console.log("Widths",E),console.log("max width",Re),console.log("Start Position",J),console.log("Position From",T),console.log("Start Position",T),console.log("Global offset (Отступ самой таблицы от края экрана)",b),console.log("Del",ee),console.groupEnd(),i.value.innerText=c[T].textContent||"",i.value.style.display="grid",i.value.style.width=te+"px",i.value.style.cursor="grabbing",f(F),_(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),R&&(t.config[T].width=i.value.style.width,t.config[T].minWidth=i.value.style.width,t.config[T].maxWidth=i.value.style.width,s(t.config)),!R){const L=k.screenX+y-b;console.log("ENP Position",L);const de=d(E,L);if(console.log(T,"->",de),de!==T){const ne=t.config[T],Le=t.config;Le.splice(T,1),Le.splice(de,0,ne),s(Le)}else{const ne=t.config[T].name;u(ne)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Ke(k){if(R){const ne=w(k)-J+te;_(ne);return}let L=k.screenX+y-b-ee;L<0&&(L=0),L+te>Re&&(L=Re-te),f(L)}})});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,(f,_)=>(o.openBlock(),o.createBlock(Pn,o.mergeProps({key:f},f,{onOrder:h=>u(f.name),onSelect:d[0]||(d[0]=h=>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 xn=M(Dn,[["__scopeId","data-v-ccffc6bd"]]),Bn={class:"widget-list"},Un={class:"widget-list-body position_relative"},Vn=50,Mn=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],f=d.indexOf(a);f===-1?d.push(a):d==null||d.splice(f,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+Vn>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(xn,{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",Un,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(d,f)=>{var _;return o.openBlock(),o.createBlock(In,{key:f,class:"widget-list-row",values:d,config:a.config,selected:(_=a.selectedRows)==null?void 0:_.includes(d),onSelect:h=>r(d,h)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function Fn(n){function e(...r){return t.wait?Promise.reject("The process has already started."):(t.wait=!0,Promise.resolve().then(()=>n(...r)).finally(()=>{t.wait=!1}))}const t=o.reactive({wait:!1,call:e});return t}function Te(n){return typeof n=="string"?xe(n):Wn(n)?xe(n.message):xe(A.DEFAULT_ERROR_MESSAGE)}function Wn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function xe(n){return{message:n}}function K(n="error"){return function(e){const{message:t}=Te(e);Ce.add(n,t)}}function Se(n,e={}){return U().emit("entity:read",{...e,entity:n})}function je(n,e){return U().emit("entity:update",{...e,entity:n})}function jn(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 qe(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=qe(r)),e[i]=r,e},{})}function qn(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 Gn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function zn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return A.DEFAULT_ERROR_MESSAGE}})}function X(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(A.DEFAULT_ERROR_MESSAGE)}).then(t=>zn(t).then(r=>{if(!t.ok)throw r;return r}))}function Kn(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 Jn=Ve(Fe("pretty-value-field-by-entity"));function Hn(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{return Jn('Error by parse pretty value for entity "%s", field "%s" with value "%s"',n,e,t),""}}function Xn(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const Qn=1,Zn=5e3,W=Ve(Fe("use-socket"));function U(){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 s=new Set;function u(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},Zn+1e3);const c=new Uint8Array(1);c[0]=Qn,e.send(c)}setInterval(()=>{Array.from(r).forEach(c=>{C(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:D.RequestTookToLong().message}}):r.delete(c))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&d()},A.DELAY_SOCKET_RECONNECT);function a(){return{safeQueue:s,requestId:n,handlers:r,socketInstance:e}}function l(c){const y=[...r.values()];W("Handlers array length is %d. Response event: %s. Request id: %d",r.size,c.event,c.requestId),y.forEach(E=>{const R=c.requestId;(E.requestId&&E.requestId===R||!E.requestId&&E.event===c.event)&&(W("Find appropriated handler: %d, event: %s",n,E.event),E.callback(c.data,c),E.once&&(r.delete(E),W("Handler was removed by *once* params was passed. %o",E)))})}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(y=>{y.guaranteedAnswer&&y.serializeString&&s.add(y.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(c=>{f(c),s.delete(c)})},e.onerror=function(c){console.warn(c)},e.onmessage=c=>{var y;try{if(er(c.data)){u();return}const E=JSON.parse(c.data);if(!Tt(E)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(E);return}(y=E==null?void 0:E.data)!=null&&y.refresh&&location.reload(),l(E)}catch(E){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(E)}}}function f(c){e.send(c)}function _(c,y){w({event:c,callback:y})}function h(c,y){w({event:c,callback:y,once:!0})}function g(){return e&&(e==null?void 0:e.readyState)===1}function m(c,y,E){const R=++n,b=JSON.stringify({requestId:R,event:c,data:y,contextId:O.contextId,url:window.location.href});return g()?f(b):(s.add(b),W("Socket is not connected. Message was send to save-queue")),new Promise((J,T)=>{w({event:c,requestId:R,once:!0,guaranteedAnswer:!0,serializeString:b,callback:(F,ee)=>{if(W("Promise was resolve with next data:",F),nr(ee))return void T(F);E&&E(F,ee),J(F)},timeToLive:A.TIME_TO_LIVE_SOCKET_REQUEST})})}function w(c){const y={timeToLive:0,...c,created:new Date().getTime()};r.add(y)}function C(c){return c.timeToLive===0||typeof c.timeToLive!="number"?!1:new Date().getTime()-c.created>c.timeToLive}return{get socket(){return e},on:_,once:h,emit:m,initialization(c){t=c},getDevInfo:a}}(),nr=n=>!!Tt(n)&&n.event==="request-error",Tt=n=>typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function rr(n,e){const t=o.reactive([]);let r=0;const i=o.ref(!1);function s(){if(i.value)return Promise.reject("The process has already started.");const h=f();return i.value=!0,typeof h.limit!="number"&&(h.limit=100),h.offset=r,Se(n,h).then(g=>(r+=g.length,g)).finally(()=>{i.value=!1})}function u(h,g){var w;const m=h.Version||((w=t.find(C=>C.Id===g))==null?void 0:w.Version);if(m===void 0)throw new Error("Object without version.");return m}function a(h,g){const m=t.findIndex(w=>w.Id===h);if(m===-1)throw new Error(`Can't found item with Id ${h}`);t.splice(m,1,g)}async function l(h,g){try{const m=f(),w=u(g,h);delete g.Version,await je(n,{id:h,values:g,version:w});const C=await Se(n,{fields:m.fields||"",id:h});a(h,C)}catch(m){K()(m)}}async function d(){try{const h=await s();t.push(...h)}catch(h){K()(h)}}function f(){return typeof e=="function"?e():e}async function _(){try{r=0;const h=await s();t.splice(0,t.length,...h)}catch(h){K()(h)}}return{array:t,updateById:l,next:d,reload:_,wait:i}}function ir(){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 or(n,e,t){return U().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function sr(n,e,t){return U().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function ar(n,e){return U().emit("communication-message:create",{communicationId:n,text:e})}function cr(n){return U().emit("communication-message:read",{communicationId:n})}function lr(n){const e=I.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>cr(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function ur(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw D.EntityWithoutName(n);return Se(n.name,r)}).then(qe).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(K())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw D.EntityWithoutName(n);return je(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw K()(i),i})};function t(){return typeof e=="function"?e():e}}function dr(n,e){return U().emit("metadata:read",{...e,entity:n})}class le{constructor(){this.state=o.reactive({})}set(e,t,r){this.state[le.getKey(e,t)]=r}get(e,t={}){return this.state[le.getKey(e,t)]}getByKey(e){return this.state[e]}update(e,t){return dr(e,t).then(this.set.bind(this,e,t))}static getKey(e,t){const r={entity:e,entityId:t.id,masterEntities:fr(t.masterEntities)};return JSON.stringify(r)}}function fr(n){return!n||!Array.isArray(n)?[]:n.length===0?[]:pr(n)?[n]:n}function pr(n){return!!n&&Array.isArray(n)&&typeof n[0]=="string"&&typeof n[1]=="number"}function hr(n,e={}){if(!n)return o.inject(A.PROVIDE_NAME_METADATA);const t=o.ref(null),r=o.computed(()=>t.value?Be.getByKey(t.value):null);o.provide(A.PROVIDE_NAME_METADATA,r);function i(){if(!n)throw new Error("Entity is not provided for metadata.");t.value=le.getKey(n,ot(e||{}))}const s=function(){return i(),Be.update(n,ot(e||{}))};return i(),{state:r,update:s}}function ot(n){return typeof n=="function"?n():n}const Ce=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=gr(r),s=new yr(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 gr(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 St=class Ct{constructor(e,t,r,i,s){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=s,this.id=Ct.cardId++}};St.cardId=1;let yr=St;class mr extends P{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return ar(this.id,e)}static checkAndGenerate(e,t,r){return sr(e,t,r).then(i=>i.length===0?or(e,t,r):i[0])}}function Er(){return U().emit("client:read",{})}var bt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},wr=(n,e,t)=>(bt(n,e,"read from private field"),t?t.call(n):e.get(n)),vr=(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)},_r=(n,e,t,r)=>(bt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),me;const Oe=class H extends P{constructor(){super(...arguments),this.type="front",this.organizations=[],vr(this,me,!1)}set language(e){localStorage.setItem(A.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(A.LOCALSTORAGE_LANGUAGE_KEY)||H.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){_r(this,me,e),this.emit(H.EVENT_READY_UPDATE,e)}get ready(){return wr(this,me)}onReady(e){return this.on(H.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(H.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(A.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(H.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){K()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(A.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 Er()}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}}};me=new WeakMap;Oe.DEFAULT_LANGUAGE="en";Oe.EVENT_CONTEXT_UPDATE="event:context-update";Oe.EVENT_READY_UPDATE="event:ready-update";let Tr=Oe;function Sr(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(Sr(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 ue(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${ue(t)}`};$.beginWith=function(e,t){return`@${e} BeginWith ${ue(t)}`};$.notEq=function(e,t){return`@${e} nq ${ue(t)}`};$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${ue(t)}`};$.in=function(e,t){const r=t.map(ue).join(", ");return`@${e} in (${r})`};$.and=function(...e){return e.join(" and ")};$.is=function(e,t){return`@${e} is ${t}`};$.or=function(...e){return e.join(" or ")};const O=new Tr,Be=new le;class Cr{static get url(){return"/close-api/metadata"}static async get(e,t,r){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const i=new URLSearchParams;return t&&i.append("criteria",t),r&&i.append("id",String(r)),await X(this.url+`/${e}?${i.toString()}`,{method:"GET"})}static getById(e,t,r=[]){const i=new URLSearchParams;return _e(i,r),t&&i.append("id",t),X([this.url,e].join("/")+`?${i.toString()}`)}static getFieldInformation(e,t){return X(`/open-api/metadata/${e}/fields/${t}`)}static getTreatmentListField(e,t){return X(`/open-api/metadata/${e}/list-fields/${t}`)}}class br{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 Ar{static invite(e,t,r){return p("/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 p("/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 p("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class Ge{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return p(Ge.url+e,{method:"POST",body:JSON.stringify(t)})}}class kr{static getConfiguration(){return p("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class Nr{static url(){return"/close-api/actions"}static async get({criterion:e}){const t=new URLSearchParams;return e&&t.append("criterion",e),await fetch(this.url()+`?${t.toString()}`,{method:"GET"}).then(r=>r.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return _e(i,r),X([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function Ir(n,e="images"){return`/static-folder/${e}/${n}`}class Or{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 p(`/${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]):D.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 p(`/${Q.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return p(`/${Q.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class $r{static getListSettings(e,t){const r=new URLSearchParams;r.set("entity",e),t&&r.set("mark",t);const i=`/close-api/views/list/configs?${r.toString()}`;return p(i)}}var At=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},x=(n,e,t)=>(At(n,e,"read from private field"),t?t.call(n):e.get(n)),j=(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)},q=(n,e,t,r)=>(At(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ee,oe,we,ve,se,ae,Ue;const G="_______LIST_______ROW_______INDEX________NAME_______",$e=class B extends P{constructor(e){super(),this.LIST_ROW_KEY=1,j(this,Ee,void 0),this.array=[],j(this,oe,[]),j(this,we,[]),j(this,ve,new Proxy({},{set:(t,r,i,s)=>(t[r]=i,this.emit(B.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(B.EVENT_FILTERS_UPDATE,t),!0)})),j(this,se,!1),j(this,ae,(...t)=>Promise),j(this,Ue,()=>{}),q(this,Ee,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&q(this,oe,e.config)}set config(e){q(this,oe,e.map(I.utils.copyObject)),this.emitUpdateConfig()}get config(){return x(this,oe)}emitUpdateConfig(){this.emit(B.EVENT_CONFIG_UPDATE,this.config)}get order(){return x(this,we)}set order(e){q(this,we,e),this.emit(B.EVENT_ORDER_UPDATE,this.order)}get filters(){return x(this,ve)}set filters(e){Lr(x(this,ve),e)}set wait(e){q(this,se,e),this.emit(I.Form.EVENT_WAIT,x(this,se))}get wait(){return x(this,se)}get primaryKeys(){return x(this,Ee)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[G]===e)}indexByKey(e){return this.array.findIndex(t=>t[G]===e)}static getKey(e){return e[G]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,G)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(B.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const t=this.indexByKey(e);t!==-1&&(this.array.splice(t,1),this.emit(B.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(B.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[G]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,G)}set read(e){q(this,ae,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=x(this,ae).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){q(this,ae,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>x(this,Ue).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static mergeWithKey(e,t){return{...e,[G]:t}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,t){const r=B.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}}};Ee=new WeakMap;oe=new WeakMap;we=new WeakMap;ve=new WeakMap;se=new WeakMap;ae=new WeakMap;Ue=new WeakMap;$e.EVENT_DATA="list-data: update";$e.EVENT_CONFIG_UPDATE="list-config:update";$e.EVENT_ORDER_UPDATE="list-order:update";$e.EVENT_FILTERS_UPDATE="list-filters:update";function Rr(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 Lr(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Pr(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 Dr(n){return n.statusName==="Completed"}function xr(n){return n.statusName==="FinalStepWithConfirmation"}function Br(n){return n.statusName==="ValidationError"}function Ur(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(y=>y.name===u))==null?void 0:c.fields)||[]:[]}function f(c){if(l(),Br(c))return void t.onValidation(c.validationResults);if((c.statusName==="FinalStep"||c.statusName==="NextStep")&&(!d().length||Vr(d(),t.presets)))return C(t.presets||{});Dr(c)&&t.onCompleted(c),xr(c)&&t.onConfirmation(c)}async function _(){try{await h(),await w()}catch(c){const{message:y}=Te(c);Ce.add("error",y)}}function h(){return i.wait="Loading process information.",ye.getStartConfig(e,n).then(c=>{s=c.steps.map(y=>({label:y.title,name:y.stepName,number:y.number,fields:y.frontendEntity.objectTypes.reduce((E,R)=>(R.properties.forEach(b=>{E.push({name:b.name,label:b.title,type:b.refEntityName||b.dataType})}),E),[])}))}).then(c=>(i.wait=!1,c))}function g(c){return u=c.nextStepName,r=c.token,c}function m(c){const y=Te(c);Ce.add("error",y.message)}function w(){return i.wait="Starting process",ye.startProcess(e,n).then(g).then(f).catch(m).finally(()=>{i.wait=null})}function C(c={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Expect the result",ye.runStep(e,n,u,r,c).then(g).then(f).catch(m).finally(()=>{i.wait=!1}))}return{initialize:_,state:i,currentStepConfig:o.readonly(a),next:C}}function Vr(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 Mr="close-api/proxy/Equipment/Search";class Fr{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=`/${Mr}?${u.toString()}`;return p(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Wr={clickOutside:Ae,staticLink:Ir},jr={usage:Rt,utils:Ft,config:Wt,types:jt};exports.Communication=mr;exports.CoreError=D;exports.Filter=$;exports.Manager=O;exports.NotificationSystem=Ce;exports.WidgetButton=yn;exports.WidgetIcon=Ne;exports.WidgetImage=kn;exports.WidgetList=Mn;exports.WidgetLoader=bn;exports.WidgetMultiButton=Tn;exports.WidgetSpinner=Ie;exports.WidgetTable=fn;exports.actionService=Nr;exports.asyncProcess=Fn;exports.authService=S;exports.billingService=Q;exports.catchUniversal=K;exports.clickOutside=Ae;exports.clientService=lt;exports.communicationService=Xt;exports.configurationService=$r;exports.constants=A;exports.dataService=ce;exports.debounce=Kn;exports.default=jr;exports.documentsService=Or;exports.equipmentService=Fr;exports.fileService=br;exports.getCellValue=Et;exports.getNamesFromListConfig=jn;exports.groupArrayByField=qn;exports.historyService=qt;exports.internationalizationService=Gt;exports.invitationService=Ar;exports.metadataService=Cr;exports.openService=kr;exports.parseError=Te;exports.prettyDate=We;exports.prettyDateWithTime=wt;exports.prettyMoney=_t;exports.prettyValueFieldByEntity=Hn;exports.processWizardService=ye;exports.request=X;exports.ruleValidationService=Ge;exports.t=Z;exports.throttle=Yn;exports.universalEntityRead=Se;exports.universalEntityUpdate=je;exports.useCommunication=lr;exports.useFormEntity=ur;exports.useListActiveRow=Xn;exports.useListEntity=rr;exports.useListSearch=Rr;exports.useListSelect=Pr;exports.useLogger=Kt;exports.useManagerState=ir;exports.useMetadata=hr;exports.useSocket=U;exports.useWizard=Ur;exports.utils=Wr;exports.uuidv4=Gn;exports.valuesToUpperCase=qe;exports.viewService=Qt;
|
|
11
11
|
//# sourceMappingURL=eservices-core.cjs.js.map
|
|
@@ -5,7 +5,7 @@ import { RouterLink as tn } from "vue-router";
|
|
|
5
5
|
import Ze from "debug";
|
|
6
6
|
import nn from "date-and-time";
|
|
7
7
|
/*!
|
|
8
|
-
* eservices-core v1.3.
|
|
8
|
+
* eservices-core v1.3.47
|
|
9
9
|
* (c) 2023 ESERVICES
|
|
10
10
|
*/
|
|
11
11
|
function rn(n, e) {
|
|
@@ -1708,7 +1708,7 @@ const hr = function() {
|
|
|
1708
1708
|
const o = /* @__PURE__ */ new Set();
|
|
1709
1709
|
function l() {
|
|
1710
1710
|
if (e)
|
|
1711
|
-
|
|
1711
|
+
i && (clearTimeout(i), i = 0);
|
|
1712
1712
|
else
|
|
1713
1713
|
return;
|
|
1714
1714
|
i = setTimeout(() => {
|
|
@@ -1763,7 +1763,7 @@ const hr = function() {
|
|
|
1763
1763
|
}, e.onmessage = (a) => {
|
|
1764
1764
|
var g;
|
|
1765
1765
|
try {
|
|
1766
|
-
if (pr(a)) {
|
|
1766
|
+
if (pr(a.data)) {
|
|
1767
1767
|
l();
|
|
1768
1768
|
return;
|
|
1769
1769
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.es-list-container{overflow:auto}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.widget-table__head-cell[data-v-25198f4a]{padding:18px;text-align:start}.widget-table__head-label[data-v-25198f4a]{font-weight:600;font-size:14px;line-height:19px}[dir=rtl] .icon[data-v-e287c8d9]{transform:scaleX(-1)}.widget-spinner[data-v-0ef9ae88],.widget-spinner[data-v-0ef9ae88]:after{border-radius:50%;width:14px;height:14px}.widget-spinner[data-v-0ef9ae88]{font-size:2px;position:relative;text-indent:-9999em;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid #ffffff;transform:translateZ(0);animation:spinnerAnimation-0ef9ae88 1.1s infinite linear}@keyframes spinnerAnimation-0ef9ae88{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.widget-button[data-v-450dc564]{position:relative}.widget-button-spinner[data-v-450dc564]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.widget-multi-button-wrap[data-v-a8d711d1]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-a8d711d1]{grid-template-columns:1fr var(--button-size);background-color:var(--primary);grid-template-rows:var(--button-size);transition:var(--fast)}.widget-multi-button_active[data-v-a8d711d1]{grid-template-rows:calc(var(--button-size) * var(--7025434e))}.widget-multi-button-body[data-v-a8d711d1]{min-width:80px}.widget-multi-button-body-label[data-v-a8d711d1]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-a8d711d1]:hover{background-color:#223296}.widget-multi-button-side[data-v-a8d711d1]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-a8d711d1]{transform:rotate(180deg)}.widget-multi-button-side[data-v-a8d711d1]:hover{background-color:#223296}tr[data-v-344a8cc1]{border:1px solid #F3F4FC;height:30px}th[data-v-344a8cc1],td[data-v-344a8cc1]{position:relative;padding:0 11px}th[data-v-344a8cc1]{text-align:left}p[data-v-344a8cc1]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.widget-list-head-cell[data-v-bf495d6a]{padding:0 0 0 10px;display:flex}.widget-list-head-cell[data-v-bf495d6a]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-bf495d6a]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-bf495d6a]{position:absolute;inset-inline-end:22px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-bf495d6a]{transform:rotate(180deg)}.head-cell-resize[data-v-bf495d6a]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-bf495d6a]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-bf495d6a]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-ccffc6bd]{position:sticky;top:-1px;z-index:1}.test-block[data-v-ccffc6bd]{position:absolute;z-index:2;display:none;height:calc(100% + 1px);place-content:center;inset-block-start:-1px;padding-inline:10px;background-color:#e7f2ff;-webkit-user-select:none;user-select:none;white-space:nowrap}.widget-list-head th[data-v-ccffc6bd]{position:sticky;top:0;z-index:2;-webkit-user-select:none;user-select:none}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
2
|
(function(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")):typeof define=="function"&&define.amd?define(["exports","vue","jenesius-vue-form","vue-router","debug","date-and-time"],o):(l=typeof globalThis<"u"?globalThis:l||self,o(l["eservices-core"]={},l.Vue,l.JenesiusVueForm,l.VueRouter,l.Debug,l.DateAndTime))})(this,function(l,o,v,vt,Le,It){"use strict";/*!
|
|
3
|
-
* eservices-core v1.3.
|
|
3
|
+
* eservices-core v1.3.47
|
|
4
4
|
* (c) 2023 ESERVICES
|
|
5
5
|
*/function Ot(n,e){return!!n&&n===e||"password is not equal"}function Ke(n){return Number(n.replace(/[^0-9.]/g,""))}function $t(n,e=null){let r=String(Ke(n)).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length>1&&e!==null&&r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const Rt={inputs:Object.freeze(Object.defineProperty({__proto__:null,numeric:Ke,prettyNumeric:$t,validPassword:Ot},Symbol.toStringTag,{value:"Module"}))};function fe(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?fe(n[r],e.substr(t+1)):void 0}return n[e]}function pe(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 Ye(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const Je=class T extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=T.ID++}static ParentFormNotFound(){return new T("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new T("Composite object name is undefined",e)}static EntityWithoutName(e){return new T("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new T(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new T("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new T("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new T(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return T.ApiNotAvailable()}static ApiError(e){return new T("Request error",e)}static ApiNotAvailable(){return new T(`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?T.ApiNotAvailable():new T(e||"Authorization Error",t)}static ApiResponseParseFailed(){return T.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new T("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new T(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new T("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new T("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new T(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new T(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new T(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new T(`Metadata for the ${e} is not currently available.`)}static RequestTookToLong(){return new T("The request took too long to complete. Try again later.")}};Je.ID=0;let L=Je;const Lt="Please try again later or submit a feedback if problem doesn't go.";class He{static getClientData(){return h("/close-api/client-content")}static getNavigation(){return h("/close-api/client/navigation")}}const Pt=new class{constructor(){this.store=o.reactive([])}add(e,t,{children:r,timeout:i=10,click:s=()=>{}}={}){const d=new Dt(e,t,i,r||[],s);return this.store.push(d),i&&setTimeout(this.remove.bind(this,d.id),i*1e3),d}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}removeChild(e,t){throw new Error("Removing children error.")}},Xe=class kt{constructor(e,t,r,i,s){this.type=e,this.msg=t,this.timeout=r,this.children=i,this.click=s,this.id=kt.cardId++}};Xe.cardId=1;let Dt=Xe;/*!
|
|
7
7
|
* jenesius-event-emitter v1.0.2
|
|
8
8
|
* (c) 2022 Jenesius
|
|
9
9
|
* @license MIT
|
|
10
|
-
*/const Qe=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},Ze=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},et=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},tt=function(){this.events={}};class P{constructor(){this.events={}}on(e,t){return Qe.call(this,e,t)}emit(e,t){return Ze.call(this,e,t)}off(e,t){return et.call(this,e,t)}cleanEvents(){tt.call(this)}static on(e,t){return Qe.call(P,e,t)}static emit(e,t){return Ze.call(P,e,t)}static off(e,t){return et.call(P,e,t)}static cleanEvents(){tt.call(P)}}P.events={};var nt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},he=(n,e,t)=>(nt(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)=>(nt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),te,ge,ye;const q=class O extends P{constructor(){super(...arguments),Pe(this,te,void 0),Pe(this,ge,"front"),this.organizations=[],Pe(this,ye,!1)}set language(e){localStorage.setItem(O.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(O.LOCALSTORAGE_LANGUAGE_KEY)||O.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(O.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(!he(this,te))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return he(this,te)}set type(e){De(this,ge,e)}get type(){return he(this,ge)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){De(this,ye,e),this.emit(O.EVENT_READY_UPDATE,e)}get ready(){return he(this,ye)}onReady(e){return this.on(O.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(O.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(O.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(O.CURRENT_CONTEXT_KEY,String(e)),this.emit(O.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(O.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{Pt.add("error",L.ApiNotAvailable().message)}}loadCustomerData(){return He.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,ge=new WeakMap,ye=new WeakMap,q.DEFAULT_LANGUAGE="en",q.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",q.EVENT_CONTEXT_UPDATE="event:context-update",q.EVENT_READY_UPDATE="event:ready-update",q.EVENT_DATA_UPDATE="event:data-update",q.CURRENT_CONTEXT_KEY="CurrentContext";let Bt=q;const rt=new Bt;function Ut(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Lt}})}function h(n,e={}){return rt.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=rt.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw L.ApiNotAvailable()}).then(t=>Ut(t).then(r=>{if(!t.ok)throw r;return r}))}class me{constructor(){}static parseNamesFromListConfig(e){let t=me.parseFieldsToGraphQL(e.reduce((i,s)=>(s.name&&i.push(s.name),i),[]));function r(i){let s="";for(let d in i)typeof i[d]=="boolean"?s+=` ${d} `:s+=` ${d} { ${r(i[d])} }`;return s}return r(t)}static parseSortFromListConfig(e){let t={};for(let r in e)t[r]=e[r]?"ASC":"DESC";return t}static parseFieldsToGraphQL(e){function t(r,i){if(i.includes(".")){const s=i.indexOf("."),d=i.substring(s+1),a=i.substring(0,s);a in r||(r[a]={}),t(r[a],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 it=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 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(".")}const Wt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:me,Journal:it,Request:h,clickOutside:pe,default:{Request:h,clickOutside:pe,getPropFromObject:fe,runPromiseQueue:Ye,GraphQL:me,firstChapterToLowerCase:ot,valuesToUpperCase:Be,prettyMoney:Mt},firstChapterToLowerCase:ot,getPropFromObject:fe,runPromiseQueue:Ye,valuesToUpperCase:Be},Symbol.toStringTag,{value:"Module"}));function st(n,e=""){for(let t in n){if(typeof n[t]=="object"){st(n[t],(e.length?`${e}-`:"")+t);continue}let r="--"+((e.length?`${e}-`:"")+t).replace(/([A-Z])/g,i=>`-${i}`.toLowerCase());document.documentElement.style.setProperty(r,n[t])}}const W={};function Ft(n){for(let e in n)W[e]=n[e];n.styles&&st(n.styles),it.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=W}const qt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Gr="";class jt{static readHistoryById(e,t){return h(`/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 d=s.changes.map(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...s,changes:d}});return{...r,history:i}})}}class Gt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return h(`/open-api/internationalization/language/${e}`)}}let j={};function H(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=v.utils.getPropFromObject((this==null?void 0:this.vocabulary)||j,n);if(typeof t=="string")return at(t,e);const r=v.utils.getPropFromObject(j==null?void 0:j.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}H.setGlobalVocabulary=function(n){j=n},H.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),H.bind({vocabulary:v.utils.getPropFromObject(j,e.toLowerCase())})},H.setVocabulary=function(n){return typeof n=="string"&&(n=v.utils.getPropFromObject(j,n)),H.bind({vocabulary:n})};const xt=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 s(...u){r("warn",u)}function d(...u){r("error",u)}function a(u=!0){n=u}return{info:i,warn:s,history:e,display:a,error:d}}();function zt(){return xt}class b{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw L.AuthServiceError(e.title,t)}static login(e){return h(W.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:W.applicationName})}).catch(b.parseError)}static registration(e){return e.AppName=W.applicationName,h(W.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(b.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw L.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return b.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return b.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return b.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return b.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return h(`${W.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(b.parseError)}static startLoginProcess(e){return b.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return b.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return b.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return h(`${W.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(b.parseError).then(b.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw L.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}function Kt(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Yt="masterId",Jt="masterEntity";function Ee(n,e){if(!Array.isArray(e))return;if(Kt(e))return t(e);e.forEach(t);function t(r){n.append(Jt,r[0]),n.append(Yt,r[1].toString())}}class ne{static async anonymousGetList(e){return await h(`/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 d=(Array.isArray(i)?[i]:Object.entries(i)).map(([a,u="desc"])=>`@${a} ${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 h(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=ne.getSearchParamsForEntityListRead(t||{});return h(`/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 Ee(i,r==null?void 0:r.masterEntities),h(`/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 h(`/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 h(`/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 Ee(s,i==null?void 0:i.masterEntities),h(`/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 ne.removeByKeys(e,i,r)}static removeByKeys(e,t,r){return h(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}const ct=class de{static async create(e){return h(de.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 h(de.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return h(`${de.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return h(`${de.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};ct.url="/close-api/communications";let Ht=ct;class Xt{static async getDefaultView(e){return h("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function lt(n){return{...n,createdEntities:n.createdEntites}}const ut=class Re{static async getStartConfig(e,t){return h([Re.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return h([Re.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(lt)}static async runStep(e,t,r,i,s){return h([Re.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(lt)}};ut.url="/close-api/views/process-wizard";let we=ut;const Qt={class:"widget-table__head"},Zt={class:"widget-table__head-label margin_0 text_overflow"},en=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",Qt,[(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",Zt,o.toDisplayString(r.label),1)]))),128))]))}}),xr="",F=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},tn=F(en,[["__scopeId","data-v-25198f4a"]]);function nn(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function dt(n,e){const t=nn(n);let r=t?v.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function Ue(n){return["eservices-core",n].join(":")}function ft(n){return Ve(n,"YYYY/MM/DD HH:mm:ss")}function Ve(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return It.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const zr="",_e=F({props:{name:String},setup(n,e){let t="unknown";try{t=e.slots.default()[0].children}catch{t=n.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${t}`})}},[["__scopeId","data-v-e287c8d9"]]),rn=Le(Ue("setup-list-row"));function on(n,e){const t=n.config.map(r=>sn(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function sn(n,e,t){const r=e.values;let i=dt(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function d(p){s.onClick.push(()=>p(r))}function a(p){Array.isArray(p)?s.class.push(...p):s.class.push(p)}const u=[],f=[];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=Ve(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(v.FormField,{type:"single-checkbox",modelValue:e.selected})),d(pt.bind(null,t,!0));break}case"select":{f.push(o.h(v.FormField,{type:"single-radio",modelValue:e.selected})),d(pt.bind(null,t,!1));break}}if(n.onClick&&d(n.onClick),n.link)try{const p=n.link(r);if(p){const S=o.h(vt.RouterLink,{to:p});f.push(S),a("widget-table-cell_link")}}catch(p){rn("Can't add router link",p)}return n.href&&(f.push(o.h("a",{href:n.href(r),target:"_blank"})),a("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&f.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&f.push(o.h(_e,{name:n.icon})),n.class&&(typeof n.class=="function"?a(n.class(r)):a(n.class)),u.push(o.h("td",s,f)),u}function pt(n,e){n.emit("select",e)}function ht(n,e){return()=>{try{return on(n,e)}catch(t){return console.warn(t),null}}}const an={props:{values:Object,config:Object,selected:Boolean},setup:ht},cn=["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]=s=>e("close")),onSave:i[1]||(i[1]=s=>e("save",s))}),null,16,["values","new"]))],8,cn)],512))}}),A={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",TIME_TO_LIVE_SOCKET_REQUEST:1e4},ln={class:"widget-table"},yt="update:selectedRows",un=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,u=!0){if(!t.selectedRows)return;if(!u)return e(yt,t.selectedRows.includes(a)?[]:[a]);const f=[...t.selectedRows],p=f.indexOf(a);return p===-1?f.push(a):f.splice(p,1),e(yt,f)}function d(a){e("save",a),e("update:activeRow",null)}return(a,u)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",ln,[o.createVNode(tn,{config:a.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(f,p)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:p},[o.createVNode(an,{config:a.config,values:f,selected:a.selectedRows.includes(f),onSelect:S=>s(f,S),class:o.normalizeClass(a.classCallback?a.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&a.activeRow===f?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":a.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)),a.activeRow===o.unref(A).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":a.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)])])]))}}),dn=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))}}),Yr="",Te=F(dn,[["__scopeId","data-v-0ef9ae88"]]),fn={class:"widget-button"},pn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",fn,[e.wait?(o.openBlock(),o.createBlock(Te,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),Jr="",hn=F(pn,[["__scopeId","data-v-450dc564"]]),gn={class:"widget-multi-button-wrap position_relative cursor_pointer"},yn={class:"widget-multi-button-body grid"},mn=["onClick"],En={class:"widget-multi-button-side-wrap"},wn=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(d=>({"7025434e":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 s(d=!t.active){t.active=d}return(d,a)=>(o.openBlock(),o.createElementBlock("div",gn,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",yn,[d.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]=u=>s())},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:p=>{i(u.callback),s(!1)}},o.toDisplayString(u.label),9,mn))),128))]),o.createElementVNode("div",En,[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]=u=>s())},[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(_e),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),Hr="",_n=F(wn,[["__scopeId","data-v-a8d711d1"]]),Tn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Sn={class:"text_md"},Cn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",Tn,[o.createVNode(Te,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",Sn,o.toDisplayString(e.label),1)]))}}),bn=["alt","src"],An=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))}}),kn={props:{config:Array,values:Object,selected:Boolean},setup:ht},Xr="",Nn=F(kn,[["__scopeId","data-v-344a8cc1"]]),vn=n=>(o.pushScopeId("data-v-bf495d6a"),n=n(),o.popScopeId(),n),In={class:"widget-list-head-cell"},On=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",In,[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(v.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(_e),{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),On])]))}}),Qr="",Rn=F($n,[["__scopeId","data-v-bf495d6a"]]),Ln=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(y,E){let _=-1;do _++,E-=y[_];while(E>0&&_<y.length);return _}function f(y,E){let _=0;for(;E>0&&E>y[_]&&_<y.length;)E-=y[_],_++;return console.log(E,_),_>0?_:0}function p(y){try{i.value.style.insetInlineStart=y+"px"}catch(E){console.log(E)}}function S(y){try{i.value.style.width=y+"px",i.value.style.minWidth=y+"px",i.value.style.maxWidth=y+"px"}catch(E){console.log(E)}}function g(y){return y===null?!1:y.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(E){var At;function _(I){return I.screenX+m-N}const k=r.value,c=[...k.children].filter(I=>I.localName==="th"),m=((At=k.offsetParent)==null?void 0:At.scrollLeft)||0,w=c.map(I=>I.clientWidth),D=g(E.target),N=k.getBoundingClientRect().left,Z=_(E),C=u(w,Z),J=w.slice(0,C).reduce((I,B)=>I+B,0),ce=Z-J,xe=k.offsetWidth,le=c[C].clientWidth;if(t.config[C].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",E.screenX),console.log("Widths",w),console.log("max width",xe),console.log("Start Position",Z),console.log("Position From",C),console.log("Start Position",C),console.log("Global offset (Отступ самой таблицы от края экрана)",N),console.log("Del",ce),console.groupEnd(),i.value.innerText=c[C].textContent||"",i.value.style.display="grid",i.value.style.width=le+"px",i.value.style.cursor="grabbing",p(J),S(le),document.addEventListener("pointermove",bt,{passive:!0}),document.addEventListener("pointerup",Ct);function Ct(I){if(console.group("END"),document.removeEventListener("pointermove",bt),document.removeEventListener("pointerup",Ct),D&&(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)),!D){const B=I.screenX+m-N;console.log("ENP Position",B);const $e=f(w,B);if(console.log(C,"->",$e),$e!==C){const ue=t.config[C],ze=t.config;ze.splice(C,1),ze.splice($e,0,ue),s(ze)}else{const ue=t.config[C].name;d(ue)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function bt(I){if(D){const ue=_(I)-Z+le;S(ue);return}let B=I.screenX+m-N-ce;B<0&&(B=0),B+le>xe&&(B=xe-le),p(B)}})});function s(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 a([u]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";a([u,f==="asc"?"desc":"asc"])}function a(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,(p,S)=>(o.openBlock(),o.createBlock(Rn,o.mergeProps({key:p},p,{onOrder:g=>d(p.name),onSelect:f[0]||(f[0]=g=>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))}}),Zr="",Pn=F(Ln,[["__scopeId","data-v-ccffc6bd"]]),Dn={class:"widget-list"},Bn={class:"widget-list-body position_relative"},Un=50,Vn=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,u=!0){if(t.selectedRows)if(!u)s(t.selectedRows.includes(a)?[]:[a]);else{const f=[...t.selectedRows],p=f.indexOf(a);p===-1?f.push(a):f==null||f.splice(p,1),s(f)}}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 d(a){if(!a)return;const u=a.target;u.scrollTop+u.clientHeight+Un>u.scrollHeight&&e("scrollEnd")}return(a,u)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:d},[o.createElementVNode("table",Dn,[o.createElementVNode("thead",null,[o.createVNode(Pn,{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:a.config,order:a.order},null,8,["config","order"])]),o.createElementVNode("tbody",Bn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(f,p)=>{var S;return o.openBlock(),o.createBlock(Nn,{key:p,class:"widget-list-row",values:f,config:a.config,selected:(S=a.selectedRows)==null?void 0:S.includes(f),onSelect:g=>r(f,g)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function Mn(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 Se(n){return typeof n=="string"?Me(n):Wn(n)?Me(n.message):Me(A.DEFAULT_ERROR_MESSAGE)}function Wn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function Me(n){return{message:n}}function G(n="error"){return function(e){const{message:t}=Se(e);be.add(n,t)}}function Ce(n,e={}){return U().emit("entity:read",{...e,entity:n})}function We(n,e){return U().emit("entity:update",{...e,entity:n})}function Fn(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 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 qn(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 jn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Gn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return A.DEFAULT_ERROR_MESSAGE}})}function X(n,e={}){return R.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=R.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw new Error(A.DEFAULT_ERROR_MESSAGE)}).then(t=>Gn(t).then(r=>{if(!t.ok)throw r;return r}))}function xn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function zn(n,e){let t=!1;return(...r)=>{if(!t)return t=!0,setTimeout(()=>t=!1,e),n(...r)}}const Kn=Le(Ue("pretty-value-field-by-entity"));function Yn(n,e,t){try{const r=qe.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{return Kn('Error by parse pretty value for entity "%s", field "%s" with value "%s"',n,e,t),""}}function Jn(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const Hn=1,Xn=5e3,x=Le(Ue("use-socket"));function U(){return Zn}function Qn(n){return typeof n=="object"&&Object.prototype.toString.call(n)==="[object Blob]"}const Zn=function(){let n=1,e,t;const r=new Set;let i=0;const s=new Set;function d(){if(e)e&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},Xn+1e3);const c=new Uint8Array(1);c[0]=Hn,e.send(c)}setInterval(()=>{Array.from(r).forEach(c=>{k(c)&&(x("Handler for event %s requestId %d was expired",c.event,c.requestId),c.requestId?u({requestId:c.requestId,event:"request-error",data:{message:L.RequestTookToLong().message}}):r.delete(c))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&f()},A.DELAY_SOCKET_RECONNECT);function a(){return{safeQueue:s,requestId:n,handlers:r,socketInstance:e}}function u(c){const m=[...r.values()];x("Handlers array length is %d. Response event: %s. Request id: %d",r.size,c.event,c.requestId),m.forEach(w=>{const D=c.requestId;(w.requestId&&w.requestId===D||!w.requestId&&w.event===c.event)&&(x("Find appropriated handler: %d, event: %s",n,w.event),w.callback(c.data,c),w.once&&(r.delete(w),x("Handler was removed by *once* params was passed. %o",w)))})}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){x("Connection to server was stopped: %d %s",c.code,c.reason),Array.from(r).forEach(m=>{m.guaranteedAnswer&&m.serializeString&&s.add(m.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(c=>{p(c),s.delete(c)})},e.onerror=function(c){console.warn(c)},e.onmessage=c=>{var m;try{if(Qn(c)){d();return}const w=JSON.parse(c.data);if(!Et(w)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(w);return}(m=w==null?void 0:w.data)!=null&&m.refresh&&location.reload(),u(w)}catch(w){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(w)}}}function p(c){e.send(c)}function S(c,m){_({event:c,callback:m})}function g(c,m){_({event:c,callback:m,once:!0})}function y(){return e&&(e==null?void 0:e.readyState)===1}function E(c,m,w){const D=++n,N=JSON.stringify({requestId:D,event:c,data:m,contextId:R.contextId,url:window.location.href});return y()?p(N):(s.add(N),x("Socket is not connected. Message was send to save-queue")),new Promise((Z,C)=>{_({event:c,requestId:D,once:!0,guaranteedAnswer:!0,serializeString:N,callback:(J,ce)=>{if(x("Promise was resolve with next data:",J),er(ce))return void C(J);w&&w(J,ce),Z(J)},timeToLive:A.TIME_TO_LIVE_SOCKET_REQUEST})})}function _(c){const m={timeToLive:0,...c,created:new Date().getTime()};r.add(m)}function k(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:g,emit:E,initialization(c){t=c},getDevInfo:a}}(),er=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 tr(n,e){const t=o.reactive([]);let r=0;const i=o.ref(!1);function s(){if(i.value)return Promise.reject("The process has already started.");const g=p();return i.value=!0,typeof g.limit!="number"&&(g.limit=100),g.offset=r,Ce(n,g).then(y=>(r+=y.length,y)).finally(()=>{i.value=!1})}function d(g,y){var _;const E=g.Version||((_=t.find(k=>k.Id===y))==null?void 0:_.Version);if(E===void 0)throw new Error("Object without version.");return E}function a(g,y){const E=t.findIndex(_=>_.Id===g);if(E===-1)throw new Error(`Can't found item with Id ${g}`);t.splice(E,1,y)}async function u(g,y){try{const E=p(),_=d(y,g);delete y.Version,await We(n,{id:g,values:y,version:_});const k=await Ce(n,{fields:E.fields||"",id:g});a(g,k)}catch(E){G()(E)}}async function f(){try{const g=await s();t.push(...g)}catch(g){G()(g)}}function p(){return typeof e=="function"?e():e}async function S(){try{r=0;const g=await s();t.splice(0,t.length,...g)}catch(g){G()(g)}}return{array:t,updateById:u,next:f,reload:S,wait:i}}function nr(){function n(){return{organizations:R.organizations,currentContextId:R.contextId,person:R.person,context:R.context,contextType:R.contextType,userId:R.userId}}const e=o.reactive(n());return R.onupdateContext(()=>{Object.assign(e,n())}),e}function rr(n,e,t){return U().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function ir(n,e,t){return U().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function or(n,e){return U().emit("communication-message:create",{communicationId:n,text:e})}function sr(n){return U().emit("communication-message:read",{communicationId:n})}function ar(n){const e=v.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>sr(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function cr(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw L.EntityWithoutName(n);return Ce(n.name,r)}).then(Fe).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(G())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw L.EntityWithoutName(n);return We(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw G()(i),i})};function t(){return typeof e=="function"?e():e}}function lr(n,e){return U().emit("metadata:read",{...e,entity:n})}class re{constructor(){this.state=o.reactive({})}set(e,t,r){this.state[re.getKey(e,t)]=r}get(e,t={}){return this.state[re.getKey(e,t)]}getByKey(e){return this.state[e]}update(e,t){return lr(e,t).then(this.set.bind(this,e,t))}static getKey(e,t){const r={entity:e,entityId:t.id,masterEntities:ur(t.masterEntities)};return JSON.stringify(r)}}function ur(n){return!n||!Array.isArray(n)?[]:n.length===0?[]:dr(n)?[n]:n}function dr(n){return!!n&&Array.isArray(n)&&typeof n[0]=="string"&&typeof n[1]=="number"}function fr(n,e={}){if(!n)return o.inject(A.PROVIDE_NAME_METADATA);const t=o.ref(null),r=o.computed(()=>t.value?qe.getByKey(t.value):null);o.provide(A.PROVIDE_NAME_METADATA,r);function i(){if(!n)throw new Error("Entity is not provided for metadata.");t.value=re.getKey(n,wt(e||{}))}const s=function(){return i(),qe.update(n,wt(e||{}))};return i(),{state:r,update:s}}function wt(n){return typeof n=="function"?n():n}const be=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=pr(r),s=new hr(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 pr(n){function e(r){return!!r&&typeof r=="object"}const t={timeout:10,click:()=>null,children:[]};return e(n)?{timeout:n.timeout||t.timeout,click:n.click||t.click,children:n.children||t.children}:t}const _t=class Nt{constructor(e,t,r,i,s){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=s,this.id=Nt.cardId++}};_t.cardId=1;let hr=_t;class gr extends P{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return or(this.id,e)}static checkAndGenerate(e,t,r){return ir(e,t,r).then(i=>i.length===0?rr(e,t,r):i[0])}}function yr(){return U().emit("client:read",{})}var Tt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},mr=(n,e,t)=>(Tt(n,e,"read from private field"),t?t.call(n):e.get(n)),Er=(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)},wr=(n,e,t,r)=>(Tt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ae;const ke=class ee extends P{constructor(){super(...arguments),this.type="front",this.organizations=[],Er(this,Ae,!1)}set language(e){localStorage.setItem(A.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(A.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){wr(this,Ae,e),this.emit(ee.EVENT_READY_UPDATE,e)}get ready(){return mr(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(A.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){G()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(A.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 yr()}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 _r=ke;function Tr(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(Tr(r)){let i=function(s){var d;return((d=s.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 ie(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${ie(t)}`},$.beginWith=function(e,t){return`@${e} BeginWith ${ie(t)}`},$.notEq=function(e,t){return`@${e} nq ${ie(t)}`},$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${ie(t)}`},$.in=function(e,t){const r=t.map(ie).join(", ");return`@${e} in (${r})`},$.and=function(...e){return e.join(" and ")},$.is=function(e,t){return`@${e} is ${t}`},$.or=function(...e){return e.join(" or ")};const R=new _r,qe=new re;class Sr{static get url(){return"/close-api/metadata"}static async get(e,t,r){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const i=new URLSearchParams;return t&&i.append("criteria",t),r&&i.append("id",String(r)),await X(this.url+`/${e}?${i.toString()}`,{method:"GET"})}static getById(e,t,r=[]){const i=new URLSearchParams;return Ee(i,r),t&&i.append("id",t),X([this.url,e].join("/")+`?${i.toString()}`)}static getFieldInformation(e,t){return X(`/open-api/metadata/${e}/fields/${t}`)}static getTreatmentListField(e,t){return X(`/open-api/metadata/${e}/list-fields/${t}`)}}class Cr{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 br{static invite(e,t,r){return h("/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 h("/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 h("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class je{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return h(je.url+e,{method:"POST",body:JSON.stringify(t)})}}class Ar{static getConfiguration(){return h("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class kr{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 Ee(i,r),X([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function Nr(n,e="images"){return`/static-folder/${e}/${n}`}class vr{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 h(`/${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]):L.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 h(`/${Q.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return h(`/${Q.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class Ir{static getListSettings(e,t){const r=new URLSearchParams;r.set("entity",e),t&&r.set("mark",t);const i=`/close-api/views/list/configs?${r.toString()}`;return h(i)}}var St=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},V=(n,e,t)=>(St(n,e,"read from private field"),t?t.call(n):e.get(n)),z=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},K=(n,e,t,r)=>(St(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ne,oe,ve,Ie,se,ae,Ge;const Y="_______LIST_______ROW_______INDEX________NAME_______",Oe=class M extends P{constructor(e){super(),this.LIST_ROW_KEY=1,z(this,Ne,void 0),this.array=[],z(this,oe,[]),z(this,ve,[]),z(this,Ie,new Proxy({},{set:(t,r,i,s)=>(t[r]=i,this.emit(M.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(M.EVENT_FILTERS_UPDATE,t),!0)})),z(this,se,!1),z(this,ae,(...t)=>Promise),z(this,Ge,()=>{}),K(this,Ne,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&K(this,oe,e.config)}set config(e){K(this,oe,e.map(v.utils.copyObject)),this.emitUpdateConfig()}get config(){return V(this,oe)}emitUpdateConfig(){this.emit(M.EVENT_CONFIG_UPDATE,this.config)}get order(){return V(this,ve)}set order(e){K(this,ve,e),this.emit(M.EVENT_ORDER_UPDATE,this.order)}get filters(){return V(this,Ie)}set filters(e){$r(V(this,Ie),e)}set wait(e){K(this,se,e),this.emit(v.Form.EVENT_WAIT,V(this,se))}get wait(){return V(this,se)}get primaryKeys(){return V(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(M.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const t=this.indexByKey(e);t!==-1&&(this.array.splice(t,1),this.emit(M.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(M.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[Y]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,Y)}set read(e){K(this,ae,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=V(this,ae).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){K(this,ae,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>V(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=M.getCellName(e),i=(()=>{let s=r?fe(t,r):null;return s===void 0&&(s=null),e.value?e.value(s,t):s})();return{name:r,value:i}}};Ne=new WeakMap,oe=new WeakMap,ve=new WeakMap,Ie=new WeakMap,se=new WeakMap,ae=new WeakMap,Ge=new WeakMap,Oe.EVENT_DATA="list-data: update",Oe.EVENT_CONFIG_UPDATE="list-config:update",Oe.EVENT_ORDER_UPDATE="list-order:update",Oe.EVENT_FILTERS_UPDATE="list-filters:update";function Or(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 $r(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Rr(n){const e=o.reactive([]);function t(a){return e.includes(a)}function r(a){t(a)||e.push(a)}function i(a){const u=e.findIndex(f=>f===a);u!==-1&&e.splice(u,1)}function s(a){const u=o.unref(n);if(a===void 0){e.length===0?u.forEach(r):u.forEach(i);return}t(a)?i(a):r(a)}const d=o.computed(()=>{const a=o.unref(n);return e.length===a.length&&a.length!==0});return[e,s,d,r,i]}function Lr(n){return n.statusName==="Completed"}function Pr(n){return n.statusName==="FinalStepWithConfirmation"}function Dr(n){return n.statusName==="ValidationError"}function Br(n,e,t){let r=null;const i=o.reactive({wait:null});let s=[],d=null;const a=o.ref(null);function u(){a.value=s.find(c=>c.name===d)||null}function f(){var c;return d?((c=s.find(m=>m.name===d))==null?void 0:c.fields)||[]:[]}function p(c){if(u(),Dr(c))return void t.onValidation(c.validationResults);if((c.statusName==="FinalStep"||c.statusName==="NextStep")&&(!f().length||Ur(f(),t.presets)))return k(t.presets||{});Lr(c)&&t.onCompleted(c),Pr(c)&&t.onConfirmation(c)}async function S(){try{await g(),await _()}catch(c){const{message:m}=Se(c);be.add("error",m)}}function g(){return i.wait="Loading process information.",we.getStartConfig(e,n).then(c=>{s=c.steps.map(m=>({label:m.title,name:m.stepName,number:m.number,fields:m.frontendEntity.objectTypes.reduce((w,D)=>(D.properties.forEach(N=>{w.push({name:N.name,label:N.title,type:N.refEntityName||N.dataType})}),w),[])}))}).then(c=>(i.wait=!1,c))}function y(c){return d=c.nextStepName,r=c.token,c}function E(c){const m=Se(c);be.add("error",m.message)}function _(){return i.wait="Starting process",we.startProcess(e,n).then(y).then(p).catch(E).finally(()=>{i.wait=null})}function k(c={}){return!r||!d?Promise.reject("Not step or token."):(i.wait="Expect the result",we.runStep(e,n,d,r,c).then(y).then(p).catch(E).finally(()=>{i.wait=!1}))}return{initialize:S,state:i,currentStepConfig:o.readonly(a),next:k}}function Ur(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!v.utils.getPropFromObject(e,r.name))return!1}return!0}const Vr="close-api/proxy/Equipment/Search";class Mr{static search(e,t,r,i,s){const d=new URLSearchParams;d.append("pattern",e||""),t&&d.append("categoryId",t),r&&d.append("useType",String(r)),i&&d.append("statusCode",i),s&&(d.append("limit",String(s.limit)),d.append("offset",String(s.offset)));const a=`/${Vr}?${d.toString()}`;return h(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Wr={clickOutside:pe,staticLink:Nr},Fr={usage:Rt,utils:Wt,config:Ft,types:qt};l.Communication=gr,l.CoreError=L,l.Filter=$,l.Manager=R,l.NotificationSystem=be,l.WidgetButton=hn,l.WidgetIcon=_e,l.WidgetImage=An,l.WidgetList=Vn,l.WidgetLoader=Cn,l.WidgetMultiButton=_n,l.WidgetSpinner=Te,l.WidgetTable=un,l.actionService=kr,l.asyncProcess=Mn,l.authService=b,l.billingService=Q,l.catchUniversal=G,l.clickOutside=pe,l.clientService=He,l.communicationService=Ht,l.configurationService=Ir,l.constants=A,l.dataService=ne,l.debounce=xn,l.default=Fr,l.documentsService=vr,l.equipmentService=Mr,l.fileService=Cr,l.getCellValue=dt,l.getNamesFromListConfig=Fn,l.groupArrayByField=qn,l.historyService=jt,l.internationalizationService=Gt,l.invitationService=br,l.metadataService=Sr,l.openService=Ar,l.parseError=Se,l.prettyDate=Ve,l.prettyDateWithTime=ft,l.prettyMoney=mt,l.prettyValueFieldByEntity=Yn,l.processWizardService=we,l.request=X,l.ruleValidationService=je,l.t=H,l.throttle=zn,l.universalEntityRead=Ce,l.universalEntityUpdate=We,l.useCommunication=ar,l.useFormEntity=cr,l.useListActiveRow=Jn,l.useListEntity=tr,l.useListSearch=Or,l.useListSelect=Rr,l.useLogger=zt,l.useManagerState=nr,l.useMetadata=fr,l.useSocket=U,l.useWizard=Br,l.utils=Wr,l.uuidv4=jn,l.valuesToUpperCase=Fe,l.viewService=Xt,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
10
|
+
*/const Qe=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},Ze=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},et=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},tt=function(){this.events={}};class P{constructor(){this.events={}}on(e,t){return Qe.call(this,e,t)}emit(e,t){return Ze.call(this,e,t)}off(e,t){return et.call(this,e,t)}cleanEvents(){tt.call(this)}static on(e,t){return Qe.call(P,e,t)}static emit(e,t){return Ze.call(P,e,t)}static off(e,t){return et.call(P,e,t)}static cleanEvents(){tt.call(P)}}P.events={};var nt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},he=(n,e,t)=>(nt(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)=>(nt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),te,ge,ye;const q=class O extends P{constructor(){super(...arguments),Pe(this,te,void 0),Pe(this,ge,"front"),this.organizations=[],Pe(this,ye,!1)}set language(e){localStorage.setItem(O.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(O.LOCALSTORAGE_LANGUAGE_KEY)||O.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(O.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(!he(this,te))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return he(this,te)}set type(e){De(this,ge,e)}get type(){return he(this,ge)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){De(this,ye,e),this.emit(O.EVENT_READY_UPDATE,e)}get ready(){return he(this,ye)}onReady(e){return this.on(O.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(O.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(O.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(O.CURRENT_CONTEXT_KEY,String(e)),this.emit(O.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(O.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{Pt.add("error",L.ApiNotAvailable().message)}}loadCustomerData(){return He.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,ge=new WeakMap,ye=new WeakMap,q.DEFAULT_LANGUAGE="en",q.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",q.EVENT_CONTEXT_UPDATE="event:context-update",q.EVENT_READY_UPDATE="event:ready-update",q.EVENT_DATA_UPDATE="event:data-update",q.CURRENT_CONTEXT_KEY="CurrentContext";let Bt=q;const rt=new Bt;function Ut(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Lt}})}function h(n,e={}){return rt.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=rt.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw L.ApiNotAvailable()}).then(t=>Ut(t).then(r=>{if(!t.ok)throw r;return r}))}class me{constructor(){}static parseNamesFromListConfig(e){let t=me.parseFieldsToGraphQL(e.reduce((i,s)=>(s.name&&i.push(s.name),i),[]));function r(i){let s="";for(let d in i)typeof i[d]=="boolean"?s+=` ${d} `:s+=` ${d} { ${r(i[d])} }`;return s}return r(t)}static parseSortFromListConfig(e){let t={};for(let r in e)t[r]=e[r]?"ASC":"DESC";return t}static parseFieldsToGraphQL(e){function t(r,i){if(i.includes(".")){const s=i.indexOf("."),d=i.substring(s+1),a=i.substring(0,s);a in r||(r[a]={}),t(r[a],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 it=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 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(".")}const Wt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:me,Journal:it,Request:h,clickOutside:pe,default:{Request:h,clickOutside:pe,getPropFromObject:fe,runPromiseQueue:Ye,GraphQL:me,firstChapterToLowerCase:ot,valuesToUpperCase:Be,prettyMoney:Mt},firstChapterToLowerCase:ot,getPropFromObject:fe,runPromiseQueue:Ye,valuesToUpperCase:Be},Symbol.toStringTag,{value:"Module"}));function st(n,e=""){for(let t in n){if(typeof n[t]=="object"){st(n[t],(e.length?`${e}-`:"")+t);continue}let r="--"+((e.length?`${e}-`:"")+t).replace(/([A-Z])/g,i=>`-${i}`.toLowerCase());document.documentElement.style.setProperty(r,n[t])}}const W={};function Ft(n){for(let e in n)W[e]=n[e];n.styles&&st(n.styles),it.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=W}const qt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Gr="";class jt{static readHistoryById(e,t){return h(`/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 d=s.changes.map(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...s,changes:d}});return{...r,history:i}})}}class Gt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return h(`/open-api/internationalization/language/${e}`)}}let j={};function H(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=v.utils.getPropFromObject((this==null?void 0:this.vocabulary)||j,n);if(typeof t=="string")return at(t,e);const r=v.utils.getPropFromObject(j==null?void 0:j.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}H.setGlobalVocabulary=function(n){j=n},H.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),H.bind({vocabulary:v.utils.getPropFromObject(j,e.toLowerCase())})},H.setVocabulary=function(n){return typeof n=="string"&&(n=v.utils.getPropFromObject(j,n)),H.bind({vocabulary:n})};const xt=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 s(...u){r("warn",u)}function d(...u){r("error",u)}function a(u=!0){n=u}return{info:i,warn:s,history:e,display:a,error:d}}();function zt(){return xt}class b{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw L.AuthServiceError(e.title,t)}static login(e){return h(W.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:W.applicationName})}).catch(b.parseError)}static registration(e){return e.AppName=W.applicationName,h(W.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(b.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw L.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return b.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return b.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return b.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return b.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return h(`${W.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(b.parseError)}static startLoginProcess(e){return b.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return b.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return b.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return h(`${W.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(b.parseError).then(b.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw L.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}function Kt(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Yt="masterId",Jt="masterEntity";function Ee(n,e){if(!Array.isArray(e))return;if(Kt(e))return t(e);e.forEach(t);function t(r){n.append(Jt,r[0]),n.append(Yt,r[1].toString())}}class ne{static async anonymousGetList(e){return await h(`/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 d=(Array.isArray(i)?[i]:Object.entries(i)).map(([a,u="desc"])=>`@${a} ${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 h(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=ne.getSearchParamsForEntityListRead(t||{});return h(`/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 Ee(i,r==null?void 0:r.masterEntities),h(`/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 h(`/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 h(`/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 Ee(s,i==null?void 0:i.masterEntities),h(`/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 ne.removeByKeys(e,i,r)}static removeByKeys(e,t,r){return h(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}const ct=class de{static async create(e){return h(de.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 h(de.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return h(`${de.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return h(`${de.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};ct.url="/close-api/communications";let Ht=ct;class Xt{static async getDefaultView(e){return h("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function lt(n){return{...n,createdEntities:n.createdEntites}}const ut=class Re{static async getStartConfig(e,t){return h([Re.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return h([Re.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(lt)}static async runStep(e,t,r,i,s){return h([Re.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(lt)}};ut.url="/close-api/views/process-wizard";let we=ut;const Qt={class:"widget-table__head"},Zt={class:"widget-table__head-label margin_0 text_overflow"},en=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",Qt,[(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",Zt,o.toDisplayString(r.label),1)]))),128))]))}}),xr="",F=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},tn=F(en,[["__scopeId","data-v-25198f4a"]]);function nn(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function dt(n,e){const t=nn(n);let r=t?v.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function Ue(n){return["eservices-core",n].join(":")}function ft(n){return Ve(n,"YYYY/MM/DD HH:mm:ss")}function Ve(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return It.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const zr="",_e=F({props:{name:String},setup(n,e){let t="unknown";try{t=e.slots.default()[0].children}catch{t=n.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${t}`})}},[["__scopeId","data-v-e287c8d9"]]),rn=Le(Ue("setup-list-row"));function on(n,e){const t=n.config.map(r=>sn(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function sn(n,e,t){const r=e.values;let i=dt(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function d(p){s.onClick.push(()=>p(r))}function a(p){Array.isArray(p)?s.class.push(...p):s.class.push(p)}const u=[],f=[];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=Ve(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(v.FormField,{type:"single-checkbox",modelValue:e.selected})),d(pt.bind(null,t,!0));break}case"select":{f.push(o.h(v.FormField,{type:"single-radio",modelValue:e.selected})),d(pt.bind(null,t,!1));break}}if(n.onClick&&d(n.onClick),n.link)try{const p=n.link(r);if(p){const S=o.h(vt.RouterLink,{to:p});f.push(S),a("widget-table-cell_link")}}catch(p){rn("Can't add router link",p)}return n.href&&(f.push(o.h("a",{href:n.href(r),target:"_blank"})),a("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&f.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&f.push(o.h(_e,{name:n.icon})),n.class&&(typeof n.class=="function"?a(n.class(r)):a(n.class)),u.push(o.h("td",s,f)),u}function pt(n,e){n.emit("select",e)}function ht(n,e){return()=>{try{return on(n,e)}catch(t){return console.warn(t),null}}}const an={props:{values:Object,config:Object,selected:Boolean},setup:ht},cn=["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]=s=>e("close")),onSave:i[1]||(i[1]=s=>e("save",s))}),null,16,["values","new"]))],8,cn)],512))}}),A={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",TIME_TO_LIVE_SOCKET_REQUEST:1e4},ln={class:"widget-table"},yt="update:selectedRows",un=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,u=!0){if(!t.selectedRows)return;if(!u)return e(yt,t.selectedRows.includes(a)?[]:[a]);const f=[...t.selectedRows],p=f.indexOf(a);return p===-1?f.push(a):f.splice(p,1),e(yt,f)}function d(a){e("save",a),e("update:activeRow",null)}return(a,u)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",ln,[o.createVNode(tn,{config:a.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(f,p)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:p},[o.createVNode(an,{config:a.config,values:f,selected:a.selectedRows.includes(f),onSelect:S=>s(f,S),class:o.normalizeClass(a.classCallback?a.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&a.activeRow===f?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":a.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)),a.activeRow===o.unref(A).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(gt,{key:0,component:i.value,"row-length":a.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)])])]))}}),dn=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))}}),Yr="",Te=F(dn,[["__scopeId","data-v-0ef9ae88"]]),fn={class:"widget-button"},pn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",fn,[e.wait?(o.openBlock(),o.createBlock(Te,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),Jr="",hn=F(pn,[["__scopeId","data-v-450dc564"]]),gn={class:"widget-multi-button-wrap position_relative cursor_pointer"},yn={class:"widget-multi-button-body grid"},mn=["onClick"],En={class:"widget-multi-button-side-wrap"},wn=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(d=>({"7025434e":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 s(d=!t.active){t.active=d}return(d,a)=>(o.openBlock(),o.createElementBlock("div",gn,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",yn,[d.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]=u=>s())},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:p=>{i(u.callback),s(!1)}},o.toDisplayString(u.label),9,mn))),128))]),o.createElementVNode("div",En,[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]=u=>s())},[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(_e),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),Hr="",_n=F(wn,[["__scopeId","data-v-a8d711d1"]]),Tn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Sn={class:"text_md"},Cn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",Tn,[o.createVNode(Te,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",Sn,o.toDisplayString(e.label),1)]))}}),bn=["alt","src"],An=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))}}),kn={props:{config:Array,values:Object,selected:Boolean},setup:ht},Xr="",Nn=F(kn,[["__scopeId","data-v-344a8cc1"]]),vn=n=>(o.pushScopeId("data-v-bf495d6a"),n=n(),o.popScopeId(),n),In={class:"widget-list-head-cell"},On=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",In,[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(v.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(_e),{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),On])]))}}),Qr="",Rn=F($n,[["__scopeId","data-v-bf495d6a"]]),Ln=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(y,E){let _=-1;do _++,E-=y[_];while(E>0&&_<y.length);return _}function f(y,E){let _=0;for(;E>0&&E>y[_]&&_<y.length;)E-=y[_],_++;return console.log(E,_),_>0?_:0}function p(y){try{i.value.style.insetInlineStart=y+"px"}catch(E){console.log(E)}}function S(y){try{i.value.style.width=y+"px",i.value.style.minWidth=y+"px",i.value.style.maxWidth=y+"px"}catch(E){console.log(E)}}function g(y){return y===null?!1:y.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(E){var At;function _(I){return I.screenX+m-N}const k=r.value,c=[...k.children].filter(I=>I.localName==="th"),m=((At=k.offsetParent)==null?void 0:At.scrollLeft)||0,w=c.map(I=>I.clientWidth),D=g(E.target),N=k.getBoundingClientRect().left,Z=_(E),C=u(w,Z),J=w.slice(0,C).reduce((I,B)=>I+B,0),ce=Z-J,xe=k.offsetWidth,le=c[C].clientWidth;if(t.config[C].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",E.screenX),console.log("Widths",w),console.log("max width",xe),console.log("Start Position",Z),console.log("Position From",C),console.log("Start Position",C),console.log("Global offset (Отступ самой таблицы от края экрана)",N),console.log("Del",ce),console.groupEnd(),i.value.innerText=c[C].textContent||"",i.value.style.display="grid",i.value.style.width=le+"px",i.value.style.cursor="grabbing",p(J),S(le),document.addEventListener("pointermove",bt,{passive:!0}),document.addEventListener("pointerup",Ct);function Ct(I){if(console.group("END"),document.removeEventListener("pointermove",bt),document.removeEventListener("pointerup",Ct),D&&(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)),!D){const B=I.screenX+m-N;console.log("ENP Position",B);const $e=f(w,B);if(console.log(C,"->",$e),$e!==C){const ue=t.config[C],ze=t.config;ze.splice(C,1),ze.splice($e,0,ue),s(ze)}else{const ue=t.config[C].name;d(ue)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function bt(I){if(D){const ue=_(I)-Z+le;S(ue);return}let B=I.screenX+m-N-ce;B<0&&(B=0),B+le>xe&&(B=xe-le),p(B)}})});function s(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 a([u]);const f=t.order.length===1||t.order[1]==="asc"?"asc":"desc";a([u,f==="asc"?"desc":"asc"])}function a(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,(p,S)=>(o.openBlock(),o.createBlock(Rn,o.mergeProps({key:p},p,{onOrder:g=>d(p.name),onSelect:f[0]||(f[0]=g=>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))}}),Zr="",Pn=F(Ln,[["__scopeId","data-v-ccffc6bd"]]),Dn={class:"widget-list"},Bn={class:"widget-list-body position_relative"},Un=50,Vn=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,u=!0){if(t.selectedRows)if(!u)s(t.selectedRows.includes(a)?[]:[a]);else{const f=[...t.selectedRows],p=f.indexOf(a);p===-1?f.push(a):f==null||f.splice(p,1),s(f)}}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 d(a){if(!a)return;const u=a.target;u.scrollTop+u.clientHeight+Un>u.scrollHeight&&e("scrollEnd")}return(a,u)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:d},[o.createElementVNode("table",Dn,[o.createElementVNode("thead",null,[o.createVNode(Pn,{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:a.config,order:a.order},null,8,["config","order"])]),o.createElementVNode("tbody",Bn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(f,p)=>{var S;return o.openBlock(),o.createBlock(Nn,{key:p,class:"widget-list-row",values:f,config:a.config,selected:(S=a.selectedRows)==null?void 0:S.includes(f),onSelect:g=>r(f,g)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function Mn(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 Se(n){return typeof n=="string"?Me(n):Wn(n)?Me(n.message):Me(A.DEFAULT_ERROR_MESSAGE)}function Wn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function Me(n){return{message:n}}function G(n="error"){return function(e){const{message:t}=Se(e);be.add(n,t)}}function Ce(n,e={}){return U().emit("entity:read",{...e,entity:n})}function We(n,e){return U().emit("entity:update",{...e,entity:n})}function Fn(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 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 qn(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 jn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Gn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return A.DEFAULT_ERROR_MESSAGE}})}function X(n,e={}){return R.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=R.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw new Error(A.DEFAULT_ERROR_MESSAGE)}).then(t=>Gn(t).then(r=>{if(!t.ok)throw r;return r}))}function xn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function zn(n,e){let t=!1;return(...r)=>{if(!t)return t=!0,setTimeout(()=>t=!1,e),n(...r)}}const Kn=Le(Ue("pretty-value-field-by-entity"));function Yn(n,e,t){try{const r=qe.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{return Kn('Error by parse pretty value for entity "%s", field "%s" with value "%s"',n,e,t),""}}function Jn(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const Hn=1,Xn=5e3,x=Le(Ue("use-socket"));function U(){return Zn}function Qn(n){return typeof n=="object"&&Object.prototype.toString.call(n)==="[object Blob]"}const Zn=function(){let n=1,e,t;const r=new Set;let i=0;const s=new Set;function d(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},Xn+1e3);const c=new Uint8Array(1);c[0]=Hn,e.send(c)}setInterval(()=>{Array.from(r).forEach(c=>{k(c)&&(x("Handler for event %s requestId %d was expired",c.event,c.requestId),c.requestId?u({requestId:c.requestId,event:"request-error",data:{message:L.RequestTookToLong().message}}):r.delete(c))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&f()},A.DELAY_SOCKET_RECONNECT);function a(){return{safeQueue:s,requestId:n,handlers:r,socketInstance:e}}function u(c){const m=[...r.values()];x("Handlers array length is %d. Response event: %s. Request id: %d",r.size,c.event,c.requestId),m.forEach(w=>{const D=c.requestId;(w.requestId&&w.requestId===D||!w.requestId&&w.event===c.event)&&(x("Find appropriated handler: %d, event: %s",n,w.event),w.callback(c.data,c),w.once&&(r.delete(w),x("Handler was removed by *once* params was passed. %o",w)))})}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){x("Connection to server was stopped: %d %s",c.code,c.reason),Array.from(r).forEach(m=>{m.guaranteedAnswer&&m.serializeString&&s.add(m.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(c=>{p(c),s.delete(c)})},e.onerror=function(c){console.warn(c)},e.onmessage=c=>{var m;try{if(Qn(c.data)){d();return}const w=JSON.parse(c.data);if(!Et(w)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(w);return}(m=w==null?void 0:w.data)!=null&&m.refresh&&location.reload(),u(w)}catch(w){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(w)}}}function p(c){e.send(c)}function S(c,m){_({event:c,callback:m})}function g(c,m){_({event:c,callback:m,once:!0})}function y(){return e&&(e==null?void 0:e.readyState)===1}function E(c,m,w){const D=++n,N=JSON.stringify({requestId:D,event:c,data:m,contextId:R.contextId,url:window.location.href});return y()?p(N):(s.add(N),x("Socket is not connected. Message was send to save-queue")),new Promise((Z,C)=>{_({event:c,requestId:D,once:!0,guaranteedAnswer:!0,serializeString:N,callback:(J,ce)=>{if(x("Promise was resolve with next data:",J),er(ce))return void C(J);w&&w(J,ce),Z(J)},timeToLive:A.TIME_TO_LIVE_SOCKET_REQUEST})})}function _(c){const m={timeToLive:0,...c,created:new Date().getTime()};r.add(m)}function k(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:g,emit:E,initialization(c){t=c},getDevInfo:a}}(),er=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 tr(n,e){const t=o.reactive([]);let r=0;const i=o.ref(!1);function s(){if(i.value)return Promise.reject("The process has already started.");const g=p();return i.value=!0,typeof g.limit!="number"&&(g.limit=100),g.offset=r,Ce(n,g).then(y=>(r+=y.length,y)).finally(()=>{i.value=!1})}function d(g,y){var _;const E=g.Version||((_=t.find(k=>k.Id===y))==null?void 0:_.Version);if(E===void 0)throw new Error("Object without version.");return E}function a(g,y){const E=t.findIndex(_=>_.Id===g);if(E===-1)throw new Error(`Can't found item with Id ${g}`);t.splice(E,1,y)}async function u(g,y){try{const E=p(),_=d(y,g);delete y.Version,await We(n,{id:g,values:y,version:_});const k=await Ce(n,{fields:E.fields||"",id:g});a(g,k)}catch(E){G()(E)}}async function f(){try{const g=await s();t.push(...g)}catch(g){G()(g)}}function p(){return typeof e=="function"?e():e}async function S(){try{r=0;const g=await s();t.splice(0,t.length,...g)}catch(g){G()(g)}}return{array:t,updateById:u,next:f,reload:S,wait:i}}function nr(){function n(){return{organizations:R.organizations,currentContextId:R.contextId,person:R.person,context:R.context,contextType:R.contextType,userId:R.userId}}const e=o.reactive(n());return R.onupdateContext(()=>{Object.assign(e,n())}),e}function rr(n,e,t){return U().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function ir(n,e,t){return U().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function or(n,e){return U().emit("communication-message:create",{communicationId:n,text:e})}function sr(n){return U().emit("communication-message:read",{communicationId:n})}function ar(n){const e=v.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>sr(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function cr(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw L.EntityWithoutName(n);return Ce(n.name,r)}).then(Fe).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(G())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw L.EntityWithoutName(n);return We(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw G()(i),i})};function t(){return typeof e=="function"?e():e}}function lr(n,e){return U().emit("metadata:read",{...e,entity:n})}class re{constructor(){this.state=o.reactive({})}set(e,t,r){this.state[re.getKey(e,t)]=r}get(e,t={}){return this.state[re.getKey(e,t)]}getByKey(e){return this.state[e]}update(e,t){return lr(e,t).then(this.set.bind(this,e,t))}static getKey(e,t){const r={entity:e,entityId:t.id,masterEntities:ur(t.masterEntities)};return JSON.stringify(r)}}function ur(n){return!n||!Array.isArray(n)?[]:n.length===0?[]:dr(n)?[n]:n}function dr(n){return!!n&&Array.isArray(n)&&typeof n[0]=="string"&&typeof n[1]=="number"}function fr(n,e={}){if(!n)return o.inject(A.PROVIDE_NAME_METADATA);const t=o.ref(null),r=o.computed(()=>t.value?qe.getByKey(t.value):null);o.provide(A.PROVIDE_NAME_METADATA,r);function i(){if(!n)throw new Error("Entity is not provided for metadata.");t.value=re.getKey(n,wt(e||{}))}const s=function(){return i(),qe.update(n,wt(e||{}))};return i(),{state:r,update:s}}function wt(n){return typeof n=="function"?n():n}const be=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=pr(r),s=new hr(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 pr(n){function e(r){return!!r&&typeof r=="object"}const t={timeout:10,click:()=>null,children:[]};return e(n)?{timeout:n.timeout||t.timeout,click:n.click||t.click,children:n.children||t.children}:t}const _t=class Nt{constructor(e,t,r,i,s){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=s,this.id=Nt.cardId++}};_t.cardId=1;let hr=_t;class gr extends P{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return or(this.id,e)}static checkAndGenerate(e,t,r){return ir(e,t,r).then(i=>i.length===0?rr(e,t,r):i[0])}}function yr(){return U().emit("client:read",{})}var Tt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},mr=(n,e,t)=>(Tt(n,e,"read from private field"),t?t.call(n):e.get(n)),Er=(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)},wr=(n,e,t,r)=>(Tt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ae;const ke=class ee extends P{constructor(){super(...arguments),this.type="front",this.organizations=[],Er(this,Ae,!1)}set language(e){localStorage.setItem(A.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(A.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){wr(this,Ae,e),this.emit(ee.EVENT_READY_UPDATE,e)}get ready(){return mr(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(A.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){G()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(A.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 yr()}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 _r=ke;function Tr(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(Tr(r)){let i=function(s){var d;return((d=s.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 ie(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${ie(t)}`},$.beginWith=function(e,t){return`@${e} BeginWith ${ie(t)}`},$.notEq=function(e,t){return`@${e} nq ${ie(t)}`},$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${ie(t)}`},$.in=function(e,t){const r=t.map(ie).join(", ");return`@${e} in (${r})`},$.and=function(...e){return e.join(" and ")},$.is=function(e,t){return`@${e} is ${t}`},$.or=function(...e){return e.join(" or ")};const R=new _r,qe=new re;class Sr{static get url(){return"/close-api/metadata"}static async get(e,t,r){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const i=new URLSearchParams;return t&&i.append("criteria",t),r&&i.append("id",String(r)),await X(this.url+`/${e}?${i.toString()}`,{method:"GET"})}static getById(e,t,r=[]){const i=new URLSearchParams;return Ee(i,r),t&&i.append("id",t),X([this.url,e].join("/")+`?${i.toString()}`)}static getFieldInformation(e,t){return X(`/open-api/metadata/${e}/fields/${t}`)}static getTreatmentListField(e,t){return X(`/open-api/metadata/${e}/list-fields/${t}`)}}class Cr{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 br{static invite(e,t,r){return h("/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 h("/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 h("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class je{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return h(je.url+e,{method:"POST",body:JSON.stringify(t)})}}class Ar{static getConfiguration(){return h("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class kr{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 Ee(i,r),X([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function Nr(n,e="images"){return`/static-folder/${e}/${n}`}class vr{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 h(`/${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]):L.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 h(`/${Q.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return h(`/${Q.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class Ir{static getListSettings(e,t){const r=new URLSearchParams;r.set("entity",e),t&&r.set("mark",t);const i=`/close-api/views/list/configs?${r.toString()}`;return h(i)}}var St=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},V=(n,e,t)=>(St(n,e,"read from private field"),t?t.call(n):e.get(n)),z=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},K=(n,e,t,r)=>(St(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ne,oe,ve,Ie,se,ae,Ge;const Y="_______LIST_______ROW_______INDEX________NAME_______",Oe=class M extends P{constructor(e){super(),this.LIST_ROW_KEY=1,z(this,Ne,void 0),this.array=[],z(this,oe,[]),z(this,ve,[]),z(this,Ie,new Proxy({},{set:(t,r,i,s)=>(t[r]=i,this.emit(M.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(M.EVENT_FILTERS_UPDATE,t),!0)})),z(this,se,!1),z(this,ae,(...t)=>Promise),z(this,Ge,()=>{}),K(this,Ne,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&K(this,oe,e.config)}set config(e){K(this,oe,e.map(v.utils.copyObject)),this.emitUpdateConfig()}get config(){return V(this,oe)}emitUpdateConfig(){this.emit(M.EVENT_CONFIG_UPDATE,this.config)}get order(){return V(this,ve)}set order(e){K(this,ve,e),this.emit(M.EVENT_ORDER_UPDATE,this.order)}get filters(){return V(this,Ie)}set filters(e){$r(V(this,Ie),e)}set wait(e){K(this,se,e),this.emit(v.Form.EVENT_WAIT,V(this,se))}get wait(){return V(this,se)}get primaryKeys(){return V(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(M.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const t=this.indexByKey(e);t!==-1&&(this.array.splice(t,1),this.emit(M.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(M.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[Y]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,Y)}set read(e){K(this,ae,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=V(this,ae).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){K(this,ae,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>V(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=M.getCellName(e),i=(()=>{let s=r?fe(t,r):null;return s===void 0&&(s=null),e.value?e.value(s,t):s})();return{name:r,value:i}}};Ne=new WeakMap,oe=new WeakMap,ve=new WeakMap,Ie=new WeakMap,se=new WeakMap,ae=new WeakMap,Ge=new WeakMap,Oe.EVENT_DATA="list-data: update",Oe.EVENT_CONFIG_UPDATE="list-config:update",Oe.EVENT_ORDER_UPDATE="list-order:update",Oe.EVENT_FILTERS_UPDATE="list-filters:update";function Or(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 $r(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Rr(n){const e=o.reactive([]);function t(a){return e.includes(a)}function r(a){t(a)||e.push(a)}function i(a){const u=e.findIndex(f=>f===a);u!==-1&&e.splice(u,1)}function s(a){const u=o.unref(n);if(a===void 0){e.length===0?u.forEach(r):u.forEach(i);return}t(a)?i(a):r(a)}const d=o.computed(()=>{const a=o.unref(n);return e.length===a.length&&a.length!==0});return[e,s,d,r,i]}function Lr(n){return n.statusName==="Completed"}function Pr(n){return n.statusName==="FinalStepWithConfirmation"}function Dr(n){return n.statusName==="ValidationError"}function Br(n,e,t){let r=null;const i=o.reactive({wait:null});let s=[],d=null;const a=o.ref(null);function u(){a.value=s.find(c=>c.name===d)||null}function f(){var c;return d?((c=s.find(m=>m.name===d))==null?void 0:c.fields)||[]:[]}function p(c){if(u(),Dr(c))return void t.onValidation(c.validationResults);if((c.statusName==="FinalStep"||c.statusName==="NextStep")&&(!f().length||Ur(f(),t.presets)))return k(t.presets||{});Lr(c)&&t.onCompleted(c),Pr(c)&&t.onConfirmation(c)}async function S(){try{await g(),await _()}catch(c){const{message:m}=Se(c);be.add("error",m)}}function g(){return i.wait="Loading process information.",we.getStartConfig(e,n).then(c=>{s=c.steps.map(m=>({label:m.title,name:m.stepName,number:m.number,fields:m.frontendEntity.objectTypes.reduce((w,D)=>(D.properties.forEach(N=>{w.push({name:N.name,label:N.title,type:N.refEntityName||N.dataType})}),w),[])}))}).then(c=>(i.wait=!1,c))}function y(c){return d=c.nextStepName,r=c.token,c}function E(c){const m=Se(c);be.add("error",m.message)}function _(){return i.wait="Starting process",we.startProcess(e,n).then(y).then(p).catch(E).finally(()=>{i.wait=null})}function k(c={}){return!r||!d?Promise.reject("Not step or token."):(i.wait="Expect the result",we.runStep(e,n,d,r,c).then(y).then(p).catch(E).finally(()=>{i.wait=!1}))}return{initialize:S,state:i,currentStepConfig:o.readonly(a),next:k}}function Ur(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!v.utils.getPropFromObject(e,r.name))return!1}return!0}const Vr="close-api/proxy/Equipment/Search";class Mr{static search(e,t,r,i,s){const d=new URLSearchParams;d.append("pattern",e||""),t&&d.append("categoryId",t),r&&d.append("useType",String(r)),i&&d.append("statusCode",i),s&&(d.append("limit",String(s.limit)),d.append("offset",String(s.offset)));const a=`/${Vr}?${d.toString()}`;return h(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Wr={clickOutside:pe,staticLink:Nr},Fr={usage:Rt,utils:Wt,config:Ft,types:qt};l.Communication=gr,l.CoreError=L,l.Filter=$,l.Manager=R,l.NotificationSystem=be,l.WidgetButton=hn,l.WidgetIcon=_e,l.WidgetImage=An,l.WidgetList=Vn,l.WidgetLoader=Cn,l.WidgetMultiButton=_n,l.WidgetSpinner=Te,l.WidgetTable=un,l.actionService=kr,l.asyncProcess=Mn,l.authService=b,l.billingService=Q,l.catchUniversal=G,l.clickOutside=pe,l.clientService=He,l.communicationService=Ht,l.configurationService=Ir,l.constants=A,l.dataService=ne,l.debounce=xn,l.default=Fr,l.documentsService=vr,l.equipmentService=Mr,l.fileService=Cr,l.getCellValue=dt,l.getNamesFromListConfig=Fn,l.groupArrayByField=qn,l.historyService=jt,l.internationalizationService=Gt,l.invitationService=br,l.metadataService=Sr,l.openService=Ar,l.parseError=Se,l.prettyDate=Ve,l.prettyDateWithTime=ft,l.prettyMoney=mt,l.prettyValueFieldByEntity=Yn,l.processWizardService=we,l.request=X,l.ruleValidationService=je,l.t=H,l.throttle=zn,l.universalEntityRead=Ce,l.universalEntityUpdate=We,l.useCommunication=ar,l.useFormEntity=cr,l.useListActiveRow=Jn,l.useListEntity=tr,l.useListSearch=Or,l.useListSelect=Rr,l.useLogger=zt,l.useManagerState=nr,l.useMetadata=fr,l.useSocket=U,l.useWizard=Br,l.utils=Wr,l.uuidv4=jn,l.valuesToUpperCase=Fe,l.viewService=Xt,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
11
11
|
//# sourceMappingURL=eservices-core.umd.js.map
|