eservices-core 1.3.120 → 1.3.121
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.121
|
|
4
4
|
* (c) 2024 ESERVICES
|
|
5
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("jenesius-vue-form"),o=require("vue"),Ue=require("vue-router"),
|
|
5
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("jenesius-vue-form"),o=require("vue"),Ue=require("vue-router"),Ce=require("debug"),st=require("date-and-time"),ue=require("jenesius-vue-modal");let j={};function H(t,...e){if(typeof t!="string")return console.trace(`Label is not provided for translation: ${t}`),"undefined";let n=P.utils.getPropFromObject((this==null?void 0:this.vocabulary)||j,t);if(typeof n=="string")return Oe(n,e);const r=P.utils.getPropFromObject(j==null?void 0:j.root,t);return typeof r=="string"?Oe(r,e):(typeof n===void 0&&console.warn(`Translation for label "${t}" is not founded.`),t)}function Oe(t,e){return e.forEach((n,r)=>{t=t.replaceAll(new RegExp(`\\{${r}}`,"g"),n)}),t}H.setGlobalVocabulary=function(t){j=t};H.getScope=function(t){const e=typeof t=="string"?t:"root";return typeof t!="string"&&console.warn(`SCOPE ${t} for translate is not string.`),H.bind({vocabulary:P.utils.getPropFromObject(j,e.toLowerCase())})};H.setVocabulary=function(t){return typeof t=="string"&&(t=P.utils.getPropFromObject(j,t)),H.bind({vocabulary:t})};const je=class m extends Error{constructor(e,n=null){super(),this.message=e,this.details=n,this.id=m.ID++}static ParentFormNotFound(){return new m("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new m("Composite object name is undefined",e)}static EntityWithoutName(e){return new m("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new m(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new m("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new m("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new m(`${e} (id) is not a number`)}static UndefinedErrorId(e,n){return m.ApiNotAvailable()}static ApiError(e){return new m("Request error",e)}static ApiNotAvailable(){return new m(`Sorry, we experience difficulties here.
|
|
6
6
|
Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,n){return!e&&!n?m.ApiNotAvailable():new m(e||"Authorization Error",n)}static ApiResponseParseFailed(){return m.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new m("Object doesn't have id",e)}static ObjectWithIdNotFound(e,n){return new m(`Can't find object with id: ${e}`,n)}static ObjectWithoutConnectToPresentArray(e,n){return new m("Object is not found.",{object:e,array:n})}static EntityWithoutId(e){return new m("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,n){return new m(`Can't find the element with tableIndex ${e}`,n)}static UndefinedError(e,n=[]){return new m(e,n)}static TableArrayAlreadyIncludeProvidedIndexValue(e,n,r){return new m(`Array already includes the element with value ${e}`,{array:n,table:r})}static MetadataEntityIsNotAvailable(e){return new m(`Metadata for the ${e} is not currently available.`)}static RequestTookToLong(){return new m("The request took too long to complete. Try again later.")}};je.ID=0;let W=je;const at="Please try again later or submit a feedback if problem doesn't go.",ct=new class{constructor(){this.store=o.reactive([])}add(e,n,{children:r,timeout:i=10,click:a=()=>{}}={}){const u=new lt(e,n,i,r||[],a);return this.store.push(u),i&&setTimeout(this.remove.bind(this,u.id),i*1e3),u}remove(e){const n=this.store.findIndex(r=>r.id===e);if(n===-1)return!1;this.store.splice(n,1)}removeChild(e,n){throw new Error("Removing children error.")}},We=class qe{constructor(e,n,r,i,a){this.type=e,this.msg=n,this.timeout=r,this.children=i,this.click=a,this.id=qe.cardId++}};We.cardId=1;let lt=We;/*!
|
|
7
7
|
* jenesius-event-emitter v1.0.2
|
|
8
8
|
* (c) 2022 Jenesius
|
|
9
9
|
* @license MIT
|
|
10
|
-
*/const Le=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},$e=function(t,e){t in this.events&&this.events[t].forEach(n=>n(e))},Pe=function(t,e){const n=this.events[t];if(!n)return;const r=n.indexOf(e);r!==-1&&n.splice(r,1)},De=function(){this.events={}};class V{constructor(){this.events={}}on(e,n){return Le.call(this,e,n)}emit(e,n){return $e.call(this,e,n)}off(e,n){return Pe.call(this,e,n)}cleanEvents(){De.call(this)}static on(e,n){return Le.call(V,e,n)}static emit(e,n){return $e.call(V,e,n)}static off(e,n){return Pe.call(V,e,n)}static cleanEvents(){De.call(V)}}V.events={};var ze=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},re=(t,e,n)=>(ze(t,e,"read from private field"),n?n.call(t):e.get(t)),Ee=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},ve=(t,e,n,r)=>(ze(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Z,ie,se;const q=class I extends V{constructor(){super(...arguments),Ee(this,Z,void 0),Ee(this,ie,"front"),this.organizations=[],Ee(this,se,!1)}set language(e){localStorage.setItem(I.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(I.LOCALSTORAGE_LANGUAGE_KEY)||I.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(I.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){ve(this,Z,e)}get router(){if(!re(this,Z))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return re(this,Z)}set type(e){ve(this,ie,e)}get type(){return re(this,ie)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){ve(this,se,e),this.emit(I.EVENT_READY_UPDATE,e)}get ready(){return re(this,se)}onReady(e){return this.on(I.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(I.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(I.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(I.CURRENT_CONTEXT_KEY,String(e)),this.emit(I.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(n=>n.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 n=Number.parseInt(localStorage.getItem(I.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(n)&&this.validateContextId(Number(n))?this.setCurrentContext(n):this.setCurrentContext(Number(e.id))}catch{ct.add("error",W.ApiNotAvailable().message)}}loadCustomerData(){return Ge.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var n;return((n=this.person)==null?void 0:n.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 n=localStorage.getItem(this.getListKeyById(e));return n&&JSON.parse(n)}setListInformationToLocalStorage(e,n){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(n))}};Z=new WeakMap;ie=new WeakMap;se=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 ut=q;const xe=new ut;function dt(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return at}})}function O(t,e={}){return xe.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=xe.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw W.ApiNotAvailable()}).then(n=>dt(n).then(r=>{if(!n.ok)throw r;return r}))}class ft{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,n,r)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[n]=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")}}new ft;class Ge{static getClientData(){return O("/close-api/client-content")}static getNavigation(){return O("/close-api/client/navigation")}}class pt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return O(`/open-api/internationalization/language/${e}`)}}function Be(t){return{...t,createdEntities:t.createdEntites}}const Ye=class ae{static async getStartConfig(e,n){return O([ae.url,e,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,n){return O([ae.url,e,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(Be)}static async runStep(e,n,r,i,a){return O([ae.url,e,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:a})}).then(Be)}};Ye.url="/close-api/views/process-wizard";let ce=Ye;class ht{static async upload(e,n){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${n}`;return await fetch(i,{method:"POST",body:r}).then(a=>a.json()).then(a=>(a.filename=e.name,a))}}class gt{static invite(e,n,r){return O("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:n,relatedRoleCode:r})})}static accept(e,n){return O("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!0})})}static decline(e,n){return O("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!1})})}}class mt{static getRequiredDocuments(e,n,r){const i=new URLSearchParams({entity:e,primaryKey:n,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(a=>a.json())}}class Y{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Y.url()}/calculator/${e}`)}static calculate(e,n){return O(`/${Y.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:n})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):W.ApiNotAvailable()})}static parseMetadataField(e){function n(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:n(e)}}static createOnlinePayment(e,n){return O(`/${Y.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:n})})}static applyOnlinePayment(e){return O(`/${Y.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}function yt(t){return t.statusName==="Completed"}function Et(t){return t.statusName==="FinalStepWithConfirmation"}function vt(t){return t.statusName==="ValidationError"}function wt(t,e,n){let r=null;const i=o.reactive({wait:null});let a=[],u=null;const l=o.ref(null);function c(){l.value=a.find(s=>s.name===u)||null}function d(){var s;return u?((s=a.find(p=>p.name===u))==null?void 0:s.fields)||[]:[]}function f(s){if(c(),vt(s))return void n.onValidation(s.validationResults);if((s.statusName==="FinalStep"||s.statusName==="NextStep")&&(!d().length||_t(d(),n.presets)))return k(n.presets||{});yt(s)&&n.onCompleted(s),Et(s)&&n.onConfirmation(s)}async function w(){try{await b(),await g()}catch(s){const{message:p}=de(s);ee.add("error",p)}}function b(){return i.wait="Loading process information.",ce.getStartConfig(e,t).then(s=>{a=s.steps.map(p=>({label:p.title,name:p.stepName,number:p.number,fields:p.frontendEntity.objectTypes.reduce((h,_)=>(_.properties.forEach(T=>{h.push({name:T.name,label:T.title,type:T.refEntityName||T.dataType})}),h),[])}))}).then(s=>(i.wait=!1,s))}function y(s){return u=s.nextStepName,r=s.token,s}function E(s){const p=de(s);ee.add("error",p.message)}function g(){return i.wait="Starting process",ce.startProcess(e,t).then(y).then(f).catch(E).finally(()=>{i.wait=null})}function k(s={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Waiting for result...",ce.runStep(e,t,u,r,s).then(y).then(f).catch(E).finally(()=>{i.wait=!1}))}return{initialize:w,state:i,currentStepConfig:o.readonly(l),next:k}}function _t(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(!P.utils.getPropFromObject(e,r.name))return!1}return!0}const Ct={class:"widget-table__head"},Tt={class:"widget-table__head-label margin_0 text_overflow"},At=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("tr",Ct,[(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",Tt,o.toDisplayString(r.label),1)]))),128))]))}});const F=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},St=F(At,[["__scopeId","data-v-25198f4a"]]);function He(t){return typeof t.name=="string"?t.name:Array.isArray(t.name)?t.name[0]:null}function bt(t){const e=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let r;for(;(r=e.exec(t))!==null;)n.push(r[1]);return n}function kt(t,e){return bt(t).forEach(r=>{t=t.replace(new RegExp("\\$\\{"+r+"}","g"),P.utils.getPropFromObject(e,r))}),t}function Ce(t,e){if(typeof t.value=="string")return kt(t.value,e);const n=He(t);let r=n?P.utils.getPropFromObject(e,n):null;return r===void 0&&(r=null),t.value?t.value(r,e):t.value===null?null:r}const v={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",TIME_TO_LIVE_SOCKET_REQUEST:3e4,CORE_DEBUG_LABEL:"eservices-core"};function Te(t){return[v.CORE_DEBUG_LABEL,t].join(":")}function Ke(t){return Ae(t,"YYYY/MM/DD HH:mm:ss")}function Ae(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return st.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const Nt={props:{name:String},setup(t,e){let n="unknown";try{n=e.slots.default()[0].children}catch{n=t.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${n}`})}},Q=F(Nt,[["__scopeId","data-v-e287c8d9"]]);function we(t){return e=>typeof e=="string"||typeof e=="number"?`${e} ${t}`:""}const It=_e(Te("setup-list-row"));function Rt(t,e){const n=t.config.map(r=>Ot(r,t,e));return o.h("tr",{class:"widget-table__row widget-table-row"},n)}function Ot(t,e,n){const r=e.values;let i=Ce(t,r);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(f){a.onClick.push(()=>f(r))}function l(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const c=[],d=[];if(t.unitValue&&(i=we(t.unitValue)(i)),t.unit&&(i=we(t.unit)(i)),t.hide&&t.hide(r))return[o.h("td")];if(t.type)switch(l(`widget-table-cell_${t.type}`),t.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Ae(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Ke(typeof i=="string"?i:null);break}case"money":{i=Xe(i);break}case"multi-select":{d.push(o.h(P.FormField,{type:"single-checkbox",modelValue:e.selected})),u(Ve.bind(null,n,!0));break}case"select":{d.push(o.h(P.FormField,{type:"single-radio",modelValue:e.selected})),u(Ve.bind(null,n,!1));break}}if(t.onClick&&u(t.onClick),t.link)try{const f=t.link(r);if(f){const w=o.h(Ue.RouterLink,{to:f});d.push(w),l("widget-table-cell_link")}}catch(f){It("Can't add router link",f)}if(t.href&&(d.push(o.h("a",{href:t.href(r),target:"_blank"})),l("widget-table-cell_link")),t.formatter&&(i=be(t.formatter).exec(i,r)),typeof i=="boolean"&&(i=i?"✓":"—"),(typeof i=="string"||typeof i=="number")&&d.push(o.h("p",{class:"widget-list-cell-text"},i)),t.icon&&(typeof t.icon=="string"&&d.push(o.h(Q,{name:t.icon})),typeof t.icon=="function")){const f=t.icon(r);f!==null&&d.push(o.h(Q,{name:f}))}return t.class&&(typeof t.class=="function"?l(t.class(r)):l(t.class)),c.push(o.h("td",a,d)),c}function Ve(t,e){t.emit("select",e)}function Je(t,e){return()=>{try{return Rt(t,e)}catch(n){return console.warn(n),null}}}const Lt={props:{values:Object,config:Object,selected:Boolean},setup:Je},$t=["colspan"],Fe=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(t,{emit:e}){const n=o.ref();return o.onMounted(()=>{setTimeout(()=>{n.value&&n.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:n},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=a=>e("close")),onSave:i[1]||(i[1]=a=>e("save",a))}),null,16,["values","new"]))],8,$t)],512))}}),Pt={class:"widget-table"},Me="update:selectedRows",Dt=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1}},emits:["update:activeRow","save"],setup(t,{emit:e}){const n=t,r=o.useSlots(),i=o.computed(()=>{var c;return(c=r==null?void 0:r.default)==null?void 0:c.call(r)[0]});function a(c,d=!0){if(!n.selectedRows)return;if(!d)return e(Me,n.selectedRows.includes(c)?[]:[c]);const f=[...n.selectedRows],w=f.indexOf(c);return w===-1?f.push(c):f.splice(w,1),e(Me,f)}function u(c){e("save",c),e("update:activeRow",null)}const l=o.computed(()=>n.shortcut?n.config.filter(c=>c.name?!!n.array.find(f=>![null,""].includes(Ce(c,f))):!0):n.config);return(c,d)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",Pt,[o.createVNode(St,{config:l.value},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.array,(f,w)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:w},[o.createVNode(Lt,{config:l.value,values:f,selected:c.selectedRows.includes(f),onSelect:b=>a(f,b),class:o.normalizeClass(c.classCallback?c.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&c.activeRow===f?(o.openBlock(),o.createBlock(Fe,{key:0,component:i.value,"row-length":c.config.length,values:f,onClose:d[0]||(d[0]=b=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),c.activeRow===o.unref(v).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(Fe,{key:0,component:i.value,"row-length":l.value.length,onClose:d[1]||(d[1]=f=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),xt=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}});const he=F(xt,[["__scopeId","data-v-0ef9ae88"]]),Bt={class:"widget-button"},Vt=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("button",Bt,[e.wait?(o.openBlock(),o.createBlock(he,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const Ft=F(Vt,[["__scopeId","data-v-450dc564"]]),Mt={class:"widget-multi-button-wrap position_relative cursor_pointer"},Ut={class:"widget-multi-button-body grid"},jt=["onClick"],Wt={class:"widget-multi-button-side-wrap"},qt=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(t){const e=t;o.useCssVars(u=>({"7025434e":r.value}));const n=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(u){if(!(typeof u!="function"||n.wait))return n.wait=!0,Promise.resolve().then(u).finally(()=>{n.wait=!1})}function a(u=!n.active){n.active=u}return(u,l)=>(o.openBlock(),o.createElementBlock("div",Mt,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[o.createElementVNode("div",Ut,[u.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:l[0]||(l[0]=c=>a())},o.toDisplayString(u.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(c,d)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:d,onClick:f=>{i(c.callback),a(!1)}},o.toDisplayString(c.label),9,jt))),128))]),o.createElementVNode("div",Wt,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:l[1]||(l[1]=c=>a())},[n.wait?(o.openBlock(),o.createBlock(o.unref(he),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(Q),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}});const zt=F(qt,[["__scopeId","data-v-a8d711d1"]]),Gt={class:"widget-loader flex flex-align_center gap_10 padding_15"},Yt={class:"text_md"},Ht=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",Gt,[o.createVNode(he,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",Yt,o.toDisplayString(e.label),1)]))}}),Kt=["alt","src"],Jt=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,n=o.ref();return o.onMounted(()=>{n.value&&(n.value.src=e.src),n.value.onerror=function(){e.default&&(n.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:n,src:r.src||r.$props.default},null,8,Kt))}}),Xt={props:{config:Array,values:Object,selected:Boolean},setup:Je};const Zt=F(Xt,[["__scopeId","data-v-344a8cc1"]]),Qt=t=>(o.pushScopeId("data-v-bf495d6a"),t=t(),o.popScopeId(),t),en={class:"widget-list-head-cell"},tn=Qt(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),nn=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(t,{emit:e}){const n=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",en,[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(P.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(a=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=a=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(Q),{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),tn])]))}});const rn=F(nn,[["__scopeId","data-v-bf495d6a"]]),on=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const n=t,r=o.ref(),i=o.ref();o.onMounted(()=>{function c(y,E){let g=-1;do g++,E-=y[g];while(E>0&&g<y.length);return g}function d(y,E){let g=0;for(;E>0&&E>y[g]&&g<y.length;)E-=y[g],g++;return console.log(E,g),g>0?g:0}function f(y){try{i.value.style.insetInlineStart=y+"px"}catch(E){console.log(E)}}function w(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 b(y){return y===null?!1:y.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(E){var Re;function g(N){return N.screenX+p-T}const k=r.value,s=[...k.children].filter(N=>N.localName==="th"),p=((Re=k.offsetParent)==null?void 0:Re.scrollLeft)||0,h=s.map(N=>N.clientWidth),_=b(E.target),T=k.getBoundingClientRect().left,z=g(E),A=c(h,z),M=h.slice(0,A).reduce((N,D)=>N+D,0),K=z-M,me=k.offsetWidth,J=s[A].clientWidth;if(n.config[A].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",E.screenX),console.log("Widths",h),console.log("max width",me),console.log("Start Position",z),console.log("Position From",A),console.log("Start Position",A),console.log("Global offset (Отступ самой таблицы от края экрана)",T),console.log("Del",K),console.groupEnd(),i.value.innerText=s[A].textContent||"",i.value.style.display="grid",i.value.style.width=J+"px",i.value.style.cursor="grabbing",f(M),w(J),document.addEventListener("pointermove",Ie,{passive:!0}),document.addEventListener("pointerup",Ne);function Ne(N){if(console.group("END"),document.removeEventListener("pointermove",Ie),document.removeEventListener("pointerup",Ne),_&&(n.config[A].width=i.value.style.width,n.config[A].minWidth=i.value.style.width,n.config[A].maxWidth=i.value.style.width,a(n.config)),!_){const D=N.screenX+p-T;console.log("ENP Position",D);const ne=d(h,D);if(console.log(A,"->",ne),ne!==A){const X=n.config[A],ye=n.config;ye.splice(A,1),ye.splice(ne,0,X),a(ye)}else{const X=n.config[A].name;u(X)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Ie(N){if(_){const X=g(N)-z+J;w(X);return}let D=N.screenX+p-T-K;D<0&&(D=0),D+J>me&&(D=me-J),f(D)}})});function a(c){e("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(n.order.length===0||n.order[0]!==c)return void l([c]);const d=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([c,d==="asc"?"desc":"asc"])}function l(c){e("update:order",c)}return(c,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(c.config,(f,w)=>(o.openBlock(),o.createBlock(rn,o.mergeProps({key:f},f,{onOrder:b=>u(f.name),onSelect:d[0]||(d[0]=b=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}});const sn=F(on,[["__scopeId","data-v-ccffc6bd"]]),an={class:"widget-list"},cn={class:"widget-list-body position_relative"},ln=50,un=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(t,{emit:e}){const n=t;function r(l,c=!0){if(n.selectedRows)if(!c)a(n.selectedRows.includes(l)?[]:[l]);else{const d=[...n.selectedRows],f=d.indexOf(l);f===-1?d.push(l):d==null||d.splice(f,1),a(d)}}function i(){var l;if(((l=n.selectedRows)==null?void 0:l.length)!==n.array.length)return a([...n.array]);a([])}function a(l){e("update:selectedRows",l)}function u(l){if(!l)return;const c=l.target;c.scrollTop+c.clientHeight+ln>c.scrollHeight&&e("scrollEnd")}return(l,c)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[o.createElementVNode("table",an,[o.createElementVNode("thead",null,[o.createVNode(sn,{onSelect:c[0]||(c[0]=d=>i()),"onUpdate:order":c[1]||(c[1]=d=>e("update:order",d)),"onUpdate:config":c[2]||(c[2]=d=>e("update:config",d)),config:l.config,order:l.order},null,8,["config","order"])]),o.createElementVNode("tbody",cn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.array,(d,f)=>{var w;return o.openBlock(),o.createBlock(Zt,{key:f,class:"widget-list-row",values:d,config:l.config,selected:(w=l.selectedRows)==null?void 0:w.includes(d),onSelect:b=>r(d,b)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),x={};function dn(t){for(let e in t)x[e]=t[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function fn(t){function e(...r){return n.wait?Promise.reject("The process has already started."):(n.wait=!0,Promise.resolve().then(()=>t(...r)).finally(()=>{n.wait=!1}))}const n=o.reactive({wait:!1,call:e});return n}function de(t){return typeof t=="string"?oe(t):pn(t)?oe(t.message,t.children||t.details||[]):hn(t)?oe(t.title,[t.detail||""]):oe(v.DEFAULT_ERROR_MESSAGE)}function pn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"message"))}function hn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"title"))}function oe(t,e=[]){return{message:t,children:e}}function $(t="error"){return function(e){const{message:n,children:r}=de(e);ee.add(t,n,{children:r})}}function fe(t,e={}){return C().emit("entity:read",{...e,entity:t})}function Se(t,e){return C().emit("entity:update",{...e,entity:t})}function gn(t){return t.reduce((e,n)=>(n.name&&(typeof n.name=="string"?e.push(n.name):e.push(...n.name)),e),[])}function Xe(t,e=2){if(!(typeof t=="string"||typeof t=="number"))return"";let r=String(t).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 mn(t,e){const n=new Map;return t.forEach(r=>{var a;const i=e(r);n.has(i)||n.set(i,[]),(a=n.get(i))==null||a.push(r)}),n}function yn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function En(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return v.DEFAULT_ERROR_MESSAGE}})}function R(t,e={}){return L.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=L.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw new Error(v.DEFAULT_ERROR_MESSAGE)}).then(n=>En(n).then(r=>{if(!n.ok)throw r;return r}))}function vn(t,e=1e3){let n=0;return(...r)=>{clearTimeout(n),n=setTimeout(()=>t(...r),e)}}function wn(t,e){let n=!1;return(...r)=>{if(!n)return n=!0,setTimeout(()=>n=!1,e),t(...r)}}const _n=_e(Te("pretty-value-field-by-entity"));function Cn(t,e,n){try{const r=pe.get(t);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${t} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(r){return _n('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,t,e,n),n}}const Tn=1,An=5e3,Sn="static-folder",Ze="request-error",U=_e(Te("use-socket"));function C(){return kn}function bn(t){return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Blob]"}const kn=function(){let t=1,e,n;const r=new Set;let i=0;const a=new Set;function u(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},An*2);const s=new Uint8Array(1);s[0]=Tn,e.send(s)}setInterval(()=>{Array.from(r).forEach(s=>{k(s)&&(U("Handler for event %s requestId %d was expired",s.event,s.requestId),s.requestId?c({requestId:s.requestId,event:Ze,data:{message:W.RequestTookToLong().message}}):r.delete(s))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&d()},v.DELAY_SOCKET_RECONNECT);function l(){return{safeQueue:a,requestId:t,handlers:r,socketInstance:e}}function c(s){const p=[...r.values()];U("Handlers array length is %d. Response event: %s. Request id: %d",r.size,s.event,s.requestId),p.forEach(h=>{const _=s.requestId;(h.requestId&&h.requestId===_||!h.requestId&&h.event===s.event)&&(U("Find appropriated handler: %d, event: %s",t,h.event),h.callback(s.data,s),h.once&&(r.delete(h),U("Handler was removed by *once* params was passed. %o",h)))})}function d(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),e=new WebSocket(n),e.onclose=function(s){U("Connection to server was stopped: %d %s",s.code,s.reason),Array.from(r).forEach(p=>{p.guaranteedAnswer&&p.serializeString&&a.add(p.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(s=>{f(s),a.delete(s)})},e.onerror=function(s){console.warn(s)},e.onmessage=s=>{var p;try{if(bn(s.data)){u();return}const h=JSON.parse(s.data);if(!Qe(h)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(h);return}(p=h==null?void 0:h.data)!=null&&p.refresh&&location.reload(),c(h)}catch(h){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(h)}}}function f(s){e.send(s)}function w(s,p){g({event:s,callback:p})}function b(s,p){g({event:s,callback:p,once:!0})}function y(){return e&&(e==null?void 0:e.readyState)===1}function E(s,p,h){const _=++t,T=JSON.stringify({requestId:_,event:s,data:p,contextId:L.contextId,url:window.location.href});return y()?f(T):(a.add(T),U("Socket is not connected. Message was send to save-queue")),new Promise((z,A)=>{g({event:s,requestId:_,once:!0,guaranteedAnswer:!0,serializeString:T,callback:(M,K)=>{if(U("Promise was resolve with next data:",M),Nn(K))return void A(M);h&&h(M,K),z(M)},timeToLive:v.TIME_TO_LIVE_SOCKET_REQUEST})})}function g(s){const p={timeToLive:0,...s,created:new Date().getTime()};r.add(p)}function k(s){return s.timeToLive===0||typeof s.timeToLive!="number"?!1:new Date().getTime()-s.created>s.timeToLive}return{get socket(){return e},on:w,once:b,emit:E,initialization(s){n=s},getDevInfo:l}}(),Nn=t=>!!Qe(t)&&t.event===Ze,Qe=t=>typeof t=="object"&&t!==null&&"event"in t&&typeof t.event=="string"&&"requestId"in t&&typeof t.requestId=="number"&&"data"in t;function In(t,e){return C().emit("list-setting:read",{entity:t,mark:e})}function Rn(t,e){return C().emit("metadata-field:treat",{entity:t,fieldName:e})}function et(t,e){return C().emit("entity:create",{...e,entity:t})}function tt(t,e){return C().emit("entity:delete",{...e,entity:t})}function On(t,e){return C().emit("usage-context:read",{...e,entity:t})}function nt(t={}){return C().emit("tool:read",t)}function Ln(t,e={},n={}){const r=o.inject(v.PROVIDE_NAME_ACTIONS,null),i=typeof t=="string"?t:e,a=typeof e=="string"?n:e;return o.computed(()=>{var c;const l=((typeof t=="string"?(c=r==null?void 0:r.actions)==null?void 0:c.value:o.unref(t))||[]).find(d=>d.name===i);return l?{...l,...a}:null})}function $n(t){return C().emit("history:read",t)}function Pn(t,e){return C().emit("entity:count",{...e,entity:t})}function Dn(t){return`/${Sn}/${t}`}function be(t){return{exec(e,n){switch(t.name){case"replace-boolean":return be.replaceBoolean(t,e,n||{})}}}}be.replaceBoolean=(t,e,n)=>xn(e,t.values);function xn(t,e){return t?e[1]:e[0]}function Bn(){const t=o.ref(null);function e(n){t.value=n}return{activeRow:t,activateRow:e}}function Vn(t,e,n={}){const r=o.reactive([]);let i=0;const a=o.ref(!1);function u(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function l(){if(a.value)return Promise.reject("The process has already started.");const s=g();return a.value=!0,typeof s.limit!="number"&&(s.limit=100),s.offset=i,(n.request||fe)(t,s).then(h=>(i+=h.length,h)).finally(()=>{a.value=!1})}function c(s,p){var _;return typeof s.Version=="number"?s.Version:(_=r.find(T=>T.Id===p))==null?void 0:_.Version}function d(s,p){const h=r.findIndex(_=>_.Id===s);if(h===-1)throw new Error(`Can't found item with Id ${s}`);r.splice(h,1,p)}function f(s){const p=r.findIndex(h=>h.Id===s);if(p===-1)throw new Error(`Can't found item with Id ${s}`);r.splice(p,1)}async function w(s,p){try{const h=g(),_=c(p,s);delete p.Version,await Se(t,{id:s,values:p,version:_,masterEntities:u()});const T=await fe(t,{fields:h.fields||"",id:s});d(s,T)}catch(h){$()(h)}}async function b(s,p={}){try{const h=g(),_=c(p,s);delete p.Version,await tt(t,{id:s,version:_,masterEntities:u()}),f(s)}catch(h){$()(h)}}async function y(s){try{await et(t,{values:s,masterEntities:u()}),await k()}catch(p){$()(p)}}async function E(){try{const s=await l();r.push(...s)}catch(s){$()(s)}}function g(){return typeof e=="function"?e():e}async function k(){try{i=0;const s=await l();r.splice(0,r.length,...s)}catch(s){$()(s)}}return{array:r,updateById:w,next:E,reload:k,wait:a,create:y,deleteById:b}}function Fn(){function t(){return{organizations:L.organizations,currentContextId:L.contextId,person:L.person,context:L.context,contextType:L.contextType,userId:L.userId}}const e=o.reactive(t());return L.onupdateContext(()=>{Object.assign(e,t())}),e}function Mn(t,e,n){return C().emit("communication:create",{entityName:t,entityCatalogId:e,targetCode:n})}function Un(t,e,n){return C().emit("communication:read",{entityName:t,entityCatalogId:e,targetCode:n})}function jn(t,e){return C().emit("communication-message:create",{communicationId:t,text:e})}function Wn(t){return C().emit("communication-message:read",{communicationId:t})}function qn(t){const e=P.Form.getParentForm(),n=o.reactive([]);return e&&e.subscribe(t),t.read=()=>Wn(t.id).then(r=>(n.splice(0,n.length,...r),r)),{array:n}}function zn(t,e){t.read=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw W.EntityWithoutName(t);return fe(t.name,r)}).then(ke).then(i=>(i.hasOwnProperty("Version")&&(t.version=i.Version),t.setValues(i),i)).catch($())},t.save=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw W.EntityWithoutName(t);return Se(t.name,{id:r.id,values:t.changes,version:t.version})}).then(i=>{t.version=i.version}).catch(i=>{throw $()(i),i})};function n(){return typeof e=="function"?e():e}}function Gn(t){if(!t)return o.inject(v.PROVIDE_NAME_METADATA);pe.initEntity(t);const e=o.computed(()=>pe.state[t]);return o.provide(v.PROVIDE_NAME_METADATA,e),e}function Yn(t,e={}){if(!t)return o.inject(v.PROVIDE_NAME_USAGE_CONTEXT);const n=o.ref(null);return o.provide(v.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await On(t,Hn(e||{}))}}}function Hn(t){return typeof t=="function"?t():t}function Kn(t={}){return C().emit("tool:execute",t)}function Jn(t){if(!t)return o.inject(v.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),n=o.computed(()=>e.map(a=>Xn(t,a))),r={actions:n,update:i};o.provide(v.PROVIDE_NAME_ACTIONS,r),t.router=Ue.useRouter(),t.handleConfirmation||(t.handleConfirmation=Qn),t.handleAffectedEntity||(t.handleAffectedEntity=tr),t.handleCloseForm||(t.handleCloseForm=nr),t.handleValidationResult||(t.handleValidationResult=er);function i(a={}){return e.splice(0,e.length),nt(a).then(u=>e.splice(0,0,...u)).catch($("error"))}return{actions:n,update:i}}function Xn(t,e){return{...e,label:e.title,callback(){var i;const n=typeof t.values=="function"?t.values(e,t):t.values,r=()=>Kn({name:e.name,values:n}).then(async a=>{var u,l;if(!rr(a))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(t.handlers))for await(const c of t.handlers)await c(e,a,t);if(!a.success)throw t.handleValidationResult&&a.validationEffect&&((l=(u=a.validationEffect)==null?void 0:u.results)!=null&&l.length)&&t.handleValidationResult(e,a.validationEffect,t),new Error(a.message);return a.message&&ee.add("info",a.message),Array.isArray(a.affectedEntities)&&t.handleAffectedEntity&&a.affectedEntities.forEach(c=>{var d;return(d=t.handleAffectedEntity)==null?void 0:d.call(t,e,c,t)}),e.closeHostForm&&t.handleCloseForm&&t.handleCloseForm(e,t),a}).catch($("error"));return(i=t.overrides)!=null&&i[e.name]?t.overrides[e.name](e,t):e.requireSave&&t.form&&t.form.changed?t.form.save().then(r):!e.confirmation||!t.handleConfirmation?r():t.handleConfirmation(e,r)}}}function Zn(t){const e="Are you sure?";return t===!0||typeof t=="string"&&t.toLowerCase()==="true"||t==="1"?e:typeof t=="string"?t:e}async function Qn(t,e){const n=Zn(t.confirmation);if(!ue.getComponentFromStore(v.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await ue.promptModal(v.MODAL_CONFIRM,{message:n}))return e()}function er(t,e){const n=v.MODAL_VALIDATION_EFFECT;if(!ue.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{ue.pushModal(n,e)})}function tr(t,e,n){var u;const{router:r,form:i}=n,a=(u=e.primaryKey)==null?void 0:u.Id;if(r&&e&&e.name===t.redirectEntity)return r.push({name:e.name,params:{id:a}});i&&e.name===i.name&&e.updated&&a===i.id&&i.read()}function nr(t,e){const{router:n}=e;n&&t.closeHostForm&&n.back()}function rr(t){return!!(t&&typeof t=="object"&&"affectedEntities"in t&&"success"in t)}function or(t){function e(n){n.key==="Enter"&&t()}o.onMounted(()=>{document.addEventListener("keypress",e)}),o.onUnmounted(()=>{document.removeEventListener("keypress",e)})}function ir(t,e={}){const n=o.reactive([]),r=c=>{const d=o.unref(t);if(c===void 0){n.length===0?d.forEach(a):d.forEach(u);return}i(c)?u(c):a(c)},i=c=>n.includes(c),a=c=>{e.handleSelect&&!e.handleSelect(c)||i(c)||n.push(c)},u=c=>{const d=n.findIndex(f=>f===c);d!==-1&&n.splice(d,1)},l=o.computed(()=>{const c=o.unref(t);return n.length===c.length&&c.length!==0});return[n,r,l,a,u]}function sr(t){const e=o.ref(""),n=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(t).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:n}}const ee=new class{constructor(){this.store=o.reactive([])}add(e,n,r={}){const i=ar(r),a=new cr(e,n,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(e){const n=this.store.findIndex(r=>r.id===e);if(n===-1)return!1;this.store.splice(n,1)}};function ar(t){function e(r){return!!r&&typeof r=="object"}const n={timeout:10,click:()=>null,children:[]};return e(t)?{timeout:t.timeout||n.timeout,click:t.click||n.click,children:t.children||n.children}:n}const rt=class ot{constructor(e,n,r,i,a){this.type=e,this.message=n,this.timeout=r,this.children=i,this.click=a,this.id=ot.cardId++}};rt.cardId=1;let cr=rt;class lr extends V{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return jn(this.id,e)}static checkAndGenerate(e,n,r){return Un(e,n,r).then(i=>i.length===0?Mn(e,n,r):i[0])}}function ur(){return C().emit("client:read",{})}var it=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},dr=(t,e,n)=>(it(t,e,"read from private field"),n?n.call(t):e.get(t)),fr=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},pr=(t,e,n,r)=>(it(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),le;const ge=class G extends V{constructor(){super(...arguments),this.type="front",this.organizations=[],fr(this,le,!1)}set language(e){localStorage.setItem(v.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(v.LOCALSTORAGE_LANGUAGE_KEY)||G.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){pr(this,le,e),this.emit(G.EVENT_READY_UPDATE,e)}get ready(){return dr(this,le)}onReady(e){return this.on(G.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(G.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(v.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(G.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(n=>n.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){$()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(v.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 ur()}validateContextId(e){var n;try{return((n=this.person)==null?void 0:n.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};le=new WeakMap;ge.DEFAULT_LANGUAGE="en";ge.EVENT_CONTEXT_UPDATE="event:context-update";ge.EVENT_READY_UPDATE="event:ready-update";let hr=ge;function gr(t){return C().emit("metadata:read",{entity:t})}const pe=function(){const e=o.reactive({}),n=new Map;function r(l){return e[l]}async function i(l){if(n.has(l)&&await n.get(l),e[l])return;const c=await a(l);u(l,c)}function a(l){const c=gr(l).finally(()=>{n.delete(l)});return n.set(l,c),c}function u(l,c){e[l]=c}return{state:e,initEntity:i,get:r}}();class B{static login(e){return R(x.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:x.applicationName})})}static parseProcessAnswer(e){if(e.statusCode>4)throw new Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return 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,n){return R(`${x.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}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,n){return R(`${x.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(B.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startPasswordReset(e,n){return R(`${x.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:n,AppName:e})})}static confirmPhoneNumberByAccessRecovery(e,n,r,i){return R(`${x.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static confirmEmailByAccessRecovery(e,n,r,i){return R(`${x.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static finishAccessRecovery(e,n,r){return R(`${x.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Password:r,ConfirmedPassword:r})})}}class mr{static readHistoryById(e,n){return R(`/close-api/audits/history/${e}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class yr{static readLicences(e){const n=`/close-api/proxy/Dashboard/Licenses?organizationId=${e.toString()}`;return R(n).then(r=>{const i={};return r.byOrganization.licenses.forEach(a=>{const u=a.licenseTypeCode;i[u]||(i[u]={licenseTypeCode:u}),i[u][a.statisticName]=a.value}),Object.values(i)})}}class Er{static getConfiguration(){return R("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(e){return await R(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}function vr(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function S(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];if(Array.isArray(r)){const i=r.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return r.length&&e.push(`@${n} in (${i})`),e}if(vr(r)){let i=function(a){var u;return((u=a.match(/([^Z]*)/))==null?void 0:u[0])+"0000Z"};return r.start&&e.push(`@${n} ge ${i(r.start)}`),r.end&&e.push(`@${n} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${n} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${n} eq '${r}'`),e):(r===null&&e.push(S.is(n,r)),e)},[]).join(" and ")}function te(t){return typeof t=="string"?`'${t}'`:`${t}`}S.includes=function(e,n){return`@${e} Contains ${te(n)}`};S.beginWith=function(e,n){return`@${e} BeginWith ${te(n)}`};S.notEq=function(e,n){return`@${e} nq ${te(n)}`};S.eq=function(e,n){return Array.isArray(n)?S.in(e,n):`@${e} eq ${te(n)}`};S.in=function(e,n){const r=n.map(te).join(", ");return`@${e} in (${r})`};S.notIn=function(e,n){return!Array.isArray(n)||n.length===0?"":S.and(...n.map(r=>S.notEq(e,r)))};S.and=function(...e){return e.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(S.wrap).join(" and ")};S.wrap=function(e){return`(${e})`};S.is=function(e,n){return`@${e} is ${n}`};S.or=function(...e){return e.join(" or ")};function ke(t){return Object.keys(t).reduce((e,n)=>{let r=t[n];const i=n.charAt(0).toUpperCase()+n.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=ke(r)),e[i]=r,e},{})}const L=new hr;exports.Communication=lr;exports.CoreError=W;exports.Filter=S;exports.Manager=L;exports.MetadataStore=pe;exports.NotificationSystem=ee;exports.WidgetButton=Ft;exports.WidgetIcon=Q;exports.WidgetImage=Jt;exports.WidgetList=un;exports.WidgetLoader=Ht;exports.WidgetMultiButton=zt;exports.WidgetSpinner=he;exports.WidgetTable=Dt;exports.asyncProcess=fn;exports.authService=B;exports.billingService=Y;exports.catchUniversal=$;exports.clientService=Ge;exports.config=dn;exports.configuration=x;exports.constants=v;exports.dashboardService=yr;exports.debounce=vn;exports.documentsService=mt;exports.fileService=ht;exports.getCellName=He;exports.getCellValue=Ce;exports.getNamesFromListConfig=gn;exports.getUnitValue=we;exports.groupArrayByField=mn;exports.historyService=mr;exports.injectAction=Ln;exports.internationalizationService=pt;exports.invitationService=gt;exports.openService=Er;exports.parseError=de;exports.prettyDate=Ae;exports.prettyDateWithTime=Ke;exports.prettyMoney=Xe;exports.prettyValueFieldByEntity=Cn;exports.processWizardService=ce;exports.request=R;exports.staticLink=Dn;exports.t=H;exports.throttle=wn;exports.universalEntityCount=Pn;exports.universalEntityCreate=et;exports.universalEntityDelete=tt;exports.universalEntityRead=fe;exports.universalEntityUpdate=Se;exports.universalHistoryRead=$n;exports.universalListSettingRead=In;exports.universalMetadataFieldTreat=Rn;exports.universalToolRead=nt;exports.useActions=Jn;exports.useCommunication=qn;exports.useEnter=or;exports.useFormEntity=zn;exports.useListActiveRow=Bn;exports.useListEntity=Vn;exports.useListSearch=sr;exports.useListSelect=ir;exports.useManagerState=Fn;exports.useMetadata=Gn;exports.useSocket=C;exports.useUsageContext=Yn;exports.useWizard=wt;exports.uuidv4=yn;exports.valuesToUpperCase=ke;
|
|
10
|
+
*/const Le=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},$e=function(t,e){t in this.events&&this.events[t].forEach(n=>n(e))},Pe=function(t,e){const n=this.events[t];if(!n)return;const r=n.indexOf(e);r!==-1&&n.splice(r,1)},De=function(){this.events={}};class V{constructor(){this.events={}}on(e,n){return Le.call(this,e,n)}emit(e,n){return $e.call(this,e,n)}off(e,n){return Pe.call(this,e,n)}cleanEvents(){De.call(this)}static on(e,n){return Le.call(V,e,n)}static emit(e,n){return $e.call(V,e,n)}static off(e,n){return Pe.call(V,e,n)}static cleanEvents(){De.call(V)}}V.events={};var ze=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},re=(t,e,n)=>(ze(t,e,"read from private field"),n?n.call(t):e.get(t)),ve=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},we=(t,e,n,r)=>(ze(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Z,ie,se;const q=class I extends V{constructor(){super(...arguments),ve(this,Z,void 0),ve(this,ie,"front"),this.organizations=[],ve(this,se,!1)}set language(e){localStorage.setItem(I.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(I.LOCALSTORAGE_LANGUAGE_KEY)||I.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(I.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){we(this,Z,e)}get router(){if(!re(this,Z))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return re(this,Z)}set type(e){we(this,ie,e)}get type(){return re(this,ie)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){we(this,se,e),this.emit(I.EVENT_READY_UPDATE,e)}get ready(){return re(this,se)}onReady(e){return this.on(I.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(I.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(I.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(I.CURRENT_CONTEXT_KEY,String(e)),this.emit(I.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(n=>n.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 n=Number.parseInt(localStorage.getItem(I.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(n)&&this.validateContextId(Number(n))?this.setCurrentContext(n):this.setCurrentContext(Number(e.id))}catch{ct.add("error",W.ApiNotAvailable().message)}}loadCustomerData(){return Ge.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var n;return((n=this.person)==null?void 0:n.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 n=localStorage.getItem(this.getListKeyById(e));return n&&JSON.parse(n)}setListInformationToLocalStorage(e,n){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(n))}};Z=new WeakMap;ie=new WeakMap;se=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 ut=q;const xe=new ut;function dt(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return at}})}function O(t,e={}){return xe.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=xe.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw W.ApiNotAvailable()}).then(n=>dt(n).then(r=>{if(!n.ok)throw r;return r}))}class ft{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,n,r)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[n]=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")}}new ft;class Ge{static getClientData(){return O("/close-api/client-content")}static getNavigation(){return O("/close-api/client/navigation")}}class pt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return O(`/open-api/internationalization/language/${e}`)}}function Be(t){return{...t,createdEntities:t.createdEntites}}const Ye=class ae{static async getStartConfig(e,n){return O([ae.url,e,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,n){return O([ae.url,e,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(Be)}static async runStep(e,n,r,i,a){return O([ae.url,e,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:a})}).then(Be)}};Ye.url="/close-api/views/process-wizard";let ce=Ye;class ht{static async upload(e,n){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${n}`;return await fetch(i,{method:"POST",body:r}).then(a=>a.json()).then(a=>(a.filename=e.name,a))}}class gt{static invite(e,n,r){return O("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:n,relatedRoleCode:r})})}static accept(e,n){return O("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!0})})}static decline(e,n){return O("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!1})})}}class mt{static getRequiredDocuments(e,n,r){const i=new URLSearchParams({entity:e,primaryKey:n,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(a=>a.json())}}class Y{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Y.url()}/calculator/${e}`)}static calculate(e,n){return O(`/${Y.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:n})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):W.ApiNotAvailable()})}static parseMetadataField(e){function n(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:n(e)}}static createOnlinePayment(e,n){return O(`/${Y.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:n})})}static applyOnlinePayment(e){return O(`/${Y.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}function yt(t){return t.statusName==="Completed"}function Et(t){return t.statusName==="FinalStepWithConfirmation"}function vt(t){return t.statusName==="ValidationError"}function wt(t,e,n){let r=null;const i=o.reactive({wait:null});let a=[],u=null;const l=o.ref(null);function c(){l.value=a.find(s=>s.name===u)||null}function d(){var s;return u?((s=a.find(p=>p.name===u))==null?void 0:s.fields)||[]:[]}function f(s){if(c(),vt(s))return void n.onValidation(s.validationResults);if((s.statusName==="FinalStep"||s.statusName==="NextStep")&&(!d().length||_t(d(),n.presets)))return k(n.presets||{});yt(s)&&n.onCompleted(s),Et(s)&&n.onConfirmation(s)}async function w(){try{await b(),await g()}catch(s){const{message:p}=de(s);ee.add("error",p)}}function b(){return i.wait="Loading process information.",ce.getStartConfig(e,t).then(s=>{a=s.steps.map(p=>({label:p.title,name:p.stepName,number:p.number,fields:p.frontendEntity.objectTypes.reduce((h,_)=>(_.properties.forEach(T=>{h.push({name:T.name,label:T.title,type:T.refEntityName||T.dataType})}),h),[])}))}).then(s=>(i.wait=!1,s))}function y(s){return u=s.nextStepName,r=s.token,s}function E(s){const p=de(s);ee.add("error",p.message)}function g(){return i.wait="Starting process",ce.startProcess(e,t).then(y).then(f).catch(E).finally(()=>{i.wait=null})}function k(s={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Waiting for result...",ce.runStep(e,t,u,r,s).then(y).then(f).catch(E).finally(()=>{i.wait=!1}))}return{initialize:w,state:i,currentStepConfig:o.readonly(l),next:k}}function _t(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(!P.utils.getPropFromObject(e,r.name))return!1}return!0}const Ct={class:"widget-table__head"},Tt={class:"widget-table__head-label margin_0 text_overflow"},At=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("tr",Ct,[(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",Tt,o.toDisplayString(r.label),1)]))),128))]))}});const F=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},St=F(At,[["__scopeId","data-v-25198f4a"]]);function He(t){return typeof t.name=="string"?t.name:Array.isArray(t.name)?t.name[0]:null}function bt(t){const e=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let r;for(;(r=e.exec(t))!==null;)n.push(r[1]);return n}function kt(t,e){return bt(t).forEach(r=>{t=t.replace(new RegExp("\\$\\{"+r+"}","g"),P.utils.getPropFromObject(e,r))}),t}function Te(t,e){if(typeof t.value=="string")return kt(t.value,e);const n=He(t);let r=n?P.utils.getPropFromObject(e,n):null;return r===void 0&&(r=null),t.value?t.value(r,e):t.value===null?null:r}const v={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",TIME_TO_LIVE_SOCKET_REQUEST:3e4,CORE_DEBUG_LABEL:"eservices-core"};function Ae(t){return[v.CORE_DEBUG_LABEL,t].join(":")}function Ke(t){return Se(t,"YYYY/MM/DD HH:mm:ss")}function Se(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return st.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const Nt={props:{name:String},setup(t,e){let n="unknown";try{n=e.slots.default()[0].children}catch{n=t.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${n}`})}},Q=F(Nt,[["__scopeId","data-v-e287c8d9"]]);function _e(t){return e=>typeof e=="string"||typeof e=="number"?`${e} ${t}`:""}const It=Ce(Ae("setup-list-row"));function Rt(t,e){const n=t.config.map(r=>Ot(r,t,e));return o.h("tr",{class:"widget-table__row widget-table-row"},n)}function Ot(t,e,n){const r=e.values;let i=Te(t,r);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(f){a.onClick.push(()=>f(r))}function l(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const c=[],d=[];if(t.unitValue&&(i=_e(t.unitValue)(i)),t.unit&&(i=_e(t.unit)(i)),t.hide&&t.hide(r))return[o.h("td")];if(t.type)switch(l(`widget-table-cell_${t.type}`),t.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Se(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Ke(typeof i=="string"?i:null);break}case"money":{i=Xe(i);break}case"multi-select":{d.push(o.h(P.FormField,{type:"single-checkbox",modelValue:e.selected})),u(Ve.bind(null,n,!0));break}case"select":{d.push(o.h(P.FormField,{type:"single-radio",modelValue:e.selected})),u(Ve.bind(null,n,!1));break}}if(t.onClick&&u(t.onClick),t.link)try{const f=t.link(r);if(f){const w=o.h(Ue.RouterLink,{to:f});d.push(w),l("widget-table-cell_link")}}catch(f){It("Can't add router link",f)}if(t.href&&(d.push(o.h("a",{href:t.href(r),target:"_blank"})),l("widget-table-cell_link")),t.formatter&&(i=ge(t.formatter).exec(i,r)),typeof i=="boolean"&&(i=i?"✓":"—"),(typeof i=="string"||typeof i=="number")&&d.push(o.h("p",{class:"widget-list-cell-text"},i)),t.icon&&(typeof t.icon=="string"&&d.push(o.h(Q,{name:t.icon})),typeof t.icon=="function")){const f=t.icon(r);f!==null&&d.push(o.h(Q,{name:f}))}return t.class&&(typeof t.class=="function"?l(t.class(r)):l(t.class)),c.push(o.h("td",a,d)),c}function Ve(t,e){t.emit("select",e)}function Je(t,e){return()=>{try{return Rt(t,e)}catch(n){return console.warn(n),null}}}const Lt={props:{values:Object,config:Object,selected:Boolean},setup:Je},$t=["colspan"],Fe=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(t,{emit:e}){const n=o.ref();return o.onMounted(()=>{setTimeout(()=>{n.value&&n.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:n},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=a=>e("close")),onSave:i[1]||(i[1]=a=>e("save",a))}),null,16,["values","new"]))],8,$t)],512))}}),Pt={class:"widget-table"},Me="update:selectedRows",Dt=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1}},emits:["update:activeRow","save"],setup(t,{emit:e}){const n=t,r=o.useSlots(),i=o.computed(()=>{var c;return(c=r==null?void 0:r.default)==null?void 0:c.call(r)[0]});function a(c,d=!0){if(!n.selectedRows)return;if(!d)return e(Me,n.selectedRows.includes(c)?[]:[c]);const f=[...n.selectedRows],w=f.indexOf(c);return w===-1?f.push(c):f.splice(w,1),e(Me,f)}function u(c){e("save",c),e("update:activeRow",null)}const l=o.computed(()=>n.shortcut?n.config.filter(c=>c.name?!!n.array.find(f=>![null,""].includes(Te(c,f))):!0):n.config);return(c,d)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",Pt,[o.createVNode(St,{config:l.value},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.array,(f,w)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:w},[o.createVNode(Lt,{config:l.value,values:f,selected:c.selectedRows.includes(f),onSelect:b=>a(f,b),class:o.normalizeClass(c.classCallback?c.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&c.activeRow===f?(o.openBlock(),o.createBlock(Fe,{key:0,component:i.value,"row-length":c.config.length,values:f,onClose:d[0]||(d[0]=b=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),c.activeRow===o.unref(v).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(Fe,{key:0,component:i.value,"row-length":l.value.length,onClose:d[1]||(d[1]=f=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),xt=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}});const he=F(xt,[["__scopeId","data-v-0ef9ae88"]]),Bt={class:"widget-button"},Vt=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("button",Bt,[e.wait?(o.openBlock(),o.createBlock(he,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const Ft=F(Vt,[["__scopeId","data-v-450dc564"]]),Mt={class:"widget-multi-button-wrap position_relative cursor_pointer"},Ut={class:"widget-multi-button-body grid"},jt=["onClick"],Wt={class:"widget-multi-button-side-wrap"},qt=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(t){const e=t;o.useCssVars(u=>({"7025434e":r.value}));const n=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(u){if(!(typeof u!="function"||n.wait))return n.wait=!0,Promise.resolve().then(u).finally(()=>{n.wait=!1})}function a(u=!n.active){n.active=u}return(u,l)=>(o.openBlock(),o.createElementBlock("div",Mt,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[o.createElementVNode("div",Ut,[u.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:l[0]||(l[0]=c=>a())},o.toDisplayString(u.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(c,d)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:d,onClick:f=>{i(c.callback),a(!1)}},o.toDisplayString(c.label),9,jt))),128))]),o.createElementVNode("div",Wt,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:l[1]||(l[1]=c=>a())},[n.wait?(o.openBlock(),o.createBlock(o.unref(he),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(Q),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}});const zt=F(qt,[["__scopeId","data-v-a8d711d1"]]),Gt={class:"widget-loader flex flex-align_center gap_10 padding_15"},Yt={class:"text_md"},Ht=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",Gt,[o.createVNode(he,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",Yt,o.toDisplayString(e.label),1)]))}}),Kt=["alt","src"],Jt=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,n=o.ref();return o.onMounted(()=>{n.value&&(n.value.src=e.src),n.value.onerror=function(){e.default&&(n.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:n,src:r.src||r.$props.default},null,8,Kt))}}),Xt={props:{config:Array,values:Object,selected:Boolean},setup:Je};const Zt=F(Xt,[["__scopeId","data-v-344a8cc1"]]),Qt=t=>(o.pushScopeId("data-v-bf495d6a"),t=t(),o.popScopeId(),t),en={class:"widget-list-head-cell"},tn=Qt(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),nn=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(t,{emit:e}){const n=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",en,[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(P.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(a=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=a=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(Q),{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),tn])]))}});const rn=F(nn,[["__scopeId","data-v-bf495d6a"]]),on=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const n=t,r=o.ref(),i=o.ref();o.onMounted(()=>{function c(y,E){let g=-1;do g++,E-=y[g];while(E>0&&g<y.length);return g}function d(y,E){let g=0;for(;E>0&&E>y[g]&&g<y.length;)E-=y[g],g++;return console.log(E,g),g>0?g:0}function f(y){try{i.value.style.insetInlineStart=y+"px"}catch(E){console.log(E)}}function w(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 b(y){return y===null?!1:y.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(E){var Re;function g(N){return N.screenX+p-T}const k=r.value,s=[...k.children].filter(N=>N.localName==="th"),p=((Re=k.offsetParent)==null?void 0:Re.scrollLeft)||0,h=s.map(N=>N.clientWidth),_=b(E.target),T=k.getBoundingClientRect().left,z=g(E),A=c(h,z),M=h.slice(0,A).reduce((N,D)=>N+D,0),K=z-M,ye=k.offsetWidth,J=s[A].clientWidth;if(n.config[A].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",E.screenX),console.log("Widths",h),console.log("max width",ye),console.log("Start Position",z),console.log("Position From",A),console.log("Start Position",A),console.log("Global offset (Отступ самой таблицы от края экрана)",T),console.log("Del",K),console.groupEnd(),i.value.innerText=s[A].textContent||"",i.value.style.display="grid",i.value.style.width=J+"px",i.value.style.cursor="grabbing",f(M),w(J),document.addEventListener("pointermove",Ie,{passive:!0}),document.addEventListener("pointerup",Ne);function Ne(N){if(console.group("END"),document.removeEventListener("pointermove",Ie),document.removeEventListener("pointerup",Ne),_&&(n.config[A].width=i.value.style.width,n.config[A].minWidth=i.value.style.width,n.config[A].maxWidth=i.value.style.width,a(n.config)),!_){const D=N.screenX+p-T;console.log("ENP Position",D);const ne=d(h,D);if(console.log(A,"->",ne),ne!==A){const X=n.config[A],Ee=n.config;Ee.splice(A,1),Ee.splice(ne,0,X),a(Ee)}else{const X=n.config[A].name;u(X)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Ie(N){if(_){const X=g(N)-z+J;w(X);return}let D=N.screenX+p-T-K;D<0&&(D=0),D+J>ye&&(D=ye-J),f(D)}})});function a(c){e("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(n.order.length===0||n.order[0]!==c)return void l([c]);const d=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([c,d==="asc"?"desc":"asc"])}function l(c){e("update:order",c)}return(c,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(c.config,(f,w)=>(o.openBlock(),o.createBlock(rn,o.mergeProps({key:f},f,{onOrder:b=>u(f.name),onSelect:d[0]||(d[0]=b=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}});const sn=F(on,[["__scopeId","data-v-ccffc6bd"]]),an={class:"widget-list"},cn={class:"widget-list-body position_relative"},ln=50,un=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(t,{emit:e}){const n=t;function r(l,c=!0){if(n.selectedRows)if(!c)a(n.selectedRows.includes(l)?[]:[l]);else{const d=[...n.selectedRows],f=d.indexOf(l);f===-1?d.push(l):d==null||d.splice(f,1),a(d)}}function i(){var l;if(((l=n.selectedRows)==null?void 0:l.length)!==n.array.length)return a([...n.array]);a([])}function a(l){e("update:selectedRows",l)}function u(l){if(!l)return;const c=l.target;c.scrollTop+c.clientHeight+ln>c.scrollHeight&&e("scrollEnd")}return(l,c)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[o.createElementVNode("table",an,[o.createElementVNode("thead",null,[o.createVNode(sn,{onSelect:c[0]||(c[0]=d=>i()),"onUpdate:order":c[1]||(c[1]=d=>e("update:order",d)),"onUpdate:config":c[2]||(c[2]=d=>e("update:config",d)),config:l.config,order:l.order},null,8,["config","order"])]),o.createElementVNode("tbody",cn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.array,(d,f)=>{var w;return o.openBlock(),o.createBlock(Zt,{key:f,class:"widget-list-row",values:d,config:l.config,selected:(w=l.selectedRows)==null?void 0:w.includes(d),onSelect:b=>r(d,b)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),x={};function dn(t){for(let e in t)x[e]=t[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function fn(t){function e(...r){return n.wait?Promise.reject("The process has already started."):(n.wait=!0,Promise.resolve().then(()=>t(...r)).finally(()=>{n.wait=!1}))}const n=o.reactive({wait:!1,call:e});return n}function de(t){return typeof t=="string"?oe(t):pn(t)?oe(t.message,t.children||t.details||[]):hn(t)?oe(t.title,[t.detail||""]):oe(v.DEFAULT_ERROR_MESSAGE)}function pn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"message"))}function hn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"title"))}function oe(t,e=[]){return{message:t,children:e}}function $(t="error"){return function(e){const{message:n,children:r}=de(e);ee.add(t,n,{children:r})}}function fe(t,e={}){return C().emit("entity:read",{...e,entity:t})}function be(t,e){return C().emit("entity:update",{...e,entity:t})}function gn(t){return t.reduce((e,n)=>(n.name&&(typeof n.name=="string"?e.push(n.name):e.push(...n.name)),e),[])}function Xe(t,e=2){if(!(typeof t=="string"||typeof t=="number"))return"";let r=String(t).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 mn(t,e){const n=new Map;return t.forEach(r=>{var a;const i=e(r);n.has(i)||n.set(i,[]),(a=n.get(i))==null||a.push(r)}),n}function yn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function En(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return v.DEFAULT_ERROR_MESSAGE}})}function R(t,e={}){return L.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=L.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw new Error(v.DEFAULT_ERROR_MESSAGE)}).then(n=>En(n).then(r=>{if(!n.ok)throw r;return r}))}function vn(t,e=1e3){let n=0;return(...r)=>{clearTimeout(n),n=setTimeout(()=>t(...r),e)}}function wn(t,e){let n=!1;return(...r)=>{if(!n)return n=!0,setTimeout(()=>n=!1,e),t(...r)}}const _n=Ce(Ae("pretty-value-field-by-entity"));function Cn(t,e,n){try{const r=pe.get(t);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${t} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(r){return _n('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,t,e,n),n}}const Tn=1,An=5e3,Sn="static-folder",Ze="request-error",U=Ce(Ae("use-socket"));function C(){return kn}function bn(t){return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Blob]"}const kn=function(){let t=1,e,n;const r=new Set;let i=0;const a=new Set;function u(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},An*2);const s=new Uint8Array(1);s[0]=Tn,e.send(s)}setInterval(()=>{Array.from(r).forEach(s=>{k(s)&&(U("Handler for event %s requestId %d was expired",s.event,s.requestId),s.requestId?c({requestId:s.requestId,event:Ze,data:{message:W.RequestTookToLong().message}}):r.delete(s))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&d()},v.DELAY_SOCKET_RECONNECT);function l(){return{safeQueue:a,requestId:t,handlers:r,socketInstance:e}}function c(s){const p=[...r.values()];U("Handlers array length is %d. Response event: %s. Request id: %d",r.size,s.event,s.requestId),p.forEach(h=>{const _=s.requestId;(h.requestId&&h.requestId===_||!h.requestId&&h.event===s.event)&&(U("Find appropriated handler: %d, event: %s",t,h.event),h.callback(s.data,s),h.once&&(r.delete(h),U("Handler was removed by *once* params was passed. %o",h)))})}function d(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),e=new WebSocket(n),e.onclose=function(s){U("Connection to server was stopped: %d %s",s.code,s.reason),Array.from(r).forEach(p=>{p.guaranteedAnswer&&p.serializeString&&a.add(p.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(s=>{f(s),a.delete(s)})},e.onerror=function(s){console.warn(s)},e.onmessage=s=>{var p;try{if(bn(s.data)){u();return}const h=JSON.parse(s.data);if(!Qe(h)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(h);return}(p=h==null?void 0:h.data)!=null&&p.refresh&&location.reload(),c(h)}catch(h){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(h)}}}function f(s){e.send(s)}function w(s,p){g({event:s,callback:p})}function b(s,p){g({event:s,callback:p,once:!0})}function y(){return e&&(e==null?void 0:e.readyState)===1}function E(s,p,h){const _=++t,T=JSON.stringify({requestId:_,event:s,data:p,contextId:L.contextId,url:window.location.href});return y()?f(T):(a.add(T),U("Socket is not connected. Message was send to save-queue")),new Promise((z,A)=>{g({event:s,requestId:_,once:!0,guaranteedAnswer:!0,serializeString:T,callback:(M,K)=>{if(U("Promise was resolve with next data:",M),Nn(K))return void A(M);h&&h(M,K),z(M)},timeToLive:v.TIME_TO_LIVE_SOCKET_REQUEST})})}function g(s){const p={timeToLive:0,...s,created:new Date().getTime()};r.add(p)}function k(s){return s.timeToLive===0||typeof s.timeToLive!="number"?!1:new Date().getTime()-s.created>s.timeToLive}return{get socket(){return e},on:w,once:b,emit:E,initialization(s){n=s},getDevInfo:l}}(),Nn=t=>!!Qe(t)&&t.event===Ze,Qe=t=>typeof t=="object"&&t!==null&&"event"in t&&typeof t.event=="string"&&"requestId"in t&&typeof t.requestId=="number"&&"data"in t;function In(t,e){return C().emit("list-setting:read",{entity:t,mark:e})}function Rn(t,e){return C().emit("metadata-field:treat",{entity:t,fieldName:e})}function et(t,e){return C().emit("entity:create",{...e,entity:t})}function tt(t,e){return C().emit("entity:delete",{...e,entity:t})}function On(t,e){return C().emit("usage-context:read",{...e,entity:t})}function nt(t={}){return C().emit("tool:read",t)}function Ln(t,e={},n={}){const r=o.inject(v.PROVIDE_NAME_ACTIONS,null),i=typeof t=="string"?t:e,a=typeof e=="string"?n:e;return o.computed(()=>{var c;const l=((typeof t=="string"?(c=r==null?void 0:r.actions)==null?void 0:c.value:o.unref(t))||[]).find(d=>d.name===i);return l?{...l,...a}:null})}function $n(t){return C().emit("history:read",t)}function Pn(t,e){return C().emit("entity:count",{...e,entity:t})}function Dn(t){return`/${Sn}/${t}`}function ge(t){return{exec(e,n){switch(t.name){case"replace-boolean":return ge.replaceBoolean(t,e,n||{})}}}}ge.replaceBoolean=(t,e,n)=>xn(e,t.values);function xn(t,e){return t?e[1]:e[0]}function Bn(){const t=o.ref(null);function e(n){t.value=n}return{activeRow:t,activateRow:e}}function Vn(t,e,n={}){const r=o.reactive([]);let i=0;const a=o.ref(!1);function u(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function l(){if(a.value)return Promise.reject("The process has already started.");const s=g();return a.value=!0,typeof s.limit!="number"&&(s.limit=100),s.offset=i,(n.request||fe)(t,s).then(h=>(i+=h.length,h)).finally(()=>{a.value=!1})}function c(s,p){var _;return typeof s.Version=="number"?s.Version:(_=r.find(T=>T.Id===p))==null?void 0:_.Version}function d(s,p){const h=r.findIndex(_=>_.Id===s);if(h===-1)throw new Error(`Can't found item with Id ${s}`);r.splice(h,1,p)}function f(s){const p=r.findIndex(h=>h.Id===s);if(p===-1)throw new Error(`Can't found item with Id ${s}`);r.splice(p,1)}async function w(s,p){try{const h=g(),_=c(p,s);delete p.Version,await be(t,{id:s,values:p,version:_,masterEntities:u()});const T=await fe(t,{fields:h.fields||"",id:s});d(s,T)}catch(h){$()(h)}}async function b(s,p={}){try{const h=g(),_=c(p,s);delete p.Version,await tt(t,{id:s,version:_,masterEntities:u()}),f(s)}catch(h){$()(h)}}async function y(s){try{await et(t,{values:s,masterEntities:u()}),await k()}catch(p){$()(p)}}async function E(){try{const s=await l();r.push(...s)}catch(s){$()(s)}}function g(){return typeof e=="function"?e():e}async function k(){try{i=0;const s=await l();r.splice(0,r.length,...s)}catch(s){$()(s)}}return{array:r,updateById:w,next:E,reload:k,wait:a,create:y,deleteById:b}}function Fn(){function t(){return{organizations:L.organizations,currentContextId:L.contextId,person:L.person,context:L.context,contextType:L.contextType,userId:L.userId}}const e=o.reactive(t());return L.onupdateContext(()=>{Object.assign(e,t())}),e}function Mn(t,e,n){return C().emit("communication:create",{entityName:t,entityCatalogId:e,targetCode:n})}function Un(t,e,n){return C().emit("communication:read",{entityName:t,entityCatalogId:e,targetCode:n})}function jn(t,e){return C().emit("communication-message:create",{communicationId:t,text:e})}function Wn(t){return C().emit("communication-message:read",{communicationId:t})}function qn(t){const e=P.Form.getParentForm(),n=o.reactive([]);return e&&e.subscribe(t),t.read=()=>Wn(t.id).then(r=>(n.splice(0,n.length,...r),r)),{array:n}}function zn(t,e){t.read=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw W.EntityWithoutName(t);return fe(t.name,r)}).then(ke).then(i=>(i.hasOwnProperty("Version")&&(t.version=i.Version),t.setValues(i),i)).catch($())},t.save=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw W.EntityWithoutName(t);return be(t.name,{id:r.id,values:t.changes,version:t.version})}).then(i=>{t.version=i.version}).catch(i=>{throw $()(i),i})};function n(){return typeof e=="function"?e():e}}function Gn(t){if(!t)return o.inject(v.PROVIDE_NAME_METADATA);pe.initEntity(t);const e=o.computed(()=>pe.state[t]);return o.provide(v.PROVIDE_NAME_METADATA,e),e}function Yn(t,e={}){if(!t)return o.inject(v.PROVIDE_NAME_USAGE_CONTEXT);const n=o.ref(null);return o.provide(v.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await On(t,Hn(e||{}))}}}function Hn(t){return typeof t=="function"?t():t}function Kn(t={}){return C().emit("tool:execute",t)}function Jn(t){if(!t)return o.inject(v.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),n=o.computed(()=>e.map(a=>Xn(t,a))),r={actions:n,update:i};o.provide(v.PROVIDE_NAME_ACTIONS,r),t.router=Ue.useRouter(),t.handleConfirmation||(t.handleConfirmation=Qn),t.handleAffectedEntity||(t.handleAffectedEntity=tr),t.handleCloseForm||(t.handleCloseForm=nr),t.handleValidationResult||(t.handleValidationResult=er);function i(a={}){return e.splice(0,e.length),nt(a).then(u=>e.splice(0,0,...u)).catch($("error"))}return{actions:n,update:i}}function Xn(t,e){return{...e,label:e.title,callback(){var i;const n=typeof t.values=="function"?t.values(e,t):t.values,r=()=>Kn({name:e.name,values:n}).then(async a=>{var u,l;if(!rr(a))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(t.handlers))for await(const c of t.handlers)await c(e,a,t);if(!a.success)throw t.handleValidationResult&&a.validationEffect&&((l=(u=a.validationEffect)==null?void 0:u.results)!=null&&l.length)&&t.handleValidationResult(e,a.validationEffect,t),new Error(a.message);return a.message&&ee.add("info",a.message),Array.isArray(a.affectedEntities)&&t.handleAffectedEntity&&a.affectedEntities.forEach(c=>{var d;return(d=t.handleAffectedEntity)==null?void 0:d.call(t,e,c,t)}),e.closeHostForm&&t.handleCloseForm&&t.handleCloseForm(e,t),a}).catch($("error"));return(i=t.overrides)!=null&&i[e.name]?t.overrides[e.name](e,t):e.requireSave&&t.form&&t.form.changed?t.form.save().then(r):!e.confirmation||!t.handleConfirmation?r():t.handleConfirmation(e,r)}}}function Zn(t){const e="Are you sure?";return t===!0||typeof t=="string"&&t.toLowerCase()==="true"||t==="1"?e:typeof t=="string"?t:e}async function Qn(t,e){const n=Zn(t.confirmation);if(!ue.getComponentFromStore(v.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await ue.promptModal(v.MODAL_CONFIRM,{message:n}))return e()}function er(t,e){const n=v.MODAL_VALIDATION_EFFECT;if(!ue.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{ue.pushModal(n,e)})}function tr(t,e,n){var u;const{router:r,form:i}=n,a=(u=e.primaryKey)==null?void 0:u.Id;if(r&&e&&e.name===t.redirectEntity)return r.push({name:e.name,params:{id:a}});i&&e.name===i.name&&e.updated&&a===i.id&&i.read()}function nr(t,e){const{router:n}=e;n&&t.closeHostForm&&n.back()}function rr(t){return!!(t&&typeof t=="object"&&"affectedEntities"in t&&"success"in t)}function or(t){function e(n){n.key==="Enter"&&t()}o.onMounted(()=>{document.addEventListener("keypress",e)}),o.onUnmounted(()=>{document.removeEventListener("keypress",e)})}function ir(t,e={}){const n=o.reactive([]),r=c=>{const d=o.unref(t);if(c===void 0){n.length===0?d.forEach(a):d.forEach(u);return}i(c)?u(c):a(c)},i=c=>n.includes(c),a=c=>{e.handleSelect&&!e.handleSelect(c)||i(c)||n.push(c)},u=c=>{const d=n.findIndex(f=>f===c);d!==-1&&n.splice(d,1)},l=o.computed(()=>{const c=o.unref(t);return n.length===c.length&&c.length!==0});return[n,r,l,a,u]}function sr(t){const e=o.ref(""),n=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(t).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:n}}const ee=new class{constructor(){this.store=o.reactive([])}add(e,n,r={}){const i=ar(r),a=new cr(e,n,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(e){const n=this.store.findIndex(r=>r.id===e);if(n===-1)return!1;this.store.splice(n,1)}};function ar(t){function e(r){return!!r&&typeof r=="object"}const n={timeout:10,click:()=>null,children:[]};return e(t)?{timeout:t.timeout||n.timeout,click:t.click||n.click,children:t.children||n.children}:n}const rt=class ot{constructor(e,n,r,i,a){this.type=e,this.message=n,this.timeout=r,this.children=i,this.click=a,this.id=ot.cardId++}};rt.cardId=1;let cr=rt;class lr extends V{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return jn(this.id,e)}static checkAndGenerate(e,n,r){return Un(e,n,r).then(i=>i.length===0?Mn(e,n,r):i[0])}}function ur(){return C().emit("client:read",{})}var it=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},dr=(t,e,n)=>(it(t,e,"read from private field"),n?n.call(t):e.get(t)),fr=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},pr=(t,e,n,r)=>(it(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),le;const me=class G extends V{constructor(){super(...arguments),this.type="front",this.organizations=[],fr(this,le,!1)}set language(e){localStorage.setItem(v.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(v.LOCALSTORAGE_LANGUAGE_KEY)||G.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){pr(this,le,e),this.emit(G.EVENT_READY_UPDATE,e)}get ready(){return dr(this,le)}onReady(e){return this.on(G.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(G.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(v.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(G.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(n=>n.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){$()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(v.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 ur()}validateContextId(e){var n;try{return((n=this.person)==null?void 0:n.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};le=new WeakMap;me.DEFAULT_LANGUAGE="en";me.EVENT_CONTEXT_UPDATE="event:context-update";me.EVENT_READY_UPDATE="event:ready-update";let hr=me;function gr(t){return C().emit("metadata:read",{entity:t})}const pe=function(){const e=o.reactive({}),n=new Map;function r(l){return e[l]}async function i(l){if(n.has(l)&&await n.get(l),e[l])return;const c=await a(l);u(l,c)}function a(l){const c=gr(l).finally(()=>{n.delete(l)});return n.set(l,c),c}function u(l,c){e[l]=c}return{state:e,initEntity:i,get:r}}();class B{static login(e){return R(x.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:x.applicationName})})}static parseProcessAnswer(e){if(e.statusCode>4)throw new Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return 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,n){return R(`${x.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}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,n){return R(`${x.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(B.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startPasswordReset(e,n){return R(`${x.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:n,AppName:e})})}static confirmPhoneNumberByAccessRecovery(e,n,r,i){return R(`${x.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static confirmEmailByAccessRecovery(e,n,r,i){return R(`${x.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static finishAccessRecovery(e,n,r){return R(`${x.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Password:r,ConfirmedPassword:r})})}}class mr{static readHistoryById(e,n){return R(`/close-api/audits/history/${e}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class yr{static readLicences(e){const n=`/close-api/proxy/Dashboard/Licenses?organizationId=${e.toString()}`;return R(n).then(r=>{const i={};return r.byOrganization.licenses.forEach(a=>{const u=a.licenseTypeCode;i[u]||(i[u]={licenseTypeCode:u}),i[u][a.statisticName]=a.value}),Object.values(i)})}}class Er{static getConfiguration(){return R("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(e){return await R(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}function vr(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function S(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];if(Array.isArray(r)){const i=r.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return r.length&&e.push(`@${n} in (${i})`),e}if(vr(r)){let i=function(a){var u;return((u=a.match(/([^Z]*)/))==null?void 0:u[0])+"0000Z"};return r.start&&e.push(`@${n} ge ${i(r.start)}`),r.end&&e.push(`@${n} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${n} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${n} eq '${r}'`),e):(r===null&&e.push(S.is(n,r)),e)},[]).join(" and ")}function te(t){return typeof t=="string"?`'${t}'`:`${t}`}S.includes=function(e,n){return`@${e} Contains ${te(n)}`};S.beginWith=function(e,n){return`@${e} BeginWith ${te(n)}`};S.notEq=function(e,n){return`@${e} nq ${te(n)}`};S.eq=function(e,n){return Array.isArray(n)?S.in(e,n):`@${e} eq ${te(n)}`};S.in=function(e,n){const r=n.map(te).join(", ");return`@${e} in (${r})`};S.notIn=function(e,n){return!Array.isArray(n)||n.length===0?"":S.and(...n.map(r=>S.notEq(e,r)))};S.and=function(...e){return e.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(S.wrap).join(" and ")};S.wrap=function(e){return`(${e})`};S.is=function(e,n){return`@${e} is ${n}`};S.or=function(...e){return e.join(" or ")};function ke(t){return Object.keys(t).reduce((e,n)=>{let r=t[n];const i=n.charAt(0).toUpperCase()+n.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=ke(r)),e[i]=r,e},{})}const L=new hr;exports.Communication=lr;exports.CoreError=W;exports.Filter=S;exports.Manager=L;exports.MetadataStore=pe;exports.NotificationSystem=ee;exports.WidgetButton=Ft;exports.WidgetIcon=Q;exports.WidgetImage=Jt;exports.WidgetList=un;exports.WidgetLoader=Ht;exports.WidgetMultiButton=zt;exports.WidgetSpinner=he;exports.WidgetTable=Dt;exports.asyncProcess=fn;exports.authService=B;exports.billingService=Y;exports.catchUniversal=$;exports.clientService=Ge;exports.config=dn;exports.configuration=x;exports.constants=v;exports.dashboardService=yr;exports.debounce=vn;exports.documentsService=mt;exports.fileService=ht;exports.formatter=ge;exports.getCellName=He;exports.getCellValue=Te;exports.getNamesFromListConfig=gn;exports.getUnitValue=_e;exports.groupArrayByField=mn;exports.historyService=mr;exports.injectAction=Ln;exports.internationalizationService=pt;exports.invitationService=gt;exports.openService=Er;exports.parseError=de;exports.prettyDate=Se;exports.prettyDateWithTime=Ke;exports.prettyMoney=Xe;exports.prettyValueFieldByEntity=Cn;exports.processWizardService=ce;exports.request=R;exports.staticLink=Dn;exports.t=H;exports.throttle=wn;exports.universalEntityCount=Pn;exports.universalEntityCreate=et;exports.universalEntityDelete=tt;exports.universalEntityRead=fe;exports.universalEntityUpdate=be;exports.universalHistoryRead=$n;exports.universalListSettingRead=In;exports.universalMetadataFieldTreat=Rn;exports.universalToolRead=nt;exports.useActions=Jn;exports.useCommunication=qn;exports.useEnter=or;exports.useFormEntity=zn;exports.useListActiveRow=Bn;exports.useListEntity=Vn;exports.useListSearch=sr;exports.useListSelect=ir;exports.useManagerState=Fn;exports.useMetadata=Gn;exports.useSocket=C;exports.useUsageContext=Yn;exports.useWizard=wt;exports.uuidv4=yn;exports.valuesToUpperCase=ke;
|
|
11
11
|
//# sourceMappingURL=eservices-core.cjs.js.map
|
|
@@ -6,7 +6,7 @@ import Me from "debug";
|
|
|
6
6
|
import $t from "date-and-time";
|
|
7
7
|
import { getComponentFromStore as it, promptModal as Pt, pushModal as Dt } from "jenesius-vue-modal";
|
|
8
8
|
/*!
|
|
9
|
-
* eservices-core v1.3.
|
|
9
|
+
* eservices-core v1.3.121
|
|
10
10
|
* (c) 2024 ESERVICES
|
|
11
11
|
*/
|
|
12
12
|
let J = {};
|
|
@@ -2450,6 +2450,7 @@ export {
|
|
|
2450
2450
|
Ur as debounce,
|
|
2451
2451
|
Sr as documentsService,
|
|
2452
2452
|
Ar as fileService,
|
|
2453
|
+
Ve as formatter,
|
|
2453
2454
|
Xt as getCellName,
|
|
2454
2455
|
dt as getCellValue,
|
|
2455
2456
|
xr as getNamesFromListConfig,
|
|
@@ -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
|
-
(function(l,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("jenesius-vue-form"),require("vue"),require("vue-router"),require("debug"),require("date-and-time"),require("jenesius-vue-modal")):typeof define=="function"&&define.amd?define(["exports","jenesius-vue-form","vue","vue-router","debug","date-and-time","jenesius-vue-modal"],N):(l=typeof globalThis<"u"?globalThis:l||self,N(l["eservices-core"]={},l.JenesiusVueForm,l.Vue,l.VueRouter,l.Debug,l.DateAndTime,l.JenesiusVueModal))})(this,function(l,N,o,Re,
|
|
3
|
-
* eservices-core v1.3.
|
|
2
|
+
(function(l,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("jenesius-vue-form"),require("vue"),require("vue-router"),require("debug"),require("date-and-time"),require("jenesius-vue-modal")):typeof define=="function"&&define.amd?define(["exports","jenesius-vue-form","vue","vue-router","debug","date-and-time","jenesius-vue-modal"],N):(l=typeof globalThis<"u"?globalThis:l||self,N(l["eservices-core"]={},l.JenesiusVueForm,l.Vue,l.VueRouter,l.Debug,l.DateAndTime,l.JenesiusVueModal))})(this,function(l,N,o,Re,Ee,st,re){"use strict";/*!
|
|
3
|
+
* eservices-core v1.3.121
|
|
4
4
|
* (c) 2024 ESERVICES
|
|
5
|
-
*/const _r="";let W={};function
|
|
5
|
+
*/const _r="";let W={};function x(t,...e){if(typeof t!="string")return console.trace(`Label is not provided for translation: ${t}`),"undefined";let n=N.utils.getPropFromObject((this==null?void 0:this.vocabulary)||W,t);if(typeof n=="string")return Oe(n,e);const r=N.utils.getPropFromObject(W==null?void 0:W.root,t);return typeof r=="string"?Oe(r,e):(typeof n===void 0&&console.warn(`Translation for label "${t}" is not founded.`),t)}function Oe(t,e){return e.forEach((n,r)=>{t=t.replaceAll(new RegExp(`\\{${r}}`,"g"),n)}),t}x.setGlobalVocabulary=function(t){W=t},x.getScope=function(t){const e=typeof t=="string"?t:"root";return typeof t!="string"&&console.warn(`SCOPE ${t} for translate is not string.`),x.bind({vocabulary:N.utils.getPropFromObject(W,e.toLowerCase())})},x.setVocabulary=function(t){return typeof t=="string"&&(t=N.utils.getPropFromObject(W,t)),x.bind({vocabulary:t})};const ve=class y extends Error{constructor(e,n=null){super(),this.message=e,this.details=n,this.id=y.ID++}static ParentFormNotFound(){return new y("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new y("Composite object name is undefined",e)}static EntityWithoutName(e){return new y("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new y(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new y("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new y("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new y(`${e} (id) is not a number`)}static UndefinedErrorId(e,n){return y.ApiNotAvailable()}static ApiError(e){return new y("Request error",e)}static ApiNotAvailable(){return new y(`Sorry, we experience difficulties here.
|
|
6
6
|
Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,n){return!e&&!n?y.ApiNotAvailable():new y(e||"Authorization Error",n)}static ApiResponseParseFailed(){return y.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new y("Object doesn't have id",e)}static ObjectWithIdNotFound(e,n){return new y(`Can't find object with id: ${e}`,n)}static ObjectWithoutConnectToPresentArray(e,n){return new y("Object is not found.",{object:e,array:n})}static EntityWithoutId(e){return new y("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,n){return new y(`Can't find the element with tableIndex ${e}`,n)}static UndefinedError(e,n=[]){return new y(e,n)}static TableArrayAlreadyIncludeProvidedIndexValue(e,n,r){return new y(`Array already includes the element with value ${e}`,{array:n,table:r})}static MetadataEntityIsNotAvailable(e){return new y(`Metadata for the ${e} is not currently available.`)}static RequestTookToLong(){return new y("The request took too long to complete. Try again later.")}};ve.ID=0;let q=ve;const ct="Please try again later or submit a feedback if problem doesn't go.",lt=new class{constructor(){this.store=o.reactive([])}add(e,n,{children:r,timeout:i=10,click:s=()=>{}}={}){const d=new ut(e,n,i,r||[],s);return this.store.push(d),i&&setTimeout(this.remove.bind(this,d.id),i*1e3),d}remove(e){const n=this.store.findIndex(r=>r.id===e);if(n===-1)return!1;this.store.splice(n,1)}removeChild(e,n){throw new Error("Removing children error.")}},Le=class it{constructor(e,n,r,i,s){this.type=e,this.msg=n,this.timeout=r,this.children=i,this.click=s,this.id=it.cardId++}};Le.cardId=1;let ut=Le;/*!
|
|
7
7
|
* jenesius-event-emitter v1.0.2
|
|
8
8
|
* (c) 2022 Jenesius
|
|
9
9
|
* @license MIT
|
|
10
|
-
*/const $e=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},Pe=function(t,e){t in this.events&&this.events[t].forEach(n=>n(e))},De=function(t,e){const n=this.events[t];if(!n)return;const r=n.indexOf(e);r!==-1&&n.splice(r,1)},Be=function(){this.events={}};class F{constructor(){this.events={}}on(e,n){return $e.call(this,e,n)}emit(e,n){return Pe.call(this,e,n)}off(e,n){return De.call(this,e,n)}cleanEvents(){Be.call(this)}static on(e,n){return $e.call(F,e,n)}static emit(e,n){return Pe.call(F,e,n)}static off(e,n){return De.call(F,e,n)}static cleanEvents(){Be.call(F)}}F.events={};var Ve=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},oe=(t,e,n)=>(Ve(t,e,"read from private field"),n?n.call(t):e.get(t)),Ee=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},we=(t,e,n,r)=>(Ve(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),K,ie,ae;const j=class $ extends F{constructor(){super(...arguments),Ee(this,K,void 0),Ee(this,ie,"front"),this.organizations=[],Ee(this,ae,!1)}set language(e){localStorage.setItem($.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem($.LOCALSTORAGE_LANGUAGE_KEY)||$.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem($.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){we(this,K,e)}get router(){if(!oe(this,K))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return oe(this,K)}set type(e){we(this,ie,e)}get type(){return oe(this,ie)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){we(this,ae,e),this.emit($.EVENT_READY_UPDATE,e)}get ready(){return oe(this,ae)}onReady(e){return this.on($.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on($.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on($.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem($.CURRENT_CONTEXT_KEY,String(e)),this.emit($.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(n=>n.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 n=Number.parseInt(localStorage.getItem($.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(n)&&this.validateContextId(Number(n))?this.setCurrentContext(n):this.setCurrentContext(Number(e.id))}catch{lt.add("error",q.ApiNotAvailable().message)}}loadCustomerData(){return Fe.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var n;return((n=this.person)==null?void 0:n.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 n=localStorage.getItem(this.getListKeyById(e));return n&&JSON.parse(n)}setListInformationToLocalStorage(e,n){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(n))}};K=new WeakMap,ie=new WeakMap,ae=new WeakMap,j.DEFAULT_LANGUAGE="en",j.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",j.EVENT_CONTEXT_UPDATE="event:context-update",j.EVENT_READY_UPDATE="event:ready-update",j.EVENT_DATA_UPDATE="event:data-update",j.CURRENT_CONTEXT_KEY="CurrentContext";let dt=j;const Me=new dt;function ft(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return ct}})}function R(t,e={}){return Me.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=Me.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw q.ApiNotAvailable()}).then(n=>ft(n).then(r=>{if(!n.ok)throw r;return r}))}class ht{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,n,r)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[n]=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")}}new ht;class Fe{static getClientData(){return R("/close-api/client-content")}static getNavigation(){return R("/close-api/client/navigation")}}class pt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return R(`/open-api/internationalization/language/${e}`)}}function Ue(t){return{...t,createdEntities:t.createdEntites}}const We=class me{static async getStartConfig(e,n){return R([me.url,e,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,n){return R([me.url,e,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(Ue)}static async runStep(e,n,r,i,s){return R([me.url,e,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(Ue)}};We.url="/close-api/views/process-wizard";let se=We;class gt{static async upload(e,n){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${n}`;return await fetch(i,{method:"POST",body:r}).then(s=>s.json()).then(s=>(s.filename=e.name,s))}}class mt{static invite(e,n,r){return R("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:n,relatedRoleCode:r})})}static accept(e,n){return R("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!0})})}static decline(e,n){return R("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!1})})}}class yt{static getRequiredDocuments(e,n,r){const i=new URLSearchParams({entity:e,primaryKey:n,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(s=>s.json())}}class Y{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Y.url()}/calculator/${e}`)}static calculate(e,n){return R(`/${Y.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:n})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):q.ApiNotAvailable()})}static parseMetadataField(e){function n(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:n(e)}}static createOnlinePayment(e,n){return R(`/${Y.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:n})})}static applyOnlinePayment(e){return R(`/${Y.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}function Et(t){return t.statusName==="Completed"}function wt(t){return t.statusName==="FinalStepWithConfirmation"}function _t(t){return t.statusName==="ValidationError"}function Ct(t,e,n){let r=null;const i=o.reactive({wait:null});let s=[],d=null;const u=o.ref(null);function c(){u.value=s.find(a=>a.name===d)||null}function f(){var a;return d?((a=s.find(p=>p.name===d))==null?void 0:a.fields)||[]:[]}function h(a){if(c(),_t(a))return void n.onValidation(a.validationResults);if((a.statusName==="FinalStep"||a.statusName==="NextStep")&&(!f().length||Tt(f(),n.presets)))return v(n.presets||{});Et(a)&&n.onCompleted(a),wt(a)&&n.onConfirmation(a)}async function C(){try{await I(),await m()}catch(a){const{message:p}=le(a);Z.add("error",p)}}function I(){return i.wait="Loading process information.",se.getStartConfig(e,t).then(a=>{s=a.steps.map(p=>({label:p.title,name:p.stepName,number:p.number,fields:p.frontendEntity.objectTypes.reduce((g,T)=>(T.properties.forEach(S=>{g.push({name:S.name,label:S.title,type:S.refEntityName||S.dataType})}),g),[])}))}).then(a=>(i.wait=!1,a))}function E(a){return d=a.nextStepName,r=a.token,a}function _(a){const p=le(a);Z.add("error",p.message)}function m(){return i.wait="Starting process",se.startProcess(e,t).then(E).then(h).catch(_).finally(()=>{i.wait=null})}function v(a={}){return!r||!d?Promise.reject("Not step or token."):(i.wait="Waiting for result...",se.runStep(e,t,d,r,a).then(E).then(h).catch(_).finally(()=>{i.wait=!1}))}return{initialize:C,state:i,currentStepConfig:o.readonly(u),next:v}}function Tt(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(!N.utils.getPropFromObject(e,r.name))return!1}return!0}const At={class:"widget-table__head"},St={class:"widget-table__head-label margin_0 text_overflow"},bt=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("tr",At,[(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",St,o.toDisplayString(r.label),1)]))),128))]))}}),Cr="",U=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},kt=U(bt,[["__scopeId","data-v-25198f4a"]]);function qe(t){return typeof t.name=="string"?t.name:Array.isArray(t.name)?t.name[0]:null}function Nt(t){const e=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let r;for(;(r=e.exec(t))!==null;)n.push(r[1]);return n}function It(t,e){return Nt(t).forEach(r=>{t=t.replace(new RegExp("\\$\\{"+r+"}","g"),N.utils.getPropFromObject(e,r))}),t}function _e(t,e){if(typeof t.value=="string")return It(t.value,e);const n=qe(t);let r=n?N.utils.getPropFromObject(e,n):null;return r===void 0&&(r=null),t.value?t.value(r,e):t.value===null?null:r}const w={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",TIME_TO_LIVE_SOCKET_REQUEST:3e4,CORE_DEBUG_LABEL:"eservices-core"};function Ce(t){return[w.CORE_DEBUG_LABEL,t].join(":")}function je(t){return Te(t,"YYYY/MM/DD HH:mm:ss")}function Te(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return st.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const Tr="",X=U({props:{name:String},setup(t,e){let n="unknown";try{n=e.slots.default()[0].children}catch{n=t.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${n}`})}},[["__scopeId","data-v-e287c8d9"]]);function Ae(t){return e=>typeof e=="string"||typeof e=="number"?`${e} ${t}`:""}const Rt=ye(Ce("setup-list-row"));function Ot(t,e){const n=t.config.map(r=>vt(r,t,e));return o.h("tr",{class:"widget-table__row widget-table-row"},n)}function vt(t,e,n){const r=e.values;let i=_e(t,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function d(h){s.onClick.push(()=>h(r))}function u(h){Array.isArray(h)?s.class.push(...h):s.class.push(h)}const c=[],f=[];if(t.unitValue&&(i=Ae(t.unitValue)(i)),t.unit&&(i=Ae(t.unit)(i)),t.hide&&t.hide(r))return[o.h("td")];if(t.type)switch(u(`widget-table-cell_${t.type}`),t.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Te(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=je(typeof i=="string"?i:null);break}case"money":{i=He(i);break}case"multi-select":{f.push(o.h(N.FormField,{type:"single-checkbox",modelValue:e.selected})),d(ze.bind(null,n,!0));break}case"select":{f.push(o.h(N.FormField,{type:"single-radio",modelValue:e.selected})),d(ze.bind(null,n,!1));break}}if(t.onClick&&d(t.onClick),t.link)try{const h=t.link(r);if(h){const C=o.h(Re.RouterLink,{to:h});f.push(C),u("widget-table-cell_link")}}catch(h){Rt("Can't add router link",h)}if(t.href&&(f.push(o.h("a",{href:t.href(r),target:"_blank"})),u("widget-table-cell_link")),t.formatter&&(i=be(t.formatter).exec(i,r)),typeof i=="boolean"&&(i=i?"✓":"—"),(typeof i=="string"||typeof i=="number")&&f.push(o.h("p",{class:"widget-list-cell-text"},i)),t.icon&&(typeof t.icon=="string"&&f.push(o.h(X,{name:t.icon})),typeof t.icon=="function")){const h=t.icon(r);h!==null&&f.push(o.h(X,{name:h}))}return t.class&&(typeof t.class=="function"?u(t.class(r)):u(t.class)),c.push(o.h("td",s,f)),c}function ze(t,e){t.emit("select",e)}function xe(t,e){return()=>{try{return Ot(t,e)}catch(n){return console.warn(n),null}}}const Lt={props:{values:Object,config:Object,selected:Boolean},setup:xe},$t=["colspan"],Ge=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(t,{emit:e}){const n=o.ref();return o.onMounted(()=>{setTimeout(()=>{n.value&&n.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:n},[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,$t)],512))}}),Pt={class:"widget-table"},Ye="update:selectedRows",Dt=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1}},emits:["update:activeRow","save"],setup(t,{emit:e}){const n=t,r=o.useSlots(),i=o.computed(()=>{var c;return(c=r==null?void 0:r.default)==null?void 0:c.call(r)[0]});function s(c,f=!0){if(!n.selectedRows)return;if(!f)return e(Ye,n.selectedRows.includes(c)?[]:[c]);const h=[...n.selectedRows],C=h.indexOf(c);return C===-1?h.push(c):h.splice(C,1),e(Ye,h)}function d(c){e("save",c),e("update:activeRow",null)}const u=o.computed(()=>n.shortcut?n.config.filter(c=>c.name?!!n.array.find(h=>![null,""].includes(_e(c,h))):!0):n.config);return(c,f)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",Pt,[o.createVNode(kt,{config:u.value},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.array,(h,C)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:C},[o.createVNode(Lt,{config:u.value,values:h,selected:c.selectedRows.includes(h),onSelect:I=>s(h,I),class:o.normalizeClass(c.classCallback?c.classCallback(h):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&c.activeRow===h?(o.openBlock(),o.createBlock(Ge,{key:0,component:i.value,"row-length":c.config.length,values:h,onClose:f[0]||(f[0]=I=>e("update:activeRow",null)),onSave:d,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),c.activeRow===o.unref(w).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(Ge,{key:0,component:i.value,"row-length":u.value.length,onClose:f[1]||(f[1]=h=>e("update:activeRow",null)),onSave:d,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),Bt=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}}),Sr="",ce=U(Bt,[["__scopeId","data-v-0ef9ae88"]]),Vt={class:"widget-button"},Mt=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("button",Vt,[e.wait?(o.openBlock(),o.createBlock(ce,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),br="",Ft=U(Mt,[["__scopeId","data-v-450dc564"]]),Ut={class:"widget-multi-button-wrap position_relative cursor_pointer"},Wt={class:"widget-multi-button-body grid"},qt=["onClick"],jt={class:"widget-multi-button-side-wrap"},zt=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(t){const e=t;o.useCssVars(d=>({"7025434e":r.value}));const n=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(d){if(!(typeof d!="function"||n.wait))return n.wait=!0,Promise.resolve().then(d).finally(()=>{n.wait=!1})}function s(d=!n.active){n.active=d}return(d,u)=>(o.openBlock(),o.createElementBlock("div",Ut,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[o.createElementVNode("div",Wt,[d.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:u[0]||(u[0]=c=>s())},o.toDisplayString(d.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.array,(c,f)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:h=>{i(c.callback),s(!1)}},o.toDisplayString(c.label),9,qt))),128))]),o.createElementVNode("div",jt,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:u[1]||(u[1]=c=>s())},[n.wait?(o.openBlock(),o.createBlock(o.unref(ce),{key:0,class:"widget-multi-button-side-spinner"})):d.array.length>1?(o.openBlock(),o.createBlock(o.unref(X),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),kr="",xt=U(zt,[["__scopeId","data-v-a8d711d1"]]),Gt={class:"widget-loader flex flex-align_center gap_10 padding_15"},Yt={class:"text_md"},Ht=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",Gt,[o.createVNode(ce,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",Yt,o.toDisplayString(e.label),1)]))}}),Jt=["alt","src"],Kt=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,n=o.ref();return o.onMounted(()=>{n.value&&(n.value.src=e.src),n.value.onerror=function(){e.default&&(n.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:n,src:r.src||r.$props.default},null,8,Jt))}}),Xt={props:{config:Array,values:Object,selected:Boolean},setup:xe},Nr="",Zt=U(Xt,[["__scopeId","data-v-344a8cc1"]]),Qt=t=>(o.pushScopeId("data-v-bf495d6a"),t=t(),o.popScopeId(),t),en={class:"widget-list-head-cell"},tn=Qt(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),nn=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(t,{emit:e}){const n=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",en,[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(N.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(X),{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),tn])]))}}),Ir="",rn=U(nn,[["__scopeId","data-v-bf495d6a"]]),on=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const n=t,r=o.ref(),i=o.ref();o.onMounted(()=>{function c(E,_){let m=-1;do m++,_-=E[m];while(_>0&&m<E.length);return m}function f(E,_){let m=0;for(;_>0&&_>E[m]&&m<E.length;)_-=E[m],m++;return console.log(_,m),m>0?m:0}function h(E){try{i.value.style.insetInlineStart=E+"px"}catch(_){console.log(_)}}function C(E){try{i.value.style.width=E+"px",i.value.style.minWidth=E+"px",i.value.style.maxWidth=E+"px"}catch(_){console.log(_)}}function I(E){return E===null?!1:E.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(_){var ot;function m(L){return L.screenX+p-S}const v=r.value,a=[...v.children].filter(L=>L.localName==="th"),p=((ot=v.offsetParent)==null?void 0:ot.scrollLeft)||0,g=a.map(L=>L.clientWidth),T=I(_.target),S=v.getBoundingClientRect().left,H=m(_),k=c(g,H),x=g.slice(0,k).reduce((L,M)=>L+M,0),ee=H-x,Ne=v.offsetWidth,te=a[k].clientWidth;if(n.config[k].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",_.screenX),console.log("Widths",g),console.log("max width",Ne),console.log("Start Position",H),console.log("Position From",k),console.log("Start Position",k),console.log("Global offset (Отступ самой таблицы от края экрана)",S),console.log("Del",ee),console.groupEnd(),i.value.innerText=a[k].textContent||"",i.value.style.display="grid",i.value.style.width=te+"px",i.value.style.cursor="grabbing",h(x),C(te),document.addEventListener("pointermove",rt,{passive:!0}),document.addEventListener("pointerup",nt);function nt(L){if(console.group("END"),document.removeEventListener("pointermove",rt),document.removeEventListener("pointerup",nt),T&&(n.config[k].width=i.value.style.width,n.config[k].minWidth=i.value.style.width,n.config[k].maxWidth=i.value.style.width,s(n.config)),!T){const M=L.screenX+p-S;console.log("ENP Position",M);const ge=f(g,M);if(console.log(k,"->",ge),ge!==k){const ne=n.config[k],Ie=n.config;Ie.splice(k,1),Ie.splice(ge,0,ne),s(Ie)}else{const ne=n.config[k].name;d(ne)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function rt(L){if(T){const ne=m(L)-H+te;C(ne);return}let M=L.screenX+p-S-ee;M<0&&(M=0),M+te>Ne&&(M=Ne-te),h(M)}})});function s(c){e("update:config",c)}function d(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(n.order.length===0||n.order[0]!==c)return void u([c]);const f=n.order.length===1||n.order[1]==="asc"?"asc":"desc";u([c,f==="asc"?"desc":"asc"])}function u(c){e("update:order",c)}return(c,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(c.config,(h,C)=>(o.openBlock(),o.createBlock(rn,o.mergeProps({key:h},h,{onOrder:I=>d(h.name),onSelect:f[0]||(f[0]=I=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),Rr="",an=U(on,[["__scopeId","data-v-ccffc6bd"]]),sn={class:"widget-list"},cn={class:"widget-list-body position_relative"},ln=50,un=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(t,{emit:e}){const n=t;function r(u,c=!0){if(n.selectedRows)if(!c)s(n.selectedRows.includes(u)?[]:[u]);else{const f=[...n.selectedRows],h=f.indexOf(u);h===-1?f.push(u):f==null||f.splice(h,1),s(f)}}function i(){var u;if(((u=n.selectedRows)==null?void 0:u.length)!==n.array.length)return s([...n.array]);s([])}function s(u){e("update:selectedRows",u)}function d(u){if(!u)return;const c=u.target;c.scrollTop+c.clientHeight+ln>c.scrollHeight&&e("scrollEnd")}return(u,c)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:d},[o.createElementVNode("table",sn,[o.createElementVNode("thead",null,[o.createVNode(an,{onSelect:c[0]||(c[0]=f=>i()),"onUpdate:order":c[1]||(c[1]=f=>e("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>e("update:config",f)),config:u.config,order:u.order},null,8,["config","order"])]),o.createElementVNode("tbody",cn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(f,h)=>{var C;return o.openBlock(),o.createBlock(Zt,{key:h,class:"widget-list-row",values:f,config:u.config,selected:(C=u.selectedRows)==null?void 0:C.includes(f),onSelect:I=>r(f,I)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),B={};function dn(t){for(let e in t)B[e]=t[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function fn(t){function e(...r){return n.wait?Promise.reject("The process has already started."):(n.wait=!0,Promise.resolve().then(()=>t(...r)).finally(()=>{n.wait=!1}))}const n=o.reactive({wait:!1,call:e});return n}function le(t){return typeof t=="string"?ue(t):hn(t)?ue(t.message,t.children||t.details||[]):pn(t)?ue(t.title,[t.detail||""]):ue(w.DEFAULT_ERROR_MESSAGE)}function hn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"message"))}function pn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"title"))}function ue(t,e=[]){return{message:t,children:e}}function P(t="error"){return function(e){const{message:n,children:r}=le(e);Z.add(t,n,{children:r})}}function de(t,e={}){return A().emit("entity:read",{...e,entity:t})}function Se(t,e){return A().emit("entity:update",{...e,entity:t})}function gn(t){return t.reduce((e,n)=>(n.name&&(typeof n.name=="string"?e.push(n.name):e.push(...n.name)),e),[])}function He(t,e=2){if(!(typeof t=="string"||typeof t=="number"))return"";let r=String(t).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 mn(t,e){const n=new Map;return t.forEach(r=>{var s;const i=e(r);n.has(i)||n.set(i,[]),(s=n.get(i))==null||s.push(r)}),n}function yn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function En(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return w.DEFAULT_ERROR_MESSAGE}})}function O(t,e={}){return D.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=D.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw new Error(w.DEFAULT_ERROR_MESSAGE)}).then(n=>En(n).then(r=>{if(!n.ok)throw r;return r}))}function wn(t,e=1e3){let n=0;return(...r)=>{clearTimeout(n),n=setTimeout(()=>t(...r),e)}}function _n(t,e){let n=!1;return(...r)=>{if(!n)return n=!0,setTimeout(()=>n=!1,e),t(...r)}}const Cn=ye(Ce("pretty-value-field-by-entity"));function Tn(t,e,n){try{const r=pe.get(t);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${t} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(r){return Cn('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,t,e,n),n}}const An=1,Sn=5e3,bn="static-folder",Je="request-error",z=ye(Ce("use-socket"));function A(){return Nn}function kn(t){return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Blob]"}const Nn=function(){let t=1,e,n;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()},Sn*2);const a=new Uint8Array(1);a[0]=An,e.send(a)}setInterval(()=>{Array.from(r).forEach(a=>{v(a)&&(z("Handler for event %s requestId %d was expired",a.event,a.requestId),a.requestId?c({requestId:a.requestId,event:Je,data:{message:q.RequestTookToLong().message}}):r.delete(a))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&f()},w.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:s,requestId:t,handlers:r,socketInstance:e}}function c(a){const p=[...r.values()];z("Handlers array length is %d. Response event: %s. Request id: %d",r.size,a.event,a.requestId),p.forEach(g=>{const T=a.requestId;(g.requestId&&g.requestId===T||!g.requestId&&g.event===a.event)&&(z("Find appropriated handler: %d, event: %s",t,g.event),g.callback(a.data,a),g.once&&(r.delete(g),z("Handler was removed by *once* params was passed. %o",g)))})}function f(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),e=new WebSocket(n),e.onclose=function(a){z("Connection to server was stopped: %d %s",a.code,a.reason),Array.from(r).forEach(p=>{p.guaranteedAnswer&&p.serializeString&&s.add(p.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(a=>{h(a),s.delete(a)})},e.onerror=function(a){console.warn(a)},e.onmessage=a=>{var p;try{if(kn(a.data)){d();return}const g=JSON.parse(a.data);if(!Ke(g)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(g);return}(p=g==null?void 0:g.data)!=null&&p.refresh&&location.reload(),c(g)}catch(g){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(g)}}}function h(a){e.send(a)}function C(a,p){m({event:a,callback:p})}function I(a,p){m({event:a,callback:p,once:!0})}function E(){return e&&(e==null?void 0:e.readyState)===1}function _(a,p,g){const T=++t,S=JSON.stringify({requestId:T,event:a,data:p,contextId:D.contextId,url:window.location.href});return E()?h(S):(s.add(S),z("Socket is not connected. Message was send to save-queue")),new Promise((H,k)=>{m({event:a,requestId:T,once:!0,guaranteedAnswer:!0,serializeString:S,callback:(x,ee)=>{if(z("Promise was resolve with next data:",x),In(ee))return void k(x);g&&g(x,ee),H(x)},timeToLive:w.TIME_TO_LIVE_SOCKET_REQUEST})})}function m(a){const p={timeToLive:0,...a,created:new Date().getTime()};r.add(p)}function v(a){return a.timeToLive===0||typeof a.timeToLive!="number"?!1:new Date().getTime()-a.created>a.timeToLive}return{get socket(){return e},on:C,once:I,emit:_,initialization(a){n=a},getDevInfo:u}}(),In=t=>!!Ke(t)&&t.event===Je,Ke=t=>typeof t=="object"&&t!==null&&"event"in t&&typeof t.event=="string"&&"requestId"in t&&typeof t.requestId=="number"&&"data"in t;function Rn(t,e){return A().emit("list-setting:read",{entity:t,mark:e})}function On(t,e){return A().emit("metadata-field:treat",{entity:t,fieldName:e})}function Xe(t,e){return A().emit("entity:create",{...e,entity:t})}function Ze(t,e){return A().emit("entity:delete",{...e,entity:t})}function vn(t,e){return A().emit("usage-context:read",{...e,entity:t})}function Qe(t={}){return A().emit("tool:read",t)}function Ln(t,e={},n={}){const r=o.inject(w.PROVIDE_NAME_ACTIONS,null),i=typeof t=="string"?t:e,s=typeof e=="string"?n:e;return o.computed(()=>{var c;const u=((typeof t=="string"?(c=r==null?void 0:r.actions)==null?void 0:c.value:o.unref(t))||[]).find(f=>f.name===i);return u?{...u,...s}:null})}function $n(t){return A().emit("history:read",t)}function Pn(t,e){return A().emit("entity:count",{...e,entity:t})}function Dn(t){return`/${bn}/${t}`}function be(t){return{exec(e,n){switch(t.name){case"replace-boolean":return be.replaceBoolean(t,e,n||{})}}}}be.replaceBoolean=(t,e,n)=>Bn(e,t.values);function Bn(t,e){return t?e[1]:e[0]}function Vn(){const t=o.ref(null);function e(n){t.value=n}return{activeRow:t,activateRow:e}}function Mn(t,e,n={}){const r=o.reactive([]);let i=0;const s=o.ref(!1);function d(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function u(){if(s.value)return Promise.reject("The process has already started.");const a=m();return s.value=!0,typeof a.limit!="number"&&(a.limit=100),a.offset=i,(n.request||de)(t,a).then(g=>(i+=g.length,g)).finally(()=>{s.value=!1})}function c(a,p){var T;return typeof a.Version=="number"?a.Version:(T=r.find(S=>S.Id===p))==null?void 0:T.Version}function f(a,p){const g=r.findIndex(T=>T.Id===a);if(g===-1)throw new Error(`Can't found item with Id ${a}`);r.splice(g,1,p)}function h(a){const p=r.findIndex(g=>g.Id===a);if(p===-1)throw new Error(`Can't found item with Id ${a}`);r.splice(p,1)}async function C(a,p){try{const g=m(),T=c(p,a);delete p.Version,await Se(t,{id:a,values:p,version:T,masterEntities:d()});const S=await de(t,{fields:g.fields||"",id:a});f(a,S)}catch(g){P()(g)}}async function I(a,p={}){try{const g=m(),T=c(p,a);delete p.Version,await Ze(t,{id:a,version:T,masterEntities:d()}),h(a)}catch(g){P()(g)}}async function E(a){try{await Xe(t,{values:a,masterEntities:d()}),await v()}catch(p){P()(p)}}async function _(){try{const a=await u();r.push(...a)}catch(a){P()(a)}}function m(){return typeof e=="function"?e():e}async function v(){try{i=0;const a=await u();r.splice(0,r.length,...a)}catch(a){P()(a)}}return{array:r,updateById:C,next:_,reload:v,wait:s,create:E,deleteById:I}}function Fn(){function t(){return{organizations:D.organizations,currentContextId:D.contextId,person:D.person,context:D.context,contextType:D.contextType,userId:D.userId}}const e=o.reactive(t());return D.onupdateContext(()=>{Object.assign(e,t())}),e}function Un(t,e,n){return A().emit("communication:create",{entityName:t,entityCatalogId:e,targetCode:n})}function Wn(t,e,n){return A().emit("communication:read",{entityName:t,entityCatalogId:e,targetCode:n})}function qn(t,e){return A().emit("communication-message:create",{communicationId:t,text:e})}function jn(t){return A().emit("communication-message:read",{communicationId:t})}function zn(t){const e=N.Form.getParentForm(),n=o.reactive([]);return e&&e.subscribe(t),t.read=()=>jn(t.id).then(r=>(n.splice(0,n.length,...r),r)),{array:n}}function xn(t,e){t.read=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw q.EntityWithoutName(t);return de(t.name,r)}).then(ke).then(i=>(i.hasOwnProperty("Version")&&(t.version=i.Version),t.setValues(i),i)).catch(P())},t.save=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw q.EntityWithoutName(t);return Se(t.name,{id:r.id,values:t.changes,version:t.version})}).then(i=>{t.version=i.version}).catch(i=>{throw P()(i),i})};function n(){return typeof e=="function"?e():e}}function Gn(t){if(!t)return o.inject(w.PROVIDE_NAME_METADATA);pe.initEntity(t);const e=o.computed(()=>pe.state[t]);return o.provide(w.PROVIDE_NAME_METADATA,e),e}function Yn(t,e={}){if(!t)return o.inject(w.PROVIDE_NAME_USAGE_CONTEXT);const n=o.ref(null);return o.provide(w.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await vn(t,Hn(e||{}))}}}function Hn(t){return typeof t=="function"?t():t}function Jn(t={}){return A().emit("tool:execute",t)}function Kn(t){if(!t)return o.inject(w.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),n=o.computed(()=>e.map(s=>Xn(t,s))),r={actions:n,update:i};o.provide(w.PROVIDE_NAME_ACTIONS,r),t.router=Re.useRouter(),t.handleConfirmation||(t.handleConfirmation=Qn),t.handleAffectedEntity||(t.handleAffectedEntity=tr),t.handleCloseForm||(t.handleCloseForm=nr),t.handleValidationResult||(t.handleValidationResult=er);function i(s={}){return e.splice(0,e.length),Qe(s).then(d=>e.splice(0,0,...d)).catch(P("error"))}return{actions:n,update:i}}function Xn(t,e){return{...e,label:e.title,callback(){var i;const n=typeof t.values=="function"?t.values(e,t):t.values,r=()=>Jn({name:e.name,values:n}).then(async s=>{var d,u;if(!rr(s))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(t.handlers))for await(const c of t.handlers)await c(e,s,t);if(!s.success)throw t.handleValidationResult&&s.validationEffect&&((u=(d=s.validationEffect)==null?void 0:d.results)!=null&&u.length)&&t.handleValidationResult(e,s.validationEffect,t),new Error(s.message);return s.message&&Z.add("info",s.message),Array.isArray(s.affectedEntities)&&t.handleAffectedEntity&&s.affectedEntities.forEach(c=>{var f;return(f=t.handleAffectedEntity)==null?void 0:f.call(t,e,c,t)}),e.closeHostForm&&t.handleCloseForm&&t.handleCloseForm(e,t),s}).catch(P("error"));return(i=t.overrides)!=null&&i[e.name]?t.overrides[e.name](e,t):e.requireSave&&t.form&&t.form.changed?t.form.save().then(r):!e.confirmation||!t.handleConfirmation?r():t.handleConfirmation(e,r)}}}function Zn(t){const e="Are you sure?";return t===!0||typeof t=="string"&&t.toLowerCase()==="true"||t==="1"?e:typeof t=="string"?t:e}async function Qn(t,e){const n=Zn(t.confirmation);if(!re.getComponentFromStore(w.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await re.promptModal(w.MODAL_CONFIRM,{message:n}))return e()}function er(t,e){const n=w.MODAL_VALIDATION_EFFECT;if(!re.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{re.pushModal(n,e)})}function tr(t,e,n){var d;const{router:r,form:i}=n,s=(d=e.primaryKey)==null?void 0:d.Id;if(r&&e&&e.name===t.redirectEntity)return r.push({name:e.name,params:{id:s}});i&&e.name===i.name&&e.updated&&s===i.id&&i.read()}function nr(t,e){const{router:n}=e;n&&t.closeHostForm&&n.back()}function rr(t){return!!(t&&typeof t=="object"&&"affectedEntities"in t&&"success"in t)}function or(t){function e(n){n.key==="Enter"&&t()}o.onMounted(()=>{document.addEventListener("keypress",e)}),o.onUnmounted(()=>{document.removeEventListener("keypress",e)})}function ir(t,e={}){const n=o.reactive([]),r=c=>{const f=o.unref(t);if(c===void 0){n.length===0?f.forEach(s):f.forEach(d);return}i(c)?d(c):s(c)},i=c=>n.includes(c),s=c=>{e.handleSelect&&!e.handleSelect(c)||i(c)||n.push(c)},d=c=>{const f=n.findIndex(h=>h===c);f!==-1&&n.splice(f,1)},u=o.computed(()=>{const c=o.unref(t);return n.length===c.length&&c.length!==0});return[n,r,u,s,d]}function ar(t){const e=o.ref(""),n=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(t).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:n}}const Z=new class{constructor(){this.store=o.reactive([])}add(e,n,r={}){const i=sr(r),s=new cr(e,n,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 n=this.store.findIndex(r=>r.id===e);if(n===-1)return!1;this.store.splice(n,1)}};function sr(t){function e(r){return!!r&&typeof r=="object"}const n={timeout:10,click:()=>null,children:[]};return e(t)?{timeout:t.timeout||n.timeout,click:t.click||n.click,children:t.children||n.children}:n}const et=class at{constructor(e,n,r,i,s){this.type=e,this.message=n,this.timeout=r,this.children=i,this.click=s,this.id=at.cardId++}};et.cardId=1;let cr=et;class lr extends F{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return qn(this.id,e)}static checkAndGenerate(e,n,r){return Wn(e,n,r).then(i=>i.length===0?Un(e,n,r):i[0])}}function ur(){return A().emit("client:read",{})}var tt=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},dr=(t,e,n)=>(tt(t,e,"read from private field"),n?n.call(t):e.get(t)),fr=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},hr=(t,e,n,r)=>(tt(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),fe;const he=class J extends F{constructor(){super(...arguments),this.type="front",this.organizations=[],fr(this,fe,!1)}set language(e){localStorage.setItem(w.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(w.LOCALSTORAGE_LANGUAGE_KEY)||J.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){hr(this,fe,e),this.emit(J.EVENT_READY_UPDATE,e)}get ready(){return dr(this,fe)}onReady(e){return this.on(J.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(J.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(w.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(J.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(n=>n.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){P()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(w.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return ur()}validateContextId(e){var n;try{return((n=this.person)==null?void 0:n.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};fe=new WeakMap,he.DEFAULT_LANGUAGE="en",he.EVENT_CONTEXT_UPDATE="event:context-update",he.EVENT_READY_UPDATE="event:ready-update";let pr=he;function gr(t){return A().emit("metadata:read",{entity:t})}const pe=function(){const e=o.reactive({}),n=new Map;function r(u){return e[u]}async function i(u){if(n.has(u)&&await n.get(u),e[u])return;const c=await s(u);d(u,c)}function s(u){const c=gr(u).finally(()=>{n.delete(u)});return n.set(u,c),c}function d(u,c){e[u]=c}return{state:e,initEntity:i,get:r}}();class V{static login(e){return O(B.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:B.applicationName})})}static parseProcessAnswer(e){if(e.statusCode>4)throw new Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return V.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return V.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return V.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return V.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,n){return O(`${B.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(e){return V.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return V.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return V.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,n){return O(`${B.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(V.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startPasswordReset(e,n){return O(`${B.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:n,AppName:e})})}static confirmPhoneNumberByAccessRecovery(e,n,r,i){return O(`${B.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static confirmEmailByAccessRecovery(e,n,r,i){return O(`${B.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static finishAccessRecovery(e,n,r){return O(`${B.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Password:r,ConfirmedPassword:r})})}}class mr{static readHistoryById(e,n){return O(`/close-api/audits/history/${e}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class yr{static readLicences(e){const n=`/close-api/proxy/Dashboard/Licenses?organizationId=${e.toString()}`;return O(n).then(r=>{const i={};return r.byOrganization.licenses.forEach(s=>{const d=s.licenseTypeCode;i[d]||(i[d]={licenseTypeCode:d}),i[d][s.statisticName]=s.value}),Object.values(i)})}}class Er{static getConfiguration(){return O("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(e){return await O(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}function wr(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function b(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];if(Array.isArray(r)){const i=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${n} in (${i})`),e}if(wr(r)){let i=function(s){var d;return((d=s.match(/([^Z]*)/))==null?void 0:d[0])+"0000Z"};return r.start&&e.push(`@${n} ge ${i(r.start)}`),r.end&&e.push(`@${n} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${n} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${n} eq '${r}'`),e):(r===null&&e.push(b.is(n,r)),e)},[]).join(" and ")}function Q(t){return typeof t=="string"?`'${t}'`:`${t}`}b.includes=function(e,n){return`@${e} Contains ${Q(n)}`},b.beginWith=function(e,n){return`@${e} BeginWith ${Q(n)}`},b.notEq=function(e,n){return`@${e} nq ${Q(n)}`},b.eq=function(e,n){return Array.isArray(n)?b.in(e,n):`@${e} eq ${Q(n)}`},b.in=function(e,n){const r=n.map(Q).join(", ");return`@${e} in (${r})`},b.notIn=function(e,n){return!Array.isArray(n)||n.length===0?"":b.and(...n.map(r=>b.notEq(e,r)))},b.and=function(...e){return e.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(b.wrap).join(" and ")},b.wrap=function(e){return`(${e})`},b.is=function(e,n){return`@${e} is ${n}`},b.or=function(...e){return e.join(" or ")};function ke(t){return Object.keys(t).reduce((e,n)=>{let r=t[n];const i=n.charAt(0).toUpperCase()+n.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=ke(r)),e[i]=r,e},{})}const D=new pr;l.Communication=lr,l.CoreError=q,l.Filter=b,l.Manager=D,l.MetadataStore=pe,l.NotificationSystem=Z,l.WidgetButton=Ft,l.WidgetIcon=X,l.WidgetImage=Kt,l.WidgetList=un,l.WidgetLoader=Ht,l.WidgetMultiButton=xt,l.WidgetSpinner=ce,l.WidgetTable=Dt,l.asyncProcess=fn,l.authService=V,l.billingService=Y,l.catchUniversal=P,l.clientService=Fe,l.config=dn,l.configuration=B,l.constants=w,l.dashboardService=yr,l.debounce=wn,l.documentsService=yt,l.fileService=gt,l.getCellName=qe,l.getCellValue=_e,l.getNamesFromListConfig=gn,l.getUnitValue=Ae,l.groupArrayByField=mn,l.historyService=mr,l.injectAction=Ln,l.internationalizationService=pt,l.invitationService=mt,l.openService=Er,l.parseError=le,l.prettyDate=Te,l.prettyDateWithTime=je,l.prettyMoney=He,l.prettyValueFieldByEntity=Tn,l.processWizardService=se,l.request=O,l.staticLink=Dn,l.t=G,l.throttle=_n,l.universalEntityCount=Pn,l.universalEntityCreate=Xe,l.universalEntityDelete=Ze,l.universalEntityRead=de,l.universalEntityUpdate=Se,l.universalHistoryRead=$n,l.universalListSettingRead=Rn,l.universalMetadataFieldTreat=On,l.universalToolRead=Qe,l.useActions=Kn,l.useCommunication=zn,l.useEnter=or,l.useFormEntity=xn,l.useListActiveRow=Vn,l.useListEntity=Mn,l.useListSearch=ar,l.useListSelect=ir,l.useManagerState=Fn,l.useMetadata=Gn,l.useSocket=A,l.useUsageContext=Yn,l.useWizard=Ct,l.uuidv4=yn,l.valuesToUpperCase=ke,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
|
10
|
+
*/const $e=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},Pe=function(t,e){t in this.events&&this.events[t].forEach(n=>n(e))},De=function(t,e){const n=this.events[t];if(!n)return;const r=n.indexOf(e);r!==-1&&n.splice(r,1)},Be=function(){this.events={}};class F{constructor(){this.events={}}on(e,n){return $e.call(this,e,n)}emit(e,n){return Pe.call(this,e,n)}off(e,n){return De.call(this,e,n)}cleanEvents(){Be.call(this)}static on(e,n){return $e.call(F,e,n)}static emit(e,n){return Pe.call(F,e,n)}static off(e,n){return De.call(F,e,n)}static cleanEvents(){Be.call(F)}}F.events={};var Ve=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},oe=(t,e,n)=>(Ve(t,e,"read from private field"),n?n.call(t):e.get(t)),we=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},_e=(t,e,n,r)=>(Ve(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),K,ie,ae;const j=class $ extends F{constructor(){super(...arguments),we(this,K,void 0),we(this,ie,"front"),this.organizations=[],we(this,ae,!1)}set language(e){localStorage.setItem($.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem($.LOCALSTORAGE_LANGUAGE_KEY)||$.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem($.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){_e(this,K,e)}get router(){if(!oe(this,K))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return oe(this,K)}set type(e){_e(this,ie,e)}get type(){return oe(this,ie)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){_e(this,ae,e),this.emit($.EVENT_READY_UPDATE,e)}get ready(){return oe(this,ae)}onReady(e){return this.on($.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on($.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on($.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem($.CURRENT_CONTEXT_KEY,String(e)),this.emit($.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(n=>n.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 n=Number.parseInt(localStorage.getItem($.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(n)&&this.validateContextId(Number(n))?this.setCurrentContext(n):this.setCurrentContext(Number(e.id))}catch{lt.add("error",q.ApiNotAvailable().message)}}loadCustomerData(){return Fe.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var n;return((n=this.person)==null?void 0:n.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 n=localStorage.getItem(this.getListKeyById(e));return n&&JSON.parse(n)}setListInformationToLocalStorage(e,n){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(n))}};K=new WeakMap,ie=new WeakMap,ae=new WeakMap,j.DEFAULT_LANGUAGE="en",j.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",j.EVENT_CONTEXT_UPDATE="event:context-update",j.EVENT_READY_UPDATE="event:ready-update",j.EVENT_DATA_UPDATE="event:data-update",j.CURRENT_CONTEXT_KEY="CurrentContext";let dt=j;const Me=new dt;function ft(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return ct}})}function R(t,e={}){return Me.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=Me.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw q.ApiNotAvailable()}).then(n=>ft(n).then(r=>{if(!n.ok)throw r;return r}))}class ht{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,n,r)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[n]=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")}}new ht;class Fe{static getClientData(){return R("/close-api/client-content")}static getNavigation(){return R("/close-api/client/navigation")}}class pt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return R(`/open-api/internationalization/language/${e}`)}}function Ue(t){return{...t,createdEntities:t.createdEntites}}const We=class ye{static async getStartConfig(e,n){return R([ye.url,e,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,n){return R([ye.url,e,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(Ue)}static async runStep(e,n,r,i,s){return R([ye.url,e,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(Ue)}};We.url="/close-api/views/process-wizard";let se=We;class gt{static async upload(e,n){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${n}`;return await fetch(i,{method:"POST",body:r}).then(s=>s.json()).then(s=>(s.filename=e.name,s))}}class mt{static invite(e,n,r){return R("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:n,relatedRoleCode:r})})}static accept(e,n){return R("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!0})})}static decline(e,n){return R("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!1})})}}class yt{static getRequiredDocuments(e,n,r){const i=new URLSearchParams({entity:e,primaryKey:n,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(s=>s.json())}}class Y{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Y.url()}/calculator/${e}`)}static calculate(e,n){return R(`/${Y.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:n})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):q.ApiNotAvailable()})}static parseMetadataField(e){function n(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:n(e)}}static createOnlinePayment(e,n){return R(`/${Y.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:n})})}static applyOnlinePayment(e){return R(`/${Y.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}function Et(t){return t.statusName==="Completed"}function wt(t){return t.statusName==="FinalStepWithConfirmation"}function _t(t){return t.statusName==="ValidationError"}function Ct(t,e,n){let r=null;const i=o.reactive({wait:null});let s=[],d=null;const u=o.ref(null);function c(){u.value=s.find(a=>a.name===d)||null}function f(){var a;return d?((a=s.find(p=>p.name===d))==null?void 0:a.fields)||[]:[]}function h(a){if(c(),_t(a))return void n.onValidation(a.validationResults);if((a.statusName==="FinalStep"||a.statusName==="NextStep")&&(!f().length||Tt(f(),n.presets)))return v(n.presets||{});Et(a)&&n.onCompleted(a),wt(a)&&n.onConfirmation(a)}async function C(){try{await I(),await m()}catch(a){const{message:p}=le(a);Z.add("error",p)}}function I(){return i.wait="Loading process information.",se.getStartConfig(e,t).then(a=>{s=a.steps.map(p=>({label:p.title,name:p.stepName,number:p.number,fields:p.frontendEntity.objectTypes.reduce((g,T)=>(T.properties.forEach(S=>{g.push({name:S.name,label:S.title,type:S.refEntityName||S.dataType})}),g),[])}))}).then(a=>(i.wait=!1,a))}function E(a){return d=a.nextStepName,r=a.token,a}function _(a){const p=le(a);Z.add("error",p.message)}function m(){return i.wait="Starting process",se.startProcess(e,t).then(E).then(h).catch(_).finally(()=>{i.wait=null})}function v(a={}){return!r||!d?Promise.reject("Not step or token."):(i.wait="Waiting for result...",se.runStep(e,t,d,r,a).then(E).then(h).catch(_).finally(()=>{i.wait=!1}))}return{initialize:C,state:i,currentStepConfig:o.readonly(u),next:v}}function Tt(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(!N.utils.getPropFromObject(e,r.name))return!1}return!0}const At={class:"widget-table__head"},St={class:"widget-table__head-label margin_0 text_overflow"},bt=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("tr",At,[(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",St,o.toDisplayString(r.label),1)]))),128))]))}}),Cr="",U=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},kt=U(bt,[["__scopeId","data-v-25198f4a"]]);function qe(t){return typeof t.name=="string"?t.name:Array.isArray(t.name)?t.name[0]:null}function Nt(t){const e=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let r;for(;(r=e.exec(t))!==null;)n.push(r[1]);return n}function It(t,e){return Nt(t).forEach(r=>{t=t.replace(new RegExp("\\$\\{"+r+"}","g"),N.utils.getPropFromObject(e,r))}),t}function Ce(t,e){if(typeof t.value=="string")return It(t.value,e);const n=qe(t);let r=n?N.utils.getPropFromObject(e,n):null;return r===void 0&&(r=null),t.value?t.value(r,e):t.value===null?null:r}const w={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",TIME_TO_LIVE_SOCKET_REQUEST:3e4,CORE_DEBUG_LABEL:"eservices-core"};function Te(t){return[w.CORE_DEBUG_LABEL,t].join(":")}function je(t){return Ae(t,"YYYY/MM/DD HH:mm:ss")}function Ae(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return st.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const Tr="",X=U({props:{name:String},setup(t,e){let n="unknown";try{n=e.slots.default()[0].children}catch{n=t.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${n}`})}},[["__scopeId","data-v-e287c8d9"]]);function Se(t){return e=>typeof e=="string"||typeof e=="number"?`${e} ${t}`:""}const Rt=Ee(Te("setup-list-row"));function Ot(t,e){const n=t.config.map(r=>vt(r,t,e));return o.h("tr",{class:"widget-table__row widget-table-row"},n)}function vt(t,e,n){const r=e.values;let i=Ce(t,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function d(h){s.onClick.push(()=>h(r))}function u(h){Array.isArray(h)?s.class.push(...h):s.class.push(h)}const c=[],f=[];if(t.unitValue&&(i=Se(t.unitValue)(i)),t.unit&&(i=Se(t.unit)(i)),t.hide&&t.hide(r))return[o.h("td")];if(t.type)switch(u(`widget-table-cell_${t.type}`),t.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Ae(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=je(typeof i=="string"?i:null);break}case"money":{i=He(i);break}case"multi-select":{f.push(o.h(N.FormField,{type:"single-checkbox",modelValue:e.selected})),d(ze.bind(null,n,!0));break}case"select":{f.push(o.h(N.FormField,{type:"single-radio",modelValue:e.selected})),d(ze.bind(null,n,!1));break}}if(t.onClick&&d(t.onClick),t.link)try{const h=t.link(r);if(h){const C=o.h(Re.RouterLink,{to:h});f.push(C),u("widget-table-cell_link")}}catch(h){Rt("Can't add router link",h)}if(t.href&&(f.push(o.h("a",{href:t.href(r),target:"_blank"})),u("widget-table-cell_link")),t.formatter&&(i=fe(t.formatter).exec(i,r)),typeof i=="boolean"&&(i=i?"✓":"—"),(typeof i=="string"||typeof i=="number")&&f.push(o.h("p",{class:"widget-list-cell-text"},i)),t.icon&&(typeof t.icon=="string"&&f.push(o.h(X,{name:t.icon})),typeof t.icon=="function")){const h=t.icon(r);h!==null&&f.push(o.h(X,{name:h}))}return t.class&&(typeof t.class=="function"?u(t.class(r)):u(t.class)),c.push(o.h("td",s,f)),c}function ze(t,e){t.emit("select",e)}function Ge(t,e){return()=>{try{return Ot(t,e)}catch(n){return console.warn(n),null}}}const Lt={props:{values:Object,config:Object,selected:Boolean},setup:Ge},$t=["colspan"],xe=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(t,{emit:e}){const n=o.ref();return o.onMounted(()=>{setTimeout(()=>{n.value&&n.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:n},[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,$t)],512))}}),Pt={class:"widget-table"},Ye="update:selectedRows",Dt=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1}},emits:["update:activeRow","save"],setup(t,{emit:e}){const n=t,r=o.useSlots(),i=o.computed(()=>{var c;return(c=r==null?void 0:r.default)==null?void 0:c.call(r)[0]});function s(c,f=!0){if(!n.selectedRows)return;if(!f)return e(Ye,n.selectedRows.includes(c)?[]:[c]);const h=[...n.selectedRows],C=h.indexOf(c);return C===-1?h.push(c):h.splice(C,1),e(Ye,h)}function d(c){e("save",c),e("update:activeRow",null)}const u=o.computed(()=>n.shortcut?n.config.filter(c=>c.name?!!n.array.find(h=>![null,""].includes(Ce(c,h))):!0):n.config);return(c,f)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",Pt,[o.createVNode(kt,{config:u.value},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.array,(h,C)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:C},[o.createVNode(Lt,{config:u.value,values:h,selected:c.selectedRows.includes(h),onSelect:I=>s(h,I),class:o.normalizeClass(c.classCallback?c.classCallback(h):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&c.activeRow===h?(o.openBlock(),o.createBlock(xe,{key:0,component:i.value,"row-length":c.config.length,values:h,onClose:f[0]||(f[0]=I=>e("update:activeRow",null)),onSave:d,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),c.activeRow===o.unref(w).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(xe,{key:0,component:i.value,"row-length":u.value.length,onClose:f[1]||(f[1]=h=>e("update:activeRow",null)),onSave:d,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),Bt=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}}),Sr="",ce=U(Bt,[["__scopeId","data-v-0ef9ae88"]]),Vt={class:"widget-button"},Mt=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("button",Vt,[e.wait?(o.openBlock(),o.createBlock(ce,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),br="",Ft=U(Mt,[["__scopeId","data-v-450dc564"]]),Ut={class:"widget-multi-button-wrap position_relative cursor_pointer"},Wt={class:"widget-multi-button-body grid"},qt=["onClick"],jt={class:"widget-multi-button-side-wrap"},zt=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(t){const e=t;o.useCssVars(d=>({"7025434e":r.value}));const n=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(d){if(!(typeof d!="function"||n.wait))return n.wait=!0,Promise.resolve().then(d).finally(()=>{n.wait=!1})}function s(d=!n.active){n.active=d}return(d,u)=>(o.openBlock(),o.createElementBlock("div",Ut,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[o.createElementVNode("div",Wt,[d.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:u[0]||(u[0]=c=>s())},o.toDisplayString(d.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.array,(c,f)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:h=>{i(c.callback),s(!1)}},o.toDisplayString(c.label),9,qt))),128))]),o.createElementVNode("div",jt,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:u[1]||(u[1]=c=>s())},[n.wait?(o.openBlock(),o.createBlock(o.unref(ce),{key:0,class:"widget-multi-button-side-spinner"})):d.array.length>1?(o.openBlock(),o.createBlock(o.unref(X),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),kr="",Gt=U(zt,[["__scopeId","data-v-a8d711d1"]]),xt={class:"widget-loader flex flex-align_center gap_10 padding_15"},Yt={class:"text_md"},Ht=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",xt,[o.createVNode(ce,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",Yt,o.toDisplayString(e.label),1)]))}}),Jt=["alt","src"],Kt=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,n=o.ref();return o.onMounted(()=>{n.value&&(n.value.src=e.src),n.value.onerror=function(){e.default&&(n.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:n,src:r.src||r.$props.default},null,8,Jt))}}),Xt={props:{config:Array,values:Object,selected:Boolean},setup:Ge},Nr="",Zt=U(Xt,[["__scopeId","data-v-344a8cc1"]]),Qt=t=>(o.pushScopeId("data-v-bf495d6a"),t=t(),o.popScopeId(),t),en={class:"widget-list-head-cell"},tn=Qt(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),nn=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(t,{emit:e}){const n=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",en,[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(N.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(X),{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),tn])]))}}),Ir="",rn=U(nn,[["__scopeId","data-v-bf495d6a"]]),on=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const n=t,r=o.ref(),i=o.ref();o.onMounted(()=>{function c(E,_){let m=-1;do m++,_-=E[m];while(_>0&&m<E.length);return m}function f(E,_){let m=0;for(;_>0&&_>E[m]&&m<E.length;)_-=E[m],m++;return console.log(_,m),m>0?m:0}function h(E){try{i.value.style.insetInlineStart=E+"px"}catch(_){console.log(_)}}function C(E){try{i.value.style.width=E+"px",i.value.style.minWidth=E+"px",i.value.style.maxWidth=E+"px"}catch(_){console.log(_)}}function I(E){return E===null?!1:E.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(_){var ot;function m(L){return L.screenX+p-S}const v=r.value,a=[...v.children].filter(L=>L.localName==="th"),p=((ot=v.offsetParent)==null?void 0:ot.scrollLeft)||0,g=a.map(L=>L.clientWidth),T=I(_.target),S=v.getBoundingClientRect().left,H=m(_),k=c(g,H),G=g.slice(0,k).reduce((L,M)=>L+M,0),ee=H-G,Ne=v.offsetWidth,te=a[k].clientWidth;if(n.config[k].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",_.screenX),console.log("Widths",g),console.log("max width",Ne),console.log("Start Position",H),console.log("Position From",k),console.log("Start Position",k),console.log("Global offset (Отступ самой таблицы от края экрана)",S),console.log("Del",ee),console.groupEnd(),i.value.innerText=a[k].textContent||"",i.value.style.display="grid",i.value.style.width=te+"px",i.value.style.cursor="grabbing",h(G),C(te),document.addEventListener("pointermove",rt,{passive:!0}),document.addEventListener("pointerup",nt);function nt(L){if(console.group("END"),document.removeEventListener("pointermove",rt),document.removeEventListener("pointerup",nt),T&&(n.config[k].width=i.value.style.width,n.config[k].minWidth=i.value.style.width,n.config[k].maxWidth=i.value.style.width,s(n.config)),!T){const M=L.screenX+p-S;console.log("ENP Position",M);const me=f(g,M);if(console.log(k,"->",me),me!==k){const ne=n.config[k],Ie=n.config;Ie.splice(k,1),Ie.splice(me,0,ne),s(Ie)}else{const ne=n.config[k].name;d(ne)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function rt(L){if(T){const ne=m(L)-H+te;C(ne);return}let M=L.screenX+p-S-ee;M<0&&(M=0),M+te>Ne&&(M=Ne-te),h(M)}})});function s(c){e("update:config",c)}function d(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(n.order.length===0||n.order[0]!==c)return void u([c]);const f=n.order.length===1||n.order[1]==="asc"?"asc":"desc";u([c,f==="asc"?"desc":"asc"])}function u(c){e("update:order",c)}return(c,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(c.config,(h,C)=>(o.openBlock(),o.createBlock(rn,o.mergeProps({key:h},h,{onOrder:I=>d(h.name),onSelect:f[0]||(f[0]=I=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),Rr="",an=U(on,[["__scopeId","data-v-ccffc6bd"]]),sn={class:"widget-list"},cn={class:"widget-list-body position_relative"},ln=50,un=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(t,{emit:e}){const n=t;function r(u,c=!0){if(n.selectedRows)if(!c)s(n.selectedRows.includes(u)?[]:[u]);else{const f=[...n.selectedRows],h=f.indexOf(u);h===-1?f.push(u):f==null||f.splice(h,1),s(f)}}function i(){var u;if(((u=n.selectedRows)==null?void 0:u.length)!==n.array.length)return s([...n.array]);s([])}function s(u){e("update:selectedRows",u)}function d(u){if(!u)return;const c=u.target;c.scrollTop+c.clientHeight+ln>c.scrollHeight&&e("scrollEnd")}return(u,c)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:d},[o.createElementVNode("table",sn,[o.createElementVNode("thead",null,[o.createVNode(an,{onSelect:c[0]||(c[0]=f=>i()),"onUpdate:order":c[1]||(c[1]=f=>e("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>e("update:config",f)),config:u.config,order:u.order},null,8,["config","order"])]),o.createElementVNode("tbody",cn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(f,h)=>{var C;return o.openBlock(),o.createBlock(Zt,{key:h,class:"widget-list-row",values:f,config:u.config,selected:(C=u.selectedRows)==null?void 0:C.includes(f),onSelect:I=>r(f,I)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),B={};function dn(t){for(let e in t)B[e]=t[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function fn(t){function e(...r){return n.wait?Promise.reject("The process has already started."):(n.wait=!0,Promise.resolve().then(()=>t(...r)).finally(()=>{n.wait=!1}))}const n=o.reactive({wait:!1,call:e});return n}function le(t){return typeof t=="string"?ue(t):hn(t)?ue(t.message,t.children||t.details||[]):pn(t)?ue(t.title,[t.detail||""]):ue(w.DEFAULT_ERROR_MESSAGE)}function hn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"message"))}function pn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"title"))}function ue(t,e=[]){return{message:t,children:e}}function P(t="error"){return function(e){const{message:n,children:r}=le(e);Z.add(t,n,{children:r})}}function de(t,e={}){return A().emit("entity:read",{...e,entity:t})}function be(t,e){return A().emit("entity:update",{...e,entity:t})}function gn(t){return t.reduce((e,n)=>(n.name&&(typeof n.name=="string"?e.push(n.name):e.push(...n.name)),e),[])}function He(t,e=2){if(!(typeof t=="string"||typeof t=="number"))return"";let r=String(t).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 mn(t,e){const n=new Map;return t.forEach(r=>{var s;const i=e(r);n.has(i)||n.set(i,[]),(s=n.get(i))==null||s.push(r)}),n}function yn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function En(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return w.DEFAULT_ERROR_MESSAGE}})}function O(t,e={}){return D.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=D.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw new Error(w.DEFAULT_ERROR_MESSAGE)}).then(n=>En(n).then(r=>{if(!n.ok)throw r;return r}))}function wn(t,e=1e3){let n=0;return(...r)=>{clearTimeout(n),n=setTimeout(()=>t(...r),e)}}function _n(t,e){let n=!1;return(...r)=>{if(!n)return n=!0,setTimeout(()=>n=!1,e),t(...r)}}const Cn=Ee(Te("pretty-value-field-by-entity"));function Tn(t,e,n){try{const r=ge.get(t);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${t} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(r){return Cn('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,t,e,n),n}}const An=1,Sn=5e3,bn="static-folder",Je="request-error",z=Ee(Te("use-socket"));function A(){return Nn}function kn(t){return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Blob]"}const Nn=function(){let t=1,e,n;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()},Sn*2);const a=new Uint8Array(1);a[0]=An,e.send(a)}setInterval(()=>{Array.from(r).forEach(a=>{v(a)&&(z("Handler for event %s requestId %d was expired",a.event,a.requestId),a.requestId?c({requestId:a.requestId,event:Je,data:{message:q.RequestTookToLong().message}}):r.delete(a))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&f()},w.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:s,requestId:t,handlers:r,socketInstance:e}}function c(a){const p=[...r.values()];z("Handlers array length is %d. Response event: %s. Request id: %d",r.size,a.event,a.requestId),p.forEach(g=>{const T=a.requestId;(g.requestId&&g.requestId===T||!g.requestId&&g.event===a.event)&&(z("Find appropriated handler: %d, event: %s",t,g.event),g.callback(a.data,a),g.once&&(r.delete(g),z("Handler was removed by *once* params was passed. %o",g)))})}function f(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),e=new WebSocket(n),e.onclose=function(a){z("Connection to server was stopped: %d %s",a.code,a.reason),Array.from(r).forEach(p=>{p.guaranteedAnswer&&p.serializeString&&s.add(p.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(a=>{h(a),s.delete(a)})},e.onerror=function(a){console.warn(a)},e.onmessage=a=>{var p;try{if(kn(a.data)){d();return}const g=JSON.parse(a.data);if(!Ke(g)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(g);return}(p=g==null?void 0:g.data)!=null&&p.refresh&&location.reload(),c(g)}catch(g){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(g)}}}function h(a){e.send(a)}function C(a,p){m({event:a,callback:p})}function I(a,p){m({event:a,callback:p,once:!0})}function E(){return e&&(e==null?void 0:e.readyState)===1}function _(a,p,g){const T=++t,S=JSON.stringify({requestId:T,event:a,data:p,contextId:D.contextId,url:window.location.href});return E()?h(S):(s.add(S),z("Socket is not connected. Message was send to save-queue")),new Promise((H,k)=>{m({event:a,requestId:T,once:!0,guaranteedAnswer:!0,serializeString:S,callback:(G,ee)=>{if(z("Promise was resolve with next data:",G),In(ee))return void k(G);g&&g(G,ee),H(G)},timeToLive:w.TIME_TO_LIVE_SOCKET_REQUEST})})}function m(a){const p={timeToLive:0,...a,created:new Date().getTime()};r.add(p)}function v(a){return a.timeToLive===0||typeof a.timeToLive!="number"?!1:new Date().getTime()-a.created>a.timeToLive}return{get socket(){return e},on:C,once:I,emit:_,initialization(a){n=a},getDevInfo:u}}(),In=t=>!!Ke(t)&&t.event===Je,Ke=t=>typeof t=="object"&&t!==null&&"event"in t&&typeof t.event=="string"&&"requestId"in t&&typeof t.requestId=="number"&&"data"in t;function Rn(t,e){return A().emit("list-setting:read",{entity:t,mark:e})}function On(t,e){return A().emit("metadata-field:treat",{entity:t,fieldName:e})}function Xe(t,e){return A().emit("entity:create",{...e,entity:t})}function Ze(t,e){return A().emit("entity:delete",{...e,entity:t})}function vn(t,e){return A().emit("usage-context:read",{...e,entity:t})}function Qe(t={}){return A().emit("tool:read",t)}function Ln(t,e={},n={}){const r=o.inject(w.PROVIDE_NAME_ACTIONS,null),i=typeof t=="string"?t:e,s=typeof e=="string"?n:e;return o.computed(()=>{var c;const u=((typeof t=="string"?(c=r==null?void 0:r.actions)==null?void 0:c.value:o.unref(t))||[]).find(f=>f.name===i);return u?{...u,...s}:null})}function $n(t){return A().emit("history:read",t)}function Pn(t,e){return A().emit("entity:count",{...e,entity:t})}function Dn(t){return`/${bn}/${t}`}function fe(t){return{exec(e,n){switch(t.name){case"replace-boolean":return fe.replaceBoolean(t,e,n||{})}}}}fe.replaceBoolean=(t,e,n)=>Bn(e,t.values);function Bn(t,e){return t?e[1]:e[0]}function Vn(){const t=o.ref(null);function e(n){t.value=n}return{activeRow:t,activateRow:e}}function Mn(t,e,n={}){const r=o.reactive([]);let i=0;const s=o.ref(!1);function d(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function u(){if(s.value)return Promise.reject("The process has already started.");const a=m();return s.value=!0,typeof a.limit!="number"&&(a.limit=100),a.offset=i,(n.request||de)(t,a).then(g=>(i+=g.length,g)).finally(()=>{s.value=!1})}function c(a,p){var T;return typeof a.Version=="number"?a.Version:(T=r.find(S=>S.Id===p))==null?void 0:T.Version}function f(a,p){const g=r.findIndex(T=>T.Id===a);if(g===-1)throw new Error(`Can't found item with Id ${a}`);r.splice(g,1,p)}function h(a){const p=r.findIndex(g=>g.Id===a);if(p===-1)throw new Error(`Can't found item with Id ${a}`);r.splice(p,1)}async function C(a,p){try{const g=m(),T=c(p,a);delete p.Version,await be(t,{id:a,values:p,version:T,masterEntities:d()});const S=await de(t,{fields:g.fields||"",id:a});f(a,S)}catch(g){P()(g)}}async function I(a,p={}){try{const g=m(),T=c(p,a);delete p.Version,await Ze(t,{id:a,version:T,masterEntities:d()}),h(a)}catch(g){P()(g)}}async function E(a){try{await Xe(t,{values:a,masterEntities:d()}),await v()}catch(p){P()(p)}}async function _(){try{const a=await u();r.push(...a)}catch(a){P()(a)}}function m(){return typeof e=="function"?e():e}async function v(){try{i=0;const a=await u();r.splice(0,r.length,...a)}catch(a){P()(a)}}return{array:r,updateById:C,next:_,reload:v,wait:s,create:E,deleteById:I}}function Fn(){function t(){return{organizations:D.organizations,currentContextId:D.contextId,person:D.person,context:D.context,contextType:D.contextType,userId:D.userId}}const e=o.reactive(t());return D.onupdateContext(()=>{Object.assign(e,t())}),e}function Un(t,e,n){return A().emit("communication:create",{entityName:t,entityCatalogId:e,targetCode:n})}function Wn(t,e,n){return A().emit("communication:read",{entityName:t,entityCatalogId:e,targetCode:n})}function qn(t,e){return A().emit("communication-message:create",{communicationId:t,text:e})}function jn(t){return A().emit("communication-message:read",{communicationId:t})}function zn(t){const e=N.Form.getParentForm(),n=o.reactive([]);return e&&e.subscribe(t),t.read=()=>jn(t.id).then(r=>(n.splice(0,n.length,...r),r)),{array:n}}function Gn(t,e){t.read=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw q.EntityWithoutName(t);return de(t.name,r)}).then(ke).then(i=>(i.hasOwnProperty("Version")&&(t.version=i.Version),t.setValues(i),i)).catch(P())},t.save=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw q.EntityWithoutName(t);return be(t.name,{id:r.id,values:t.changes,version:t.version})}).then(i=>{t.version=i.version}).catch(i=>{throw P()(i),i})};function n(){return typeof e=="function"?e():e}}function xn(t){if(!t)return o.inject(w.PROVIDE_NAME_METADATA);ge.initEntity(t);const e=o.computed(()=>ge.state[t]);return o.provide(w.PROVIDE_NAME_METADATA,e),e}function Yn(t,e={}){if(!t)return o.inject(w.PROVIDE_NAME_USAGE_CONTEXT);const n=o.ref(null);return o.provide(w.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await vn(t,Hn(e||{}))}}}function Hn(t){return typeof t=="function"?t():t}function Jn(t={}){return A().emit("tool:execute",t)}function Kn(t){if(!t)return o.inject(w.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),n=o.computed(()=>e.map(s=>Xn(t,s))),r={actions:n,update:i};o.provide(w.PROVIDE_NAME_ACTIONS,r),t.router=Re.useRouter(),t.handleConfirmation||(t.handleConfirmation=Qn),t.handleAffectedEntity||(t.handleAffectedEntity=tr),t.handleCloseForm||(t.handleCloseForm=nr),t.handleValidationResult||(t.handleValidationResult=er);function i(s={}){return e.splice(0,e.length),Qe(s).then(d=>e.splice(0,0,...d)).catch(P("error"))}return{actions:n,update:i}}function Xn(t,e){return{...e,label:e.title,callback(){var i;const n=typeof t.values=="function"?t.values(e,t):t.values,r=()=>Jn({name:e.name,values:n}).then(async s=>{var d,u;if(!rr(s))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(t.handlers))for await(const c of t.handlers)await c(e,s,t);if(!s.success)throw t.handleValidationResult&&s.validationEffect&&((u=(d=s.validationEffect)==null?void 0:d.results)!=null&&u.length)&&t.handleValidationResult(e,s.validationEffect,t),new Error(s.message);return s.message&&Z.add("info",s.message),Array.isArray(s.affectedEntities)&&t.handleAffectedEntity&&s.affectedEntities.forEach(c=>{var f;return(f=t.handleAffectedEntity)==null?void 0:f.call(t,e,c,t)}),e.closeHostForm&&t.handleCloseForm&&t.handleCloseForm(e,t),s}).catch(P("error"));return(i=t.overrides)!=null&&i[e.name]?t.overrides[e.name](e,t):e.requireSave&&t.form&&t.form.changed?t.form.save().then(r):!e.confirmation||!t.handleConfirmation?r():t.handleConfirmation(e,r)}}}function Zn(t){const e="Are you sure?";return t===!0||typeof t=="string"&&t.toLowerCase()==="true"||t==="1"?e:typeof t=="string"?t:e}async function Qn(t,e){const n=Zn(t.confirmation);if(!re.getComponentFromStore(w.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await re.promptModal(w.MODAL_CONFIRM,{message:n}))return e()}function er(t,e){const n=w.MODAL_VALIDATION_EFFECT;if(!re.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{re.pushModal(n,e)})}function tr(t,e,n){var d;const{router:r,form:i}=n,s=(d=e.primaryKey)==null?void 0:d.Id;if(r&&e&&e.name===t.redirectEntity)return r.push({name:e.name,params:{id:s}});i&&e.name===i.name&&e.updated&&s===i.id&&i.read()}function nr(t,e){const{router:n}=e;n&&t.closeHostForm&&n.back()}function rr(t){return!!(t&&typeof t=="object"&&"affectedEntities"in t&&"success"in t)}function or(t){function e(n){n.key==="Enter"&&t()}o.onMounted(()=>{document.addEventListener("keypress",e)}),o.onUnmounted(()=>{document.removeEventListener("keypress",e)})}function ir(t,e={}){const n=o.reactive([]),r=c=>{const f=o.unref(t);if(c===void 0){n.length===0?f.forEach(s):f.forEach(d);return}i(c)?d(c):s(c)},i=c=>n.includes(c),s=c=>{e.handleSelect&&!e.handleSelect(c)||i(c)||n.push(c)},d=c=>{const f=n.findIndex(h=>h===c);f!==-1&&n.splice(f,1)},u=o.computed(()=>{const c=o.unref(t);return n.length===c.length&&c.length!==0});return[n,r,u,s,d]}function ar(t){const e=o.ref(""),n=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(t).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:n}}const Z=new class{constructor(){this.store=o.reactive([])}add(e,n,r={}){const i=sr(r),s=new cr(e,n,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 n=this.store.findIndex(r=>r.id===e);if(n===-1)return!1;this.store.splice(n,1)}};function sr(t){function e(r){return!!r&&typeof r=="object"}const n={timeout:10,click:()=>null,children:[]};return e(t)?{timeout:t.timeout||n.timeout,click:t.click||n.click,children:t.children||n.children}:n}const et=class at{constructor(e,n,r,i,s){this.type=e,this.message=n,this.timeout=r,this.children=i,this.click=s,this.id=at.cardId++}};et.cardId=1;let cr=et;class lr extends F{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return qn(this.id,e)}static checkAndGenerate(e,n,r){return Wn(e,n,r).then(i=>i.length===0?Un(e,n,r):i[0])}}function ur(){return A().emit("client:read",{})}var tt=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},dr=(t,e,n)=>(tt(t,e,"read from private field"),n?n.call(t):e.get(t)),fr=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},hr=(t,e,n,r)=>(tt(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),he;const pe=class J extends F{constructor(){super(...arguments),this.type="front",this.organizations=[],fr(this,he,!1)}set language(e){localStorage.setItem(w.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(w.LOCALSTORAGE_LANGUAGE_KEY)||J.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){hr(this,he,e),this.emit(J.EVENT_READY_UPDATE,e)}get ready(){return dr(this,he)}onReady(e){return this.on(J.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(J.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(w.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(J.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(n=>n.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){P()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(w.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return ur()}validateContextId(e){var n;try{return((n=this.person)==null?void 0:n.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};he=new WeakMap,pe.DEFAULT_LANGUAGE="en",pe.EVENT_CONTEXT_UPDATE="event:context-update",pe.EVENT_READY_UPDATE="event:ready-update";let pr=pe;function gr(t){return A().emit("metadata:read",{entity:t})}const ge=function(){const e=o.reactive({}),n=new Map;function r(u){return e[u]}async function i(u){if(n.has(u)&&await n.get(u),e[u])return;const c=await s(u);d(u,c)}function s(u){const c=gr(u).finally(()=>{n.delete(u)});return n.set(u,c),c}function d(u,c){e[u]=c}return{state:e,initEntity:i,get:r}}();class V{static login(e){return O(B.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:B.applicationName})})}static parseProcessAnswer(e){if(e.statusCode>4)throw new Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return V.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return V.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return V.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return V.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,n){return O(`${B.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(e){return V.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return V.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return V.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,n){return O(`${B.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(V.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startPasswordReset(e,n){return O(`${B.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:n,AppName:e})})}static confirmPhoneNumberByAccessRecovery(e,n,r,i){return O(`${B.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static confirmEmailByAccessRecovery(e,n,r,i){return O(`${B.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static finishAccessRecovery(e,n,r){return O(`${B.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Password:r,ConfirmedPassword:r})})}}class mr{static readHistoryById(e,n){return O(`/close-api/audits/history/${e}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class yr{static readLicences(e){const n=`/close-api/proxy/Dashboard/Licenses?organizationId=${e.toString()}`;return O(n).then(r=>{const i={};return r.byOrganization.licenses.forEach(s=>{const d=s.licenseTypeCode;i[d]||(i[d]={licenseTypeCode:d}),i[d][s.statisticName]=s.value}),Object.values(i)})}}class Er{static getConfiguration(){return O("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(e){return await O(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}function wr(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function b(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];if(Array.isArray(r)){const i=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${n} in (${i})`),e}if(wr(r)){let i=function(s){var d;return((d=s.match(/([^Z]*)/))==null?void 0:d[0])+"0000Z"};return r.start&&e.push(`@${n} ge ${i(r.start)}`),r.end&&e.push(`@${n} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${n} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${n} eq '${r}'`),e):(r===null&&e.push(b.is(n,r)),e)},[]).join(" and ")}function Q(t){return typeof t=="string"?`'${t}'`:`${t}`}b.includes=function(e,n){return`@${e} Contains ${Q(n)}`},b.beginWith=function(e,n){return`@${e} BeginWith ${Q(n)}`},b.notEq=function(e,n){return`@${e} nq ${Q(n)}`},b.eq=function(e,n){return Array.isArray(n)?b.in(e,n):`@${e} eq ${Q(n)}`},b.in=function(e,n){const r=n.map(Q).join(", ");return`@${e} in (${r})`},b.notIn=function(e,n){return!Array.isArray(n)||n.length===0?"":b.and(...n.map(r=>b.notEq(e,r)))},b.and=function(...e){return e.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(b.wrap).join(" and ")},b.wrap=function(e){return`(${e})`},b.is=function(e,n){return`@${e} is ${n}`},b.or=function(...e){return e.join(" or ")};function ke(t){return Object.keys(t).reduce((e,n)=>{let r=t[n];const i=n.charAt(0).toUpperCase()+n.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=ke(r)),e[i]=r,e},{})}const D=new pr;l.Communication=lr,l.CoreError=q,l.Filter=b,l.Manager=D,l.MetadataStore=ge,l.NotificationSystem=Z,l.WidgetButton=Ft,l.WidgetIcon=X,l.WidgetImage=Kt,l.WidgetList=un,l.WidgetLoader=Ht,l.WidgetMultiButton=Gt,l.WidgetSpinner=ce,l.WidgetTable=Dt,l.asyncProcess=fn,l.authService=V,l.billingService=Y,l.catchUniversal=P,l.clientService=Fe,l.config=dn,l.configuration=B,l.constants=w,l.dashboardService=yr,l.debounce=wn,l.documentsService=yt,l.fileService=gt,l.formatter=fe,l.getCellName=qe,l.getCellValue=Ce,l.getNamesFromListConfig=gn,l.getUnitValue=Se,l.groupArrayByField=mn,l.historyService=mr,l.injectAction=Ln,l.internationalizationService=pt,l.invitationService=mt,l.openService=Er,l.parseError=le,l.prettyDate=Ae,l.prettyDateWithTime=je,l.prettyMoney=He,l.prettyValueFieldByEntity=Tn,l.processWizardService=se,l.request=O,l.staticLink=Dn,l.t=x,l.throttle=_n,l.universalEntityCount=Pn,l.universalEntityCreate=Xe,l.universalEntityDelete=Ze,l.universalEntityRead=de,l.universalEntityUpdate=be,l.universalHistoryRead=$n,l.universalListSettingRead=Rn,l.universalMetadataFieldTreat=On,l.universalToolRead=Qe,l.useActions=Kn,l.useCommunication=zn,l.useEnter=or,l.useFormEntity=Gn,l.useListActiveRow=Vn,l.useListEntity=Mn,l.useListSearch=ar,l.useListSelect=ir,l.useManagerState=Fn,l.useMetadata=xn,l.useSocket=A,l.useUsageContext=Yn,l.useWizard=Ct,l.uuidv4=yn,l.valuesToUpperCase=ke,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
|
11
11
|
//# sourceMappingURL=eservices-core.umd.js.map
|
|
@@ -18,11 +18,11 @@ export { CoreError, };
|
|
|
18
18
|
export { useWizard };
|
|
19
19
|
/**ДАЙ МНЕ СИЛЫ СДЕЛАТЬ ТАК, ЧТОБЫ ЭТО СТРОКА БЫЛА ПЕРВОЙ И ВТОРОЙ**/
|
|
20
20
|
import { WidgetButton, WidgetMultiButton, WidgetIcon, WidgetSpinner, WidgetTable, WidgetLoader, WidgetImage, WidgetList } from "./../src/index";
|
|
21
|
-
import { staticLink, universalEntityCount, universalHistoryRead, getUnitValue, injectAction, universalToolRead, getCellName, universalEntityDelete, universalEntityCreate, universalMetadataFieldTreat, universalListSettingRead, prettyValueFieldByEntity, throttle, debounce, request, uuidv4, groupArrayByField, valuesToUpperCase, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, getCellValue, universalEntityRead, universalEntityUpdate, getNamesFromListConfig } from "./../src/index";
|
|
21
|
+
import { formatter, staticLink, universalEntityCount, universalHistoryRead, getUnitValue, injectAction, universalToolRead, getCellName, universalEntityDelete, universalEntityCreate, universalMetadataFieldTreat, universalListSettingRead, prettyValueFieldByEntity, throttle, debounce, request, uuidv4, groupArrayByField, valuesToUpperCase, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, getCellValue, universalEntityRead, universalEntityUpdate, getNamesFromListConfig } from "./../src/index";
|
|
22
22
|
import type { IListSettings, IEntityCountResult, IEntityCountParams, IParsedHistoryResponse, IHistoryReadParams, INotificationConfig, IValidationEffectItem, IAffectedEntity, IActionOptions, IActionReadOptions, ITool, IToolResult, IUsageContext, ILoginValues, IListTreatmentField, IMasterEntity, IExtendedMetadata, INavigationRecord, IListCell, INotificationType, IMultiButtonItem, IEntityId, IEntityVersion, IUniversalEntityReadListOptions, IUniversalEntityReadSingleOptions, IUniversalEntityUpdateOptions, IUniversalEntityReadOptions, IValues, IListOrder, IUniversalEntityCreateOptions, IUniversalEntityCreatingResult, IUniversalEntityUpdatingResult } from "./../src/index";
|
|
23
23
|
import { constants, config, configuration } from "./../src/index";
|
|
24
24
|
import { useListSearch, useListSelect, useEnter, useActions, useUsageContext, useMetadata, useFormEntity, useCommunication, useListActiveRow, useSocket, useListEntity, useManagerState } from "./../src/index";
|
|
25
25
|
import { NotificationSystem, Manager, Communication, MetadataStore } from "./../src/index";
|
|
26
26
|
import { Filter } from "./../src/index";
|
|
27
27
|
import { authService, dashboardService, historyService, openService } from "./../src/index";
|
|
28
|
-
export { authService, dashboardService, historyService, openService, NotificationSystem, Manager, Communication, MetadataStore, constants, config, configuration, WidgetButton, WidgetMultiButton, WidgetIcon, WidgetSpinner, WidgetTable, WidgetLoader, WidgetImage, WidgetList, staticLink, prettyValueFieldByEntity, throttle, debounce, request, groupArrayByField, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, universalListSettingRead, universalEntityDelete, universalMetadataFieldTreat, universalHistoryRead, universalEntityCreate, getNamesFromListConfig, getCellValue, valuesToUpperCase, uuidv4, getCellName, universalToolRead, injectAction, getUnitValue, IListCell, IListOrder, INotificationType, IMultiButtonItem, IEntityId, IEntityVersion, IUniversalEntityReadListOptions, IUniversalEntityReadSingleOptions, IUniversalEntityReadOptions, IUniversalEntityUpdateOptions, IValues, INavigationRecord, IMasterEntity, IExtendedMetadata, IListTreatmentField, IUniversalEntityCreateOptions, IUniversalEntityCreatingResult, IUniversalEntityUpdatingResult, ILoginValues, IUsageContext, IAffectedEntity, IActionOptions, IActionReadOptions, ITool, IToolResult, IValidationEffectItem, INotificationConfig, IParsedHistoryResponse, IHistoryReadParams, IEntityCountResult, IEntityCountParams, IListSettings, useActions, useListActiveRow, useSocket, useListEntity, useManagerState, useFormEntity, useMetadata, useCommunication, useUsageContext, useEnter, useListSelect, useListSearch, universalEntityCount, Filter, };
|
|
28
|
+
export { authService, dashboardService, historyService, openService, NotificationSystem, Manager, Communication, MetadataStore, constants, config, configuration, WidgetButton, WidgetMultiButton, WidgetIcon, WidgetSpinner, WidgetTable, WidgetLoader, WidgetImage, WidgetList, formatter, staticLink, prettyValueFieldByEntity, throttle, debounce, request, groupArrayByField, prettyMoney, prettyDate, prettyDateWithTime, asyncProcess, parseError, catchUniversal, universalEntityRead, universalEntityUpdate, universalListSettingRead, universalEntityDelete, universalMetadataFieldTreat, universalHistoryRead, universalEntityCreate, getNamesFromListConfig, getCellValue, valuesToUpperCase, uuidv4, getCellName, universalToolRead, injectAction, getUnitValue, IListCell, IListOrder, INotificationType, IMultiButtonItem, IEntityId, IEntityVersion, IUniversalEntityReadListOptions, IUniversalEntityReadSingleOptions, IUniversalEntityReadOptions, IUniversalEntityUpdateOptions, IValues, INavigationRecord, IMasterEntity, IExtendedMetadata, IListTreatmentField, IUniversalEntityCreateOptions, IUniversalEntityCreatingResult, IUniversalEntityUpdatingResult, ILoginValues, IUsageContext, IAffectedEntity, IActionOptions, IActionReadOptions, ITool, IToolResult, IValidationEffectItem, INotificationConfig, IParsedHistoryResponse, IHistoryReadParams, IEntityCountResult, IEntityCountParams, IListSettings, useActions, useListActiveRow, useSocket, useListEntity, useManagerState, useFormEntity, useMetadata, useCommunication, useUsageContext, useEnter, useListSelect, useListSearch, universalEntityCount, Filter, };
|