eservices-core 1.3.185 → 1.3.186

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-94b2ed25]{box-shadow:0 2px 2px #00000040;background-color:#fff;padding:3px 0;max-height:400px;max-width:340px;overflow:hidden auto}.widget-filter-enum-item[data-v-94b2ed25]{padding:6px 11px;transition:.1s;cursor:pointer}.widget-filter-enum-item[data-v-94b2ed25]: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-a7ce8477]{position:relative}.widget-filter-item-container[data-v-a7ce8477]:hover .widget-filter-item-popup[data-v-a7ce8477]{display:block}.widget-filter-item[data-v-a7ce8477]{display:grid;grid-template-columns:max-content max-content;gap:10px;align-items:center;cursor:pointer;padding:0 10px;color:#fff}.widget-filter-item-label[data-v-a7ce8477]{-webkit-user-select:none;user-select:none;padding:4px 8px}.widget-filter-item-popup[data-v-a7ce8477]{display:none;position:absolute;z-index:2;inset-block-start:100%;inset-inline-end:0}.widget-filter-item-icon[data-v-a7ce8477]{font-size:17px;transition:.2s;height:16px}.widget-filter-item-icon_active[data-v-a7ce8477]{transform:rotate(180deg) translateY(-2px)}.widget-table-panel-filter[data-v-51bb1b22]{justify-content:end;background-color:var(--color-primary)}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
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,i)=>(et(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);/*!
3
- * eservices-core v1.3.185
3
+ * eservices-core v1.3.186
4
4
  * (c) 2024 ESERVICES
5
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),F=require("jenesius-vue-form"),Me=require("vue-router"),Kt=require("date-and-time"),Ne=require("debug"),ne=require("jenesius-vue-modal"),A=class A extends Error{constructor(t,n=null){super(),this.message=t,this.details=n,this.id=A.ID++}static ParentFormNotFound(){return new A("Can't found parent form.")}static UndefinedNameOfCompositeFormController(t){return new A("Composite object name is undefined",t)}static EntityWithoutName(t){return new A("'Entity doesn't have a name",t)}static NotResolvedNameEventEmitter(t){return new A(`'${t}' is not a valid Event emitter name`)}static FormIsNotValidated(t){return new A("Form is not validated",t)}static ListWorkerIsRunningOrEnd(t){return new A("List data request is running or already done",t)}static ObjectIdNotNumber(t){return new A(`${t} (id) is not a number`)}static UndefinedErrorId(t,n){return A.ApiNotAvailable()}static ApiError(t){return new A("Request error",t)}static ApiNotAvailable(){return new A(`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?A.ApiNotAvailable():new A(t||"Authorization Error",n)}static ApiResponseParseFailed(){return A.ApiNotAvailable()}static MissingIdInValuesEntity(t){return new A("Object doesn't have id",t)}static ObjectWithIdNotFound(t,n){return new A(`Can't find object with id: ${t}`,n)}static ObjectWithoutConnectToPresentArray(t,n){return new A("Object is not found.",{object:t,array:n})}static EntityWithoutId(t){return new A("Entity doesn't have id.",t)}static NotFoundedTableIndex(t,n){return new A(`Can't find the element with tableIndex ${t}`,n)}static UndefinedError(t,n=[]){return new A(t,n)}static TableArrayAlreadyIncludeProvidedIndexValue(t,n,i){return new A(`Array already includes the element with value ${t}`,{array:n,table:i})}static MetadataEntityIsNotAvailable(t){return new A(`Metadata for the ${t} is not currently available.`)}static RequestTookToLong(){return new A("The request took too long to complete. Try again later.")}};A.ID=0;let Q=A;const Qt="Please try again later or submit a feedback if problem doesn't go.";function Zt(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return Qt}})}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=>Zt(n).then(i=>{if(!n.ok)throw i;return i}))}class en{constructor(){this.public=!1,this.errors=new Proxy([],{set:(t,n,i)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(i)}`),t[n]=i,!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 en;function rt(e){return{...e,createdEntities:e.createdEntites}}const oe=class oe{static async getStartConfig(t,n){return J([oe.url,t,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(t,n){return J([oe.url,t,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(rt)}static async runStep(t,n,i,o,a){return J([oe.url,t,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:i,token:o,values:a})}).then(rt)}};oe.url="/close-api/views/process-wizard";let ae=oe;class tn{static invite(t,n,i){return J("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:t,personKey:n,relatedRoleCode:i})})}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 nn{static getRequiredDocuments(t,n,i){const o=new URLSearchParams({entity:t,primaryKey:n,statusCode:i});return fetch(`/close-api/views/required-documents?${o.toString()}`).then(a=>a.json())}}class ie{static url(){return"close-api/billing"}static getBillingMetadata(t){return fetch(`/${ie.url()}/calculator/${t}`)}static calculate(t,n){return J(`/${ie.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:t,values:n})}).then(i=>{if(i&&i.status===1)return i;throw Array.isArray(i.notes)?new Error(i.notes[0]):Q.ApiNotAvailable()})}static parseMetadataField(t){function n(i){switch(i.type){case"ValueType":switch(i.dataType){case"Integer":return"number";default:return i.dataType}case"EntityReference":return i.dataType}}return{name:t.name,label:t.title,required:t.required,type:n(t)}}static createOnlinePayment(t,n){return J(`/${ie.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:t,returnURL:n})})}static applyOnlinePayment(t){return J(`/${ie.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:t})})}}function rn(e){return e.statusName==="Completed"}function on(e){return e.statusName==="FinalStepWithConfirmation"}function an(e){return e.statusName==="ValidationError"}function sn(e,t,n){let i=null;const o=r.reactive({wait:null});let a=[],s=null;const u=r.ref(null);function l(){u.value=a.find(p=>p.name===s)||null}function c(){var p;return s?((p=a.find(b=>b.name===s))==null?void 0:p.fields)||[]:[]}function f(p){if(l(),an(p))return void n.onValidation(p.validationResults);if((p.statusName==="FinalStep"||p.statusName==="NextStep")&&(!c().length||ln(c(),n.presets)))return v(n.presets||{});rn(p)&&n.onCompleted(p),on(p)&&n.onConfirmation(p)}async function m(){try{await d(),await k()}catch(p){const{message:b}=ge(p);me.add("error",b)}}function d(){return o.wait="Loading process information.",ae.getStartConfig(t,e).then(p=>{a=p.steps.map(b=>({label:b.title,name:b.stepName,number:b.number,fields:b.frontendEntity.objectTypes.reduce((T,I)=>(I.properties.forEach(R=>{T.push({name:R.name,label:R.title,type:R.refEntityName||R.dataType})}),T),[])}))}).then(p=>(o.wait=!1,p))}function w(p){return["FinalStepWithConfirmation","NextStep","Completed","FinalStep"].includes(p.statusName)&&(i=p.token,s=p.nextStepName),p}function h(p){const b=ge(p);me.add("error",b.message)}function k(){return o.wait="Starting process",ae.startProcess(t,e).then(w).then(f).catch(h).finally(()=>{o.wait=null})}function v(p={}){return!i||!s?Promise.reject("Not step or token."):(o.wait="Waiting for result...",ae.runStep(t,e,s,i,p).then(w).then(f).catch(h).finally(()=>{o.wait=!1}))}return{initialize:m,state:o,currentStepConfig:r.readonly(u),next:v}}function ln(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(!F.utils.getPropFromObject(t,i.name))return!1}return!0}const cn={class:"widget-table__head-cell"},un={class:"widget-table__head-label margin_0 text_overflow"},vt=r.defineComponent({__name:"widget-table-head-cell",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("th",cn,[r.createElementVNode("span",un,r.toDisplayString(t.label),1)]))}}),fn={class:"widget-table__head"},dn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>S.componentTableHeadCell||vt),(t,n)=>(r.openBlock(),r.createElementBlock("tr",fn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.config,i=>r.renderSlot(t.$slots,"default",r.mergeProps({ref_for:!0},i),void 0,!0)),256))]))}}),M=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},pn=M(dn,[["__scopeId","data-v-498c4f00"]]);function je(e){return Array.isArray(e)?je(e[0]):typeof e!="string"?null:e}function pe(e){return je(e.name)}function gn(e){const t=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let i;for(;(i=t.exec(e))!==null;)n.push(i[1]);return n}function mn(e,t){return gn(e).forEach(i=>{e=e.replace(new RegExp("\\$\\{"+i+"}","g"),F.utils.getPropFromObject(t,i))}),e}function Be(e){return t=>typeof t=="string"||typeof t=="number"?`${t} ${e}`:""}function Ue(e,t){const n=pe(e);if(typeof e.value=="string")return mn(e.value,t);let i=n?F.utils.getPropFromObject(t,n):null;if(i===void 0&&(i=null),typeof e.value=="function")return e.value(i,t);if(e.value===null)return null;if(e.unitValue&&(i=Be(e.unitValue)(i)),e.unit&&(i=Be(e.unit)(i)),e.type)switch(e.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Ge(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Tt(typeof i=="string"?i:null);break}case"money":{i=Ct(i);break}}return e.formatter&&(i=ue(e.formatter).exec(i,t)),typeof i=="boolean"&&(i=i?"✓":"—"),i}const hn=1,yn=5e3,vn="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 wn={class:"widget-filter-text flex gap_20"},bn=r.defineComponent({__name:"widget-filter-text",props:{values:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,i=t,o=r.ref("");function a(){i("update:values",o.value)}return r.watch(()=>n.values,s=>{if(typeof s!="string")return o.value="";o.value=s},{immediate:!0}),(s,u)=>{const l=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",wn,[r.createVNode(r.unref(F.FormField),{type:"text",modelValue:o.value,"onUpdate:modelValue":u[0]||(u[0]=c=>o.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})])}}}),En=M(bn,[["__scopeId","data-v-800b3803"]]),kn={class:"widget-filter-enum"},Tn=r.defineComponent({__name:"widget-filter-entity",props:{values:{},fieldMetadata:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,i=r.ref([]),o=Oe(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)||!o.value)return;const c=o.value.fieldNameForLabel,f=o.value.fieldNameForIdentification;i.value=await ce(n.fieldMetadata.entity,{fields:[c,f].join(" "),order:[c,"asc"]}).then(d=>d.map(w=>({label:w[c],value:w[f]})))}return r.watch(()=>o.value,l,{immediate:!0}),(c,f)=>(r.openBlock(),r.createElementBlock("div",kn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,m=>(r.openBlock(),r.createBlock(r.unref(F.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))]))}}),_n=M(Tn,[["__scopeId","data-v-94b2ed25"]]),S={getEntityLink(e,t){return`/forms/${e}/${t}`},iconHandlerText(){return""},iconTag:"i",tableFilterEntityBind:{String:En,Entity:_n}};function Cn(e){for(let t in e)S[t]=e[t]}const An={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(S.iconTag,{class:S.iconHandler?S.iconHandler(n):`icon icon-${n}`},S.iconHandlerText(n))}},le=M(An,[["__scopeId","data-v-8a72b45f"]]),Sn=Ne(Re("setup-list-row"));function In(e,t){const n=e.config.map(i=>Nn(i,e,t));return r.h("tr",{class:"widget-table__row widget-table-row"},n)}function Nn(e,t,n){const i=t.values;let o=Ue(e,i);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function s(f){a.onClick.push(()=>f(i,e,n))}function u(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const l=[],c=[];if(e.hide&&e.hide(i))return[r.h("td")];if(e.type)switch(u(`widget-table-cell_${e.type}`),e.type){case"multi-select":{c.push(r.h(F.FormField,{type:"single-checkbox",modelValue:t.selected})),s(it.bind(null,n,!0));break}case"select":{c.push(r.h(F.FormField,{type:"single-radio",modelValue:t.selected})),s(it.bind(null,n,!1));break}}if(e.onClick&&s(e.onClick),e.link)try{const f=e.link(i);if(f){const m=r.h(Me.RouterLink,{to:f});c.push(m),u("widget-table-cell_link")}}catch(f){Sn("Can't add router link",f)}if(e.href&&(c.push(r.h("a",{href:e.href(i),target:"_blank"})),u("widget-table-cell_link")),(typeof o=="string"||typeof o=="number")&&c.push(r.h("p",{class:"widget-list-cell-text"},o)),e.icon&&(typeof e.icon=="string"&&c.push(r.h(le,{name:e.icon})),typeof e.icon=="function")){const f=e.icon(i);f!==null&&c.push(r.h(le,{name:f}))}return e.class&&(typeof e.class=="function"?u(e.class(i)):u(e.class)),S.listCellHandler&&S.listCellHandler(e,i,{cellNodeChildren:c,addClass:u,addHandleClick:s,context:n}),l.push(r.h("td",a,c)),l}function it(e,t){e.emit("select",t)}function We(e,t){return()=>{try{return In(e,t)}catch(n){return console.warn(n),null}}}const Rn={props:{values:Object,config:Object,selected:Boolean},setup:We},Ln=["colspan"],ot=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(e,{emit:t}){const n=t,i=r.ref();return r.onMounted(()=>{setTimeout(()=>{i.value&&i.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(o,a)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:i},[r.createElementVNode("td",{colspan:o.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(o.component),r.mergeProps(o.$attrs,{values:o.values,new:o.isNew,onClose:a[0]||(a[0]=s=>n("close")),onSave:a[1]||(a[1]=s=>n("save",s))}),null,16,["values","new"]))],8,Ln)],512))}}),On={class:"widget-table"},at="update:selectedRows",$n="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,i=t,o=r.useSlots(),a=r.computed(()=>{var d;return(d=o==null?void 0:o.default)==null?void 0:d.call(o)[0]});function s(d){return n.useMockField?pt(d):d}function u(d,w=!0){if(!n.selectedRows)return;if(!w)return i(at,n.selectedRows.includes(d)?[]:[d]);const h=[...n.selectedRows],k=h.indexOf(d);return k===-1?h.push(d):h.splice(k,1),i(at,h)}function l(d){i($n,d)}function c(d){i("save",d),i("update:activeRow",null)}const f=r.computed(()=>n.shortcut?n.config.filter(d=>d.name?!!n.array.find(h=>![null,""].includes(Ue(d,h))):!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",On,[r.createElementVNode("thead",null,[r.createVNode(pn,{config:f.value,onOrder:w[0]||(w[0]=h=>d.$emit("order",h))},{default:r.withCtx(h=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(d.$slots["head-cell"]||vt),r.normalizeProps(r.guardReactiveProps(h)),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,(h,k)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:k},[r.createVNode(Rn,{config:f.value,values:h,selected:d.selectedRows.includes(s(h)),onSelect:v=>u(s(h),v),onActivate:v=>l(s(h)),class:r.normalizeClass(d.classCallback?d.classCallback(h):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&d.activeRow===s(h)?(r.openBlock(),r.createBlock(ot,{key:0,component:a.value,"row-length":d.config.length,values:h,onClose:w[1]||(w[1]=v=>i("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(ot,{key:0,component:a.value,"row-length":f.value.length,onClose:w[2]||(w[2]=h=>i("update:activeRow",null)),onSave:c,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),xn=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))}}),ye=M(xn,[["__scopeId","data-v-0ef9ae88"]]),Bn={class:"widget-button"},Fn=r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("button",Bn,[t.wait?(r.openBlock(),r.createBlock(ye,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(t.$slots,"default",{},void 0,!0)]))}}),Dn=M(Fn,[["__scopeId","data-v-450dc564"]]),Pn={class:"widget-multi-button-wrap position_relative cursor_pointer"},Vn={class:"widget-multi-button-body grid"},Mn=["onClick"],jn={class:"widget-multi-button-side-wrap"},Un=r.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(e){r.useCssVars(s=>({"04895bf1":i.value}));const t=e,n=r.reactive({active:!1,wait:!1}),i=r.computed(()=>t.array.length+(t.label?1:0));function o(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",Pn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[r.createElementVNode("div",Vn,[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=>{o(l.callback),a(!1)}},r.toDisplayString(l.label),9,Mn))),128))]),r.createElementVNode("div",jn,[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(ye),{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)]))}}),Wn=M(Un,[["__scopeId","data-v-d43a76ce"]]),qn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Gn={class:"text_md"},zn=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",qn,[r.createVNode(ye,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Gn,r.toDisplayString(t.label),1)]))}}),Hn=["alt","src"],Xn=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)}}),(i,o)=>(r.openBlock(),r.createElementBlock("img",{alt:i.alt,ref_key:"refImage",ref:n,src:i.src||i.$props.default},null,8,Hn))}}),Jn={props:{config:Array,values:Object,selected:Boolean},setup:We},Yn=M(Jn,[["__scopeId","data-v-344a8cc1"]]),Kn=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),Qn={class:"widget-list-head-cell"},Zn=Kn(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),er=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,i=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(o,a)=>(r.openBlock(),r.createElementBlock("th",null,[r.createElementVNode("div",Qn,[r.createElementVNode("div",{class:"head-cell-content flex_grow",style:r.normalizeStyle({"min-width":o.minWidth,"max-width":o.maxWidth,width:o.width})},[o.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(F.FormField),{key:0,type:"single-checkbox",onClick:a[0]||(a[0]=r.withModifiers(s=>i("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=>i("order"))},r.toDisplayString(o.title||o.label),1))],4),o.name&&o.order.length&&o.order[0]===o.name?(r.openBlock(),r.createBlock(r.unref(le),{key:0,class:r.normalizeClass(["head-cell-order",{"head-cell-order_down":o.order.length>1&&o.order[1]==="desc"}])},{default:r.withCtx(()=>[r.createTextVNode("core-arrow-up")]),_:1},8,["class"])):r.createCommentVNode("",!0),Zn])]))}}),tr=M(er,[["__scopeId","data-v-bf495d6a"]]),nr=r.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(e,{emit:t}){const n=e,i=t,o=r.ref(),a=r.ref();r.onMounted(()=>{function c(h,k){let v=-1;do v++,k-=h[v];while(k>0&&v<h.length);return v}function f(h,k){let v=0;for(;k>0&&k>h[v]&&v<h.length;)k-=h[v],v++;return console.log(k,v),v>0?v:0}function m(h){try{a.value.style.insetInlineStart=h+"px"}catch(k){console.log(k)}}function d(h){try{a.value.style.width=h+"px",a.value.style.minWidth=h+"px",a.value.style.maxWidth=h+"px"}catch(k){console.log(k)}}function w(h){return h===null?!1:h.classList.contains("head-cell-resize")}o.value.addEventListener("pointerdown",function(k){var O;function v(B){return B.screenX+T-D}const p=o.value,b=[...p.children].filter(B=>B.localName==="th"),T=((O=p.offsetParent)==null?void 0:O.scrollLeft)||0,I=b.map(B=>B.clientWidth),R=w(k.target),D=p.getBoundingClientRect().left,g=v(k),y=c(I,g),E=I.slice(0,y).reduce((B,P)=>B+P,0),C=g-E,L=p.offsetWidth,W=b[y].clientWidth;if(n.config[y].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",k.screenX),console.log("Widths",I),console.log("max width",L),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=b[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(B){if(console.group("END"),document.removeEventListener("pointermove",j),document.removeEventListener("pointerup",Y),R&&(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)),!R){const P=B.screenX+T-D;console.log("ENP Position",P);const we=f(I,P);if(console.log(y,"->",we),we!==y){const fe=n.config[y],$e=n.config;$e.splice(y,1),$e.splice(we,0,fe),s($e)}else{const fe=n.config[y].name;u(fe)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function j(B){if(R){const fe=v(B)-g+W;d(fe);return}let P=B.screenX+T-D-C;P<0&&(P=0),P+W>L&&(P=L-W),m(P)}})});function s(c){i("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){i("update:order",c)}return(c,f)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:o},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.config,(m,d)=>(r.openBlock(),r.createBlock(tr,r.mergeProps({key:m,ref_for:!0},m,{onOrder:w=>u(m.name),onSelect:f[0]||(f[0]=w=>i("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))}}),rr=M(nr,[["__scopeId","data-v-ccffc6bd"]]),ir={class:"widget-list"},or={class:"widget-list-body position_relative"},ar=50,sr=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,i=t;function o(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){i("update:selectedRows",l)}function u(l){if(!l)return;const c=l.target;c.scrollTop+c.clientHeight+ar>c.scrollHeight&&i("scrollEnd")}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[r.createElementVNode("table",ir,[r.createElementVNode("thead",null,[r.createVNode(rr,{onSelect:c[0]||(c[0]=f=>a()),"onUpdate:order":c[1]||(c[1]=f=>i("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>i("update:config",f)),config:l.config,order:l.order},null,8,["config","order"])]),r.createElementVNode("tbody",or,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(f,m)=>{var d;return r.openBlock(),r.createBlock(Yn,{key:m,class:"widget-list-row",values:f,config:l.config,selected:(d=l.selectedRows)==null?void 0:d.includes(f),onSelect:w=>o(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 i=r.inject(_.VISIBLE_ITEM_PROVIDE_NAME,{show(){},hide(){},remove(){}});return{visible:e,controller:{show(){i==null||i.show(t)},hide(){i==null||i.hide(t)},remove(){i==null||i.remove(t)}},visibleItems:n}}const lr=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{}},setup(e){const t=e,n=Oe(),i=Ke(),o=r.computed(()=>{var k,v;const d=l.value,w=c(d),h={type:w,disabled:!((k=u.value)!=null&&k.canSet),label:t.label};return d&&Object.assign(h,{suffix:w==="number"?d.valueUnit:void 0,required:s.includes(w||"")?!1:d.required,label:t.label||d.displayName}),Object.assign(h,((v=S.fieldParamsHandler)==null?void 0:v.call(S,d,u.value,h))||{}),h}),a=["MultiText","MultiWideText"],s=["switch","single-checkbox","single-radio"],u=r.computed(()=>{var d;return(d=i==null?void 0:i.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(F.FormField),r.mergeProps({key:0},{...d.$attrs,...o.value},{name:d.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function cr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||_.DEFAULT_ORDER_DIR}const ur=["fill"],fr=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),dr=[fr],pr=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},dr,8,ur))}}),gr={class:"widget-fast-table-head-cell-td"},mr={class:"widget-head-cell-label"},hr={key:0,class:"widget-head-cell-order"},yr=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(()=>cr(t.order)),(i,o)=>{var a;return r.openBlock(),r.createElementBlock("td",gr,[r.createElementVNode("div",{class:"widget-head-cell",onClick:o[0]||(o[0]=s=>i.$emit("order",i.name))},[r.createElementVNode("span",mr,r.toDisplayString(i.label),1),n.value===((a=i.order)==null?void 0:a[0])?(r.openBlock(),r.createElementBlock("div",hr,[r.createVNode(pr,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${i.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)])])}}}),kt=M(yr,[["__scopeId","data-v-9db5d417"]]),vr={class:"widget-filter-item-container grid"},wr={class:"widget-filter-item"},br={class:"widget-filter-item-label"},Er={class:"widget-filter-item-popup"},kr=r.defineComponent({__name:"widget-filter-item",props:{entity:{},values:{},filterItem:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,i=t,o=S.tableFilterEntityBind,a=r.computed(()=>{const s=n.filterItem;return s.entity?"Entity":s.type?s.type:null});return(s,u)=>(r.openBlock(),r.createElementBlock("div",vr,[r.createElementVNode("div",wr,[r.createElementVNode("span",br,r.toDisplayString(s.filterItem.label||"--"),1)]),r.createVNode(r.Transition,{name:"slide-up"},{default:r.withCtx(()=>{var l;return[r.createElementVNode("div",Er,[a.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((l=r.unref(o))==null?void 0:l[a.value]),{key:0,"field-metadata":s.filterItem,values:s.values,"onUpdate:values":u[0]||(u[0]=c=>i("update:values",c))},null,40,["field-metadata","values"])):r.createCommentVNode("",!0)])]}),_:1})]))}}),Tr=M(kr,[["__scopeId","data-v-a7ce8477"]]),_r={class:"widget-table-panel-filter flex"},Cr=r.defineComponent({__name:"widget-table-panel-filters",props:{filtersConfig:{},filters:{},entity:{}},emits:["update:filters"],setup(e,{emit:t}){const n=e,i=t;function o(a,s){i("update:filters",{...n.filters,[a]:s})}return(a,s)=>(r.openBlock(),r.createElementBlock("div",_r,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(u,l)=>{var c;return r.openBlock(),r.createBlock(Tr,{key:l,entity:a.entity,"filter-item":u,values:(c=a.filters)==null?void 0:c[r.unref(pe)(u)],"onUpdate:values":f=>o(r.unref(pe)(u),f)},null,8,["entity","filter-item","values","onUpdate:values"])}),128))]))}}),Ar=M(Cr,[["__scopeId","data-v-51bb1b22"]]),Sr={class:"es-grid es-gap-15"},Ir={key:0,class:"title-md color-primary margin-0"},Nr={key:0,class:"widget-table-loader es-flex es-gap-10 es-flex-align-center es-padding-10 text-main"},Rr=r.createElementVNode("span",null,"Loading...",-1),Lr={class:"widget-fast-table-tools es-flex es-gap-15"},Or={class:""},$r=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{}},setup(e){const t=e,n=Me.useRouter(),i=r.ref([]),o=r.ref(null),a=r.ref(null),s=r.ref(null),u=F.Form.getParentForm();Oe(t.entity);const{state:l,update:c}=Ke(t.entity,{masterEntities:t.masterEntities||[]}),f=(t.actions||[]).map(g=>Lt(g)),m=r.computed(()=>o.value?Ht(t.entity,o.value.config):[]),d=r.computed(()=>{var g;return((g=o.value)==null?void 0:g.displayItem)||Ye.inline}),w=r.computed(()=>{var g;return((g=o.value)==null?void 0:g.newItem)||d.value}),h=_e(async()=>{try{await v.call(),await c()}catch(g){const{message:y}=ge(g);a.value=y}});u instanceof F.Form&&u.subscribe({read:h.call.bind(null),name:t.entity,type:"table"}),r.onMounted(()=>{k.call(),h.call()});const k=_e(async function(){const y=t.entity;o.value=await St(y,t.mark)}),v=_e(async function(){var E,C;const y=t.entity;a.value=null,k.promise&&await k.promise,i.value=(await ce(y,{fields:_t(m.value).join(" "),order:((E=o.value)==null?void 0:E.order)||[],filter:$.and($(D.value),$(t.binding||{}),$(((C=o.value)==null?void 0:C.prefilters)||{}))})).map(oo)});async function p(g){var E;if(g===null)return s.value=null;const y=g==null?void 0:g.Id;if(!y&&((E=o.value)!=null&&E.linkNew))return n.push(o.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 v.call()):s.value=_.LIST_ACTIVE_NEW}const{controller:b}=qe();r.watch(()=>l.value,g=>{g&&(g.canRead?b.show():b.hide())},{immediate:!0}),r.onUnmounted(()=>b.remove());const T=[{icon:"reload",label:"Reload",callback(){h.call()}}];let I=[he.on("affected-entity",g=>{g.name===t.entity&&v.call()}),he.on("display-entity",async g=>{g.name===t.entity&&(v.promise&&await v.promise,s.value=i.value.find(y=>y.Id===g.id)||null)})];r.onUnmounted(()=>I.map(g=>g()));function R(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=o.value)==null?void 0:Y.order)||[];(j=>{if(o.value)return o.value.order=j,!0})(C[0]!==E?[E,"asc"]:C[1]==="desc"?[]:[E,"desc"])&&v.call()}const D=r.ref({});return r.watch(()=>D.value,()=>v.call()),(g,y)=>{var L,W,Y,j;const E=r.resolveComponent("widget-button"),C=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",Sr,[(L=o.value)!=null&&L.label?(r.openBlock(),r.createElementBlock("p",Ir,r.toDisplayString((W=o.value)==null?void 0:W.label),1)):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"slide-up"},{default:r.withCtx(()=>[r.unref(h).wait||r.unref(k).wait||r.unref(v).wait?(r.openBlock(),r.createElementBlock("div",Nr,[r.createVNode(r.unref(ye),{color:"var(--color-primary)"}),Rr])):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("div",Lr,[w.value==="form"||(Y=r.unref(l))!=null&&Y.canCreate?(r.openBlock(),r.createBlock(E,{key:0,callback:p,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",Or,[r.createVNode(Ar,{entity:g.entity,"filters-config":((j=o.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:i.value,"active-row":s.value,"onUpdate:activeRow":p,onOrder:R,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:R,order:((B=o.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(v).call()})},null,8,["entity","id","master-entities","binding"])]}),_:1},8,["config","array","active-row"])])])}}});function Tt(e){return Ge(e,"YYYY/MM/DD HH:mm:ss")}function Ge(e,t="YYYY/MM/DD"){if(!e)return"";try{const n=new Date(e);return Kt.format(n,t)}catch(n){return console.log(n),"Invalid date"}}function _e(e){function t(...i){if(n.wait)return Promise.reject("The process has already started.");n.wait=!0;const o=Promise.resolve().then(()=>e(...i)).finally(()=>{n.wait=!1,n.promise=null});return n.promise=o,o}const n=r.reactive({wait:!1,call:t,promise:null});return n}function ge(e){return typeof e=="string"?be(e):xr(e)?be(e.message,e.children||e.details||[]):Br(e)?be(e.title,[e.detail||""]):be(_.DEFAULT_ERROR_MESSAGE)}function xr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Br(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function be(e,t=[]){return{message:e,children:t}}function G(e="error"){return function(t){const{message:n,children:i}=ge(t);me.add(e,n,{children:i})}}function ce(e,t={}){return x().emit("entity:read",{...t,entity:e})}function ze(e,t){return x().emit("entity:update",{...t,entity:e})}function _t(e){return e.reduce((t,n)=>(n.name&&(typeof n.name=="string"?t.push(n.name):t.push(...n.name)),t),[])}function Ct(e,t=2){if(!(typeof e=="string"||typeof e=="number"))return"";let i=String(e).split(".");return i[0]=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),i.length<2&&(i[1]=""),i[1]=i[1].padEnd(t,"0"),i[1].length>t&&(i[1]=i[1].substring(0,t)),i.join(".")}function Fr(e,t){const n=new Map;return e.forEach(i=>{var a;const o=t(i);n.has(o)||n.set(o,[]),(a=n.get(o))==null||a.push(i)}),n}function Dr(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function Pr(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=>Pr(n).then(i=>{if(!n.ok)throw i;return i}))}function Vr(e,t=1e3){let n=0;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>e(...i),t)}}function Mr(e,t){let n=!1;return(...i)=>{if(!n)return n=!0,setTimeout(()=>n=!1,t),e(...i)}}const jr=Ne(Re("pretty-value-field-by-entity"));function Ur(e,t,n){try{const i=Se.get(e);if(!i)throw new Error("For entity metadata is not loaded");const o=i.fieldsByName[t];if(!o)throw new Error(`For entity ${e} can't found fieldMetadata for field ${t}`);return o.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(i){return jr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',i,e,t,n),n}}const ee=Ne(Re("use-socket"));function x(){return qr}function Wr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const qr=function(){let e=1,t,n;const i=new Set;let o=0;const a=new Set;function s(){if(t)o&&(clearTimeout(o),o=0);else return;o=setTimeout(()=>{t.close()},yn*2);const p=new Uint8Array(1);p[0]=hn,t.send(p)}setInterval(()=>{Array.from(i).forEach(p=>{v(p)&&(ee("Handler for event %s requestId %d was expired",p.event,p.requestId),p.requestId?l({requestId:p.requestId,event:wt,data:{message:Q.RequestTookToLong().message}}):i.delete(p))})},1e3),setInterval(()=>{(!t||t.readyState===3)&&c()},_.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:a,requestId:e,handlers:i,socketInstance:t}}function l(p){const b=[...i.values()];ee("Handlers array length is %d. Response event: %s. Request id: %d",i.size,p.event,p.requestId),b.forEach(T=>{const I=p.requestId;(T.requestId&&T.requestId===I||!T.requestId&&T.event===p.event)&&(ee("Find appropriated handler: %d, event: %s",e,T.event),T.callback(p.data,p),T.once&&(i.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(p){ee("Connection to server was stopped: %d %s",p.code,p.reason),Array.from(i).forEach(b=>{b.guaranteedAnswer&&b.serializeString&&a.add(b.serializeString)})},t.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(p=>{f(p),a.delete(p)})},t.onerror=function(p){console.warn(p)},t.onmessage=p=>{var b;try{if(Wr(p.data)){s();return}const T=JSON.parse(p.data);if(!At(T)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(T);return}(b=T==null?void 0:T.data)!=null&&b.refresh&&location.reload(),l(T)}catch(T){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(T)}}}function f(p){t.send(p)}function m(p,b){k({event:p,callback:b})}function d(p,b){k({event:p,callback:b,once:!0})}function w(){return t&&(t==null?void 0:t.readyState)===1}function h(p,b,T){const I=++e,R=JSON.stringify({requestId:I,event:p,data:b,contextId:q.contextId,url:S.socketURLHandler?S.socketURLHandler():window.location.href});return w()?f(R):(a.add(R),ee("Socket is not connected. Message was send to save-queue")),new Promise((D,g)=>{k({event:p,requestId:I,once:!0,guaranteedAnswer:!0,serializeString:R,callback:(y,E)=>{if(ee("Promise was resolve with next data:",y),Gr(E))return void g(y);T&&T(y,E),D(y)},timeToLive:_.TIME_TO_LIVE_SOCKET_REQUEST})})}function k(p){const b={timeToLive:0,...p,created:new Date().getTime()};i.add(b)}function v(p){return p.timeToLive===0||typeof p.timeToLive!="number"?!1:new Date().getTime()-p.created>p.timeToLive}return{get socket(){return t},on:m,once:d,emit:h,initialization(p){n=p},getDevInfo:u}}(),Gr=e=>!!At(e)&&e.event===wt,At=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function St(e,t){return x().emit("list-setting:read",{entity:e,mark:t})}function zr(e,t){return x().emit("metadata-field:treat",{entity:e,fieldName:t})}function It(e,t){return x().emit("entity:create",{...t,entity:e})}function Nt(e,t){return x().emit("entity:delete",{...t,entity:e})}function Hr(e,t){return x().emit("usage-context:read",{...t,entity:e})}function Rt(e={}){return x().emit("tool:read",e)}function Xr(){return x().emit("metadata-list:read",{})}function Lt(e,t={},n={}){const i=r.inject(_.PROVIDE_NAME_ACTIONS,null),o=typeof e=="string"?e:t,a=typeof t=="string"?n:t;return r.computed(()=>{var l;const u=((typeof e=="string"?(l=i==null?void 0:i.actions)==null?void 0:l.value:r.unref(e))||[]).find(c=>c.name===o);return u?{...u,...a}:null})}function Jr(e){return x().emit("history:read",e)}function Yr(e,t){return x().emit("entity:count",{...t,entity:e})}function Kr(e){return`/${vn}/${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=Qr;ue.replaceRecordOperation=Zr;function Qr(e,t){return typeof e!="boolean"?"":e?t[1]:t[0]}function Zr(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function ei(e={}){return x().emit("tool:execute",e)}const ti=Ne(Re("wrap-tool-response"));function Ot(e,t){return e.handleConfirmation===void 0&&(e.handleConfirmation=ii),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=ai),e.handleCloseForm===void 0&&(e.handleCloseForm=si),e.handleValidationResult===void 0&&(e.handleValidationResult=oi),{...t,label:t.title,callback(){var o;const n=typeof e.values=="function"?e.values(t,e):e.values,i=()=>ei({name:t.name,values:n,usageContext:t.usageContext}).then(async a=>{var s,u;if(!ni(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&&me.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(G("error"));return(o=e.overrides)!=null&&o[t.name]?e.overrides[t.name](t,e):t.requireSave&&e.form&&e.form.changed?e.form.save().then(i):!t.confirmation||!e.handleConfirmation?i():e.handleConfirmation(t,i)}}}function ni(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function ri(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 ii(e,t){const n=ri(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 oi(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 ai(e,t,n){var l;function i(c){return c!==null&&typeof c=="object"&&typeof c.read=="function"}function o(c,f){c&&(ti("Affected Entity %s. Find form with name %s.",f,c.name),c.name===f&&i(c)&&c.read(),c instanceof F.Form&&c.dependencies.forEach(m=>o(m,f)))}he.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){he.emit("display-entity",{id:u,name:t.name}),S.getEntityLink&&a.push(S.getEntityLink(t.name,u));return}o(s,t.name)}function si(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=F.utils.getPropFromObject((this==null?void 0:this.vocabulary)||te,e);if(typeof n=="string")return st(n,t);const i=F.utils.getPropFromObject(te==null?void 0:te.root,e);return typeof i=="string"?st(i,t):(typeof n===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function st(e,t){return t.forEach((n,i)=>{e=e.replaceAll(new RegExp(`\\{${i}}`,"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:F.utils.getPropFromObject(te,t.toLowerCase())})};Z.setVocabulary=function(e){return typeof e=="string"&&(e=F.utils.getPropFromObject(te,e)),Z.bind({vocabulary:e})};function li(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fe={exports:{}},N={},De={exports:{}},re={};function $t(){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 ci(e,t,n){}function ui(e,t,n){}var fi=/javascript\s*\:/img;function di(e,t){return fi.test(t)?"":t}re.whiteList=$t();re.getDefaultWhiteList=$t;re.onAttr=ci;re.onIgnoreAttr=ui;re.safeAttrValue=di;var pi={indexOf:function(e,t){var n,i;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var i,o;if(Array.prototype.forEach)return e.forEach(t,n);for(i=0,o=e.length;i<o;i++)t.call(n,e[i],i,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,"")}},de=pi;function gi(e,t){e=de.trimRight(e),e[e.length-1]!==";"&&(e+=";");var n=e.length,i=!1,o=0,a=0,s="";function u(){if(!i){var f=de.trim(e.slice(o,a)),m=f.indexOf(":");if(m!==-1){var d=de.trim(f.slice(0,m)),w=de.trim(f.slice(m+1));if(d){var h=t(o,s.length,d,w,f);h&&(s+=h+"; ")}}}o=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,o=a+1,i=!1}else l==="("?i=!0:l===")"?i=!1:l===";"?i||u():l===`
7
- `&&u()}return de.trim(s)}var mi=gi,Ee=re,hi=mi;function lt(e){return e==null}function yi(e){var t={};for(var n in e)t[n]=e[n];return t}function xt(e){e=yi(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,i=n.whiteList,o=n.onAttr,a=n.onIgnoreAttr,s=n.safeAttrValue,u=hi(e,function(l,c,f,m,d){var w=i[f],h=!1;if(w===!0?h=w:typeof w=="function"?h=w(m):w instanceof RegExp&&(h=w.test(m)),h!==!0&&(h=!1),m=s(f,m),!!m){var k={position:c,sourcePosition:l,source:d,isWhite:h};if(h){var v=o(f,m,k);return lt(v)?f+":"+m:v}else{var v=a(f,m,k);if(!lt(v))return v}}});return u};var vi=xt;(function(e,t){var n=re,i=vi;function o(s,u){var l=new i(u);return l.process(s)}t=e.exports=o,t.FilterCSS=i;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,i;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var i,o;if(Array.prototype.forEach)return e.forEach(t,n);for(i=0,o=e.length;i<o;i++)t.call(n,e[i],i,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}},wi=He.FilterCSS,bi=He.getDefaultWhiteList,Ae=Xe;function Bt(){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 Ft=new wi;function Ei(e,t,n){}function ki(e,t,n){}function Ti(e,t,n){}function _i(e,t,n){}function Dt(e){return e.replace(Ai,"&lt;").replace(Si,"&gt;")}function Ci(e,t,n,i){if(n=Wt(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"";i!==!1&&(i=i||Ft,n=i.process(n))}return n=qt(n),n}var Ai=/</g,Si=/>/g,Ii=/"/g,Ni=/&quot;/g,Ri=/&#([a-zA-Z0-9]*);?/gim,Li=/&colon;?/gim,Oi=/&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 Pt(e){return e.replace(Ii,"&quot;")}function Vt(e){return e.replace(Ni,'"')}function Mt(e){return e.replace(Ri,function(n,i){return i[0]==="x"||i[0]==="X"?String.fromCharCode(parseInt(i.substr(1),16)):String.fromCharCode(parseInt(i,10))})}function jt(e){return e.replace(Li,":").replace(Oi," ")}function Ut(e){for(var t="",n=0,i=e.length;n<i;n++)t+=e.charCodeAt(n)<32?" ":e.charAt(n);return Ae.trim(t)}function Wt(e){return e=Vt(e),e=Mt(e),e=jt(e),e=Ut(e),e}function qt(e){return e=Pt(e),e=Dt(e),e}function $i(){return""}function xi(e,t){typeof t!="function"&&(t=function(){});var n=!Array.isArray(e);function i(s){return n?!0:Ae.indexOf(e,s)!==-1}var o=[],a=!1;return{onIgnoreTag:function(s,u,l){if(i(s))if(l.isClosing){var c="[/removed]",f=l.position+c.length;return o.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(o,function(c){u+=s.slice(l,c[0]),l=c[1]}),u+=s.slice(l),u}}}function Bi(e){for(var t="",n=0;n<e.length;){var i=e.indexOf("<!--",n);if(i===-1){t+=e.slice(n);break}t+=e.slice(n,i);var o=e.indexOf("-->",i);if(o===-1)break;n=o+3}return t}function Fi(e){var t=e.split("");return t=t.filter(function(n){var i=n.charCodeAt(0);return i===127?!1:i<=31?i===10||i===13:!0}),t.join("")}N.whiteList=Bt();N.getDefaultWhiteList=Bt;N.onTag=Ei;N.onIgnoreTag=ki;N.onTagAttr=Ti;N.onIgnoreTagAttr=_i;N.safeAttrValue=Ci;N.escapeHtml=Dt;N.escapeQuote=Pt;N.unescapeQuote=Vt;N.escapeHtmlEntities=Mt;N.escapeDangerHtml5Entities=jt;N.clearNonPrintableCharacter=Ut;N.friendlyAttrValue=Wt;N.escapeAttrValue=qt;N.onIgnoreTagStripAll=$i;N.StripTagBody=xi;N.stripCommentTag=Bi;N.stripBlankChar=Fi;N.attributeWrapSign='"';N.cssFilter=Ft;N.getDefaultCSSWhiteList=bi;var Le={},K=Xe;function Di(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 Pi(e){return e.slice(0,2)==="</"}function Vi(e,t,n){var i="",o=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==="<"){i+=n(e.slice(o,u)),a=u,o=u;continue}if(m===">"||u===l-1){i+=n(e.slice(o,a)),f=e.slice(a,u+1),c=Di(f),i+=t(a,i.length,c,f,Pi(f)),o=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 o<l&&(i+=n(e.substr(o))),i}var Mi=/[^a-zA-Z0-9\\_:.-]/gim;function ji(e,t){var n=0,i=0,o=[],a=!1,s=e.length;function u(d,w){if(d=K.trim(d),d=d.replace(Mi,"").toLowerCase(),!(d.length<1)){var h=t(d,w||"");h&&o.push(h)}}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,i=e.charAt(n)==='"'||e.charAt(n)==="'"?n:Wi(e,l+1);continue}if(a!==!1&&l===i){if(m=e.indexOf(c,l+1),m===-1)break;f=K.trim(e.slice(i+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=Ui(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=qi(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(o.join(" "))}function Ui(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Wi(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="'"||n==='"'?t:-1}}function qi(e,t){for(;t>0;t--){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Gi(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function ft(e){return Gi(e)?e.substr(1,e.length-2):e}Le.parseTag=Vi;Le.parseAttr=ji;var zi=He.FilterCSS,U=N,Gt=Le,Hi=Gt.parseTag,Xi=Gt.parseAttr,Ce=Xe;function Te(e){return e==null}function Ji(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 Yi(e){var t={};for(var n in e)t[n]=e[n];return t}function Ki(e){var t={};for(var n in e)Array.isArray(e[n])?t[n.toLowerCase()]=e[n].map(function(i){return i.toLowerCase()}):t[n.toLowerCase()]=e[n];return t}function zt(e){e=Yi(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=Ki(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 zi(e.css))}zt.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,i=n.whiteList,o=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=Hi(e,function(h,k,v,p,b){var T={sourcePosition:h,position:k,isClosing:b,isWhite:Object.prototype.hasOwnProperty.call(i,v)},I=o(v,p,T);if(!Te(I))return I;if(T.isWhite){if(T.isClosing)return"</"+v+">";var R=Ji(p),D=i[v],g=Xi(R.html,function(y,E){var C=Ce.indexOf(D,y)!==-1,L=s(v,y,E,C);return Te(L)?C?(E=l(v,y,E,m),E?y+"="+f+E+f:y):(L=u(v,y,E,C),Te(L)?void 0:L):L});return p="<"+v,g&&(p+=" "+g),R.closing&&(p+=" /"),p+=">",p}else return I=a(v,p,T),Te(I)?c(p):I},c);return d&&(w=d.remove(w)),w};var Qi=zt;(function(e,t){var n=N,i=Le,o=Qi;function a(u,l){var c=new o(l);return c.process(u)}t=e.exports=a,t.filterXSS=a,t.FilterXSS=o,function(){for(var u in n)t[u]=n[u];for(var l in i)t[l]=i[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 Zi=Fe.exports;const eo=li(Zi);function to(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>'),eo(e)}function no(e,t,n,i){let o=e+t/60+n/3600;return(i=="S"||i=="W")&&(o=o*-1),o}function ro(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 Ht(e,t,n){const i=Z.getScope(e.toLowerCase());return t.map(o=>(typeof o.label=="string"&&(o.label=i(o.label)),o.type==="history"&&(o.onClick=a=>ne.openModal("modal-history",{id:a.Id,entity:e}),o.icon="history",o.class="widget-list-cell-history"),(o.entity||o.useObjectTypeName)&&Array.isArray(o.name)&&o.name.length>1&&(o.modal===!0?(o.onClick=a=>{ne.openModal("form",{entity:dt(o,a),id:a[pe(o)]})},o.class="widget-table-cell_link cursor_pointer"):o.link=a=>{if(typeof a!="object"||a==null)return null;const s=o.name[0],u=a[s];return u?Je(dt(o,a),u):null},o.value=(a,s)=>s[o.name[1]]),io(o,o.type,o.presentation),o))}function io(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 oo(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 ao(){const e=r.ref(null);function t(n){e.value=n}return{activeRow:e,activateRow:t}}function so(e,t){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(t)}async function Xt(e,t){e()&&(await t(),await Xt(e,t))}function lo(e,t,n={}){let i=!1;const o=r.ref(""),a=r.computed(()=>s.filter(g=>c(g,o.value))),s=r.reactive([]);let u=0;const l=r.ref(!1);let c=(n==null?void 0:n.filterSearchFn)||((g,y)=>so(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(L=>L.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 h(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 k(g,y){try{const E=I(),C=d(y,g);delete y.Version,await ze(e,{id:g,values:y,version:C,masterEntities:f()});const L=await ce(e,{fields:E.fields||"",id:g});w(g,L)}catch(E){G()(E)}}async function v(g,y={}){try{const E=I(),C=d(y,g);delete y.Version,await Nt(e,{id:g,version:C,masterEntities:f()}),h(g)}catch(E){G()(E)}}async function p(g){try{await It(e,{values:g,masterEntities:f()}),await R()}catch(y){G()(y)}}let b;async function T(){l.value=!0;try{b!=null&&b.signal&&!b.signal.aborted&&b.abort();let g=b=new AbortController,y=0;const C=I().limit||0;if(o.value&&!C){console.warn("Using textSearch assumes the use of limit.");return}await Xt(()=>(C>0?y<C:!0)&&!i&&!g.signal.aborted,async()=>{const L=await m();g.signal.aborted||(s.push(...L),y+=L.filter(W=>c(W,o.value)).length,(L.length<C||C===0)&&(i=!0))})}catch(g){G()(g)}l.value=!1}function I(){return typeof t=="function"?t():t}async function R(){try{u=0,i=!1,s.splice(0,s.length),await T()}catch(g){G()(g)}}function D(){if(b)return b.abort();l.value=!1}return{array:s,updateById:k,next:T,reload:R,wait:l,create:p,deleteById:v,textSearch:o,filteredArray:a,abort:D}}function co(){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 uo(e,t,n){return x().emit("communication:create",{entityName:e,entityCatalogId:t,targetCode:n})}function fo(e,t,n){return x().emit("communication:read",{entityName:e,entityCatalogId:t,targetCode:n})}function po(e,t){return x().emit("communication-message:create",{communicationId:e,text:t})}function go(e){return x().emit("communication-message:read",{communicationId:e})}function mo(e){const t=F.Form.getParentForm(),n=r.reactive([]);return t&&t.subscribe(e),e.read=()=>go(e.id).then(i=>(n.splice(0,n.length,...i),i)),{array:n}}function ho(e,t){e.read=()=>{const i=n();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return ce(e.name,i)}).then(Qe).then(o=>(o.hasOwnProperty("Version")&&(e.version=o.Version),e.setValues(o),o)).catch(G())},e.save=()=>{const i=n();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return ze(e.name,{id:i.id,values:e.changes,version:e.version})}).then(o=>{e.version=o.version}).catch(o=>{throw G()(o),o})};function n(){return typeof t=="function"?t():t}}function Oe(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 Hr(e,yo(t||{}))}}}function yo(e){return typeof e=="function"?e():e}function vo(e){if(!e)return r.inject(_.PROVIDE_NAME_ACTIONS);const t=r.ref(!1),n=r.reactive([]),i=r.computed(()=>n.map(s=>Ot(e,s))),o={actions:i,update:a};r.provide(_.PROVIDE_NAME_ACTIONS,o),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 Rt({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(G("error")).finally(()=>t.value=!1)}return{actions:i,update:a,loading:r.readonly(t)}}function wo(e){function t(n){n.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",t)}),r.onUnmounted(()=>{document.removeEventListener("keypress",t)})}function bo(e,t={}){const n=r.reactive([]),i=l=>{const c=r.unref(e);if(l===void 0){n.length===0?c.forEach(a):c.forEach(s);return}o(l)?s(l):a(l)},o=l=>n.includes(l),a=l=>{t.handleSelect&&!t.handleSelect(l)||o(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,i,u,a,s]}function Eo(e){const t=r.ref(""),n=r.computed(()=>{const i=t.value.toLowerCase();return r.unref(e).filter(o=>t.value.length?Object.values(o).join().toLowerCase().includes(i):!0)});return{search:t,searchArray:n}}const me=new class{constructor(){this.store=r.reactive([])}add(t,n,i={}){const o=ko(i),a=new Pe(t,n,o.timeout,o.children,o.click);return this.store.push(a),o.timeout&&setTimeout(this.remove.bind(this,a.id),o.timeout*1e3),a}remove(t){const n=this.store.findIndex(i=>i.id===t);if(n===-1)return!1;this.store.splice(n,1)}};function ko(e){function t(i){return!!i&&typeof i=="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,i,o,a){this.type=t,this.message=n,this.timeout=i,this.children=o,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"),F=require("jenesius-vue-form"),Me=require("vue-router"),Kt=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,i){return new S(`Array already includes the element with value ${t}`,{array:n,table:i})}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 Qt="Please try again later or submit a feedback if problem doesn't go.";function Zt(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return Qt}})}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=>Zt(n).then(i=>{if(!n.ok)throw i;return i}))}class en{constructor(){this.public=!1,this.errors=new Proxy([],{set:(t,n,i)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(i)}`),t[n]=i,!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 en;function rt(e){return{...e,createdEntities:e.createdEntites}}const oe=class oe{static async getStartConfig(t,n){return J([oe.url,t,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(t,n){return J([oe.url,t,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(rt)}static async runStep(t,n,i,o,a){return J([oe.url,t,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:i,token:o,values:a})}).then(rt)}};oe.url="/close-api/views/process-wizard";let ae=oe;class tn{static invite(t,n,i){return J("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:t,personKey:n,relatedRoleCode:i})})}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 nn{static getRequiredDocuments(t,n,i){const o=new URLSearchParams({entity:t,primaryKey:n,statusCode:i});return fetch(`/close-api/views/required-documents?${o.toString()}`).then(a=>a.json())}}class ie{static url(){return"close-api/billing"}static getBillingMetadata(t){return fetch(`/${ie.url()}/calculator/${t}`)}static calculate(t,n){return J(`/${ie.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:t,values:n})}).then(i=>{if(i&&i.status===1)return i;throw Array.isArray(i.notes)?new Error(i.notes[0]):Q.ApiNotAvailable()})}static parseMetadataField(t){function n(i){switch(i.type){case"ValueType":switch(i.dataType){case"Integer":return"number";default:return i.dataType}case"EntityReference":return i.dataType}}return{name:t.name,label:t.title,required:t.required,type:n(t)}}static createOnlinePayment(t,n){return J(`/${ie.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:t,returnURL:n})})}static applyOnlinePayment(t){return J(`/${ie.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:t})})}}function rn(e){return e.statusName==="Completed"}function on(e){return e.statusName==="FinalStepWithConfirmation"}function an(e){return e.statusName==="ValidationError"}function sn(e,t,n){let i=null;const o=r.reactive({wait:null});let a=[],s=null;const u=r.ref(null);function l(){u.value=a.find(p=>p.name===s)||null}function c(){var p;return s?((p=a.find(b=>b.name===s))==null?void 0:p.fields)||[]:[]}function f(p){if(l(),an(p))return void n.onValidation(p.validationResults);if((p.statusName==="FinalStep"||p.statusName==="NextStep")&&(!c().length||ln(c(),n.presets)))return v(n.presets||{});rn(p)&&n.onCompleted(p),on(p)&&n.onConfirmation(p)}async function m(){try{await d(),await k()}catch(p){const{message:b}=ge(p);me.add("error",b)}}function d(){return o.wait="Loading process information.",ae.getStartConfig(t,e).then(p=>{a=p.steps.map(b=>({label:b.title,name:b.stepName,number:b.number,fields:b.frontendEntity.objectTypes.reduce((T,I)=>(I.properties.forEach(R=>{T.push({name:R.name,label:R.title,type:R.refEntityName||R.dataType})}),T),[])}))}).then(p=>(o.wait=!1,p))}function w(p){return["FinalStepWithConfirmation","NextStep","Completed","FinalStep"].includes(p.statusName)&&(i=p.token,s=p.nextStepName),p}function h(p){const b=ge(p);me.add("error",b.message)}function k(){return o.wait="Starting process",ae.startProcess(t,e).then(w).then(f).catch(h).finally(()=>{o.wait=null})}function v(p={}){return!i||!s?Promise.reject("Not step or token."):(o.wait="Waiting for result...",ae.runStep(t,e,s,i,p).then(w).then(f).catch(h).finally(()=>{o.wait=!1}))}return{initialize:m,state:o,currentStepConfig:r.readonly(u),next:v}}function ln(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(!F.utils.getPropFromObject(t,i.name))return!1}return!0}const cn={class:"widget-table__head-cell"},un={class:"widget-table__head-label margin_0 text_overflow"},vt=r.defineComponent({__name:"widget-table-head-cell",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("th",cn,[r.createElementVNode("span",un,r.toDisplayString(t.label),1)]))}}),fn={class:"widget-table__head"},dn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>A.componentTableHeadCell||vt),(t,n)=>(r.openBlock(),r.createElementBlock("tr",fn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.config,i=>r.renderSlot(t.$slots,"default",r.mergeProps({ref_for:!0},i),void 0,!0)),256))]))}}),M=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},pn=M(dn,[["__scopeId","data-v-498c4f00"]]);function je(e){return Array.isArray(e)?je(e[0]):typeof e!="string"?null:e}function pe(e){return je(e.name)}function gn(e){const t=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let i;for(;(i=t.exec(e))!==null;)n.push(i[1]);return n}function mn(e,t){return gn(e).forEach(i=>{e=e.replace(new RegExp("\\$\\{"+i+"}","g"),F.utils.getPropFromObject(t,i))}),e}function Be(e){return t=>typeof t=="string"||typeof t=="number"?`${t} ${e}`:""}function Ue(e,t){const n=pe(e);if(typeof e.value=="string")return mn(e.value,t);let i=n?F.utils.getPropFromObject(t,n):null;if(i===void 0&&(i=null),typeof e.value=="function")return e.value(i,t);if(e.value===null)return null;if(e.unitValue&&(i=Be(e.unitValue)(i)),e.unit&&(i=Be(e.unit)(i)),e.type)switch(e.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Ge(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Tt(typeof i=="string"?i:null);break}case"money":{i=Ct(i);break}}return e.formatter&&(i=ue(e.formatter).exec(i,t)),typeof i=="boolean"&&(i=i?"✓":"—"),i}const hn=1,yn=5e3,vn="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 wn={class:"widget-filter-text flex gap_20"},bn=r.defineComponent({__name:"widget-filter-text",props:{values:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,i=t,o=r.ref("");function a(){i("update:values",o.value)}return r.watch(()=>n.values,s=>{if(typeof s!="string")return o.value="";o.value=s},{immediate:!0}),(s,u)=>{const l=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",wn,[r.createVNode(r.unref(F.FormField),{type:"text",modelValue:o.value,"onUpdate:modelValue":u[0]||(u[0]=c=>o.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})])}}}),En=M(bn,[["__scopeId","data-v-800b3803"]]),kn={class:"widget-filter-enum"},Tn=r.defineComponent({__name:"widget-filter-entity",props:{values:{},fieldMetadata:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,i=r.ref([]),o=Oe(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)||!o.value)return;const c=o.value.fieldNameForLabel,f=o.value.fieldNameForIdentification;i.value=await ce(n.fieldMetadata.entity,{fields:[c,f].join(" "),order:[c,"asc"]}).then(d=>d.map(w=>({label:w[c],value:w[f]})))}return r.watch(()=>o.value,l,{immediate:!0}),(c,f)=>(r.openBlock(),r.createElementBlock("div",kn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,m=>(r.openBlock(),r.createBlock(r.unref(F.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))]))}}),_n=M(Tn,[["__scopeId","data-v-94b2ed25"]]),A={getEntityLink(e,t){return`/forms/${e}/${t}`},iconHandlerText(){return""},iconTag:"i",tableFilterEntityBind:{String:En,Entity:_n}};function Cn(e){for(let t in e)A[t]=e[t]}const An={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(An,[["__scopeId","data-v-8a72b45f"]]),Sn=Ne(Re("setup-list-row"));function In(e,t){const n=e.config.map(i=>Nn(i,e,t));return r.h("tr",{class:"widget-table__row widget-table-row"},n)}function Nn(e,t,n){const i=t.values;let o=Ue(e,i);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function s(f){a.onClick.push(()=>f(i,e,n))}function u(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const l=[],c=[];if(e.hide&&e.hide(i))return[r.h("td")];if(e.type)switch(u(`widget-table-cell_${e.type}`),e.type){case"multi-select":{c.push(r.h(F.FormField,{type:"single-checkbox",modelValue:t.selected})),s(it.bind(null,n,!0));break}case"select":{c.push(r.h(F.FormField,{type:"single-radio",modelValue:t.selected})),s(it.bind(null,n,!1));break}}if(e.onClick&&s(e.onClick),e.link)try{const f=e.link(i);if(f){const m=r.h(Me.RouterLink,{to:f});c.push(m),u("widget-table-cell_link")}}catch(f){Sn("Can't add router link",f)}if(e.href&&(c.push(r.h("a",{href:e.href(i),target:"_blank"})),u("widget-table-cell_link")),(typeof o=="string"||typeof o=="number")&&c.push(r.h("p",{class:"widget-list-cell-text"},o)),e.icon&&(typeof e.icon=="string"&&c.push(r.h(le,{name:e.icon})),typeof e.icon=="function")){const f=e.icon(i);f!==null&&c.push(r.h(le,{name:f}))}return e.class&&(typeof e.class=="function"?u(e.class(i)):u(e.class)),A.listCellHandler&&A.listCellHandler(e,i,{cellNodeChildren:c,addClass:u,addHandleClick:s,context:n}),l.push(r.h("td",a,c)),l}function it(e,t){e.emit("select",t)}function We(e,t){return()=>{try{return In(e,t)}catch(n){return console.warn(n),null}}}const Rn={props:{values:Object,config:Object,selected:Boolean},setup:We},Ln=["colspan"],ot=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(e,{emit:t}){const n=t,i=r.ref();return r.onMounted(()=>{setTimeout(()=>{i.value&&i.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(o,a)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:i},[r.createElementVNode("td",{colspan:o.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(o.component),r.mergeProps(o.$attrs,{values:o.values,new:o.isNew,onClose:a[0]||(a[0]=s=>n("close")),onSave:a[1]||(a[1]=s=>n("save",s))}),null,16,["values","new"]))],8,Ln)],512))}}),On={class:"widget-table"},at="update:selectedRows",$n="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,i=t,o=r.useSlots(),a=r.computed(()=>{var d;return(d=o==null?void 0:o.default)==null?void 0:d.call(o)[0]});function s(d){return n.useMockField?pt(d):d}function u(d,w=!0){if(!n.selectedRows)return;if(!w)return i(at,n.selectedRows.includes(d)?[]:[d]);const h=[...n.selectedRows],k=h.indexOf(d);return k===-1?h.push(d):h.splice(k,1),i(at,h)}function l(d){i($n,d)}function c(d){i("save",d),i("update:activeRow",null)}const f=r.computed(()=>n.shortcut?n.config.filter(d=>d.name?!!n.array.find(h=>![null,""].includes(Ue(d,h))):!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",On,[r.createElementVNode("thead",null,[r.createVNode(pn,{config:f.value,onOrder:w[0]||(w[0]=h=>d.$emit("order",h))},{default:r.withCtx(h=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(d.$slots["head-cell"]||vt),r.normalizeProps(r.guardReactiveProps(h)),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,(h,k)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:k},[r.createVNode(Rn,{config:f.value,values:h,selected:d.selectedRows.includes(s(h)),onSelect:v=>u(s(h),v),onActivate:v=>l(s(h)),class:r.normalizeClass(d.classCallback?d.classCallback(h):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&d.activeRow===s(h)?(r.openBlock(),r.createBlock(ot,{key:0,component:a.value,"row-length":d.config.length,values:h,onClose:w[1]||(w[1]=v=>i("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(ot,{key:0,component:a.value,"row-length":f.value.length,onClose:w[2]||(w[2]=h=>i("update:activeRow",null)),onSave:c,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),xn=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))}}),ye=M(xn,[["__scopeId","data-v-0ef9ae88"]]),Bn={class:"widget-button"},Fn=r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("button",Bn,[t.wait?(r.openBlock(),r.createBlock(ye,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(t.$slots,"default",{},void 0,!0)]))}}),Dn=M(Fn,[["__scopeId","data-v-450dc564"]]),Pn={class:"widget-multi-button-wrap position_relative cursor_pointer"},Vn={class:"widget-multi-button-body grid"},Mn=["onClick"],jn={class:"widget-multi-button-side-wrap"},Un=r.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(e){r.useCssVars(s=>({"04895bf1":i.value}));const t=e,n=r.reactive({active:!1,wait:!1}),i=r.computed(()=>t.array.length+(t.label?1:0));function o(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",Pn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[r.createElementVNode("div",Vn,[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=>{o(l.callback),a(!1)}},r.toDisplayString(l.label),9,Mn))),128))]),r.createElementVNode("div",jn,[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(ye),{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)]))}}),Wn=M(Un,[["__scopeId","data-v-d43a76ce"]]),qn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Gn={class:"text_md"},zn=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",qn,[r.createVNode(ye,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Gn,r.toDisplayString(t.label),1)]))}}),Hn=["alt","src"],Xn=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)}}),(i,o)=>(r.openBlock(),r.createElementBlock("img",{alt:i.alt,ref_key:"refImage",ref:n,src:i.src||i.$props.default},null,8,Hn))}}),Jn={props:{config:Array,values:Object,selected:Boolean},setup:We},Yn=M(Jn,[["__scopeId","data-v-344a8cc1"]]),Kn=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),Qn={class:"widget-list-head-cell"},Zn=Kn(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),er=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,i=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(o,a)=>(r.openBlock(),r.createElementBlock("th",null,[r.createElementVNode("div",Qn,[r.createElementVNode("div",{class:"head-cell-content flex_grow",style:r.normalizeStyle({"min-width":o.minWidth,"max-width":o.maxWidth,width:o.width})},[o.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(F.FormField),{key:0,type:"single-checkbox",onClick:a[0]||(a[0]=r.withModifiers(s=>i("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=>i("order"))},r.toDisplayString(o.title||o.label),1))],4),o.name&&o.order.length&&o.order[0]===o.name?(r.openBlock(),r.createBlock(r.unref(le),{key:0,class:r.normalizeClass(["head-cell-order",{"head-cell-order_down":o.order.length>1&&o.order[1]==="desc"}])},{default:r.withCtx(()=>[r.createTextVNode("core-arrow-up")]),_:1},8,["class"])):r.createCommentVNode("",!0),Zn])]))}}),tr=M(er,[["__scopeId","data-v-bf495d6a"]]),nr=r.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(e,{emit:t}){const n=e,i=t,o=r.ref(),a=r.ref();r.onMounted(()=>{function c(h,k){let v=-1;do v++,k-=h[v];while(k>0&&v<h.length);return v}function f(h,k){let v=0;for(;k>0&&k>h[v]&&v<h.length;)k-=h[v],v++;return console.log(k,v),v>0?v:0}function m(h){try{a.value.style.insetInlineStart=h+"px"}catch(k){console.log(k)}}function d(h){try{a.value.style.width=h+"px",a.value.style.minWidth=h+"px",a.value.style.maxWidth=h+"px"}catch(k){console.log(k)}}function w(h){return h===null?!1:h.classList.contains("head-cell-resize")}o.value.addEventListener("pointerdown",function(k){var O;function v(B){return B.screenX+T-D}const p=o.value,b=[...p.children].filter(B=>B.localName==="th"),T=((O=p.offsetParent)==null?void 0:O.scrollLeft)||0,I=b.map(B=>B.clientWidth),R=w(k.target),D=p.getBoundingClientRect().left,g=v(k),y=c(I,g),E=I.slice(0,y).reduce((B,P)=>B+P,0),C=g-E,L=p.offsetWidth,W=b[y].clientWidth;if(n.config[y].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",k.screenX),console.log("Widths",I),console.log("max width",L),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=b[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(B){if(console.group("END"),document.removeEventListener("pointermove",j),document.removeEventListener("pointerup",Y),R&&(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)),!R){const P=B.screenX+T-D;console.log("ENP Position",P);const we=f(I,P);if(console.log(y,"->",we),we!==y){const fe=n.config[y],$e=n.config;$e.splice(y,1),$e.splice(we,0,fe),s($e)}else{const fe=n.config[y].name;u(fe)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function j(B){if(R){const fe=v(B)-g+W;d(fe);return}let P=B.screenX+T-D-C;P<0&&(P=0),P+W>L&&(P=L-W),m(P)}})});function s(c){i("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){i("update:order",c)}return(c,f)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:o},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.config,(m,d)=>(r.openBlock(),r.createBlock(tr,r.mergeProps({key:m,ref_for:!0},m,{onOrder:w=>u(m.name),onSelect:f[0]||(f[0]=w=>i("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))}}),rr=M(nr,[["__scopeId","data-v-ccffc6bd"]]),ir={class:"widget-list"},or={class:"widget-list-body position_relative"},ar=50,sr=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,i=t;function o(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){i("update:selectedRows",l)}function u(l){if(!l)return;const c=l.target;c.scrollTop+c.clientHeight+ar>c.scrollHeight&&i("scrollEnd")}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[r.createElementVNode("table",ir,[r.createElementVNode("thead",null,[r.createVNode(rr,{onSelect:c[0]||(c[0]=f=>a()),"onUpdate:order":c[1]||(c[1]=f=>i("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>i("update:config",f)),config:l.config,order:l.order},null,8,["config","order"])]),r.createElementVNode("tbody",or,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(f,m)=>{var d;return r.openBlock(),r.createBlock(Yn,{key:m,class:"widget-list-row",values:f,config:l.config,selected:(d=l.selectedRows)==null?void 0:d.includes(f),onSelect:w=>o(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 i=r.inject(_.VISIBLE_ITEM_PROVIDE_NAME,{show(){},hide(){},remove(){}});return{visible:e,controller:{show(){i==null||i.show(t)},hide(){i==null||i.hide(t)},remove(){i==null||i.remove(t)}},visibleItems:n}}const lr=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{}},setup(e){const t=e,n=Oe(),i=Ke(),o=r.computed(()=>{var k,v;const d=l.value,w=c(d),h={type:w,disabled:!((k=u.value)!=null&&k.canSet),label:t.label};return d&&Object.assign(h,{suffix:w==="number"?d.valueUnit:void 0,required:s.includes(w||"")?!1:d.required,label:t.label||d.displayName}),Object.assign(h,((v=A.fieldParamsHandler)==null?void 0:v.call(A,d,u.value,h))||{}),h}),a=["MultiText","MultiWideText"],s=["switch","single-checkbox","single-radio"],u=r.computed(()=>{var d;return(d=i==null?void 0:i.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(F.FormField),r.mergeProps({key:0},{...d.$attrs,...o.value},{name:d.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function cr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||_.DEFAULT_ORDER_DIR}const ur=["fill"],fr=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),dr=[fr],pr=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},dr,8,ur))}}),gr={class:"widget-fast-table-head-cell-td"},mr={class:"widget-head-cell-label"},hr={key:0,class:"widget-head-cell-order"},yr=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(()=>cr(t.order)),(i,o)=>{var a;return r.openBlock(),r.createElementBlock("td",gr,[r.createElementVNode("div",{class:"widget-head-cell",onClick:o[0]||(o[0]=s=>i.$emit("order",i.name))},[r.createElementVNode("span",mr,r.toDisplayString(i.label),1),n.value===((a=i.order)==null?void 0:a[0])?(r.openBlock(),r.createElementBlock("div",hr,[r.createVNode(pr,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${i.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)])])}}}),kt=M(yr,[["__scopeId","data-v-9db5d417"]]),vr={class:"widget-filter-item-container grid"},wr={class:"widget-filter-item"},br={class:"widget-filter-item-label"},Er={class:"widget-filter-item-popup"},kr=r.defineComponent({__name:"widget-filter-item",props:{entity:{},values:{},filterItem:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,i=t,o=A.tableFilterEntityBind,a=r.computed(()=>{const s=n.filterItem;return s.entity?"Entity":s.type?s.type:null});return(s,u)=>(r.openBlock(),r.createElementBlock("div",vr,[r.createElementVNode("div",wr,[r.createElementVNode("span",br,r.toDisplayString(s.filterItem.label||"--"),1)]),r.createVNode(r.Transition,{name:"slide-up"},{default:r.withCtx(()=>{var l;return[r.createElementVNode("div",Er,[a.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((l=r.unref(o))==null?void 0:l[a.value]),{key:0,"field-metadata":s.filterItem,values:s.values,"onUpdate:values":u[0]||(u[0]=c=>i("update:values",c))},null,40,["field-metadata","values"])):r.createCommentVNode("",!0)])]}),_:1})]))}}),Tr=M(kr,[["__scopeId","data-v-a7ce8477"]]),_r={class:"widget-table-panel-filter flex"},Cr=r.defineComponent({__name:"widget-table-panel-filters",props:{filtersConfig:{},filters:{},entity:{}},emits:["update:filters"],setup(e,{emit:t}){const n=e,i=t;function o(a,s){i("update:filters",{...n.filters,[a]:s})}return(a,s)=>(r.openBlock(),r.createElementBlock("div",_r,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(u,l)=>{var c;return r.openBlock(),r.createBlock(Tr,{key:l,entity:a.entity,"filter-item":u,values:(c=a.filters)==null?void 0:c[r.unref(pe)(u)],"onUpdate:values":f=>o(r.unref(pe)(u),f)},null,8,["entity","filter-item","values","onUpdate:values"])}),128))]))}}),Ar=M(Cr,[["__scopeId","data-v-51bb1b22"]]),Sr={class:"es-grid es-gap-15"},Ir={key:0,class:"title-md color-primary margin-0"},Nr={key:0,class:"widget-table-loader es-flex es-gap-10 es-flex-align-center es-padding-10 text-main"},Rr=r.createElementVNode("span",null,"Loading...",-1),Lr={class:"widget-fast-table-tools es-flex es-gap-15"},Or={class:""},$r=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{}},setup(e){const t=e,n=Me.useRouter(),i=r.ref([]),o=r.ref(null),a=r.ref(null),s=r.ref(null),u=F.Form.getParentForm();Oe(t.entity);const{state:l,update:c}=Ke(t.entity,{masterEntities:t.masterEntities||[]}),f=(t.actions||[]).map(g=>Lt(g)),m=r.computed(()=>o.value?Ht(t.entity,o.value.config):[]),d=r.computed(()=>{var g;return((g=o.value)==null?void 0:g.displayItem)||Ye.inline}),w=r.computed(()=>{var g;return((g=o.value)==null?void 0:g.newItem)||d.value}),h=_e(async()=>{try{await v.call(),await c()}catch(g){const{message:y}=ge(g);a.value=y}});u instanceof F.Form&&u.subscribe({read:h.call.bind(null),name:t.entity,type:"table"}),r.onMounted(()=>{k.call(),h.call()});const k=_e(async function(){const y=t.entity;o.value=await St(y,t.mark)}),v=_e(async function(){var E,C;const y=t.entity;a.value=null,k.promise&&await k.promise,i.value=(await ce(y,{fields:_t(m.value).join(" "),order:((E=o.value)==null?void 0:E.order)||[],filter:$.and($(D.value),$(t.binding||{}),$(((C=o.value)==null?void 0:C.prefilters)||{}))})).map(oo)});async function p(g){var E;if(g===null)return s.value=null;const y=g==null?void 0:g.Id;if(!y&&((E=o.value)!=null&&E.linkNew))return n.push(o.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 v.call()):s.value=_.LIST_ACTIVE_NEW}const{controller:b}=qe();r.watch(()=>l.value,g=>{g&&(g.canRead?b.show():b.hide())},{immediate:!0}),r.onUnmounted(()=>b.remove());const T=[{icon:"reload",label:"Reload",callback(){h.call()}}];let I=[he.on("affected-entity",g=>{g.name===t.entity&&v.call()}),he.on("display-entity",async g=>{g.name===t.entity&&(v.promise&&await v.promise,s.value=i.value.find(y=>y.Id===g.id)||null)})];r.onUnmounted(()=>I.map(g=>g()));function R(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=o.value)==null?void 0:Y.order)||[];(j=>{if(o.value)return o.value.order=j,!0})(C[0]!==E?[E,"asc"]:C[1]==="desc"?[]:[E,"desc"])&&v.call()}const D=r.ref({});return r.watch(()=>D.value,()=>v.call()),(g,y)=>{var L,W,Y,j;const E=r.resolveComponent("widget-button"),C=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",Sr,[(L=o.value)!=null&&L.label?(r.openBlock(),r.createElementBlock("p",Ir,r.toDisplayString((W=o.value)==null?void 0:W.label),1)):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"slide-up"},{default:r.withCtx(()=>[r.unref(h).wait||r.unref(k).wait||r.unref(v).wait?(r.openBlock(),r.createElementBlock("div",Nr,[r.createVNode(r.unref(ye),{color:"var(--color-primary)"}),Rr])):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("div",Lr,[w.value==="form"||(Y=r.unref(l))!=null&&Y.canCreate?(r.openBlock(),r.createBlock(E,{key:0,callback:p,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",Or,[r.createVNode(Ar,{entity:g.entity,"filters-config":((j=o.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:i.value,"active-row":s.value,"onUpdate:activeRow":p,onOrder:R,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:R,order:((B=o.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(v).call()})},null,8,["entity","id","master-entities","binding"])]}),_:1},8,["config","array","active-row"])])])}}});function Tt(e){return Ge(e,"YYYY/MM/DD HH:mm:ss")}function Ge(e,t="YYYY/MM/DD"){if(!e)return"";try{const n=new Date(e);return Kt.format(n,t)}catch(n){return console.log(n),"Invalid date"}}function _e(e){function t(...i){if(n.wait)return Promise.reject("The process has already started.");n.wait=!0;const o=Promise.resolve().then(()=>e(...i)).finally(()=>{n.wait=!1,n.promise=null});return n.promise=o,o}const n=r.reactive({wait:!1,call:t,promise:null});return n}function ge(e){return typeof e=="string"?be(e):xr(e)?be(e.message,e.children||e.details||[]):Br(e)?be(e.title,[e.detail||""]):be(_.DEFAULT_ERROR_MESSAGE)}function xr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Br(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function be(e,t=[]){return{message:e,children:t}}function G(e="error"){return function(t){const{message:n,children:i}=ge(t);me.add(e,n,{children:i})}}function ce(e,t={}){return x().emit("entity:read",{...t,entity:e})}function ze(e,t){return x().emit("entity:update",{...t,entity:e})}function _t(e){return e.reduce((t,n)=>(n.name&&(typeof n.name=="string"?t.push(n.name):t.push(...n.name)),t),[])}function Ct(e,t=2){if(!(typeof e=="string"||typeof e=="number"))return"";let i=String(e).split(".");return i[0]=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),i.length<2&&(i[1]=""),i[1]=i[1].padEnd(t,"0"),i[1].length>t&&(i[1]=i[1].substring(0,t)),i.join(".")}function Fr(e,t){const n=new Map;return e.forEach(i=>{var a;const o=t(i);n.has(o)||n.set(o,[]),(a=n.get(o))==null||a.push(i)}),n}function Dr(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function Pr(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=>Pr(n).then(i=>{if(!n.ok)throw i;return i}))}function Vr(e,t=1e3){let n=0;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>e(...i),t)}}function Mr(e,t){let n=!1;return(...i)=>{if(!n)return n=!0,setTimeout(()=>n=!1,t),e(...i)}}const jr=Ne(Re("pretty-value-field-by-entity"));function Ur(e,t,n){try{const i=Se.get(e);if(!i)throw new Error("For entity metadata is not loaded");const o=i.fieldsByName[t];if(!o)throw new Error(`For entity ${e} can't found fieldMetadata for field ${t}`);return o.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(i){return jr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',i,e,t,n),n}}const ee=Ne(Re("use-socket"));function x(){return qr}function Wr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const qr=function(){let e=1,t,n;const i=new Set;let o=0;const a=new Set;function s(){if(t)o&&(clearTimeout(o),o=0);else return;o=setTimeout(()=>{t.close()},yn*2);const p=new Uint8Array(1);p[0]=hn,t.send(p)}setInterval(()=>{Array.from(i).forEach(p=>{v(p)&&(ee("Handler for event %s requestId %d was expired",p.event,p.requestId),p.requestId?l({requestId:p.requestId,event:wt,data:{message:Q.RequestTookToLong().message}}):i.delete(p))})},1e3),setInterval(()=>{(!t||t.readyState===3)&&c()},_.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:a,requestId:e,handlers:i,socketInstance:t}}function l(p){const b=[...i.values()];ee("Handlers array length is %d. Response event: %s. Request id: %d",i.size,p.event,p.requestId),b.forEach(T=>{const I=p.requestId;(T.requestId&&T.requestId===I||!T.requestId&&T.event===p.event)&&(ee("Find appropriated handler: %d, event: %s",e,T.event),T.callback(p.data,p),T.once&&(i.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(p){ee("Connection to server was stopped: %d %s",p.code,p.reason),Array.from(i).forEach(b=>{b.guaranteedAnswer&&b.serializeString&&a.add(b.serializeString)})},t.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(p=>{f(p),a.delete(p)})},t.onerror=function(p){console.warn(p)},t.onmessage=p=>{var b;try{if(Wr(p.data)){s();return}const T=JSON.parse(p.data);if(!At(T)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(T);return}(b=T==null?void 0:T.data)!=null&&b.refresh&&location.reload(),l(T)}catch(T){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(T)}}}function f(p){t.send(p)}function m(p,b){k({event:p,callback:b})}function d(p,b){k({event:p,callback:b,once:!0})}function w(){return t&&(t==null?void 0:t.readyState)===1}function h(p,b,T){const I=++e,R=JSON.stringify({requestId:I,event:p,data:b,contextId:q.contextId,url:A.socketURLHandler?A.socketURLHandler():window.location.href});return w()?f(R):(a.add(R),ee("Socket is not connected. Message was send to save-queue")),new Promise((D,g)=>{k({event:p,requestId:I,once:!0,guaranteedAnswer:!0,serializeString:R,callback:(y,E)=>{if(ee("Promise was resolve with next data:",y),Gr(E))return void g(y);T&&T(y,E),D(y)},timeToLive:_.TIME_TO_LIVE_SOCKET_REQUEST})})}function k(p){const b={timeToLive:0,...p,created:new Date().getTime()};i.add(b)}function v(p){return p.timeToLive===0||typeof p.timeToLive!="number"?!1:new Date().getTime()-p.created>p.timeToLive}return{get socket(){return t},on:m,once:d,emit:h,initialization(p){n=p},getDevInfo:u}}(),Gr=e=>!!At(e)&&e.event===wt,At=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function St(e,t){return x().emit("list-setting:read",{entity:e,mark:t})}function zr(e,t){return x().emit("metadata-field:treat",{entity:e,fieldName:t})}function It(e,t){return x().emit("entity:create",{...t,entity:e})}function Nt(e,t){return x().emit("entity:delete",{...t,entity:e})}function Hr(e,t){return x().emit("usage-context:read",{...t,entity:e})}function Rt(e={}){return x().emit("tool:read",e)}function Xr(){return x().emit("metadata-list:read",{})}function Lt(e,t={},n={}){const i=r.inject(_.PROVIDE_NAME_ACTIONS,null),o=typeof e=="string"?e:t,a=typeof t=="string"?n:t;return r.computed(()=>{var l;const u=((typeof e=="string"?(l=i==null?void 0:i.actions)==null?void 0:l.value:r.unref(e))||[]).find(c=>c.name===o);return u?{...u,...a}:null})}function Jr(e){return x().emit("history:read",e)}function Yr(e,t){return x().emit("entity:count",{...t,entity:e})}function Kr(e){return`/${vn}/${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=Qr;ue.replaceRecordOperation=Zr;function Qr(e,t){return typeof e!="boolean"?"":e?t[1]:t[0]}function Zr(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function ei(e={}){return x().emit("tool:execute",e)}const ti=Ne(Re("wrap-tool-response"));function Ot(e,t){return e.handleConfirmation===void 0&&(e.handleConfirmation=ii),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=ai),e.handleCloseForm===void 0&&(e.handleCloseForm=si),e.handleValidationResult===void 0&&(e.handleValidationResult=oi),{...t,label:t.title,callback(){var o;const n=typeof e.values=="function"?e.values(t,e):e.values,i=()=>ei({name:t.name,values:n,usageContext:t.usageContext}).then(async a=>{var s,u;if(!ni(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&&me.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(G("error"));return(o=e.overrides)!=null&&o[t.name]?e.overrides[t.name](t,e):t.requireSave&&e.form&&e.form.changed?e.form.save().then(i):!t.confirmation||!e.handleConfirmation?i():e.handleConfirmation(t,i)}}}function ni(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function ri(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 ii(e,t){const n=ri(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 oi(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 ai(e,t,n){var l;function i(c){return c!==null&&typeof c=="object"&&typeof c.read=="function"}function o(c,f){c&&(ti("Affected Entity %s. Find form with name %s.",f,c.name),c.name===f&&i(c)&&c.read(),c instanceof F.Form&&c.dependencies.forEach(m=>o(m,f)))}he.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){he.emit("display-entity",{id:u,name:t.name}),A.getEntityLink&&a.push(A.getEntityLink(t.name,u));return}o(s,t.name)}function si(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=F.utils.getPropFromObject((this==null?void 0:this.vocabulary)||te,e);if(typeof n=="string")return st(n,t);const i=F.utils.getPropFromObject(te==null?void 0:te.root,e);return typeof i=="string"?st(i,t):(typeof n===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function st(e,t){return t.forEach((n,i)=>{e=e.replaceAll(new RegExp(`\\{${i}}`,"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:F.utils.getPropFromObject(te,t.toLowerCase())})};Z.setVocabulary=function(e){return typeof e=="string"&&(e=F.utils.getPropFromObject(te,e)),Z.bind({vocabulary:e})};function li(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fe={exports:{}},N={},De={exports:{}},re={};function $t(){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 ci(e,t,n){}function ui(e,t,n){}var fi=/javascript\s*\:/img;function di(e,t){return fi.test(t)?"":t}re.whiteList=$t();re.getDefaultWhiteList=$t;re.onAttr=ci;re.onIgnoreAttr=ui;re.safeAttrValue=di;var pi={indexOf:function(e,t){var n,i;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var i,o;if(Array.prototype.forEach)return e.forEach(t,n);for(i=0,o=e.length;i<o;i++)t.call(n,e[i],i,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,"")}},de=pi;function gi(e,t){e=de.trimRight(e),e[e.length-1]!==";"&&(e+=";");var n=e.length,i=!1,o=0,a=0,s="";function u(){if(!i){var f=de.trim(e.slice(o,a)),m=f.indexOf(":");if(m!==-1){var d=de.trim(f.slice(0,m)),w=de.trim(f.slice(m+1));if(d){var h=t(o,s.length,d,w,f);h&&(s+=h+"; ")}}}o=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,o=a+1,i=!1}else l==="("?i=!0:l===")"?i=!1:l===";"?i||u():l===`
7
+ `&&u()}return de.trim(s)}var mi=gi,Ee=re,hi=mi;function lt(e){return e==null}function yi(e){var t={};for(var n in e)t[n]=e[n];return t}function xt(e){e=yi(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,i=n.whiteList,o=n.onAttr,a=n.onIgnoreAttr,s=n.safeAttrValue,u=hi(e,function(l,c,f,m,d){var w=i[f],h=!1;if(w===!0?h=w:typeof w=="function"?h=w(m):w instanceof RegExp&&(h=w.test(m)),h!==!0&&(h=!1),m=s(f,m),!!m){var k={position:c,sourcePosition:l,source:d,isWhite:h};if(h){var v=o(f,m,k);return lt(v)?f+":"+m:v}else{var v=a(f,m,k);if(!lt(v))return v}}});return u};var vi=xt;(function(e,t){var n=re,i=vi;function o(s,u){var l=new i(u);return l.process(s)}t=e.exports=o,t.FilterCSS=i;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,i;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var i,o;if(Array.prototype.forEach)return e.forEach(t,n);for(i=0,o=e.length;i<o;i++)t.call(n,e[i],i,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}},wi=He.FilterCSS,bi=He.getDefaultWhiteList,Ae=Xe;function Bt(){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 Ft=new wi;function Ei(e,t,n){}function ki(e,t,n){}function Ti(e,t,n){}function _i(e,t,n){}function Dt(e){return e.replace(Ai,"&lt;").replace(Si,"&gt;")}function Ci(e,t,n,i){if(n=Wt(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"";i!==!1&&(i=i||Ft,n=i.process(n))}return n=qt(n),n}var Ai=/</g,Si=/>/g,Ii=/"/g,Ni=/&quot;/g,Ri=/&#([a-zA-Z0-9]*);?/gim,Li=/&colon;?/gim,Oi=/&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 Pt(e){return e.replace(Ii,"&quot;")}function Vt(e){return e.replace(Ni,'"')}function Mt(e){return e.replace(Ri,function(n,i){return i[0]==="x"||i[0]==="X"?String.fromCharCode(parseInt(i.substr(1),16)):String.fromCharCode(parseInt(i,10))})}function jt(e){return e.replace(Li,":").replace(Oi," ")}function Ut(e){for(var t="",n=0,i=e.length;n<i;n++)t+=e.charCodeAt(n)<32?" ":e.charAt(n);return Ae.trim(t)}function Wt(e){return e=Vt(e),e=Mt(e),e=jt(e),e=Ut(e),e}function qt(e){return e=Pt(e),e=Dt(e),e}function $i(){return""}function xi(e,t){typeof t!="function"&&(t=function(){});var n=!Array.isArray(e);function i(s){return n?!0:Ae.indexOf(e,s)!==-1}var o=[],a=!1;return{onIgnoreTag:function(s,u,l){if(i(s))if(l.isClosing){var c="[/removed]",f=l.position+c.length;return o.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(o,function(c){u+=s.slice(l,c[0]),l=c[1]}),u+=s.slice(l),u}}}function Bi(e){for(var t="",n=0;n<e.length;){var i=e.indexOf("<!--",n);if(i===-1){t+=e.slice(n);break}t+=e.slice(n,i);var o=e.indexOf("-->",i);if(o===-1)break;n=o+3}return t}function Fi(e){var t=e.split("");return t=t.filter(function(n){var i=n.charCodeAt(0);return i===127?!1:i<=31?i===10||i===13:!0}),t.join("")}N.whiteList=Bt();N.getDefaultWhiteList=Bt;N.onTag=Ei;N.onIgnoreTag=ki;N.onTagAttr=Ti;N.onIgnoreTagAttr=_i;N.safeAttrValue=Ci;N.escapeHtml=Dt;N.escapeQuote=Pt;N.unescapeQuote=Vt;N.escapeHtmlEntities=Mt;N.escapeDangerHtml5Entities=jt;N.clearNonPrintableCharacter=Ut;N.friendlyAttrValue=Wt;N.escapeAttrValue=qt;N.onIgnoreTagStripAll=$i;N.StripTagBody=xi;N.stripCommentTag=Bi;N.stripBlankChar=Fi;N.attributeWrapSign='"';N.cssFilter=Ft;N.getDefaultCSSWhiteList=bi;var Le={},K=Xe;function Di(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 Pi(e){return e.slice(0,2)==="</"}function Vi(e,t,n){var i="",o=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==="<"){i+=n(e.slice(o,u)),a=u,o=u;continue}if(m===">"||u===l-1){i+=n(e.slice(o,a)),f=e.slice(a,u+1),c=Di(f),i+=t(a,i.length,c,f,Pi(f)),o=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 o<l&&(i+=n(e.substr(o))),i}var Mi=/[^a-zA-Z0-9\\_:.-]/gim;function ji(e,t){var n=0,i=0,o=[],a=!1,s=e.length;function u(d,w){if(d=K.trim(d),d=d.replace(Mi,"").toLowerCase(),!(d.length<1)){var h=t(d,w||"");h&&o.push(h)}}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,i=e.charAt(n)==='"'||e.charAt(n)==="'"?n:Wi(e,l+1);continue}if(a!==!1&&l===i){if(m=e.indexOf(c,l+1),m===-1)break;f=K.trim(e.slice(i+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=Ui(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=qi(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(o.join(" "))}function Ui(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Wi(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="'"||n==='"'?t:-1}}function qi(e,t){for(;t>0;t--){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Gi(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function ft(e){return Gi(e)?e.substr(1,e.length-2):e}Le.parseTag=Vi;Le.parseAttr=ji;var zi=He.FilterCSS,U=N,Gt=Le,Hi=Gt.parseTag,Xi=Gt.parseAttr,Ce=Xe;function Te(e){return e==null}function Ji(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 Yi(e){var t={};for(var n in e)t[n]=e[n];return t}function Ki(e){var t={};for(var n in e)Array.isArray(e[n])?t[n.toLowerCase()]=e[n].map(function(i){return i.toLowerCase()}):t[n.toLowerCase()]=e[n];return t}function zt(e){e=Yi(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=Ki(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 zi(e.css))}zt.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,i=n.whiteList,o=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=Hi(e,function(h,k,v,p,b){var T={sourcePosition:h,position:k,isClosing:b,isWhite:Object.prototype.hasOwnProperty.call(i,v)},I=o(v,p,T);if(!Te(I))return I;if(T.isWhite){if(T.isClosing)return"</"+v+">";var R=Ji(p),D=i[v],g=Xi(R.html,function(y,E){var C=Ce.indexOf(D,y)!==-1,L=s(v,y,E,C);return Te(L)?C?(E=l(v,y,E,m),E?y+"="+f+E+f:y):(L=u(v,y,E,C),Te(L)?void 0:L):L});return p="<"+v,g&&(p+=" "+g),R.closing&&(p+=" /"),p+=">",p}else return I=a(v,p,T),Te(I)?c(p):I},c);return d&&(w=d.remove(w)),w};var Qi=zt;(function(e,t){var n=N,i=Le,o=Qi;function a(u,l){var c=new o(l);return c.process(u)}t=e.exports=a,t.filterXSS=a,t.FilterXSS=o,function(){for(var u in n)t[u]=n[u];for(var l in i)t[l]=i[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 Zi=Fe.exports;const eo=li(Zi);function to(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>'),eo(e)}function no(e,t,n,i){let o=e+t/60+n/3600;return(i=="S"||i=="W")&&(o=o*-1),o}function ro(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 Ht(e,t,n){const i=Z.getScope(e.toLowerCase());return t.map(o=>(typeof o.label=="string"&&(o.label=i(o.label)),o.type==="history"&&(o.onClick=a=>ne.openModal("modal-history",{id:a.Id,entity:e}),o.icon="history",o.class="widget-list-cell-history"),(o.entity||o.useObjectTypeName)&&Array.isArray(o.name)&&o.name.length>1&&(o.modal===!0?(o.onClick=a=>{ne.openModal("form",{entity:dt(o,a),id:a[pe(o)]})},o.class="widget-table-cell_link cursor_pointer"):o.link=a=>{if(typeof a!="object"||a==null)return null;const s=o.name[0],u=a[s];return u?Je(dt(o,a),u):null},o.value=(a,s)=>s[o.name[1]]),io(o,o.type,o.presentation),A.listConvertCellConfigHandler&&A.listConvertCellConfigHandler(e,o),o))}function io(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 oo(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 ao(){const e=r.ref(null);function t(n){e.value=n}return{activeRow:e,activateRow:t}}function so(e,t){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(t)}async function Xt(e,t){e()&&(await t(),await Xt(e,t))}function lo(e,t,n={}){let i=!1;const o=r.ref(""),a=r.computed(()=>s.filter(g=>c(g,o.value))),s=r.reactive([]);let u=0;const l=r.ref(!1);let c=(n==null?void 0:n.filterSearchFn)||((g,y)=>so(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(L=>L.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 h(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 k(g,y){try{const E=I(),C=d(y,g);delete y.Version,await ze(e,{id:g,values:y,version:C,masterEntities:f()});const L=await ce(e,{fields:E.fields||"",id:g});w(g,L)}catch(E){G()(E)}}async function v(g,y={}){try{const E=I(),C=d(y,g);delete y.Version,await Nt(e,{id:g,version:C,masterEntities:f()}),h(g)}catch(E){G()(E)}}async function p(g){try{await It(e,{values:g,masterEntities:f()}),await R()}catch(y){G()(y)}}let b;async function T(){l.value=!0;try{b!=null&&b.signal&&!b.signal.aborted&&b.abort();let g=b=new AbortController,y=0;const C=I().limit||0;if(o.value&&!C){console.warn("Using textSearch assumes the use of limit.");return}await Xt(()=>(C>0?y<C:!0)&&!i&&!g.signal.aborted,async()=>{const L=await m();g.signal.aborted||(s.push(...L),y+=L.filter(W=>c(W,o.value)).length,(L.length<C||C===0)&&(i=!0))})}catch(g){G()(g)}l.value=!1}function I(){return typeof t=="function"?t():t}async function R(){try{u=0,i=!1,s.splice(0,s.length),await T()}catch(g){G()(g)}}function D(){if(b)return b.abort();l.value=!1}return{array:s,updateById:k,next:T,reload:R,wait:l,create:p,deleteById:v,textSearch:o,filteredArray:a,abort:D}}function co(){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 uo(e,t,n){return x().emit("communication:create",{entityName:e,entityCatalogId:t,targetCode:n})}function fo(e,t,n){return x().emit("communication:read",{entityName:e,entityCatalogId:t,targetCode:n})}function po(e,t){return x().emit("communication-message:create",{communicationId:e,text:t})}function go(e){return x().emit("communication-message:read",{communicationId:e})}function mo(e){const t=F.Form.getParentForm(),n=r.reactive([]);return t&&t.subscribe(e),e.read=()=>go(e.id).then(i=>(n.splice(0,n.length,...i),i)),{array:n}}function ho(e,t){e.read=()=>{const i=n();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return ce(e.name,i)}).then(Qe).then(o=>(o.hasOwnProperty("Version")&&(e.version=o.Version),e.setValues(o),o)).catch(G())},e.save=()=>{const i=n();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return ze(e.name,{id:i.id,values:e.changes,version:e.version})}).then(o=>{e.version=o.version}).catch(o=>{throw G()(o),o})};function n(){return typeof t=="function"?t():t}}function Oe(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 Hr(e,yo(t||{}))}}}function yo(e){return typeof e=="function"?e():e}function vo(e){if(!e)return r.inject(_.PROVIDE_NAME_ACTIONS);const t=r.ref(!1),n=r.reactive([]),i=r.computed(()=>n.map(s=>Ot(e,s))),o={actions:i,update:a};r.provide(_.PROVIDE_NAME_ACTIONS,o),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 Rt({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(G("error")).finally(()=>t.value=!1)}return{actions:i,update:a,loading:r.readonly(t)}}function wo(e){function t(n){n.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",t)}),r.onUnmounted(()=>{document.removeEventListener("keypress",t)})}function bo(e,t={}){const n=r.reactive([]),i=l=>{const c=r.unref(e);if(l===void 0){n.length===0?c.forEach(a):c.forEach(s);return}o(l)?s(l):a(l)},o=l=>n.includes(l),a=l=>{t.handleSelect&&!t.handleSelect(l)||o(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,i,u,a,s]}function Eo(e){const t=r.ref(""),n=r.computed(()=>{const i=t.value.toLowerCase();return r.unref(e).filter(o=>t.value.length?Object.values(o).join().toLowerCase().includes(i):!0)});return{search:t,searchArray:n}}const me=new class{constructor(){this.store=r.reactive([])}add(t,n,i={}){const o=ko(i),a=new Pe(t,n,o.timeout,o.children,o.click);return this.store.push(a),o.timeout&&setTimeout(this.remove.bind(this,a.id),o.timeout*1e3),a}remove(t){const n=this.store.findIndex(i=>i.id===t);if(n===-1)return!1;this.store.splice(n,1)}};function ko(e){function t(i){return!!i&&typeof i=="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,i,o,a){this.type=t,this.message=n,this.timeout=i,this.children=o,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 i=n.indexOf(t);i!==-1&&n.splice(i,1)},yt=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(){yt.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(){yt.call(X)}}X.events={};class To extends X{constructor(t){super(),this.name="Communication",this.read=()=>{},this.id=t}sendMessage(t){return po(this.id,t)}static checkAndGenerate(t,n,i){return fo(t,n,i).then(o=>o.length===0?uo(t,n,i):o[0])}}function _o(){return x().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(i=>i.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){G()(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 _o()}validateContextId(n){var i;try{return((i=this.person)==null?void 0:i.id)==n?!0:!!this.organizations.find(o=>o.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 Co(e){return x().emit("metadata:read",{entity:e})}const Se=function(){const t=r.reactive({}),n=new Map;function i(u){return t[u]}async function o(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=Co(u).finally(()=>{n.delete(u)});return n.set(u,l),l}function s(u,l){t[u]=l}return{state:t,initEntity:o,get:i}}();class Ao 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 z{static login(t){return V(S.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...t,AppName:S.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 z.requestStepRegistrationProcess("StartRegistration",t)}static confirmPhoneRegistrationProcess(t){return z.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",t)}static confirmEmailRegistrationProcess(t){return z.requestStepRegistrationProcess("ConfirmEmailByRegistration",t)}static finishEmailRegistrationProcess(t){return z.requestStepRegistrationProcess("FinishRegistration",t)}static requestStepRegistrationProcess(t,n){return V(`${S.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(t){return z.requestStepLoginProcess("StartLogin",t)}static loginWithPassword(t){return z.requestStepLoginProcess("LoginWithPassword",t)}static loginWithOtpCode(t){return z.requestStepLoginProcess("LoginWithOtpCode",t)}static requestStepLoginProcess(t,n){return V(`${S.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(z.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(`${S.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:n,AppName:t})})}static confirmPhoneNumberByAccessRecovery(t,n,i,o){return V(`${S.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:i,Code:o})})}static confirmEmailByAccessRecovery(t,n,i,o){return V(`${S.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:i,Code:o})})}static finishAccessRecovery(t,n,i){return V(`${S.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Password:i,ConfirmedPassword:i})})}}class So{static readHistoryById(t,n){return V(`/close-api/audits/history/${t}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Io{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 No{static getDictionary(t){if(!t)throw new Error(`Can't get dictionary for ${t}.`);return V(`/open-api/internationalization/language/${t}`)}}class Ro{static async upload(t,n){const i=new FormData;return i.append("file",t),V(`/close-api/files?entityName=${n}`,{method:"POST",body:i}).then(o=>(o.filename=t.name,o))}}var Jt=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(Jt||{}),Yt=(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))(Yt||{});function Lo(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function $(e){return Object.keys(e).reduce((t,n)=>{const i=e[n];if(Array.isArray(i)){const o=i.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return i.length&&t.push(`@${n} in (${o})`),t}if(Lo(i)){let o=function(a){var s;return((s=a.match(/([^Z]*)/))==null?void 0:s[0])+"0000Z"};return i.start&&t.push(`@${n} ge ${o(i.start)}`),i.end&&t.push(`@${n} le ${o(i.end)}`),t}return typeof i=="number"||typeof i=="boolean"?(t.push(`@${n} eq ${i}`),t):typeof i=="string"?(i.length!==0&&t.push(`@${n} eq '${i}'`),t):(i===null&&t.push($.is(n,i)),t)},[]).join(" and ")}function ve(e){return typeof e=="string"?`'${e}'`:`${e}`}$.includes=function(t,n){return`@${t} Contains ${ve(n)}`};$.beginWith=function(t,n){return`@${t} BeginWith ${ve(n)}`};$.notEq=function(t,n){return`@${t} nq ${ve(n)}`};$.eq=function(t,n){return Array.isArray(n)?$.in(t,n):`@${t} eq ${ve(n)}`};$.in=function(t,n){const i=n.map(ve).join(", ");return`@${t} in (${i})`};$.notIn=function(t,n){return!Array.isArray(n)||n.length===0?"":$.and(...n.map(i=>$.notEq(t,i)))};$.and=function(...t){return t.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map($.wrap).join(" and ")};$.wrap=function(t){return`(${t})`};$.is=function(t,n){return`@${t} is ${n}`};$.or=function(...t){return t.join(" or ")};function Qe(e){return Object.keys(e).reduce((t,n)=>{let i=e[n];const o=n.charAt(0).toUpperCase()+n.slice(1);return typeof i=="object"&&!(i==null||Array.isArray(i))&&(i=Qe(i)),t[o]=i,t},{})}const q=new Ve,he=new Ao;exports.ApplicationStatus=Yt;exports.Communication=To;exports.CoreError=Q;exports.DisplayListRow=Ye;exports.EventBus=he;exports.Filter=$;exports.Manager=q;exports.MetadataStore=Se;exports.NotificationSystem=me;exports.OBJECT_TYPE_NAME_FIELD=bt;exports.RecordOperation=Jt;exports.WidgetButton=Dn;exports.WidgetFastTable=$r;exports.WidgetFastTableHeadCell=kt;exports.WidgetField=lr;exports.WidgetIcon=le;exports.WidgetImage=Xn;exports.WidgetList=sr;exports.WidgetLoader=zn;exports.WidgetMultiButton=Wn;exports.WidgetSpinner=ye;exports.WidgetTable=Et;exports.asyncProcess=_e;exports.authService=z;exports.billingService=ie;exports.catchUniversal=G;exports.config=Cn;exports.configuration=S;exports.constants=_;exports.convertDDToDMS=ro;exports.convertDMSToDD=no;exports.convertListConfig=Ht;exports.debounce=Vr;exports.documentsService=nn;exports.fileService=Ro;exports.formatter=ue;exports.getCellName=pe;exports.getCellValue=Ue;exports.getEntityLink=Je;exports.getNamesFromListConfig=_t;exports.getUnitValue=Be;exports.groupArrayByField=Fr;exports.historyService=So;exports.injectAction=Lt;exports.internationalizationService=No;exports.invitationService=tn;exports.openService=Io;exports.parseError=ge;exports.parseTextByMarkdown=to;exports.prettyDate=Ge;exports.prettyDateWithTime=Tt;exports.prettyMoney=Ct;exports.prettyValueFieldByEntity=Ur;exports.processWizardService=ae;exports.request=V;exports.setupListRow=We;exports.staticLink=Kr;exports.t=Z;exports.throttle=Mr;exports.universalEntityCount=Yr;exports.universalEntityCreate=It;exports.universalEntityDelete=Nt;exports.universalEntityRead=ce;exports.universalEntityUpdate=ze;exports.universalHistoryRead=Jr;exports.universalListSettingRead=St;exports.universalMetadataFieldTreat=zr;exports.universalMetadataListRead=Xr;exports.universalToolRead=Rt;exports.useActions=vo;exports.useCommunication=mo;exports.useEnter=wo;exports.useFormEntity=ho;exports.useListActiveRow=ao;exports.useListEntity=lo;exports.useListSearch=Eo;exports.useListSelect=bo;exports.useManagerState=co;exports.useMetadata=Oe;exports.useSocket=x;exports.useUsageContext=Ke;exports.useVisibleItem=qe;exports.useWizard=sn;exports.uuidv4=Dr;exports.valuesToUpperCase=Qe;exports.wrapToolResponse=Ot;
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 i=n.indexOf(t);i!==-1&&n.splice(i,1)},yt=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(){yt.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(){yt.call(X)}}X.events={};class To extends X{constructor(t){super(),this.name="Communication",this.read=()=>{},this.id=t}sendMessage(t){return po(this.id,t)}static checkAndGenerate(t,n,i){return fo(t,n,i).then(o=>o.length===0?uo(t,n,i):o[0])}}function _o(){return x().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(i=>i.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){G()(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 _o()}validateContextId(n){var i;try{return((i=this.person)==null?void 0:i.id)==n?!0:!!this.organizations.find(o=>o.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 Co(e){return x().emit("metadata:read",{entity:e})}const Se=function(){const t=r.reactive({}),n=new Map;function i(u){return t[u]}async function o(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=Co(u).finally(()=>{n.delete(u)});return n.set(u,l),l}function s(u,l){t[u]=l}return{state:t,initEntity:o,get:i}}();class Ao 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 z{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 z.requestStepRegistrationProcess("StartRegistration",t)}static confirmPhoneRegistrationProcess(t){return z.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",t)}static confirmEmailRegistrationProcess(t){return z.requestStepRegistrationProcess("ConfirmEmailByRegistration",t)}static finishEmailRegistrationProcess(t){return z.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 z.requestStepLoginProcess("StartLogin",t)}static loginWithPassword(t){return z.requestStepLoginProcess("LoginWithPassword",t)}static loginWithOtpCode(t){return z.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(z.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,i,o){return V(`${A.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:i,Code:o})})}static confirmEmailByAccessRecovery(t,n,i,o){return V(`${A.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:i,Code:o})})}static finishAccessRecovery(t,n,i){return V(`${A.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Password:i,ConfirmedPassword:i})})}}class So{static readHistoryById(t,n){return V(`/close-api/audits/history/${t}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Io{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 No{static getDictionary(t){if(!t)throw new Error(`Can't get dictionary for ${t}.`);return V(`/open-api/internationalization/language/${t}`)}}class Ro{static async upload(t,n){const i=new FormData;return i.append("file",t),V(`/close-api/files?entityName=${n}`,{method:"POST",body:i}).then(o=>(o.filename=t.name,o))}}var Jt=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(Jt||{}),Yt=(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))(Yt||{});function Lo(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function $(e){return Object.keys(e).reduce((t,n)=>{const i=e[n];if(Array.isArray(i)){const o=i.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return i.length&&t.push(`@${n} in (${o})`),t}if(Lo(i)){let o=function(a){var s;return((s=a.match(/([^Z]*)/))==null?void 0:s[0])+"0000Z"};return i.start&&t.push(`@${n} ge ${o(i.start)}`),i.end&&t.push(`@${n} le ${o(i.end)}`),t}return typeof i=="number"||typeof i=="boolean"?(t.push(`@${n} eq ${i}`),t):typeof i=="string"?(i.length!==0&&t.push(`@${n} eq '${i}'`),t):(i===null&&t.push($.is(n,i)),t)},[]).join(" and ")}function ve(e){return typeof e=="string"?`'${e}'`:`${e}`}$.includes=function(t,n){return`@${t} Contains ${ve(n)}`};$.beginWith=function(t,n){return`@${t} BeginWith ${ve(n)}`};$.notEq=function(t,n){return`@${t} nq ${ve(n)}`};$.eq=function(t,n){return Array.isArray(n)?$.in(t,n):`@${t} eq ${ve(n)}`};$.in=function(t,n){const i=n.map(ve).join(", ");return`@${t} in (${i})`};$.notIn=function(t,n){return!Array.isArray(n)||n.length===0?"":$.and(...n.map(i=>$.notEq(t,i)))};$.and=function(...t){return t.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map($.wrap).join(" and ")};$.wrap=function(t){return`(${t})`};$.is=function(t,n){return`@${t} is ${n}`};$.or=function(...t){return t.join(" or ")};function Qe(e){return Object.keys(e).reduce((t,n)=>{let i=e[n];const o=n.charAt(0).toUpperCase()+n.slice(1);return typeof i=="object"&&!(i==null||Array.isArray(i))&&(i=Qe(i)),t[o]=i,t},{})}const q=new Ve,he=new Ao;exports.ApplicationStatus=Yt;exports.Communication=To;exports.CoreError=Q;exports.DisplayListRow=Ye;exports.EventBus=he;exports.Filter=$;exports.Manager=q;exports.MetadataStore=Se;exports.NotificationSystem=me;exports.OBJECT_TYPE_NAME_FIELD=bt;exports.RecordOperation=Jt;exports.WidgetButton=Dn;exports.WidgetFastTable=$r;exports.WidgetFastTableHeadCell=kt;exports.WidgetField=lr;exports.WidgetIcon=le;exports.WidgetImage=Xn;exports.WidgetList=sr;exports.WidgetLoader=zn;exports.WidgetMultiButton=Wn;exports.WidgetSpinner=ye;exports.WidgetTable=Et;exports.asyncProcess=_e;exports.authService=z;exports.billingService=ie;exports.catchUniversal=G;exports.config=Cn;exports.configuration=A;exports.constants=_;exports.convertDDToDMS=ro;exports.convertDMSToDD=no;exports.convertListConfig=Ht;exports.debounce=Vr;exports.documentsService=nn;exports.fileService=Ro;exports.formatter=ue;exports.getCellName=pe;exports.getCellValue=Ue;exports.getEntityLink=Je;exports.getNamesFromListConfig=_t;exports.getUnitValue=Be;exports.groupArrayByField=Fr;exports.historyService=So;exports.injectAction=Lt;exports.internationalizationService=No;exports.invitationService=tn;exports.openService=Io;exports.parseError=ge;exports.parseTextByMarkdown=to;exports.prettyDate=Ge;exports.prettyDateWithTime=Tt;exports.prettyMoney=Ct;exports.prettyValueFieldByEntity=Ur;exports.processWizardService=ae;exports.request=V;exports.setupListRow=We;exports.staticLink=Kr;exports.t=Z;exports.throttle=Mr;exports.universalEntityCount=Yr;exports.universalEntityCreate=It;exports.universalEntityDelete=Nt;exports.universalEntityRead=ce;exports.universalEntityUpdate=ze;exports.universalHistoryRead=Jr;exports.universalListSettingRead=St;exports.universalMetadataFieldTreat=zr;exports.universalMetadataListRead=Xr;exports.universalToolRead=Rt;exports.useActions=vo;exports.useCommunication=mo;exports.useEnter=wo;exports.useFormEntity=ho;exports.useListActiveRow=ao;exports.useListEntity=lo;exports.useListSearch=Eo;exports.useListSelect=bo;exports.useManagerState=co;exports.useMetadata=Oe;exports.useSocket=x;exports.useUsageContext=Ke;exports.useVisibleItem=qe;exports.useWizard=sn;exports.uuidv4=Dr;exports.valuesToUpperCase=Qe;exports.wrapToolResponse=Ot;
12
12
  //# sourceMappingURL=eservices-core.cjs.js.map