eservices-core 1.3.199 → 1.3.200

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.es-card-list{box-shadow:#959da533 0 8px 24px;border:1px solid #f1f1f1;border-radius:4px;background-color:#fff}.color-primary{color:var(--primary)}.color-gray{color:#ccc}.es-container-full{height:100%;width:100%}.es-cursor-pointer{cursor:pointer}.es-cursor-default{cursor:default}.es-flex{display:flex}.es-flex-column{display:flex;flex-direction:column}.es-flex-center{display:flex;align-items:center;justify-content:center}.es-flex-grow{flex-grow:1}.es-flex-justify-center{justify-content:center}.es-flex-justify-between{justify-content:space-between}.es-flex-align-center{align-items:center}.es-gap-1{gap:1px}.es-gap-2{gap:2px}.es-gap-3{gap:3px}.es-gap-4{gap:4px}.es-gap-5{gap:5px}.es-gap-6{gap:6px}.es-gap-7{gap:7px}.es-gap-8{gap:8px}.es-gap-9{gap:9px}.es-gap-10{gap:10px}.es-gap-15{gap:15px}.es-gap-20{gap:20px}.es-list-container,.es-overflow-auto{overflow:auto}.es-overflow-hidden{overflow:hidden}.es-padding-2{padding:2px}.es-padding-3{padding:3px}.es-padding-4{padding:4px}.es-padding-5{padding:5px}.es-padding-10{padding:10px}.es-padding-0{padding:0}.es-padding-7{padding:7px}.es-padding-15{padding:15px}.es-padding-20{padding:20px}.es-padding-v-5{padding:5px 0}.es-padding-h-5{padding:0 5px}.es-padding-is-5{padding-inline-start:5px}.es-padding-ie-5{padding-inline-end:5px}.es-position-relative{position:relative}.es-position-absolute{position:absolute}.es-position-absolute-full{position:absolute;left:0;top:0;width:100%;height:100%}.es-position-absolute-center{position:absolute;left:0;right:0;top:0;bottom:0;margin:auto}.es-radius-2{border-radius:2px}.es-radius-3{border-radius:3px}.es-radius-4{border-radius:4px}.es-radius-5{border-radius:5px}.es-radius-6{border-radius:6px}.es-radius-7{border-radius:7px}.es-radius-8{border-radius:8px}.es-radius-9{border-radius:9px}.es-radius-10{border-radius:10px}.es-radius-15{border-radius:15px}.es-radius-20{border-radius:20px}.es-text-xs{font-weight:400;font-size:10px;line-height:13px}.es-text-sm{font-weight:400;font-size:12px;line-height:16px}.es-text-md{font-size:14px;line-height:20px}.es-text-lg{font-size:16px;line-height:24px}.es-text-xl{font-size:18px;line-height:25px}.es-text-center{text-align:center}.es-text-bold{font-weight:700}.es-text-no-wrap{text-wrap:nowrap}.es-weight-600{font-weight:600}.es-zindex-0{z-index:0}.es-zindex-1{z-index:1}.es-zindex-2{z-index:2}.es-zindex-3{z-index:3}.es-zindex-4{z-index:4}.es-zindex-5{z-index:5}.es-grid{display:grid}.es-grid-center{display:grid;place-content:center}.es-margin-0{margin:0}.widget-table__head-cell[data-v-498c4f00]{padding:18px;text-align:start}.widget-table__head-label[data-v-498c4f00]{font-weight:600;font-size:14px;line-height:19px}.widget-filter-text[data-v-800b3803]{box-shadow:0 2px 2px #00000040;background-color:#fff;padding:20px 10px}.widget-filter-enum[data-v-cf143196]{box-shadow:0 2px 2px #00000040;background-color:#fff;padding:3px 0;max-height:400px;max-width:340px;min-width:180px;overflow:hidden auto}.widget-filter-enum-item[data-v-cf143196]{padding:6px 11px;transition:.1s;cursor:pointer}.widget-filter-enum-item[data-v-cf143196]:hover{background-color:#f1f1f1}[dir=rtl] .icon[data-v-8a72b45f]{transform:scaleX(-1)}.widget-spinner[data-v-0ef9ae88],.widget-spinner[data-v-0ef9ae88]:after{border-radius:50%;width:14px;height:14px}.widget-spinner[data-v-0ef9ae88]{font-size:2px;position:relative;text-indent:-9999em;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid #ffffff;transform:translateZ(0);animation:spinnerAnimation-0ef9ae88 1.1s infinite linear}@keyframes spinnerAnimation-0ef9ae88{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.widget-button[data-v-450dc564]{position:relative}.widget-button-spinner[data-v-450dc564]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.widget-multi-button-wrap[data-v-d43a76ce]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-d43a76ce]{grid-template-columns:1fr var(--button-size);background-color:var(--primary);grid-template-rows:var(--button-size);transition:var(--fast)}.widget-multi-button_active[data-v-d43a76ce]{grid-template-rows:calc(var(--button-size) * var(--04895bf1))}.widget-multi-button-body[data-v-d43a76ce]{min-width:80px}.widget-multi-button-body-label[data-v-d43a76ce]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-d43a76ce]:hover{background-color:#223296}.widget-multi-button-side[data-v-d43a76ce]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-d43a76ce]{transform:rotate(180deg)}.widget-multi-button-side[data-v-d43a76ce]:hover{background-color:#223296}tr[data-v-344a8cc1]{border:1px solid #F3F4FC;height:30px}th[data-v-344a8cc1],td[data-v-344a8cc1]{position:relative;padding:0 11px}th[data-v-344a8cc1]{text-align:left}p[data-v-344a8cc1]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.widget-list-head-cell[data-v-bf495d6a]{padding:0 0 0 10px;display:flex}.widget-list-head-cell[data-v-bf495d6a]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-bf495d6a]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-bf495d6a]{position:absolute;inset-inline-end:22px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-bf495d6a]{transform:rotate(180deg)}.head-cell-resize[data-v-bf495d6a]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-bf495d6a]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-bf495d6a]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-ccffc6bd]{position:sticky;top:-1px;z-index:1}.test-block[data-v-ccffc6bd]{position:absolute;z-index:2;display:none;height:calc(100% + 1px);place-content:center;inset-block-start:-1px;padding-inline:10px;background-color:#e7f2ff;-webkit-user-select:none;user-select:none;white-space:nowrap}.widget-list-head th[data-v-ccffc6bd]{position:sticky;top:0;z-index:2;-webkit-user-select:none;user-select:none}.widget-head-cell[data-v-9db5d417]{display:flex;gap:4px}.widget-head-cell-order[data-v-9db5d417]{display:flex;flex-direction:column;justify-content:center;gap:2px}.widget-head-cell-label[data-v-9db5d417]{cursor:pointer}.widget-fast-table-head-cell-td[data-v-9db5d417]{padding:7px}.widget-head-cell-order-icon[data-v-9db5d417]{transition:.1s;height:18px;width:18px}.widget-head-cell-order-icon_desc[data-v-9db5d417]{transform:rotate(180deg)}.widget-filter-item-container[data-v-5b9128bc]{position:relative}.widget-filter-item-arrow[data-v-5b9128bc]{transform:rotate(180deg)}.widget-filter-item-label_active[data-v-5b9128bc]{font-weight:700}.widget-filter-item[data-v-5b9128bc]{display:grid;grid-template-columns:max-content max-content;align-items:center;cursor:pointer;padding:0 10px;color:#fff}.widget-filter-item-label[data-v-5b9128bc]{-webkit-user-select:none;user-select:none;padding:4px 2px 4px 8px}.widget-filter-item-popup[data-v-5b9128bc]{position:absolute;z-index:2;inset-block-start:100%;inset-inline-end:0}.widget-filter-item-arrow[data-v-5b9128bc]{transition:.2s}.widget-table-panel-filter[data-v-f1534314]{justify-content:end;background-color:var(--color-primary)}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
2
  "use strict";var et=e=>{throw TypeError(e)};var tt=(e,t,n)=>t.has(e)||et("Cannot "+n);var nt=(e,t,n)=>(tt(e,t,"read from private field"),n?n.call(e):t.get(e)),rt=(e,t,n)=>t.has(e)?et("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),xe=(e,t,n,o)=>(tt(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);/*!
3
- * eservices-core v1.3.199
3
+ * eservices-core v1.3.200
4
4
  * (c) 2024 ESERVICES
5
5
  */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),D=require("jenesius-vue-form"),Ve=require("vue-router"),Zt=require("date-and-time"),Ie=require("debug"),re=require("jenesius-vue-modal"),I=class I extends Error{constructor(t,n=null){super(),this.message=t,this.details=n,this.id=I.ID++}static ParentFormNotFound(){return new I("Can't found parent form.")}static UndefinedNameOfCompositeFormController(t){return new I("Composite object name is undefined",t)}static EntityWithoutName(t){return new I("'Entity doesn't have a name",t)}static NotResolvedNameEventEmitter(t){return new I(`'${t}' is not a valid Event emitter name`)}static FormIsNotValidated(t){return new I("Form is not validated",t)}static ListWorkerIsRunningOrEnd(t){return new I("List data request is running or already done",t)}static ObjectIdNotNumber(t){return new I(`${t} (id) is not a number`)}static UndefinedErrorId(t,n){return I.ApiNotAvailable()}static ApiError(t){return new I("Request error",t)}static ApiNotAvailable(){return new I(`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?I.ApiNotAvailable():new I(t||"Authorization Error",n)}static ApiResponseParseFailed(){return I.ApiNotAvailable()}static MissingIdInValuesEntity(t){return new I("Object doesn't have id",t)}static ObjectWithIdNotFound(t,n){return new I(`Can't find object with id: ${t}`,n)}static ObjectWithoutConnectToPresentArray(t,n){return new I("Object is not found.",{object:t,array:n})}static EntityWithoutId(t){return new I("Entity doesn't have id.",t)}static NotFoundedTableIndex(t,n){return new I(`Can't find the element with tableIndex ${t}`,n)}static UndefinedError(t,n=[]){return new I(t,n)}static TableArrayAlreadyIncludeProvidedIndexValue(t,n,o){return new I(`Array already includes the element with value ${t}`,{array:n,table:o})}static MetadataEntityIsNotAvailable(t){return new I(`Metadata for the ${t} is not currently available.`)}static RequestTookToLong(){return new I("The request took too long to complete. Try again later.")}};I.ID=0;let Z=I;const en="Please try again later or submit a feedback if problem doesn't go.";function tn(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return en}})}function Y(e,t={}){return t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw Z.ApiNotAvailable()}).then(n=>tn(n).then(o=>{if(!n.ok)throw o;return o}))}class nn{constructor(){this.public=!1,this.errors=new Proxy([],{set:(t,n,o)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),t[n]=o,!0)}),window._journal=this}get error(){return{add:(...t)=>{this.errors.push(t)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}new nn;function ot(e){return{...e,createdEntities:e.createdEntites}}const ae=class ae{static async getStartConfig(t,n){return Y([ae.url,t,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(t,n){return Y([ae.url,t,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(ot)}static async runStep(t,n,o,i,a){return Y([ae.url,t,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:o,token:i,values:a})}).then(ot)}};ae.url="/close-api/views/process-wizard";let se=ae;var M=(e=>(e.Completed="Completed",e.FinalStep="FinalStep",e.NextStep="NextStep",e.FinalStepWithConfirmation="FinalStepWithConfirmation",e.NextStepWithConfirmation="NextStepWithConfirmation",e.ValidationError="ValidationError",e.Undefined="Undefined",e))(M||{});class rn{static invite(t,n,o){return Y("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:t,personKey:n,relatedRoleCode:o})})}static accept(t,n){return Y("/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 Y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:t,version:n,mark:!1})})}}class on{static getRequiredDocuments(t,n,o){const i=new URLSearchParams({entity:t,primaryKey:n,statusCode:o});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(a=>a.json())}}class ie{static url(){return"close-api/billing"}static getBillingMetadata(t){return fetch(`/${ie.url()}/calculator/${t}`)}static calculate(t,n){return Y(`/${ie.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:t,values:n})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):Z.ApiNotAvailable()})}static parseMetadataField(t){function n(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:t.name,label:t.title,required:t.required,type:n(t)}}static createOnlinePayment(t,n){return Y(`/${ie.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:t,returnURL:n})})}static applyOnlinePayment(t){return Y(`/${ie.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:t})})}}function an(e){return e.statusName===M.Completed}function sn(e){return[M.FinalStepWithConfirmation,M.NextStepWithConfirmation].includes(e.statusName)}function ln(e){return e.statusName===M.ValidationError}function cn(e){return e.statusName===M.Undefined}function un(e,t,n){let o=null,i=[];const a=r.ref(!1),s=r.ref(null),u=r.computed(()=>g(i,s.value)),l=r.ref(null),c=r.reactive([]),f=r.computed(()=>c.map(v=>g(i,v)));function g(v,E){return v.find(C=>C.name===E)||null}async function d(v){var E;if(cn(v)){await n.onDisplayDataSet(v);return}if(!(sn(v)&&!await n.onDisplayDataSet(v))){if(ln(v))return void n.onValidation(v.validationResults);k(v),await r.nextTick();{const C=((E=g(i,s.value))==null?void 0:E.fields)||[];if([M.FinalStep,M.NextStep].includes(v.statusName)&&(!C.length||fn(C,n.presets)))return h(n.presets||{})}an(v)&&n.onCompleted(v)}}async function w(){try{await m(),await b()}catch(v){P("error")(v)}}function m(){return a.value="Loading process information.",se.getStartConfig(t,e).then(v=>(l.value={label:v.processTitle,info:v.processInfo,icon:v.processIcon},i=v.steps.map(E=>{const C=E.frontendEntity.rootObject,x=Object.fromEntries(E.frontendEntity.objectTypes.map(B=>[B.name,B.properties]));return{label:E.title,name:E.stepName,number:E.number,rootObjectName:C,objectTypes:x,fields:x[C],buttonCaption:E.buttonCaption}}))).finally(()=>{a.value=!1})}function k(v){return[M.FinalStepWithConfirmation,M.NextStepWithConfirmation,M.NextStep,M.Completed,M.FinalStep].includes(v.statusName)&&(o=v.token,s.value=v.nextStepName),v}function b(){return a.value="Starting process",se.startProcess(t,e).then(d).catch(P("error")).finally(()=>{a.value=null})}function h(v={}){const E=s.value;return!o||!E?Promise.reject("Not step or token."):(a.value="Waiting for result...",se.runStep(t,e,E,o,v).then(d).then(C=>(c.push(E),C)).catch(P("error")).finally(()=>{a.value=!1}))}return{initialize:w,loading:a,currentStepConfig:u,currentStepName:s,arrayPassedSteps:f,arrayProcessStepName:c,processInfo:l,next:h}}function fn(e,t){for(let n=0;n<e.length;n++){const o=e[n];if(!D.utils.getPropFromObject(t,o.name))return!1}return!0}const dn={class:"widget-table__head-cell"},pn={class:"widget-table__head-label margin_0 text_overflow"},wt=r.defineComponent({__name:"widget-table-head-cell",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("th",dn,[r.createElementVNode("span",pn,r.toDisplayString(t.label),1)]))}}),gn={class:"widget-table__head"},mn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>S.componentTableHeadCell||wt),(t,n)=>(r.openBlock(),r.createElementBlock("tr",gn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.config,o=>r.renderSlot(t.$slots,"default",r.mergeProps({ref_for:!0},o),void 0,!0)),256))]))}}),U=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},hn=U(mn,[["__scopeId","data-v-498c4f00"]]);function Me(e){return Array.isArray(e)?Me(e[0]):typeof e!="string"?null:e}function me(e){return Me(e.name)}function yn(e){const t=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let o;for(;(o=t.exec(e))!==null;)n.push(o[1]);return n}function vn(e,t){return yn(e).forEach(o=>{e=e.replace(new RegExp("\\$\\{"+o+"}","g"),D.utils.getPropFromObject(t,o))}),e}function $e(e){return t=>typeof t=="string"||typeof t=="number"?`${t} ${e}`:""}function je(e,t){const n=me(e);if(typeof e.value=="string")return vn(e.value,t);let o=n?D.utils.getPropFromObject(t,n):null;if(o===void 0&&(o=null),typeof e.value=="function")return e.value(o,t);if(e.value===null)return null;if(e.unitValue&&(o=$e(e.unitValue)(o)),e.unit&&(o=$e(e.unit)(o)),e.type)switch(e.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=qe(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=_t(typeof o=="string"?o:null);break}case"money":{o=St(o);break}}return e.formatter&&(o=fe(e.formatter).exec(o,t)),typeof o=="boolean"&&(o=o?"✓":"—"),o}const wn=1,bn=5e3,En="static-folder",bt="request-error",Et="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:Et};function Ne(e){return[_.CORE_DEBUG_LABEL,e].join(":")}const kn={class:"widget-filter-text flex gap_20"},Tn=r.defineComponent({__name:"widget-filter-text",props:{values:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,o=t,i=r.ref("");function a(){o("update:values",i.value)}return r.watch(()=>n.values,s=>{if(typeof s!="string")return i.value="";i.value=s},{immediate:!0}),(s,u)=>{const l=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",kn,[r.createVNode(r.unref(D.FormField),{type:"text",modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=c=>i.value=c)},null,8,["modelValue"]),r.createVNode(l,{onClick:a,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(ee)("Apply")),1)]),_:1})])}}}),Cn=U(Tn,[["__scopeId","data-v-800b3803"]]),_n={class:"widget-filter-enum"},An=r.defineComponent({__name:"widget-filter-entity",props:{values:{},fieldMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:t}){const n=e,o=r.ref([]),i=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(g=>g!==c)):s("update:values",[...f,c])}async function l(){var g;if(!((g=n.fieldMetadata)!=null&&g.entity)||!i.value)return;const c=i.value.fieldNameForLabel,f=i.value.fieldNameForIdentification;s("readProcess","start"),o.value=await ue(n.fieldMetadata.entity,{fields:[c,f].join(" "),order:[c,"asc"]}).then(d=>(s("readProcess","end"),d.map(w=>({label:w[c],value:w[f]}))))}return r.watch(()=>i.value,l,{immediate:!0}),(c,f)=>(r.openBlock(),r.createElementBlock("div",_n,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,g=>(r.openBlock(),r.createBlock(r.unref(D.FormField),{class:"widget-filter-enum-item",key:g.value,onClick:()=>u(g.value),type:"single-checkbox","model-value":a(g.value),label:g.label},null,8,["onClick","model-value","label"]))),128))]))}}),Sn=U(An,[["__scopeId","data-v-cf143196"]]),S={getEntityLink(e,t){return`/forms/${e}/${t}`},iconHandlerText(){return""},iconTag:"i",tableFilterEntityBind:{String:Cn,Entity:Sn}};function In(e){for(let t in e)S[t]=e[t]}const Nn={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))}},ce=U(Nn,[["__scopeId","data-v-8a72b45f"]]),Rn=Ie(Ne("setup-list-row"));function On(e,t){const n=e.config.map(o=>Ln(o,e,t));return r.h("tr",{class:"widget-table__row widget-table-row"},n)}function Ln(e,t,n){const o=t.values;let i=je(e,o);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function s(f){a.onClick.push(()=>f(o,e,n))}function u(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const l=[],c=[];if(e.hide&&e.hide(o))return[r.h("td")];if(e.type)switch(u(`widget-table-cell_${e.type}`),e.type){case"multi-select":{c.push(r.h(D.FormField,{type:"single-checkbox",modelValue:t.selected})),s(it.bind(null,n,!0));break}case"select":{c.push(r.h(D.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(o);if(f){const g=r.h(Ve.RouterLink,{to:f});c.push(g),u("widget-table-cell_link")}}catch(f){Rn("Can't add router link",f)}if(e.href&&(c.push(r.h("a",{href:e.href(o),target:"_blank"})),u("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&c.push(r.h("p",{class:"widget-list-cell-text"},i)),e.icon&&(typeof e.icon=="string"&&c.push(r.h(ce,{name:e.icon})),typeof e.icon=="function")){const f=e.icon(o);f!==null&&c.push(r.h(ce,{name:f}))}return e.class&&(typeof e.class=="function"?u(e.class(o)):u(e.class)),S.listCellHandler&&S.listCellHandler(e,o,{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 Ue(e,t){return()=>{try{return On(e,t)}catch(n){return console.warn(n),null}}}const xn={props:{values:Object,config:Object,selected:Boolean},setup:Ue},$n=["colspan"],at=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(e,{emit:t}){const n=t,o=r.ref();return r.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(i,a)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[r.createElementVNode("td",{colspan:i.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.component),r.mergeProps(i.$attrs,{values:i.values,new:i.isNew,onClose:a[0]||(a[0]=s=>n("close")),onSave:a[1]||(a[1]=s=>n("save",s))}),null,16,["values","new"]))],8,$n)],512))}}),Bn={class:"widget-table"},st="update:selectedRows",Fn="update:activeRow",kt=r.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1},useMockField:{type:Boolean,default:!1}},emits:["save","order"],setup(e,{emit:t}){const n=e,o=t,i=r.useSlots(),a=r.computed(()=>{var d;return(d=i==null?void 0:i.default)==null?void 0:d.call(i)[0]});function s(d){return n.useMockField?gt(d):d}function u(d,w=!0){if(!n.selectedRows)return;if(!w)return o(st,n.selectedRows.includes(d)?[]:[d]);const m=[...n.selectedRows],k=m.indexOf(d);return k===-1?m.push(d):m.splice(k,1),o(st,m)}function l(d){o(Fn,d)}function c(d){o("save",d),o("update:activeRow",null)}const f=r.computed(()=>n.shortcut?n.config.filter(d=>d.name?!!n.array.find(m=>![null,""].includes(je(d,m))):!0):n.config),g=r.computed(()=>n.useMockField?n.array.filter(gt):n.array);return(d,w)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Bn,[r.createElementVNode("thead",null,[r.createVNode(hn,{config:f.value,onOrder:w[0]||(w[0]=m=>d.$emit("order",m))},{default:r.withCtx(m=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(d.$slots["head-cell"]||wt),r.normalizeProps(r.guardReactiveProps(m)),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g.value,(m,k)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:k},[r.createVNode(xn,{config:f.value,values:m,selected:d.selectedRows.includes(s(m)),onSelect:b=>u(s(m),b),onActivate:b=>l(s(m)),class:r.normalizeClass(d.classCallback?d.classCallback(m):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&d.activeRow===s(m)?(r.openBlock(),r.createBlock(at,{key:0,component:a.value,"row-length":d.config.length,values:m,onClose:w[1]||(w[1]=b=>o("update:activeRow",null)),onSave:c,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),d.activeRow===r.unref(_).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(at,{key:0,component:a.value,"row-length":f.value.length,onClose:w[2]||(w[2]=m=>o("update:activeRow",null)),onSave:c,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),Dn=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))}}),de=U(Dn,[["__scopeId","data-v-0ef9ae88"]]),Pn={class:"widget-button"},Vn=r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("button",Pn,[t.wait?(r.openBlock(),r.createBlock(de,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(t.$slots,"default",{},void 0,!0)]))}}),Mn=U(Vn,[["__scopeId","data-v-450dc564"]]),jn={class:"widget-multi-button-wrap position_relative cursor_pointer"},Un={class:"widget-multi-button-body grid"},Wn=["onClick"],qn={class:"widget-multi-button-side-wrap"},Gn=r.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(e){r.useCssVars(s=>({"04895bf1":o.value}));const t=e,n=r.reactive({active:!1,wait:!1}),o=r.computed(()=>t.array.length+(t.label?1:0));function i(s){if(!(typeof s!="function"||n.wait))return n.wait=!0,Promise.resolve().then(s).finally(()=>{n.wait=!1})}function a(s=!n.active){n.active=s}return(s,u)=>(r.openBlock(),r.createElementBlock("div",jn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[r.createElementVNode("div",Un,[s.label?(r.openBlock(),r.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:u[0]||(u[0]=l=>a())},r.toDisplayString(s.label),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.array,(l,c)=>(r.openBlock(),r.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:c,onClick:f=>{i(l.callback),a(!1)}},r.toDisplayString(l.label),9,Wn))),128))]),r.createElementVNode("div",qn,[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(de),{key:0,class:"widget-multi-button-side-spinner"})):s.array.length>1?(r.openBlock(),r.createBlock(r.unref(ce),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),zn=U(Gn,[["__scopeId","data-v-d43a76ce"]]),Hn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Xn={class:"text_md"},Jn=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",Hn,[r.createVNode(de,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Xn,r.toDisplayString(t.label),1)]))}}),Yn=["alt","src"],Kn=r.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(e){const t=e,n=r.ref();return r.onMounted(()=>{n.value&&(n.value.src=t.src),n.value.onerror=function(){t.default&&(n.value.src=t.default)}}),(o,i)=>(r.openBlock(),r.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:n,src:o.src||o.$props.default},null,8,Yn))}}),Qn={props:{config:Array,values:Object,selected:Boolean},setup:Ue},Zn=U(Qn,[["__scopeId","data-v-344a8cc1"]]),er=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),tr={class:"widget-list-head-cell"},nr=er(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),rr=r.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(e,{emit:t}){const n=e,o=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(i,a)=>(r.openBlock(),r.createElementBlock("th",null,[r.createElementVNode("div",tr,[r.createElementVNode("div",{class:"head-cell-content flex_grow",style:r.normalizeStyle({"min-width":i.minWidth,"max-width":i.maxWidth,width:i.width})},[i.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(D.FormField),{key:0,type:"single-checkbox",onClick:a[0]||(a[0]=r.withModifiers(s=>o("select"),["stop","prevent"]))})):(r.openBlock(),r.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:a[1]||(a[1]=s=>o("order"))},r.toDisplayString(i.title||i.label),1))],4),i.name&&i.order.length&&i.order[0]===i.name?(r.openBlock(),r.createBlock(r.unref(ce),{key:0,class:r.normalizeClass(["head-cell-order",{"head-cell-order_down":i.order.length>1&&i.order[1]==="desc"}])},{default:r.withCtx(()=>[r.createTextVNode("core-arrow-up")]),_:1},8,["class"])):r.createCommentVNode("",!0),nr])]))}}),or=U(rr,[["__scopeId","data-v-bf495d6a"]]),ir=r.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(e,{emit:t}){const n=e,o=t,i=r.ref(),a=r.ref();r.onMounted(()=>{function c(m,k){let b=-1;do b++,k-=m[b];while(k>0&&b<m.length);return b}function f(m,k){let b=0;for(;k>0&&k>m[b]&&b<m.length;)k-=m[b],b++;return console.log(k,b),b>0?b:0}function g(m){try{a.value.style.insetInlineStart=m+"px"}catch(k){console.log(k)}}function d(m){try{a.value.style.width=m+"px",a.value.style.minWidth=m+"px",a.value.style.maxWidth=m+"px"}catch(k){console.log(k)}}function w(m){return m===null?!1:m.classList.contains("head-cell-resize")}i.value.addEventListener("pointerdown",function(k){var O;function b(F){return F.screenX+E-B}const h=i.value,v=[...h.children].filter(F=>F.localName==="th"),E=((O=h.offsetParent)==null?void 0:O.scrollLeft)||0,C=v.map(F=>F.clientWidth),x=w(k.target),B=h.getBoundingClientRect().left,p=b(k),y=c(C,p),T=C.slice(0,y).reduce((F,V)=>F+V,0),A=p-T,N=h.offsetWidth,G=v[y].clientWidth;if(n.config[y].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",k.screenX),console.log("Widths",C),console.log("max width",N),console.log("Start Position",p),console.log("Position From",y),console.log("Start Position",y),console.log("Global offset (Отступ самой таблицы от края экрана)",B),console.log("Del",A),console.groupEnd(),a.value.innerText=v[y].textContent||"",a.value.style.display="grid",a.value.style.width=G+"px",a.value.style.cursor="grabbing",g(T),d(G),document.addEventListener("pointermove",W,{passive:!0}),document.addEventListener("pointerup",K);function K(F){if(console.group("END"),document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",K),x&&(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)),!x){const V=F.screenX+E-B;console.log("ENP Position",V);const ve=f(C,V);if(console.log(y,"->",ve),ve!==y){const pe=n.config[y],Le=n.config;Le.splice(y,1),Le.splice(ve,0,pe),s(Le)}else{const pe=n.config[y].name;u(pe)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function W(F){if(x){const pe=b(F)-p+G;d(pe);return}let V=F.screenX+E-B-A;V<0&&(V=0),V+G>N&&(V=N-G),g(V)}})});function s(c){o("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(n.order.length===0||n.order[0]!==c)return void l([c]);const f=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([c,f==="asc"?"desc":"asc"])}function l(c){o("update:order",c)}return(c,f)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.config,(g,d)=>(r.openBlock(),r.createBlock(or,r.mergeProps({key:g,ref_for:!0},g,{onOrder:w=>u(g.name),onSelect:f[0]||(f[0]=w=>o("select")),order:c.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:a},"test",512)],512))}}),ar=U(ir,[["__scopeId","data-v-ccffc6bd"]]),sr={class:"widget-list"},lr={class:"widget-list-body position_relative"},cr=50,ur=r.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(e,{emit:t}){const n=e,o=t;function i(l,c=!0){if(n.selectedRows)if(!c)s(n.selectedRows.includes(l)?[]:[l]);else{const f=[...n.selectedRows],g=f.indexOf(l);g===-1?f.push(l):f==null||f.splice(g,1),s(f)}}function a(){var l;if(((l=n.selectedRows)==null?void 0:l.length)!==n.array.length)return s([...n.array]);s([])}function s(l){o("update:selectedRows",l)}function u(l){if(!l)return;const c=l.target;c.scrollTop+c.clientHeight+cr>c.scrollHeight&&o("scrollEnd")}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[r.createElementVNode("table",sr,[r.createElementVNode("thead",null,[r.createVNode(ar,{onSelect:c[0]||(c[0]=f=>a()),"onUpdate:order":c[1]||(c[1]=f=>o("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>o("update:config",f)),config:l.config,order:l.order},null,8,["config","order"])]),r.createElementVNode("tbody",lr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(f,g)=>{var d;return r.openBlock(),r.createBlock(Zn,{key:g,class:"widget-list-row",values:f,config:l.config,selected:(d=l.selectedRows)==null?void 0:d.includes(f),onSelect:w=>i(f,w)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function We(){var a;const e=r.computed(()=>Object.keys(n).length===0||Object.values(n).includes(!0)),t=(a=r.getCurrentInstance())==null?void 0:a.uid;if(!t)throw"Undefined instance. Please check it.";const n=r.reactive({});r.provide(_.VISIBLE_ITEM_PROVIDE_NAME,{show(s){n[s]=!0},hide(s){n[s]=!1},remove(s){delete n[s]}});const o=r.inject(_.VISIBLE_ITEM_PROVIDE_NAME,{show(){},hide(){},remove(){}});return{visible:e,controller:{show(){o==null||o.show(t)},hide(){o==null||o.hide(t)},remove(){o==null||o.remove(t)}},visibleItems:n}}const fr=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{}},setup(e){const t=e,n=Oe(),o=Ke(),i=r.computed(()=>{var k,b;const d=l.value,w=c(d),m={type:w,disabled:!((k=u.value)!=null&&k.canSet),label:t.label};return d&&Object.assign(m,{suffix:w==="number"?d.valueUnit:void 0,required:s.includes(w||"")?!1:d.required,label:t.label||d.displayName}),Object.assign(m,((b=S.fieldParamsHandler)==null?void 0:b.call(S,d,u.value,m))||{}),m}),a=["MultiText","MultiWideText"],s=["switch","single-checkbox","single-radio"],u=r.computed(()=>{var d;return(d=o==null?void 0:o.value)==null?void 0:d.fields[t.name]}),l=r.computed(()=>{if(!n.value)return;const d=n.value.fieldsByName[t.name];if(d)return d});function c(d){if(typeof t.type=="string"&&t.type.length!==0)return t.type;if(d){if(d.type==="Reference"||d.type==="Owned")return d.referencedEntity;if(d.dataType==="Boolean")return"single-checkbox";if(d.dataType==="DateTime")return"date";if(d.dataType==="Integer"||d.dataType==="Decimal")return"number";if(d.dataType==="List")return d.aggregatedEntity;if(a.includes(d.presentationType))return"textarea";if(d.presentationType==="PhoneNumber")return"tel"}return"text"}const f=r.computed(()=>{var d;return((d=u.value)==null?void 0:d.canGet)===!0}),{controller:g}=We();return r.watch(()=>f.value,d=>d?g.show():g.hide(),{immediate:!0}),r.onUnmounted(()=>g.remove()),(d,w)=>f.value?(r.openBlock(),r.createBlock(r.unref(D.FormField),r.mergeProps({key:0},{...d.$attrs,...i.value},{name:d.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function dr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||_.DEFAULT_ORDER_DIR}const pr=["fill"],gr=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),mr=[gr],hr=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},mr,8,pr))}}),yr={class:"widget-fast-table-head-cell-td"},vr={class:"widget-head-cell-label"},wr={key:0,class:"widget-head-cell-order"},br=r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{}},setup(e){const t=e,n=r.computed(()=>Me(t.name));return r.computed(()=>dr(t.order)),(o,i)=>{var a;return r.openBlock(),r.createElementBlock("td",yr,[r.createElementVNode("div",{class:"widget-head-cell",onClick:i[0]||(i[0]=s=>o.$emit("order",o.name))},[r.createElementVNode("span",vr,r.toDisplayString(o.label),1),n.value===((a=o.order)==null?void 0:a[0])?(r.openBlock(),r.createElementBlock("div",wr,[r.createVNode(hr,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${o.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)])])}}}),Tt=U(br,[["__scopeId","data-v-9db5d417"]]),Er=["fill"],kr=r.createElementVNode("path",{d:"M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z"},null,-1),Tr=[kr],Cr=r.defineComponent({__name:"widget-icon-keyboard-arrow-down",props:{color:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:t.color},Tr,8,Er))}}),_r={class:"widget-filter-item-popup"},Ar=r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filterItem:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,o=t,i=S.tableFilterEntityBind,a=r.ref(),s=r.computed(()=>{const w=n.filterItem;return w.entity?"Entity":w.type?w.type:null});function u(w){l.value=w==="start"}const l=r.ref(!1),c=r.computed(()=>Array.isArray(n.values)||typeof n.values=="string"?n.values.length>0:!!n.values),f=r.ref(!1);let g=null;function d(w=!f.value){f.value=w,!f.value&&g?(g(),g=null):a.value&&(g=D.utils.clickOutside(a.value,d.bind(null,!1)))}return(w,m)=>{var k;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:"widget-filter-item",onClick:m[0]||(m[0]=()=>d())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":c.value}])},r.toDisplayString(w.filterItem.label||"--"),3),l.value?(r.openBlock(),r.createBlock(de,{key:0})):(r.openBlock(),r.createBlock(Cr,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":f.value})},null,8,["class"]))]),r.withDirectives(r.createElementVNode("div",_r,[s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((k=r.unref(i))==null?void 0:k[s.value]),{key:0,"field-metadata":w.filterItem,values:w.values,"onUpdate:values":m[1]||(m[1]=b=>o("update:values",b)),onReadProcess:u},null,40,["field-metadata","values"])):r.createCommentVNode("",!0)],512),[[r.vShow,f.value]])],512)}}}),Ct=U(Ar,[["__scopeId","data-v-5b9128bc"]]),Sr={class:"widget-table-panel-filter flex"},Ir=r.defineComponent({__name:"widget-table-panel-filters",props:{filtersConfig:{},filters:{},entity:{}},emits:["update:filters"],setup(e,{emit:t}){const n=e,o=t;function i(a,s){o("update:filters",{...n.filters,[a]:s})}return(a,s)=>(r.openBlock(),r.createElementBlock("div",Sr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(u,l)=>{var c;return r.openBlock(),r.createBlock(Ct,{key:l,entity:a.entity,"filter-item":u,values:(c=a.filters)==null?void 0:c[r.unref(me)(u)],"onUpdate:values":f=>i(r.unref(me)(u),f)},null,8,["entity","filter-item","values","onUpdate:values"])}),128))]))}}),Nr=U(Ir,[["__scopeId","data-v-f1534314"]]),Rr={class:"es-grid es-gap-15"},Or={key:0,class:"title-md color-primary margin-0"},Lr={key:0,class:"widget-table-loader es-flex es-gap-10 es-flex-align-center es-padding-10 text-main"},xr=r.createElementVNode("span",null,"Loading...",-1),$r={class:"widget-fast-table-tools es-flex es-gap-15"},Br={class:""},Fr=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{}},setup(e){const t=e,n=Ve.useRouter(),o=r.ref([]),i=r.ref(null),a=r.ref(null),s=r.ref(null),u=D.Form.getParentForm();Oe(t.entity);const{state:l,update:c}=Ke(t.entity,{masterEntities:t.masterEntities||[]}),f=(t.actions||[]).map(p=>xt(p)),g=r.computed(()=>i.value?Jt(t.entity,i.value.config):[]),d=r.computed(()=>{var p;return((p=i.value)==null?void 0:p.displayItem)||Ye.inline}),w=r.computed(()=>{var p;return((p=i.value)==null?void 0:p.newItem)||d.value}),m=Te(async()=>{try{await b.call(),await c()}catch(p){const{message:y}=Ge(p);a.value=y}});u instanceof D.Form&&u.subscribe({read:m.call.bind(null),name:t.entity,type:"table"}),r.onMounted(()=>{k.call(),m.call()});const k=Te(async function(){const y=t.entity;i.value=await Nt(y,t.mark)}),b=Te(async function(){var T,A,N;const y=t.entity;a.value=null,k.promise&&await k.promise,o.value=(await ue(y,{customFilters:((T=i.value)==null?void 0:T.customFilters)||[],fields:At(g.value).join(" "),order:((A=i.value)==null?void 0:A.order)||[],filter:L.and(L(B.value),L(t.binding||{}),L(((N=i.value)==null?void 0:N.prefilters)||{}))})).map(ci)});async function h(p){var T;if(p===null)return s.value=null;const y=p==null?void 0:p.Id;if(!y&&((T=i.value)!=null&&T.linkNew))return n.push(i.value.linkNew);if(d.value==="form")return n.push(Je(t.entity,y));if(d.value==="inline")return s.value=p||_.LIST_ACTIVE_NEW;d.value==="modal"?(await re.promptModal("form",{entity:t.entity,id:y}),await b.call()):s.value=_.LIST_ACTIVE_NEW}const{controller:v}=We();r.watch(()=>l.value,p=>{p&&(p.canRead?v.show():v.hide())},{immediate:!0}),r.onUnmounted(()=>v.remove());const E=[{icon:"reload",label:"Reload",callback(){m.call()}}];let C=[he.on("affected-entity",p=>{p.name===t.entity&&b.call()}),he.on("display-entity",async p=>{p.name===t.entity&&(b.promise&&await b.promise,s.value=o.value.find(y=>y.Id===p.id)||null)})];r.onUnmounted(()=>C.map(p=>p()));function x(p){var K;function y(W){return Array.isArray(W)?y(W[0]):typeof W!="string"?null:W}const T=y(p);if(!T)return;const A=((K=i.value)==null?void 0:K.order)||[];(W=>{if(i.value)return i.value.order=W,!0})(A[0]!==T?[T,"asc"]:A[1]==="desc"?[]:[T,"desc"])&&b.call()}const B=r.ref({});return r.watch(()=>B.value,()=>b.call()),(p,y)=>{var N,G,K,W;const T=r.resolveComponent("widget-button"),A=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",Rr,[(N=i.value)!=null&&N.label?(r.openBlock(),r.createElementBlock("p",Or,r.toDisplayString((G=i.value)==null?void 0:G.label),1)):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"slide-up"},{default:r.withCtx(()=>[r.unref(m).wait||r.unref(k).wait||r.unref(b).wait?(r.openBlock(),r.createElementBlock("div",Lr,[r.createVNode(r.unref(de),{color:"var(--color-primary)"}),xr])):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("div",$r,[w.value==="form"||(K=r.unref(l))!=null&&K.canCreate?(r.openBlock(),r.createBlock(T,{key:0,callback:h,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(" Add New ")]),_:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f).filter(O=>!!O.value),O=>{var F;return r.openBlock(),r.createBlock(T,{callback:(F=O.value)==null?void 0:F.callback,type:"primary"},{default:r.withCtx(()=>{var V;return[r.createTextVNode(r.toDisplayString((V=O.value)==null?void 0:V.label),1)]}),_:2},1032,["callback"])}),256)),(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(E,O=>r.createVNode(T,{onClick:()=>O.callback,callback:O.callback},{default:r.withCtx(()=>[r.createVNode(ce,null,{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.icon),1)]),_:2},1024),r.createElementVNode("span",null,r.toDisplayString(O.label),1)]),_:2},1032,["onClick","callback"])),64))]),r.createElementVNode("div",Br,[r.createVNode(Nr,{entity:p.entity,"filters-config":((W=i.value)==null?void 0:W.filters)||[],filters:B.value,"onUpdate:filters":y[0]||(y[0]=O=>B.value=O)},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(kt),{config:g.value,array:o.value,"active-row":s.value,"onUpdate:activeRow":h,onOrder:x,class:"table"},{"head-cell":r.withCtx(O=>{var F;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.$slots["head-cell"]?p.$slots["head-cell"]:Tt),r.mergeProps({label:O.label},O,{onOrder:x,order:((F=i.value)==null?void 0:F.order)||[]}),null,16,["label","order"]))]}),default:r.withCtx(()=>{var O;return[r.createVNode(A,{entity:p.entity,id:(O=s.value)==null?void 0:O.Id,"master-entities":p.masterEntities||void 0,binding:p.binding,onFormUpdate:y[1]||(y[1]=()=>{s.value=null,r.unref(b).call()})},null,8,["entity","id","master-entities","binding"])]}),_:1},8,["config","array","active-row"])])])}}});function _t(e){return qe(e,"YYYY/MM/DD HH:mm:ss")}function qe(e,t="YYYY/MM/DD"){if(!e)return"";try{const n=new Date(e);return Zt.format(n,t)}catch(n){return console.log(n),"Invalid date"}}function Te(e){function t(...o){if(n.wait)return Promise.reject("The process has already started.");n.wait=!0;const i=Promise.resolve().then(()=>e(...o)).finally(()=>{n.wait=!1,n.promise=null});return n.promise=i,i}const n=r.reactive({wait:!1,call:t,promise:null});return n}function Ge(e){return typeof e=="string"?we(e):Dr(e)?we(e.message,e.children||e.details||[]):Pr(e)?we(e.title,[e.detail||""]):we(_.DEFAULT_ERROR_MESSAGE)}function Dr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Pr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function we(e,t=[]){return{message:e,children:t}}function P(e="error"){return function(t){const{message:n,children:o}=Ge(t);Qe.add(e,n,{children:o})}}function ue(e,t={}){return $().emit("entity:read",{...t,entity:e})}function ze(e,t){return $().emit("entity:update",{...t,entity:e})}function At(e){return e.reduce((t,n)=>(n.name&&(typeof n.name=="string"?t.push(n.name):t.push(...n.name)),t),[])}function St(e,t=2){if(!(typeof e=="string"||typeof e=="number"))return"";let o=String(e).split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.length<2&&(o[1]=""),o[1]=o[1].padEnd(t,"0"),o[1].length>t&&(o[1]=o[1].substring(0,t)),o.join(".")}function Vr(e,t){const n=new Map;return e.forEach(o=>{var a;const i=t(o);n.has(i)||n.set(i,[]),(a=n.get(i))==null||a.push(o)}),n}function Mr(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function jr(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return _.DEFAULT_ERROR_MESSAGE}})}function j(e,t={}){return z.isFront&&(t.headers||(t.headers={}),t.headers["Context-Id"]=z.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=>jr(n).then(o=>{if(!n.ok)throw o;return o}))}function Ur(e,t=1e3){let n=0;return(...o)=>{clearTimeout(n),n=window.setTimeout(()=>e(...o),t)}}function Wr(e,t){let n=!1;return(...o)=>{if(!n)return n=!0,setTimeout(()=>n=!1,t),e(...o)}}const qr=Ie(Ne("pretty-value-field-by-entity"));function Gr(e,t,n){try{const o=Ae.get(e);if(!o)throw new Error("For entity metadata is not loaded");const i=o.fieldsByName[t];if(!i)throw new Error(`For entity ${e} can't found fieldMetadata for field ${t}`);return i.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(o){return qr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',o,e,t,n),n}}const te=Ie(Ne("use-socket"));function $(){return Hr}function zr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const Hr=function(){let e=1,t,n;const o=new Set;let i=0;const a=new Set;function s(){if(t)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{t.close()},bn*2);const h=new Uint8Array(1);h[0]=wn,t.send(h)}setInterval(()=>{Array.from(o).forEach(h=>{b(h)&&(te("Handler for event %s requestId %d was expired",h.event,h.requestId),h.requestId?l({requestId:h.requestId,event:bt,data:{message:Z.RequestTookToLong().message}}):o.delete(h))})},1e3),setInterval(()=>{(!t||t.readyState===3)&&c()},_.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:a,requestId:e,handlers:o,socketInstance:t}}function l(h){const v=[...o.values()];te("Handlers array length is %d. Response event: %s. Request id: %d",o.size,h.event,h.requestId),v.forEach(E=>{const C=h.requestId;(E.requestId&&E.requestId===C||!E.requestId&&E.event===h.event)&&(te("Find appropriated handler: %d, event: %s",e,E.event),E.callback(h.data,h),E.once&&(o.delete(E),te("Handler was removed by *once* params was passed. %o",E)))})}function c(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),t=new WebSocket(n),t.onclose=function(h){te("Connection to server was stopped: %d %s",h.code,h.reason),Array.from(o).forEach(v=>{v.guaranteedAnswer&&v.serializeString&&a.add(v.serializeString)})},t.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(h=>{f(h),a.delete(h)})},t.onerror=function(h){console.warn(h)},t.onmessage=h=>{var v;try{if(zr(h.data)){s();return}const E=JSON.parse(h.data);if(!It(E)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(E);return}(v=E==null?void 0:E.data)!=null&&v.refresh&&location.reload(),l(E)}catch(E){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(E)}}}function f(h){t.send(h)}function g(h,v){k({event:h,callback:v})}function d(h,v){k({event:h,callback:v,once:!0})}function w(){return t&&(t==null?void 0:t.readyState)===1}function m(h,v,E){const C=++e,x=JSON.stringify({requestId:C,event:h,data:v,contextId:z.contextId,url:S.socketURLHandler?S.socketURLHandler():window.location.href});return w()?f(x):(a.add(x),te("Socket is not connected. Message was send to save-queue")),new Promise((B,p)=>{k({event:h,requestId:C,once:!0,guaranteedAnswer:!0,serializeString:x,callback:(y,T)=>{if(te("Promise was resolve with next data:",y),Xr(T))return void p(y);E&&E(y,T),B(y)},timeToLive:_.TIME_TO_LIVE_SOCKET_REQUEST})})}function k(h){const v={timeToLive:0,...h,created:new Date().getTime()};o.add(v)}function b(h){return h.timeToLive===0||typeof h.timeToLive!="number"?!1:new Date().getTime()-h.created>h.timeToLive}return{get socket(){return t},on:g,once:d,emit:m,initialization(h){n=h},getDevInfo:u}}(),Xr=e=>!!It(e)&&e.event===bt,It=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function Nt(e,t){return $().emit("list-setting:read",{entity:e,mark:t})}function Jr(e,t){return $().emit("metadata-field:treat",{entity:e,fieldName:t})}function Rt(e,t){return $().emit("entity:create",{...t,entity:e})}function Ot(e,t){return $().emit("entity:delete",{...t,entity:e})}function Yr(e,t){return $().emit("usage-context:read",{...t,entity:e})}function Lt(e={}){return $().emit("tool:read",e)}function Kr(){return $().emit("metadata-list:read",{})}function xt(e,t={},n={}){const o=r.inject(_.PROVIDE_NAME_ACTIONS,null),i=typeof e=="string"?e:t,a=typeof t=="string"?n:t;return r.computed(()=>{var l;const u=((typeof e=="string"?(l=o==null?void 0:o.actions)==null?void 0:l.value:r.unref(e))||[]).find(c=>c.name===i);return u?{...u,...a}:null})}function Qr(e){return $().emit("history:read",e)}function Zr(e,t){return $().emit("entity:count",{...t,entity:e})}function eo(e){return`/${En}/${e}`}function fe(e){return{exec(t,n){switch(e.name){case"replace-boolean":return fe.replaceBoolean(t,e.values);case"replace-record-operation":return fe.replaceRecordOperation(t)}}}}fe.replaceBoolean=to;fe.replaceRecordOperation=no;function to(e,t){return typeof e!="boolean"?"":e?t[1]:t[0]}function no(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function ro(e={}){return $().emit("tool:execute",e)}const oo=Ie(Ne("wrap-tool-response"));function $t(e,t){return e.handleConfirmation===void 0&&(e.handleConfirmation=so),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=co),e.handleCloseForm===void 0&&(e.handleCloseForm=uo),e.handleValidationResult===void 0&&(e.handleValidationResult=lo),{...t,label:t.title,callback(){var i;const n=typeof e.values=="function"?e.values(t,e):e.values,o=()=>ro({name:t.name,values:n,usageContext:t.usageContext}).then(async a=>{var s,u;if(!io(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&&Qe.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(P("error"));return(i=e.overrides)!=null&&i[t.name]?e.overrides[t.name](t,e):t.requireSave&&e.form&&e.form.changed?e.form.save().then(o):!t.confirmation||!e.handleConfirmation?o():e.handleConfirmation(t,o)}}}function io(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function ao(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 so(e,t){const n=ao(e.confirmation);if(!re.getComponentFromStore(_.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await re.promptModal(_.MODAL_CONFIRM,{message:n}))return t()}function lo(e,t){const n=_.MODAL_VALIDATION_EFFECT;if(!re.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{re.pushModal(n,t)})}function co(e,t,n){var l;function o(c){return c!==null&&typeof c=="object"&&typeof c.read=="function"}function i(c,f){c&&(oo("Affected Entity %s. Find form with name %s.",f,c.name),c.name===f&&o(c)&&c.read(),c instanceof D.Form&&c.dependencies.forEach(g=>i(g,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}i(s,t.name)}function uo(e,t){const{router:n}=t;n&&e.closeHostForm&&n.back()}let ne={};function ee(e,...t){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let n=D.utils.getPropFromObject((this==null?void 0:this.vocabulary)||ne,e);if(typeof n=="string")return lt(n,t);const o=D.utils.getPropFromObject(ne==null?void 0:ne.root,e);return typeof o=="string"?lt(o,t):(typeof n===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function lt(e,t){return t.forEach((n,o)=>{e=e.replaceAll(new RegExp(`\\{${o}}`,"g"),n)}),e}ee.setGlobalVocabulary=function(e){ne=e};ee.getScope=function(e){const t=typeof e=="string"?e:"root";return typeof e!="string"&&console.warn(`SCOPE ${e} for translate is not string.`),ee.bind({vocabulary:D.utils.getPropFromObject(ne,t.toLowerCase())})};ee.setVocabulary=function(e){return typeof e=="string"&&(e=D.utils.getPropFromObject(ne,e)),ee.bind({vocabulary:e})};function fo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Be={exports:{}},R={},Fe={exports:{}},oe={};function Bt(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function po(e,t,n){}function go(e,t,n){}var mo=/javascript\s*\:/img;function ho(e,t){return mo.test(t)?"":t}oe.whiteList=Bt();oe.getDefaultWhiteList=Bt;oe.onAttr=po;oe.onIgnoreAttr=go;oe.safeAttrValue=ho;var yo={indexOf:function(e,t){var n,o;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var o,i;if(Array.prototype.forEach)return e.forEach(t,n);for(o=0,i=e.length;o<i;o++)t.call(n,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},ge=yo;function vo(e,t){e=ge.trimRight(e),e[e.length-1]!==";"&&(e+=";");var n=e.length,o=!1,i=0,a=0,s="";function u(){if(!o){var f=ge.trim(e.slice(i,a)),g=f.indexOf(":");if(g!==-1){var d=ge.trim(f.slice(0,g)),w=ge.trim(f.slice(g+1));if(d){var m=t(i,s.length,d,w,f);m&&(s+=m+"; ")}}}i=a+1}for(;a<n;a++){var l=e[a];if(l==="/"&&e[a+1]==="*"){var c=e.indexOf("*/",a+2);if(c===-1)break;a=c+1,i=a+1,o=!1}else l==="("?o=!0:l===")"?o=!1:l===";"?o||u():l===`
7
- `&&u()}return ge.trim(s)}var wo=vo,be=oe,bo=wo;function ct(e){return e==null}function Eo(e){var t={};for(var n in e)t[n]=e[n];return t}function Ft(e){e=Eo(e||{}),e.whiteList=e.whiteList||be.whiteList,e.onAttr=e.onAttr||be.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||be.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||be.safeAttrValue,this.options=e}Ft.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onAttr,a=n.onIgnoreAttr,s=n.safeAttrValue,u=bo(e,function(l,c,f,g,d){var w=o[f],m=!1;if(w===!0?m=w:typeof w=="function"?m=w(g):w instanceof RegExp&&(m=w.test(g)),m!==!0&&(m=!1),g=s(f,g),!!g){var k={position:c,sourcePosition:l,source:d,isWhite:m};if(m){var b=i(f,g,k);return ct(b)?f+":"+g:b}else{var b=a(f,g,k);if(!ct(b))return b}}});return u};var ko=Ft;(function(e,t){var n=oe,o=ko;function i(s,u){var l=new o(u);return l.process(s)}t=e.exports=i,t.FilterCSS=o;for(var a in n)t[a]=n[a];typeof window<"u"&&(window.filterCSS=e.exports)})(Fe,Fe.exports);var He=Fe.exports,Xe={indexOf:function(e,t){var n,o;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var o,i;if(Array.prototype.forEach)return e.forEach(t,n);for(o=0,i=e.length;o<i;o++)t.call(n,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/,n=t.exec(e);return n?n.index:-1}},To=He.FilterCSS,Co=He.getDefaultWhiteList,_e=Xe;function Dt(){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 Pt=new To;function _o(e,t,n){}function Ao(e,t,n){}function So(e,t,n){}function Io(e,t,n){}function Vt(e){return e.replace(Ro,"&lt;").replace(Oo,"&gt;")}function No(e,t,n,o){if(n=Gt(n),t==="href"||t==="src"){if(n=_e.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(Ee.lastIndex=0,Ee.test(n))return""}else if(t==="style"){if(ut.lastIndex=0,ut.test(n)||(ft.lastIndex=0,ft.test(n)&&(Ee.lastIndex=0,Ee.test(n))))return"";o!==!1&&(o=o||Pt,n=o.process(n))}return n=zt(n),n}var Ro=/</g,Oo=/>/g,Lo=/"/g,xo=/&quot;/g,$o=/&#([a-zA-Z0-9]*);?/gim,Bo=/&colon;?/gim,Fo=/&newline;?/gim,Ee=/((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,ut=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,ft=/u\s*r\s*l\s*\(.*/gi;function Mt(e){return e.replace(Lo,"&quot;")}function jt(e){return e.replace(xo,'"')}function Ut(e){return e.replace($o,function(n,o){return o[0]==="x"||o[0]==="X"?String.fromCharCode(parseInt(o.substr(1),16)):String.fromCharCode(parseInt(o,10))})}function Wt(e){return e.replace(Bo,":").replace(Fo," ")}function qt(e){for(var t="",n=0,o=e.length;n<o;n++)t+=e.charCodeAt(n)<32?" ":e.charAt(n);return _e.trim(t)}function Gt(e){return e=jt(e),e=Ut(e),e=Wt(e),e=qt(e),e}function zt(e){return e=Mt(e),e=Vt(e),e}function Do(){return""}function Po(e,t){typeof t!="function"&&(t=function(){});var n=!Array.isArray(e);function o(s){return n?!0:_e.indexOf(e,s)!==-1}var i=[],a=!1;return{onIgnoreTag:function(s,u,l){if(o(s))if(l.isClosing){var c="[/removed]",f=l.position+c.length;return i.push([a!==!1?a:l.position,f]),a=!1,c}else return a||(a=l.position),"[removed]";else return t(s,u,l)},remove:function(s){var u="",l=0;return _e.forEach(i,function(c){u+=s.slice(l,c[0]),l=c[1]}),u+=s.slice(l),u}}}function Vo(e){for(var t="",n=0;n<e.length;){var o=e.indexOf("<!--",n);if(o===-1){t+=e.slice(n);break}t+=e.slice(n,o);var i=e.indexOf("-->",o);if(i===-1)break;n=i+3}return t}function Mo(e){var t=e.split("");return t=t.filter(function(n){var o=n.charCodeAt(0);return o===127?!1:o<=31?o===10||o===13:!0}),t.join("")}R.whiteList=Dt();R.getDefaultWhiteList=Dt;R.onTag=_o;R.onIgnoreTag=Ao;R.onTagAttr=So;R.onIgnoreTagAttr=Io;R.safeAttrValue=No;R.escapeHtml=Vt;R.escapeQuote=Mt;R.unescapeQuote=jt;R.escapeHtmlEntities=Ut;R.escapeDangerHtml5Entities=Wt;R.clearNonPrintableCharacter=qt;R.friendlyAttrValue=Gt;R.escapeAttrValue=zt;R.onIgnoreTagStripAll=Do;R.StripTagBody=Po;R.stripCommentTag=Vo;R.stripBlankChar=Mo;R.attributeWrapSign='"';R.cssFilter=Pt;R.getDefaultCSSWhiteList=Co;var Re={},Q=Xe;function jo(e){var t=Q.spaceIndex(e),n;return t===-1?n=e.slice(1,-1):n=e.slice(1,t+1),n=Q.trim(n).toLowerCase(),n.slice(0,1)==="/"&&(n=n.slice(1)),n.slice(-1)==="/"&&(n=n.slice(0,-1)),n}function Uo(e){return e.slice(0,2)==="</"}function Wo(e,t,n){var o="",i=0,a=!1,s=!1,u=0,l=e.length,c="",f="";e:for(u=0;u<l;u++){var g=e.charAt(u);if(a===!1){if(g==="<"){a=u;continue}}else if(s===!1){if(g==="<"){o+=n(e.slice(i,u)),a=u,i=u;continue}if(g===">"||u===l-1){o+=n(e.slice(i,a)),f=e.slice(a,u+1),c=jo(f),o+=t(a,o.length,c,f,Uo(f)),i=u+1,a=!1;continue}if(g==='"'||g==="'")for(var d=1,w=e.charAt(u-d);w.trim()===""||w==="=";){if(w==="="){s=g;continue e}w=e.charAt(u-++d)}}else if(g===s){s=!1;continue}}return i<l&&(o+=n(e.substr(i))),o}var qo=/[^a-zA-Z0-9\\_:.-]/gim;function Go(e,t){var n=0,o=0,i=[],a=!1,s=e.length;function u(d,w){if(d=Q.trim(d),d=d.replace(qo,"").toLowerCase(),!(d.length<1)){var m=t(d,w||"");m&&i.push(m)}}for(var l=0;l<s;l++){var c=e.charAt(l),f,g;if(a===!1&&c==="="){a=e.slice(n,l),n=l+1,o=e.charAt(n)==='"'||e.charAt(n)==="'"?n:Ho(e,l+1);continue}if(a!==!1&&l===o){if(g=e.indexOf(c,l+1),g===-1)break;f=Q.trim(e.slice(o+1,g)),u(a,f),a=!1,l=g,n=l+1;continue}if(/\s|\n|\t/.test(c))if(e=e.replace(/\s|\n|\t/g," "),a===!1)if(g=zo(e,l),g===-1){f=Q.trim(e.slice(n,l)),u(f),a=!1,n=l+1;continue}else{l=g-1;continue}else if(g=Xo(e,l-1),g===-1){f=Q.trim(e.slice(n,l)),f=dt(f),u(a,f),a=!1,n=l+1;continue}else continue}return n<e.length&&(a===!1?u(e.slice(n)):u(a,dt(Q.trim(e.slice(n))))),Q.trim(i.join(" "))}function zo(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Ho(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="'"||n==='"'?t:-1}}function Xo(e,t){for(;t>0;t--){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Jo(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function dt(e){return Jo(e)?e.substr(1,e.length-2):e}Re.parseTag=Wo;Re.parseAttr=Go;var Yo=He.FilterCSS,q=R,Ht=Re,Ko=Ht.parseTag,Qo=Ht.parseAttr,Ce=Xe;function ke(e){return e==null}function Zo(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 ei(e){var t={};for(var n in e)t[n]=e[n];return t}function ti(e){var t={};for(var n in e)Array.isArray(e[n])?t[n.toLowerCase()]=e[n].map(function(o){return o.toLowerCase()}):t[n.toLowerCase()]=e[n];return t}function Xt(e){e=ei(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=q.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=ti(e.whiteList||e.allowList):e.whiteList=q.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":q.attributeWrapSign,e.onTag=e.onTag||q.onTag,e.onTagAttr=e.onTagAttr||q.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||q.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||q.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||q.safeAttrValue,e.escapeHtml=e.escapeHtml||q.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Yo(e.css))}Xt.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onTag,a=n.onIgnoreTag,s=n.onTagAttr,u=n.onIgnoreTagAttr,l=n.safeAttrValue,c=n.escapeHtml,f=t.attributeWrapSign,g=t.cssFilter;n.stripBlankChar&&(e=q.stripBlankChar(e)),n.allowCommentTag||(e=q.stripCommentTag(e));var d=!1;n.stripIgnoreTagBody&&(d=q.StripTagBody(n.stripIgnoreTagBody,a),a=d.onIgnoreTag);var w=Ko(e,function(m,k,b,h,v){var E={sourcePosition:m,position:k,isClosing:v,isWhite:Object.prototype.hasOwnProperty.call(o,b)},C=i(b,h,E);if(!ke(C))return C;if(E.isWhite){if(E.isClosing)return"</"+b+">";var x=Zo(h),B=o[b],p=Qo(x.html,function(y,T){var A=Ce.indexOf(B,y)!==-1,N=s(b,y,T,A);return ke(N)?A?(T=l(b,y,T,g),T?y+"="+f+T+f:y):(N=u(b,y,T,A),ke(N)?void 0:N):N});return h="<"+b,p&&(h+=" "+p),x.closing&&(h+=" /"),h+=">",h}else return C=a(b,h,E),ke(C)?c(h):C},c);return d&&(w=d.remove(w)),w};var ni=Xt;(function(e,t){var n=R,o=Re,i=ni;function a(u,l){var c=new i(l);return c.process(u)}t=e.exports=a,t.filterXSS=a,t.FilterXSS=i,function(){for(var u in n)t[u]=n[u];for(var l in o)t[l]=o[l]}(),typeof window<"u"&&(window.filterXSS=e.exports);function s(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}s()&&(self.filterXSS=e.exports)})(Be,Be.exports);var ri=Be.exports;const oi=fo(ri);function ii(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>'),oi(e)}function ai(e,t,n,o){let i=e+t/60+n/3600;return(o=="S"||o=="W")&&(i=i*-1),i}function si(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 Jt(e,t,n){const o=ee.getScope(e.toLowerCase());return t.map(i=>(typeof i.label=="string"&&(i.label=o(i.label)),i.type==="history"&&(i.onClick=a=>re.openModal("modal-history",{id:a.Id,entity:e}),i.icon="history",i.class="widget-list-cell-history"),(i.entity||i.useObjectTypeName)&&Array.isArray(i.name)&&i.name.length>1&&(i.modal===!0?(i.onClick=a=>{re.openModal("form",{entity:pt(i,a),id:a[me(i)]})},i.class="widget-table-cell_link cursor_pointer"):i.link=a=>{if(typeof a!="object"||a==null)return null;const s=i.name[0],u=a[s];return u?Je(pt(i,a),u):null},i.value=(a,s)=>s[i.name[1]]),li(i,i.type,i.presentation),S.listConvertCellConfigHandler&&S.listConvertCellConfigHandler(e,i),i))}function li(e,t,n){switch(t){case"DateTime":{e.type="dateWithTime";break}case"Decimal":{n==="Money"&&(e.type="money");break}}return e}const pt=(e,t)=>e.useObjectTypeName?t[e.name[2]]:e.entity?e.entity:null;function gt(e){return typeof e!="object"||e===null?null:e[_.TABLE_MOCK_FIELD]}function ci(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 ui(){const e=r.ref(null);function t(n){e.value=n}return{activeRow:e,activateRow:t}}function fi(e,t){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(t)}async function Yt(e,t){e()&&(await t(),await Yt(e,t))}function di(e,t,n={}){let o=!1;const i=r.ref(""),a=r.computed(()=>s.filter(p=>c(p,i.value))),s=r.reactive([]);let u=0;const l=r.ref(!1);let c=(n==null?void 0:n.filterSearchFn)||((p,y)=>fi(p,y));function f(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function g(){const p=C();return typeof p.limit!="number"&&(p.limit=100),p.offset=u,(n.request||ue)(e,p).then(T=>(u+=T.length,T))}function d(p,y){var A;return typeof p.Version=="number"?p.Version:(A=s.find(N=>N.Id===y))==null?void 0:A.Version}function w(p,y){const T=s.findIndex(A=>A.Id===p);if(T===-1)throw new Error(`Can't found item with Id ${p}`);s.splice(T,1,y)}function m(p){const y=s.findIndex(T=>T.Id===p);if(y===-1)throw new Error(`Can't found item with Id ${p}`);s.splice(y,1)}async function k(p,y){try{const T=C(),A=d(y,p);delete y.Version,await ze(e,{id:p,values:y,version:A,masterEntities:f()});const N=await ue(e,{fields:T.fields||"",id:p});w(p,N)}catch(T){P()(T)}}async function b(p,y={}){try{const T=C(),A=d(y,p);delete y.Version,await Ot(e,{id:p,version:A,masterEntities:f()}),m(p)}catch(T){P()(T)}}async function h(p){try{await Rt(e,{values:p,masterEntities:f()}),await x()}catch(y){P()(y)}}let v;async function E(){l.value=!0;try{v!=null&&v.signal&&!v.signal.aborted&&v.abort();let p=v=new AbortController,y=0;const A=C().limit||0;if(i.value&&!A){console.warn("Using textSearch assumes the use of limit.");return}await Yt(()=>(A>0?y<A:!0)&&!o&&!p.signal.aborted,async()=>{const N=await g();p.signal.aborted||(s.push(...N),y+=N.filter(G=>c(G,i.value)).length,(N.length<A||A===0)&&(o=!0))})}catch(p){P()(p)}l.value=!1}function C(){return typeof t=="function"?t():t}async function x(){try{u=0,o=!1,s.splice(0,s.length),await E()}catch(p){P()(p)}}function B(){if(v)return v.abort();l.value=!1}return{array:s,updateById:k,next:E,reload:x,wait:l,create:h,deleteById:b,textSearch:i,filteredArray:a,abort:B}}function pi(){function e(){return{organizations:z.organizations,currentContextId:z.contextId,person:z.person,context:z.context,contextType:z.contextType,userId:z.userId}}const t=r.reactive(e());return z.onupdateContext(()=>{Object.assign(t,e())}),t}function gi(e,t,n){return $().emit("communication:create",{entityName:e,entityCatalogId:t,targetCode:n})}function mi(e,t,n){return $().emit("communication:read",{entityName:e,entityCatalogId:t,targetCode:n})}function hi(e,t){return $().emit("communication-message:create",{communicationId:e,text:t})}function yi(e){return $().emit("communication-message:read",{communicationId:e})}function vi(e){const t=D.Form.getParentForm(),n=r.reactive([]);return t&&t.subscribe(e),e.read=()=>yi(e.id).then(o=>(n.splice(0,n.length,...o),o)),{array:n}}function wi(e,t){e.read=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw Z.EntityWithoutName(e);return ue(e.name,o)}).then(Ze).then(i=>(i.hasOwnProperty("Version")&&(e.version=i.Version),e.setValues(i),i)).catch(P())},e.save=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw Z.EntityWithoutName(e);return ze(e.name,{id:o.id,values:e.changes,version:e.version})}).then(i=>{e.version=i.version}).catch(i=>{throw P()(i),i})};function n(){return typeof t=="function"?t():t}}function Oe(e){if(!e)return r.inject(_.PROVIDE_NAME_METADATA);Ae.initEntity(e);const t=r.computed(()=>Ae.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 Yr(e,bi(t||{}))}}}function bi(e){return typeof e=="function"?e():e}function Ei(e){if(!e)return r.inject(_.PROVIDE_NAME_ACTIONS);const t=r.ref(!1),n=r.reactive([]),o=r.computed(()=>n.map(s=>$t(e,s))),i={actions:o,update:a};r.provide(_.PROVIDE_NAME_ACTIONS,i),e.router=Ve.useRouter();function a(){if(t.value)return;t.value=!0,n.splice(0,n.length);const s=e==null?void 0:e.form;return Lt({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(P("error")).finally(()=>t.value=!1)}return{actions:o,update:a,loading:r.readonly(t)}}function ki(e){function t(n){n.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",t)}),r.onUnmounted(()=>{document.removeEventListener("keypress",t)})}function Ti(e,t={}){const n=r.reactive([]),o=l=>{const c=r.unref(e);if(l===void 0){n.length===0?c.forEach(a):c.forEach(s);return}i(l)?s(l):a(l)},i=l=>n.includes(l),a=l=>{t.handleSelect&&!t.handleSelect(l)||i(l)||n.push(l)},s=l=>{const c=n.findIndex(f=>f===l);c!==-1&&n.splice(c,1)},u=r.computed(()=>{const l=r.unref(e);return n.length===l.length&&l.length!==0});return[n,o,u,a,s]}function Ci(e){const t=r.ref(""),n=r.computed(()=>{const o=t.value.toLowerCase();return r.unref(e).filter(i=>t.value.length?Object.values(i).join().toLowerCase().includes(o):!0)});return{search:t,searchArray:n}}const Qe=new class{constructor(){this.store=r.reactive([])}add(t,n,o={}){const i=_i(o),a=new De(t,n,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(t){const n=this.store.findIndex(o=>o.id===t);if(n===-1)return!1;this.store.splice(n,1)}};function _i(e){function t(o){return!!o&&typeof o=="object"}const n={timeout:10,click:()=>null,children:[]};return t(e)?{timeout:e.timeout||n.timeout,click:e.click||n.click,children:e.children||n.children}:n}const Se=class Se{constructor(t,n,o,i,a){this.type=t,this.message=n,this.timeout=o,this.children=i,this.click=a,this.id=Se.cardId++}};Se.cardId=1;let De=Se;/*!
6
+ Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(t,n){return!t&&!n?I.ApiNotAvailable():new I(t||"Authorization Error",n)}static ApiResponseParseFailed(){return I.ApiNotAvailable()}static MissingIdInValuesEntity(t){return new I("Object doesn't have id",t)}static ObjectWithIdNotFound(t,n){return new I(`Can't find object with id: ${t}`,n)}static ObjectWithoutConnectToPresentArray(t,n){return new I("Object is not found.",{object:t,array:n})}static EntityWithoutId(t){return new I("Entity doesn't have id.",t)}static NotFoundedTableIndex(t,n){return new I(`Can't find the element with tableIndex ${t}`,n)}static UndefinedError(t,n=[]){return new I(t,n)}static TableArrayAlreadyIncludeProvidedIndexValue(t,n,o){return new I(`Array already includes the element with value ${t}`,{array:n,table:o})}static MetadataEntityIsNotAvailable(t){return new I(`Metadata for the ${t} is not currently available.`)}static RequestTookToLong(){return new I("The request took too long to complete. Try again later.")}};I.ID=0;let Z=I;const en="Please try again later or submit a feedback if problem doesn't go.";function tn(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return en}})}function Y(e,t={}){return t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw Z.ApiNotAvailable()}).then(n=>tn(n).then(o=>{if(!n.ok)throw o;return o}))}class nn{constructor(){this.public=!1,this.errors=new Proxy([],{set:(t,n,o)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),t[n]=o,!0)}),window._journal=this}get error(){return{add:(...t)=>{this.errors.push(t)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}new nn;function ot(e){return{...e,createdEntities:e.createdEntites}}const ae=class ae{static async getStartConfig(t,n){return Y([ae.url,t,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(t,n){return Y([ae.url,t,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(ot)}static async runStep(t,n,o,i,a){return Y([ae.url,t,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:o,token:i,values:a})}).then(ot)}};ae.url="/close-api/views/process-wizard";let se=ae;var M=(e=>(e.Completed="Completed",e.FinalStep="FinalStep",e.NextStep="NextStep",e.FinalStepWithConfirmation="FinalStepWithConfirmation",e.NextStepWithConfirmation="NextStepWithConfirmation",e.ValidationError="ValidationError",e.Undefined="Undefined",e))(M||{});class rn{static invite(t,n,o){return Y("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:t,personKey:n,relatedRoleCode:o})})}static accept(t,n){return Y("/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 Y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:t,version:n,mark:!1})})}}class on{static getRequiredDocuments(t,n,o){const i=new URLSearchParams({entity:t,primaryKey:n,statusCode:o});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(a=>a.json())}}class ie{static url(){return"close-api/billing"}static getBillingMetadata(t){return fetch(`/${ie.url()}/calculator/${t}`)}static calculate(t,n){return Y(`/${ie.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:t,values:n})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):Z.ApiNotAvailable()})}static parseMetadataField(t){function n(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:t.name,label:t.title,required:t.required,type:n(t)}}static createOnlinePayment(t,n){return Y(`/${ie.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:t,returnURL:n})})}static applyOnlinePayment(t){return Y(`/${ie.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:t})})}}function an(e){return e.statusName===M.Completed}function sn(e){return[M.FinalStepWithConfirmation,M.NextStepWithConfirmation].includes(e.statusName)}function ln(e){return e.statusName===M.ValidationError}function cn(e){return e.statusName===M.Undefined}function un(e,t,n){let o=null,i=[];const a=r.ref(!1),s=r.ref(null),u=r.computed(()=>g(i,s.value)),l=r.ref(null),c=r.reactive([]),f=r.computed(()=>c.map(y=>g(i,y)));function g(y,E){return y.find(C=>C.name===E)||null}async function d(y){var E;if(cn(y)){await n.onDisplayDataSet(y);return}if(!(sn(y)&&!await n.onDisplayDataSet(y))){if(ln(y))return void n.onValidation(y.validationResults);k(y),await r.nextTick();{const C=((E=g(i,s.value))==null?void 0:E.fields)||[];if([M.FinalStep,M.NextStep].includes(y.statusName)&&(!C.length||fn(C,n.presets)))return h(n.presets||{})}an(y)&&n.onCompleted(y)}}async function w(){try{await m(),await b()}catch(y){P("error")(y)}}function m(){return a.value="Loading process information.",se.getStartConfig(t,e).then(y=>(l.value={label:y.processTitle,info:y.processInfo,icon:y.processIcon},i=y.steps.map(E=>{const C=E.frontendEntity.rootObject,x=Object.fromEntries(E.frontendEntity.objectTypes.map(B=>[B.name,B.properties]));return{label:E.title,name:E.stepName,number:E.number,rootObjectName:C,objectTypes:x,fields:x[C],buttonCaption:E.buttonCaption}}))).finally(()=>{a.value=!1})}function k(y){return[M.FinalStepWithConfirmation,M.NextStepWithConfirmation,M.NextStep,M.Completed,M.FinalStep].includes(y.statusName)&&(o=y.token,s.value=y.nextStepName),y}function b(){return a.value="Starting process",se.startProcess(t,e).then(d).catch(P("error")).finally(()=>{a.value=null})}function h(y={}){const E=s.value;return!o||!E?Promise.reject("Not step or token."):(a.value="Waiting for result...",se.runStep(t,e,E,o,y).then(d).then(C=>(c.push(E),C)).catch(P("error")).finally(()=>{a.value=!1}))}return{initialize:w,loading:a,currentStepConfig:u,currentStepName:s,arrayPassedSteps:f,arrayProcessStepName:c,processInfo:l,next:h}}function fn(e,t){for(let n=0;n<e.length;n++){const o=e[n];if(!D.utils.getPropFromObject(t,o.name))return!1}return!0}const dn={class:"widget-table__head-cell"},pn={class:"widget-table__head-label margin_0 text_overflow"},wt=r.defineComponent({__name:"widget-table-head-cell",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("th",dn,[r.createElementVNode("span",pn,r.toDisplayString(t.label),1)]))}}),gn={class:"widget-table__head"},mn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>S.componentTableHeadCell||wt),(t,n)=>(r.openBlock(),r.createElementBlock("tr",gn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.config,o=>r.renderSlot(t.$slots,"default",r.mergeProps({ref_for:!0},o),void 0,!0)),256))]))}}),U=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},hn=U(mn,[["__scopeId","data-v-498c4f00"]]);function Me(e){return Array.isArray(e)?Me(e[0]):typeof e!="string"?null:e}function me(e){return Me(e.name)}function vn(e){const t=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let o;for(;(o=t.exec(e))!==null;)n.push(o[1]);return n}function yn(e,t){return vn(e).forEach(o=>{e=e.replace(new RegExp("\\$\\{"+o+"}","g"),D.utils.getPropFromObject(t,o))}),e}function $e(e){return t=>typeof t=="string"||typeof t=="number"?`${t} ${e}`:""}function je(e,t){const n=me(e);if(typeof e.value=="string")return yn(e.value,t);let o=n?D.utils.getPropFromObject(t,n):null;if(o===void 0&&(o=null),typeof e.value=="function")return e.value(o,t);if(e.value===null)return null;if(e.unitValue&&(o=$e(e.unitValue)(o)),e.unit&&(o=$e(e.unit)(o)),e.type)switch(e.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=qe(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=_t(typeof o=="string"?o:null);break}case"money":{o=St(o);break}}return e.formatter&&(o=fe(e.formatter).exec(o,t)),typeof o=="boolean"&&(o=o?"✓":"—"),o}const wn=1,bn=5e3,En="static-folder",bt="request-error",Et="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:Et};function Ne(e){return[_.CORE_DEBUG_LABEL,e].join(":")}const kn={class:"widget-filter-text flex gap_20"},Tn=r.defineComponent({__name:"widget-filter-text",props:{values:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,o=t,i=r.ref("");function a(){o("update:values",i.value)}return r.watch(()=>n.values,s=>{if(typeof s!="string")return i.value="";i.value=s},{immediate:!0}),(s,u)=>{const l=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",kn,[r.createVNode(r.unref(D.FormField),{type:"text",modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=c=>i.value=c)},null,8,["modelValue"]),r.createVNode(l,{onClick:a,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(ee)("Apply")),1)]),_:1})])}}}),Cn=U(Tn,[["__scopeId","data-v-800b3803"]]),_n={class:"widget-filter-enum"},An=r.defineComponent({__name:"widget-filter-entity",props:{values:{},fieldMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:t}){const n=e,o=r.ref([]),i=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(g=>g!==c)):s("update:values",[...f,c])}async function l(){var g;if(!((g=n.fieldMetadata)!=null&&g.entity)||!i.value)return;const c=i.value.fieldNameForLabel,f=i.value.fieldNameForIdentification;s("readProcess","start"),o.value=await ue(n.fieldMetadata.entity,{fields:[c,f].join(" "),order:[c,"asc"]}).then(d=>(s("readProcess","end"),d.map(w=>({label:w[c],value:w[f]}))))}return r.watch(()=>i.value,l,{immediate:!0}),(c,f)=>(r.openBlock(),r.createElementBlock("div",_n,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,g=>(r.openBlock(),r.createBlock(r.unref(D.FormField),{class:"widget-filter-enum-item",key:g.value,onClick:()=>u(g.value),type:"single-checkbox","model-value":a(g.value),label:g.label},null,8,["onClick","model-value","label"]))),128))]))}}),Sn=U(An,[["__scopeId","data-v-cf143196"]]),S={getEntityLink(e,t){return`/forms/${e}/${t}`},iconHandlerText(){return""},iconTag:"i",tableFilterEntityBind:{String:Cn,Entity:Sn}};function In(e){for(let t in e)S[t]=e[t]}const Nn={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))}},ce=U(Nn,[["__scopeId","data-v-8a72b45f"]]),Rn=Ie(Ne("setup-list-row"));function On(e,t){const n=e.config.map(o=>Ln(o,e,t));return r.h("tr",{class:"widget-table__row widget-table-row"},n)}function Ln(e,t,n){const o=t.values;let i=je(e,o);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function s(f){a.onClick.push(()=>f(o,e,n))}function u(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const l=[],c=[];if(e.hide&&e.hide(o))return[r.h("td")];if(e.type)switch(u(`widget-table-cell_${e.type}`),e.type){case"multi-select":{c.push(r.h(D.FormField,{type:"single-checkbox",modelValue:t.selected})),s(it.bind(null,n,!0));break}case"select":{c.push(r.h(D.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(o);if(f){const g=r.h(Ve.RouterLink,{to:f});c.push(g),u("widget-table-cell_link")}}catch(f){Rn("Can't add router link",f)}if(e.href&&(c.push(r.h("a",{href:e.href(o),target:"_blank"})),u("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&c.push(r.h("p",{class:"widget-list-cell-text"},i)),e.icon&&(typeof e.icon=="string"&&c.push(r.h(ce,{name:e.icon})),typeof e.icon=="function")){const f=e.icon(o);f!==null&&c.push(r.h(ce,{name:f}))}return e.class&&(typeof e.class=="function"?u(e.class(o)):u(e.class)),S.listCellHandler&&S.listCellHandler(e,o,{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 Ue(e,t){return()=>{try{return On(e,t)}catch(n){return console.warn(n),null}}}const xn={props:{values:Object,config:Object,selected:Boolean},setup:Ue},$n=["colspan"],at=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(e,{emit:t}){const n=t,o=r.ref();return r.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(i,a)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[r.createElementVNode("td",{colspan:i.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.component),r.mergeProps(i.$attrs,{values:i.values,new:i.isNew,onClose:a[0]||(a[0]=s=>n("close")),onSave:a[1]||(a[1]=s=>n("save",s))}),null,16,["values","new"]))],8,$n)],512))}}),Bn={class:"widget-table"},st="update:selectedRows",Fn="update:activeRow",kt=r.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1},useMockField:{type:Boolean,default:!1}},emits:["save","order"],setup(e,{emit:t}){const n=e,o=t,i=r.useSlots(),a=r.computed(()=>{var d;return(d=i==null?void 0:i.default)==null?void 0:d.call(i)[0]});function s(d){return n.useMockField?gt(d):d}function u(d,w=!0){if(!n.selectedRows)return;if(!w)return o(st,n.selectedRows.includes(d)?[]:[d]);const m=[...n.selectedRows],k=m.indexOf(d);return k===-1?m.push(d):m.splice(k,1),o(st,m)}function l(d){o(Fn,d)}function c(d){o("save",d),o("update:activeRow",null)}const f=r.computed(()=>n.shortcut?n.config.filter(d=>d.name?!!n.array.find(m=>![null,""].includes(je(d,m))):!0):n.config),g=r.computed(()=>n.useMockField?n.array.filter(gt):n.array);return(d,w)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Bn,[r.createElementVNode("thead",null,[r.createVNode(hn,{config:f.value,onOrder:w[0]||(w[0]=m=>d.$emit("order",m))},{default:r.withCtx(m=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(d.$slots["head-cell"]||wt),r.normalizeProps(r.guardReactiveProps(m)),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g.value,(m,k)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:k},[r.createVNode(xn,{config:f.value,values:m,selected:d.selectedRows.includes(s(m)),onSelect:b=>u(s(m),b),onActivate:b=>l(s(m)),class:r.normalizeClass(d.classCallback?d.classCallback(m):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&d.activeRow===s(m)?(r.openBlock(),r.createBlock(at,{key:0,component:a.value,"row-length":d.config.length,values:m,onClose:w[1]||(w[1]=b=>o("update:activeRow",null)),onSave:c,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),d.activeRow===r.unref(_).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(at,{key:0,component:a.value,"row-length":f.value.length,onClose:w[2]||(w[2]=m=>o("update:activeRow",null)),onSave:c,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),Dn=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))}}),de=U(Dn,[["__scopeId","data-v-0ef9ae88"]]),Pn={class:"widget-button"},Vn=r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("button",Pn,[t.wait?(r.openBlock(),r.createBlock(de,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(t.$slots,"default",{},void 0,!0)]))}}),Mn=U(Vn,[["__scopeId","data-v-450dc564"]]),jn={class:"widget-multi-button-wrap position_relative cursor_pointer"},Un={class:"widget-multi-button-body grid"},Wn=["onClick"],qn={class:"widget-multi-button-side-wrap"},Gn=r.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(e){r.useCssVars(s=>({"04895bf1":o.value}));const t=e,n=r.reactive({active:!1,wait:!1}),o=r.computed(()=>t.array.length+(t.label?1:0));function i(s){if(!(typeof s!="function"||n.wait))return n.wait=!0,Promise.resolve().then(s).finally(()=>{n.wait=!1})}function a(s=!n.active){n.active=s}return(s,u)=>(r.openBlock(),r.createElementBlock("div",jn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[r.createElementVNode("div",Un,[s.label?(r.openBlock(),r.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:u[0]||(u[0]=l=>a())},r.toDisplayString(s.label),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.array,(l,c)=>(r.openBlock(),r.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:c,onClick:f=>{i(l.callback),a(!1)}},r.toDisplayString(l.label),9,Wn))),128))]),r.createElementVNode("div",qn,[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(de),{key:0,class:"widget-multi-button-side-spinner"})):s.array.length>1?(r.openBlock(),r.createBlock(r.unref(ce),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),zn=U(Gn,[["__scopeId","data-v-d43a76ce"]]),Hn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Xn={class:"text_md"},Jn=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",Hn,[r.createVNode(de,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Xn,r.toDisplayString(t.label),1)]))}}),Yn=["alt","src"],Kn=r.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(e){const t=e,n=r.ref();return r.onMounted(()=>{n.value&&(n.value.src=t.src),n.value.onerror=function(){t.default&&(n.value.src=t.default)}}),(o,i)=>(r.openBlock(),r.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:n,src:o.src||o.$props.default},null,8,Yn))}}),Qn={props:{config:Array,values:Object,selected:Boolean},setup:Ue},Zn=U(Qn,[["__scopeId","data-v-344a8cc1"]]),er=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),tr={class:"widget-list-head-cell"},nr=er(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),rr=r.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(e,{emit:t}){const n=e,o=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(i,a)=>(r.openBlock(),r.createElementBlock("th",null,[r.createElementVNode("div",tr,[r.createElementVNode("div",{class:"head-cell-content flex_grow",style:r.normalizeStyle({"min-width":i.minWidth,"max-width":i.maxWidth,width:i.width})},[i.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(D.FormField),{key:0,type:"single-checkbox",onClick:a[0]||(a[0]=r.withModifiers(s=>o("select"),["stop","prevent"]))})):(r.openBlock(),r.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:a[1]||(a[1]=s=>o("order"))},r.toDisplayString(i.title||i.label),1))],4),i.name&&i.order.length&&i.order[0]===i.name?(r.openBlock(),r.createBlock(r.unref(ce),{key:0,class:r.normalizeClass(["head-cell-order",{"head-cell-order_down":i.order.length>1&&i.order[1]==="desc"}])},{default:r.withCtx(()=>[r.createTextVNode("core-arrow-up")]),_:1},8,["class"])):r.createCommentVNode("",!0),nr])]))}}),or=U(rr,[["__scopeId","data-v-bf495d6a"]]),ir=r.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(e,{emit:t}){const n=e,o=t,i=r.ref(),a=r.ref();r.onMounted(()=>{function c(m,k){let b=-1;do b++,k-=m[b];while(k>0&&b<m.length);return b}function f(m,k){let b=0;for(;k>0&&k>m[b]&&b<m.length;)k-=m[b],b++;return console.log(k,b),b>0?b:0}function g(m){try{a.value.style.insetInlineStart=m+"px"}catch(k){console.log(k)}}function d(m){try{a.value.style.width=m+"px",a.value.style.minWidth=m+"px",a.value.style.maxWidth=m+"px"}catch(k){console.log(k)}}function w(m){return m===null?!1:m.classList.contains("head-cell-resize")}i.value.addEventListener("pointerdown",function(k){var O;function b(F){return F.screenX+E-B}const h=i.value,y=[...h.children].filter(F=>F.localName==="th"),E=((O=h.offsetParent)==null?void 0:O.scrollLeft)||0,C=y.map(F=>F.clientWidth),x=w(k.target),B=h.getBoundingClientRect().left,p=b(k),v=c(C,p),T=C.slice(0,v).reduce((F,V)=>F+V,0),A=p-T,N=h.offsetWidth,G=y[v].clientWidth;if(n.config[v].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",k.screenX),console.log("Widths",C),console.log("max width",N),console.log("Start Position",p),console.log("Position From",v),console.log("Start Position",v),console.log("Global offset (Отступ самой таблицы от края экрана)",B),console.log("Del",A),console.groupEnd(),a.value.innerText=y[v].textContent||"",a.value.style.display="grid",a.value.style.width=G+"px",a.value.style.cursor="grabbing",g(T),d(G),document.addEventListener("pointermove",W,{passive:!0}),document.addEventListener("pointerup",K);function K(F){if(console.group("END"),document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",K),x&&(n.config[v].width=a.value.style.width,n.config[v].minWidth=a.value.style.width,n.config[v].maxWidth=a.value.style.width,s(n.config)),!x){const V=F.screenX+E-B;console.log("ENP Position",V);const ye=f(C,V);if(console.log(v,"->",ye),ye!==v){const pe=n.config[v],Le=n.config;Le.splice(v,1),Le.splice(ye,0,pe),s(Le)}else{const pe=n.config[v].name;u(pe)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function W(F){if(x){const pe=b(F)-p+G;d(pe);return}let V=F.screenX+E-B-A;V<0&&(V=0),V+G>N&&(V=N-G),g(V)}})});function s(c){o("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(n.order.length===0||n.order[0]!==c)return void l([c]);const f=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([c,f==="asc"?"desc":"asc"])}function l(c){o("update:order",c)}return(c,f)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.config,(g,d)=>(r.openBlock(),r.createBlock(or,r.mergeProps({key:g,ref_for:!0},g,{onOrder:w=>u(g.name),onSelect:f[0]||(f[0]=w=>o("select")),order:c.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:a},"test",512)],512))}}),ar=U(ir,[["__scopeId","data-v-ccffc6bd"]]),sr={class:"widget-list"},lr={class:"widget-list-body position_relative"},cr=50,ur=r.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(e,{emit:t}){const n=e,o=t;function i(l,c=!0){if(n.selectedRows)if(!c)s(n.selectedRows.includes(l)?[]:[l]);else{const f=[...n.selectedRows],g=f.indexOf(l);g===-1?f.push(l):f==null||f.splice(g,1),s(f)}}function a(){var l;if(((l=n.selectedRows)==null?void 0:l.length)!==n.array.length)return s([...n.array]);s([])}function s(l){o("update:selectedRows",l)}function u(l){if(!l)return;const c=l.target;c.scrollTop+c.clientHeight+cr>c.scrollHeight&&o("scrollEnd")}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[r.createElementVNode("table",sr,[r.createElementVNode("thead",null,[r.createVNode(ar,{onSelect:c[0]||(c[0]=f=>a()),"onUpdate:order":c[1]||(c[1]=f=>o("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>o("update:config",f)),config:l.config,order:l.order},null,8,["config","order"])]),r.createElementVNode("tbody",lr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(f,g)=>{var d;return r.openBlock(),r.createBlock(Zn,{key:g,class:"widget-list-row",values:f,config:l.config,selected:(d=l.selectedRows)==null?void 0:d.includes(f),onSelect:w=>i(f,w)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function We(){var a;const e=r.computed(()=>Object.keys(n).length===0||Object.values(n).includes(!0)),t=(a=r.getCurrentInstance())==null?void 0:a.uid;if(!t)throw"Undefined instance. Please check it.";const n=r.reactive({});r.provide(_.VISIBLE_ITEM_PROVIDE_NAME,{show(s){n[s]=!0},hide(s){n[s]=!1},remove(s){delete n[s]}});const o=r.inject(_.VISIBLE_ITEM_PROVIDE_NAME,{show(){},hide(){},remove(){}});return{visible:e,controller:{show(){o==null||o.show(t)},hide(){o==null||o.hide(t)},remove(){o==null||o.remove(t)}},visibleItems:n}}const fr=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{}},setup(e){const t=e,n=Oe(),o=Ke(),i=r.computed(()=>{var k,b;const d=l.value,w=c(d),m={type:w,disabled:!((k=u.value)!=null&&k.canSet),label:t.label};return d&&Object.assign(m,{suffix:w==="number"?d.valueUnit:void 0,required:s.includes(w||"")?!1:d.required,label:t.label||d.displayName}),Object.assign(m,((b=S.fieldParamsHandler)==null?void 0:b.call(S,d,u.value,m))||{}),m}),a=["MultiText","MultiWideText"],s=["switch","single-checkbox","single-radio"],u=r.computed(()=>{var d;return(d=o==null?void 0:o.value)==null?void 0:d.fields[t.name]}),l=r.computed(()=>{if(!n.value)return;const d=n.value.fieldsByName[t.name];if(d)return d});function c(d){if(typeof t.type=="string"&&t.type.length!==0)return t.type;if(d){if(d.type==="Reference"||d.type==="Owned")return d.referencedEntity;if(d.dataType==="Boolean")return"single-checkbox";if(d.dataType==="DateTime")return"date";if(d.dataType==="Integer"||d.dataType==="Decimal")return"number";if(d.dataType==="List")return d.aggregatedEntity;if(a.includes(d.presentationType))return"textarea";if(d.presentationType==="PhoneNumber")return"tel"}return"text"}const f=r.computed(()=>{var d;return((d=u.value)==null?void 0:d.canGet)===!0}),{controller:g}=We();return r.watch(()=>f.value,d=>d?g.show():g.hide(),{immediate:!0}),r.onUnmounted(()=>g.remove()),(d,w)=>f.value?(r.openBlock(),r.createBlock(r.unref(D.FormField),r.mergeProps({key:0},{...d.$attrs,...i.value},{name:d.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function dr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||_.DEFAULT_ORDER_DIR}const pr=["fill"],gr=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),mr=[gr],hr=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},mr,8,pr))}}),vr={class:"widget-fast-table-head-cell-td"},yr={class:"widget-head-cell-label"},wr={key:0,class:"widget-head-cell-order"},br=r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{}},setup(e){const t=e,n=r.computed(()=>Me(t.name));return r.computed(()=>dr(t.order)),(o,i)=>{var a;return r.openBlock(),r.createElementBlock("td",vr,[r.createElementVNode("div",{class:"widget-head-cell",onClick:i[0]||(i[0]=s=>o.$emit("order",o.name))},[r.createElementVNode("span",yr,r.toDisplayString(o.label),1),n.value===((a=o.order)==null?void 0:a[0])?(r.openBlock(),r.createElementBlock("div",wr,[r.createVNode(hr,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${o.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)])])}}}),Tt=U(br,[["__scopeId","data-v-9db5d417"]]),Er=["fill"],kr=r.createElementVNode("path",{d:"M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z"},null,-1),Tr=[kr],Cr=r.defineComponent({__name:"widget-icon-keyboard-arrow-down",props:{color:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:t.color},Tr,8,Er))}}),_r={class:"widget-filter-item-popup"},Ar=r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filterItem:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,o=t,i=S.tableFilterEntityBind,a=r.ref(),s=r.computed(()=>{const w=n.filterItem;return w.entity?"Entity":w.type?w.type:null});function u(w){l.value=w==="start"}const l=r.ref(!1),c=r.computed(()=>Array.isArray(n.values)||typeof n.values=="string"?n.values.length>0:!!n.values),f=r.ref(!1);let g=null;function d(w=!f.value){f.value=w,!f.value&&g?(g(),g=null):a.value&&(g=D.utils.clickOutside(a.value,d.bind(null,!1)))}return(w,m)=>{var k;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:"widget-filter-item",onClick:m[0]||(m[0]=()=>d())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":c.value}])},r.toDisplayString(w.filterItem.label||"--"),3),l.value?(r.openBlock(),r.createBlock(de,{key:0})):(r.openBlock(),r.createBlock(Cr,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":f.value})},null,8,["class"]))]),r.withDirectives(r.createElementVNode("div",_r,[s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((k=r.unref(i))==null?void 0:k[s.value]),{key:0,"field-metadata":w.filterItem,values:w.values,"onUpdate:values":m[1]||(m[1]=b=>o("update:values",b)),onReadProcess:u},null,40,["field-metadata","values"])):r.createCommentVNode("",!0)],512),[[r.vShow,f.value]])],512)}}}),Ct=U(Ar,[["__scopeId","data-v-5b9128bc"]]),Sr={class:"widget-table-panel-filter flex"},Ir=r.defineComponent({__name:"widget-table-panel-filters",props:{filtersConfig:{},filters:{},entity:{}},emits:["update:filters"],setup(e,{emit:t}){const n=e,o=t;function i(a,s){o("update:filters",{...n.filters,[a]:s})}return(a,s)=>(r.openBlock(),r.createElementBlock("div",Sr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(u,l)=>{var c;return r.openBlock(),r.createBlock(Ct,{key:l,entity:a.entity,"filter-item":u,values:(c=a.filters)==null?void 0:c[r.unref(me)(u)],"onUpdate:values":f=>i(r.unref(me)(u),f)},null,8,["entity","filter-item","values","onUpdate:values"])}),128))]))}}),Nr=U(Ir,[["__scopeId","data-v-f1534314"]]),Rr={class:"es-grid es-gap-15"},Or={key:0,class:"title-md color-primary margin-0"},Lr={key:0,class:"widget-table-loader es-flex es-gap-10 es-flex-align-center es-padding-10 text-main"},xr=r.createElementVNode("span",null,"Loading...",-1),$r={class:"widget-fast-table-tools es-flex es-gap-15"},Br={class:""},Fr=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{}},setup(e){const t=e,n=Ve.useRouter(),o=r.ref([]),i=r.ref(null),a=r.ref(null),s=r.ref(null),u=D.Form.getParentForm();Oe(t.entity);const{state:l,update:c}=Ke(t.entity,{masterEntities:t.masterEntities||[]}),f=(t.actions||[]).map(p=>xt(p)),g=r.computed(()=>i.value?Jt(t.entity,i.value.config):[]),d=r.computed(()=>{var p;return((p=i.value)==null?void 0:p.displayItem)||Ye.inline}),w=r.computed(()=>{var p;return((p=i.value)==null?void 0:p.newItem)||d.value}),m=Te(async()=>{try{await b.call(),await c()}catch(p){const{message:v}=Ge(p);a.value=v}});u instanceof D.Form&&u.subscribe({read:m.call.bind(null),name:t.entity,type:"table"}),r.onMounted(()=>{k.call(),m.call()});const k=Te(async function(){const v=t.entity;i.value=await Nt(v,t.mark)}),b=Te(async function(){var T,A,N;const v=t.entity;a.value=null,k.promise&&await k.promise,console.log(i.value),o.value=(await ue(v,{customFilters:((T=i.value)==null?void 0:T.customFilters)||[],fields:At(g.value).join(" "),order:((A=i.value)==null?void 0:A.order)||[],filter:L.and(L(B.value),L(t.binding||{}),L(((N=i.value)==null?void 0:N.prefilters)||{}))})).map(ci)});async function h(p){var T;if(p===null)return s.value=null;const v=p==null?void 0:p.Id;if(!v&&((T=i.value)!=null&&T.linkNew))return n.push(i.value.linkNew);if(d.value==="form")return n.push(Je(t.entity,v));if(d.value==="inline")return s.value=p||_.LIST_ACTIVE_NEW;d.value==="modal"?(await re.promptModal("form",{entity:t.entity,id:v}),await b.call()):s.value=_.LIST_ACTIVE_NEW}const{controller:y}=We();r.watch(()=>l.value,p=>{p&&(p.canRead?y.show():y.hide())},{immediate:!0}),r.onUnmounted(()=>y.remove());const E=[{icon:"reload",label:"Reload",callback(){m.call()}}];let C=[he.on("affected-entity",p=>{p.name===t.entity&&b.call()}),he.on("display-entity",async p=>{p.name===t.entity&&(b.promise&&await b.promise,s.value=o.value.find(v=>v.Id===p.id)||null)})];r.onUnmounted(()=>C.map(p=>p()));function x(p){var K;function v(W){return Array.isArray(W)?v(W[0]):typeof W!="string"?null:W}const T=v(p);if(!T)return;const A=((K=i.value)==null?void 0:K.order)||[];(W=>{if(i.value)return i.value.order=W,!0})(A[0]!==T?[T,"asc"]:A[1]==="desc"?[]:[T,"desc"])&&b.call()}const B=r.ref({});return r.watch(()=>B.value,()=>b.call()),(p,v)=>{var N,G,K,W;const T=r.resolveComponent("widget-button"),A=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",Rr,[(N=i.value)!=null&&N.label?(r.openBlock(),r.createElementBlock("p",Or,r.toDisplayString((G=i.value)==null?void 0:G.label),1)):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"slide-up"},{default:r.withCtx(()=>[r.unref(m).wait||r.unref(k).wait||r.unref(b).wait?(r.openBlock(),r.createElementBlock("div",Lr,[r.createVNode(r.unref(de),{color:"var(--color-primary)"}),xr])):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("div",$r,[w.value==="form"||(K=r.unref(l))!=null&&K.canCreate?(r.openBlock(),r.createBlock(T,{key:0,callback:h,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(" Add New ")]),_:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f).filter(O=>!!O.value),O=>{var F;return r.openBlock(),r.createBlock(T,{callback:(F=O.value)==null?void 0:F.callback,type:"primary"},{default:r.withCtx(()=>{var V;return[r.createTextVNode(r.toDisplayString((V=O.value)==null?void 0:V.label),1)]}),_:2},1032,["callback"])}),256)),(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(E,O=>r.createVNode(T,{onClick:()=>O.callback,callback:O.callback},{default:r.withCtx(()=>[r.createVNode(ce,null,{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.icon),1)]),_:2},1024),r.createElementVNode("span",null,r.toDisplayString(O.label),1)]),_:2},1032,["onClick","callback"])),64))]),r.createElementVNode("div",Br,[r.createVNode(Nr,{entity:p.entity,"filters-config":((W=i.value)==null?void 0:W.filters)||[],filters:B.value,"onUpdate:filters":v[0]||(v[0]=O=>B.value=O)},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(kt),{config:g.value,array:o.value,"active-row":s.value,"onUpdate:activeRow":h,onOrder:x,class:"table"},{"head-cell":r.withCtx(O=>{var F;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.$slots["head-cell"]?p.$slots["head-cell"]:Tt),r.mergeProps({label:O.label},O,{onOrder:x,order:((F=i.value)==null?void 0:F.order)||[]}),null,16,["label","order"]))]}),default:r.withCtx(()=>{var O;return[r.createVNode(A,{entity:p.entity,id:(O=s.value)==null?void 0:O.Id,"master-entities":p.masterEntities||void 0,binding:p.binding,onFormUpdate:v[1]||(v[1]=()=>{s.value=null,r.unref(b).call()})},null,8,["entity","id","master-entities","binding"])]}),_:1},8,["config","array","active-row"])])])}}});function _t(e){return qe(e,"YYYY/MM/DD HH:mm:ss")}function qe(e,t="YYYY/MM/DD"){if(!e)return"";try{const n=new Date(e);return Zt.format(n,t)}catch(n){return console.log(n),"Invalid date"}}function Te(e){function t(...o){if(n.wait)return Promise.reject("The process has already started.");n.wait=!0;const i=Promise.resolve().then(()=>e(...o)).finally(()=>{n.wait=!1,n.promise=null});return n.promise=i,i}const n=r.reactive({wait:!1,call:t,promise:null});return n}function Ge(e){return typeof e=="string"?we(e):Dr(e)?we(e.message,e.children||e.details||[]):Pr(e)?we(e.title,[e.detail||""]):we(_.DEFAULT_ERROR_MESSAGE)}function Dr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Pr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function we(e,t=[]){return{message:e,children:t}}function P(e="error"){return function(t){const{message:n,children:o}=Ge(t);Qe.add(e,n,{children:o})}}function ue(e,t={}){return $().emit("entity:read",{...t,entity:e})}function ze(e,t){return $().emit("entity:update",{...t,entity:e})}function At(e){return e.reduce((t,n)=>(n.name&&(typeof n.name=="string"?t.push(n.name):t.push(...n.name)),t),[])}function St(e,t=2){if(!(typeof e=="string"||typeof e=="number"))return"";let o=String(e).split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.length<2&&(o[1]=""),o[1]=o[1].padEnd(t,"0"),o[1].length>t&&(o[1]=o[1].substring(0,t)),o.join(".")}function Vr(e,t){const n=new Map;return e.forEach(o=>{var a;const i=t(o);n.has(i)||n.set(i,[]),(a=n.get(i))==null||a.push(o)}),n}function Mr(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function jr(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return _.DEFAULT_ERROR_MESSAGE}})}function j(e,t={}){return z.isFront&&(t.headers||(t.headers={}),t.headers["Context-Id"]=z.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=>jr(n).then(o=>{if(!n.ok)throw o;return o}))}function Ur(e,t=1e3){let n=0;return(...o)=>{clearTimeout(n),n=window.setTimeout(()=>e(...o),t)}}function Wr(e,t){let n=!1;return(...o)=>{if(!n)return n=!0,setTimeout(()=>n=!1,t),e(...o)}}const qr=Ie(Ne("pretty-value-field-by-entity"));function Gr(e,t,n){try{const o=Ae.get(e);if(!o)throw new Error("For entity metadata is not loaded");const i=o.fieldsByName[t];if(!i)throw new Error(`For entity ${e} can't found fieldMetadata for field ${t}`);return i.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(o){return qr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',o,e,t,n),n}}const te=Ie(Ne("use-socket"));function $(){return Hr}function zr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const Hr=function(){let e=1,t,n;const o=new Set;let i=0;const a=new Set;function s(){if(t)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{t.close()},bn*2);const h=new Uint8Array(1);h[0]=wn,t.send(h)}setInterval(()=>{Array.from(o).forEach(h=>{b(h)&&(te("Handler for event %s requestId %d was expired",h.event,h.requestId),h.requestId?l({requestId:h.requestId,event:bt,data:{message:Z.RequestTookToLong().message}}):o.delete(h))})},1e3),setInterval(()=>{(!t||t.readyState===3)&&c()},_.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:a,requestId:e,handlers:o,socketInstance:t}}function l(h){const y=[...o.values()];te("Handlers array length is %d. Response event: %s. Request id: %d",o.size,h.event,h.requestId),y.forEach(E=>{const C=h.requestId;(E.requestId&&E.requestId===C||!E.requestId&&E.event===h.event)&&(te("Find appropriated handler: %d, event: %s",e,E.event),E.callback(h.data,h),E.once&&(o.delete(E),te("Handler was removed by *once* params was passed. %o",E)))})}function c(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),t=new WebSocket(n),t.onclose=function(h){te("Connection to server was stopped: %d %s",h.code,h.reason),Array.from(o).forEach(y=>{y.guaranteedAnswer&&y.serializeString&&a.add(y.serializeString)})},t.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(h=>{f(h),a.delete(h)})},t.onerror=function(h){console.warn(h)},t.onmessage=h=>{var y;try{if(zr(h.data)){s();return}const E=JSON.parse(h.data);if(!It(E)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(E);return}(y=E==null?void 0:E.data)!=null&&y.refresh&&location.reload(),l(E)}catch(E){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(E)}}}function f(h){t.send(h)}function g(h,y){k({event:h,callback:y})}function d(h,y){k({event:h,callback:y,once:!0})}function w(){return t&&(t==null?void 0:t.readyState)===1}function m(h,y,E){const C=++e,x=JSON.stringify({requestId:C,event:h,data:y,contextId:z.contextId,url:S.socketURLHandler?S.socketURLHandler():window.location.href});return w()?f(x):(a.add(x),te("Socket is not connected. Message was send to save-queue")),new Promise((B,p)=>{k({event:h,requestId:C,once:!0,guaranteedAnswer:!0,serializeString:x,callback:(v,T)=>{if(te("Promise was resolve with next data:",v),Xr(T))return void p(v);E&&E(v,T),B(v)},timeToLive:_.TIME_TO_LIVE_SOCKET_REQUEST})})}function k(h){const y={timeToLive:0,...h,created:new Date().getTime()};o.add(y)}function b(h){return h.timeToLive===0||typeof h.timeToLive!="number"?!1:new Date().getTime()-h.created>h.timeToLive}return{get socket(){return t},on:g,once:d,emit:m,initialization(h){n=h},getDevInfo:u}}(),Xr=e=>!!It(e)&&e.event===bt,It=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function Nt(e,t){return $().emit("list-setting:read",{entity:e,mark:t})}function Jr(e,t){return $().emit("metadata-field:treat",{entity:e,fieldName:t})}function Rt(e,t){return $().emit("entity:create",{...t,entity:e})}function Ot(e,t){return $().emit("entity:delete",{...t,entity:e})}function Yr(e,t){return $().emit("usage-context:read",{...t,entity:e})}function Lt(e={}){return $().emit("tool:read",e)}function Kr(){return $().emit("metadata-list:read",{})}function xt(e,t={},n={}){const o=r.inject(_.PROVIDE_NAME_ACTIONS,null),i=typeof e=="string"?e:t,a=typeof t=="string"?n:t;return r.computed(()=>{var l;const u=((typeof e=="string"?(l=o==null?void 0:o.actions)==null?void 0:l.value:r.unref(e))||[]).find(c=>c.name===i);return u?{...u,...a}:null})}function Qr(e){return $().emit("history:read",e)}function Zr(e,t){return $().emit("entity:count",{...t,entity:e})}function eo(e){return`/${En}/${e}`}function fe(e){return{exec(t,n){switch(e.name){case"replace-boolean":return fe.replaceBoolean(t,e.values);case"replace-record-operation":return fe.replaceRecordOperation(t)}}}}fe.replaceBoolean=to;fe.replaceRecordOperation=no;function to(e,t){return typeof e!="boolean"?"":e?t[1]:t[0]}function no(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function ro(e={}){return $().emit("tool:execute",e)}const oo=Ie(Ne("wrap-tool-response"));function $t(e,t){return e.handleConfirmation===void 0&&(e.handleConfirmation=so),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=co),e.handleCloseForm===void 0&&(e.handleCloseForm=uo),e.handleValidationResult===void 0&&(e.handleValidationResult=lo),{...t,label:t.title,callback(){var i;const n=typeof e.values=="function"?e.values(t,e):e.values,o=()=>ro({name:t.name,values:n,usageContext:t.usageContext}).then(async a=>{var s,u;if(!io(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&&Qe.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(P("error"));return(i=e.overrides)!=null&&i[t.name]?e.overrides[t.name](t,e):t.requireSave&&e.form&&e.form.changed?e.form.save().then(o):!t.confirmation||!e.handleConfirmation?o():e.handleConfirmation(t,o)}}}function io(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function ao(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 so(e,t){const n=ao(e.confirmation);if(!re.getComponentFromStore(_.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await re.promptModal(_.MODAL_CONFIRM,{message:n}))return t()}function lo(e,t){const n=_.MODAL_VALIDATION_EFFECT;if(!re.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{re.pushModal(n,t)})}function co(e,t,n){var l;function o(c){return c!==null&&typeof c=="object"&&typeof c.read=="function"}function i(c,f){c&&(oo("Affected Entity %s. Find form with name %s.",f,c.name),c.name===f&&o(c)&&c.read(),c instanceof D.Form&&c.dependencies.forEach(g=>i(g,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}i(s,t.name)}function uo(e,t){const{router:n}=t;n&&e.closeHostForm&&n.back()}let ne={};function ee(e,...t){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let n=D.utils.getPropFromObject((this==null?void 0:this.vocabulary)||ne,e);if(typeof n=="string")return lt(n,t);const o=D.utils.getPropFromObject(ne==null?void 0:ne.root,e);return typeof o=="string"?lt(o,t):(typeof n===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function lt(e,t){return t.forEach((n,o)=>{e=e.replaceAll(new RegExp(`\\{${o}}`,"g"),n)}),e}ee.setGlobalVocabulary=function(e){ne=e};ee.getScope=function(e){const t=typeof e=="string"?e:"root";return typeof e!="string"&&console.warn(`SCOPE ${e} for translate is not string.`),ee.bind({vocabulary:D.utils.getPropFromObject(ne,t.toLowerCase())})};ee.setVocabulary=function(e){return typeof e=="string"&&(e=D.utils.getPropFromObject(ne,e)),ee.bind({vocabulary:e})};function fo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Be={exports:{}},R={},Fe={exports:{}},oe={};function Bt(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function po(e,t,n){}function go(e,t,n){}var mo=/javascript\s*\:/img;function ho(e,t){return mo.test(t)?"":t}oe.whiteList=Bt();oe.getDefaultWhiteList=Bt;oe.onAttr=po;oe.onIgnoreAttr=go;oe.safeAttrValue=ho;var vo={indexOf:function(e,t){var n,o;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var o,i;if(Array.prototype.forEach)return e.forEach(t,n);for(o=0,i=e.length;o<i;o++)t.call(n,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},ge=vo;function yo(e,t){e=ge.trimRight(e),e[e.length-1]!==";"&&(e+=";");var n=e.length,o=!1,i=0,a=0,s="";function u(){if(!o){var f=ge.trim(e.slice(i,a)),g=f.indexOf(":");if(g!==-1){var d=ge.trim(f.slice(0,g)),w=ge.trim(f.slice(g+1));if(d){var m=t(i,s.length,d,w,f);m&&(s+=m+"; ")}}}i=a+1}for(;a<n;a++){var l=e[a];if(l==="/"&&e[a+1]==="*"){var c=e.indexOf("*/",a+2);if(c===-1)break;a=c+1,i=a+1,o=!1}else l==="("?o=!0:l===")"?o=!1:l===";"?o||u():l===`
7
+ `&&u()}return ge.trim(s)}var wo=yo,be=oe,bo=wo;function ct(e){return e==null}function Eo(e){var t={};for(var n in e)t[n]=e[n];return t}function Ft(e){e=Eo(e||{}),e.whiteList=e.whiteList||be.whiteList,e.onAttr=e.onAttr||be.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||be.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||be.safeAttrValue,this.options=e}Ft.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onAttr,a=n.onIgnoreAttr,s=n.safeAttrValue,u=bo(e,function(l,c,f,g,d){var w=o[f],m=!1;if(w===!0?m=w:typeof w=="function"?m=w(g):w instanceof RegExp&&(m=w.test(g)),m!==!0&&(m=!1),g=s(f,g),!!g){var k={position:c,sourcePosition:l,source:d,isWhite:m};if(m){var b=i(f,g,k);return ct(b)?f+":"+g:b}else{var b=a(f,g,k);if(!ct(b))return b}}});return u};var ko=Ft;(function(e,t){var n=oe,o=ko;function i(s,u){var l=new o(u);return l.process(s)}t=e.exports=i,t.FilterCSS=o;for(var a in n)t[a]=n[a];typeof window<"u"&&(window.filterCSS=e.exports)})(Fe,Fe.exports);var He=Fe.exports,Xe={indexOf:function(e,t){var n,o;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var o,i;if(Array.prototype.forEach)return e.forEach(t,n);for(o=0,i=e.length;o<i;o++)t.call(n,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/,n=t.exec(e);return n?n.index:-1}},To=He.FilterCSS,Co=He.getDefaultWhiteList,_e=Xe;function Dt(){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 Pt=new To;function _o(e,t,n){}function Ao(e,t,n){}function So(e,t,n){}function Io(e,t,n){}function Vt(e){return e.replace(Ro,"&lt;").replace(Oo,"&gt;")}function No(e,t,n,o){if(n=Gt(n),t==="href"||t==="src"){if(n=_e.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(Ee.lastIndex=0,Ee.test(n))return""}else if(t==="style"){if(ut.lastIndex=0,ut.test(n)||(ft.lastIndex=0,ft.test(n)&&(Ee.lastIndex=0,Ee.test(n))))return"";o!==!1&&(o=o||Pt,n=o.process(n))}return n=zt(n),n}var Ro=/</g,Oo=/>/g,Lo=/"/g,xo=/&quot;/g,$o=/&#([a-zA-Z0-9]*);?/gim,Bo=/&colon;?/gim,Fo=/&newline;?/gim,Ee=/((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,ut=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,ft=/u\s*r\s*l\s*\(.*/gi;function Mt(e){return e.replace(Lo,"&quot;")}function jt(e){return e.replace(xo,'"')}function Ut(e){return e.replace($o,function(n,o){return o[0]==="x"||o[0]==="X"?String.fromCharCode(parseInt(o.substr(1),16)):String.fromCharCode(parseInt(o,10))})}function Wt(e){return e.replace(Bo,":").replace(Fo," ")}function qt(e){for(var t="",n=0,o=e.length;n<o;n++)t+=e.charCodeAt(n)<32?" ":e.charAt(n);return _e.trim(t)}function Gt(e){return e=jt(e),e=Ut(e),e=Wt(e),e=qt(e),e}function zt(e){return e=Mt(e),e=Vt(e),e}function Do(){return""}function Po(e,t){typeof t!="function"&&(t=function(){});var n=!Array.isArray(e);function o(s){return n?!0:_e.indexOf(e,s)!==-1}var i=[],a=!1;return{onIgnoreTag:function(s,u,l){if(o(s))if(l.isClosing){var c="[/removed]",f=l.position+c.length;return i.push([a!==!1?a:l.position,f]),a=!1,c}else return a||(a=l.position),"[removed]";else return t(s,u,l)},remove:function(s){var u="",l=0;return _e.forEach(i,function(c){u+=s.slice(l,c[0]),l=c[1]}),u+=s.slice(l),u}}}function Vo(e){for(var t="",n=0;n<e.length;){var o=e.indexOf("<!--",n);if(o===-1){t+=e.slice(n);break}t+=e.slice(n,o);var i=e.indexOf("-->",o);if(i===-1)break;n=i+3}return t}function Mo(e){var t=e.split("");return t=t.filter(function(n){var o=n.charCodeAt(0);return o===127?!1:o<=31?o===10||o===13:!0}),t.join("")}R.whiteList=Dt();R.getDefaultWhiteList=Dt;R.onTag=_o;R.onIgnoreTag=Ao;R.onTagAttr=So;R.onIgnoreTagAttr=Io;R.safeAttrValue=No;R.escapeHtml=Vt;R.escapeQuote=Mt;R.unescapeQuote=jt;R.escapeHtmlEntities=Ut;R.escapeDangerHtml5Entities=Wt;R.clearNonPrintableCharacter=qt;R.friendlyAttrValue=Gt;R.escapeAttrValue=zt;R.onIgnoreTagStripAll=Do;R.StripTagBody=Po;R.stripCommentTag=Vo;R.stripBlankChar=Mo;R.attributeWrapSign='"';R.cssFilter=Pt;R.getDefaultCSSWhiteList=Co;var Re={},Q=Xe;function jo(e){var t=Q.spaceIndex(e),n;return t===-1?n=e.slice(1,-1):n=e.slice(1,t+1),n=Q.trim(n).toLowerCase(),n.slice(0,1)==="/"&&(n=n.slice(1)),n.slice(-1)==="/"&&(n=n.slice(0,-1)),n}function Uo(e){return e.slice(0,2)==="</"}function Wo(e,t,n){var o="",i=0,a=!1,s=!1,u=0,l=e.length,c="",f="";e:for(u=0;u<l;u++){var g=e.charAt(u);if(a===!1){if(g==="<"){a=u;continue}}else if(s===!1){if(g==="<"){o+=n(e.slice(i,u)),a=u,i=u;continue}if(g===">"||u===l-1){o+=n(e.slice(i,a)),f=e.slice(a,u+1),c=jo(f),o+=t(a,o.length,c,f,Uo(f)),i=u+1,a=!1;continue}if(g==='"'||g==="'")for(var d=1,w=e.charAt(u-d);w.trim()===""||w==="=";){if(w==="="){s=g;continue e}w=e.charAt(u-++d)}}else if(g===s){s=!1;continue}}return i<l&&(o+=n(e.substr(i))),o}var qo=/[^a-zA-Z0-9\\_:.-]/gim;function Go(e,t){var n=0,o=0,i=[],a=!1,s=e.length;function u(d,w){if(d=Q.trim(d),d=d.replace(qo,"").toLowerCase(),!(d.length<1)){var m=t(d,w||"");m&&i.push(m)}}for(var l=0;l<s;l++){var c=e.charAt(l),f,g;if(a===!1&&c==="="){a=e.slice(n,l),n=l+1,o=e.charAt(n)==='"'||e.charAt(n)==="'"?n:Ho(e,l+1);continue}if(a!==!1&&l===o){if(g=e.indexOf(c,l+1),g===-1)break;f=Q.trim(e.slice(o+1,g)),u(a,f),a=!1,l=g,n=l+1;continue}if(/\s|\n|\t/.test(c))if(e=e.replace(/\s|\n|\t/g," "),a===!1)if(g=zo(e,l),g===-1){f=Q.trim(e.slice(n,l)),u(f),a=!1,n=l+1;continue}else{l=g-1;continue}else if(g=Xo(e,l-1),g===-1){f=Q.trim(e.slice(n,l)),f=dt(f),u(a,f),a=!1,n=l+1;continue}else continue}return n<e.length&&(a===!1?u(e.slice(n)):u(a,dt(Q.trim(e.slice(n))))),Q.trim(i.join(" "))}function zo(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Ho(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="'"||n==='"'?t:-1}}function Xo(e,t){for(;t>0;t--){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Jo(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function dt(e){return Jo(e)?e.substr(1,e.length-2):e}Re.parseTag=Wo;Re.parseAttr=Go;var Yo=He.FilterCSS,q=R,Ht=Re,Ko=Ht.parseTag,Qo=Ht.parseAttr,Ce=Xe;function ke(e){return e==null}function Zo(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 ei(e){var t={};for(var n in e)t[n]=e[n];return t}function ti(e){var t={};for(var n in e)Array.isArray(e[n])?t[n.toLowerCase()]=e[n].map(function(o){return o.toLowerCase()}):t[n.toLowerCase()]=e[n];return t}function Xt(e){e=ei(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=q.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=ti(e.whiteList||e.allowList):e.whiteList=q.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":q.attributeWrapSign,e.onTag=e.onTag||q.onTag,e.onTagAttr=e.onTagAttr||q.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||q.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||q.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||q.safeAttrValue,e.escapeHtml=e.escapeHtml||q.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Yo(e.css))}Xt.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onTag,a=n.onIgnoreTag,s=n.onTagAttr,u=n.onIgnoreTagAttr,l=n.safeAttrValue,c=n.escapeHtml,f=t.attributeWrapSign,g=t.cssFilter;n.stripBlankChar&&(e=q.stripBlankChar(e)),n.allowCommentTag||(e=q.stripCommentTag(e));var d=!1;n.stripIgnoreTagBody&&(d=q.StripTagBody(n.stripIgnoreTagBody,a),a=d.onIgnoreTag);var w=Ko(e,function(m,k,b,h,y){var E={sourcePosition:m,position:k,isClosing:y,isWhite:Object.prototype.hasOwnProperty.call(o,b)},C=i(b,h,E);if(!ke(C))return C;if(E.isWhite){if(E.isClosing)return"</"+b+">";var x=Zo(h),B=o[b],p=Qo(x.html,function(v,T){var A=Ce.indexOf(B,v)!==-1,N=s(b,v,T,A);return ke(N)?A?(T=l(b,v,T,g),T?v+"="+f+T+f:v):(N=u(b,v,T,A),ke(N)?void 0:N):N});return h="<"+b,p&&(h+=" "+p),x.closing&&(h+=" /"),h+=">",h}else return C=a(b,h,E),ke(C)?c(h):C},c);return d&&(w=d.remove(w)),w};var ni=Xt;(function(e,t){var n=R,o=Re,i=ni;function a(u,l){var c=new i(l);return c.process(u)}t=e.exports=a,t.filterXSS=a,t.FilterXSS=i,function(){for(var u in n)t[u]=n[u];for(var l in o)t[l]=o[l]}(),typeof window<"u"&&(window.filterXSS=e.exports);function s(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}s()&&(self.filterXSS=e.exports)})(Be,Be.exports);var ri=Be.exports;const oi=fo(ri);function ii(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>'),oi(e)}function ai(e,t,n,o){let i=e+t/60+n/3600;return(o=="S"||o=="W")&&(i=i*-1),i}function si(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 Jt(e,t,n){const o=ee.getScope(e.toLowerCase());return t.map(i=>(typeof i.label=="string"&&(i.label=o(i.label)),i.type==="history"&&(i.onClick=a=>re.openModal("modal-history",{id:a.Id,entity:e}),i.icon="history",i.class="widget-list-cell-history"),(i.entity||i.useObjectTypeName)&&Array.isArray(i.name)&&i.name.length>1&&(i.modal===!0?(i.onClick=a=>{re.openModal("form",{entity:pt(i,a),id:a[me(i)]})},i.class="widget-table-cell_link cursor_pointer"):i.link=a=>{if(typeof a!="object"||a==null)return null;const s=i.name[0],u=a[s];return u?Je(pt(i,a),u):null},i.value=(a,s)=>s[i.name[1]]),li(i,i.type,i.presentation),S.listConvertCellConfigHandler&&S.listConvertCellConfigHandler(e,i),i))}function li(e,t,n){switch(t){case"DateTime":{e.type="dateWithTime";break}case"Decimal":{n==="Money"&&(e.type="money");break}}return e}const pt=(e,t)=>e.useObjectTypeName?t[e.name[2]]:e.entity?e.entity:null;function gt(e){return typeof e!="object"||e===null?null:e[_.TABLE_MOCK_FIELD]}function ci(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 ui(){const e=r.ref(null);function t(n){e.value=n}return{activeRow:e,activateRow:t}}function fi(e,t){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(t)}async function Yt(e,t){e()&&(await t(),await Yt(e,t))}function di(e,t,n={}){let o=!1;const i=r.ref(""),a=r.computed(()=>s.filter(p=>c(p,i.value))),s=r.reactive([]);let u=0;const l=r.ref(!1);let c=(n==null?void 0:n.filterSearchFn)||((p,v)=>fi(p,v));function f(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function g(){const p=C();return typeof p.limit!="number"&&(p.limit=100),p.offset=u,(n.request||ue)(e,p).then(T=>(u+=T.length,T))}function d(p,v){var A;return typeof p.Version=="number"?p.Version:(A=s.find(N=>N.Id===v))==null?void 0:A.Version}function w(p,v){const T=s.findIndex(A=>A.Id===p);if(T===-1)throw new Error(`Can't found item with Id ${p}`);s.splice(T,1,v)}function m(p){const v=s.findIndex(T=>T.Id===p);if(v===-1)throw new Error(`Can't found item with Id ${p}`);s.splice(v,1)}async function k(p,v){try{const T=C(),A=d(v,p);delete v.Version,await ze(e,{id:p,values:v,version:A,masterEntities:f()});const N=await ue(e,{fields:T.fields||"",id:p});w(p,N)}catch(T){P()(T)}}async function b(p,v={}){try{const T=C(),A=d(v,p);delete v.Version,await Ot(e,{id:p,version:A,masterEntities:f()}),m(p)}catch(T){P()(T)}}async function h(p){try{await Rt(e,{values:p,masterEntities:f()}),await x()}catch(v){P()(v)}}let y;async function E(){l.value=!0;try{y!=null&&y.signal&&!y.signal.aborted&&y.abort();let p=y=new AbortController,v=0;const A=C().limit||0;if(i.value&&!A){console.warn("Using textSearch assumes the use of limit.");return}await Yt(()=>(A>0?v<A:!0)&&!o&&!p.signal.aborted,async()=>{const N=await g();p.signal.aborted||(s.push(...N),v+=N.filter(G=>c(G,i.value)).length,(N.length<A||A===0)&&(o=!0))})}catch(p){P()(p)}l.value=!1}function C(){return typeof t=="function"?t():t}async function x(){try{u=0,o=!1,s.splice(0,s.length),await E()}catch(p){P()(p)}}function B(){if(y)return y.abort();l.value=!1}return{array:s,updateById:k,next:E,reload:x,wait:l,create:h,deleteById:b,textSearch:i,filteredArray:a,abort:B}}function pi(){function e(){return{organizations:z.organizations,currentContextId:z.contextId,person:z.person,context:z.context,contextType:z.contextType,userId:z.userId}}const t=r.reactive(e());return z.onupdateContext(()=>{Object.assign(t,e())}),t}function gi(e,t,n){return $().emit("communication:create",{entityName:e,entityCatalogId:t,targetCode:n})}function mi(e,t,n){return $().emit("communication:read",{entityName:e,entityCatalogId:t,targetCode:n})}function hi(e,t){return $().emit("communication-message:create",{communicationId:e,text:t})}function vi(e){return $().emit("communication-message:read",{communicationId:e})}function yi(e){const t=D.Form.getParentForm(),n=r.reactive([]);return t&&t.subscribe(e),e.read=()=>vi(e.id).then(o=>(n.splice(0,n.length,...o),o)),{array:n}}function wi(e,t){e.read=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw Z.EntityWithoutName(e);return ue(e.name,o)}).then(Ze).then(i=>(i.hasOwnProperty("Version")&&(e.version=i.Version),e.setValues(i),i)).catch(P())},e.save=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw Z.EntityWithoutName(e);return ze(e.name,{id:o.id,values:e.changes,version:e.version})}).then(i=>{e.version=i.version}).catch(i=>{throw P()(i),i})};function n(){return typeof t=="function"?t():t}}function Oe(e){if(!e)return r.inject(_.PROVIDE_NAME_METADATA);Ae.initEntity(e);const t=r.computed(()=>Ae.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 Yr(e,bi(t||{}))}}}function bi(e){return typeof e=="function"?e():e}function Ei(e){if(!e)return r.inject(_.PROVIDE_NAME_ACTIONS);const t=r.ref(!1),n=r.reactive([]),o=r.computed(()=>n.map(s=>$t(e,s))),i={actions:o,update:a};r.provide(_.PROVIDE_NAME_ACTIONS,i),e.router=Ve.useRouter();function a(){if(t.value)return;t.value=!0,n.splice(0,n.length);const s=e==null?void 0:e.form;return Lt({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(P("error")).finally(()=>t.value=!1)}return{actions:o,update:a,loading:r.readonly(t)}}function ki(e){function t(n){n.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",t)}),r.onUnmounted(()=>{document.removeEventListener("keypress",t)})}function Ti(e,t={}){const n=r.reactive([]),o=l=>{const c=r.unref(e);if(l===void 0){n.length===0?c.forEach(a):c.forEach(s);return}i(l)?s(l):a(l)},i=l=>n.includes(l),a=l=>{t.handleSelect&&!t.handleSelect(l)||i(l)||n.push(l)},s=l=>{const c=n.findIndex(f=>f===l);c!==-1&&n.splice(c,1)},u=r.computed(()=>{const l=r.unref(e);return n.length===l.length&&l.length!==0});return[n,o,u,a,s]}function Ci(e){const t=r.ref(""),n=r.computed(()=>{const o=t.value.toLowerCase();return r.unref(e).filter(i=>t.value.length?Object.values(i).join().toLowerCase().includes(o):!0)});return{search:t,searchArray:n}}const Qe=new class{constructor(){this.store=r.reactive([])}add(t,n,o={}){const i=_i(o),a=new De(t,n,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(t){const n=this.store.findIndex(o=>o.id===t);if(n===-1)return!1;this.store.splice(n,1)}};function _i(e){function t(o){return!!o&&typeof o=="object"}const n={timeout:10,click:()=>null,children:[]};return t(e)?{timeout:e.timeout||n.timeout,click:e.click||n.click,children:e.children||n.children}:n}const Se=class Se{constructor(t,n,o,i,a){this.type=t,this.message=n,this.timeout=o,this.children=i,this.click=a,this.id=Se.cardId++}};Se.cardId=1;let De=Se;/*!
8
8
  * jenesius-event-emitter v1.0.2
9
9
  * (c) 2022 Jenesius
10
10
  * @license MIT
11
- */const mt=function(e,t){return e in this.events||(this.events[e]=[]),this.events[e].push(t),this.off.bind(this,e,t)},ht=function(e,t){e in this.events&&this.events[e].forEach(n=>n(t))},yt=function(e,t){const n=this.events[e];if(!n)return;const o=n.indexOf(t);o!==-1&&n.splice(o,1)},vt=function(){this.events={}};class J{constructor(){this.events={}}on(t,n){return mt.call(this,t,n)}emit(t,n){return ht.call(this,t,n)}off(t,n){return yt.call(this,t,n)}cleanEvents(){vt.call(this)}static on(t,n){return mt.call(J,t,n)}static emit(t,n){return ht.call(J,t,n)}static off(t,n){return yt.call(J,t,n)}static cleanEvents(){vt.call(J)}}J.events={};class Ai extends J{constructor(t){super(),this.name="Communication",this.read=()=>{},this.id=t}sendMessage(t){return hi(this.id,t)}static checkAndGenerate(t,n,o){return mi(t,n,o).then(i=>i.length===0?gi(t,n,o):i[0])}}function Si(){return $().emit("client:read",{})}var le;const X=class X extends J{constructor(){super(...arguments);rt(this,le);this.type="front",this.organizations=[],xe(this,le,!1)}set language(n){localStorage.setItem(_.LOCALSTORAGE_LANGUAGE_KEY,n)}get language(){return localStorage.getItem(_.LOCALSTORAGE_LANGUAGE_KEY)||X.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,le,n),this.emit(X.EVENT_READY_UPDATE,n)}get ready(){return nt(this,le)}onReady(n){return this.on(X.EVENT_READY_UPDATE,n)}onupdateContext(n){return this.on(X.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(X.EVENT_CONTEXT_UPDATE,n),console.log(`Current context id %c${n}`,"color: purple")}get context(){var n;return this.contextId?this.contextId===((n=this.person)==null?void 0:n.id)?this.person:this.organizations.find(o=>o.id===this.contextId)||null:null}async init(){try{const n=await this.loadCustomerData();this.person=n,this.organizations=n.organizations,this.userId=n.userId,this.restoreCurrentContext(),this.ready=!0}catch(n){P()(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 Si()}validateContextId(n){var o;try{return((o=this.person)==null?void 0:o.id)==n?!0:!!this.organizations.find(i=>i.id===n)}catch{return!1}}};le=new WeakMap,X.DEFAULT_LANGUAGE="en",X.EVENT_CONTEXT_UPDATE="event:context-update",X.EVENT_READY_UPDATE="event:ready-update";let Pe=X;function Ii(e){return $().emit("metadata:read",{entity:e})}const Ae=function(){const t=r.reactive({}),n=new Map;function o(u){return t[u]}async function i(u){if(n.has(u)&&await n.get(u),t[u])return;const l=await a(u);s(u,l)}function a(u){const l=Ii(u).finally(()=>{n.delete(u)});return n.set(u,l),l}function s(u,l){t[u]=l}return{state:t,initEntity:i,get:o}}();class Ni extends J{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 H{static login(t){return j(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 H.requestStepRegistrationProcess("StartRegistration",t)}static confirmPhoneRegistrationProcess(t){return H.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",t)}static confirmEmailRegistrationProcess(t){return H.requestStepRegistrationProcess("ConfirmEmailByRegistration",t)}static finishEmailRegistrationProcess(t){return H.requestStepRegistrationProcess("FinishRegistration",t)}static requestStepRegistrationProcess(t,n){return j(`${S.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(t){return H.requestStepLoginProcess("StartLogin",t)}static loginWithPassword(t){return H.requestStepLoginProcess("LoginWithPassword",t)}static loginWithOtpCode(t){return H.requestStepLoginProcess("LoginWithOtpCode",t)}static requestStepLoginProcess(t,n){return j(`${S.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(H.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 j(`${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,o,i){return j(`${S.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:o,Code:i})})}static confirmEmailByAccessRecovery(t,n,o,i){return j(`${S.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:o,Code:i})})}static finishAccessRecovery(t,n,o){return j(`${S.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Password:o,ConfirmedPassword:o})})}}class Ri{static readHistoryById(t,n){return j(`/close-api/audits/history/${t}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Oi{static getConfiguration(){return j("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(t){return await j(`/open-api/data/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Li{static getDictionary(t){if(!t)throw new Error(`Can't get dictionary for ${t}.`);return j(`/open-api/internationalization/language/${t}`)}}class xi{static async upload(t,n){const o=new FormData;return o.append("file",t),j(`/close-api/files?entityName=${n}`,{method:"POST",body:o}).then(i=>(i.filename=t.name,i))}}var Kt=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(Kt||{}),Qt=(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))(Qt||{});function $i(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function L(e){return Object.keys(e).reduce((t,n)=>{const o=e[n];if(Array.isArray(o)){const i=o.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return o.length&&t.push(`@${n} in (${i})`),t}if($i(o)){let i=function(a){var s;return((s=a.match(/([^Z]*)/))==null?void 0:s[0])+"0000Z"};return o.start&&t.push(`@${n} ge ${i(o.start)}`),o.end&&t.push(`@${n} le ${i(o.end)}`),t}return typeof o=="number"||typeof o=="boolean"?(t.push(`@${n} eq ${o}`),t):typeof o=="string"?(o.length!==0&&t.push(`@${n} eq '${o}'`),t):(o===null&&t.push(L.is(n,o)),t)},[]).join(" and ")}function ye(e){return typeof e=="string"?`'${e}'`:`${e}`}L.includes=function(t,n){return`@${t} Contains ${ye(n)}`};L.beginWith=function(t,n){return`@${t} BeginWith ${ye(n)}`};L.notEq=function(t,n){return`@${t} nq ${ye(n)}`};L.eq=function(t,n){return Array.isArray(n)?L.in(t,n):`@${t} eq ${ye(n)}`};L.in=function(t,n){const o=n.map(ye).join(", ");return`@${t} in (${o})`};L.notIn=function(t,n){return!Array.isArray(n)||n.length===0?"":L.and(...n.map(o=>L.notEq(t,o)))};L.and=function(...t){return t.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(L.wrap).join(" and ")};L.wrap=function(t){return`(${t})`};L.is=function(t,n){return`@${t} is ${n}`};L.or=function(...t){return t.join(" or ")};function Ze(e){return Object.keys(e).reduce((t,n)=>{let o=e[n];const i=n.charAt(0).toUpperCase()+n.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=Ze(o)),t[i]=o,t},{})}const z=new Pe,he=new Ni;exports.ApplicationStatus=Qt;exports.Communication=Ai;exports.CoreError=Z;exports.DisplayListRow=Ye;exports.EventBus=he;exports.Filter=L;exports.Manager=z;exports.MetadataStore=Ae;exports.NotificationSystem=Qe;exports.OBJECT_TYPE_NAME_FIELD=Et;exports.RecordOperation=Kt;exports.WidgetButton=Mn;exports.WidgetFastTable=Fr;exports.WidgetFastTableHeadCell=Tt;exports.WidgetField=fr;exports.WidgetIcon=ce;exports.WidgetImage=Kn;exports.WidgetList=ur;exports.WidgetLoader=Jn;exports.WidgetMultiButton=zn;exports.WidgetSpinner=de;exports.WidgetTable=kt;exports.WidgetTablePanelFilterItem=Ct;exports.asyncProcess=Te;exports.authService=H;exports.billingService=ie;exports.catchUniversal=P;exports.config=In;exports.configuration=S;exports.constants=_;exports.convertDDToDMS=si;exports.convertDMSToDD=ai;exports.convertListConfig=Jt;exports.debounce=Ur;exports.documentsService=on;exports.fileService=xi;exports.formatter=fe;exports.getCellName=me;exports.getCellValue=je;exports.getEntityLink=Je;exports.getNamesFromListConfig=At;exports.getUnitValue=$e;exports.groupArrayByField=Vr;exports.historyService=Ri;exports.injectAction=xt;exports.internationalizationService=Li;exports.invitationService=rn;exports.openService=Oi;exports.parseError=Ge;exports.parseTextByMarkdown=ii;exports.prettyDate=qe;exports.prettyDateWithTime=_t;exports.prettyMoney=St;exports.prettyValueFieldByEntity=Gr;exports.processWizardService=se;exports.request=j;exports.setupListRow=Ue;exports.staticLink=eo;exports.t=ee;exports.throttle=Wr;exports.universalEntityCount=Zr;exports.universalEntityCreate=Rt;exports.universalEntityDelete=Ot;exports.universalEntityRead=ue;exports.universalEntityUpdate=ze;exports.universalHistoryRead=Qr;exports.universalListSettingRead=Nt;exports.universalMetadataFieldTreat=Jr;exports.universalMetadataListRead=Kr;exports.universalToolRead=Lt;exports.useActions=Ei;exports.useCommunication=vi;exports.useEnter=ki;exports.useFormEntity=wi;exports.useListActiveRow=ui;exports.useListEntity=di;exports.useListSearch=Ci;exports.useListSelect=Ti;exports.useManagerState=pi;exports.useMetadata=Oe;exports.useSocket=$;exports.useUsageContext=Ke;exports.useVisibleItem=We;exports.useWizard=un;exports.uuidv4=Mr;exports.valuesToUpperCase=Ze;exports.wrapToolResponse=$t;
11
+ */const mt=function(e,t){return e in this.events||(this.events[e]=[]),this.events[e].push(t),this.off.bind(this,e,t)},ht=function(e,t){e in this.events&&this.events[e].forEach(n=>n(t))},vt=function(e,t){const n=this.events[e];if(!n)return;const o=n.indexOf(t);o!==-1&&n.splice(o,1)},yt=function(){this.events={}};class J{constructor(){this.events={}}on(t,n){return mt.call(this,t,n)}emit(t,n){return ht.call(this,t,n)}off(t,n){return vt.call(this,t,n)}cleanEvents(){yt.call(this)}static on(t,n){return mt.call(J,t,n)}static emit(t,n){return ht.call(J,t,n)}static off(t,n){return vt.call(J,t,n)}static cleanEvents(){yt.call(J)}}J.events={};class Ai extends J{constructor(t){super(),this.name="Communication",this.read=()=>{},this.id=t}sendMessage(t){return hi(this.id,t)}static checkAndGenerate(t,n,o){return mi(t,n,o).then(i=>i.length===0?gi(t,n,o):i[0])}}function Si(){return $().emit("client:read",{})}var le;const X=class X extends J{constructor(){super(...arguments);rt(this,le);this.type="front",this.organizations=[],xe(this,le,!1)}set language(n){localStorage.setItem(_.LOCALSTORAGE_LANGUAGE_KEY,n)}get language(){return localStorage.getItem(_.LOCALSTORAGE_LANGUAGE_KEY)||X.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,le,n),this.emit(X.EVENT_READY_UPDATE,n)}get ready(){return nt(this,le)}onReady(n){return this.on(X.EVENT_READY_UPDATE,n)}onupdateContext(n){return this.on(X.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(X.EVENT_CONTEXT_UPDATE,n),console.log(`Current context id %c${n}`,"color: purple")}get context(){var n;return this.contextId?this.contextId===((n=this.person)==null?void 0:n.id)?this.person:this.organizations.find(o=>o.id===this.contextId)||null:null}async init(){try{const n=await this.loadCustomerData();this.person=n,this.organizations=n.organizations,this.userId=n.userId,this.restoreCurrentContext(),this.ready=!0}catch(n){P()(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 Si()}validateContextId(n){var o;try{return((o=this.person)==null?void 0:o.id)==n?!0:!!this.organizations.find(i=>i.id===n)}catch{return!1}}};le=new WeakMap,X.DEFAULT_LANGUAGE="en",X.EVENT_CONTEXT_UPDATE="event:context-update",X.EVENT_READY_UPDATE="event:ready-update";let Pe=X;function Ii(e){return $().emit("metadata:read",{entity:e})}const Ae=function(){const t=r.reactive({}),n=new Map;function o(u){return t[u]}async function i(u){if(n.has(u)&&await n.get(u),t[u])return;const l=await a(u);s(u,l)}function a(u){const l=Ii(u).finally(()=>{n.delete(u)});return n.set(u,l),l}function s(u,l){t[u]=l}return{state:t,initEntity:i,get:o,loadingFlags:n}}();class Ni extends J{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 H{static login(t){return j(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 H.requestStepRegistrationProcess("StartRegistration",t)}static confirmPhoneRegistrationProcess(t){return H.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",t)}static confirmEmailRegistrationProcess(t){return H.requestStepRegistrationProcess("ConfirmEmailByRegistration",t)}static finishEmailRegistrationProcess(t){return H.requestStepRegistrationProcess("FinishRegistration",t)}static requestStepRegistrationProcess(t,n){return j(`${S.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(t){return H.requestStepLoginProcess("StartLogin",t)}static loginWithPassword(t){return H.requestStepLoginProcess("LoginWithPassword",t)}static loginWithOtpCode(t){return H.requestStepLoginProcess("LoginWithOtpCode",t)}static requestStepLoginProcess(t,n){return j(`${S.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(H.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 j(`${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,o,i){return j(`${S.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:o,Code:i})})}static confirmEmailByAccessRecovery(t,n,o,i){return j(`${S.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:o,Code:i})})}static finishAccessRecovery(t,n,o){return j(`${S.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Password:o,ConfirmedPassword:o})})}}class Ri{static readHistoryById(t,n){return j(`/close-api/audits/history/${t}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Oi{static getConfiguration(){return j("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(t){return await j(`/open-api/data/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Li{static getDictionary(t){if(!t)throw new Error(`Can't get dictionary for ${t}.`);return j(`/open-api/internationalization/language/${t}`)}}class xi{static async upload(t,n){const o=new FormData;return o.append("file",t),j(`/close-api/files?entityName=${n}`,{method:"POST",body:o}).then(i=>(i.filename=t.name,i))}}var Kt=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(Kt||{}),Qt=(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))(Qt||{});function $i(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function L(e){return Object.keys(e).reduce((t,n)=>{const o=e[n];if(Array.isArray(o)){const i=o.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return o.length&&t.push(`@${n} in (${i})`),t}if($i(o)){let i=function(a){var s;return((s=a.match(/([^Z]*)/))==null?void 0:s[0])+"0000Z"};return o.start&&t.push(`@${n} ge ${i(o.start)}`),o.end&&t.push(`@${n} le ${i(o.end)}`),t}return typeof o=="number"||typeof o=="boolean"?(t.push(`@${n} eq ${o}`),t):typeof o=="string"?(o.length!==0&&t.push(`@${n} eq '${o}'`),t):(o===null&&t.push(L.is(n,o)),t)},[]).join(" and ")}function ve(e){return typeof e=="string"?`'${e}'`:`${e}`}L.includes=function(t,n){return`@${t} Contains ${ve(n)}`};L.beginWith=function(t,n){return`@${t} BeginWith ${ve(n)}`};L.notEq=function(t,n){return`@${t} nq ${ve(n)}`};L.eq=function(t,n){return Array.isArray(n)?L.in(t,n):`@${t} eq ${ve(n)}`};L.in=function(t,n){const o=n.map(ve).join(", ");return`@${t} in (${o})`};L.notIn=function(t,n){return!Array.isArray(n)||n.length===0?"":L.and(...n.map(o=>L.notEq(t,o)))};L.and=function(...t){return t.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(L.wrap).join(" and ")};L.wrap=function(t){return`(${t})`};L.is=function(t,n){return`@${t} is ${n}`};L.or=function(...t){return t.join(" or ")};function Ze(e){return Object.keys(e).reduce((t,n)=>{let o=e[n];const i=n.charAt(0).toUpperCase()+n.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=Ze(o)),t[i]=o,t},{})}const z=new Pe,he=new Ni;exports.ApplicationStatus=Qt;exports.Communication=Ai;exports.CoreError=Z;exports.DisplayListRow=Ye;exports.EventBus=he;exports.Filter=L;exports.Manager=z;exports.MetadataStore=Ae;exports.NotificationSystem=Qe;exports.OBJECT_TYPE_NAME_FIELD=Et;exports.RecordOperation=Kt;exports.WidgetButton=Mn;exports.WidgetFastTable=Fr;exports.WidgetFastTableHeadCell=Tt;exports.WidgetField=fr;exports.WidgetIcon=ce;exports.WidgetImage=Kn;exports.WidgetList=ur;exports.WidgetLoader=Jn;exports.WidgetMultiButton=zn;exports.WidgetSpinner=de;exports.WidgetTable=kt;exports.WidgetTablePanelFilterItem=Ct;exports.asyncProcess=Te;exports.authService=H;exports.billingService=ie;exports.catchUniversal=P;exports.config=In;exports.configuration=S;exports.constants=_;exports.convertDDToDMS=si;exports.convertDMSToDD=ai;exports.convertListConfig=Jt;exports.debounce=Ur;exports.documentsService=on;exports.fileService=xi;exports.formatter=fe;exports.getCellName=me;exports.getCellValue=je;exports.getEntityLink=Je;exports.getNamesFromListConfig=At;exports.getUnitValue=$e;exports.groupArrayByField=Vr;exports.historyService=Ri;exports.injectAction=xt;exports.internationalizationService=Li;exports.invitationService=rn;exports.openService=Oi;exports.parseError=Ge;exports.parseTextByMarkdown=ii;exports.prettyDate=qe;exports.prettyDateWithTime=_t;exports.prettyMoney=St;exports.prettyValueFieldByEntity=Gr;exports.processWizardService=se;exports.request=j;exports.setupListRow=Ue;exports.staticLink=eo;exports.t=ee;exports.throttle=Wr;exports.universalEntityCount=Zr;exports.universalEntityCreate=Rt;exports.universalEntityDelete=Ot;exports.universalEntityRead=ue;exports.universalEntityUpdate=ze;exports.universalHistoryRead=Qr;exports.universalListSettingRead=Nt;exports.universalMetadataFieldTreat=Jr;exports.universalMetadataListRead=Kr;exports.universalToolRead=Lt;exports.useActions=Ei;exports.useCommunication=yi;exports.useEnter=ki;exports.useFormEntity=wi;exports.useListActiveRow=ui;exports.useListEntity=di;exports.useListSearch=Ci;exports.useListSelect=Ti;exports.useManagerState=pi;exports.useMetadata=Oe;exports.useSocket=$;exports.useUsageContext=Ke;exports.useVisibleItem=We;exports.useWizard=un;exports.uuidv4=Mr;exports.valuesToUpperCase=Ze;exports.wrapToolResponse=$t;
12
12
  //# sourceMappingURL=eservices-core.cjs.js.map
@@ -11,7 +11,7 @@ import On from "date-and-time";
11
11
  import Ke from "debug";
12
12
  import { promptModal as Dt, getComponentFromStore as Mt, pushModal as Rn, openModal as yt } from "jenesius-vue-modal";
13
13
  /*!
14
- * eservices-core v1.3.199
14
+ * eservices-core v1.3.200
15
15
  * (c) 2024 ESERVICES
16
16
  */
17
17
  const O = class O extends Error {
@@ -1463,7 +1463,7 @@ const Pr = ["fill"], Fr = /* @__PURE__ */ I("path", { d: "M440-647 244-451q-12 1
1463
1463
  }), b = nt(async function() {
1464
1464
  var T, S, N;
1465
1465
  const m = t.entity;
1466
- o.value = null, _.promise && await _.promise, r.value = (await Re(m, {
1466
+ o.value = null, _.promise && await _.promise, console.log(i.value), r.value = (await Re(m, {
1467
1467
  // @ts-ignore
1468
1468
  customFilters: ((T = i.value) == null ? void 0 : T.customFilters) || [],
1469
1469
  fields: ci(p.value).join(" "),
@@ -3200,7 +3200,8 @@ const lt = function() {
3200
3200
  return {
3201
3201
  state: t,
3202
3202
  initEntity: i,
3203
- get: r
3203
+ get: r,
3204
+ loadingFlags: n
3204
3205
  };
3205
3206
  }();
3206
3207
  class Vo extends le {
@@ -1,12 +1,12 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.es-card-list{box-shadow:#959da533 0 8px 24px;border:1px solid #f1f1f1;border-radius:4px;background-color:#fff}.color-primary{color:var(--primary)}.color-gray{color:#ccc}.es-container-full{height:100%;width:100%}.es-cursor-pointer{cursor:pointer}.es-cursor-default{cursor:default}.es-flex{display:flex}.es-flex-column{display:flex;flex-direction:column}.es-flex-center{display:flex;align-items:center;justify-content:center}.es-flex-grow{flex-grow:1}.es-flex-justify-center{justify-content:center}.es-flex-justify-between{justify-content:space-between}.es-flex-align-center{align-items:center}.es-gap-1{gap:1px}.es-gap-2{gap:2px}.es-gap-3{gap:3px}.es-gap-4{gap:4px}.es-gap-5{gap:5px}.es-gap-6{gap:6px}.es-gap-7{gap:7px}.es-gap-8{gap:8px}.es-gap-9{gap:9px}.es-gap-10{gap:10px}.es-gap-15{gap:15px}.es-gap-20{gap:20px}.es-list-container,.es-overflow-auto{overflow:auto}.es-overflow-hidden{overflow:hidden}.es-padding-2{padding:2px}.es-padding-3{padding:3px}.es-padding-4{padding:4px}.es-padding-5{padding:5px}.es-padding-10{padding:10px}.es-padding-0{padding:0}.es-padding-7{padding:7px}.es-padding-15{padding:15px}.es-padding-20{padding:20px}.es-padding-v-5{padding:5px 0}.es-padding-h-5{padding:0 5px}.es-padding-is-5{padding-inline-start:5px}.es-padding-ie-5{padding-inline-end:5px}.es-position-relative{position:relative}.es-position-absolute{position:absolute}.es-position-absolute-full{position:absolute;left:0;top:0;width:100%;height:100%}.es-position-absolute-center{position:absolute;left:0;right:0;top:0;bottom:0;margin:auto}.es-radius-2{border-radius:2px}.es-radius-3{border-radius:3px}.es-radius-4{border-radius:4px}.es-radius-5{border-radius:5px}.es-radius-6{border-radius:6px}.es-radius-7{border-radius:7px}.es-radius-8{border-radius:8px}.es-radius-9{border-radius:9px}.es-radius-10{border-radius:10px}.es-radius-15{border-radius:15px}.es-radius-20{border-radius:20px}.es-text-xs{font-weight:400;font-size:10px;line-height:13px}.es-text-sm{font-weight:400;font-size:12px;line-height:16px}.es-text-md{font-size:14px;line-height:20px}.es-text-lg{font-size:16px;line-height:24px}.es-text-xl{font-size:18px;line-height:25px}.es-text-center{text-align:center}.es-text-bold{font-weight:700}.es-text-no-wrap{text-wrap:nowrap}.es-weight-600{font-weight:600}.es-zindex-0{z-index:0}.es-zindex-1{z-index:1}.es-zindex-2{z-index:2}.es-zindex-3{z-index:3}.es-zindex-4{z-index:4}.es-zindex-5{z-index:5}.es-grid{display:grid}.es-grid-center{display:grid;place-content:center}.es-margin-0{margin:0}.widget-table__head-cell[data-v-498c4f00]{padding:18px;text-align:start}.widget-table__head-label[data-v-498c4f00]{font-weight:600;font-size:14px;line-height:19px}.widget-filter-text[data-v-800b3803]{box-shadow:0 2px 2px #00000040;background-color:#fff;padding:20px 10px}.widget-filter-enum[data-v-cf143196]{box-shadow:0 2px 2px #00000040;background-color:#fff;padding:3px 0;max-height:400px;max-width:340px;min-width:180px;overflow:hidden auto}.widget-filter-enum-item[data-v-cf143196]{padding:6px 11px;transition:.1s;cursor:pointer}.widget-filter-enum-item[data-v-cf143196]:hover{background-color:#f1f1f1}[dir=rtl] .icon[data-v-8a72b45f]{transform:scaleX(-1)}.widget-spinner[data-v-0ef9ae88],.widget-spinner[data-v-0ef9ae88]:after{border-radius:50%;width:14px;height:14px}.widget-spinner[data-v-0ef9ae88]{font-size:2px;position:relative;text-indent:-9999em;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid #ffffff;transform:translateZ(0);animation:spinnerAnimation-0ef9ae88 1.1s infinite linear}@keyframes spinnerAnimation-0ef9ae88{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.widget-button[data-v-450dc564]{position:relative}.widget-button-spinner[data-v-450dc564]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.widget-multi-button-wrap[data-v-d43a76ce]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-d43a76ce]{grid-template-columns:1fr var(--button-size);background-color:var(--primary);grid-template-rows:var(--button-size);transition:var(--fast)}.widget-multi-button_active[data-v-d43a76ce]{grid-template-rows:calc(var(--button-size) * var(--04895bf1))}.widget-multi-button-body[data-v-d43a76ce]{min-width:80px}.widget-multi-button-body-label[data-v-d43a76ce]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-d43a76ce]:hover{background-color:#223296}.widget-multi-button-side[data-v-d43a76ce]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-d43a76ce]{transform:rotate(180deg)}.widget-multi-button-side[data-v-d43a76ce]:hover{background-color:#223296}tr[data-v-344a8cc1]{border:1px solid #F3F4FC;height:30px}th[data-v-344a8cc1],td[data-v-344a8cc1]{position:relative;padding:0 11px}th[data-v-344a8cc1]{text-align:left}p[data-v-344a8cc1]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.widget-list-head-cell[data-v-bf495d6a]{padding:0 0 0 10px;display:flex}.widget-list-head-cell[data-v-bf495d6a]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-bf495d6a]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-bf495d6a]{position:absolute;inset-inline-end:22px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-bf495d6a]{transform:rotate(180deg)}.head-cell-resize[data-v-bf495d6a]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-bf495d6a]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-bf495d6a]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-ccffc6bd]{position:sticky;top:-1px;z-index:1}.test-block[data-v-ccffc6bd]{position:absolute;z-index:2;display:none;height:calc(100% + 1px);place-content:center;inset-block-start:-1px;padding-inline:10px;background-color:#e7f2ff;-webkit-user-select:none;user-select:none;white-space:nowrap}.widget-list-head th[data-v-ccffc6bd]{position:sticky;top:0;z-index:2;-webkit-user-select:none;user-select:none}.widget-head-cell[data-v-9db5d417]{display:flex;gap:4px}.widget-head-cell-order[data-v-9db5d417]{display:flex;flex-direction:column;justify-content:center;gap:2px}.widget-head-cell-label[data-v-9db5d417]{cursor:pointer}.widget-fast-table-head-cell-td[data-v-9db5d417]{padding:7px}.widget-head-cell-order-icon[data-v-9db5d417]{transition:.1s;height:18px;width:18px}.widget-head-cell-order-icon_desc[data-v-9db5d417]{transform:rotate(180deg)}.widget-filter-item-container[data-v-5b9128bc]{position:relative}.widget-filter-item-arrow[data-v-5b9128bc]{transform:rotate(180deg)}.widget-filter-item-label_active[data-v-5b9128bc]{font-weight:700}.widget-filter-item[data-v-5b9128bc]{display:grid;grid-template-columns:max-content max-content;align-items:center;cursor:pointer;padding:0 10px;color:#fff}.widget-filter-item-label[data-v-5b9128bc]{-webkit-user-select:none;user-select:none;padding:4px 2px 4px 8px}.widget-filter-item-popup[data-v-5b9128bc]{position:absolute;z-index:2;inset-block-start:100%;inset-inline-end:0}.widget-filter-item-arrow[data-v-5b9128bc]{transition:.2s}.widget-table-panel-filter[data-v-f1534314]{justify-content:end;background-color:var(--color-primary)}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
2
  (function(f,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("jenesius-vue-form"),require("vue-router"),require("date-and-time"),require("debug"),require("jenesius-vue-modal")):typeof define=="function"&&define.amd?define(["exports","vue","jenesius-vue-form","vue-router","date-and-time","debug","jenesius-vue-modal"],r):(f=typeof globalThis<"u"?globalThis:f||self,r(f["eservices-core"]={},f.Vue,f.JenesiusVueForm,f.VueRouter,f.DateAndTime,f.Debug,f.JenesiusVueModal))})(this,function(f,r,v,ae,en,Ee,ne){"use strict";var Yt=f=>{throw TypeError(f)};var Kt=(f,r,v)=>r.has(f)||Yt("Cannot "+v);var Qt=(f,r,v)=>(Kt(f,r,"read from private field"),v?v.call(f):r.get(f)),Zt=(f,r,v)=>r.has(f)?Yt("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(f):r.set(f,v),et=(f,r,v,ae)=>(Kt(f,r,"write to private field"),ae?ae.call(f,v):r.set(f,v),v);/*!
3
- * eservices-core v1.3.199
3
+ * eservices-core v1.3.200
4
4
  * (c) 2024 ESERVICES
5
5
  */var ge;const R=class R extends Error{constructor(t,n=null){super(),this.message=t,this.details=n,this.id=R.ID++}static ParentFormNotFound(){return new R("Can't found parent form.")}static UndefinedNameOfCompositeFormController(t){return new R("Composite object name is undefined",t)}static EntityWithoutName(t){return new R("'Entity doesn't have a name",t)}static NotResolvedNameEventEmitter(t){return new R(`'${t}' is not a valid Event emitter name`)}static FormIsNotValidated(t){return new R("Form is not validated",t)}static ListWorkerIsRunningOrEnd(t){return new R("List data request is running or already done",t)}static ObjectIdNotNumber(t){return new R(`${t} (id) is not a number`)}static UndefinedErrorId(t,n){return R.ApiNotAvailable()}static ApiError(t){return new R("Request error",t)}static ApiNotAvailable(){return new R(`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?R.ApiNotAvailable():new R(t||"Authorization Error",n)}static ApiResponseParseFailed(){return R.ApiNotAvailable()}static MissingIdInValuesEntity(t){return new R("Object doesn't have id",t)}static ObjectWithIdNotFound(t,n){return new R(`Can't find object with id: ${t}`,n)}static ObjectWithoutConnectToPresentArray(t,n){return new R("Object is not found.",{object:t,array:n})}static EntityWithoutId(t){return new R("Entity doesn't have id.",t)}static NotFoundedTableIndex(t,n){return new R(`Can't find the element with tableIndex ${t}`,n)}static UndefinedError(t,n=[]){return new R(t,n)}static TableArrayAlreadyIncludeProvidedIndexValue(t,n,i){return new R(`Array already includes the element with value ${t}`,{array:n,table:i})}static MetadataEntityIsNotAvailable(t){return new R(`Metadata for the ${t} is not currently available.`)}static RequestTookToLong(){return new R("The request took too long to complete. Try again later.")}};R.ID=0;let Q=R;const tn="Please try again later or submit a feedback if problem doesn't go.";function nn(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return tn}})}function Y(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=>nn(n).then(i=>{if(!n.ok)throw i;return i}))}class rn{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 rn;function tt(e){return{...e,createdEntities:e.createdEntites}}const pe=class pe{static async getStartConfig(t,n){return Y([pe.url,t,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(t,n){return Y([pe.url,t,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(tt)}static async runStep(t,n,i,o,a){return Y([pe.url,t,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:i,token:o,values:a})}).then(tt)}};pe.url="/close-api/views/process-wizard";let se=pe;var x=(e=>(e.Completed="Completed",e.FinalStep="FinalStep",e.NextStep="NextStep",e.FinalStepWithConfirmation="FinalStepWithConfirmation",e.NextStepWithConfirmation="NextStepWithConfirmation",e.ValidationError="ValidationError",e.Undefined="Undefined",e))(x||{});class on{static invite(t,n,i){return Y("/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 Y("/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 Y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:t,version:n,mark:!1})})}}class an{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 le{static url(){return"close-api/billing"}static getBillingMetadata(t){return fetch(`/${le.url()}/calculator/${t}`)}static calculate(t,n){return Y(`/${le.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 Y(`/${le.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:t,returnURL:n})})}static applyOnlinePayment(t){return Y(`/${le.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:t})})}}function sn(e){return e.statusName===x.Completed}function ln(e){return[x.FinalStepWithConfirmation,x.NextStepWithConfirmation].includes(e.statusName)}function cn(e){return e.statusName===x.ValidationError}function fn(e){return e.statusName===x.Undefined}function un(e,t,n){let i=null,o=[];const a=r.ref(!1),s=r.ref(null),u=r.computed(()=>m(o,s.value)),l=r.ref(null),c=r.reactive([]),d=r.computed(()=>c.map(b=>m(o,b)));function m(b,k){return b.find(A=>A.name===k)||null}async function p(b){var k;if(fn(b)){await n.onDisplayDataSet(b);return}if(!(ln(b)&&!await n.onDisplayDataSet(b))){if(cn(b))return void n.onValidation(b.validationResults);T(b),await r.nextTick();{const A=((k=m(o,s.value))==null?void 0:k.fields)||[];if([x.FinalStep,x.NextStep].includes(b.statusName)&&(!A.length||dn(A,n.presets)))return y(n.presets||{})}sn(b)&&n.onCompleted(b)}}async function E(){try{await h(),await _()}catch(b){M("error")(b)}}function h(){return a.value="Loading process information.",se.getStartConfig(t,e).then(b=>(l.value={label:b.processTitle,info:b.processInfo,icon:b.processIcon},o=b.steps.map(k=>{const A=k.frontendEntity.rootObject,P=Object.fromEntries(k.frontendEntity.objectTypes.map(D=>[D.name,D.properties]));return{label:k.title,name:k.stepName,number:k.number,rootObjectName:A,objectTypes:P,fields:P[A],buttonCaption:k.buttonCaption}}))).finally(()=>{a.value=!1})}function T(b){return[x.FinalStepWithConfirmation,x.NextStepWithConfirmation,x.NextStep,x.Completed,x.FinalStep].includes(b.statusName)&&(i=b.token,s.value=b.nextStepName),b}function _(){return a.value="Starting process",se.startProcess(t,e).then(p).catch(M("error")).finally(()=>{a.value=null})}function y(b={}){const k=s.value;return!i||!k?Promise.reject("Not step or token."):(a.value="Waiting for result...",se.runStep(t,e,k,i,b).then(p).then(A=>(c.push(k),A)).catch(M("error")).finally(()=>{a.value=!1}))}return{initialize:E,loading:a,currentStepConfig:u,currentStepName:s,arrayPassedSteps:d,arrayProcessStepName:c,processInfo:l,next:y}}function dn(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(!v.utils.getPropFromObject(t,i.name))return!1}return!0}const pn={class:"widget-table__head-cell"},gn={class:"widget-table__head-label margin_0 text_overflow"},nt=r.defineComponent({__name:"widget-table-head-cell",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("th",pn,[r.createElementVNode("span",gn,r.toDisplayString(t.label),1)]))}}),mn={class:"widget-table__head"},hn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>N.componentTableHeadCell||nt),(t,n)=>(r.openBlock(),r.createElementBlock("tr",mn,[(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))]))}}),U=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},yn=U(hn,[["__scopeId","data-v-498c4f00"]]);function Be(e){return Array.isArray(e)?Be(e[0]):typeof e!="string"?null:e}function me(e){return Be(e.name)}function wn(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 bn(e,t){return wn(e).forEach(i=>{e=e.replace(new RegExp("\\$\\{"+i+"}","g"),v.utils.getPropFromObject(t,i))}),e}function Fe(e){return t=>typeof t=="string"||typeof t=="number"?`${t} ${e}`:""}function Pe(e,t){const n=me(e);if(typeof e.value=="string")return bn(e.value,t);let i=n?v.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=Fe(e.unitValue)(i)),e.unit&&(i=Fe(e.unit)(i)),e.type)switch(e.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Me(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=ut(typeof i=="string"?i:null);break}case"money":{i=pt(i);break}}return e.formatter&&(i=de(e.formatter).exec(i,t)),typeof i=="boolean"&&(i=i?"✓":"—"),i}const En=1,_n=5e3,kn="static-folder",rt="request-error",it="Distinguisher",S={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:it};function _e(e){return[S.CORE_DEBUG_LABEL,e].join(":")}const Tn={class:"widget-filter-text flex gap_20"},Cn=U(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",Tn,[r.createVNode(r.unref(v.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})])}}}),[["__scopeId","data-v-800b3803"]]),An={class:"widget-filter-enum"},N={getEntityLink(e,t){return`/forms/${e}/${t}`},iconHandlerText(){return""},iconTag:"i",tableFilterEntityBind:{String:Cn,Entity:U(r.defineComponent({__name:"widget-filter-entity",props:{values:{},fieldMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:t}){const n=e,i=r.ref([]),o=Re(n.fieldMetadata.entity),a=c=>(n.values||[]).includes(c),s=t;function u(c){const d=n.values||[];return d.includes(c)?s("update:values",d.filter(m=>m!==c)):s("update:values",[...d,c])}async function l(){var m;if(!((m=n.fieldMetadata)!=null&&m.entity)||!o.value)return;const c=o.value.fieldNameForLabel,d=o.value.fieldNameForIdentification;s("readProcess","start"),i.value=await ue(n.fieldMetadata.entity,{fields:[c,d].join(" "),order:[c,"asc"]}).then(p=>(s("readProcess","end"),p.map(E=>({label:E[c],value:E[d]}))))}return r.watch(()=>o.value,l,{immediate:!0}),(c,d)=>(r.openBlock(),r.createElementBlock("div",An,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,m=>(r.openBlock(),r.createBlock(r.unref(v.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))]))}}),[["__scopeId","data-v-cf143196"]])}};function Sn(e){for(let t in e)N[t]=e[t]}const ce=U({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(N.iconTag,{class:N.iconHandler?N.iconHandler(n):`icon icon-${n}`},N.iconHandlerText(n))}},[["__scopeId","data-v-8a72b45f"]]),vn=Ee(_e("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=Pe(e,i);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function s(d){a.onClick.push(()=>d(i,e,n))}function u(d){Array.isArray(d)?a.class.push(...d):a.class.push(d)}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(v.FormField,{type:"single-checkbox",modelValue:t.selected})),s(ot.bind(null,n,!0));break}case"select":{c.push(r.h(v.FormField,{type:"single-radio",modelValue:t.selected})),s(ot.bind(null,n,!1));break}}if(e.onClick&&s(e.onClick),e.link)try{const d=e.link(i);if(d){const m=r.h(ae.RouterLink,{to:d});c.push(m),u("widget-table-cell_link")}}catch(d){vn("Can't add router link",d)}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(ce,{name:e.icon})),typeof e.icon=="function")){const d=e.icon(i);d!==null&&c.push(r.h(ce,{name:d}))}return e.class&&(typeof e.class=="function"?u(e.class(i)):u(e.class)),N.listCellHandler&&N.listCellHandler(e,i,{cellNodeChildren:c,addClass:u,addHandleClick:s,context:n}),l.push(r.h("td",a,c)),l}function ot(e,t){e.emit("select",t)}function De(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:De},On=["colspan"],at=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,On)],512))}}),Ln={class:"widget-table"},st="update:selectedRows",$n="update:activeRow",lt=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 p;return(p=o==null?void 0:o.default)==null?void 0:p.call(o)[0]});function s(p){return n.useMockField?Wt(p):p}function u(p,E=!0){if(!n.selectedRows)return;if(!E)return i(st,n.selectedRows.includes(p)?[]:[p]);const h=[...n.selectedRows],T=h.indexOf(p);return T===-1?h.push(p):h.splice(T,1),i(st,h)}function l(p){i($n,p)}function c(p){i("save",p),i("update:activeRow",null)}const d=r.computed(()=>n.shortcut?n.config.filter(p=>p.name?!!n.array.find(h=>![null,""].includes(Pe(p,h))):!0):n.config),m=r.computed(()=>n.useMockField?n.array.filter(Wt):n.array);return(p,E)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Ln,[r.createElementVNode("thead",null,[r.createVNode(yn,{config:d.value,onOrder:E[0]||(E[0]=h=>p.$emit("order",h))},{default:r.withCtx(h=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.$slots["head-cell"]||nt),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,T)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:T},[r.createVNode(Rn,{config:d.value,values:h,selected:p.selectedRows.includes(s(h)),onSelect:_=>u(s(h),_),onActivate:_=>l(s(h)),class:r.normalizeClass(p.classCallback?p.classCallback(h):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&p.activeRow===s(h)?(r.openBlock(),r.createBlock(at,{key:0,component:a.value,"row-length":p.config.length,values:h,onClose:E[1]||(E[1]=_=>i("update:activeRow",null)),onSave:c,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),p.activeRow===r.unref(S).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(at,{key:0,component:a.value,"row-length":d.value.length,onClose:E[2]||(E[2]=h=>i("update:activeRow",null)),onSave:c,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),fe=U(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))}}),[["__scopeId","data-v-0ef9ae88"]]),Bn={class:"widget-button"},Fn=U(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(fe,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(t.$slots,"default",{},void 0,!0)]))}}),[["__scopeId","data-v-450dc564"]]),Pn={class:"widget-multi-button-wrap position_relative cursor_pointer"},Dn={class:"widget-multi-button-body grid"},Vn=["onClick"],Mn={class:"widget-multi-button-side-wrap"},xn=U(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",Dn,[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:d=>{o(l.callback),a(!1)}},r.toDisplayString(l.label),9,Vn))),128))]),r.createElementVNode("div",Mn,[r.createElementVNode("div",{class:r.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:u[1]||(u[1]=l=>a())},[n.wait?(r.openBlock(),r.createBlock(r.unref(fe),{key:0,class:"widget-multi-button-side-spinner"})):s.array.length>1?(r.openBlock(),r.createBlock(r.unref(ce),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),[["__scopeId","data-v-d43a76ce"]]),Un={class:"widget-loader flex flex-align_center gap_10 padding_15"},Wn={class:"text_md"},qn=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",Un,[r.createVNode(fe,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Wn,r.toDisplayString(t.label),1)]))}}),jn=["alt","src"],Gn=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,jn))}}),zn=U({props:{config:Array,values:Object,selected:Boolean},setup:De},[["__scopeId","data-v-344a8cc1"]]),Hn=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),Xn={class:"widget-list-head-cell"},Jn=Hn(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Yn=U(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",Xn,[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(v.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(ce),{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),Jn])]))}}),[["__scopeId","data-v-bf495d6a"]]),Kn=U(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,T){let _=-1;do _++,T-=h[_];while(T>0&&_<h.length);return _}function d(h,T){let _=0;for(;T>0&&T>h[_]&&_<h.length;)T-=h[_],_++;return console.log(T,_),_>0?_:0}function m(h){try{a.value.style.insetInlineStart=h+"px"}catch(T){console.log(T)}}function p(h){try{a.value.style.width=h+"px",a.value.style.minWidth=h+"px",a.value.style.maxWidth=h+"px"}catch(T){console.log(T)}}function E(h){return h===null?!1:h.classList.contains("head-cell-resize")}o.value.addEventListener("pointerdown",function(T){var B;function _(V){return V.screenX+k-D}const y=o.value,b=[...y.children].filter(V=>V.localName==="th"),k=((B=y.offsetParent)==null?void 0:B.scrollLeft)||0,A=b.map(V=>V.clientWidth),P=E(T.target),D=y.getBoundingClientRect().left,g=_(T),w=c(A,g),C=A.slice(0,w).reduce((V,q)=>V+q,0),I=g-C,L=y.offsetWidth,H=b[w].clientWidth;if(n.config[w].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",T.screenX),console.log("Widths",A),console.log("max width",L),console.log("Start Position",g),console.log("Position From",w),console.log("Start Position",w),console.log("Global offset (Отступ самой таблицы от края экрана)",D),console.log("Del",I),console.groupEnd(),a.value.innerText=b[w].textContent||"",a.value.style.display="grid",a.value.style.width=H+"px",a.value.style.cursor="grabbing",m(C),p(H),document.addEventListener("pointermove",G,{passive:!0}),document.addEventListener("pointerup",te);function te(V){if(console.group("END"),document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",te),P&&(n.config[w].width=a.value.style.width,n.config[w].minWidth=a.value.style.width,n.config[w].maxWidth=a.value.style.width,s(n.config)),!P){const q=V.screenX+k-D;console.log("ENP Position",q);const $e=d(A,q);if(console.log(w,"->",$e),$e!==w){const be=n.config[w],Ze=n.config;Ze.splice(w,1),Ze.splice($e,0,be),s(Ze)}else{const be=n.config[w].name;u(be)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function G(V){if(P){const be=_(V)-g+H;p(be);return}let q=V.screenX+k-D-I;q<0&&(q=0),q+H>L&&(q=L-H),m(q)}})});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 d=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([c,d==="asc"?"desc":"asc"])}function l(c){i("update:order",c)}return(c,d)=>(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,p)=>(r.openBlock(),r.createBlock(Yn,r.mergeProps({key:m,ref_for:!0},m,{onOrder:E=>u(m.name),onSelect:d[0]||(d[0]=E=>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))}}),[["__scopeId","data-v-ccffc6bd"]]),Qn={class:"widget-list"},Zn={class:"widget-list-body position_relative"},er=50,tr=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 d=[...n.selectedRows],m=d.indexOf(l);m===-1?d.push(l):d==null||d.splice(m,1),s(d)}}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+er>c.scrollHeight&&i("scrollEnd")}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[r.createElementVNode("table",Qn,[r.createElementVNode("thead",null,[r.createVNode(Kn,{onSelect:c[0]||(c[0]=d=>a()),"onUpdate:order":c[1]||(c[1]=d=>i("update:order",d)),"onUpdate:config":c[2]||(c[2]=d=>i("update:config",d)),config:l.config,order:l.order},null,8,["config","order"])]),r.createElementVNode("tbody",Zn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(d,m)=>{var p;return r.openBlock(),r.createBlock(zn,{key:m,class:"widget-list-row",values:d,config:l.config,selected:(p=l.selectedRows)==null?void 0:p.includes(d),onSelect:E=>o(d,E)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function Ve(){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(S.VISIBLE_ITEM_PROVIDE_NAME,{show(s){n[s]=!0},hide(s){n[s]=!1},remove(s){delete n[s]}});const i=r.inject(S.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 nr=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{}},setup(e){const t=e,n=Re(),i=Xe(),o=r.computed(()=>{var T,_;const p=l.value,E=c(p),h={type:E,disabled:!((T=u.value)!=null&&T.canSet),label:t.label};return p&&Object.assign(h,{suffix:E==="number"?p.valueUnit:void 0,required:s.includes(E||"")?!1:p.required,label:t.label||p.displayName}),Object.assign(h,((_=N.fieldParamsHandler)==null?void 0:_.call(N,p,u.value,h))||{}),h}),a=["MultiText","MultiWideText"],s=["switch","single-checkbox","single-radio"],u=r.computed(()=>{var p;return(p=i==null?void 0:i.value)==null?void 0:p.fields[t.name]}),l=r.computed(()=>{if(!n.value)return;const p=n.value.fieldsByName[t.name];if(p)return p});function c(p){if(typeof t.type=="string"&&t.type.length!==0)return t.type;if(p){if(p.type==="Reference"||p.type==="Owned")return p.referencedEntity;if(p.dataType==="Boolean")return"single-checkbox";if(p.dataType==="DateTime")return"date";if(p.dataType==="Integer"||p.dataType==="Decimal")return"number";if(p.dataType==="List")return p.aggregatedEntity;if(a.includes(p.presentationType))return"textarea";if(p.presentationType==="PhoneNumber")return"tel"}return"text"}const d=r.computed(()=>{var p;return((p=u.value)==null?void 0:p.canGet)===!0}),{controller:m}=Ve();return r.watch(()=>d.value,p=>p?m.show():m.hide(),{immediate:!0}),r.onUnmounted(()=>m.remove()),(p,E)=>d.value?(r.openBlock(),r.createBlock(r.unref(v.FormField),r.mergeProps({key:0},{...p.$attrs,...o.value},{name:p.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function rr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||S.DEFAULT_ORDER_DIR}const ir=["fill"],or=[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)],ar=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},or,8,ir))}}),sr={class:"widget-fast-table-head-cell-td"},lr={class:"widget-head-cell-label"},cr={key:0,class:"widget-head-cell-order"},ct=U(r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{}},setup(e){const t=e,n=r.computed(()=>Be(t.name));return r.computed(()=>rr(t.order)),(i,o)=>{var a;return r.openBlock(),r.createElementBlock("td",sr,[r.createElementVNode("div",{class:"widget-head-cell",onClick:o[0]||(o[0]=s=>i.$emit("order",i.name))},[r.createElementVNode("span",lr,r.toDisplayString(i.label),1),n.value===((a=i.order)==null?void 0:a[0])?(r.openBlock(),r.createElementBlock("div",cr,[r.createVNode(ar,{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)])])}}}),[["__scopeId","data-v-9db5d417"]]),fr=["fill"],ur=[r.createElementVNode("path",{d:"M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z"},null,-1)],dr=r.defineComponent({__name:"widget-icon-keyboard-arrow-down",props:{color:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:t.color},ur,8,fr))}}),pr={class:"widget-filter-item-popup"},ft=U(r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filterItem:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,i=t,o=N.tableFilterEntityBind,a=r.ref(),s=r.computed(()=>{const E=n.filterItem;return E.entity?"Entity":E.type?E.type:null});function u(E){l.value=E==="start"}const l=r.ref(!1),c=r.computed(()=>Array.isArray(n.values)||typeof n.values=="string"?n.values.length>0:!!n.values),d=r.ref(!1);let m=null;function p(E=!d.value){d.value=E,!d.value&&m?(m(),m=null):a.value&&(m=v.utils.clickOutside(a.value,p.bind(null,!1)))}return(E,h)=>{var T;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:"widget-filter-item",onClick:h[0]||(h[0]=()=>p())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":c.value}])},r.toDisplayString(E.filterItem.label||"--"),3),l.value?(r.openBlock(),r.createBlock(fe,{key:0})):(r.openBlock(),r.createBlock(dr,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":d.value})},null,8,["class"]))]),r.withDirectives(r.createElementVNode("div",pr,[s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((T=r.unref(o))==null?void 0:T[s.value]),{key:0,"field-metadata":E.filterItem,values:E.values,"onUpdate:values":h[1]||(h[1]=_=>i("update:values",_)),onReadProcess:u},null,40,["field-metadata","values"])):r.createCommentVNode("",!0)],512),[[r.vShow,d.value]])],512)}}}),[["__scopeId","data-v-5b9128bc"]]),gr={class:"widget-table-panel-filter flex"},mr=U(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",gr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(u,l)=>{var c;return r.openBlock(),r.createBlock(ft,{key:l,entity:a.entity,"filter-item":u,values:(c=a.filters)==null?void 0:c[r.unref(me)(u)],"onUpdate:values":d=>o(r.unref(me)(u),d)},null,8,["entity","filter-item","values","onUpdate:values"])}),128))]))}}),[["__scopeId","data-v-f1534314"]]),hr={class:"es-grid es-gap-15"},yr={key:0,class:"title-md color-primary margin-0"},wr={key:0,class:"widget-table-loader es-flex es-gap-10 es-flex-align-center es-padding-10 text-main"},br=r.createElementVNode("span",null,"Loading...",-1),Er={class:"widget-fast-table-tools es-flex es-gap-15"},_r={class:""},kr=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{}},setup(e){const t=e,n=ae.useRouter(),i=r.ref([]),o=r.ref(null),a=r.ref(null),s=r.ref(null),u=v.Form.getParentForm();Re(t.entity);const{state:l,update:c}=Xe(t.entity,{masterEntities:t.masterEntities||[]}),d=(t.actions||[]).map(g=>bt(g)),m=r.computed(()=>o.value?xt(t.entity,o.value.config):[]),p=r.computed(()=>{var g;return((g=o.value)==null?void 0:g.displayItem)||He.inline}),E=r.computed(()=>{var g;return((g=o.value)==null?void 0:g.newItem)||p.value}),h=ke(async()=>{try{await _.call(),await c()}catch(g){const{message:w}=xe(g);a.value=w}});u instanceof v.Form&&u.subscribe({read:h.call.bind(null),name:t.entity,type:"table"}),r.onMounted(()=>{T.call(),h.call()});const T=ke(async function(){const w=t.entity;o.value=await mt(w,t.mark)}),_=ke(async function(){var C,I,L;const w=t.entity;a.value=null,T.promise&&await T.promise,i.value=(await ue(w,{customFilters:((C=o.value)==null?void 0:C.customFilters)||[],fields:dt(m.value).join(" "),order:((I=o.value)==null?void 0:I.order)||[],filter:$.and($(D.value),$(t.binding||{}),$(((L=o.value)==null?void 0:L.prefilters)||{}))})).map(Xi)});async function y(g){var C;if(g===null)return s.value=null;const w=g==null?void 0:g.Id;if(!w&&((C=o.value)!=null&&C.linkNew))return n.push(o.value.linkNew);if(p.value==="form")return n.push(ze(t.entity,w));if(p.value==="inline")return s.value=g||S.LIST_ACTIVE_NEW;p.value==="modal"?(await ne.promptModal("form",{entity:t.entity,id:w}),await _.call()):s.value=S.LIST_ACTIVE_NEW}const{controller:b}=Ve();r.watch(()=>l.value,g=>{g&&(g.canRead?b.show():b.hide())},{immediate:!0}),r.onUnmounted(()=>b.remove());const k=[{icon:"reload",label:"Reload",callback(){h.call()}}];let A=[we.on("affected-entity",g=>{g.name===t.entity&&_.call()}),we.on("display-entity",async g=>{g.name===t.entity&&(_.promise&&await _.promise,s.value=i.value.find(w=>w.Id===g.id)||null)})];r.onUnmounted(()=>A.map(g=>g()));function P(g){var te;function w(G){return Array.isArray(G)?w(G[0]):typeof G!="string"?null:G}const C=w(g);if(!C)return;const I=((te=o.value)==null?void 0:te.order)||[];(G=>{if(o.value)return o.value.order=G,!0})(I[0]!==C?[C,"asc"]:I[1]==="desc"?[]:[C,"desc"])&&_.call()}const D=r.ref({});return r.watch(()=>D.value,()=>_.call()),(g,w)=>{var L,H,te,G;const C=r.resolveComponent("widget-button"),I=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",hr,[(L=o.value)!=null&&L.label?(r.openBlock(),r.createElementBlock("p",yr,r.toDisplayString((H=o.value)==null?void 0:H.label),1)):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"slide-up"},{default:r.withCtx(()=>[r.unref(h).wait||r.unref(T).wait||r.unref(_).wait?(r.openBlock(),r.createElementBlock("div",wr,[r.createVNode(r.unref(fe),{color:"var(--color-primary)"}),br])):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("div",Er,[E.value==="form"||(te=r.unref(l))!=null&&te.canCreate?(r.openBlock(),r.createBlock(C,{key:0,callback:y,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(d).filter(B=>!!B.value),B=>{var V;return r.openBlock(),r.createBlock(C,{callback:(V=B.value)==null?void 0:V.callback,type:"primary"},{default:r.withCtx(()=>{var q;return[r.createTextVNode(r.toDisplayString((q=B.value)==null?void 0:q.label),1)]}),_:2},1032,["callback"])}),256)),(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(k,B=>r.createVNode(C,{onClick:()=>B.callback,callback:B.callback},{default:r.withCtx(()=>[r.createVNode(ce,null,{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(B.icon),1)]),_:2},1024),r.createElementVNode("span",null,r.toDisplayString(B.label),1)]),_:2},1032,["onClick","callback"])),64))]),r.createElementVNode("div",_r,[r.createVNode(mr,{entity:g.entity,"filters-config":((G=o.value)==null?void 0:G.filters)||[],filters:D.value,"onUpdate:filters":w[0]||(w[0]=B=>D.value=B)},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(lt),{config:m.value,array:i.value,"active-row":s.value,"onUpdate:activeRow":y,onOrder:P,class:"table"},{"head-cell":r.withCtx(B=>{var V;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.$slots["head-cell"]?g.$slots["head-cell"]:ct),r.mergeProps({label:B.label},B,{onOrder:P,order:((V=o.value)==null?void 0:V.order)||[]}),null,16,["label","order"]))]}),default:r.withCtx(()=>{var B;return[r.createVNode(I,{entity:g.entity,id:(B=s.value)==null?void 0:B.Id,"master-entities":g.masterEntities||void 0,binding:g.binding,onFormUpdate:w[1]||(w[1]=()=>{s.value=null,r.unref(_).call()})},null,8,["entity","id","master-entities","binding"])]}),_:1},8,["config","array","active-row"])])])}}});function ut(e){return Me(e,"YYYY/MM/DD HH:mm:ss")}function Me(e,t="YYYY/MM/DD"){if(!e)return"";try{const n=new Date(e);return en.format(n,t)}catch(n){return console.log(n),"Invalid date"}}function ke(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 xe(e){return typeof e=="string"?Te(e):Tr(e)?Te(e.message,e.children||e.details||[]):Cr(e)?Te(e.title,[e.detail||""]):Te(S.DEFAULT_ERROR_MESSAGE)}function Tr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Cr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function Te(e,t=[]){return{message:e,children:t}}function M(e="error"){return function(t){const{message:n,children:i}=xe(t);Je.add(e,n,{children:i})}}function ue(e,t={}){return F().emit("entity:read",{...t,entity:e})}function Ue(e,t){return F().emit("entity:update",{...t,entity:e})}function dt(e){return e.reduce((t,n)=>(n.name&&(typeof n.name=="string"?t.push(n.name):t.push(...n.name)),t),[])}function pt(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 Ar(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 Sr(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function vr(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return S.DEFAULT_ERROR_MESSAGE}})}function W(e,t={}){return z.isFront&&(t.headers||(t.headers={}),t.headers["Context-Id"]=z.contextId),t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.reload():n).catch(()=>{throw new Error(S.DEFAULT_ERROR_MESSAGE)}).then(n=>vr(n).then(i=>{if(!n.ok)throw i;return i}))}function Ir(e,t=1e3){let n=0;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>e(...i),t)}}function Nr(e,t){let n=!1;return(...i)=>{if(!n)return n=!0,setTimeout(()=>n=!1,t),e(...i)}}const Rr=Ee(_e("pretty-value-field-by-entity"));function Or(e,t,n){try{const i=Oe.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 Rr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',i,e,t,n),n}}const re=Ee(_e("use-socket"));function F(){return $r}function Lr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const $r=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()},_n*2);const y=new Uint8Array(1);y[0]=En,t.send(y)}setInterval(()=>{Array.from(i).forEach(y=>{_(y)&&(re("Handler for event %s requestId %d was expired",y.event,y.requestId),y.requestId?l({requestId:y.requestId,event:rt,data:{message:Q.RequestTookToLong().message}}):i.delete(y))})},1e3),setInterval(()=>{(!t||t.readyState===3)&&c()},S.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:a,requestId:e,handlers:i,socketInstance:t}}function l(y){const b=[...i.values()];re("Handlers array length is %d. Response event: %s. Request id: %d",i.size,y.event,y.requestId),b.forEach(k=>{const A=y.requestId;(k.requestId&&k.requestId===A||!k.requestId&&k.event===y.event)&&(re("Find appropriated handler: %d, event: %s",e,k.event),k.callback(y.data,y),k.once&&(i.delete(k),re("Handler was removed by *once* params was passed. %o",k)))})}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(y){re("Connection to server was stopped: %d %s",y.code,y.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(y=>{d(y),a.delete(y)})},t.onerror=function(y){console.warn(y)},t.onmessage=y=>{var b;try{if(Lr(y.data)){s();return}const k=JSON.parse(y.data);if(!gt(k)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(k);return}(b=k==null?void 0:k.data)!=null&&b.refresh&&location.reload(),l(k)}catch(k){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(k)}}}function d(y){t.send(y)}function m(y,b){T({event:y,callback:b})}function p(y,b){T({event:y,callback:b,once:!0})}function E(){return t&&(t==null?void 0:t.readyState)===1}function h(y,b,k){const A=++e,P=JSON.stringify({requestId:A,event:y,data:b,contextId:z.contextId,url:N.socketURLHandler?N.socketURLHandler():window.location.href});return E()?d(P):(a.add(P),re("Socket is not connected. Message was send to save-queue")),new Promise((D,g)=>{T({event:y,requestId:A,once:!0,guaranteedAnswer:!0,serializeString:P,callback:(w,C)=>{if(re("Promise was resolve with next data:",w),Br(C))return void g(w);k&&k(w,C),D(w)},timeToLive:S.TIME_TO_LIVE_SOCKET_REQUEST})})}function T(y){const b={timeToLive:0,...y,created:new Date().getTime()};i.add(b)}function _(y){return y.timeToLive===0||typeof y.timeToLive!="number"?!1:new Date().getTime()-y.created>y.timeToLive}return{get socket(){return t},on:m,once:p,emit:h,initialization(y){n=y},getDevInfo:u}}(),Br=e=>!!gt(e)&&e.event===rt,gt=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function mt(e,t){return F().emit("list-setting:read",{entity:e,mark:t})}function Fr(e,t){return F().emit("metadata-field:treat",{entity:e,fieldName:t})}function ht(e,t){return F().emit("entity:create",{...t,entity:e})}function yt(e,t){return F().emit("entity:delete",{...t,entity:e})}function Pr(e,t){return F().emit("usage-context:read",{...t,entity:e})}function wt(e={}){return F().emit("tool:read",e)}function Dr(){return F().emit("metadata-list:read",{})}function bt(e,t={},n={}){const i=r.inject(S.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 Vr(e){return F().emit("history:read",e)}function Mr(e,t){return F().emit("entity:count",{...t,entity:e})}function xr(e){return`/${kn}/${e}`}function de(e){return{exec(t,n){switch(e.name){case"replace-boolean":return de.replaceBoolean(t,e.values);case"replace-record-operation":return de.replaceRecordOperation(t)}}}}de.replaceBoolean=Ur,de.replaceRecordOperation=Wr;function Ur(e,t){return typeof e!="boolean"?"":e?t[1]:t[0]}function Wr(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function qr(e={}){return F().emit("tool:execute",e)}const jr=Ee(_e("wrap-tool-response"));function Et(e,t){return e.handleConfirmation===void 0&&(e.handleConfirmation=Hr),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=Jr),e.handleCloseForm===void 0&&(e.handleCloseForm=Yr),e.handleValidationResult===void 0&&(e.handleValidationResult=Xr),{...t,label:t.title,callback(){var o;const n=typeof e.values=="function"?e.values(t,e):e.values,i=()=>qr({name:t.name,values:n,usageContext:t.usageContext}).then(async a=>{var s,u;if(!Gr(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&&Je.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(M("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 Gr(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function zr(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 Hr(e,t){const n=zr(e.confirmation);if(!ne.getComponentFromStore(S.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await ne.promptModal(S.MODAL_CONFIRM,{message:n}))return t()}function Xr(e,t){const n=S.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 Jr(e,t,n){var l;function i(c){return c!==null&&typeof c=="object"&&typeof c.read=="function"}function o(c,d){c&&(jr("Affected Entity %s. Find form with name %s.",d,c.name),c.name===d&&i(c)&&c.read(),c instanceof v.Form&&c.dependencies.forEach(m=>o(m,d)))}we.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){we.emit("display-entity",{id:u,name:t.name}),N.getEntityLink&&a.push(N.getEntityLink(t.name,u));return}o(s,t.name)}function Yr(e,t){const{router:n}=t;n&&e.closeHostForm&&n.back()}let ie={};function Z(e,...t){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let n=v.utils.getPropFromObject((this==null?void 0:this.vocabulary)||ie,e);if(typeof n=="string")return _t(n,t);const i=v.utils.getPropFromObject(ie==null?void 0:ie.root,e);return typeof i=="string"?_t(i,t):(typeof n===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function _t(e,t){return t.forEach((n,i)=>{e=e.replaceAll(new RegExp(`\\{${i}}`,"g"),n)}),e}Z.setGlobalVocabulary=function(e){ie=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:v.utils.getPropFromObject(ie,t.toLowerCase())})},Z.setVocabulary=function(e){return typeof e=="string"&&(e=v.utils.getPropFromObject(ie,e)),Z.bind({vocabulary:e})};function Kr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var We={exports:{}},O={},qe={exports:{}},oe={};function kt(){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 Qr(e,t,n){}function Zr(e,t,n){}var ei=/javascript\s*\:/img;function ti(e,t){return ei.test(t)?"":t}oe.whiteList=kt(),oe.getDefaultWhiteList=kt,oe.onAttr=Qr,oe.onIgnoreAttr=Zr,oe.safeAttrValue=ti;var ni={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,"")}},he=ni;function ri(e,t){e=he.trimRight(e),e[e.length-1]!==";"&&(e+=";");var n=e.length,i=!1,o=0,a=0,s="";function u(){if(!i){var d=he.trim(e.slice(o,a)),m=d.indexOf(":");if(m!==-1){var p=he.trim(d.slice(0,m)),E=he.trim(d.slice(m+1));if(p){var h=t(o,s.length,p,E,d);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===`
6
+ Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(t,n){return!t&&!n?R.ApiNotAvailable():new R(t||"Authorization Error",n)}static ApiResponseParseFailed(){return R.ApiNotAvailable()}static MissingIdInValuesEntity(t){return new R("Object doesn't have id",t)}static ObjectWithIdNotFound(t,n){return new R(`Can't find object with id: ${t}`,n)}static ObjectWithoutConnectToPresentArray(t,n){return new R("Object is not found.",{object:t,array:n})}static EntityWithoutId(t){return new R("Entity doesn't have id.",t)}static NotFoundedTableIndex(t,n){return new R(`Can't find the element with tableIndex ${t}`,n)}static UndefinedError(t,n=[]){return new R(t,n)}static TableArrayAlreadyIncludeProvidedIndexValue(t,n,i){return new R(`Array already includes the element with value ${t}`,{array:n,table:i})}static MetadataEntityIsNotAvailable(t){return new R(`Metadata for the ${t} is not currently available.`)}static RequestTookToLong(){return new R("The request took too long to complete. Try again later.")}};R.ID=0;let Q=R;const tn="Please try again later or submit a feedback if problem doesn't go.";function nn(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return tn}})}function Y(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=>nn(n).then(i=>{if(!n.ok)throw i;return i}))}class rn{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 rn;function tt(e){return{...e,createdEntities:e.createdEntites}}const pe=class pe{static async getStartConfig(t,n){return Y([pe.url,t,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(t,n){return Y([pe.url,t,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(tt)}static async runStep(t,n,i,o,a){return Y([pe.url,t,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:i,token:o,values:a})}).then(tt)}};pe.url="/close-api/views/process-wizard";let se=pe;var x=(e=>(e.Completed="Completed",e.FinalStep="FinalStep",e.NextStep="NextStep",e.FinalStepWithConfirmation="FinalStepWithConfirmation",e.NextStepWithConfirmation="NextStepWithConfirmation",e.ValidationError="ValidationError",e.Undefined="Undefined",e))(x||{});class on{static invite(t,n,i){return Y("/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 Y("/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 Y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:t,version:n,mark:!1})})}}class an{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 le{static url(){return"close-api/billing"}static getBillingMetadata(t){return fetch(`/${le.url()}/calculator/${t}`)}static calculate(t,n){return Y(`/${le.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 Y(`/${le.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:t,returnURL:n})})}static applyOnlinePayment(t){return Y(`/${le.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:t})})}}function sn(e){return e.statusName===x.Completed}function ln(e){return[x.FinalStepWithConfirmation,x.NextStepWithConfirmation].includes(e.statusName)}function cn(e){return e.statusName===x.ValidationError}function fn(e){return e.statusName===x.Undefined}function un(e,t,n){let i=null,o=[];const a=r.ref(!1),s=r.ref(null),u=r.computed(()=>m(o,s.value)),l=r.ref(null),c=r.reactive([]),d=r.computed(()=>c.map(b=>m(o,b)));function m(b,k){return b.find(A=>A.name===k)||null}async function p(b){var k;if(fn(b)){await n.onDisplayDataSet(b);return}if(!(ln(b)&&!await n.onDisplayDataSet(b))){if(cn(b))return void n.onValidation(b.validationResults);T(b),await r.nextTick();{const A=((k=m(o,s.value))==null?void 0:k.fields)||[];if([x.FinalStep,x.NextStep].includes(b.statusName)&&(!A.length||dn(A,n.presets)))return y(n.presets||{})}sn(b)&&n.onCompleted(b)}}async function E(){try{await h(),await _()}catch(b){M("error")(b)}}function h(){return a.value="Loading process information.",se.getStartConfig(t,e).then(b=>(l.value={label:b.processTitle,info:b.processInfo,icon:b.processIcon},o=b.steps.map(k=>{const A=k.frontendEntity.rootObject,P=Object.fromEntries(k.frontendEntity.objectTypes.map(D=>[D.name,D.properties]));return{label:k.title,name:k.stepName,number:k.number,rootObjectName:A,objectTypes:P,fields:P[A],buttonCaption:k.buttonCaption}}))).finally(()=>{a.value=!1})}function T(b){return[x.FinalStepWithConfirmation,x.NextStepWithConfirmation,x.NextStep,x.Completed,x.FinalStep].includes(b.statusName)&&(i=b.token,s.value=b.nextStepName),b}function _(){return a.value="Starting process",se.startProcess(t,e).then(p).catch(M("error")).finally(()=>{a.value=null})}function y(b={}){const k=s.value;return!i||!k?Promise.reject("Not step or token."):(a.value="Waiting for result...",se.runStep(t,e,k,i,b).then(p).then(A=>(c.push(k),A)).catch(M("error")).finally(()=>{a.value=!1}))}return{initialize:E,loading:a,currentStepConfig:u,currentStepName:s,arrayPassedSteps:d,arrayProcessStepName:c,processInfo:l,next:y}}function dn(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(!v.utils.getPropFromObject(t,i.name))return!1}return!0}const pn={class:"widget-table__head-cell"},gn={class:"widget-table__head-label margin_0 text_overflow"},nt=r.defineComponent({__name:"widget-table-head-cell",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("th",pn,[r.createElementVNode("span",gn,r.toDisplayString(t.label),1)]))}}),mn={class:"widget-table__head"},hn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>N.componentTableHeadCell||nt),(t,n)=>(r.openBlock(),r.createElementBlock("tr",mn,[(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))]))}}),U=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},yn=U(hn,[["__scopeId","data-v-498c4f00"]]);function Be(e){return Array.isArray(e)?Be(e[0]):typeof e!="string"?null:e}function me(e){return Be(e.name)}function wn(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 bn(e,t){return wn(e).forEach(i=>{e=e.replace(new RegExp("\\$\\{"+i+"}","g"),v.utils.getPropFromObject(t,i))}),e}function Fe(e){return t=>typeof t=="string"||typeof t=="number"?`${t} ${e}`:""}function Pe(e,t){const n=me(e);if(typeof e.value=="string")return bn(e.value,t);let i=n?v.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=Fe(e.unitValue)(i)),e.unit&&(i=Fe(e.unit)(i)),e.type)switch(e.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Me(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=ut(typeof i=="string"?i:null);break}case"money":{i=pt(i);break}}return e.formatter&&(i=de(e.formatter).exec(i,t)),typeof i=="boolean"&&(i=i?"✓":"—"),i}const En=1,_n=5e3,kn="static-folder",rt="request-error",it="Distinguisher",S={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:it};function _e(e){return[S.CORE_DEBUG_LABEL,e].join(":")}const Tn={class:"widget-filter-text flex gap_20"},Cn=U(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",Tn,[r.createVNode(r.unref(v.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})])}}}),[["__scopeId","data-v-800b3803"]]),An={class:"widget-filter-enum"},N={getEntityLink(e,t){return`/forms/${e}/${t}`},iconHandlerText(){return""},iconTag:"i",tableFilterEntityBind:{String:Cn,Entity:U(r.defineComponent({__name:"widget-filter-entity",props:{values:{},fieldMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:t}){const n=e,i=r.ref([]),o=Re(n.fieldMetadata.entity),a=c=>(n.values||[]).includes(c),s=t;function u(c){const d=n.values||[];return d.includes(c)?s("update:values",d.filter(m=>m!==c)):s("update:values",[...d,c])}async function l(){var m;if(!((m=n.fieldMetadata)!=null&&m.entity)||!o.value)return;const c=o.value.fieldNameForLabel,d=o.value.fieldNameForIdentification;s("readProcess","start"),i.value=await ue(n.fieldMetadata.entity,{fields:[c,d].join(" "),order:[c,"asc"]}).then(p=>(s("readProcess","end"),p.map(E=>({label:E[c],value:E[d]}))))}return r.watch(()=>o.value,l,{immediate:!0}),(c,d)=>(r.openBlock(),r.createElementBlock("div",An,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,m=>(r.openBlock(),r.createBlock(r.unref(v.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))]))}}),[["__scopeId","data-v-cf143196"]])}};function Sn(e){for(let t in e)N[t]=e[t]}const ce=U({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(N.iconTag,{class:N.iconHandler?N.iconHandler(n):`icon icon-${n}`},N.iconHandlerText(n))}},[["__scopeId","data-v-8a72b45f"]]),vn=Ee(_e("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=Pe(e,i);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function s(d){a.onClick.push(()=>d(i,e,n))}function u(d){Array.isArray(d)?a.class.push(...d):a.class.push(d)}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(v.FormField,{type:"single-checkbox",modelValue:t.selected})),s(ot.bind(null,n,!0));break}case"select":{c.push(r.h(v.FormField,{type:"single-radio",modelValue:t.selected})),s(ot.bind(null,n,!1));break}}if(e.onClick&&s(e.onClick),e.link)try{const d=e.link(i);if(d){const m=r.h(ae.RouterLink,{to:d});c.push(m),u("widget-table-cell_link")}}catch(d){vn("Can't add router link",d)}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(ce,{name:e.icon})),typeof e.icon=="function")){const d=e.icon(i);d!==null&&c.push(r.h(ce,{name:d}))}return e.class&&(typeof e.class=="function"?u(e.class(i)):u(e.class)),N.listCellHandler&&N.listCellHandler(e,i,{cellNodeChildren:c,addClass:u,addHandleClick:s,context:n}),l.push(r.h("td",a,c)),l}function ot(e,t){e.emit("select",t)}function De(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:De},On=["colspan"],at=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,On)],512))}}),Ln={class:"widget-table"},st="update:selectedRows",$n="update:activeRow",lt=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 p;return(p=o==null?void 0:o.default)==null?void 0:p.call(o)[0]});function s(p){return n.useMockField?Wt(p):p}function u(p,E=!0){if(!n.selectedRows)return;if(!E)return i(st,n.selectedRows.includes(p)?[]:[p]);const h=[...n.selectedRows],T=h.indexOf(p);return T===-1?h.push(p):h.splice(T,1),i(st,h)}function l(p){i($n,p)}function c(p){i("save",p),i("update:activeRow",null)}const d=r.computed(()=>n.shortcut?n.config.filter(p=>p.name?!!n.array.find(h=>![null,""].includes(Pe(p,h))):!0):n.config),m=r.computed(()=>n.useMockField?n.array.filter(Wt):n.array);return(p,E)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Ln,[r.createElementVNode("thead",null,[r.createVNode(yn,{config:d.value,onOrder:E[0]||(E[0]=h=>p.$emit("order",h))},{default:r.withCtx(h=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.$slots["head-cell"]||nt),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,T)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:T},[r.createVNode(Rn,{config:d.value,values:h,selected:p.selectedRows.includes(s(h)),onSelect:_=>u(s(h),_),onActivate:_=>l(s(h)),class:r.normalizeClass(p.classCallback?p.classCallback(h):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&p.activeRow===s(h)?(r.openBlock(),r.createBlock(at,{key:0,component:a.value,"row-length":p.config.length,values:h,onClose:E[1]||(E[1]=_=>i("update:activeRow",null)),onSave:c,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),p.activeRow===r.unref(S).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(at,{key:0,component:a.value,"row-length":d.value.length,onClose:E[2]||(E[2]=h=>i("update:activeRow",null)),onSave:c,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),fe=U(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))}}),[["__scopeId","data-v-0ef9ae88"]]),Bn={class:"widget-button"},Fn=U(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(fe,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(t.$slots,"default",{},void 0,!0)]))}}),[["__scopeId","data-v-450dc564"]]),Pn={class:"widget-multi-button-wrap position_relative cursor_pointer"},Dn={class:"widget-multi-button-body grid"},Vn=["onClick"],Mn={class:"widget-multi-button-side-wrap"},xn=U(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",Dn,[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:d=>{o(l.callback),a(!1)}},r.toDisplayString(l.label),9,Vn))),128))]),r.createElementVNode("div",Mn,[r.createElementVNode("div",{class:r.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:u[1]||(u[1]=l=>a())},[n.wait?(r.openBlock(),r.createBlock(r.unref(fe),{key:0,class:"widget-multi-button-side-spinner"})):s.array.length>1?(r.openBlock(),r.createBlock(r.unref(ce),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),[["__scopeId","data-v-d43a76ce"]]),Un={class:"widget-loader flex flex-align_center gap_10 padding_15"},Wn={class:"text_md"},qn=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",Un,[r.createVNode(fe,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Wn,r.toDisplayString(t.label),1)]))}}),jn=["alt","src"],Gn=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,jn))}}),zn=U({props:{config:Array,values:Object,selected:Boolean},setup:De},[["__scopeId","data-v-344a8cc1"]]),Hn=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),Xn={class:"widget-list-head-cell"},Jn=Hn(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Yn=U(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",Xn,[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(v.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(ce),{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),Jn])]))}}),[["__scopeId","data-v-bf495d6a"]]),Kn=U(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,T){let _=-1;do _++,T-=h[_];while(T>0&&_<h.length);return _}function d(h,T){let _=0;for(;T>0&&T>h[_]&&_<h.length;)T-=h[_],_++;return console.log(T,_),_>0?_:0}function m(h){try{a.value.style.insetInlineStart=h+"px"}catch(T){console.log(T)}}function p(h){try{a.value.style.width=h+"px",a.value.style.minWidth=h+"px",a.value.style.maxWidth=h+"px"}catch(T){console.log(T)}}function E(h){return h===null?!1:h.classList.contains("head-cell-resize")}o.value.addEventListener("pointerdown",function(T){var B;function _(V){return V.screenX+k-D}const y=o.value,b=[...y.children].filter(V=>V.localName==="th"),k=((B=y.offsetParent)==null?void 0:B.scrollLeft)||0,A=b.map(V=>V.clientWidth),P=E(T.target),D=y.getBoundingClientRect().left,g=_(T),w=c(A,g),C=A.slice(0,w).reduce((V,q)=>V+q,0),I=g-C,L=y.offsetWidth,H=b[w].clientWidth;if(n.config[w].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",T.screenX),console.log("Widths",A),console.log("max width",L),console.log("Start Position",g),console.log("Position From",w),console.log("Start Position",w),console.log("Global offset (Отступ самой таблицы от края экрана)",D),console.log("Del",I),console.groupEnd(),a.value.innerText=b[w].textContent||"",a.value.style.display="grid",a.value.style.width=H+"px",a.value.style.cursor="grabbing",m(C),p(H),document.addEventListener("pointermove",G,{passive:!0}),document.addEventListener("pointerup",te);function te(V){if(console.group("END"),document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",te),P&&(n.config[w].width=a.value.style.width,n.config[w].minWidth=a.value.style.width,n.config[w].maxWidth=a.value.style.width,s(n.config)),!P){const q=V.screenX+k-D;console.log("ENP Position",q);const $e=d(A,q);if(console.log(w,"->",$e),$e!==w){const be=n.config[w],Ze=n.config;Ze.splice(w,1),Ze.splice($e,0,be),s(Ze)}else{const be=n.config[w].name;u(be)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function G(V){if(P){const be=_(V)-g+H;p(be);return}let q=V.screenX+k-D-I;q<0&&(q=0),q+H>L&&(q=L-H),m(q)}})});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 d=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([c,d==="asc"?"desc":"asc"])}function l(c){i("update:order",c)}return(c,d)=>(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,p)=>(r.openBlock(),r.createBlock(Yn,r.mergeProps({key:m,ref_for:!0},m,{onOrder:E=>u(m.name),onSelect:d[0]||(d[0]=E=>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))}}),[["__scopeId","data-v-ccffc6bd"]]),Qn={class:"widget-list"},Zn={class:"widget-list-body position_relative"},er=50,tr=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 d=[...n.selectedRows],m=d.indexOf(l);m===-1?d.push(l):d==null||d.splice(m,1),s(d)}}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+er>c.scrollHeight&&i("scrollEnd")}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[r.createElementVNode("table",Qn,[r.createElementVNode("thead",null,[r.createVNode(Kn,{onSelect:c[0]||(c[0]=d=>a()),"onUpdate:order":c[1]||(c[1]=d=>i("update:order",d)),"onUpdate:config":c[2]||(c[2]=d=>i("update:config",d)),config:l.config,order:l.order},null,8,["config","order"])]),r.createElementVNode("tbody",Zn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(d,m)=>{var p;return r.openBlock(),r.createBlock(zn,{key:m,class:"widget-list-row",values:d,config:l.config,selected:(p=l.selectedRows)==null?void 0:p.includes(d),onSelect:E=>o(d,E)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function Ve(){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(S.VISIBLE_ITEM_PROVIDE_NAME,{show(s){n[s]=!0},hide(s){n[s]=!1},remove(s){delete n[s]}});const i=r.inject(S.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 nr=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{}},setup(e){const t=e,n=Re(),i=Xe(),o=r.computed(()=>{var T,_;const p=l.value,E=c(p),h={type:E,disabled:!((T=u.value)!=null&&T.canSet),label:t.label};return p&&Object.assign(h,{suffix:E==="number"?p.valueUnit:void 0,required:s.includes(E||"")?!1:p.required,label:t.label||p.displayName}),Object.assign(h,((_=N.fieldParamsHandler)==null?void 0:_.call(N,p,u.value,h))||{}),h}),a=["MultiText","MultiWideText"],s=["switch","single-checkbox","single-radio"],u=r.computed(()=>{var p;return(p=i==null?void 0:i.value)==null?void 0:p.fields[t.name]}),l=r.computed(()=>{if(!n.value)return;const p=n.value.fieldsByName[t.name];if(p)return p});function c(p){if(typeof t.type=="string"&&t.type.length!==0)return t.type;if(p){if(p.type==="Reference"||p.type==="Owned")return p.referencedEntity;if(p.dataType==="Boolean")return"single-checkbox";if(p.dataType==="DateTime")return"date";if(p.dataType==="Integer"||p.dataType==="Decimal")return"number";if(p.dataType==="List")return p.aggregatedEntity;if(a.includes(p.presentationType))return"textarea";if(p.presentationType==="PhoneNumber")return"tel"}return"text"}const d=r.computed(()=>{var p;return((p=u.value)==null?void 0:p.canGet)===!0}),{controller:m}=Ve();return r.watch(()=>d.value,p=>p?m.show():m.hide(),{immediate:!0}),r.onUnmounted(()=>m.remove()),(p,E)=>d.value?(r.openBlock(),r.createBlock(r.unref(v.FormField),r.mergeProps({key:0},{...p.$attrs,...o.value},{name:p.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function rr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||S.DEFAULT_ORDER_DIR}const ir=["fill"],or=[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)],ar=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},or,8,ir))}}),sr={class:"widget-fast-table-head-cell-td"},lr={class:"widget-head-cell-label"},cr={key:0,class:"widget-head-cell-order"},ct=U(r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{}},setup(e){const t=e,n=r.computed(()=>Be(t.name));return r.computed(()=>rr(t.order)),(i,o)=>{var a;return r.openBlock(),r.createElementBlock("td",sr,[r.createElementVNode("div",{class:"widget-head-cell",onClick:o[0]||(o[0]=s=>i.$emit("order",i.name))},[r.createElementVNode("span",lr,r.toDisplayString(i.label),1),n.value===((a=i.order)==null?void 0:a[0])?(r.openBlock(),r.createElementBlock("div",cr,[r.createVNode(ar,{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)])])}}}),[["__scopeId","data-v-9db5d417"]]),fr=["fill"],ur=[r.createElementVNode("path",{d:"M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z"},null,-1)],dr=r.defineComponent({__name:"widget-icon-keyboard-arrow-down",props:{color:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:t.color},ur,8,fr))}}),pr={class:"widget-filter-item-popup"},ft=U(r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filterItem:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,i=t,o=N.tableFilterEntityBind,a=r.ref(),s=r.computed(()=>{const E=n.filterItem;return E.entity?"Entity":E.type?E.type:null});function u(E){l.value=E==="start"}const l=r.ref(!1),c=r.computed(()=>Array.isArray(n.values)||typeof n.values=="string"?n.values.length>0:!!n.values),d=r.ref(!1);let m=null;function p(E=!d.value){d.value=E,!d.value&&m?(m(),m=null):a.value&&(m=v.utils.clickOutside(a.value,p.bind(null,!1)))}return(E,h)=>{var T;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:"widget-filter-item",onClick:h[0]||(h[0]=()=>p())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":c.value}])},r.toDisplayString(E.filterItem.label||"--"),3),l.value?(r.openBlock(),r.createBlock(fe,{key:0})):(r.openBlock(),r.createBlock(dr,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":d.value})},null,8,["class"]))]),r.withDirectives(r.createElementVNode("div",pr,[s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((T=r.unref(o))==null?void 0:T[s.value]),{key:0,"field-metadata":E.filterItem,values:E.values,"onUpdate:values":h[1]||(h[1]=_=>i("update:values",_)),onReadProcess:u},null,40,["field-metadata","values"])):r.createCommentVNode("",!0)],512),[[r.vShow,d.value]])],512)}}}),[["__scopeId","data-v-5b9128bc"]]),gr={class:"widget-table-panel-filter flex"},mr=U(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",gr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(u,l)=>{var c;return r.openBlock(),r.createBlock(ft,{key:l,entity:a.entity,"filter-item":u,values:(c=a.filters)==null?void 0:c[r.unref(me)(u)],"onUpdate:values":d=>o(r.unref(me)(u),d)},null,8,["entity","filter-item","values","onUpdate:values"])}),128))]))}}),[["__scopeId","data-v-f1534314"]]),hr={class:"es-grid es-gap-15"},yr={key:0,class:"title-md color-primary margin-0"},wr={key:0,class:"widget-table-loader es-flex es-gap-10 es-flex-align-center es-padding-10 text-main"},br=r.createElementVNode("span",null,"Loading...",-1),Er={class:"widget-fast-table-tools es-flex es-gap-15"},_r={class:""},kr=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{}},setup(e){const t=e,n=ae.useRouter(),i=r.ref([]),o=r.ref(null),a=r.ref(null),s=r.ref(null),u=v.Form.getParentForm();Re(t.entity);const{state:l,update:c}=Xe(t.entity,{masterEntities:t.masterEntities||[]}),d=(t.actions||[]).map(g=>bt(g)),m=r.computed(()=>o.value?xt(t.entity,o.value.config):[]),p=r.computed(()=>{var g;return((g=o.value)==null?void 0:g.displayItem)||He.inline}),E=r.computed(()=>{var g;return((g=o.value)==null?void 0:g.newItem)||p.value}),h=ke(async()=>{try{await _.call(),await c()}catch(g){const{message:w}=xe(g);a.value=w}});u instanceof v.Form&&u.subscribe({read:h.call.bind(null),name:t.entity,type:"table"}),r.onMounted(()=>{T.call(),h.call()});const T=ke(async function(){const w=t.entity;o.value=await mt(w,t.mark)}),_=ke(async function(){var C,I,L;const w=t.entity;a.value=null,T.promise&&await T.promise,console.log(o.value),i.value=(await ue(w,{customFilters:((C=o.value)==null?void 0:C.customFilters)||[],fields:dt(m.value).join(" "),order:((I=o.value)==null?void 0:I.order)||[],filter:$.and($(D.value),$(t.binding||{}),$(((L=o.value)==null?void 0:L.prefilters)||{}))})).map(Xi)});async function y(g){var C;if(g===null)return s.value=null;const w=g==null?void 0:g.Id;if(!w&&((C=o.value)!=null&&C.linkNew))return n.push(o.value.linkNew);if(p.value==="form")return n.push(ze(t.entity,w));if(p.value==="inline")return s.value=g||S.LIST_ACTIVE_NEW;p.value==="modal"?(await ne.promptModal("form",{entity:t.entity,id:w}),await _.call()):s.value=S.LIST_ACTIVE_NEW}const{controller:b}=Ve();r.watch(()=>l.value,g=>{g&&(g.canRead?b.show():b.hide())},{immediate:!0}),r.onUnmounted(()=>b.remove());const k=[{icon:"reload",label:"Reload",callback(){h.call()}}];let A=[we.on("affected-entity",g=>{g.name===t.entity&&_.call()}),we.on("display-entity",async g=>{g.name===t.entity&&(_.promise&&await _.promise,s.value=i.value.find(w=>w.Id===g.id)||null)})];r.onUnmounted(()=>A.map(g=>g()));function P(g){var te;function w(G){return Array.isArray(G)?w(G[0]):typeof G!="string"?null:G}const C=w(g);if(!C)return;const I=((te=o.value)==null?void 0:te.order)||[];(G=>{if(o.value)return o.value.order=G,!0})(I[0]!==C?[C,"asc"]:I[1]==="desc"?[]:[C,"desc"])&&_.call()}const D=r.ref({});return r.watch(()=>D.value,()=>_.call()),(g,w)=>{var L,H,te,G;const C=r.resolveComponent("widget-button"),I=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",hr,[(L=o.value)!=null&&L.label?(r.openBlock(),r.createElementBlock("p",yr,r.toDisplayString((H=o.value)==null?void 0:H.label),1)):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"slide-up"},{default:r.withCtx(()=>[r.unref(h).wait||r.unref(T).wait||r.unref(_).wait?(r.openBlock(),r.createElementBlock("div",wr,[r.createVNode(r.unref(fe),{color:"var(--color-primary)"}),br])):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("div",Er,[E.value==="form"||(te=r.unref(l))!=null&&te.canCreate?(r.openBlock(),r.createBlock(C,{key:0,callback:y,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(d).filter(B=>!!B.value),B=>{var V;return r.openBlock(),r.createBlock(C,{callback:(V=B.value)==null?void 0:V.callback,type:"primary"},{default:r.withCtx(()=>{var q;return[r.createTextVNode(r.toDisplayString((q=B.value)==null?void 0:q.label),1)]}),_:2},1032,["callback"])}),256)),(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(k,B=>r.createVNode(C,{onClick:()=>B.callback,callback:B.callback},{default:r.withCtx(()=>[r.createVNode(ce,null,{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(B.icon),1)]),_:2},1024),r.createElementVNode("span",null,r.toDisplayString(B.label),1)]),_:2},1032,["onClick","callback"])),64))]),r.createElementVNode("div",_r,[r.createVNode(mr,{entity:g.entity,"filters-config":((G=o.value)==null?void 0:G.filters)||[],filters:D.value,"onUpdate:filters":w[0]||(w[0]=B=>D.value=B)},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(lt),{config:m.value,array:i.value,"active-row":s.value,"onUpdate:activeRow":y,onOrder:P,class:"table"},{"head-cell":r.withCtx(B=>{var V;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.$slots["head-cell"]?g.$slots["head-cell"]:ct),r.mergeProps({label:B.label},B,{onOrder:P,order:((V=o.value)==null?void 0:V.order)||[]}),null,16,["label","order"]))]}),default:r.withCtx(()=>{var B;return[r.createVNode(I,{entity:g.entity,id:(B=s.value)==null?void 0:B.Id,"master-entities":g.masterEntities||void 0,binding:g.binding,onFormUpdate:w[1]||(w[1]=()=>{s.value=null,r.unref(_).call()})},null,8,["entity","id","master-entities","binding"])]}),_:1},8,["config","array","active-row"])])])}}});function ut(e){return Me(e,"YYYY/MM/DD HH:mm:ss")}function Me(e,t="YYYY/MM/DD"){if(!e)return"";try{const n=new Date(e);return en.format(n,t)}catch(n){return console.log(n),"Invalid date"}}function ke(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 xe(e){return typeof e=="string"?Te(e):Tr(e)?Te(e.message,e.children||e.details||[]):Cr(e)?Te(e.title,[e.detail||""]):Te(S.DEFAULT_ERROR_MESSAGE)}function Tr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Cr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function Te(e,t=[]){return{message:e,children:t}}function M(e="error"){return function(t){const{message:n,children:i}=xe(t);Je.add(e,n,{children:i})}}function ue(e,t={}){return F().emit("entity:read",{...t,entity:e})}function Ue(e,t){return F().emit("entity:update",{...t,entity:e})}function dt(e){return e.reduce((t,n)=>(n.name&&(typeof n.name=="string"?t.push(n.name):t.push(...n.name)),t),[])}function pt(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 Ar(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 Sr(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function vr(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return S.DEFAULT_ERROR_MESSAGE}})}function W(e,t={}){return z.isFront&&(t.headers||(t.headers={}),t.headers["Context-Id"]=z.contextId),t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.reload():n).catch(()=>{throw new Error(S.DEFAULT_ERROR_MESSAGE)}).then(n=>vr(n).then(i=>{if(!n.ok)throw i;return i}))}function Ir(e,t=1e3){let n=0;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>e(...i),t)}}function Nr(e,t){let n=!1;return(...i)=>{if(!n)return n=!0,setTimeout(()=>n=!1,t),e(...i)}}const Rr=Ee(_e("pretty-value-field-by-entity"));function Or(e,t,n){try{const i=Oe.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 Rr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',i,e,t,n),n}}const re=Ee(_e("use-socket"));function F(){return $r}function Lr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const $r=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()},_n*2);const y=new Uint8Array(1);y[0]=En,t.send(y)}setInterval(()=>{Array.from(i).forEach(y=>{_(y)&&(re("Handler for event %s requestId %d was expired",y.event,y.requestId),y.requestId?l({requestId:y.requestId,event:rt,data:{message:Q.RequestTookToLong().message}}):i.delete(y))})},1e3),setInterval(()=>{(!t||t.readyState===3)&&c()},S.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:a,requestId:e,handlers:i,socketInstance:t}}function l(y){const b=[...i.values()];re("Handlers array length is %d. Response event: %s. Request id: %d",i.size,y.event,y.requestId),b.forEach(k=>{const A=y.requestId;(k.requestId&&k.requestId===A||!k.requestId&&k.event===y.event)&&(re("Find appropriated handler: %d, event: %s",e,k.event),k.callback(y.data,y),k.once&&(i.delete(k),re("Handler was removed by *once* params was passed. %o",k)))})}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(y){re("Connection to server was stopped: %d %s",y.code,y.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(y=>{d(y),a.delete(y)})},t.onerror=function(y){console.warn(y)},t.onmessage=y=>{var b;try{if(Lr(y.data)){s();return}const k=JSON.parse(y.data);if(!gt(k)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(k);return}(b=k==null?void 0:k.data)!=null&&b.refresh&&location.reload(),l(k)}catch(k){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(k)}}}function d(y){t.send(y)}function m(y,b){T({event:y,callback:b})}function p(y,b){T({event:y,callback:b,once:!0})}function E(){return t&&(t==null?void 0:t.readyState)===1}function h(y,b,k){const A=++e,P=JSON.stringify({requestId:A,event:y,data:b,contextId:z.contextId,url:N.socketURLHandler?N.socketURLHandler():window.location.href});return E()?d(P):(a.add(P),re("Socket is not connected. Message was send to save-queue")),new Promise((D,g)=>{T({event:y,requestId:A,once:!0,guaranteedAnswer:!0,serializeString:P,callback:(w,C)=>{if(re("Promise was resolve with next data:",w),Br(C))return void g(w);k&&k(w,C),D(w)},timeToLive:S.TIME_TO_LIVE_SOCKET_REQUEST})})}function T(y){const b={timeToLive:0,...y,created:new Date().getTime()};i.add(b)}function _(y){return y.timeToLive===0||typeof y.timeToLive!="number"?!1:new Date().getTime()-y.created>y.timeToLive}return{get socket(){return t},on:m,once:p,emit:h,initialization(y){n=y},getDevInfo:u}}(),Br=e=>!!gt(e)&&e.event===rt,gt=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function mt(e,t){return F().emit("list-setting:read",{entity:e,mark:t})}function Fr(e,t){return F().emit("metadata-field:treat",{entity:e,fieldName:t})}function ht(e,t){return F().emit("entity:create",{...t,entity:e})}function yt(e,t){return F().emit("entity:delete",{...t,entity:e})}function Pr(e,t){return F().emit("usage-context:read",{...t,entity:e})}function wt(e={}){return F().emit("tool:read",e)}function Dr(){return F().emit("metadata-list:read",{})}function bt(e,t={},n={}){const i=r.inject(S.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 Vr(e){return F().emit("history:read",e)}function Mr(e,t){return F().emit("entity:count",{...t,entity:e})}function xr(e){return`/${kn}/${e}`}function de(e){return{exec(t,n){switch(e.name){case"replace-boolean":return de.replaceBoolean(t,e.values);case"replace-record-operation":return de.replaceRecordOperation(t)}}}}de.replaceBoolean=Ur,de.replaceRecordOperation=Wr;function Ur(e,t){return typeof e!="boolean"?"":e?t[1]:t[0]}function Wr(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function qr(e={}){return F().emit("tool:execute",e)}const jr=Ee(_e("wrap-tool-response"));function Et(e,t){return e.handleConfirmation===void 0&&(e.handleConfirmation=Hr),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=Jr),e.handleCloseForm===void 0&&(e.handleCloseForm=Yr),e.handleValidationResult===void 0&&(e.handleValidationResult=Xr),{...t,label:t.title,callback(){var o;const n=typeof e.values=="function"?e.values(t,e):e.values,i=()=>qr({name:t.name,values:n,usageContext:t.usageContext}).then(async a=>{var s,u;if(!Gr(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&&Je.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(M("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 Gr(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function zr(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 Hr(e,t){const n=zr(e.confirmation);if(!ne.getComponentFromStore(S.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await ne.promptModal(S.MODAL_CONFIRM,{message:n}))return t()}function Xr(e,t){const n=S.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 Jr(e,t,n){var l;function i(c){return c!==null&&typeof c=="object"&&typeof c.read=="function"}function o(c,d){c&&(jr("Affected Entity %s. Find form with name %s.",d,c.name),c.name===d&&i(c)&&c.read(),c instanceof v.Form&&c.dependencies.forEach(m=>o(m,d)))}we.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){we.emit("display-entity",{id:u,name:t.name}),N.getEntityLink&&a.push(N.getEntityLink(t.name,u));return}o(s,t.name)}function Yr(e,t){const{router:n}=t;n&&e.closeHostForm&&n.back()}let ie={};function Z(e,...t){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let n=v.utils.getPropFromObject((this==null?void 0:this.vocabulary)||ie,e);if(typeof n=="string")return _t(n,t);const i=v.utils.getPropFromObject(ie==null?void 0:ie.root,e);return typeof i=="string"?_t(i,t):(typeof n===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function _t(e,t){return t.forEach((n,i)=>{e=e.replaceAll(new RegExp(`\\{${i}}`,"g"),n)}),e}Z.setGlobalVocabulary=function(e){ie=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:v.utils.getPropFromObject(ie,t.toLowerCase())})},Z.setVocabulary=function(e){return typeof e=="string"&&(e=v.utils.getPropFromObject(ie,e)),Z.bind({vocabulary:e})};function Kr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var We={exports:{}},O={},qe={exports:{}},oe={};function kt(){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 Qr(e,t,n){}function Zr(e,t,n){}var ei=/javascript\s*\:/img;function ti(e,t){return ei.test(t)?"":t}oe.whiteList=kt(),oe.getDefaultWhiteList=kt,oe.onAttr=Qr,oe.onIgnoreAttr=Zr,oe.safeAttrValue=ti;var ni={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,"")}},he=ni;function ri(e,t){e=he.trimRight(e),e[e.length-1]!==";"&&(e+=";");var n=e.length,i=!1,o=0,a=0,s="";function u(){if(!i){var d=he.trim(e.slice(o,a)),m=d.indexOf(":");if(m!==-1){var p=he.trim(d.slice(0,m)),E=he.trim(d.slice(m+1));if(p){var h=t(o,s.length,p,E,d);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
7
  `&&u()}return he.trim(s)}var ii=ri,Ce=oe,oi=ii;function Tt(e){return e==null}function ai(e){var t={};for(var n in e)t[n]=e[n];return t}function Ct(e){e=ai(e||{}),e.whiteList=e.whiteList||Ce.whiteList,e.onAttr=e.onAttr||Ce.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||Ce.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||Ce.safeAttrValue,this.options=e}Ct.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=oi(e,function(l,c,d,m,p){var E=i[d],h=!1;if(E===!0?h=E:typeof E=="function"?h=E(m):E instanceof RegExp&&(h=E.test(m)),h!==!0&&(h=!1),m=s(d,m),!!m){var T={position:c,sourcePosition:l,source:p,isWhite:h};if(h){var _=o(d,m,T);return Tt(_)?d+":"+m:_}else{var _=a(d,m,T);if(!Tt(_))return _}}});return u};var si=Ct;(function(e,t){var n=oe,i=si;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)})(qe,qe.exports);var je=qe.exports,Ge={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}},li=je.FilterCSS,ci=je.getDefaultWhiteList,Ae=Ge;function At(){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 St=new li;function fi(e,t,n){}function ui(e,t,n){}function di(e,t,n){}function pi(e,t,n){}function vt(e){return e.replace(mi,"&lt;").replace(hi,"&gt;")}function gi(e,t,n,i){if(n=Ft(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(Se.lastIndex=0,Se.test(n))return""}else if(t==="style"){if(It.lastIndex=0,It.test(n)||(Nt.lastIndex=0,Nt.test(n)&&(Se.lastIndex=0,Se.test(n))))return"";i!==!1&&(i=i||St,n=i.process(n))}return n=Pt(n),n}var mi=/</g,hi=/>/g,yi=/"/g,wi=/&quot;/g,bi=/&#([a-zA-Z0-9]*);?/gim,Ei=/&colon;?/gim,_i=/&newline;?/gim,Se=/((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,It=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Nt=/u\s*r\s*l\s*\(.*/gi;function Rt(e){return e.replace(yi,"&quot;")}function Ot(e){return e.replace(wi,'"')}function Lt(e){return e.replace(bi,function(n,i){return i[0]==="x"||i[0]==="X"?String.fromCharCode(parseInt(i.substr(1),16)):String.fromCharCode(parseInt(i,10))})}function $t(e){return e.replace(Ei,":").replace(_i," ")}function Bt(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 Ft(e){return e=Ot(e),e=Lt(e),e=$t(e),e=Bt(e),e}function Pt(e){return e=Rt(e),e=vt(e),e}function ki(){return""}function Ti(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]",d=l.position+c.length;return o.push([a!==!1?a:l.position,d]),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 Ci(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 Ai(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("")}O.whiteList=At(),O.getDefaultWhiteList=At,O.onTag=fi,O.onIgnoreTag=ui,O.onTagAttr=di,O.onIgnoreTagAttr=pi,O.safeAttrValue=gi,O.escapeHtml=vt,O.escapeQuote=Rt,O.unescapeQuote=Ot,O.escapeHtmlEntities=Lt,O.escapeDangerHtml5Entities=$t,O.clearNonPrintableCharacter=Bt,O.friendlyAttrValue=Ft,O.escapeAttrValue=Pt,O.onIgnoreTagStripAll=ki,O.StripTagBody=Ti,O.stripCommentTag=Ci,O.stripBlankChar=Ai,O.attributeWrapSign='"',O.cssFilter=St,O.getDefaultCSSWhiteList=ci;var ve={},ee=Ge;function Si(e){var t=ee.spaceIndex(e),n;return t===-1?n=e.slice(1,-1):n=e.slice(1,t+1),n=ee.trim(n).toLowerCase(),n.slice(0,1)==="/"&&(n=n.slice(1)),n.slice(-1)==="/"&&(n=n.slice(0,-1)),n}function vi(e){return e.slice(0,2)==="</"}function Ii(e,t,n){var i="",o=0,a=!1,s=!1,u=0,l=e.length,c="",d="";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)),d=e.slice(a,u+1),c=Si(d),i+=t(a,i.length,c,d,vi(d)),o=u+1,a=!1;continue}if(m==='"'||m==="'")for(var p=1,E=e.charAt(u-p);E.trim()===""||E==="=";){if(E==="="){s=m;continue e}E=e.charAt(u-++p)}}else if(m===s){s=!1;continue}}return o<l&&(i+=n(e.substr(o))),i}var Ni=/[^a-zA-Z0-9\\_:.-]/gim;function Ri(e,t){var n=0,i=0,o=[],a=!1,s=e.length;function u(p,E){if(p=ee.trim(p),p=p.replace(Ni,"").toLowerCase(),!(p.length<1)){var h=t(p,E||"");h&&o.push(h)}}for(var l=0;l<s;l++){var c=e.charAt(l),d,m;if(a===!1&&c==="="){a=e.slice(n,l),n=l+1,i=e.charAt(n)==='"'||e.charAt(n)==="'"?n:Li(e,l+1);continue}if(a!==!1&&l===i){if(m=e.indexOf(c,l+1),m===-1)break;d=ee.trim(e.slice(i+1,m)),u(a,d),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=Oi(e,l),m===-1){d=ee.trim(e.slice(n,l)),u(d),a=!1,n=l+1;continue}else{l=m-1;continue}else if(m=$i(e,l-1),m===-1){d=ee.trim(e.slice(n,l)),d=Dt(d),u(a,d),a=!1,n=l+1;continue}else continue}return n<e.length&&(a===!1?u(e.slice(n)):u(a,Dt(ee.trim(e.slice(n))))),ee.trim(o.join(" "))}function Oi(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Li(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="'"||n==='"'?t:-1}}function $i(e,t){for(;t>0;t--){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Bi(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function Dt(e){return Bi(e)?e.substr(1,e.length-2):e}ve.parseTag=Ii,ve.parseAttr=Ri;var Fi=je.FilterCSS,j=O,Vt=ve,Pi=Vt.parseTag,Di=Vt.parseAttr,Ie=Ge;function Ne(e){return e==null}function Vi(e){var t=Ie.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=Ie.trim(e.slice(t+1,-1));var n=e[e.length-1]==="/";return n&&(e=Ie.trim(e.slice(0,-1))),{html:e,closing:n}}function Mi(e){var t={};for(var n in e)t[n]=e[n];return t}function xi(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 Mt(e){e=Mi(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=j.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=xi(e.whiteList||e.allowList):e.whiteList=j.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":j.attributeWrapSign,e.onTag=e.onTag||j.onTag,e.onTagAttr=e.onTagAttr||j.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||j.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||j.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||j.safeAttrValue,e.escapeHtml=e.escapeHtml||j.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Fi(e.css))}Mt.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,d=t.attributeWrapSign,m=t.cssFilter;n.stripBlankChar&&(e=j.stripBlankChar(e)),n.allowCommentTag||(e=j.stripCommentTag(e));var p=!1;n.stripIgnoreTagBody&&(p=j.StripTagBody(n.stripIgnoreTagBody,a),a=p.onIgnoreTag);var E=Pi(e,function(h,T,_,y,b){var k={sourcePosition:h,position:T,isClosing:b,isWhite:Object.prototype.hasOwnProperty.call(i,_)},A=o(_,y,k);if(!Ne(A))return A;if(k.isWhite){if(k.isClosing)return"</"+_+">";var P=Vi(y),D=i[_],g=Di(P.html,function(w,C){var I=Ie.indexOf(D,w)!==-1,L=s(_,w,C,I);return Ne(L)?I?(C=l(_,w,C,m),C?w+"="+d+C+d:w):(L=u(_,w,C,I),Ne(L)?void 0:L):L});return y="<"+_,g&&(y+=" "+g),P.closing&&(y+=" /"),y+=">",y}else return A=a(_,y,k),Ne(A)?c(y):A},c);return p&&(E=p.remove(E)),E};var Ui=Mt;(function(e,t){var n=O,i=ve,o=Ui;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)})(We,We.exports);var Wi=We.exports;const qi=Kr(Wi);function ji(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>'),qi(e)}function Gi(e,t,n,i){let o=e+t/60+n/3600;return(i=="S"||i=="W")&&(o=o*-1),o}function zi(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 ze(e,t){return`/forms/${e}/${t}`}function xt(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:Ut(o,a),id:a[me(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?ze(Ut(o,a),u):null},o.value=(a,s)=>s[o.name[1]]),Hi(o,o.type,o.presentation),N.listConvertCellConfigHandler&&N.listConvertCellConfigHandler(e,o),o))}function Hi(e,t,n){switch(t){case"DateTime":{e.type="dateWithTime";break}case"Decimal":{n==="Money"&&(e.type="money");break}}return e}const Ut=(e,t)=>e.useObjectTypeName?t[e.name[2]]:e.entity?e.entity:null;function Wt(e){return typeof e!="object"||e===null?null:e[S.TABLE_MOCK_FIELD]}function Xi(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[S.TABLE_MOCK_FIELD]=t):e[S.TABLE_MOCK_FIELD]=e.Id,e)}var He=(e=>(e.form="form",e.inline="inline",e.modal="modal",e))(He||{});function Ji(){const e=r.ref(null);function t(n){e.value=n}return{activeRow:e,activateRow:t}}function Yi(e,t){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(t)}async function qt(e,t){e()&&(await t(),await qt(e,t))}function Ki(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,w)=>Yi(g,w));function d(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function m(){const g=A();return typeof g.limit!="number"&&(g.limit=100),g.offset=u,(n.request||ue)(e,g).then(C=>(u+=C.length,C))}function p(g,w){var I;return typeof g.Version=="number"?g.Version:(I=s.find(L=>L.Id===w))==null?void 0:I.Version}function E(g,w){const C=s.findIndex(I=>I.Id===g);if(C===-1)throw new Error(`Can't found item with Id ${g}`);s.splice(C,1,w)}function h(g){const w=s.findIndex(C=>C.Id===g);if(w===-1)throw new Error(`Can't found item with Id ${g}`);s.splice(w,1)}async function T(g,w){try{const C=A(),I=p(w,g);delete w.Version,await Ue(e,{id:g,values:w,version:I,masterEntities:d()});const L=await ue(e,{fields:C.fields||"",id:g});E(g,L)}catch(C){M()(C)}}async function _(g,w={}){try{const C=A(),I=p(w,g);delete w.Version,await yt(e,{id:g,version:I,masterEntities:d()}),h(g)}catch(C){M()(C)}}async function y(g){try{await ht(e,{values:g,masterEntities:d()}),await P()}catch(w){M()(w)}}let b;async function k(){l.value=!0;try{b!=null&&b.signal&&!b.signal.aborted&&b.abort();let g=b=new AbortController,w=0;const I=A().limit||0;if(o.value&&!I){console.warn("Using textSearch assumes the use of limit.");return}await qt(()=>(I>0?w<I:!0)&&!i&&!g.signal.aborted,async()=>{const L=await m();g.signal.aborted||(s.push(...L),w+=L.filter(H=>c(H,o.value)).length,(L.length<I||I===0)&&(i=!0))})}catch(g){M()(g)}l.value=!1}function A(){return typeof t=="function"?t():t}async function P(){try{u=0,i=!1,s.splice(0,s.length),await k()}catch(g){M()(g)}}function D(){if(b)return b.abort();l.value=!1}return{array:s,updateById:T,next:k,reload:P,wait:l,create:y,deleteById:_,textSearch:o,filteredArray:a,abort:D}}function Qi(){function e(){return{organizations:z.organizations,currentContextId:z.contextId,person:z.person,context:z.context,contextType:z.contextType,userId:z.userId}}const t=r.reactive(e());return z.onupdateContext(()=>{Object.assign(t,e())}),t}function Zi(e,t,n){return F().emit("communication:create",{entityName:e,entityCatalogId:t,targetCode:n})}function eo(e,t,n){return F().emit("communication:read",{entityName:e,entityCatalogId:t,targetCode:n})}function to(e,t){return F().emit("communication-message:create",{communicationId:e,text:t})}function no(e){return F().emit("communication-message:read",{communicationId:e})}function ro(e){const t=v.Form.getParentForm(),n=r.reactive([]);return t&&t.subscribe(e),e.read=()=>no(e.id).then(i=>(n.splice(0,n.length,...i),i)),{array:n}}function io(e,t){e.read=()=>{const i=n();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return ue(e.name,i)}).then(Qe).then(o=>(o.hasOwnProperty("Version")&&(e.version=o.Version),e.setValues(o),o)).catch(M())},e.save=()=>{const i=n();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return Ue(e.name,{id:i.id,values:e.changes,version:e.version})}).then(o=>{e.version=o.version}).catch(o=>{throw M()(o),o})};function n(){return typeof t=="function"?t():t}}function Re(e){if(!e)return r.inject(S.PROVIDE_NAME_METADATA);Oe.initEntity(e);const t=r.computed(()=>Oe.state[e]);return r.provide(S.PROVIDE_NAME_METADATA,t),t}function Xe(e,t={}){if(!e)return r.inject(S.PROVIDE_NAME_USAGE_CONTEXT);const n=r.ref(null);return r.provide(S.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await Pr(e,oo(t||{}))}}}function oo(e){return typeof e=="function"?e():e}function ao(e){if(!e)return r.inject(S.PROVIDE_NAME_ACTIONS);const t=r.ref(!1),n=r.reactive([]),i=r.computed(()=>n.map(s=>Et(e,s))),o={actions:i,update:a};r.provide(S.PROVIDE_NAME_ACTIONS,o),e.router=ae.useRouter();function a(){if(t.value)return;t.value=!0,n.splice(0,n.length);const s=e==null?void 0:e.form;return wt({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(M("error")).finally(()=>t.value=!1)}return{actions:i,update:a,loading:r.readonly(t)}}function so(e){function t(n){n.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",t)}),r.onUnmounted(()=>{document.removeEventListener("keypress",t)})}function lo(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(d=>d===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 co(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 Je=new class{constructor(){this.store=r.reactive([])}add(t,n,i={}){const o=fo(i),a=new Ye(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 fo(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 Le=class Le{constructor(t,n,i,o,a){this.type=t,this.message=n,this.timeout=i,this.children=o,this.click=a,this.id=Le.cardId++}};Le.cardId=1;let Ye=Le;/*!
8
8
  * jenesius-event-emitter v1.0.2
9
9
  * (c) 2022 Jenesius
10
10
  * @license MIT
11
- */const jt=function(e,t){return e in this.events||(this.events[e]=[]),this.events[e].push(t),this.off.bind(this,e,t)},Gt=function(e,t){e in this.events&&this.events[e].forEach(n=>n(t))},zt=function(e,t){const n=this.events[e];if(!n)return;const i=n.indexOf(t);i!==-1&&n.splice(i,1)},Ht=function(){this.events={}};class K{constructor(){this.events={}}on(t,n){return jt.call(this,t,n)}emit(t,n){return Gt.call(this,t,n)}off(t,n){return zt.call(this,t,n)}cleanEvents(){Ht.call(this)}static on(t,n){return jt.call(K,t,n)}static emit(t,n){return Gt.call(K,t,n)}static off(t,n){return zt.call(K,t,n)}static cleanEvents(){Ht.call(K)}}K.events={};class uo extends K{constructor(t){super(),this.name="Communication",this.read=()=>{},this.id=t}sendMessage(t){return to(this.id,t)}static checkAndGenerate(t,n,i){return eo(t,n,i).then(o=>o.length===0?Zi(t,n,i):o[0])}}function po(){return F().emit("client:read",{})}const J=class J extends K{constructor(){super(...arguments);Zt(this,ge);this.type="front",this.organizations=[],et(this,ge,!1)}set language(n){localStorage.setItem(S.LOCALSTORAGE_LANGUAGE_KEY,n)}get language(){return localStorage.getItem(S.LOCALSTORAGE_LANGUAGE_KEY)||J.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){et(this,ge,n),this.emit(J.EVENT_READY_UPDATE,n)}get ready(){return Qt(this,ge)}onReady(n){return this.on(J.EVENT_READY_UPDATE,n)}onupdateContext(n){return this.on(J.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(S.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(n)),this.emit(J.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){M()(n)}}restoreCurrentContext(){const n=Number.parseInt(localStorage.getItem(S.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 po()}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}}};ge=new WeakMap,J.DEFAULT_LANGUAGE="en",J.EVENT_CONTEXT_UPDATE="event:context-update",J.EVENT_READY_UPDATE="event:ready-update";let Ke=J;function go(e){return F().emit("metadata:read",{entity:e})}const Oe=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=go(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 mo extends K{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 X{static login(t){return W(N.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...t,AppName:N.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 X.requestStepRegistrationProcess("StartRegistration",t)}static confirmPhoneRegistrationProcess(t){return X.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",t)}static confirmEmailRegistrationProcess(t){return X.requestStepRegistrationProcess("ConfirmEmailByRegistration",t)}static finishEmailRegistrationProcess(t){return X.requestStepRegistrationProcess("FinishRegistration",t)}static requestStepRegistrationProcess(t,n){return W(`${N.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(t){return X.requestStepLoginProcess("StartLogin",t)}static loginWithPassword(t){return X.requestStepLoginProcess("LoginWithPassword",t)}static loginWithOtpCode(t){return X.requestStepLoginProcess("LoginWithOtpCode",t)}static requestStepLoginProcess(t,n){return W(`${N.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(X.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 W(`${N.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 W(`${N.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 W(`${N.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 W(`${N.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 ho{static readHistoryById(t,n){return W(`/close-api/audits/history/${t}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class yo{static getConfiguration(){return W("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(t){return await W(`/open-api/data/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class wo{static getDictionary(t){if(!t)throw new Error(`Can't get dictionary for ${t}.`);return W(`/open-api/internationalization/language/${t}`)}}class bo{static async upload(t,n){const i=new FormData;return i.append("file",t),W(`/close-api/files?entityName=${n}`,{method:"POST",body:i}).then(o=>(o.filename=t.name,o))}}var Xt=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(Xt||{}),Jt=(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))(Jt||{});function Eo(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(Eo(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 ye(e){return typeof e=="string"?`'${e}'`:`${e}`}$.includes=function(t,n){return`@${t} Contains ${ye(n)}`},$.beginWith=function(t,n){return`@${t} BeginWith ${ye(n)}`},$.notEq=function(t,n){return`@${t} nq ${ye(n)}`},$.eq=function(t,n){return Array.isArray(n)?$.in(t,n):`@${t} eq ${ye(n)}`},$.in=function(t,n){const i=n.map(ye).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 z=new Ke,we=new mo;f.ApplicationStatus=Jt,f.Communication=uo,f.CoreError=Q,f.DisplayListRow=He,f.EventBus=we,f.Filter=$,f.Manager=z,f.MetadataStore=Oe,f.NotificationSystem=Je,f.OBJECT_TYPE_NAME_FIELD=it,f.RecordOperation=Xt,f.WidgetButton=Fn,f.WidgetFastTable=kr,f.WidgetFastTableHeadCell=ct,f.WidgetField=nr,f.WidgetIcon=ce,f.WidgetImage=Gn,f.WidgetList=tr,f.WidgetLoader=qn,f.WidgetMultiButton=xn,f.WidgetSpinner=fe,f.WidgetTable=lt,f.WidgetTablePanelFilterItem=ft,f.asyncProcess=ke,f.authService=X,f.billingService=le,f.catchUniversal=M,f.config=Sn,f.configuration=N,f.constants=S,f.convertDDToDMS=zi,f.convertDMSToDD=Gi,f.convertListConfig=xt,f.debounce=Ir,f.documentsService=an,f.fileService=bo,f.formatter=de,f.getCellName=me,f.getCellValue=Pe,f.getEntityLink=ze,f.getNamesFromListConfig=dt,f.getUnitValue=Fe,f.groupArrayByField=Ar,f.historyService=ho,f.injectAction=bt,f.internationalizationService=wo,f.invitationService=on,f.openService=yo,f.parseError=xe,f.parseTextByMarkdown=ji,f.prettyDate=Me,f.prettyDateWithTime=ut,f.prettyMoney=pt,f.prettyValueFieldByEntity=Or,f.processWizardService=se,f.request=W,f.setupListRow=De,f.staticLink=xr,f.t=Z,f.throttle=Nr,f.universalEntityCount=Mr,f.universalEntityCreate=ht,f.universalEntityDelete=yt,f.universalEntityRead=ue,f.universalEntityUpdate=Ue,f.universalHistoryRead=Vr,f.universalListSettingRead=mt,f.universalMetadataFieldTreat=Fr,f.universalMetadataListRead=Dr,f.universalToolRead=wt,f.useActions=ao,f.useCommunication=ro,f.useEnter=so,f.useFormEntity=io,f.useListActiveRow=Ji,f.useListEntity=Ki,f.useListSearch=co,f.useListSelect=lo,f.useManagerState=Qi,f.useMetadata=Re,f.useSocket=F,f.useUsageContext=Xe,f.useVisibleItem=Ve,f.useWizard=un,f.uuidv4=Sr,f.valuesToUpperCase=Qe,f.wrapToolResponse=Et,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
11
+ */const jt=function(e,t){return e in this.events||(this.events[e]=[]),this.events[e].push(t),this.off.bind(this,e,t)},Gt=function(e,t){e in this.events&&this.events[e].forEach(n=>n(t))},zt=function(e,t){const n=this.events[e];if(!n)return;const i=n.indexOf(t);i!==-1&&n.splice(i,1)},Ht=function(){this.events={}};class K{constructor(){this.events={}}on(t,n){return jt.call(this,t,n)}emit(t,n){return Gt.call(this,t,n)}off(t,n){return zt.call(this,t,n)}cleanEvents(){Ht.call(this)}static on(t,n){return jt.call(K,t,n)}static emit(t,n){return Gt.call(K,t,n)}static off(t,n){return zt.call(K,t,n)}static cleanEvents(){Ht.call(K)}}K.events={};class uo extends K{constructor(t){super(),this.name="Communication",this.read=()=>{},this.id=t}sendMessage(t){return to(this.id,t)}static checkAndGenerate(t,n,i){return eo(t,n,i).then(o=>o.length===0?Zi(t,n,i):o[0])}}function po(){return F().emit("client:read",{})}const J=class J extends K{constructor(){super(...arguments);Zt(this,ge);this.type="front",this.organizations=[],et(this,ge,!1)}set language(n){localStorage.setItem(S.LOCALSTORAGE_LANGUAGE_KEY,n)}get language(){return localStorage.getItem(S.LOCALSTORAGE_LANGUAGE_KEY)||J.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){et(this,ge,n),this.emit(J.EVENT_READY_UPDATE,n)}get ready(){return Qt(this,ge)}onReady(n){return this.on(J.EVENT_READY_UPDATE,n)}onupdateContext(n){return this.on(J.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(S.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(n)),this.emit(J.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){M()(n)}}restoreCurrentContext(){const n=Number.parseInt(localStorage.getItem(S.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 po()}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}}};ge=new WeakMap,J.DEFAULT_LANGUAGE="en",J.EVENT_CONTEXT_UPDATE="event:context-update",J.EVENT_READY_UPDATE="event:ready-update";let Ke=J;function go(e){return F().emit("metadata:read",{entity:e})}const Oe=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=go(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,loadingFlags:n}}();class mo extends K{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 X{static login(t){return W(N.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...t,AppName:N.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 X.requestStepRegistrationProcess("StartRegistration",t)}static confirmPhoneRegistrationProcess(t){return X.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",t)}static confirmEmailRegistrationProcess(t){return X.requestStepRegistrationProcess("ConfirmEmailByRegistration",t)}static finishEmailRegistrationProcess(t){return X.requestStepRegistrationProcess("FinishRegistration",t)}static requestStepRegistrationProcess(t,n){return W(`${N.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(t){return X.requestStepLoginProcess("StartLogin",t)}static loginWithPassword(t){return X.requestStepLoginProcess("LoginWithPassword",t)}static loginWithOtpCode(t){return X.requestStepLoginProcess("LoginWithOtpCode",t)}static requestStepLoginProcess(t,n){return W(`${N.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(X.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 W(`${N.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 W(`${N.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 W(`${N.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 W(`${N.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 ho{static readHistoryById(t,n){return W(`/close-api/audits/history/${t}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class yo{static getConfiguration(){return W("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(t){return await W(`/open-api/data/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class wo{static getDictionary(t){if(!t)throw new Error(`Can't get dictionary for ${t}.`);return W(`/open-api/internationalization/language/${t}`)}}class bo{static async upload(t,n){const i=new FormData;return i.append("file",t),W(`/close-api/files?entityName=${n}`,{method:"POST",body:i}).then(o=>(o.filename=t.name,o))}}var Xt=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(Xt||{}),Jt=(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))(Jt||{});function Eo(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(Eo(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 ye(e){return typeof e=="string"?`'${e}'`:`${e}`}$.includes=function(t,n){return`@${t} Contains ${ye(n)}`},$.beginWith=function(t,n){return`@${t} BeginWith ${ye(n)}`},$.notEq=function(t,n){return`@${t} nq ${ye(n)}`},$.eq=function(t,n){return Array.isArray(n)?$.in(t,n):`@${t} eq ${ye(n)}`},$.in=function(t,n){const i=n.map(ye).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 z=new Ke,we=new mo;f.ApplicationStatus=Jt,f.Communication=uo,f.CoreError=Q,f.DisplayListRow=He,f.EventBus=we,f.Filter=$,f.Manager=z,f.MetadataStore=Oe,f.NotificationSystem=Je,f.OBJECT_TYPE_NAME_FIELD=it,f.RecordOperation=Xt,f.WidgetButton=Fn,f.WidgetFastTable=kr,f.WidgetFastTableHeadCell=ct,f.WidgetField=nr,f.WidgetIcon=ce,f.WidgetImage=Gn,f.WidgetList=tr,f.WidgetLoader=qn,f.WidgetMultiButton=xn,f.WidgetSpinner=fe,f.WidgetTable=lt,f.WidgetTablePanelFilterItem=ft,f.asyncProcess=ke,f.authService=X,f.billingService=le,f.catchUniversal=M,f.config=Sn,f.configuration=N,f.constants=S,f.convertDDToDMS=zi,f.convertDMSToDD=Gi,f.convertListConfig=xt,f.debounce=Ir,f.documentsService=an,f.fileService=bo,f.formatter=de,f.getCellName=me,f.getCellValue=Pe,f.getEntityLink=ze,f.getNamesFromListConfig=dt,f.getUnitValue=Fe,f.groupArrayByField=Ar,f.historyService=ho,f.injectAction=bt,f.internationalizationService=wo,f.invitationService=on,f.openService=yo,f.parseError=xe,f.parseTextByMarkdown=ji,f.prettyDate=Me,f.prettyDateWithTime=ut,f.prettyMoney=pt,f.prettyValueFieldByEntity=Or,f.processWizardService=se,f.request=W,f.setupListRow=De,f.staticLink=xr,f.t=Z,f.throttle=Nr,f.universalEntityCount=Mr,f.universalEntityCreate=ht,f.universalEntityDelete=yt,f.universalEntityRead=ue,f.universalEntityUpdate=Ue,f.universalHistoryRead=Vr,f.universalListSettingRead=mt,f.universalMetadataFieldTreat=Fr,f.universalMetadataListRead=Dr,f.universalToolRead=wt,f.useActions=ao,f.useCommunication=ro,f.useEnter=so,f.useFormEntity=io,f.useListActiveRow=Ji,f.useListEntity=Ki,f.useListSearch=co,f.useListSelect=lo,f.useManagerState=Qi,f.useMetadata=Re,f.useSocket=F,f.useUsageContext=Xe,f.useVisibleItem=Ve,f.useWizard=un,f.uuidv4=Sr,f.valuesToUpperCase=Qe,f.wrapToolResponse=Et,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
12
12
  //# sourceMappingURL=eservices-core.umd.js.map
@@ -4,5 +4,6 @@ declare const _default: {
4
4
  state: Record<string, IExtendedMetadata>;
5
5
  initEntity: (entity: string) => Promise<void>;
6
6
  get: (entity: string) => IExtendedMetadata;
7
+ loadingFlags: Map<string, Promise<unknown>>;
7
8
  };
8
9
  export default _default;
@@ -5,6 +5,6 @@ declare function formatter(config: IFormatterBase): {
5
5
  };
6
6
  declare namespace formatter {
7
7
  var replaceBoolean: (value: unknown, replaceValues: [falseValue: string, trueValue: string]) => string;
8
- var replaceRecordOperation: (value: unknown) => "" | "+" | "~" | "" | "?";
8
+ var replaceRecordOperation: (value: unknown) => "" | "?" | "+" | "~" | "";
9
9
  }
10
10
  export default formatter;
@@ -1,4 +1,5 @@
1
1
  import { IMasterEntity } from './usage-context-type';
2
+ import { IEntityReadParams } from '../../../backend/src/socket/events/entity_read';
2
3
 
3
4
  export declare type IEntityId = number;
4
5
  export declare type IEntityVersion = number;
@@ -13,6 +14,7 @@ export interface IUniversalEntityReadListOptions extends IUniversalEntityReadBas
13
14
  offset?: number;
14
15
  limit?: number;
15
16
  distinct?: boolean;
17
+ customFilters: IEntityReadParams['customFilters'];
16
18
  }
17
19
  export interface IUniversalEntityReadSingleOptions extends IUniversalEntityReadBasicOptions {
18
20
  id: IEntityId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eservices-core",
3
- "version": "1.3.199",
3
+ "version": "1.3.200",
4
4
  "description": "Core library",
5
5
  "author": "",
6
6
  "scripts": {