eservices-core 1.3.194 → 1.3.195

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,12 +1,12 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.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}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.es-card-list{box-shadow:#959da533 0 8px 24px;border:1px solid #f1f1f1;border-radius:4px;background-color:#fff}.color-primary{color:var(--primary)}.color-gray{color:#ccc}.es-container-full{height:100%;width:100%}.es-cursor-pointer{cursor:pointer}.es-cursor-default{cursor:default}.es-flex{display:flex}.es-flex-column{display:flex;flex-direction:column}.es-flex-center{display:flex;align-items:center;justify-content:center}.es-flex-grow{flex-grow:1}.es-flex-justify-center{justify-content:center}.es-flex-justify-between{justify-content:space-between}.es-flex-align-center{align-items:center}.es-gap-1{gap:1px}.es-gap-2{gap:2px}.es-gap-3{gap:3px}.es-gap-4{gap:4px}.es-gap-5{gap:5px}.es-gap-6{gap:6px}.es-gap-7{gap:7px}.es-gap-8{gap:8px}.es-gap-9{gap:9px}.es-gap-10{gap:10px}.es-gap-15{gap:15px}.es-gap-20{gap:20px}.es-list-container,.es-overflow-auto{overflow:auto}.es-overflow-hidden{overflow:hidden}.es-padding-2{padding:2px}.es-padding-3{padding:3px}.es-padding-4{padding:4px}.es-padding-5{padding:5px}.es-padding-10{padding:10px}.es-padding-0{padding:0}.es-padding-7{padding:7px}.es-padding-15{padding:15px}.es-padding-20{padding:20px}.es-padding-v-5{padding:5px 0}.es-padding-h-5{padding:0 5px}.es-padding-is-5{padding-inline-start:5px}.es-padding-ie-5{padding-inline-end:5px}.es-position-relative{position:relative}.es-position-absolute{position:absolute}.es-position-absolute-full{position:absolute;left:0;top:0;width:100%;height:100%}.es-position-absolute-center{position:absolute;left:0;right:0;top:0;bottom:0;margin:auto}.es-radius-2{border-radius:2px}.es-radius-3{border-radius:3px}.es-radius-4{border-radius:4px}.es-radius-5{border-radius:5px}.es-radius-6{border-radius:6px}.es-radius-7{border-radius:7px}.es-radius-8{border-radius:8px}.es-radius-9{border-radius:9px}.es-radius-10{border-radius:10px}.es-radius-15{border-radius:15px}.es-radius-20{border-radius:20px}.es-text-xs{font-weight:400;font-size:10px;line-height:13px}.es-text-sm{font-weight:400;font-size:12px;line-height:16px}.es-text-md{font-size:14px;line-height:20px}.es-text-lg{font-size:16px;line-height:24px}.es-text-xl{font-size:18px;line-height:25px}.es-text-center{text-align:center}.es-text-bold{font-weight:700}.es-text-no-wrap{text-wrap:nowrap}.es-weight-600{font-weight:600}.es-zindex-0{z-index:0}.es-zindex-1{z-index:1}.es-zindex-2{z-index:2}.es-zindex-3{z-index:3}.es-zindex-4{z-index:4}.es-zindex-5{z-index:5}.es-grid{display:grid}.es-grid-center{display:grid;place-content:center}.es-margin-0{margin:0}.widget-table__head-cell[data-v-498c4f00]{padding:18px;text-align:start}.widget-table__head-label[data-v-498c4f00]{font-weight:600;font-size:14px;line-height:19px}.widget-filter-text[data-v-800b3803]{box-shadow:0 2px 2px #00000040;background-color:#fff;padding:20px 10px}.widget-filter-enum[data-v-cf143196]{box-shadow:0 2px 2px #00000040;background-color:#fff;padding:3px 0;max-height:400px;max-width:340px;min-width:180px;overflow:hidden auto}.widget-filter-enum-item[data-v-cf143196]{padding:6px 11px;transition:.1s;cursor:pointer}.widget-filter-enum-item[data-v-cf143196]:hover{background-color:#f1f1f1}[dir=rtl] .icon[data-v-8a72b45f]{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-d43a76ce]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-d43a76ce]{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-d43a76ce]{grid-template-rows:calc(var(--button-size) * var(--04895bf1))}.widget-multi-button-body[data-v-d43a76ce]{min-width:80px}.widget-multi-button-body-label[data-v-d43a76ce]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-d43a76ce]:hover{background-color:#223296}.widget-multi-button-side[data-v-d43a76ce]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-d43a76ce]{transform:rotate(180deg)}.widget-multi-button-side[data-v-d43a76ce]: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}.widget-head-cell[data-v-9db5d417]{display:flex;gap:4px}.widget-head-cell-order[data-v-9db5d417]{display:flex;flex-direction:column;justify-content:center;gap:2px}.widget-head-cell-label[data-v-9db5d417]{cursor:pointer}.widget-fast-table-head-cell-td[data-v-9db5d417]{padding:7px}.widget-head-cell-order-icon[data-v-9db5d417]{transition:.1s;height:18px;width:18px}.widget-head-cell-order-icon_desc[data-v-9db5d417]{transform:rotate(180deg)}.widget-filter-item-container[data-v-5b9128bc]{position:relative}.widget-filter-item-arrow[data-v-5b9128bc]{transform:rotate(180deg)}.widget-filter-item-label_active[data-v-5b9128bc]{font-weight:700}.widget-filter-item[data-v-5b9128bc]{display:grid;grid-template-columns:max-content max-content;align-items:center;cursor:pointer;padding:0 10px;color:#fff}.widget-filter-item-label[data-v-5b9128bc]{-webkit-user-select:none;user-select:none;padding:4px 2px 4px 8px}.widget-filter-item-popup[data-v-5b9128bc]{position:absolute;z-index:2;inset-block-start:100%;inset-inline-end:0}.widget-filter-item-arrow[data-v-5b9128bc]{transition:.2s}.widget-table-panel-filter[data-v-f1534314]{justify-content:end;background-color:var(--color-primary)}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- "use strict";var Ze=e=>{throw TypeError(e)};var et=(e,t,n)=>t.has(e)||Ze("Cannot "+n);var tt=(e,t,n)=>(et(e,t,"read from private field"),n?n.call(e):t.get(e)),nt=(e,t,n)=>t.has(e)?Ze("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),xe=(e,t,n,o)=>(et(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);/*!
3
- * eservices-core v1.3.194
2
+ "use strict";var Ze=e=>{throw TypeError(e)};var et=(e,t,n)=>t.has(e)||Ze("Cannot "+n);var tt=(e,t,n)=>(et(e,t,"read from private field"),n?n.call(e):t.get(e)),nt=(e,t,n)=>t.has(e)?Ze("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Be=(e,t,n,o)=>(et(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);/*!
3
+ * eservices-core v1.3.195
4
4
  * (c) 2024 ESERVICES
5
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),B=require("jenesius-vue-form"),Me=require("vue-router"),Qt=require("date-and-time"),Ne=require("debug"),ne=require("jenesius-vue-modal"),S=class S extends Error{constructor(t,n=null){super(),this.message=t,this.details=n,this.id=S.ID++}static ParentFormNotFound(){return new S("Can't found parent form.")}static UndefinedNameOfCompositeFormController(t){return new S("Composite object name is undefined",t)}static EntityWithoutName(t){return new S("'Entity doesn't have a name",t)}static NotResolvedNameEventEmitter(t){return new S(`'${t}' is not a valid Event emitter name`)}static FormIsNotValidated(t){return new S("Form is not validated",t)}static ListWorkerIsRunningOrEnd(t){return new S("List data request is running or already done",t)}static ObjectIdNotNumber(t){return new S(`${t} (id) is not a number`)}static UndefinedErrorId(t,n){return S.ApiNotAvailable()}static ApiError(t){return new S("Request error",t)}static ApiNotAvailable(){return new S(`Sorry, we experience difficulties here.
6
- Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(t,n){return!t&&!n?S.ApiNotAvailable():new S(t||"Authorization Error",n)}static ApiResponseParseFailed(){return S.ApiNotAvailable()}static MissingIdInValuesEntity(t){return new S("Object doesn't have id",t)}static ObjectWithIdNotFound(t,n){return new S(`Can't find object with id: ${t}`,n)}static ObjectWithoutConnectToPresentArray(t,n){return new S("Object is not found.",{object:t,array:n})}static EntityWithoutId(t){return new S("Entity doesn't have id.",t)}static NotFoundedTableIndex(t,n){return new S(`Can't find the element with tableIndex ${t}`,n)}static UndefinedError(t,n=[]){return new S(t,n)}static TableArrayAlreadyIncludeProvidedIndexValue(t,n,o){return new S(`Array already includes the element with value ${t}`,{array:n,table:o})}static MetadataEntityIsNotAvailable(t){return new S(`Metadata for the ${t} is not currently available.`)}static RequestTookToLong(){return new S("The request took too long to complete. Try again later.")}};S.ID=0;let Q=S;const Zt="Please try again later or submit a feedback if problem doesn't go.";function en(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return Zt}})}function J(e,t={}){return t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw Q.ApiNotAvailable()}).then(n=>en(n).then(o=>{if(!n.ok)throw o;return o}))}class tn{constructor(){this.public=!1,this.errors=new Proxy([],{set:(t,n,o)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),t[n]=o,!0)}),window._journal=this}get error(){return{add:(...t)=>{this.errors.push(t)},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 tn;function rt(e){return{...e,createdEntities:e.createdEntites}}const ie=class ie{static async getStartConfig(t,n){return J([ie.url,t,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(t,n){return J([ie.url,t,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(rt)}static async runStep(t,n,o,i,a){return J([ie.url,t,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:o,token:i,values:a})}).then(rt)}};ie.url="/close-api/views/process-wizard";let ae=ie;class nn{static invite(t,n,o){return J("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:t,personKey:n,relatedRoleCode:o})})}static accept(t,n){return J("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:t,version:n,mark:!0})})}static decline(t,n){return J("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:t,version:n,mark:!1})})}}class rn{static getRequiredDocuments(t,n,o){const i=new URLSearchParams({entity:t,primaryKey:n,statusCode:o});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(a=>a.json())}}class oe{static url(){return"close-api/billing"}static getBillingMetadata(t){return fetch(`/${oe.url()}/calculator/${t}`)}static calculate(t,n){return J(`/${oe.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:t,values:n})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):Q.ApiNotAvailable()})}static parseMetadataField(t){function n(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:t.name,label:t.title,required:t.required,type:n(t)}}static createOnlinePayment(t,n){return J(`/${oe.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:t,returnURL:n})})}static applyOnlinePayment(t){return J(`/${oe.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:t})})}}function on(e){return e.statusName==="Completed"}function an(e){return["FinalStepWithConfirmation","NextStepWithConfirmation"].includes(e.statusName)}function sn(e){return e.statusName==="ValidationError"}function ln(e){return e.statusName==="Undefined"}function cn(e,t,n){let o=null,i=[];const a=r.ref(!1),s=r.ref(null),u=r.computed(()=>i.find(p=>p.name===s.value)||null),l=r.computed(()=>{var p;return((p=u.value)==null?void 0:p.fields)||[]});async function c(p){if(ln(p)){await n.onDisplayDataSet(p);return}if(!(an(p)&&!await n.onDisplayDataSet(p))){if(sn(p))return void n.onValidation(p.validationResults);if(await d(p),console.log(l.value,s.value),(p.statusName==="FinalStep"||p.statusName==="NextStep")&&(!l.value.length||un(l.value,n.presets)))return b(n.presets||{});on(p)&&n.onCompleted(p)}}async function f(){try{await m(),await v()}catch(p){const{message:h}=me(p);he.add("error",h)}}function m(){return a.value="Loading process information.",ae.getStartConfig(t,e).then(p=>i=p.steps.map(h=>{const k=h.frontendEntity.rootObject,T=Object.fromEntries(h.frontendEntity.objectTypes.map(I=>[I.name,I.properties]));return{label:h.title,name:h.stepName,number:h.number,rootObjectName:k,objectTypes:T,fields:T[k],buttonCaption:h.buttonCaption}})).finally(()=>{a.value=!1})}async function d(p){return["FinalStepWithConfirmation","NextStepWithConfirmation","NextStep","Completed","FinalStep"].includes(p.statusName)&&(o=p.token,s.value=p.nextStepName,await r.nextTick()),p}function w(p){const h=me(p);he.add("error",h.message)}function v(){return a.value="Starting process",ae.startProcess(t,e).then(c).catch(w).finally(()=>{a.value=null})}function b(p={}){return!o||!s.value?Promise.reject("Not step or token."):(a.value="Waiting for result...",ae.runStep(t,e,s.value,o,p).then(c).catch(w).finally(()=>{a.value=!1}))}return{initialize:f,loading:a,currentStepConfig:u,currentStepFields:l,currentStepName:s,next:b}}function un(e,t){for(let n=0;n<e.length;n++){const o=e[n];if(!B.utils.getPropFromObject(t,o.name))return!1}return!0}const fn={class:"widget-table__head-cell"},dn={class:"widget-table__head-label margin_0 text_overflow"},yt=r.defineComponent({__name:"widget-table-head-cell",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("th",fn,[r.createElementVNode("span",dn,r.toDisplayString(t.label),1)]))}}),pn={class:"widget-table__head"},gn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>A.componentTableHeadCell||yt),(t,n)=>(r.openBlock(),r.createElementBlock("tr",pn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.config,o=>r.renderSlot(t.$slots,"default",r.mergeProps({ref_for:!0},o),void 0,!0)),256))]))}}),M=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},mn=M(gn,[["__scopeId","data-v-498c4f00"]]);function je(e){return Array.isArray(e)?je(e[0]):typeof e!="string"?null:e}function ge(e){return je(e.name)}function hn(e){const t=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let o;for(;(o=t.exec(e))!==null;)n.push(o[1]);return n}function vn(e,t){return hn(e).forEach(o=>{e=e.replace(new RegExp("\\$\\{"+o+"}","g"),B.utils.getPropFromObject(t,o))}),e}function Be(e){return t=>typeof t=="string"||typeof t=="number"?`${t} ${e}`:""}function Ue(e,t){const n=ge(e);if(typeof e.value=="string")return vn(e.value,t);let o=n?B.utils.getPropFromObject(t,n):null;if(o===void 0&&(o=null),typeof e.value=="function")return e.value(o,t);if(e.value===null)return null;if(e.unitValue&&(o=Be(e.unitValue)(o)),e.unit&&(o=Be(e.unit)(o)),e.type)switch(e.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=ze(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=_t(typeof o=="string"?o:null);break}case"money":{o=At(o);break}}return e.formatter&&(o=ue(e.formatter).exec(o,t)),typeof o=="boolean"&&(o=o?"✓":"—"),o}const yn=1,wn=5e3,bn="static-folder",wt="request-error",bt="Distinguisher",_={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",VISIBLE_ITEM_PROVIDE_NAME:"visible-item-provider",EVENT_FORM_UPDATE:"form-update",EVENT_AFFECTED_ENTITY:"affected-entity",DEFAULT_ORDER_DIR:"asc",TABLE_MOCK_FIELD:"_A_MOCK_ID_FIELD",OBJECT_TYPE_NAME_FIELD:bt};function Re(e){return[_.CORE_DEBUG_LABEL,e].join(":")}const En={class:"widget-filter-text flex gap_20"},kn=r.defineComponent({__name:"widget-filter-text",props:{values:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,o=t,i=r.ref("");function a(){o("update:values",i.value)}return r.watch(()=>n.values,s=>{if(typeof s!="string")return i.value="";i.value=s},{immediate:!0}),(s,u)=>{const l=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",En,[r.createVNode(r.unref(B.FormField),{type:"text",modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=c=>i.value=c)},null,8,["modelValue"]),r.createVNode(l,{onClick:a,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(Z)("Apply")),1)]),_:1})])}}}),Tn=M(kn,[["__scopeId","data-v-800b3803"]]),_n={class:"widget-filter-enum"},Cn=r.defineComponent({__name:"widget-filter-entity",props:{values:{},fieldMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:t}){const n=e,o=r.ref([]),i=Le(n.fieldMetadata.entity),a=c=>(n.values||[]).includes(c),s=t;function u(c){const f=n.values||[];return f.includes(c)?s("update:values",f.filter(m=>m!==c)):s("update:values",[...f,c])}async function l(){var m;if(!((m=n.fieldMetadata)!=null&&m.entity)||!i.value)return;const c=i.value.fieldNameForLabel,f=i.value.fieldNameForIdentification;s("readProcess","start"),o.value=await ce(n.fieldMetadata.entity,{fields:[c,f].join(" "),order:[c,"asc"]}).then(d=>(s("readProcess","end"),d.map(w=>({label:w[c],value:w[f]}))))}return r.watch(()=>i.value,l,{immediate:!0}),(c,f)=>(r.openBlock(),r.createElementBlock("div",_n,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,m=>(r.openBlock(),r.createBlock(r.unref(B.FormField),{class:"widget-filter-enum-item",key:m.value,onClick:()=>u(m.value),type:"single-checkbox","model-value":a(m.value),label:m.label},null,8,["onClick","model-value","label"]))),128))]))}}),An=M(Cn,[["__scopeId","data-v-cf143196"]]),A={getEntityLink(e,t){return`/forms/${e}/${t}`},iconHandlerText(){return""},iconTag:"i",tableFilterEntityBind:{String:Tn,Entity:An}};function Sn(e){for(let t in e)A[t]=e[t]}const In={props:{name:String},setup(e,t){let n="unknown";try{n=t.slots.default()[0].children}catch{n=e.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>r.h(A.iconTag,{class:A.iconHandler?A.iconHandler(n):`icon icon-${n}`},A.iconHandlerText(n))}},le=M(In,[["__scopeId","data-v-8a72b45f"]]),Nn=Ne(Re("setup-list-row"));function Rn(e,t){const n=e.config.map(o=>On(o,e,t));return r.h("tr",{class:"widget-table__row widget-table-row"},n)}function On(e,t,n){const o=t.values;let i=Ue(e,o);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function s(f){a.onClick.push(()=>f(o,e,n))}function u(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const l=[],c=[];if(e.hide&&e.hide(o))return[r.h("td")];if(e.type)switch(u(`widget-table-cell_${e.type}`),e.type){case"multi-select":{c.push(r.h(B.FormField,{type:"single-checkbox",modelValue:t.selected})),s(ot.bind(null,n,!0));break}case"select":{c.push(r.h(B.FormField,{type:"single-radio",modelValue:t.selected})),s(ot.bind(null,n,!1));break}}if(e.onClick&&s(e.onClick),e.link)try{const f=e.link(o);if(f){const m=r.h(Me.RouterLink,{to:f});c.push(m),u("widget-table-cell_link")}}catch(f){Nn("Can't add router link",f)}if(e.href&&(c.push(r.h("a",{href:e.href(o),target:"_blank"})),u("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&c.push(r.h("p",{class:"widget-list-cell-text"},i)),e.icon&&(typeof e.icon=="string"&&c.push(r.h(le,{name:e.icon})),typeof e.icon=="function")){const f=e.icon(o);f!==null&&c.push(r.h(le,{name:f}))}return e.class&&(typeof e.class=="function"?u(e.class(o)):u(e.class)),A.listCellHandler&&A.listCellHandler(e,o,{cellNodeChildren:c,addClass:u,addHandleClick:s,context:n}),l.push(r.h("td",a,c)),l}function ot(e,t){e.emit("select",t)}function We(e,t){return()=>{try{return Rn(e,t)}catch(n){return console.warn(n),null}}}const Ln={props:{values:Object,config:Object,selected:Boolean},setup:We},$n=["colspan"],it=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(e,{emit:t}){const n=t,o=r.ref();return r.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(i,a)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[r.createElementVNode("td",{colspan:i.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.component),r.mergeProps(i.$attrs,{values:i.values,new:i.isNew,onClose:a[0]||(a[0]=s=>n("close")),onSave:a[1]||(a[1]=s=>n("save",s))}),null,16,["values","new"]))],8,$n)],512))}}),xn={class:"widget-table"},at="update:selectedRows",Bn="update:activeRow",Et=r.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1},useMockField:{type:Boolean,default:!1}},emits:["save","order"],setup(e,{emit:t}){const n=e,o=t,i=r.useSlots(),a=r.computed(()=>{var d;return(d=i==null?void 0:i.default)==null?void 0:d.call(i)[0]});function s(d){return n.useMockField?pt(d):d}function u(d,w=!0){if(!n.selectedRows)return;if(!w)return o(at,n.selectedRows.includes(d)?[]:[d]);const v=[...n.selectedRows],b=v.indexOf(d);return b===-1?v.push(d):v.splice(b,1),o(at,v)}function l(d){o(Bn,d)}function c(d){o("save",d),o("update:activeRow",null)}const f=r.computed(()=>n.shortcut?n.config.filter(d=>d.name?!!n.array.find(v=>![null,""].includes(Ue(d,v))):!0):n.config),m=r.computed(()=>n.useMockField?n.array.filter(pt):n.array);return(d,w)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",xn,[r.createElementVNode("thead",null,[r.createVNode(mn,{config:f.value,onOrder:w[0]||(w[0]=v=>d.$emit("order",v))},{default:r.withCtx(v=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(d.$slots["head-cell"]||yt),r.normalizeProps(r.guardReactiveProps(v)),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,(v,b)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:b},[r.createVNode(Ln,{config:f.value,values:v,selected:d.selectedRows.includes(s(v)),onSelect:p=>u(s(v),p),onActivate:p=>l(s(v)),class:r.normalizeClass(d.classCallback?d.classCallback(v):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&d.activeRow===s(v)?(r.openBlock(),r.createBlock(it,{key:0,component:a.value,"row-length":d.config.length,values:v,onClose:w[1]||(w[1]=p=>o("update:activeRow",null)),onSave:c,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),d.activeRow===r.unref(_).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(it,{key:0,component:a.value,"row-length":f.value.length,onClose:w[2]||(w[2]=v=>o("update:activeRow",null)),onSave:c,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),Fn=r.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",{class:"widget-spinner",style:r.normalizeStyle({"border-left":`1.1em solid ${t.color}`})},null,4))}}),fe=M(Fn,[["__scopeId","data-v-0ef9ae88"]]),Dn={class:"widget-button"},Pn=r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("button",Dn,[t.wait?(r.openBlock(),r.createBlock(fe,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(t.$slots,"default",{},void 0,!0)]))}}),Vn=M(Pn,[["__scopeId","data-v-450dc564"]]),Mn={class:"widget-multi-button-wrap position_relative cursor_pointer"},jn={class:"widget-multi-button-body grid"},Un=["onClick"],Wn={class:"widget-multi-button-side-wrap"},qn=r.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(e){r.useCssVars(s=>({"04895bf1":o.value}));const t=e,n=r.reactive({active:!1,wait:!1}),o=r.computed(()=>t.array.length+(t.label?1:0));function i(s){if(!(typeof s!="function"||n.wait))return n.wait=!0,Promise.resolve().then(s).finally(()=>{n.wait=!1})}function a(s=!n.active){n.active=s}return(s,u)=>(r.openBlock(),r.createElementBlock("div",Mn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[r.createElementVNode("div",jn,[s.label?(r.openBlock(),r.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:u[0]||(u[0]=l=>a())},r.toDisplayString(s.label),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.array,(l,c)=>(r.openBlock(),r.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:c,onClick:f=>{i(l.callback),a(!1)}},r.toDisplayString(l.label),9,Un))),128))]),r.createElementVNode("div",Wn,[r.createElementVNode("div",{class:r.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:u[1]||(u[1]=l=>a())},[n.wait?(r.openBlock(),r.createBlock(r.unref(fe),{key:0,class:"widget-multi-button-side-spinner"})):s.array.length>1?(r.openBlock(),r.createBlock(r.unref(le),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),zn=M(qn,[["__scopeId","data-v-d43a76ce"]]),Gn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Hn={class:"text_md"},Xn=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",Gn,[r.createVNode(fe,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Hn,r.toDisplayString(t.label),1)]))}}),Jn=["alt","src"],Yn=r.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(e){const t=e,n=r.ref();return r.onMounted(()=>{n.value&&(n.value.src=t.src),n.value.onerror=function(){t.default&&(n.value.src=t.default)}}),(o,i)=>(r.openBlock(),r.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:n,src:o.src||o.$props.default},null,8,Jn))}}),Kn={props:{config:Array,values:Object,selected:Boolean},setup:We},Qn=M(Kn,[["__scopeId","data-v-344a8cc1"]]),Zn=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),er={class:"widget-list-head-cell"},tr=Zn(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),nr=r.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(e,{emit:t}){const n=e,o=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(i,a)=>(r.openBlock(),r.createElementBlock("th",null,[r.createElementVNode("div",er,[r.createElementVNode("div",{class:"head-cell-content flex_grow",style:r.normalizeStyle({"min-width":i.minWidth,"max-width":i.maxWidth,width:i.width})},[i.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(B.FormField),{key:0,type:"single-checkbox",onClick:a[0]||(a[0]=r.withModifiers(s=>o("select"),["stop","prevent"]))})):(r.openBlock(),r.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:a[1]||(a[1]=s=>o("order"))},r.toDisplayString(i.title||i.label),1))],4),i.name&&i.order.length&&i.order[0]===i.name?(r.openBlock(),r.createBlock(r.unref(le),{key:0,class:r.normalizeClass(["head-cell-order",{"head-cell-order_down":i.order.length>1&&i.order[1]==="desc"}])},{default:r.withCtx(()=>[r.createTextVNode("core-arrow-up")]),_:1},8,["class"])):r.createCommentVNode("",!0),tr])]))}}),rr=M(nr,[["__scopeId","data-v-bf495d6a"]]),or=r.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(e,{emit:t}){const n=e,o=t,i=r.ref(),a=r.ref();r.onMounted(()=>{function c(v,b){let p=-1;do p++,b-=v[p];while(b>0&&p<v.length);return p}function f(v,b){let p=0;for(;b>0&&b>v[p]&&p<v.length;)b-=v[p],p++;return console.log(b,p),p>0?p:0}function m(v){try{a.value.style.insetInlineStart=v+"px"}catch(b){console.log(b)}}function d(v){try{a.value.style.width=v+"px",a.value.style.minWidth=v+"px",a.value.style.maxWidth=v+"px"}catch(b){console.log(b)}}function w(v){return v===null?!1:v.classList.contains("head-cell-resize")}i.value.addEventListener("pointerdown",function(b){var O;function p(x){return x.screenX+T-D}const h=i.value,k=[...h.children].filter(x=>x.localName==="th"),T=((O=h.offsetParent)==null?void 0:O.scrollLeft)||0,I=k.map(x=>x.clientWidth),F=w(b.target),D=h.getBoundingClientRect().left,g=p(b),y=c(I,g),E=I.slice(0,y).reduce((x,P)=>x+P,0),C=g-E,N=h.offsetWidth,W=k[y].clientWidth;if(n.config[y].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",b.screenX),console.log("Widths",I),console.log("max width",N),console.log("Start Position",g),console.log("Position From",y),console.log("Start Position",y),console.log("Global offset (Отступ самой таблицы от края экрана)",D),console.log("Del",C),console.groupEnd(),a.value.innerText=k[y].textContent||"",a.value.style.display="grid",a.value.style.width=W+"px",a.value.style.cursor="grabbing",m(E),d(W),document.addEventListener("pointermove",j,{passive:!0}),document.addEventListener("pointerup",Y);function Y(x){if(console.group("END"),document.removeEventListener("pointermove",j),document.removeEventListener("pointerup",Y),F&&(n.config[y].width=a.value.style.width,n.config[y].minWidth=a.value.style.width,n.config[y].maxWidth=a.value.style.width,s(n.config)),!F){const P=x.screenX+T-D;console.log("ENP Position",P);const we=f(I,P);if(console.log(y,"->",we),we!==y){const de=n.config[y],$e=n.config;$e.splice(y,1),$e.splice(we,0,de),s($e)}else{const de=n.config[y].name;u(de)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function j(x){if(F){const de=p(x)-g+W;d(de);return}let P=x.screenX+T-D-C;P<0&&(P=0),P+W>N&&(P=N-W),m(P)}})});function s(c){o("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 f=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([c,f==="asc"?"desc":"asc"])}function l(c){o("update:order",c)}return(c,f)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.config,(m,d)=>(r.openBlock(),r.createBlock(rr,r.mergeProps({key:m,ref_for:!0},m,{onOrder:w=>u(m.name),onSelect:f[0]||(f[0]=w=>o("select")),order:c.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:a},"test",512)],512))}}),ir=M(or,[["__scopeId","data-v-ccffc6bd"]]),ar={class:"widget-list"},sr={class:"widget-list-body position_relative"},lr=50,cr=r.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(e,{emit:t}){const n=e,o=t;function i(l,c=!0){if(n.selectedRows)if(!c)s(n.selectedRows.includes(l)?[]:[l]);else{const f=[...n.selectedRows],m=f.indexOf(l);m===-1?f.push(l):f==null||f.splice(m,1),s(f)}}function a(){var l;if(((l=n.selectedRows)==null?void 0:l.length)!==n.array.length)return s([...n.array]);s([])}function s(l){o("update:selectedRows",l)}function u(l){if(!l)return;const c=l.target;c.scrollTop+c.clientHeight+lr>c.scrollHeight&&o("scrollEnd")}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[r.createElementVNode("table",ar,[r.createElementVNode("thead",null,[r.createVNode(ir,{onSelect:c[0]||(c[0]=f=>a()),"onUpdate:order":c[1]||(c[1]=f=>o("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>o("update:config",f)),config:l.config,order:l.order},null,8,["config","order"])]),r.createElementVNode("tbody",sr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(f,m)=>{var d;return r.openBlock(),r.createBlock(Qn,{key:m,class:"widget-list-row",values:f,config:l.config,selected:(d=l.selectedRows)==null?void 0:d.includes(f),onSelect:w=>i(f,w)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function qe(){var a;const e=r.computed(()=>Object.keys(n).length===0||Object.values(n).includes(!0)),t=(a=r.getCurrentInstance())==null?void 0:a.uid;if(!t)throw"Undefined instance. Please check it.";const n=r.reactive({});r.provide(_.VISIBLE_ITEM_PROVIDE_NAME,{show(s){n[s]=!0},hide(s){n[s]=!1},remove(s){delete n[s]}});const o=r.inject(_.VISIBLE_ITEM_PROVIDE_NAME,{show(){},hide(){},remove(){}});return{visible:e,controller:{show(){o==null||o.show(t)},hide(){o==null||o.hide(t)},remove(){o==null||o.remove(t)}},visibleItems:n}}const ur=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{}},setup(e){const t=e,n=Le(),o=Ke(),i=r.computed(()=>{var b,p;const d=l.value,w=c(d),v={type:w,disabled:!((b=u.value)!=null&&b.canSet),label:t.label};return d&&Object.assign(v,{suffix:w==="number"?d.valueUnit:void 0,required:s.includes(w||"")?!1:d.required,label:t.label||d.displayName}),Object.assign(v,((p=A.fieldParamsHandler)==null?void 0:p.call(A,d,u.value,v))||{}),v}),a=["MultiText","MultiWideText"],s=["switch","single-checkbox","single-radio"],u=r.computed(()=>{var d;return(d=o==null?void 0:o.value)==null?void 0:d.fields[t.name]}),l=r.computed(()=>{if(!n.value)return;const d=n.value.fieldsByName[t.name];if(d)return d});function c(d){if(typeof t.type=="string"&&t.type.length!==0)return t.type;if(d){if(d.type==="Reference"||d.type==="Owned")return d.referencedEntity;if(d.dataType==="Boolean")return"single-checkbox";if(d.dataType==="DateTime")return"date";if(d.dataType==="Integer"||d.dataType==="Decimal")return"number";if(d.dataType==="List")return d.aggregatedEntity;if(a.includes(d.presentationType))return"textarea";if(d.presentationType==="PhoneNumber")return"tel"}return"text"}const f=r.computed(()=>{var d;return((d=u.value)==null?void 0:d.canGet)===!0}),{controller:m}=qe();return r.watch(()=>f.value,d=>d?m.show():m.hide(),{immediate:!0}),r.onUnmounted(()=>m.remove()),(d,w)=>f.value?(r.openBlock(),r.createBlock(r.unref(B.FormField),r.mergeProps({key:0},{...d.$attrs,...i.value},{name:d.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function fr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||_.DEFAULT_ORDER_DIR}const dr=["fill"],pr=r.createElementVNode("path",{d:"M440-647 244-451q-12 12-28 11.5T188-452q-11-12-11.5-28t11.5-28l264-264q6-6 13-8.5t15-2.5q8 0 15 2.5t13 8.5l264 264q11 11 11 27.5T772-452q-12 12-28.5 12T715-452L520-647v447q0 17-11.5 28.5T480-160q-17 0-28.5-11.5T440-200v-447Z"},null,-1),gr=[pr],mr=r.defineComponent({__name:"widget-icon-arrow-up",props:{color:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:t.color},gr,8,dr))}}),hr={class:"widget-fast-table-head-cell-td"},vr={class:"widget-head-cell-label"},yr={key:0,class:"widget-head-cell-order"},wr=r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{}},setup(e){const t=e,n=r.computed(()=>je(t.name));return r.computed(()=>fr(t.order)),(o,i)=>{var a;return r.openBlock(),r.createElementBlock("td",hr,[r.createElementVNode("div",{class:"widget-head-cell",onClick:i[0]||(i[0]=s=>o.$emit("order",o.name))},[r.createElementVNode("span",vr,r.toDisplayString(o.label),1),n.value===((a=o.order)==null?void 0:a[0])?(r.openBlock(),r.createElementBlock("div",yr,[r.createVNode(mr,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${o.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)])])}}}),kt=M(wr,[["__scopeId","data-v-9db5d417"]]),br=["fill"],Er=r.createElementVNode("path",{d:"M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z"},null,-1),kr=[Er],Tr=r.defineComponent({__name:"widget-icon-keyboard-arrow-down",props:{color:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:t.color},kr,8,br))}}),_r={class:"widget-filter-item-popup"},Cr=r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filterItem:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,o=t,i=A.tableFilterEntityBind,a=r.ref(),s=r.computed(()=>{const w=n.filterItem;return w.entity?"Entity":w.type?w.type:null});function u(w){l.value=w==="start"}const l=r.ref(!1),c=r.computed(()=>Array.isArray(n.values)||typeof n.values=="string"?n.values.length>0:!!n.values),f=r.ref(!1);let m=null;function d(w=!f.value){f.value=w,!f.value&&m?(m(),m=null):a.value&&(m=B.utils.clickOutside(a.value,d.bind(null,!1)))}return(w,v)=>{var b;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:"widget-filter-item",onClick:v[0]||(v[0]=()=>d())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":c.value}])},r.toDisplayString(w.filterItem.label||"--"),3),l.value?(r.openBlock(),r.createBlock(fe,{key:0})):(r.openBlock(),r.createBlock(Tr,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":f.value})},null,8,["class"]))]),r.withDirectives(r.createElementVNode("div",_r,[s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((b=r.unref(i))==null?void 0:b[s.value]),{key:0,"field-metadata":w.filterItem,values:w.values,"onUpdate:values":v[1]||(v[1]=p=>o("update:values",p)),onReadProcess:u},null,40,["field-metadata","values"])):r.createCommentVNode("",!0)],512),[[r.vShow,f.value]])],512)}}}),Tt=M(Cr,[["__scopeId","data-v-5b9128bc"]]),Ar={class:"widget-table-panel-filter flex"},Sr=r.defineComponent({__name:"widget-table-panel-filters",props:{filtersConfig:{},filters:{},entity:{}},emits:["update:filters"],setup(e,{emit:t}){const n=e,o=t;function i(a,s){o("update:filters",{...n.filters,[a]:s})}return(a,s)=>(r.openBlock(),r.createElementBlock("div",Ar,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(u,l)=>{var c;return r.openBlock(),r.createBlock(Tt,{key:l,entity:a.entity,"filter-item":u,values:(c=a.filters)==null?void 0:c[r.unref(ge)(u)],"onUpdate:values":f=>i(r.unref(ge)(u),f)},null,8,["entity","filter-item","values","onUpdate:values"])}),128))]))}}),Ir=M(Sr,[["__scopeId","data-v-f1534314"]]),Nr={class:"es-grid es-gap-15"},Rr={key:0,class:"title-md color-primary margin-0"},Or={key:0,class:"widget-table-loader es-flex es-gap-10 es-flex-align-center es-padding-10 text-main"},Lr=r.createElementVNode("span",null,"Loading...",-1),$r={class:"widget-fast-table-tools es-flex es-gap-15"},xr={class:""},Br=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{}},setup(e){const t=e,n=Me.useRouter(),o=r.ref([]),i=r.ref(null),a=r.ref(null),s=r.ref(null),u=B.Form.getParentForm();Le(t.entity);const{state:l,update:c}=Ke(t.entity,{masterEntities:t.masterEntities||[]}),f=(t.actions||[]).map(g=>Lt(g)),m=r.computed(()=>i.value?Xt(t.entity,i.value.config):[]),d=r.computed(()=>{var g;return((g=i.value)==null?void 0:g.displayItem)||Ye.inline}),w=r.computed(()=>{var g;return((g=i.value)==null?void 0:g.newItem)||d.value}),v=_e(async()=>{try{await p.call(),await c()}catch(g){const{message:y}=me(g);a.value=y}});u instanceof B.Form&&u.subscribe({read:v.call.bind(null),name:t.entity,type:"table"}),r.onMounted(()=>{b.call(),v.call()});const b=_e(async function(){const y=t.entity;i.value=await It(y,t.mark)}),p=_e(async function(){var E,C,N;const y=t.entity;a.value=null,b.promise&&await b.promise,o.value=(await ce(y,{customFilters:((E=i.value)==null?void 0:E.customFilters)||[],fields:Ct(m.value).join(" "),order:((C=i.value)==null?void 0:C.order)||[],filter:L.and(L(D.value),L(t.binding||{}),L(((N=i.value)==null?void 0:N.prefilters)||{}))})).map(li)});async function h(g){var E;if(g===null)return s.value=null;const y=g==null?void 0:g.Id;if(!y&&((E=i.value)!=null&&E.linkNew))return n.push(i.value.linkNew);if(d.value==="form")return n.push(Je(t.entity,y));if(d.value==="inline")return s.value=g||_.LIST_ACTIVE_NEW;d.value==="modal"?(await ne.promptModal("form",{entity:t.entity,id:y}),await p.call()):s.value=_.LIST_ACTIVE_NEW}const{controller:k}=qe();r.watch(()=>l.value,g=>{g&&(g.canRead?k.show():k.hide())},{immediate:!0}),r.onUnmounted(()=>k.remove());const T=[{icon:"reload",label:"Reload",callback(){v.call()}}];let I=[ve.on("affected-entity",g=>{g.name===t.entity&&p.call()}),ve.on("display-entity",async g=>{g.name===t.entity&&(p.promise&&await p.promise,s.value=o.value.find(y=>y.Id===g.id)||null)})];r.onUnmounted(()=>I.map(g=>g()));function F(g){var Y;function y(j){return Array.isArray(j)?y(j[0]):typeof j!="string"?null:j}const E=y(g);if(!E)return;const C=((Y=i.value)==null?void 0:Y.order)||[];(j=>{if(i.value)return i.value.order=j,!0})(C[0]!==E?[E,"asc"]:C[1]==="desc"?[]:[E,"desc"])&&p.call()}const D=r.ref({});return r.watch(()=>D.value,()=>p.call()),(g,y)=>{var N,W,Y,j;const E=r.resolveComponent("widget-button"),C=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",Nr,[(N=i.value)!=null&&N.label?(r.openBlock(),r.createElementBlock("p",Rr,r.toDisplayString((W=i.value)==null?void 0:W.label),1)):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"slide-up"},{default:r.withCtx(()=>[r.unref(v).wait||r.unref(b).wait||r.unref(p).wait?(r.openBlock(),r.createElementBlock("div",Or,[r.createVNode(r.unref(fe),{color:"var(--color-primary)"}),Lr])):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("div",$r,[w.value==="form"||(Y=r.unref(l))!=null&&Y.canCreate?(r.openBlock(),r.createBlock(E,{key:0,callback:h,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(" Add New ")]),_:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f).filter(O=>!!O.value),O=>{var x;return r.openBlock(),r.createBlock(E,{callback:(x=O.value)==null?void 0:x.callback,type:"primary"},{default:r.withCtx(()=>{var P;return[r.createTextVNode(r.toDisplayString((P=O.value)==null?void 0:P.label),1)]}),_:2},1032,["callback"])}),256)),(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(T,O=>r.createVNode(E,{onClick:()=>O.callback,callback:O.callback},{default:r.withCtx(()=>[r.createVNode(le,null,{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.icon),1)]),_:2},1024),r.createElementVNode("span",null,r.toDisplayString(O.label),1)]),_:2},1032,["onClick","callback"])),64))]),r.createElementVNode("div",xr,[r.createVNode(Ir,{entity:g.entity,"filters-config":((j=i.value)==null?void 0:j.filters)||[],filters:D.value,"onUpdate:filters":y[0]||(y[0]=O=>D.value=O)},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(Et),{config:m.value,array:o.value,"active-row":s.value,"onUpdate:activeRow":h,onOrder:F,class:"table"},{"head-cell":r.withCtx(O=>{var x;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.$slots["head-cell"]?g.$slots["head-cell"]:kt),r.mergeProps({label:O.label},O,{onOrder:F,order:((x=i.value)==null?void 0:x.order)||[]}),null,16,["label","order"]))]}),default:r.withCtx(()=>{var O;return[r.createVNode(C,{entity:g.entity,id:(O=s.value)==null?void 0:O.Id,"master-entities":g.masterEntities||void 0,binding:g.binding,onFormUpdate:y[1]||(y[1]=()=>{s.value=null,r.unref(p).call()})},null,8,["entity","id","master-entities","binding"])]}),_:1},8,["config","array","active-row"])])])}}});function _t(e){return ze(e,"YYYY/MM/DD HH:mm:ss")}function ze(e,t="YYYY/MM/DD"){if(!e)return"";try{const n=new Date(e);return Qt.format(n,t)}catch(n){return console.log(n),"Invalid date"}}function _e(e){function t(...o){if(n.wait)return Promise.reject("The process has already started.");n.wait=!0;const i=Promise.resolve().then(()=>e(...o)).finally(()=>{n.wait=!1,n.promise=null});return n.promise=i,i}const n=r.reactive({wait:!1,call:t,promise:null});return n}function me(e){return typeof e=="string"?be(e):Fr(e)?be(e.message,e.children||e.details||[]):Dr(e)?be(e.title,[e.detail||""]):be(_.DEFAULT_ERROR_MESSAGE)}function Fr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Dr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function be(e,t=[]){return{message:e,children:t}}function z(e="error"){return function(t){const{message:n,children:o}=me(t);he.add(e,n,{children:o})}}function ce(e,t={}){return $().emit("entity:read",{...t,entity:e})}function Ge(e,t){return $().emit("entity:update",{...t,entity:e})}function Ct(e){return e.reduce((t,n)=>(n.name&&(typeof n.name=="string"?t.push(n.name):t.push(...n.name)),t),[])}function At(e,t=2){if(!(typeof e=="string"||typeof e=="number"))return"";let o=String(e).split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.length<2&&(o[1]=""),o[1]=o[1].padEnd(t,"0"),o[1].length>t&&(o[1]=o[1].substring(0,t)),o.join(".")}function Pr(e,t){const n=new Map;return e.forEach(o=>{var a;const i=t(o);n.has(i)||n.set(i,[]),(a=n.get(i))==null||a.push(o)}),n}function Vr(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function Mr(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return _.DEFAULT_ERROR_MESSAGE}})}function V(e,t={}){return q.isFront&&(t.headers||(t.headers={}),t.headers["Context-Id"]=q.contextId),t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.reload():n).catch(()=>{throw new Error(_.DEFAULT_ERROR_MESSAGE)}).then(n=>Mr(n).then(o=>{if(!n.ok)throw o;return o}))}function jr(e,t=1e3){let n=0;return(...o)=>{clearTimeout(n),n=window.setTimeout(()=>e(...o),t)}}function Ur(e,t){let n=!1;return(...o)=>{if(!n)return n=!0,setTimeout(()=>n=!1,t),e(...o)}}const Wr=Ne(Re("pretty-value-field-by-entity"));function qr(e,t,n){try{const o=Se.get(e);if(!o)throw new Error("For entity metadata is not loaded");const i=o.fieldsByName[t];if(!i)throw new Error(`For entity ${e} can't found fieldMetadata for field ${t}`);return i.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(o){return Wr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',o,e,t,n),n}}const ee=Ne(Re("use-socket"));function $(){return Gr}function zr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const Gr=function(){let e=1,t,n;const o=new Set;let i=0;const a=new Set;function s(){if(t)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{t.close()},wn*2);const h=new Uint8Array(1);h[0]=yn,t.send(h)}setInterval(()=>{Array.from(o).forEach(h=>{p(h)&&(ee("Handler for event %s requestId %d was expired",h.event,h.requestId),h.requestId?l({requestId:h.requestId,event:wt,data:{message:Q.RequestTookToLong().message}}):o.delete(h))})},1e3),setInterval(()=>{(!t||t.readyState===3)&&c()},_.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:a,requestId:e,handlers:o,socketInstance:t}}function l(h){const k=[...o.values()];ee("Handlers array length is %d. Response event: %s. Request id: %d",o.size,h.event,h.requestId),k.forEach(T=>{const I=h.requestId;(T.requestId&&T.requestId===I||!T.requestId&&T.event===h.event)&&(ee("Find appropriated handler: %d, event: %s",e,T.event),T.callback(h.data,h),T.once&&(o.delete(T),ee("Handler was removed by *once* params was passed. %o",T)))})}function c(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),t=new WebSocket(n),t.onclose=function(h){ee("Connection to server was stopped: %d %s",h.code,h.reason),Array.from(o).forEach(k=>{k.guaranteedAnswer&&k.serializeString&&a.add(k.serializeString)})},t.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(h=>{f(h),a.delete(h)})},t.onerror=function(h){console.warn(h)},t.onmessage=h=>{var k;try{if(zr(h.data)){s();return}const T=JSON.parse(h.data);if(!St(T)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(T);return}(k=T==null?void 0:T.data)!=null&&k.refresh&&location.reload(),l(T)}catch(T){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(T)}}}function f(h){t.send(h)}function m(h,k){b({event:h,callback:k})}function d(h,k){b({event:h,callback:k,once:!0})}function w(){return t&&(t==null?void 0:t.readyState)===1}function v(h,k,T){const I=++e,F=JSON.stringify({requestId:I,event:h,data:k,contextId:q.contextId,url:A.socketURLHandler?A.socketURLHandler():window.location.href});return w()?f(F):(a.add(F),ee("Socket is not connected. Message was send to save-queue")),new Promise((D,g)=>{b({event:h,requestId:I,once:!0,guaranteedAnswer:!0,serializeString:F,callback:(y,E)=>{if(ee("Promise was resolve with next data:",y),Hr(E))return void g(y);T&&T(y,E),D(y)},timeToLive:_.TIME_TO_LIVE_SOCKET_REQUEST})})}function b(h){const k={timeToLive:0,...h,created:new Date().getTime()};o.add(k)}function p(h){return h.timeToLive===0||typeof h.timeToLive!="number"?!1:new Date().getTime()-h.created>h.timeToLive}return{get socket(){return t},on:m,once:d,emit:v,initialization(h){n=h},getDevInfo:u}}(),Hr=e=>!!St(e)&&e.event===wt,St=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function It(e,t){return $().emit("list-setting:read",{entity:e,mark:t})}function Xr(e,t){return $().emit("metadata-field:treat",{entity:e,fieldName:t})}function Nt(e,t){return $().emit("entity:create",{...t,entity:e})}function Rt(e,t){return $().emit("entity:delete",{...t,entity:e})}function Jr(e,t){return $().emit("usage-context:read",{...t,entity:e})}function Ot(e={}){return $().emit("tool:read",e)}function Yr(){return $().emit("metadata-list:read",{})}function Lt(e,t={},n={}){const o=r.inject(_.PROVIDE_NAME_ACTIONS,null),i=typeof e=="string"?e:t,a=typeof t=="string"?n:t;return r.computed(()=>{var l;const u=((typeof e=="string"?(l=o==null?void 0:o.actions)==null?void 0:l.value:r.unref(e))||[]).find(c=>c.name===i);return u?{...u,...a}:null})}function Kr(e){return $().emit("history:read",e)}function Qr(e,t){return $().emit("entity:count",{...t,entity:e})}function Zr(e){return`/${bn}/${e}`}function ue(e){return{exec(t,n){switch(e.name){case"replace-boolean":return ue.replaceBoolean(t,e.values);case"replace-record-operation":return ue.replaceRecordOperation(t)}}}}ue.replaceBoolean=eo;ue.replaceRecordOperation=to;function eo(e,t){return typeof e!="boolean"?"":e?t[1]:t[0]}function to(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function no(e={}){return $().emit("tool:execute",e)}const ro=Ne(Re("wrap-tool-response"));function $t(e,t){return e.handleConfirmation===void 0&&(e.handleConfirmation=ao),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=lo),e.handleCloseForm===void 0&&(e.handleCloseForm=co),e.handleValidationResult===void 0&&(e.handleValidationResult=so),{...t,label:t.title,callback(){var i;const n=typeof e.values=="function"?e.values(t,e):e.values,o=()=>no({name:t.name,values:n,usageContext:t.usageContext}).then(async a=>{var s,u;if(!oo(a))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(e.handlers))for await(const l of e.handlers)await l(t,a,e);if(!a.success)throw e.handleValidationResult&&a.validationEffect&&((u=(s=a.validationEffect)==null?void 0:s.results)!=null&&u.length)&&e.handleValidationResult(t,a.validationEffect,e),new Error(a.message);return a.message&&he.add("info",a.message),Array.isArray(a.affectedEntities)&&e.handleAffectedEntity&&a.affectedEntities.forEach(l=>{var c;return(c=e.handleAffectedEntity)==null?void 0:c.call(e,t,l,e)}),t.closeHostForm&&e.handleCloseForm&&e.handleCloseForm(t,e),a}).catch(z("error"));return(i=e.overrides)!=null&&i[t.name]?e.overrides[t.name](t,e):t.requireSave&&e.form&&e.form.changed?e.form.save().then(o):!t.confirmation||!e.handleConfirmation?o():e.handleConfirmation(t,o)}}}function oo(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function io(e){const t="Are you sure?";return e===!0||typeof e=="string"&&e.toLowerCase()==="true"||e==="1"?t:typeof e=="string"?e:t}async function ao(e,t){const n=io(e.confirmation);if(!ne.getComponentFromStore(_.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await ne.promptModal(_.MODAL_CONFIRM,{message:n}))return t()}function so(e,t){const n=_.MODAL_VALIDATION_EFFECT;if(!ne.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{ne.pushModal(n,t)})}function lo(e,t,n){var l;function o(c){return c!==null&&typeof c=="object"&&typeof c.read=="function"}function i(c,f){c&&(ro("Affected Entity %s. Find form with name %s.",f,c.name),c.name===f&&o(c)&&c.read(),c instanceof B.Form&&c.dependencies.forEach(m=>i(m,f)))}ve.emit("affected-entity",t);const{router:a,form:s}=n,u=(l=t.primaryKey)==null?void 0:l.Id;if(a&&t&&t.name===e.redirectEntity){ve.emit("display-entity",{id:u,name:t.name}),A.getEntityLink&&a.push(A.getEntityLink(t.name,u));return}i(s,t.name)}function co(e,t){const{router:n}=t;n&&e.closeHostForm&&n.back()}let te={};function Z(e,...t){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let n=B.utils.getPropFromObject((this==null?void 0:this.vocabulary)||te,e);if(typeof n=="string")return st(n,t);const o=B.utils.getPropFromObject(te==null?void 0:te.root,e);return typeof o=="string"?st(o,t):(typeof n===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function st(e,t){return t.forEach((n,o)=>{e=e.replaceAll(new RegExp(`\\{${o}}`,"g"),n)}),e}Z.setGlobalVocabulary=function(e){te=e};Z.getScope=function(e){const t=typeof e=="string"?e:"root";return typeof e!="string"&&console.warn(`SCOPE ${e} for translate is not string.`),Z.bind({vocabulary:B.utils.getPropFromObject(te,t.toLowerCase())})};Z.setVocabulary=function(e){return typeof e=="string"&&(e=B.utils.getPropFromObject(te,e)),Z.bind({vocabulary:e})};function uo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fe={exports:{}},R={},De={exports:{}},re={};function xt(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function fo(e,t,n){}function po(e,t,n){}var go=/javascript\s*\:/img;function mo(e,t){return go.test(t)?"":t}re.whiteList=xt();re.getDefaultWhiteList=xt;re.onAttr=fo;re.onIgnoreAttr=po;re.safeAttrValue=mo;var ho={indexOf:function(e,t){var n,o;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var o,i;if(Array.prototype.forEach)return e.forEach(t,n);for(o=0,i=e.length;o<i;o++)t.call(n,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},pe=ho;function vo(e,t){e=pe.trimRight(e),e[e.length-1]!==";"&&(e+=";");var n=e.length,o=!1,i=0,a=0,s="";function u(){if(!o){var f=pe.trim(e.slice(i,a)),m=f.indexOf(":");if(m!==-1){var d=pe.trim(f.slice(0,m)),w=pe.trim(f.slice(m+1));if(d){var v=t(i,s.length,d,w,f);v&&(s+=v+"; ")}}}i=a+1}for(;a<n;a++){var l=e[a];if(l==="/"&&e[a+1]==="*"){var c=e.indexOf("*/",a+2);if(c===-1)break;a=c+1,i=a+1,o=!1}else l==="("?o=!0:l===")"?o=!1:l===";"?o||u():l===`
7
- `&&u()}return pe.trim(s)}var yo=vo,Ee=re,wo=yo;function lt(e){return e==null}function bo(e){var t={};for(var n in e)t[n]=e[n];return t}function Bt(e){e=bo(e||{}),e.whiteList=e.whiteList||Ee.whiteList,e.onAttr=e.onAttr||Ee.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||Ee.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||Ee.safeAttrValue,this.options=e}Bt.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onAttr,a=n.onIgnoreAttr,s=n.safeAttrValue,u=wo(e,function(l,c,f,m,d){var w=o[f],v=!1;if(w===!0?v=w:typeof w=="function"?v=w(m):w instanceof RegExp&&(v=w.test(m)),v!==!0&&(v=!1),m=s(f,m),!!m){var b={position:c,sourcePosition:l,source:d,isWhite:v};if(v){var p=i(f,m,b);return lt(p)?f+":"+m:p}else{var p=a(f,m,b);if(!lt(p))return p}}});return u};var Eo=Bt;(function(e,t){var n=re,o=Eo;function i(s,u){var l=new o(u);return l.process(s)}t=e.exports=i,t.FilterCSS=o;for(var a in n)t[a]=n[a];typeof window<"u"&&(window.filterCSS=e.exports)})(De,De.exports);var He=De.exports,Xe={indexOf:function(e,t){var n,o;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var o,i;if(Array.prototype.forEach)return e.forEach(t,n);for(o=0,i=e.length;o<i;o++)t.call(n,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/,n=t.exec(e);return n?n.index:-1}},ko=He.FilterCSS,To=He.getDefaultWhiteList,Ae=Xe;function Ft(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var Dt=new ko;function _o(e,t,n){}function Co(e,t,n){}function Ao(e,t,n){}function So(e,t,n){}function Pt(e){return e.replace(No,"&lt;").replace(Ro,"&gt;")}function Io(e,t,n,o){if(n=qt(n),t==="href"||t==="src"){if(n=Ae.trim(n),n==="#")return"#";if(!(n.substr(0,7)==="http://"||n.substr(0,8)==="https://"||n.substr(0,7)==="mailto:"||n.substr(0,4)==="tel:"||n.substr(0,11)==="data:image/"||n.substr(0,6)==="ftp://"||n.substr(0,2)==="./"||n.substr(0,3)==="../"||n[0]==="#"||n[0]==="/"))return""}else if(t==="background"){if(ke.lastIndex=0,ke.test(n))return""}else if(t==="style"){if(ct.lastIndex=0,ct.test(n)||(ut.lastIndex=0,ut.test(n)&&(ke.lastIndex=0,ke.test(n))))return"";o!==!1&&(o=o||Dt,n=o.process(n))}return n=zt(n),n}var No=/</g,Ro=/>/g,Oo=/"/g,Lo=/&quot;/g,$o=/&#([a-zA-Z0-9]*);?/gim,xo=/&colon;?/gim,Bo=/&newline;?/gim,ke=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,ct=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,ut=/u\s*r\s*l\s*\(.*/gi;function Vt(e){return e.replace(Oo,"&quot;")}function Mt(e){return e.replace(Lo,'"')}function jt(e){return e.replace($o,function(n,o){return o[0]==="x"||o[0]==="X"?String.fromCharCode(parseInt(o.substr(1),16)):String.fromCharCode(parseInt(o,10))})}function Ut(e){return e.replace(xo,":").replace(Bo," ")}function Wt(e){for(var t="",n=0,o=e.length;n<o;n++)t+=e.charCodeAt(n)<32?" ":e.charAt(n);return Ae.trim(t)}function qt(e){return e=Mt(e),e=jt(e),e=Ut(e),e=Wt(e),e}function zt(e){return e=Vt(e),e=Pt(e),e}function Fo(){return""}function Do(e,t){typeof t!="function"&&(t=function(){});var n=!Array.isArray(e);function o(s){return n?!0:Ae.indexOf(e,s)!==-1}var i=[],a=!1;return{onIgnoreTag:function(s,u,l){if(o(s))if(l.isClosing){var c="[/removed]",f=l.position+c.length;return i.push([a!==!1?a:l.position,f]),a=!1,c}else return a||(a=l.position),"[removed]";else return t(s,u,l)},remove:function(s){var u="",l=0;return Ae.forEach(i,function(c){u+=s.slice(l,c[0]),l=c[1]}),u+=s.slice(l),u}}}function Po(e){for(var t="",n=0;n<e.length;){var o=e.indexOf("<!--",n);if(o===-1){t+=e.slice(n);break}t+=e.slice(n,o);var i=e.indexOf("-->",o);if(i===-1)break;n=i+3}return t}function Vo(e){var t=e.split("");return t=t.filter(function(n){var o=n.charCodeAt(0);return o===127?!1:o<=31?o===10||o===13:!0}),t.join("")}R.whiteList=Ft();R.getDefaultWhiteList=Ft;R.onTag=_o;R.onIgnoreTag=Co;R.onTagAttr=Ao;R.onIgnoreTagAttr=So;R.safeAttrValue=Io;R.escapeHtml=Pt;R.escapeQuote=Vt;R.unescapeQuote=Mt;R.escapeHtmlEntities=jt;R.escapeDangerHtml5Entities=Ut;R.clearNonPrintableCharacter=Wt;R.friendlyAttrValue=qt;R.escapeAttrValue=zt;R.onIgnoreTagStripAll=Fo;R.StripTagBody=Do;R.stripCommentTag=Po;R.stripBlankChar=Vo;R.attributeWrapSign='"';R.cssFilter=Dt;R.getDefaultCSSWhiteList=To;var Oe={},K=Xe;function Mo(e){var t=K.spaceIndex(e),n;return t===-1?n=e.slice(1,-1):n=e.slice(1,t+1),n=K.trim(n).toLowerCase(),n.slice(0,1)==="/"&&(n=n.slice(1)),n.slice(-1)==="/"&&(n=n.slice(0,-1)),n}function jo(e){return e.slice(0,2)==="</"}function Uo(e,t,n){var o="",i=0,a=!1,s=!1,u=0,l=e.length,c="",f="";e:for(u=0;u<l;u++){var m=e.charAt(u);if(a===!1){if(m==="<"){a=u;continue}}else if(s===!1){if(m==="<"){o+=n(e.slice(i,u)),a=u,i=u;continue}if(m===">"||u===l-1){o+=n(e.slice(i,a)),f=e.slice(a,u+1),c=Mo(f),o+=t(a,o.length,c,f,jo(f)),i=u+1,a=!1;continue}if(m==='"'||m==="'")for(var d=1,w=e.charAt(u-d);w.trim()===""||w==="=";){if(w==="="){s=m;continue e}w=e.charAt(u-++d)}}else if(m===s){s=!1;continue}}return i<l&&(o+=n(e.substr(i))),o}var Wo=/[^a-zA-Z0-9\\_:.-]/gim;function qo(e,t){var n=0,o=0,i=[],a=!1,s=e.length;function u(d,w){if(d=K.trim(d),d=d.replace(Wo,"").toLowerCase(),!(d.length<1)){var v=t(d,w||"");v&&i.push(v)}}for(var l=0;l<s;l++){var c=e.charAt(l),f,m;if(a===!1&&c==="="){a=e.slice(n,l),n=l+1,o=e.charAt(n)==='"'||e.charAt(n)==="'"?n:Go(e,l+1);continue}if(a!==!1&&l===o){if(m=e.indexOf(c,l+1),m===-1)break;f=K.trim(e.slice(o+1,m)),u(a,f),a=!1,l=m,n=l+1;continue}if(/\s|\n|\t/.test(c))if(e=e.replace(/\s|\n|\t/g," "),a===!1)if(m=zo(e,l),m===-1){f=K.trim(e.slice(n,l)),u(f),a=!1,n=l+1;continue}else{l=m-1;continue}else if(m=Ho(e,l-1),m===-1){f=K.trim(e.slice(n,l)),f=ft(f),u(a,f),a=!1,n=l+1;continue}else continue}return n<e.length&&(a===!1?u(e.slice(n)):u(a,ft(K.trim(e.slice(n))))),K.trim(i.join(" "))}function zo(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Go(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="'"||n==='"'?t:-1}}function Ho(e,t){for(;t>0;t--){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Xo(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function ft(e){return Xo(e)?e.substr(1,e.length-2):e}Oe.parseTag=Uo;Oe.parseAttr=qo;var Jo=He.FilterCSS,U=R,Gt=Oe,Yo=Gt.parseTag,Ko=Gt.parseAttr,Ce=Xe;function Te(e){return e==null}function Qo(e){var t=Ce.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=Ce.trim(e.slice(t+1,-1));var n=e[e.length-1]==="/";return n&&(e=Ce.trim(e.slice(0,-1))),{html:e,closing:n}}function Zo(e){var t={};for(var n in e)t[n]=e[n];return t}function ei(e){var t={};for(var n in e)Array.isArray(e[n])?t[n.toLowerCase()]=e[n].map(function(o){return o.toLowerCase()}):t[n.toLowerCase()]=e[n];return t}function Ht(e){e=Zo(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=U.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=ei(e.whiteList||e.allowList):e.whiteList=U.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":U.attributeWrapSign,e.onTag=e.onTag||U.onTag,e.onTagAttr=e.onTagAttr||U.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||U.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||U.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||U.safeAttrValue,e.escapeHtml=e.escapeHtml||U.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Jo(e.css))}Ht.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onTag,a=n.onIgnoreTag,s=n.onTagAttr,u=n.onIgnoreTagAttr,l=n.safeAttrValue,c=n.escapeHtml,f=t.attributeWrapSign,m=t.cssFilter;n.stripBlankChar&&(e=U.stripBlankChar(e)),n.allowCommentTag||(e=U.stripCommentTag(e));var d=!1;n.stripIgnoreTagBody&&(d=U.StripTagBody(n.stripIgnoreTagBody,a),a=d.onIgnoreTag);var w=Yo(e,function(v,b,p,h,k){var T={sourcePosition:v,position:b,isClosing:k,isWhite:Object.prototype.hasOwnProperty.call(o,p)},I=i(p,h,T);if(!Te(I))return I;if(T.isWhite){if(T.isClosing)return"</"+p+">";var F=Qo(h),D=o[p],g=Ko(F.html,function(y,E){var C=Ce.indexOf(D,y)!==-1,N=s(p,y,E,C);return Te(N)?C?(E=l(p,y,E,m),E?y+"="+f+E+f:y):(N=u(p,y,E,C),Te(N)?void 0:N):N});return h="<"+p,g&&(h+=" "+g),F.closing&&(h+=" /"),h+=">",h}else return I=a(p,h,T),Te(I)?c(h):I},c);return d&&(w=d.remove(w)),w};var ti=Ht;(function(e,t){var n=R,o=Oe,i=ti;function a(u,l){var c=new i(l);return c.process(u)}t=e.exports=a,t.filterXSS=a,t.FilterXSS=i,function(){for(var u in n)t[u]=n[u];for(var l in o)t[l]=o[l]}(),typeof window<"u"&&(window.filterXSS=e.exports);function s(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}s()&&(self.filterXSS=e.exports)})(Fe,Fe.exports);var ni=Fe.exports;const ri=uo(ni);function oi(e){return e=e.replace(/\*\*([^*]+)\*\*/g,"<b>$1</b>"),e=e.replace(/\[icon:([^\]]+)]/g,"<widget-icon>$1</widget-icon>"),e=e.replace(/\[(.*)]\((.*)\)/g,'<router-link to = "$2">$1</router-link>'),ri(e)}function ii(e,t,n,o){let i=e+t/60+n/3600;return(o=="S"||o=="W")&&(i=i*-1),i}function ai(e,t){const n={dir:e<0?t==="long"?"W":"S":t==="long"?"E":"N",deg:0|(e<0?e=-e:e),min:0|(e+=1e-9)%1*60,sec:(0|e*60%1*6e3)/100};return`${n.deg}° ${n.min}' ${n.sec}" ${n.dir}`}function Je(e,t){return`/forms/${e}/${t}`}function Xt(e,t,n){const o=Z.getScope(e.toLowerCase());return t.map(i=>(typeof i.label=="string"&&(i.label=o(i.label)),i.type==="history"&&(i.onClick=a=>ne.openModal("modal-history",{id:a.Id,entity:e}),i.icon="history",i.class="widget-list-cell-history"),(i.entity||i.useObjectTypeName)&&Array.isArray(i.name)&&i.name.length>1&&(i.modal===!0?(i.onClick=a=>{ne.openModal("form",{entity:dt(i,a),id:a[ge(i)]})},i.class="widget-table-cell_link cursor_pointer"):i.link=a=>{if(typeof a!="object"||a==null)return null;const s=i.name[0],u=a[s];return u?Je(dt(i,a),u):null},i.value=(a,s)=>s[i.name[1]]),si(i,i.type,i.presentation),A.listConvertCellConfigHandler&&A.listConvertCellConfigHandler(e,i),i))}function si(e,t,n){switch(t){case"DateTime":{e.type="dateWithTime";break}case"Decimal":{n==="Money"&&(e.type="money");break}}return e}const dt=(e,t)=>e.useObjectTypeName?t[e.name[2]]:e.entity?e.entity:null;function pt(e){return typeof e!="object"||e===null?null:e[_.TABLE_MOCK_FIELD]}function li(e,t){return typeof e!="object"||e===null?(console.warn("cell data is not a valid object."),e):(typeof t=="string"||typeof t=="number"||typeof t=="function"?(typeof t=="function"&&(t=t(e)),e[_.TABLE_MOCK_FIELD]=t):e[_.TABLE_MOCK_FIELD]=e.Id,e)}var Ye=(e=>(e.form="form",e.inline="inline",e.modal="modal",e))(Ye||{});function ci(){const e=r.ref(null);function t(n){e.value=n}return{activeRow:e,activateRow:t}}function ui(e,t){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(t)}async function Jt(e,t){e()&&(await t(),await Jt(e,t))}function fi(e,t,n={}){let o=!1;const i=r.ref(""),a=r.computed(()=>s.filter(g=>c(g,i.value))),s=r.reactive([]);let u=0;const l=r.ref(!1);let c=(n==null?void 0:n.filterSearchFn)||((g,y)=>ui(g,y));function f(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function m(){const g=I();return typeof g.limit!="number"&&(g.limit=100),g.offset=u,(n.request||ce)(e,g).then(E=>(u+=E.length,E))}function d(g,y){var C;return typeof g.Version=="number"?g.Version:(C=s.find(N=>N.Id===y))==null?void 0:C.Version}function w(g,y){const E=s.findIndex(C=>C.Id===g);if(E===-1)throw new Error(`Can't found item with Id ${g}`);s.splice(E,1,y)}function v(g){const y=s.findIndex(E=>E.Id===g);if(y===-1)throw new Error(`Can't found item with Id ${g}`);s.splice(y,1)}async function b(g,y){try{const E=I(),C=d(y,g);delete y.Version,await Ge(e,{id:g,values:y,version:C,masterEntities:f()});const N=await ce(e,{fields:E.fields||"",id:g});w(g,N)}catch(E){z()(E)}}async function p(g,y={}){try{const E=I(),C=d(y,g);delete y.Version,await Rt(e,{id:g,version:C,masterEntities:f()}),v(g)}catch(E){z()(E)}}async function h(g){try{await Nt(e,{values:g,masterEntities:f()}),await F()}catch(y){z()(y)}}let k;async function T(){l.value=!0;try{k!=null&&k.signal&&!k.signal.aborted&&k.abort();let g=k=new AbortController,y=0;const C=I().limit||0;if(i.value&&!C){console.warn("Using textSearch assumes the use of limit.");return}await Jt(()=>(C>0?y<C:!0)&&!o&&!g.signal.aborted,async()=>{const N=await m();g.signal.aborted||(s.push(...N),y+=N.filter(W=>c(W,i.value)).length,(N.length<C||C===0)&&(o=!0))})}catch(g){z()(g)}l.value=!1}function I(){return typeof t=="function"?t():t}async function F(){try{u=0,o=!1,s.splice(0,s.length),await T()}catch(g){z()(g)}}function D(){if(k)return k.abort();l.value=!1}return{array:s,updateById:b,next:T,reload:F,wait:l,create:h,deleteById:p,textSearch:i,filteredArray:a,abort:D}}function di(){function e(){return{organizations:q.organizations,currentContextId:q.contextId,person:q.person,context:q.context,contextType:q.contextType,userId:q.userId}}const t=r.reactive(e());return q.onupdateContext(()=>{Object.assign(t,e())}),t}function pi(e,t,n){return $().emit("communication:create",{entityName:e,entityCatalogId:t,targetCode:n})}function gi(e,t,n){return $().emit("communication:read",{entityName:e,entityCatalogId:t,targetCode:n})}function mi(e,t){return $().emit("communication-message:create",{communicationId:e,text:t})}function hi(e){return $().emit("communication-message:read",{communicationId:e})}function vi(e){const t=B.Form.getParentForm(),n=r.reactive([]);return t&&t.subscribe(e),e.read=()=>hi(e.id).then(o=>(n.splice(0,n.length,...o),o)),{array:n}}function yi(e,t){e.read=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return ce(e.name,o)}).then(Qe).then(i=>(i.hasOwnProperty("Version")&&(e.version=i.Version),e.setValues(i),i)).catch(z())},e.save=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return Ge(e.name,{id:o.id,values:e.changes,version:e.version})}).then(i=>{e.version=i.version}).catch(i=>{throw z()(i),i})};function n(){return typeof t=="function"?t():t}}function Le(e){if(!e)return r.inject(_.PROVIDE_NAME_METADATA);Se.initEntity(e);const t=r.computed(()=>Se.state[e]);return r.provide(_.PROVIDE_NAME_METADATA,t),t}function Ke(e,t={}){if(!e)return r.inject(_.PROVIDE_NAME_USAGE_CONTEXT);const n=r.ref(null);return r.provide(_.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await Jr(e,wi(t||{}))}}}function wi(e){return typeof e=="function"?e():e}function bi(e){if(!e)return r.inject(_.PROVIDE_NAME_ACTIONS);const t=r.ref(!1),n=r.reactive([]),o=r.computed(()=>n.map(s=>$t(e,s))),i={actions:o,update:a};r.provide(_.PROVIDE_NAME_ACTIONS,i),e.router=Me.useRouter();function a(){if(t.value)return;t.value=!0,n.splice(0,n.length);const s=e==null?void 0:e.form;return Ot({masterEntities:e==null?void 0:e.masterEntities,id:s==null?void 0:s.id,entity:s==null?void 0:s.name}).then(u=>n.splice(0,0,...u)).catch(z("error")).finally(()=>t.value=!1)}return{actions:o,update:a,loading:r.readonly(t)}}function Ei(e){function t(n){n.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",t)}),r.onUnmounted(()=>{document.removeEventListener("keypress",t)})}function ki(e,t={}){const n=r.reactive([]),o=l=>{const c=r.unref(e);if(l===void 0){n.length===0?c.forEach(a):c.forEach(s);return}i(l)?s(l):a(l)},i=l=>n.includes(l),a=l=>{t.handleSelect&&!t.handleSelect(l)||i(l)||n.push(l)},s=l=>{const c=n.findIndex(f=>f===l);c!==-1&&n.splice(c,1)},u=r.computed(()=>{const l=r.unref(e);return n.length===l.length&&l.length!==0});return[n,o,u,a,s]}function Ti(e){const t=r.ref(""),n=r.computed(()=>{const o=t.value.toLowerCase();return r.unref(e).filter(i=>t.value.length?Object.values(i).join().toLowerCase().includes(o):!0)});return{search:t,searchArray:n}}const he=new class{constructor(){this.store=r.reactive([])}add(t,n,o={}){const i=_i(o),a=new Pe(t,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(t){const n=this.store.findIndex(o=>o.id===t);if(n===-1)return!1;this.store.splice(n,1)}};function _i(e){function t(o){return!!o&&typeof o=="object"}const n={timeout:10,click:()=>null,children:[]};return t(e)?{timeout:e.timeout||n.timeout,click:e.click||n.click,children:e.children||n.children}:n}const Ie=class Ie{constructor(t,n,o,i,a){this.type=t,this.message=n,this.timeout=o,this.children=i,this.click=a,this.id=Ie.cardId++}};Ie.cardId=1;let Pe=Ie;/*!
5
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),x=require("jenesius-vue-form"),Me=require("vue-router"),Qt=require("date-and-time"),Ne=require("debug"),ne=require("jenesius-vue-modal"),S=class S extends Error{constructor(t,n=null){super(),this.message=t,this.details=n,this.id=S.ID++}static ParentFormNotFound(){return new S("Can't found parent form.")}static UndefinedNameOfCompositeFormController(t){return new S("Composite object name is undefined",t)}static EntityWithoutName(t){return new S("'Entity doesn't have a name",t)}static NotResolvedNameEventEmitter(t){return new S(`'${t}' is not a valid Event emitter name`)}static FormIsNotValidated(t){return new S("Form is not validated",t)}static ListWorkerIsRunningOrEnd(t){return new S("List data request is running or already done",t)}static ObjectIdNotNumber(t){return new S(`${t} (id) is not a number`)}static UndefinedErrorId(t,n){return S.ApiNotAvailable()}static ApiError(t){return new S("Request error",t)}static ApiNotAvailable(){return new S(`Sorry, we experience difficulties here.
6
+ Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(t,n){return!t&&!n?S.ApiNotAvailable():new S(t||"Authorization Error",n)}static ApiResponseParseFailed(){return S.ApiNotAvailable()}static MissingIdInValuesEntity(t){return new S("Object doesn't have id",t)}static ObjectWithIdNotFound(t,n){return new S(`Can't find object with id: ${t}`,n)}static ObjectWithoutConnectToPresentArray(t,n){return new S("Object is not found.",{object:t,array:n})}static EntityWithoutId(t){return new S("Entity doesn't have id.",t)}static NotFoundedTableIndex(t,n){return new S(`Can't find the element with tableIndex ${t}`,n)}static UndefinedError(t,n=[]){return new S(t,n)}static TableArrayAlreadyIncludeProvidedIndexValue(t,n,o){return new S(`Array already includes the element with value ${t}`,{array:n,table:o})}static MetadataEntityIsNotAvailable(t){return new S(`Metadata for the ${t} is not currently available.`)}static RequestTookToLong(){return new S("The request took too long to complete. Try again later.")}};S.ID=0;let Q=S;const Zt="Please try again later or submit a feedback if problem doesn't go.";function en(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return Zt}})}function J(e,t={}){return t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw Q.ApiNotAvailable()}).then(n=>en(n).then(o=>{if(!n.ok)throw o;return o}))}class tn{constructor(){this.public=!1,this.errors=new Proxy([],{set:(t,n,o)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),t[n]=o,!0)}),window._journal=this}get error(){return{add:(...t)=>{this.errors.push(t)},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 tn;function rt(e){return{...e,createdEntities:e.createdEntites}}const ie=class ie{static async getStartConfig(t,n){return J([ie.url,t,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(t,n){return J([ie.url,t,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(rt)}static async runStep(t,n,o,i,a){return J([ie.url,t,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:o,token:i,values:a})}).then(rt)}};ie.url="/close-api/views/process-wizard";let ae=ie;class nn{static invite(t,n,o){return J("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:t,personKey:n,relatedRoleCode:o})})}static accept(t,n){return J("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:t,version:n,mark:!0})})}static decline(t,n){return J("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:t,version:n,mark:!1})})}}class rn{static getRequiredDocuments(t,n,o){const i=new URLSearchParams({entity:t,primaryKey:n,statusCode:o});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(a=>a.json())}}class oe{static url(){return"close-api/billing"}static getBillingMetadata(t){return fetch(`/${oe.url()}/calculator/${t}`)}static calculate(t,n){return J(`/${oe.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:t,values:n})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):Q.ApiNotAvailable()})}static parseMetadataField(t){function n(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:t.name,label:t.title,required:t.required,type:n(t)}}static createOnlinePayment(t,n){return J(`/${oe.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:t,returnURL:n})})}static applyOnlinePayment(t){return J(`/${oe.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:t})})}}function on(e){return e.statusName==="Completed"}function an(e){return["FinalStepWithConfirmation","NextStepWithConfirmation"].includes(e.statusName)}function sn(e){return e.statusName==="ValidationError"}function ln(e){return e.statusName==="Undefined"}function cn(e,t,n){let o=null,i=[];const a=r.ref(!1),s=r.ref(null),u=r.computed(()=>i.find(p=>p.name===s.value)||null),l=r.computed(()=>{var p;return((p=u.value)==null?void 0:p.fields)||[]});async function c(p){if(ln(p)){await n.onDisplayDataSet(p);return}if(!(an(p)&&!await n.onDisplayDataSet(p))){if(sn(p))return void n.onValidation(p.validationResults);if(await d(p),console.log(i,l.value,s.value),(p.statusName==="FinalStep"||p.statusName==="NextStep")&&(!l.value.length||un(l.value,n.presets)))return b(n.presets||{});on(p)&&n.onCompleted(p)}}async function f(){try{await h(),await v()}catch(p){const{message:m}=me(p);he.add("error",m)}}function h(){return a.value="Loading process information.",ae.getStartConfig(t,e).then(p=>i=p.steps.map(m=>{const k=m.frontendEntity.rootObject,T=Object.fromEntries(m.frontendEntity.objectTypes.map(I=>[I.name,I.properties]));return{label:m.title,name:m.stepName,number:m.number,rootObjectName:k,objectTypes:T,fields:T[k],buttonCaption:m.buttonCaption}})).finally(()=>{a.value=!1})}async function d(p){return new Promise(m=>{["FinalStepWithConfirmation","NextStepWithConfirmation","NextStep","Completed","FinalStep"].includes(p.statusName)&&(o=p.token,s.value=p.nextStepName),setTimeout(()=>m(p),5)})}function w(p){const m=me(p);he.add("error",m.message)}function v(){return a.value="Starting process",ae.startProcess(t,e).then(c).catch(w).finally(()=>{a.value=null})}function b(p={}){return!o||!s.value?Promise.reject("Not step or token."):(a.value="Waiting for result...",ae.runStep(t,e,s.value,o,p).then(c).catch(w).finally(()=>{a.value=!1}))}return{initialize:f,loading:a,currentStepConfig:u,currentStepFields:l,currentStepName:s,next:b}}function un(e,t){for(let n=0;n<e.length;n++){const o=e[n];if(!x.utils.getPropFromObject(t,o.name))return!1}return!0}const fn={class:"widget-table__head-cell"},dn={class:"widget-table__head-label margin_0 text_overflow"},yt=r.defineComponent({__name:"widget-table-head-cell",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("th",fn,[r.createElementVNode("span",dn,r.toDisplayString(t.label),1)]))}}),pn={class:"widget-table__head"},gn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>A.componentTableHeadCell||yt),(t,n)=>(r.openBlock(),r.createElementBlock("tr",pn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.config,o=>r.renderSlot(t.$slots,"default",r.mergeProps({ref_for:!0},o),void 0,!0)),256))]))}}),M=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},mn=M(gn,[["__scopeId","data-v-498c4f00"]]);function je(e){return Array.isArray(e)?je(e[0]):typeof e!="string"?null:e}function ge(e){return je(e.name)}function hn(e){const t=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let o;for(;(o=t.exec(e))!==null;)n.push(o[1]);return n}function vn(e,t){return hn(e).forEach(o=>{e=e.replace(new RegExp("\\$\\{"+o+"}","g"),x.utils.getPropFromObject(t,o))}),e}function xe(e){return t=>typeof t=="string"||typeof t=="number"?`${t} ${e}`:""}function Ue(e,t){const n=ge(e);if(typeof e.value=="string")return vn(e.value,t);let o=n?x.utils.getPropFromObject(t,n):null;if(o===void 0&&(o=null),typeof e.value=="function")return e.value(o,t);if(e.value===null)return null;if(e.unitValue&&(o=xe(e.unitValue)(o)),e.unit&&(o=xe(e.unit)(o)),e.type)switch(e.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=ze(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=_t(typeof o=="string"?o:null);break}case"money":{o=At(o);break}}return e.formatter&&(o=ue(e.formatter).exec(o,t)),typeof o=="boolean"&&(o=o?"✓":"—"),o}const yn=1,wn=5e3,bn="static-folder",wt="request-error",bt="Distinguisher",_={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",VISIBLE_ITEM_PROVIDE_NAME:"visible-item-provider",EVENT_FORM_UPDATE:"form-update",EVENT_AFFECTED_ENTITY:"affected-entity",DEFAULT_ORDER_DIR:"asc",TABLE_MOCK_FIELD:"_A_MOCK_ID_FIELD",OBJECT_TYPE_NAME_FIELD:bt};function Re(e){return[_.CORE_DEBUG_LABEL,e].join(":")}const En={class:"widget-filter-text flex gap_20"},kn=r.defineComponent({__name:"widget-filter-text",props:{values:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,o=t,i=r.ref("");function a(){o("update:values",i.value)}return r.watch(()=>n.values,s=>{if(typeof s!="string")return i.value="";i.value=s},{immediate:!0}),(s,u)=>{const l=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",En,[r.createVNode(r.unref(x.FormField),{type:"text",modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=c=>i.value=c)},null,8,["modelValue"]),r.createVNode(l,{onClick:a,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(Z)("Apply")),1)]),_:1})])}}}),Tn=M(kn,[["__scopeId","data-v-800b3803"]]),_n={class:"widget-filter-enum"},Cn=r.defineComponent({__name:"widget-filter-entity",props:{values:{},fieldMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:t}){const n=e,o=r.ref([]),i=Le(n.fieldMetadata.entity),a=c=>(n.values||[]).includes(c),s=t;function u(c){const f=n.values||[];return f.includes(c)?s("update:values",f.filter(h=>h!==c)):s("update:values",[...f,c])}async function l(){var h;if(!((h=n.fieldMetadata)!=null&&h.entity)||!i.value)return;const c=i.value.fieldNameForLabel,f=i.value.fieldNameForIdentification;s("readProcess","start"),o.value=await ce(n.fieldMetadata.entity,{fields:[c,f].join(" "),order:[c,"asc"]}).then(d=>(s("readProcess","end"),d.map(w=>({label:w[c],value:w[f]}))))}return r.watch(()=>i.value,l,{immediate:!0}),(c,f)=>(r.openBlock(),r.createElementBlock("div",_n,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,h=>(r.openBlock(),r.createBlock(r.unref(x.FormField),{class:"widget-filter-enum-item",key:h.value,onClick:()=>u(h.value),type:"single-checkbox","model-value":a(h.value),label:h.label},null,8,["onClick","model-value","label"]))),128))]))}}),An=M(Cn,[["__scopeId","data-v-cf143196"]]),A={getEntityLink(e,t){return`/forms/${e}/${t}`},iconHandlerText(){return""},iconTag:"i",tableFilterEntityBind:{String:Tn,Entity:An}};function Sn(e){for(let t in e)A[t]=e[t]}const In={props:{name:String},setup(e,t){let n="unknown";try{n=t.slots.default()[0].children}catch{n=e.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>r.h(A.iconTag,{class:A.iconHandler?A.iconHandler(n):`icon icon-${n}`},A.iconHandlerText(n))}},le=M(In,[["__scopeId","data-v-8a72b45f"]]),Nn=Ne(Re("setup-list-row"));function Rn(e,t){const n=e.config.map(o=>On(o,e,t));return r.h("tr",{class:"widget-table__row widget-table-row"},n)}function On(e,t,n){const o=t.values;let i=Ue(e,o);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function s(f){a.onClick.push(()=>f(o,e,n))}function u(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const l=[],c=[];if(e.hide&&e.hide(o))return[r.h("td")];if(e.type)switch(u(`widget-table-cell_${e.type}`),e.type){case"multi-select":{c.push(r.h(x.FormField,{type:"single-checkbox",modelValue:t.selected})),s(ot.bind(null,n,!0));break}case"select":{c.push(r.h(x.FormField,{type:"single-radio",modelValue:t.selected})),s(ot.bind(null,n,!1));break}}if(e.onClick&&s(e.onClick),e.link)try{const f=e.link(o);if(f){const h=r.h(Me.RouterLink,{to:f});c.push(h),u("widget-table-cell_link")}}catch(f){Nn("Can't add router link",f)}if(e.href&&(c.push(r.h("a",{href:e.href(o),target:"_blank"})),u("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&c.push(r.h("p",{class:"widget-list-cell-text"},i)),e.icon&&(typeof e.icon=="string"&&c.push(r.h(le,{name:e.icon})),typeof e.icon=="function")){const f=e.icon(o);f!==null&&c.push(r.h(le,{name:f}))}return e.class&&(typeof e.class=="function"?u(e.class(o)):u(e.class)),A.listCellHandler&&A.listCellHandler(e,o,{cellNodeChildren:c,addClass:u,addHandleClick:s,context:n}),l.push(r.h("td",a,c)),l}function ot(e,t){e.emit("select",t)}function We(e,t){return()=>{try{return Rn(e,t)}catch(n){return console.warn(n),null}}}const Ln={props:{values:Object,config:Object,selected:Boolean},setup:We},$n=["colspan"],it=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(e,{emit:t}){const n=t,o=r.ref();return r.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(i,a)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[r.createElementVNode("td",{colspan:i.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.component),r.mergeProps(i.$attrs,{values:i.values,new:i.isNew,onClose:a[0]||(a[0]=s=>n("close")),onSave:a[1]||(a[1]=s=>n("save",s))}),null,16,["values","new"]))],8,$n)],512))}}),Bn={class:"widget-table"},at="update:selectedRows",xn="update:activeRow",Et=r.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1},useMockField:{type:Boolean,default:!1}},emits:["save","order"],setup(e,{emit:t}){const n=e,o=t,i=r.useSlots(),a=r.computed(()=>{var d;return(d=i==null?void 0:i.default)==null?void 0:d.call(i)[0]});function s(d){return n.useMockField?pt(d):d}function u(d,w=!0){if(!n.selectedRows)return;if(!w)return o(at,n.selectedRows.includes(d)?[]:[d]);const v=[...n.selectedRows],b=v.indexOf(d);return b===-1?v.push(d):v.splice(b,1),o(at,v)}function l(d){o(xn,d)}function c(d){o("save",d),o("update:activeRow",null)}const f=r.computed(()=>n.shortcut?n.config.filter(d=>d.name?!!n.array.find(v=>![null,""].includes(Ue(d,v))):!0):n.config),h=r.computed(()=>n.useMockField?n.array.filter(pt):n.array);return(d,w)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Bn,[r.createElementVNode("thead",null,[r.createVNode(mn,{config:f.value,onOrder:w[0]||(w[0]=v=>d.$emit("order",v))},{default:r.withCtx(v=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(d.$slots["head-cell"]||yt),r.normalizeProps(r.guardReactiveProps(v)),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.value,(v,b)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:b},[r.createVNode(Ln,{config:f.value,values:v,selected:d.selectedRows.includes(s(v)),onSelect:p=>u(s(v),p),onActivate:p=>l(s(v)),class:r.normalizeClass(d.classCallback?d.classCallback(v):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&d.activeRow===s(v)?(r.openBlock(),r.createBlock(it,{key:0,component:a.value,"row-length":d.config.length,values:v,onClose:w[1]||(w[1]=p=>o("update:activeRow",null)),onSave:c,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),d.activeRow===r.unref(_).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(it,{key:0,component:a.value,"row-length":f.value.length,onClose:w[2]||(w[2]=v=>o("update:activeRow",null)),onSave:c,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),Fn=r.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",{class:"widget-spinner",style:r.normalizeStyle({"border-left":`1.1em solid ${t.color}`})},null,4))}}),fe=M(Fn,[["__scopeId","data-v-0ef9ae88"]]),Dn={class:"widget-button"},Pn=r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("button",Dn,[t.wait?(r.openBlock(),r.createBlock(fe,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(t.$slots,"default",{},void 0,!0)]))}}),Vn=M(Pn,[["__scopeId","data-v-450dc564"]]),Mn={class:"widget-multi-button-wrap position_relative cursor_pointer"},jn={class:"widget-multi-button-body grid"},Un=["onClick"],Wn={class:"widget-multi-button-side-wrap"},qn=r.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(e){r.useCssVars(s=>({"04895bf1":o.value}));const t=e,n=r.reactive({active:!1,wait:!1}),o=r.computed(()=>t.array.length+(t.label?1:0));function i(s){if(!(typeof s!="function"||n.wait))return n.wait=!0,Promise.resolve().then(s).finally(()=>{n.wait=!1})}function a(s=!n.active){n.active=s}return(s,u)=>(r.openBlock(),r.createElementBlock("div",Mn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[r.createElementVNode("div",jn,[s.label?(r.openBlock(),r.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:u[0]||(u[0]=l=>a())},r.toDisplayString(s.label),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.array,(l,c)=>(r.openBlock(),r.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:c,onClick:f=>{i(l.callback),a(!1)}},r.toDisplayString(l.label),9,Un))),128))]),r.createElementVNode("div",Wn,[r.createElementVNode("div",{class:r.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:u[1]||(u[1]=l=>a())},[n.wait?(r.openBlock(),r.createBlock(r.unref(fe),{key:0,class:"widget-multi-button-side-spinner"})):s.array.length>1?(r.openBlock(),r.createBlock(r.unref(le),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),zn=M(qn,[["__scopeId","data-v-d43a76ce"]]),Gn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Hn={class:"text_md"},Xn=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",Gn,[r.createVNode(fe,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Hn,r.toDisplayString(t.label),1)]))}}),Jn=["alt","src"],Yn=r.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(e){const t=e,n=r.ref();return r.onMounted(()=>{n.value&&(n.value.src=t.src),n.value.onerror=function(){t.default&&(n.value.src=t.default)}}),(o,i)=>(r.openBlock(),r.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:n,src:o.src||o.$props.default},null,8,Jn))}}),Kn={props:{config:Array,values:Object,selected:Boolean},setup:We},Qn=M(Kn,[["__scopeId","data-v-344a8cc1"]]),Zn=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),er={class:"widget-list-head-cell"},tr=Zn(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),nr=r.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(e,{emit:t}){const n=e,o=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(i,a)=>(r.openBlock(),r.createElementBlock("th",null,[r.createElementVNode("div",er,[r.createElementVNode("div",{class:"head-cell-content flex_grow",style:r.normalizeStyle({"min-width":i.minWidth,"max-width":i.maxWidth,width:i.width})},[i.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(x.FormField),{key:0,type:"single-checkbox",onClick:a[0]||(a[0]=r.withModifiers(s=>o("select"),["stop","prevent"]))})):(r.openBlock(),r.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:a[1]||(a[1]=s=>o("order"))},r.toDisplayString(i.title||i.label),1))],4),i.name&&i.order.length&&i.order[0]===i.name?(r.openBlock(),r.createBlock(r.unref(le),{key:0,class:r.normalizeClass(["head-cell-order",{"head-cell-order_down":i.order.length>1&&i.order[1]==="desc"}])},{default:r.withCtx(()=>[r.createTextVNode("core-arrow-up")]),_:1},8,["class"])):r.createCommentVNode("",!0),tr])]))}}),rr=M(nr,[["__scopeId","data-v-bf495d6a"]]),or=r.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(e,{emit:t}){const n=e,o=t,i=r.ref(),a=r.ref();r.onMounted(()=>{function c(v,b){let p=-1;do p++,b-=v[p];while(b>0&&p<v.length);return p}function f(v,b){let p=0;for(;b>0&&b>v[p]&&p<v.length;)b-=v[p],p++;return console.log(b,p),p>0?p:0}function h(v){try{a.value.style.insetInlineStart=v+"px"}catch(b){console.log(b)}}function d(v){try{a.value.style.width=v+"px",a.value.style.minWidth=v+"px",a.value.style.maxWidth=v+"px"}catch(b){console.log(b)}}function w(v){return v===null?!1:v.classList.contains("head-cell-resize")}i.value.addEventListener("pointerdown",function(b){var O;function p(B){return B.screenX+T-D}const m=i.value,k=[...m.children].filter(B=>B.localName==="th"),T=((O=m.offsetParent)==null?void 0:O.scrollLeft)||0,I=k.map(B=>B.clientWidth),F=w(b.target),D=m.getBoundingClientRect().left,g=p(b),y=c(I,g),E=I.slice(0,y).reduce((B,P)=>B+P,0),C=g-E,N=m.offsetWidth,W=k[y].clientWidth;if(n.config[y].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",b.screenX),console.log("Widths",I),console.log("max width",N),console.log("Start Position",g),console.log("Position From",y),console.log("Start Position",y),console.log("Global offset (Отступ самой таблицы от края экрана)",D),console.log("Del",C),console.groupEnd(),a.value.innerText=k[y].textContent||"",a.value.style.display="grid",a.value.style.width=W+"px",a.value.style.cursor="grabbing",h(E),d(W),document.addEventListener("pointermove",j,{passive:!0}),document.addEventListener("pointerup",Y);function Y(B){if(console.group("END"),document.removeEventListener("pointermove",j),document.removeEventListener("pointerup",Y),F&&(n.config[y].width=a.value.style.width,n.config[y].minWidth=a.value.style.width,n.config[y].maxWidth=a.value.style.width,s(n.config)),!F){const P=B.screenX+T-D;console.log("ENP Position",P);const we=f(I,P);if(console.log(y,"->",we),we!==y){const de=n.config[y],$e=n.config;$e.splice(y,1),$e.splice(we,0,de),s($e)}else{const de=n.config[y].name;u(de)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function j(B){if(F){const de=p(B)-g+W;d(de);return}let P=B.screenX+T-D-C;P<0&&(P=0),P+W>N&&(P=N-W),h(P)}})});function s(c){o("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 f=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([c,f==="asc"?"desc":"asc"])}function l(c){o("update:order",c)}return(c,f)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.config,(h,d)=>(r.openBlock(),r.createBlock(rr,r.mergeProps({key:h,ref_for:!0},h,{onOrder:w=>u(h.name),onSelect:f[0]||(f[0]=w=>o("select")),order:c.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:a},"test",512)],512))}}),ir=M(or,[["__scopeId","data-v-ccffc6bd"]]),ar={class:"widget-list"},sr={class:"widget-list-body position_relative"},lr=50,cr=r.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(e,{emit:t}){const n=e,o=t;function i(l,c=!0){if(n.selectedRows)if(!c)s(n.selectedRows.includes(l)?[]:[l]);else{const f=[...n.selectedRows],h=f.indexOf(l);h===-1?f.push(l):f==null||f.splice(h,1),s(f)}}function a(){var l;if(((l=n.selectedRows)==null?void 0:l.length)!==n.array.length)return s([...n.array]);s([])}function s(l){o("update:selectedRows",l)}function u(l){if(!l)return;const c=l.target;c.scrollTop+c.clientHeight+lr>c.scrollHeight&&o("scrollEnd")}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[r.createElementVNode("table",ar,[r.createElementVNode("thead",null,[r.createVNode(ir,{onSelect:c[0]||(c[0]=f=>a()),"onUpdate:order":c[1]||(c[1]=f=>o("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>o("update:config",f)),config:l.config,order:l.order},null,8,["config","order"])]),r.createElementVNode("tbody",sr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(f,h)=>{var d;return r.openBlock(),r.createBlock(Qn,{key:h,class:"widget-list-row",values:f,config:l.config,selected:(d=l.selectedRows)==null?void 0:d.includes(f),onSelect:w=>i(f,w)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function qe(){var a;const e=r.computed(()=>Object.keys(n).length===0||Object.values(n).includes(!0)),t=(a=r.getCurrentInstance())==null?void 0:a.uid;if(!t)throw"Undefined instance. Please check it.";const n=r.reactive({});r.provide(_.VISIBLE_ITEM_PROVIDE_NAME,{show(s){n[s]=!0},hide(s){n[s]=!1},remove(s){delete n[s]}});const o=r.inject(_.VISIBLE_ITEM_PROVIDE_NAME,{show(){},hide(){},remove(){}});return{visible:e,controller:{show(){o==null||o.show(t)},hide(){o==null||o.hide(t)},remove(){o==null||o.remove(t)}},visibleItems:n}}const ur=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{}},setup(e){const t=e,n=Le(),o=Ke(),i=r.computed(()=>{var b,p;const d=l.value,w=c(d),v={type:w,disabled:!((b=u.value)!=null&&b.canSet),label:t.label};return d&&Object.assign(v,{suffix:w==="number"?d.valueUnit:void 0,required:s.includes(w||"")?!1:d.required,label:t.label||d.displayName}),Object.assign(v,((p=A.fieldParamsHandler)==null?void 0:p.call(A,d,u.value,v))||{}),v}),a=["MultiText","MultiWideText"],s=["switch","single-checkbox","single-radio"],u=r.computed(()=>{var d;return(d=o==null?void 0:o.value)==null?void 0:d.fields[t.name]}),l=r.computed(()=>{if(!n.value)return;const d=n.value.fieldsByName[t.name];if(d)return d});function c(d){if(typeof t.type=="string"&&t.type.length!==0)return t.type;if(d){if(d.type==="Reference"||d.type==="Owned")return d.referencedEntity;if(d.dataType==="Boolean")return"single-checkbox";if(d.dataType==="DateTime")return"date";if(d.dataType==="Integer"||d.dataType==="Decimal")return"number";if(d.dataType==="List")return d.aggregatedEntity;if(a.includes(d.presentationType))return"textarea";if(d.presentationType==="PhoneNumber")return"tel"}return"text"}const f=r.computed(()=>{var d;return((d=u.value)==null?void 0:d.canGet)===!0}),{controller:h}=qe();return r.watch(()=>f.value,d=>d?h.show():h.hide(),{immediate:!0}),r.onUnmounted(()=>h.remove()),(d,w)=>f.value?(r.openBlock(),r.createBlock(r.unref(x.FormField),r.mergeProps({key:0},{...d.$attrs,...i.value},{name:d.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function fr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||_.DEFAULT_ORDER_DIR}const dr=["fill"],pr=r.createElementVNode("path",{d:"M440-647 244-451q-12 12-28 11.5T188-452q-11-12-11.5-28t11.5-28l264-264q6-6 13-8.5t15-2.5q8 0 15 2.5t13 8.5l264 264q11 11 11 27.5T772-452q-12 12-28.5 12T715-452L520-647v447q0 17-11.5 28.5T480-160q-17 0-28.5-11.5T440-200v-447Z"},null,-1),gr=[pr],mr=r.defineComponent({__name:"widget-icon-arrow-up",props:{color:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:t.color},gr,8,dr))}}),hr={class:"widget-fast-table-head-cell-td"},vr={class:"widget-head-cell-label"},yr={key:0,class:"widget-head-cell-order"},wr=r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{}},setup(e){const t=e,n=r.computed(()=>je(t.name));return r.computed(()=>fr(t.order)),(o,i)=>{var a;return r.openBlock(),r.createElementBlock("td",hr,[r.createElementVNode("div",{class:"widget-head-cell",onClick:i[0]||(i[0]=s=>o.$emit("order",o.name))},[r.createElementVNode("span",vr,r.toDisplayString(o.label),1),n.value===((a=o.order)==null?void 0:a[0])?(r.openBlock(),r.createElementBlock("div",yr,[r.createVNode(mr,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${o.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)])])}}}),kt=M(wr,[["__scopeId","data-v-9db5d417"]]),br=["fill"],Er=r.createElementVNode("path",{d:"M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z"},null,-1),kr=[Er],Tr=r.defineComponent({__name:"widget-icon-keyboard-arrow-down",props:{color:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:t.color},kr,8,br))}}),_r={class:"widget-filter-item-popup"},Cr=r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filterItem:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,o=t,i=A.tableFilterEntityBind,a=r.ref(),s=r.computed(()=>{const w=n.filterItem;return w.entity?"Entity":w.type?w.type:null});function u(w){l.value=w==="start"}const l=r.ref(!1),c=r.computed(()=>Array.isArray(n.values)||typeof n.values=="string"?n.values.length>0:!!n.values),f=r.ref(!1);let h=null;function d(w=!f.value){f.value=w,!f.value&&h?(h(),h=null):a.value&&(h=x.utils.clickOutside(a.value,d.bind(null,!1)))}return(w,v)=>{var b;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:"widget-filter-item",onClick:v[0]||(v[0]=()=>d())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":c.value}])},r.toDisplayString(w.filterItem.label||"--"),3),l.value?(r.openBlock(),r.createBlock(fe,{key:0})):(r.openBlock(),r.createBlock(Tr,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":f.value})},null,8,["class"]))]),r.withDirectives(r.createElementVNode("div",_r,[s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((b=r.unref(i))==null?void 0:b[s.value]),{key:0,"field-metadata":w.filterItem,values:w.values,"onUpdate:values":v[1]||(v[1]=p=>o("update:values",p)),onReadProcess:u},null,40,["field-metadata","values"])):r.createCommentVNode("",!0)],512),[[r.vShow,f.value]])],512)}}}),Tt=M(Cr,[["__scopeId","data-v-5b9128bc"]]),Ar={class:"widget-table-panel-filter flex"},Sr=r.defineComponent({__name:"widget-table-panel-filters",props:{filtersConfig:{},filters:{},entity:{}},emits:["update:filters"],setup(e,{emit:t}){const n=e,o=t;function i(a,s){o("update:filters",{...n.filters,[a]:s})}return(a,s)=>(r.openBlock(),r.createElementBlock("div",Ar,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(u,l)=>{var c;return r.openBlock(),r.createBlock(Tt,{key:l,entity:a.entity,"filter-item":u,values:(c=a.filters)==null?void 0:c[r.unref(ge)(u)],"onUpdate:values":f=>i(r.unref(ge)(u),f)},null,8,["entity","filter-item","values","onUpdate:values"])}),128))]))}}),Ir=M(Sr,[["__scopeId","data-v-f1534314"]]),Nr={class:"es-grid es-gap-15"},Rr={key:0,class:"title-md color-primary margin-0"},Or={key:0,class:"widget-table-loader es-flex es-gap-10 es-flex-align-center es-padding-10 text-main"},Lr=r.createElementVNode("span",null,"Loading...",-1),$r={class:"widget-fast-table-tools es-flex es-gap-15"},Br={class:""},xr=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{}},setup(e){const t=e,n=Me.useRouter(),o=r.ref([]),i=r.ref(null),a=r.ref(null),s=r.ref(null),u=x.Form.getParentForm();Le(t.entity);const{state:l,update:c}=Ke(t.entity,{masterEntities:t.masterEntities||[]}),f=(t.actions||[]).map(g=>Lt(g)),h=r.computed(()=>i.value?Xt(t.entity,i.value.config):[]),d=r.computed(()=>{var g;return((g=i.value)==null?void 0:g.displayItem)||Ye.inline}),w=r.computed(()=>{var g;return((g=i.value)==null?void 0:g.newItem)||d.value}),v=_e(async()=>{try{await p.call(),await c()}catch(g){const{message:y}=me(g);a.value=y}});u instanceof x.Form&&u.subscribe({read:v.call.bind(null),name:t.entity,type:"table"}),r.onMounted(()=>{b.call(),v.call()});const b=_e(async function(){const y=t.entity;i.value=await It(y,t.mark)}),p=_e(async function(){var E,C,N;const y=t.entity;a.value=null,b.promise&&await b.promise,o.value=(await ce(y,{customFilters:((E=i.value)==null?void 0:E.customFilters)||[],fields:Ct(h.value).join(" "),order:((C=i.value)==null?void 0:C.order)||[],filter:L.and(L(D.value),L(t.binding||{}),L(((N=i.value)==null?void 0:N.prefilters)||{}))})).map(li)});async function m(g){var E;if(g===null)return s.value=null;const y=g==null?void 0:g.Id;if(!y&&((E=i.value)!=null&&E.linkNew))return n.push(i.value.linkNew);if(d.value==="form")return n.push(Je(t.entity,y));if(d.value==="inline")return s.value=g||_.LIST_ACTIVE_NEW;d.value==="modal"?(await ne.promptModal("form",{entity:t.entity,id:y}),await p.call()):s.value=_.LIST_ACTIVE_NEW}const{controller:k}=qe();r.watch(()=>l.value,g=>{g&&(g.canRead?k.show():k.hide())},{immediate:!0}),r.onUnmounted(()=>k.remove());const T=[{icon:"reload",label:"Reload",callback(){v.call()}}];let I=[ve.on("affected-entity",g=>{g.name===t.entity&&p.call()}),ve.on("display-entity",async g=>{g.name===t.entity&&(p.promise&&await p.promise,s.value=o.value.find(y=>y.Id===g.id)||null)})];r.onUnmounted(()=>I.map(g=>g()));function F(g){var Y;function y(j){return Array.isArray(j)?y(j[0]):typeof j!="string"?null:j}const E=y(g);if(!E)return;const C=((Y=i.value)==null?void 0:Y.order)||[];(j=>{if(i.value)return i.value.order=j,!0})(C[0]!==E?[E,"asc"]:C[1]==="desc"?[]:[E,"desc"])&&p.call()}const D=r.ref({});return r.watch(()=>D.value,()=>p.call()),(g,y)=>{var N,W,Y,j;const E=r.resolveComponent("widget-button"),C=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",Nr,[(N=i.value)!=null&&N.label?(r.openBlock(),r.createElementBlock("p",Rr,r.toDisplayString((W=i.value)==null?void 0:W.label),1)):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"slide-up"},{default:r.withCtx(()=>[r.unref(v).wait||r.unref(b).wait||r.unref(p).wait?(r.openBlock(),r.createElementBlock("div",Or,[r.createVNode(r.unref(fe),{color:"var(--color-primary)"}),Lr])):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("div",$r,[w.value==="form"||(Y=r.unref(l))!=null&&Y.canCreate?(r.openBlock(),r.createBlock(E,{key:0,callback:m,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(" Add New ")]),_:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f).filter(O=>!!O.value),O=>{var B;return r.openBlock(),r.createBlock(E,{callback:(B=O.value)==null?void 0:B.callback,type:"primary"},{default:r.withCtx(()=>{var P;return[r.createTextVNode(r.toDisplayString((P=O.value)==null?void 0:P.label),1)]}),_:2},1032,["callback"])}),256)),(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(T,O=>r.createVNode(E,{onClick:()=>O.callback,callback:O.callback},{default:r.withCtx(()=>[r.createVNode(le,null,{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.icon),1)]),_:2},1024),r.createElementVNode("span",null,r.toDisplayString(O.label),1)]),_:2},1032,["onClick","callback"])),64))]),r.createElementVNode("div",Br,[r.createVNode(Ir,{entity:g.entity,"filters-config":((j=i.value)==null?void 0:j.filters)||[],filters:D.value,"onUpdate:filters":y[0]||(y[0]=O=>D.value=O)},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(Et),{config:h.value,array:o.value,"active-row":s.value,"onUpdate:activeRow":m,onOrder:F,class:"table"},{"head-cell":r.withCtx(O=>{var B;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.$slots["head-cell"]?g.$slots["head-cell"]:kt),r.mergeProps({label:O.label},O,{onOrder:F,order:((B=i.value)==null?void 0:B.order)||[]}),null,16,["label","order"]))]}),default:r.withCtx(()=>{var O;return[r.createVNode(C,{entity:g.entity,id:(O=s.value)==null?void 0:O.Id,"master-entities":g.masterEntities||void 0,binding:g.binding,onFormUpdate:y[1]||(y[1]=()=>{s.value=null,r.unref(p).call()})},null,8,["entity","id","master-entities","binding"])]}),_:1},8,["config","array","active-row"])])])}}});function _t(e){return ze(e,"YYYY/MM/DD HH:mm:ss")}function ze(e,t="YYYY/MM/DD"){if(!e)return"";try{const n=new Date(e);return Qt.format(n,t)}catch(n){return console.log(n),"Invalid date"}}function _e(e){function t(...o){if(n.wait)return Promise.reject("The process has already started.");n.wait=!0;const i=Promise.resolve().then(()=>e(...o)).finally(()=>{n.wait=!1,n.promise=null});return n.promise=i,i}const n=r.reactive({wait:!1,call:t,promise:null});return n}function me(e){return typeof e=="string"?be(e):Fr(e)?be(e.message,e.children||e.details||[]):Dr(e)?be(e.title,[e.detail||""]):be(_.DEFAULT_ERROR_MESSAGE)}function Fr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Dr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function be(e,t=[]){return{message:e,children:t}}function z(e="error"){return function(t){const{message:n,children:o}=me(t);he.add(e,n,{children:o})}}function ce(e,t={}){return $().emit("entity:read",{...t,entity:e})}function Ge(e,t){return $().emit("entity:update",{...t,entity:e})}function Ct(e){return e.reduce((t,n)=>(n.name&&(typeof n.name=="string"?t.push(n.name):t.push(...n.name)),t),[])}function At(e,t=2){if(!(typeof e=="string"||typeof e=="number"))return"";let o=String(e).split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.length<2&&(o[1]=""),o[1]=o[1].padEnd(t,"0"),o[1].length>t&&(o[1]=o[1].substring(0,t)),o.join(".")}function Pr(e,t){const n=new Map;return e.forEach(o=>{var a;const i=t(o);n.has(i)||n.set(i,[]),(a=n.get(i))==null||a.push(o)}),n}function Vr(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function Mr(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return _.DEFAULT_ERROR_MESSAGE}})}function V(e,t={}){return q.isFront&&(t.headers||(t.headers={}),t.headers["Context-Id"]=q.contextId),t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.reload():n).catch(()=>{throw new Error(_.DEFAULT_ERROR_MESSAGE)}).then(n=>Mr(n).then(o=>{if(!n.ok)throw o;return o}))}function jr(e,t=1e3){let n=0;return(...o)=>{clearTimeout(n),n=window.setTimeout(()=>e(...o),t)}}function Ur(e,t){let n=!1;return(...o)=>{if(!n)return n=!0,setTimeout(()=>n=!1,t),e(...o)}}const Wr=Ne(Re("pretty-value-field-by-entity"));function qr(e,t,n){try{const o=Se.get(e);if(!o)throw new Error("For entity metadata is not loaded");const i=o.fieldsByName[t];if(!i)throw new Error(`For entity ${e} can't found fieldMetadata for field ${t}`);return i.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(o){return Wr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',o,e,t,n),n}}const ee=Ne(Re("use-socket"));function $(){return Gr}function zr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const Gr=function(){let e=1,t,n;const o=new Set;let i=0;const a=new Set;function s(){if(t)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{t.close()},wn*2);const m=new Uint8Array(1);m[0]=yn,t.send(m)}setInterval(()=>{Array.from(o).forEach(m=>{p(m)&&(ee("Handler for event %s requestId %d was expired",m.event,m.requestId),m.requestId?l({requestId:m.requestId,event:wt,data:{message:Q.RequestTookToLong().message}}):o.delete(m))})},1e3),setInterval(()=>{(!t||t.readyState===3)&&c()},_.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:a,requestId:e,handlers:o,socketInstance:t}}function l(m){const k=[...o.values()];ee("Handlers array length is %d. Response event: %s. Request id: %d",o.size,m.event,m.requestId),k.forEach(T=>{const I=m.requestId;(T.requestId&&T.requestId===I||!T.requestId&&T.event===m.event)&&(ee("Find appropriated handler: %d, event: %s",e,T.event),T.callback(m.data,m),T.once&&(o.delete(T),ee("Handler was removed by *once* params was passed. %o",T)))})}function c(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),t=new WebSocket(n),t.onclose=function(m){ee("Connection to server was stopped: %d %s",m.code,m.reason),Array.from(o).forEach(k=>{k.guaranteedAnswer&&k.serializeString&&a.add(k.serializeString)})},t.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(m=>{f(m),a.delete(m)})},t.onerror=function(m){console.warn(m)},t.onmessage=m=>{var k;try{if(zr(m.data)){s();return}const T=JSON.parse(m.data);if(!St(T)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(T);return}(k=T==null?void 0:T.data)!=null&&k.refresh&&location.reload(),l(T)}catch(T){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(T)}}}function f(m){t.send(m)}function h(m,k){b({event:m,callback:k})}function d(m,k){b({event:m,callback:k,once:!0})}function w(){return t&&(t==null?void 0:t.readyState)===1}function v(m,k,T){const I=++e,F=JSON.stringify({requestId:I,event:m,data:k,contextId:q.contextId,url:A.socketURLHandler?A.socketURLHandler():window.location.href});return w()?f(F):(a.add(F),ee("Socket is not connected. Message was send to save-queue")),new Promise((D,g)=>{b({event:m,requestId:I,once:!0,guaranteedAnswer:!0,serializeString:F,callback:(y,E)=>{if(ee("Promise was resolve with next data:",y),Hr(E))return void g(y);T&&T(y,E),D(y)},timeToLive:_.TIME_TO_LIVE_SOCKET_REQUEST})})}function b(m){const k={timeToLive:0,...m,created:new Date().getTime()};o.add(k)}function p(m){return m.timeToLive===0||typeof m.timeToLive!="number"?!1:new Date().getTime()-m.created>m.timeToLive}return{get socket(){return t},on:h,once:d,emit:v,initialization(m){n=m},getDevInfo:u}}(),Hr=e=>!!St(e)&&e.event===wt,St=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function It(e,t){return $().emit("list-setting:read",{entity:e,mark:t})}function Xr(e,t){return $().emit("metadata-field:treat",{entity:e,fieldName:t})}function Nt(e,t){return $().emit("entity:create",{...t,entity:e})}function Rt(e,t){return $().emit("entity:delete",{...t,entity:e})}function Jr(e,t){return $().emit("usage-context:read",{...t,entity:e})}function Ot(e={}){return $().emit("tool:read",e)}function Yr(){return $().emit("metadata-list:read",{})}function Lt(e,t={},n={}){const o=r.inject(_.PROVIDE_NAME_ACTIONS,null),i=typeof e=="string"?e:t,a=typeof t=="string"?n:t;return r.computed(()=>{var l;const u=((typeof e=="string"?(l=o==null?void 0:o.actions)==null?void 0:l.value:r.unref(e))||[]).find(c=>c.name===i);return u?{...u,...a}:null})}function Kr(e){return $().emit("history:read",e)}function Qr(e,t){return $().emit("entity:count",{...t,entity:e})}function Zr(e){return`/${bn}/${e}`}function ue(e){return{exec(t,n){switch(e.name){case"replace-boolean":return ue.replaceBoolean(t,e.values);case"replace-record-operation":return ue.replaceRecordOperation(t)}}}}ue.replaceBoolean=eo;ue.replaceRecordOperation=to;function eo(e,t){return typeof e!="boolean"?"":e?t[1]:t[0]}function to(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function no(e={}){return $().emit("tool:execute",e)}const ro=Ne(Re("wrap-tool-response"));function $t(e,t){return e.handleConfirmation===void 0&&(e.handleConfirmation=ao),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=lo),e.handleCloseForm===void 0&&(e.handleCloseForm=co),e.handleValidationResult===void 0&&(e.handleValidationResult=so),{...t,label:t.title,callback(){var i;const n=typeof e.values=="function"?e.values(t,e):e.values,o=()=>no({name:t.name,values:n,usageContext:t.usageContext}).then(async a=>{var s,u;if(!oo(a))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(e.handlers))for await(const l of e.handlers)await l(t,a,e);if(!a.success)throw e.handleValidationResult&&a.validationEffect&&((u=(s=a.validationEffect)==null?void 0:s.results)!=null&&u.length)&&e.handleValidationResult(t,a.validationEffect,e),new Error(a.message);return a.message&&he.add("info",a.message),Array.isArray(a.affectedEntities)&&e.handleAffectedEntity&&a.affectedEntities.forEach(l=>{var c;return(c=e.handleAffectedEntity)==null?void 0:c.call(e,t,l,e)}),t.closeHostForm&&e.handleCloseForm&&e.handleCloseForm(t,e),a}).catch(z("error"));return(i=e.overrides)!=null&&i[t.name]?e.overrides[t.name](t,e):t.requireSave&&e.form&&e.form.changed?e.form.save().then(o):!t.confirmation||!e.handleConfirmation?o():e.handleConfirmation(t,o)}}}function oo(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function io(e){const t="Are you sure?";return e===!0||typeof e=="string"&&e.toLowerCase()==="true"||e==="1"?t:typeof e=="string"?e:t}async function ao(e,t){const n=io(e.confirmation);if(!ne.getComponentFromStore(_.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await ne.promptModal(_.MODAL_CONFIRM,{message:n}))return t()}function so(e,t){const n=_.MODAL_VALIDATION_EFFECT;if(!ne.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{ne.pushModal(n,t)})}function lo(e,t,n){var l;function o(c){return c!==null&&typeof c=="object"&&typeof c.read=="function"}function i(c,f){c&&(ro("Affected Entity %s. Find form with name %s.",f,c.name),c.name===f&&o(c)&&c.read(),c instanceof x.Form&&c.dependencies.forEach(h=>i(h,f)))}ve.emit("affected-entity",t);const{router:a,form:s}=n,u=(l=t.primaryKey)==null?void 0:l.Id;if(a&&t&&t.name===e.redirectEntity){ve.emit("display-entity",{id:u,name:t.name}),A.getEntityLink&&a.push(A.getEntityLink(t.name,u));return}i(s,t.name)}function co(e,t){const{router:n}=t;n&&e.closeHostForm&&n.back()}let te={};function Z(e,...t){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let n=x.utils.getPropFromObject((this==null?void 0:this.vocabulary)||te,e);if(typeof n=="string")return st(n,t);const o=x.utils.getPropFromObject(te==null?void 0:te.root,e);return typeof o=="string"?st(o,t):(typeof n===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function st(e,t){return t.forEach((n,o)=>{e=e.replaceAll(new RegExp(`\\{${o}}`,"g"),n)}),e}Z.setGlobalVocabulary=function(e){te=e};Z.getScope=function(e){const t=typeof e=="string"?e:"root";return typeof e!="string"&&console.warn(`SCOPE ${e} for translate is not string.`),Z.bind({vocabulary:x.utils.getPropFromObject(te,t.toLowerCase())})};Z.setVocabulary=function(e){return typeof e=="string"&&(e=x.utils.getPropFromObject(te,e)),Z.bind({vocabulary:e})};function uo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fe={exports:{}},R={},De={exports:{}},re={};function Bt(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function fo(e,t,n){}function po(e,t,n){}var go=/javascript\s*\:/img;function mo(e,t){return go.test(t)?"":t}re.whiteList=Bt();re.getDefaultWhiteList=Bt;re.onAttr=fo;re.onIgnoreAttr=po;re.safeAttrValue=mo;var ho={indexOf:function(e,t){var n,o;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var o,i;if(Array.prototype.forEach)return e.forEach(t,n);for(o=0,i=e.length;o<i;o++)t.call(n,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},pe=ho;function vo(e,t){e=pe.trimRight(e),e[e.length-1]!==";"&&(e+=";");var n=e.length,o=!1,i=0,a=0,s="";function u(){if(!o){var f=pe.trim(e.slice(i,a)),h=f.indexOf(":");if(h!==-1){var d=pe.trim(f.slice(0,h)),w=pe.trim(f.slice(h+1));if(d){var v=t(i,s.length,d,w,f);v&&(s+=v+"; ")}}}i=a+1}for(;a<n;a++){var l=e[a];if(l==="/"&&e[a+1]==="*"){var c=e.indexOf("*/",a+2);if(c===-1)break;a=c+1,i=a+1,o=!1}else l==="("?o=!0:l===")"?o=!1:l===";"?o||u():l===`
7
+ `&&u()}return pe.trim(s)}var yo=vo,Ee=re,wo=yo;function lt(e){return e==null}function bo(e){var t={};for(var n in e)t[n]=e[n];return t}function xt(e){e=bo(e||{}),e.whiteList=e.whiteList||Ee.whiteList,e.onAttr=e.onAttr||Ee.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||Ee.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||Ee.safeAttrValue,this.options=e}xt.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onAttr,a=n.onIgnoreAttr,s=n.safeAttrValue,u=wo(e,function(l,c,f,h,d){var w=o[f],v=!1;if(w===!0?v=w:typeof w=="function"?v=w(h):w instanceof RegExp&&(v=w.test(h)),v!==!0&&(v=!1),h=s(f,h),!!h){var b={position:c,sourcePosition:l,source:d,isWhite:v};if(v){var p=i(f,h,b);return lt(p)?f+":"+h:p}else{var p=a(f,h,b);if(!lt(p))return p}}});return u};var Eo=xt;(function(e,t){var n=re,o=Eo;function i(s,u){var l=new o(u);return l.process(s)}t=e.exports=i,t.FilterCSS=o;for(var a in n)t[a]=n[a];typeof window<"u"&&(window.filterCSS=e.exports)})(De,De.exports);var He=De.exports,Xe={indexOf:function(e,t){var n,o;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var o,i;if(Array.prototype.forEach)return e.forEach(t,n);for(o=0,i=e.length;o<i;o++)t.call(n,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/,n=t.exec(e);return n?n.index:-1}},ko=He.FilterCSS,To=He.getDefaultWhiteList,Ae=Xe;function Ft(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var Dt=new ko;function _o(e,t,n){}function Co(e,t,n){}function Ao(e,t,n){}function So(e,t,n){}function Pt(e){return e.replace(No,"&lt;").replace(Ro,"&gt;")}function Io(e,t,n,o){if(n=qt(n),t==="href"||t==="src"){if(n=Ae.trim(n),n==="#")return"#";if(!(n.substr(0,7)==="http://"||n.substr(0,8)==="https://"||n.substr(0,7)==="mailto:"||n.substr(0,4)==="tel:"||n.substr(0,11)==="data:image/"||n.substr(0,6)==="ftp://"||n.substr(0,2)==="./"||n.substr(0,3)==="../"||n[0]==="#"||n[0]==="/"))return""}else if(t==="background"){if(ke.lastIndex=0,ke.test(n))return""}else if(t==="style"){if(ct.lastIndex=0,ct.test(n)||(ut.lastIndex=0,ut.test(n)&&(ke.lastIndex=0,ke.test(n))))return"";o!==!1&&(o=o||Dt,n=o.process(n))}return n=zt(n),n}var No=/</g,Ro=/>/g,Oo=/"/g,Lo=/&quot;/g,$o=/&#([a-zA-Z0-9]*);?/gim,Bo=/&colon;?/gim,xo=/&newline;?/gim,ke=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,ct=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,ut=/u\s*r\s*l\s*\(.*/gi;function Vt(e){return e.replace(Oo,"&quot;")}function Mt(e){return e.replace(Lo,'"')}function jt(e){return e.replace($o,function(n,o){return o[0]==="x"||o[0]==="X"?String.fromCharCode(parseInt(o.substr(1),16)):String.fromCharCode(parseInt(o,10))})}function Ut(e){return e.replace(Bo,":").replace(xo," ")}function Wt(e){for(var t="",n=0,o=e.length;n<o;n++)t+=e.charCodeAt(n)<32?" ":e.charAt(n);return Ae.trim(t)}function qt(e){return e=Mt(e),e=jt(e),e=Ut(e),e=Wt(e),e}function zt(e){return e=Vt(e),e=Pt(e),e}function Fo(){return""}function Do(e,t){typeof t!="function"&&(t=function(){});var n=!Array.isArray(e);function o(s){return n?!0:Ae.indexOf(e,s)!==-1}var i=[],a=!1;return{onIgnoreTag:function(s,u,l){if(o(s))if(l.isClosing){var c="[/removed]",f=l.position+c.length;return i.push([a!==!1?a:l.position,f]),a=!1,c}else return a||(a=l.position),"[removed]";else return t(s,u,l)},remove:function(s){var u="",l=0;return Ae.forEach(i,function(c){u+=s.slice(l,c[0]),l=c[1]}),u+=s.slice(l),u}}}function Po(e){for(var t="",n=0;n<e.length;){var o=e.indexOf("<!--",n);if(o===-1){t+=e.slice(n);break}t+=e.slice(n,o);var i=e.indexOf("-->",o);if(i===-1)break;n=i+3}return t}function Vo(e){var t=e.split("");return t=t.filter(function(n){var o=n.charCodeAt(0);return o===127?!1:o<=31?o===10||o===13:!0}),t.join("")}R.whiteList=Ft();R.getDefaultWhiteList=Ft;R.onTag=_o;R.onIgnoreTag=Co;R.onTagAttr=Ao;R.onIgnoreTagAttr=So;R.safeAttrValue=Io;R.escapeHtml=Pt;R.escapeQuote=Vt;R.unescapeQuote=Mt;R.escapeHtmlEntities=jt;R.escapeDangerHtml5Entities=Ut;R.clearNonPrintableCharacter=Wt;R.friendlyAttrValue=qt;R.escapeAttrValue=zt;R.onIgnoreTagStripAll=Fo;R.StripTagBody=Do;R.stripCommentTag=Po;R.stripBlankChar=Vo;R.attributeWrapSign='"';R.cssFilter=Dt;R.getDefaultCSSWhiteList=To;var Oe={},K=Xe;function Mo(e){var t=K.spaceIndex(e),n;return t===-1?n=e.slice(1,-1):n=e.slice(1,t+1),n=K.trim(n).toLowerCase(),n.slice(0,1)==="/"&&(n=n.slice(1)),n.slice(-1)==="/"&&(n=n.slice(0,-1)),n}function jo(e){return e.slice(0,2)==="</"}function Uo(e,t,n){var o="",i=0,a=!1,s=!1,u=0,l=e.length,c="",f="";e:for(u=0;u<l;u++){var h=e.charAt(u);if(a===!1){if(h==="<"){a=u;continue}}else if(s===!1){if(h==="<"){o+=n(e.slice(i,u)),a=u,i=u;continue}if(h===">"||u===l-1){o+=n(e.slice(i,a)),f=e.slice(a,u+1),c=Mo(f),o+=t(a,o.length,c,f,jo(f)),i=u+1,a=!1;continue}if(h==='"'||h==="'")for(var d=1,w=e.charAt(u-d);w.trim()===""||w==="=";){if(w==="="){s=h;continue e}w=e.charAt(u-++d)}}else if(h===s){s=!1;continue}}return i<l&&(o+=n(e.substr(i))),o}var Wo=/[^a-zA-Z0-9\\_:.-]/gim;function qo(e,t){var n=0,o=0,i=[],a=!1,s=e.length;function u(d,w){if(d=K.trim(d),d=d.replace(Wo,"").toLowerCase(),!(d.length<1)){var v=t(d,w||"");v&&i.push(v)}}for(var l=0;l<s;l++){var c=e.charAt(l),f,h;if(a===!1&&c==="="){a=e.slice(n,l),n=l+1,o=e.charAt(n)==='"'||e.charAt(n)==="'"?n:Go(e,l+1);continue}if(a!==!1&&l===o){if(h=e.indexOf(c,l+1),h===-1)break;f=K.trim(e.slice(o+1,h)),u(a,f),a=!1,l=h,n=l+1;continue}if(/\s|\n|\t/.test(c))if(e=e.replace(/\s|\n|\t/g," "),a===!1)if(h=zo(e,l),h===-1){f=K.trim(e.slice(n,l)),u(f),a=!1,n=l+1;continue}else{l=h-1;continue}else if(h=Ho(e,l-1),h===-1){f=K.trim(e.slice(n,l)),f=ft(f),u(a,f),a=!1,n=l+1;continue}else continue}return n<e.length&&(a===!1?u(e.slice(n)):u(a,ft(K.trim(e.slice(n))))),K.trim(i.join(" "))}function zo(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Go(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="'"||n==='"'?t:-1}}function Ho(e,t){for(;t>0;t--){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Xo(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function ft(e){return Xo(e)?e.substr(1,e.length-2):e}Oe.parseTag=Uo;Oe.parseAttr=qo;var Jo=He.FilterCSS,U=R,Gt=Oe,Yo=Gt.parseTag,Ko=Gt.parseAttr,Ce=Xe;function Te(e){return e==null}function Qo(e){var t=Ce.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=Ce.trim(e.slice(t+1,-1));var n=e[e.length-1]==="/";return n&&(e=Ce.trim(e.slice(0,-1))),{html:e,closing:n}}function Zo(e){var t={};for(var n in e)t[n]=e[n];return t}function ei(e){var t={};for(var n in e)Array.isArray(e[n])?t[n.toLowerCase()]=e[n].map(function(o){return o.toLowerCase()}):t[n.toLowerCase()]=e[n];return t}function Ht(e){e=Zo(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=U.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=ei(e.whiteList||e.allowList):e.whiteList=U.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":U.attributeWrapSign,e.onTag=e.onTag||U.onTag,e.onTagAttr=e.onTagAttr||U.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||U.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||U.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||U.safeAttrValue,e.escapeHtml=e.escapeHtml||U.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Jo(e.css))}Ht.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onTag,a=n.onIgnoreTag,s=n.onTagAttr,u=n.onIgnoreTagAttr,l=n.safeAttrValue,c=n.escapeHtml,f=t.attributeWrapSign,h=t.cssFilter;n.stripBlankChar&&(e=U.stripBlankChar(e)),n.allowCommentTag||(e=U.stripCommentTag(e));var d=!1;n.stripIgnoreTagBody&&(d=U.StripTagBody(n.stripIgnoreTagBody,a),a=d.onIgnoreTag);var w=Yo(e,function(v,b,p,m,k){var T={sourcePosition:v,position:b,isClosing:k,isWhite:Object.prototype.hasOwnProperty.call(o,p)},I=i(p,m,T);if(!Te(I))return I;if(T.isWhite){if(T.isClosing)return"</"+p+">";var F=Qo(m),D=o[p],g=Ko(F.html,function(y,E){var C=Ce.indexOf(D,y)!==-1,N=s(p,y,E,C);return Te(N)?C?(E=l(p,y,E,h),E?y+"="+f+E+f:y):(N=u(p,y,E,C),Te(N)?void 0:N):N});return m="<"+p,g&&(m+=" "+g),F.closing&&(m+=" /"),m+=">",m}else return I=a(p,m,T),Te(I)?c(m):I},c);return d&&(w=d.remove(w)),w};var ti=Ht;(function(e,t){var n=R,o=Oe,i=ti;function a(u,l){var c=new i(l);return c.process(u)}t=e.exports=a,t.filterXSS=a,t.FilterXSS=i,function(){for(var u in n)t[u]=n[u];for(var l in o)t[l]=o[l]}(),typeof window<"u"&&(window.filterXSS=e.exports);function s(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}s()&&(self.filterXSS=e.exports)})(Fe,Fe.exports);var ni=Fe.exports;const ri=uo(ni);function oi(e){return e=e.replace(/\*\*([^*]+)\*\*/g,"<b>$1</b>"),e=e.replace(/\[icon:([^\]]+)]/g,"<widget-icon>$1</widget-icon>"),e=e.replace(/\[(.*)]\((.*)\)/g,'<router-link to = "$2">$1</router-link>'),ri(e)}function ii(e,t,n,o){let i=e+t/60+n/3600;return(o=="S"||o=="W")&&(i=i*-1),i}function ai(e,t){const n={dir:e<0?t==="long"?"W":"S":t==="long"?"E":"N",deg:0|(e<0?e=-e:e),min:0|(e+=1e-9)%1*60,sec:(0|e*60%1*6e3)/100};return`${n.deg}° ${n.min}' ${n.sec}" ${n.dir}`}function Je(e,t){return`/forms/${e}/${t}`}function Xt(e,t,n){const o=Z.getScope(e.toLowerCase());return t.map(i=>(typeof i.label=="string"&&(i.label=o(i.label)),i.type==="history"&&(i.onClick=a=>ne.openModal("modal-history",{id:a.Id,entity:e}),i.icon="history",i.class="widget-list-cell-history"),(i.entity||i.useObjectTypeName)&&Array.isArray(i.name)&&i.name.length>1&&(i.modal===!0?(i.onClick=a=>{ne.openModal("form",{entity:dt(i,a),id:a[ge(i)]})},i.class="widget-table-cell_link cursor_pointer"):i.link=a=>{if(typeof a!="object"||a==null)return null;const s=i.name[0],u=a[s];return u?Je(dt(i,a),u):null},i.value=(a,s)=>s[i.name[1]]),si(i,i.type,i.presentation),A.listConvertCellConfigHandler&&A.listConvertCellConfigHandler(e,i),i))}function si(e,t,n){switch(t){case"DateTime":{e.type="dateWithTime";break}case"Decimal":{n==="Money"&&(e.type="money");break}}return e}const dt=(e,t)=>e.useObjectTypeName?t[e.name[2]]:e.entity?e.entity:null;function pt(e){return typeof e!="object"||e===null?null:e[_.TABLE_MOCK_FIELD]}function li(e,t){return typeof e!="object"||e===null?(console.warn("cell data is not a valid object."),e):(typeof t=="string"||typeof t=="number"||typeof t=="function"?(typeof t=="function"&&(t=t(e)),e[_.TABLE_MOCK_FIELD]=t):e[_.TABLE_MOCK_FIELD]=e.Id,e)}var Ye=(e=>(e.form="form",e.inline="inline",e.modal="modal",e))(Ye||{});function ci(){const e=r.ref(null);function t(n){e.value=n}return{activeRow:e,activateRow:t}}function ui(e,t){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(t)}async function Jt(e,t){e()&&(await t(),await Jt(e,t))}function fi(e,t,n={}){let o=!1;const i=r.ref(""),a=r.computed(()=>s.filter(g=>c(g,i.value))),s=r.reactive([]);let u=0;const l=r.ref(!1);let c=(n==null?void 0:n.filterSearchFn)||((g,y)=>ui(g,y));function f(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function h(){const g=I();return typeof g.limit!="number"&&(g.limit=100),g.offset=u,(n.request||ce)(e,g).then(E=>(u+=E.length,E))}function d(g,y){var C;return typeof g.Version=="number"?g.Version:(C=s.find(N=>N.Id===y))==null?void 0:C.Version}function w(g,y){const E=s.findIndex(C=>C.Id===g);if(E===-1)throw new Error(`Can't found item with Id ${g}`);s.splice(E,1,y)}function v(g){const y=s.findIndex(E=>E.Id===g);if(y===-1)throw new Error(`Can't found item with Id ${g}`);s.splice(y,1)}async function b(g,y){try{const E=I(),C=d(y,g);delete y.Version,await Ge(e,{id:g,values:y,version:C,masterEntities:f()});const N=await ce(e,{fields:E.fields||"",id:g});w(g,N)}catch(E){z()(E)}}async function p(g,y={}){try{const E=I(),C=d(y,g);delete y.Version,await Rt(e,{id:g,version:C,masterEntities:f()}),v(g)}catch(E){z()(E)}}async function m(g){try{await Nt(e,{values:g,masterEntities:f()}),await F()}catch(y){z()(y)}}let k;async function T(){l.value=!0;try{k!=null&&k.signal&&!k.signal.aborted&&k.abort();let g=k=new AbortController,y=0;const C=I().limit||0;if(i.value&&!C){console.warn("Using textSearch assumes the use of limit.");return}await Jt(()=>(C>0?y<C:!0)&&!o&&!g.signal.aborted,async()=>{const N=await h();g.signal.aborted||(s.push(...N),y+=N.filter(W=>c(W,i.value)).length,(N.length<C||C===0)&&(o=!0))})}catch(g){z()(g)}l.value=!1}function I(){return typeof t=="function"?t():t}async function F(){try{u=0,o=!1,s.splice(0,s.length),await T()}catch(g){z()(g)}}function D(){if(k)return k.abort();l.value=!1}return{array:s,updateById:b,next:T,reload:F,wait:l,create:m,deleteById:p,textSearch:i,filteredArray:a,abort:D}}function di(){function e(){return{organizations:q.organizations,currentContextId:q.contextId,person:q.person,context:q.context,contextType:q.contextType,userId:q.userId}}const t=r.reactive(e());return q.onupdateContext(()=>{Object.assign(t,e())}),t}function pi(e,t,n){return $().emit("communication:create",{entityName:e,entityCatalogId:t,targetCode:n})}function gi(e,t,n){return $().emit("communication:read",{entityName:e,entityCatalogId:t,targetCode:n})}function mi(e,t){return $().emit("communication-message:create",{communicationId:e,text:t})}function hi(e){return $().emit("communication-message:read",{communicationId:e})}function vi(e){const t=x.Form.getParentForm(),n=r.reactive([]);return t&&t.subscribe(e),e.read=()=>hi(e.id).then(o=>(n.splice(0,n.length,...o),o)),{array:n}}function yi(e,t){e.read=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return ce(e.name,o)}).then(Qe).then(i=>(i.hasOwnProperty("Version")&&(e.version=i.Version),e.setValues(i),i)).catch(z())},e.save=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return Ge(e.name,{id:o.id,values:e.changes,version:e.version})}).then(i=>{e.version=i.version}).catch(i=>{throw z()(i),i})};function n(){return typeof t=="function"?t():t}}function Le(e){if(!e)return r.inject(_.PROVIDE_NAME_METADATA);Se.initEntity(e);const t=r.computed(()=>Se.state[e]);return r.provide(_.PROVIDE_NAME_METADATA,t),t}function Ke(e,t={}){if(!e)return r.inject(_.PROVIDE_NAME_USAGE_CONTEXT);const n=r.ref(null);return r.provide(_.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await Jr(e,wi(t||{}))}}}function wi(e){return typeof e=="function"?e():e}function bi(e){if(!e)return r.inject(_.PROVIDE_NAME_ACTIONS);const t=r.ref(!1),n=r.reactive([]),o=r.computed(()=>n.map(s=>$t(e,s))),i={actions:o,update:a};r.provide(_.PROVIDE_NAME_ACTIONS,i),e.router=Me.useRouter();function a(){if(t.value)return;t.value=!0,n.splice(0,n.length);const s=e==null?void 0:e.form;return Ot({masterEntities:e==null?void 0:e.masterEntities,id:s==null?void 0:s.id,entity:s==null?void 0:s.name}).then(u=>n.splice(0,0,...u)).catch(z("error")).finally(()=>t.value=!1)}return{actions:o,update:a,loading:r.readonly(t)}}function Ei(e){function t(n){n.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",t)}),r.onUnmounted(()=>{document.removeEventListener("keypress",t)})}function ki(e,t={}){const n=r.reactive([]),o=l=>{const c=r.unref(e);if(l===void 0){n.length===0?c.forEach(a):c.forEach(s);return}i(l)?s(l):a(l)},i=l=>n.includes(l),a=l=>{t.handleSelect&&!t.handleSelect(l)||i(l)||n.push(l)},s=l=>{const c=n.findIndex(f=>f===l);c!==-1&&n.splice(c,1)},u=r.computed(()=>{const l=r.unref(e);return n.length===l.length&&l.length!==0});return[n,o,u,a,s]}function Ti(e){const t=r.ref(""),n=r.computed(()=>{const o=t.value.toLowerCase();return r.unref(e).filter(i=>t.value.length?Object.values(i).join().toLowerCase().includes(o):!0)});return{search:t,searchArray:n}}const he=new class{constructor(){this.store=r.reactive([])}add(t,n,o={}){const i=_i(o),a=new Pe(t,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(t){const n=this.store.findIndex(o=>o.id===t);if(n===-1)return!1;this.store.splice(n,1)}};function _i(e){function t(o){return!!o&&typeof o=="object"}const n={timeout:10,click:()=>null,children:[]};return t(e)?{timeout:e.timeout||n.timeout,click:e.click||n.click,children:e.children||n.children}:n}const Ie=class Ie{constructor(t,n,o,i,a){this.type=t,this.message=n,this.timeout=o,this.children=i,this.click=a,this.id=Ie.cardId++}};Ie.cardId=1;let Pe=Ie;/*!
8
8
  * jenesius-event-emitter v1.0.2
9
9
  * (c) 2022 Jenesius
10
10
  * @license MIT
11
- */const gt=function(e,t){return e in this.events||(this.events[e]=[]),this.events[e].push(t),this.off.bind(this,e,t)},mt=function(e,t){e in this.events&&this.events[e].forEach(n=>n(t))},ht=function(e,t){const n=this.events[e];if(!n)return;const o=n.indexOf(t);o!==-1&&n.splice(o,1)},vt=function(){this.events={}};class X{constructor(){this.events={}}on(t,n){return gt.call(this,t,n)}emit(t,n){return mt.call(this,t,n)}off(t,n){return ht.call(this,t,n)}cleanEvents(){vt.call(this)}static on(t,n){return gt.call(X,t,n)}static emit(t,n){return mt.call(X,t,n)}static off(t,n){return ht.call(X,t,n)}static cleanEvents(){vt.call(X)}}X.events={};class Ci extends X{constructor(t){super(),this.name="Communication",this.read=()=>{},this.id=t}sendMessage(t){return mi(this.id,t)}static checkAndGenerate(t,n,o){return gi(t,n,o).then(i=>i.length===0?pi(t,n,o):i[0])}}function Ai(){return $().emit("client:read",{})}var se;const H=class H extends X{constructor(){super(...arguments);nt(this,se);this.type="front",this.organizations=[],xe(this,se,!1)}set language(n){localStorage.setItem(_.LOCALSTORAGE_LANGUAGE_KEY,n)}get language(){return localStorage.getItem(_.LOCALSTORAGE_LANGUAGE_KEY)||H.DEFAULT_LANGUAGE}get contextType(){var n;if(this.contextId)return((n=this.person)==null?void 0:n.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(n){xe(this,se,n),this.emit(H.EVENT_READY_UPDATE,n)}get ready(){return tt(this,se)}onReady(n){return this.on(H.EVENT_READY_UPDATE,n)}onupdateContext(n){return this.on(H.EVENT_CONTEXT_UPDATE,n)}setCurrentContext(n){if(this.contextId===n)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(n),localStorage.setItem(_.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(n)),this.emit(H.EVENT_CONTEXT_UPDATE,n),console.log(`Current context id %c${n}`,"color: purple")}get context(){var n;return this.contextId?this.contextId===((n=this.person)==null?void 0:n.id)?this.person:this.organizations.find(o=>o.id===this.contextId)||null:null}async init(){try{const n=await this.loadCustomerData();this.person=n,this.organizations=n.organizations,this.userId=n.userId,this.restoreCurrentContext(),this.ready=!0}catch(n){z()(n)}}restoreCurrentContext(){const n=Number.parseInt(localStorage.getItem(_.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(n)&&this.validateContextId(Number(n)))this.setCurrentContext(n);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Ai()}validateContextId(n){var o;try{return((o=this.person)==null?void 0:o.id)==n?!0:!!this.organizations.find(i=>i.id===n)}catch{return!1}}};se=new WeakMap,H.DEFAULT_LANGUAGE="en",H.EVENT_CONTEXT_UPDATE="event:context-update",H.EVENT_READY_UPDATE="event:ready-update";let Ve=H;function Si(e){return $().emit("metadata:read",{entity:e})}const Se=function(){const t=r.reactive({}),n=new Map;function o(u){return t[u]}async function i(u){if(n.has(u)&&await n.get(u),t[u])return;const l=await a(u);s(u,l)}function a(u){const l=Si(u).finally(()=>{n.delete(u)});return n.set(u,l),l}function s(u,l){t[u]=l}return{state:t,initEntity:i,get:o}}();class Ii extends X{on(t,n){return super.on(t,n)}emit(t,n){console.log("[event-bus] emit",t,n),super.emit(t,n)}off(t,n){super.off(t,n)}}class G{static login(t){return V(A.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...t,AppName:A.applicationName})})}static parseProcessAnswer(t){if(t.statusCode>4)throw new Error(t.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return t}static startRegistrationProcess(t){return G.requestStepRegistrationProcess("StartRegistration",t)}static confirmPhoneRegistrationProcess(t){return G.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",t)}static confirmEmailRegistrationProcess(t){return G.requestStepRegistrationProcess("ConfirmEmailByRegistration",t)}static finishEmailRegistrationProcess(t){return G.requestStepRegistrationProcess("FinishRegistration",t)}static requestStepRegistrationProcess(t,n){return V(`${A.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(t){return G.requestStepLoginProcess("StartLogin",t)}static loginWithPassword(t){return G.requestStepLoginProcess("LoginWithPassword",t)}static loginWithOtpCode(t){return G.requestStepLoginProcess("LoginWithOtpCode",t)}static requestStepLoginProcess(t,n){return V(`${A.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(G.parseLoginProcessAnswer)}static parseLoginProcessAnswer(t){if(t.statusCode>3)throw Error(t.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return t}static startPasswordReset(t,n){return V(`${A.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:n,AppName:t})})}static confirmPhoneNumberByAccessRecovery(t,n,o,i){return V(`${A.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:o,Code:i})})}static confirmEmailByAccessRecovery(t,n,o,i){return V(`${A.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:o,Code:i})})}static finishAccessRecovery(t,n,o){return V(`${A.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Password:o,ConfirmedPassword:o})})}}class Ni{static readHistoryById(t,n){return V(`/close-api/audits/history/${t}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Ri{static getConfiguration(){return V("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(t){return await V(`/open-api/data/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Oi{static getDictionary(t){if(!t)throw new Error(`Can't get dictionary for ${t}.`);return V(`/open-api/internationalization/language/${t}`)}}class Li{static async upload(t,n){const o=new FormData;return o.append("file",t),V(`/close-api/files?entityName=${n}`,{method:"POST",body:o}).then(i=>(i.filename=t.name,i))}}var Yt=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(Yt||{}),Kt=(e=>(e.Approved="A",e.AwaitingFeedback="AF",e.AssignedForExam="AFE",e.Cancelled="C",e.Closed="CLS",e.Completed="CT",e.Draft="D",e.NotSatisfied="NSF",e.OnClarification="OC",e.Processing="P",e.Rejected="R",e.ReadyForExam="RFE",e.Submitted="S",e.SecurityCheck="SCK",e.Satisfied="SF",e.Withdrawn="W",e))(Kt||{});function $i(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function L(e){return Object.keys(e).reduce((t,n)=>{const o=e[n];if(Array.isArray(o)){const i=o.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return o.length&&t.push(`@${n} in (${i})`),t}if($i(o)){let i=function(a){var s;return((s=a.match(/([^Z]*)/))==null?void 0:s[0])+"0000Z"};return o.start&&t.push(`@${n} ge ${i(o.start)}`),o.end&&t.push(`@${n} le ${i(o.end)}`),t}return typeof o=="number"||typeof o=="boolean"?(t.push(`@${n} eq ${o}`),t):typeof o=="string"?(o.length!==0&&t.push(`@${n} eq '${o}'`),t):(o===null&&t.push(L.is(n,o)),t)},[]).join(" and ")}function ye(e){return typeof e=="string"?`'${e}'`:`${e}`}L.includes=function(t,n){return`@${t} Contains ${ye(n)}`};L.beginWith=function(t,n){return`@${t} BeginWith ${ye(n)}`};L.notEq=function(t,n){return`@${t} nq ${ye(n)}`};L.eq=function(t,n){return Array.isArray(n)?L.in(t,n):`@${t} eq ${ye(n)}`};L.in=function(t,n){const o=n.map(ye).join(", ");return`@${t} in (${o})`};L.notIn=function(t,n){return!Array.isArray(n)||n.length===0?"":L.and(...n.map(o=>L.notEq(t,o)))};L.and=function(...t){return t.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(L.wrap).join(" and ")};L.wrap=function(t){return`(${t})`};L.is=function(t,n){return`@${t} is ${n}`};L.or=function(...t){return t.join(" or ")};function Qe(e){return Object.keys(e).reduce((t,n)=>{let o=e[n];const i=n.charAt(0).toUpperCase()+n.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=Qe(o)),t[i]=o,t},{})}const q=new Ve,ve=new Ii;exports.ApplicationStatus=Kt;exports.Communication=Ci;exports.CoreError=Q;exports.DisplayListRow=Ye;exports.EventBus=ve;exports.Filter=L;exports.Manager=q;exports.MetadataStore=Se;exports.NotificationSystem=he;exports.OBJECT_TYPE_NAME_FIELD=bt;exports.RecordOperation=Yt;exports.WidgetButton=Vn;exports.WidgetFastTable=Br;exports.WidgetFastTableHeadCell=kt;exports.WidgetField=ur;exports.WidgetIcon=le;exports.WidgetImage=Yn;exports.WidgetList=cr;exports.WidgetLoader=Xn;exports.WidgetMultiButton=zn;exports.WidgetSpinner=fe;exports.WidgetTable=Et;exports.WidgetTablePanelFilterItem=Tt;exports.asyncProcess=_e;exports.authService=G;exports.billingService=oe;exports.catchUniversal=z;exports.config=Sn;exports.configuration=A;exports.constants=_;exports.convertDDToDMS=ai;exports.convertDMSToDD=ii;exports.convertListConfig=Xt;exports.debounce=jr;exports.documentsService=rn;exports.fileService=Li;exports.formatter=ue;exports.getCellName=ge;exports.getCellValue=Ue;exports.getEntityLink=Je;exports.getNamesFromListConfig=Ct;exports.getUnitValue=Be;exports.groupArrayByField=Pr;exports.historyService=Ni;exports.injectAction=Lt;exports.internationalizationService=Oi;exports.invitationService=nn;exports.openService=Ri;exports.parseError=me;exports.parseTextByMarkdown=oi;exports.prettyDate=ze;exports.prettyDateWithTime=_t;exports.prettyMoney=At;exports.prettyValueFieldByEntity=qr;exports.processWizardService=ae;exports.request=V;exports.setupListRow=We;exports.staticLink=Zr;exports.t=Z;exports.throttle=Ur;exports.universalEntityCount=Qr;exports.universalEntityCreate=Nt;exports.universalEntityDelete=Rt;exports.universalEntityRead=ce;exports.universalEntityUpdate=Ge;exports.universalHistoryRead=Kr;exports.universalListSettingRead=It;exports.universalMetadataFieldTreat=Xr;exports.universalMetadataListRead=Yr;exports.universalToolRead=Ot;exports.useActions=bi;exports.useCommunication=vi;exports.useEnter=Ei;exports.useFormEntity=yi;exports.useListActiveRow=ci;exports.useListEntity=fi;exports.useListSearch=Ti;exports.useListSelect=ki;exports.useManagerState=di;exports.useMetadata=Le;exports.useSocket=$;exports.useUsageContext=Ke;exports.useVisibleItem=qe;exports.useWizard=cn;exports.uuidv4=Vr;exports.valuesToUpperCase=Qe;exports.wrapToolResponse=$t;
11
+ */const gt=function(e,t){return e in this.events||(this.events[e]=[]),this.events[e].push(t),this.off.bind(this,e,t)},mt=function(e,t){e in this.events&&this.events[e].forEach(n=>n(t))},ht=function(e,t){const n=this.events[e];if(!n)return;const o=n.indexOf(t);o!==-1&&n.splice(o,1)},vt=function(){this.events={}};class X{constructor(){this.events={}}on(t,n){return gt.call(this,t,n)}emit(t,n){return mt.call(this,t,n)}off(t,n){return ht.call(this,t,n)}cleanEvents(){vt.call(this)}static on(t,n){return gt.call(X,t,n)}static emit(t,n){return mt.call(X,t,n)}static off(t,n){return ht.call(X,t,n)}static cleanEvents(){vt.call(X)}}X.events={};class Ci extends X{constructor(t){super(),this.name="Communication",this.read=()=>{},this.id=t}sendMessage(t){return mi(this.id,t)}static checkAndGenerate(t,n,o){return gi(t,n,o).then(i=>i.length===0?pi(t,n,o):i[0])}}function Ai(){return $().emit("client:read",{})}var se;const H=class H extends X{constructor(){super(...arguments);nt(this,se);this.type="front",this.organizations=[],Be(this,se,!1)}set language(n){localStorage.setItem(_.LOCALSTORAGE_LANGUAGE_KEY,n)}get language(){return localStorage.getItem(_.LOCALSTORAGE_LANGUAGE_KEY)||H.DEFAULT_LANGUAGE}get contextType(){var n;if(this.contextId)return((n=this.person)==null?void 0:n.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(n){Be(this,se,n),this.emit(H.EVENT_READY_UPDATE,n)}get ready(){return tt(this,se)}onReady(n){return this.on(H.EVENT_READY_UPDATE,n)}onupdateContext(n){return this.on(H.EVENT_CONTEXT_UPDATE,n)}setCurrentContext(n){if(this.contextId===n)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(n),localStorage.setItem(_.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(n)),this.emit(H.EVENT_CONTEXT_UPDATE,n),console.log(`Current context id %c${n}`,"color: purple")}get context(){var n;return this.contextId?this.contextId===((n=this.person)==null?void 0:n.id)?this.person:this.organizations.find(o=>o.id===this.contextId)||null:null}async init(){try{const n=await this.loadCustomerData();this.person=n,this.organizations=n.organizations,this.userId=n.userId,this.restoreCurrentContext(),this.ready=!0}catch(n){z()(n)}}restoreCurrentContext(){const n=Number.parseInt(localStorage.getItem(_.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(n)&&this.validateContextId(Number(n)))this.setCurrentContext(n);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Ai()}validateContextId(n){var o;try{return((o=this.person)==null?void 0:o.id)==n?!0:!!this.organizations.find(i=>i.id===n)}catch{return!1}}};se=new WeakMap,H.DEFAULT_LANGUAGE="en",H.EVENT_CONTEXT_UPDATE="event:context-update",H.EVENT_READY_UPDATE="event:ready-update";let Ve=H;function Si(e){return $().emit("metadata:read",{entity:e})}const Se=function(){const t=r.reactive({}),n=new Map;function o(u){return t[u]}async function i(u){if(n.has(u)&&await n.get(u),t[u])return;const l=await a(u);s(u,l)}function a(u){const l=Si(u).finally(()=>{n.delete(u)});return n.set(u,l),l}function s(u,l){t[u]=l}return{state:t,initEntity:i,get:o}}();class Ii extends X{on(t,n){return super.on(t,n)}emit(t,n){console.log("[event-bus] emit",t,n),super.emit(t,n)}off(t,n){super.off(t,n)}}class G{static login(t){return V(A.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...t,AppName:A.applicationName})})}static parseProcessAnswer(t){if(t.statusCode>4)throw new Error(t.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return t}static startRegistrationProcess(t){return G.requestStepRegistrationProcess("StartRegistration",t)}static confirmPhoneRegistrationProcess(t){return G.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",t)}static confirmEmailRegistrationProcess(t){return G.requestStepRegistrationProcess("ConfirmEmailByRegistration",t)}static finishEmailRegistrationProcess(t){return G.requestStepRegistrationProcess("FinishRegistration",t)}static requestStepRegistrationProcess(t,n){return V(`${A.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(t){return G.requestStepLoginProcess("StartLogin",t)}static loginWithPassword(t){return G.requestStepLoginProcess("LoginWithPassword",t)}static loginWithOtpCode(t){return G.requestStepLoginProcess("LoginWithOtpCode",t)}static requestStepLoginProcess(t,n){return V(`${A.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(G.parseLoginProcessAnswer)}static parseLoginProcessAnswer(t){if(t.statusCode>3)throw Error(t.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return t}static startPasswordReset(t,n){return V(`${A.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:n,AppName:t})})}static confirmPhoneNumberByAccessRecovery(t,n,o,i){return V(`${A.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:o,Code:i})})}static confirmEmailByAccessRecovery(t,n,o,i){return V(`${A.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:o,Code:i})})}static finishAccessRecovery(t,n,o){return V(`${A.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Password:o,ConfirmedPassword:o})})}}class Ni{static readHistoryById(t,n){return V(`/close-api/audits/history/${t}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Ri{static getConfiguration(){return V("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(t){return await V(`/open-api/data/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Oi{static getDictionary(t){if(!t)throw new Error(`Can't get dictionary for ${t}.`);return V(`/open-api/internationalization/language/${t}`)}}class Li{static async upload(t,n){const o=new FormData;return o.append("file",t),V(`/close-api/files?entityName=${n}`,{method:"POST",body:o}).then(i=>(i.filename=t.name,i))}}var Yt=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(Yt||{}),Kt=(e=>(e.Approved="A",e.AwaitingFeedback="AF",e.AssignedForExam="AFE",e.Cancelled="C",e.Closed="CLS",e.Completed="CT",e.Draft="D",e.NotSatisfied="NSF",e.OnClarification="OC",e.Processing="P",e.Rejected="R",e.ReadyForExam="RFE",e.Submitted="S",e.SecurityCheck="SCK",e.Satisfied="SF",e.Withdrawn="W",e))(Kt||{});function $i(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function L(e){return Object.keys(e).reduce((t,n)=>{const o=e[n];if(Array.isArray(o)){const i=o.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return o.length&&t.push(`@${n} in (${i})`),t}if($i(o)){let i=function(a){var s;return((s=a.match(/([^Z]*)/))==null?void 0:s[0])+"0000Z"};return o.start&&t.push(`@${n} ge ${i(o.start)}`),o.end&&t.push(`@${n} le ${i(o.end)}`),t}return typeof o=="number"||typeof o=="boolean"?(t.push(`@${n} eq ${o}`),t):typeof o=="string"?(o.length!==0&&t.push(`@${n} eq '${o}'`),t):(o===null&&t.push(L.is(n,o)),t)},[]).join(" and ")}function ye(e){return typeof e=="string"?`'${e}'`:`${e}`}L.includes=function(t,n){return`@${t} Contains ${ye(n)}`};L.beginWith=function(t,n){return`@${t} BeginWith ${ye(n)}`};L.notEq=function(t,n){return`@${t} nq ${ye(n)}`};L.eq=function(t,n){return Array.isArray(n)?L.in(t,n):`@${t} eq ${ye(n)}`};L.in=function(t,n){const o=n.map(ye).join(", ");return`@${t} in (${o})`};L.notIn=function(t,n){return!Array.isArray(n)||n.length===0?"":L.and(...n.map(o=>L.notEq(t,o)))};L.and=function(...t){return t.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(L.wrap).join(" and ")};L.wrap=function(t){return`(${t})`};L.is=function(t,n){return`@${t} is ${n}`};L.or=function(...t){return t.join(" or ")};function Qe(e){return Object.keys(e).reduce((t,n)=>{let o=e[n];const i=n.charAt(0).toUpperCase()+n.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=Qe(o)),t[i]=o,t},{})}const q=new Ve,ve=new Ii;exports.ApplicationStatus=Kt;exports.Communication=Ci;exports.CoreError=Q;exports.DisplayListRow=Ye;exports.EventBus=ve;exports.Filter=L;exports.Manager=q;exports.MetadataStore=Se;exports.NotificationSystem=he;exports.OBJECT_TYPE_NAME_FIELD=bt;exports.RecordOperation=Yt;exports.WidgetButton=Vn;exports.WidgetFastTable=xr;exports.WidgetFastTableHeadCell=kt;exports.WidgetField=ur;exports.WidgetIcon=le;exports.WidgetImage=Yn;exports.WidgetList=cr;exports.WidgetLoader=Xn;exports.WidgetMultiButton=zn;exports.WidgetSpinner=fe;exports.WidgetTable=Et;exports.WidgetTablePanelFilterItem=Tt;exports.asyncProcess=_e;exports.authService=G;exports.billingService=oe;exports.catchUniversal=z;exports.config=Sn;exports.configuration=A;exports.constants=_;exports.convertDDToDMS=ai;exports.convertDMSToDD=ii;exports.convertListConfig=Xt;exports.debounce=jr;exports.documentsService=rn;exports.fileService=Li;exports.formatter=ue;exports.getCellName=ge;exports.getCellValue=Ue;exports.getEntityLink=Je;exports.getNamesFromListConfig=Ct;exports.getUnitValue=xe;exports.groupArrayByField=Pr;exports.historyService=Ni;exports.injectAction=Lt;exports.internationalizationService=Oi;exports.invitationService=nn;exports.openService=Ri;exports.parseError=me;exports.parseTextByMarkdown=oi;exports.prettyDate=ze;exports.prettyDateWithTime=_t;exports.prettyMoney=At;exports.prettyValueFieldByEntity=qr;exports.processWizardService=ae;exports.request=V;exports.setupListRow=We;exports.staticLink=Zr;exports.t=Z;exports.throttle=Ur;exports.universalEntityCount=Qr;exports.universalEntityCreate=Nt;exports.universalEntityDelete=Rt;exports.universalEntityRead=ce;exports.universalEntityUpdate=Ge;exports.universalHistoryRead=Kr;exports.universalListSettingRead=It;exports.universalMetadataFieldTreat=Xr;exports.universalMetadataListRead=Yr;exports.universalToolRead=Ot;exports.useActions=bi;exports.useCommunication=vi;exports.useEnter=Ei;exports.useFormEntity=yi;exports.useListActiveRow=ci;exports.useListEntity=fi;exports.useListSearch=Ti;exports.useListSelect=ki;exports.useManagerState=di;exports.useMetadata=Le;exports.useSocket=$;exports.useUsageContext=Ke;exports.useVisibleItem=qe;exports.useWizard=cn;exports.uuidv4=Vr;exports.valuesToUpperCase=Qe;exports.wrapToolResponse=$t;
12
12
  //# sourceMappingURL=eservices-core.cjs.js.map