eservices-core 1.2.13 → 1.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('[dir=rtl] .icon[data-v-0d979509]{transform:scaleX(-1)}.input-text-container[data-v-65e2ee2d]{position:relative;height:var(--input-height);width:100%;background-color:var(--input-background-color);border:var(--input-border);border-radius:var(--input-border-radius)}.input-text-container[data-v-65e2ee2d]:focus-within{outline:var(--input-border-active)}.input-text__error[data-v-65e2ee2d]{position:absolute;margin:0;top:100%}.input-text[data-v-65e2ee2d]{width:100%;height:100%;padding:0 10px;background-color:transparent;border:0;color:var(--input-color);font-size:var(--input-font-size);outline:none}.input-text[data-v-65e2ee2d]::placeholder{color:var(--input-placeholder-color)}.input-text-container[disabled=true][data-v-65e2ee2d]{background-color:var(--input-background-color-disabled);border:var(--input-border-disabled)}.input-text-container[error=true][data-v-65e2ee2d]{border:var(--input-border-error)}.input-text__password[data-v-65e2ee2d]{padding:0 6px;display:flex;align-items:center}.input-title[data-v-65e2ee2d]{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.input-title_required[data-v-65e2ee2d],.input-text__error[data-v-65e2ee2d]{color:red}.input__toggle[data-v-56d58611]{position:relative;width:40px;height:20px;background-color:var(--input-toggle-background-color);border-radius:var(--input-toggle-border-radius);cursor:pointer;transition:var(--fast);border:var(--input-toggle-border)}.input__toggle[data-v-56d58611]:before{content:"";position:absolute;top:0;bottom:0;margin:auto;left:3px;height:14px;width:14px;border-radius:var(--input-toggle-round-radius);background-color:var(--input-toggle-round-background-color);transition:var(--transition-fast)}.input__toggle.active[data-v-56d58611]{background-color:var(--input-toggle-background-color-active)}.input__toggle.active[data-v-56d58611]:before{transform:translate(20px)}.input__toggle.disabled[data-v-56d58611]{background-color:var(--input-disabled-background-color);border:var(--input-disabled-border)}.input__toggle.disabled[data-v-56d58611]:before{background-color:var(--gray-1)}.input__toggle.disabled[data-v-56d58611]{cursor:auto}.item-wrap[data-v-69ab8592]{display:flex;align-items:center}.input-select__item[data-v-69ab8592]{margin:0;text-overflow:ellipsis;overflow:hidden;color:var(--text-black);transition:var(--fast);font-size:14px;line-height:19px;font-weight:400}.input-select__item.active[data-v-69ab8592]{background-color:var(--main);color:var(--text-white)}.input-select-container[data-v-c4acd469]{position:relative;width:100%;outline:none}.input-select-container.disabled>.input-select-container__current[data-v-c4acd469]{background-color:var(--input-background-color-disabled)}.input-select-container__list[data-v-c4acd469]{display:none;position:absolute;top:calc(100% - 5px);z-index:100;padding-top:4px;border:1px solid var(--gray-1);border-top:0;max-height:250px;width:100%;overflow:auto}.input-select-container.active .input-select-container__list[data-v-c4acd469]{display:block}.input-select-container.active>.input-select-container__current>img[data-v-c4acd469]{transform:rotate(-180deg)}.input-select-container__current[data-v-c4acd469]{display:flex;justify-content:space-between;align-items:center;padding:0 10px 0 0;border:var(--input-border);width:100%;border-radius:var(--input-border-radius);cursor:pointer;background-color:var(--input-background-color)}.current-placeholder[data-v-c4acd469]{padding:0 10px;color:var(--input-placeholder-color)}.input-select__ico-toggle[data-v-c4acd469]{fill:var(--main)}.input-select-container.error>.input-select-container__current[data-v-c4acd469]{border:1px solid var(--error)}.input-select-container.active>.input-select-container__current[data-v-c4acd469]{outline:var(--input-border-active)}.input-select-value[data-v-c4acd469]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;padding:0 16px;color:var(--input-color)}.container-input-file[data-v-bdbf1475]{height:var(--input-height);border:var(--input-border);background-color:var(--input-background-color);border-radius:var(--input-border-radius);padding:5px;display:flex;align-items:center;position:relative}.icon__file-upload[data-v-bdbf1475]{font-size:12px;color:var(--input-color)}.input-file[data-v-bdbf1475]{position:absolute;left:0;top:0;z-index:500;width:100%;height:100%;opacity:0;cursor:pointer}.input-file[data-v-bdbf1475]::-webkit-file-upload-button{visibility:hidden}.process-info[data-v-bdbf1475]{margin:4px 0}.widget-input__container[data-v-1e3f1057]{position:relative;outline:none}.widget-input__underline[data-v-1e3f1057]{height:2px;background-color:var(--input-line-color)}.widget-input__placeholder[data-v-1e3f1057]{margin:2px 0 0;color:var(--input-line-placeholder-color);font-size:var(--input-line-placeholder-font-size);line-height:var(--input-line-placeholder-line-height);-webkit-user-select:none;user-select:none}.widget-input__placeholder_error[data-v-1e3f1057]{color:var(--error)}.input-container__content[data-v-1e3f1057]{width:100%;display:flex}.input-text[data-v-212b50e2]{height:31px;width:100%;border:unset;outline:unset;background-color:transparent;color:var(--input-line-color);font-size:var(--input-line-font-size)}.input-text__password[data-v-212b50e2]{padding:0 6px;display:flex;align-items:center}.input-title[data-v-9c3e5ea6]{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.input-text-container[data-v-9c3e5ea6]{position:relative;height:32px;width:100%;background-color:var(--input-background-color);border:var(--input-border);border-radius:var(--input-border-radius)}.input-text-container[data-v-9c3e5ea6]:focus-within{border:var(--input-border-active)!important}.input-text__error[data-v-9c3e5ea6]{position:absolute;margin:0;top:100%;text-align:right}.input-text[data-v-9c3e5ea6]{width:100%;height:100%;padding:0 10px;background-color:transparent;border:0;color:var(--input-color);font-size:var(--input-font-size)}.input-text[data-v-9c3e5ea6]::placeholder{color:var(--input-placeholder-color)}.input-text-container[disabled=true][data-v-9c3e5ea6]{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.input-text-container[error=true][data-v-9c3e5ea6]{border:var(--input-border-error)}.input-text__password[data-v-9c3e5ea6]{padding:0 6px;display:flex;align-items:center}.input-text[data-v-9c3e5ea6]:focus{border:0;outline:0}.widget-button-wrap[data-v-b6be5c12]{width:fit-content;outline:none;-webkit-user-select:none;user-select:none;position:relative;--size: 30px;max-height:var(--size);height:var(--size)}.widget-button[data-v-b6be5c12]{background-color:var(--widget-button-background);color:var(--widget-button-color);border:var(--widget-button-border);border-radius:var(--widget-button-radius);height:fit-content;overflow:hidden}.widget-button__toggle[data-v-b6be5c12]{height:var(--size);width:var(--size)}.widget-button__toggle[data-v-b6be5c12]:hover{background-color:var(--widget-button-background-hover)}.widget-button__list[data-v-b6be5c12]{overflow:hidden;max-height:var(--size);transition:var(--fast);height:fit-content}.widget-button .widget-button__toggle-icon[data-v-b6be5c12]{transition:var(--fast)}.widget-button.active .widget-button__toggle-icon[data-v-b6be5c12]{transform:rotate(-180deg)}.widget-button__list-elem[data-v-b6be5c12]{line-height:var(--size);font-size:14px;padding:0 10px;transition:var(--extra-fast);min-width:80px}.widget-button__list-elem[data-v-b6be5c12]:hover{background-color:var(--widget-button-background-hover)}.function-item[data-v-73f7eb9f]{padding:10px}.form-title[data-v-c91ffa31]{flex-grow:1}.widget-form[data-v-c3e88e10]{width:100%;max-width:966px;overflow:hidden;border:var(--form-border);background-color:var(--form-background-color);box-shadow:var(--form-shadow);border-radius:var(--form-radius);border-bottom:5px solid var(--form-border-bottom)}.widget-form__head[data-v-c3e88e10]{min-height:60px;align-items:center;background-color:var(--form-head-background-color)}@media screen and (min-width: 769px){.widget-form__head[data-v-c3e88e10]{flex-wrap:nowrap;padding:0 20px 0 40px}.widget-form__head-button[data-v-c3e88e10]{margin-right:15px}}@media screen and (max-width: 768px){.widget-form[data-v-c3e88e10]{width:100%}.widget-form__head[data-v-c3e88e10]{flex-wrap:wrap}}.widget-form__head-functions[data-v-c3e88e10]{height:100%;align-items:center}.widget-form__body[data-v-c3e88e10]{overflow:auto}.form-container-item[data-v-9264f6f4]{flex-wrap:wrap;gap:10px}.form-container-item-center[data-v-9264f6f4]{flex-grow:1;max-width:240px}.form-container-item__title[data-v-9264f6f4]{min-width:180px;max-width:180px;min-height:30px;justify-content:flex-end}.form-container-item__title>span[data-v-9264f6f4]{display:flex;align-items:center;font-size:14px;height:30px;line-height:130%}.form-container-item-1 .form-container-item-center[data-v-9264f6f4]{max-width:unset}.form-container-item__right[data-v-9264f6f4]{flex-grow:1;max-width:240px}.content_double[data-v-9264f6f4]{max-width:480px}.container-auth-wrap[data-v-0b1a5e81]{display:flex;align-items:center;justify-content:center;background-color:var(--container-auth-background-color);border-radius:var(--container-auth-border-radius);box-shadow:var(--container-auth-box-shadow);overflow:hidden;max-width:900px}.container-auth-wrap[data-v-0b1a5e81]{display:flex;width:100%;height:100%}.container-auth-sidebar[data-v-0b1a5e81]{width:300px;background-color:var(--container-auth-sidebar-background-color)}.container-auth-main[data-v-0b1a5e81]{display:flex;flex-direction:column;flex-grow:1;position:relative}@media screen and (min-width: 768px){.container-auth-wrap[data-v-0b1a5e81]{height:500px}.container-auth-wrap>div[data-v-0b1a5e81]{height:100%}.container-auth-sidebar[data-v-0b1a5e81]{height:100%}}@media screen and (max-width: 768px){.container-auth-wrap[data-v-0b1a5e81]{flex-direction:column}.container-auth-sidebar[data-v-0b1a5e81]{height:220px}}.loader[data-v-661e0416],.loader[data-v-661e0416]:after{border-radius:50%;width:14px;height:14px}.loader[data-v-661e0416]{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;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8-661e0416 1.1s infinite linear;animation:load8-661e0416 1.1s infinite linear}@-webkit-keyframes load8-661e0416{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8-661e0416{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.button-wrap[data-v-3cf452e1]{position:relative}.button-spinner[data-v-3cf452e1]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.button-element[data-v-3cf452e1]{height:100%;width:100%;padding:0 20px;cursor:pointer;background-color:transparent;outline:unset;border:unset;color:unset;font-weight:unset;font-size:unset}.widget-button-wrap[data-v-3edae6ea]{--button-size: 40px;max-height:var(--button-size);z-index:1;position:relative;cursor:pointer;width:fit-content}.widget-multi-button[data-v-3edae6ea]{display:flex;background-color:#3949ab;border-radius:20px;overflow:hidden}.button__content[data-v-3edae6ea]{max-height:40px;min-width:80px;transition:.2s;overflow:hidden}.button__content_active[data-v-3edae6ea]{max-height:200px}.button__content-title[data-v-3edae6ea]{white-space:nowrap;font-size:14px;line-height:20px;padding:10px 10px 10px 20px;color:#fff;margin:0;transition:background-color .2s}.button__content-title[data-v-3edae6ea]:hover{background-color:#223296}.button__toggle_active[data-v-3edae6ea]{transform:rotate(180deg)}.button__side[data-v-3edae6ea]{min-width:var(--button-size)}.button__size-toggle[data-v-3edae6ea]{height:var(--button-size)}.button__size-toggle[data-v-3edae6ea]{cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .1s,background-color .2s;color:#fff}.button__size-toggle[data-v-3edae6ea]:hover{background-color:#223296}.button__toggle-icon[data-v-3edae6ea]{height:16px}.button__size-progress[data-v-3edae6ea]{display:flex;align-items:center;justify-content:center;height:var(--button-size)}.widget-error[data-v-8a0a0924]{height:38px;background-color:#ffb694;box-shadow:4px 4px 10px #ff500033}.widget-error-text[data-v-8a0a0924]{margin:0}.widget-error-wrap[data-v-8a0a0924]{height:100%;display:flex;align-items:center;justify-content:center}.widget-error-close[data-v-8a0a0924]{display:flex;align-items:center;justify-content:center;height:100%;width:40px;cursor:pointer}.widget-error-close[data-v-8a0a0924]:after,.widget-error-close[data-v-8a0a0924]:before{position:absolute;content:"";height:20px;width:2px;background-color:#000;border-radius:2px}.widget-error-close[data-v-8a0a0924]:after{transform:rotate(45deg)}.widget-error-close[data-v-8a0a0924]:before{transform:rotate(-45deg)}.widget-error-message[data-v-8a0a0924]{font-size:14px;line-height:130%;letter-spacing:.05em;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.widget-error-main[data-v-8a0a0924]{width:700px}.widget-error__container-close[data-v-8a0a0924]{height:100%}.article-details[data-v-8a0a0924]{font-size:18px;line-height:130%;letter-spacing:.05em;text-decoration-line:underline;font-weight:700;cursor:pointer}.fade-enter-active[data-v-aa732044],.fade-leave-active[data-v-aa732044]{transition:.5s ease;max-height:38px}.fade-enter-from[data-v-aa732044],.fade-leave-to[data-v-aa732044]{opacity:0;max-height:0}.container-errors[data-v-8e9870dd]{display:flex;gap:1px;flex-direction:column;position:fixed;top:0;left:0;width:100%;z-index:11}.fade-enter-active[data-v-8e9870dd],.fade-leave-active[data-v-8e9870dd]{transition:.5s ease;max-height:38px}.fade-enter-from[data-v-8e9870dd],.fade-leave-to[data-v-8e9870dd]{opacity:0;max-height:0}.modal__wait[data-v-4d18289e]{padding:40px 30px;max-width:450px}*{--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}.grid{display:grid}.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}.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}.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}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15,.padding_20{padding:15px}.es-list-container{overflow:auto}.widget-table__head[data-v-f478f0d8]{text-align:start}.widget-table__head-cell[data-v-f478f0d8]{padding:18px;text-align:start}.widget-table__head-title[data-v-f478f0d8]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-weight:600;font-size:14px;line-height:19px;margin:0}.widget-wait[data-v-2038b2ba]{align-items:center}.wait-spinner[data-v-2038b2ba]{padding:8px}.widget-table-loader{padding:10px 0}.breadcrumb[data-v-1702aee0]{gap:8px;align-items:center;color:#828282;cursor:pointer}.breadcrumb__title[data-v-1702aee0]{font-weight:400;font-size:12px;line-height:16px;margin:0}.breadcrumb__icon[data-v-1702aee0]{height:16px}.breadcrumb_active[data-v-1702aee0],.breadcrumb[data-v-1702aee0]:hover{color:#4f4f4f}.widget-breadcrumbs[data-v-1dfb2668]{display:flex;gap:14px}tr[data-v-47478206]{border:1px solid #F3F4FC;height:30px}th[data-v-47478206],td[data-v-47478206]{position:relative;padding:0 11px}th[data-v-47478206]{text-align:left}p[data-v-47478206]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.head-cell[data-v-03c9724f]{padding:0 15px 0 10px;display:flex}.head-cell[data-v-03c9724f]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-03c9724f]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-03c9724f]{position:absolute;inset-inline-end:4px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-03c9724f]{transform:rotate(180deg)}.head-cell-resize[data-v-03c9724f]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-03c9724f]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-03c9724f]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-11644ad4]{position:sticky;top:-1px;z-index:1}.test-block[data-v-11644ad4]{background-color:#e7f2ff;inset-block-start:-1px;position:absolute;z-index:2;-webkit-user-select:none;user-select:none;white-space:nowrap;padding:0 10px;height:calc(100% + 1px);display:none;place-content:center}.widget-list-head th[data-v-11644ad4]{position:sticky;top:0;z-index:2;-webkit-user-select:none;user-select:none}.head-cell[data-v-11644ad4]{display:flex;cursor:pointer;padding:0 10px}.head-cell-label[data-v-11644ad4]{flex-grow:1;margin:0;white-space:nowrap;-webkit-user-select:none;user-select:none}.list-arrow[data-v-11644ad4]{position:relative;display:block;height:15px;width:2px;background-color:gray;border-radius:2px}.list-arrow[data-v-11644ad4]:after,.list-arrow[data-v-11644ad4]:before{position:absolute;display:block;content:"";background-color:gray;height:8px;width:2px;border-radius:2px}.list-arrow[data-v-11644ad4]:after{transform:rotate(-30deg);right:-2px}.list-arrow[data-v-11644ad4]:before{transform:rotate(30deg);left:-2px}.block-list-arrow[data-v-11644ad4]{transition:.1s}.down[data-v-11644ad4]{transform:rotate(180deg)}.head-cell-order[data-v-11644ad4]{display:grid;place-content:center}.widget-list-head-label[data-v-11644ad4]{font-weight:400;font-size:13px;line-height:16px;padding:5px 0}.head-cell-resize[data-v-11644ad4]{position:relative;padding:3px 10px;cursor:col-resize}.head-cell-resize[data-v-11644ad4]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:gray}.widget-list-body[data-v-eb609a21]{position:relative}.widget-list-body[data-v-eb609a21]:after{content:"";background-color:transparent;z-index:-1;transition:.1s}.widget-list-body_inactive[data-v-eb609a21]:after{z-index:0;position:absolute;top:0;background-color:#afafaf80;height:100%;width:100%}.widget-section[data-v-07232553]{background-color:var(--form-section-background-color);box-shadow:var(--form-section-box-shadow);border-radius:var(--form-section-border-radius)}.widget-section__header[data-v-07232553]{border-radius:10px 10px 0 0;display:flex;padding:8px 8px 8px 40px;background-color:var(--form-section-header-background-color)}.widget-section-title[data-v-07232553]{flex-grow:1;font-weight:var(--form-section-title-font-weight);color:var(--form-section-title-color);font-size:var(--form-section-title-font-size);line-height:var(--form-section-title-line-height);margin:0}.widget-section__body[data-v-07232553]{padding:20px 40px}.widget-table__head[data-v-2d396466]{text-align:left;position:sticky;top:-1px;z-index:0}.widget-table__head-cell[data-v-2d396466]{padding:18px}.widget-table__head-title[data-v-2d396466]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-weight:600;font-size:14px;line-height:19px;margin:0}.form-titles[data-v-6ea1062c]{display:flex;flex-direction:column;justify-content:center}.form-label[data-v-6ea1062c]{display:flex;gap:10px;padding:4px 7px;align-items:center}.form-container-label[data-v-6ea1062c]{margin:0 0 0 6px}.form-info[data-v-6ea1062c]{color:#828282}.form-label[data-v-6ea1062c]{background-color:#ff6262;color:#fff;border-radius:4px}.form-title[data-v-6ea1062c]{font-weight:700;font-size:18px;line-height:25px}.form-label__title[data-v-6ea1062c]{margin:0;line-height:16px}.form-label__icon[data-v-6ea1062c]{height:16px;font-size:16px}.form-label_inactive[data-v-6ea1062c]{background-color:gray}.form-label_correct[data-v-6ea1062c]{background-color:green}.form-label_warning[data-v-6ea1062c]{background-color:#ff0}.form-label_error[data-v-6ea1062c]{background-color:#ff6262}.widget-form[data-v-f076ad65]{display:flex;flex-direction:column;gap:10px}.widget-form__head[data-v-f076ad65]{display:flex;gap:16px;align-items:center;z-index:1;padding:10px 0}.widget-form__button[data-v-f076ad65]{margin-left:auto}.wrap__widget-form[data-v-f076ad65]{padding:20px}.widget-form__head[data-v-f076ad65]{position:sticky;top:0}@media screen and (max-width: 768px){.wrap__widget-form[data-v-f076ad65]{padding:10px}.widget-form__head[data-v-f076ad65]{top:15px}}.head-image[data-v-f076ad65]{padding:15px;background-color:#f3f4fc;border-radius:8px}.validation-item[data-v-e6138c02]{display:grid;grid-template-columns:70px 1fr;border:1px solid #00CCB1;border-radius:4px}.validation-item_failed[data-v-e6138c02]{border-color:#ee8030}.validation-item-header[data-v-e6138c02]{display:grid;place-content:center;background-color:#00ccb1}.validation-item_failed .validation-item-header[data-v-e6138c02]{background-color:#ee8030}.validation-item__title[data-v-e6138c02]{font-weight:700;font-size:18px;line-height:25px;color:#fff}.validation-item-content[data-v-e6138c02]{display:flex;flex-direction:column;padding:10px 16px;gap:10px}.modal-wrap[data-v-119165b9]{max-height:80%;display:flex;flex-direction:column}.modal-wrap-head[data-v-119165b9]{display:flex;align-items:center;padding:10px;background:#F3F4FC;border-radius:8px 8px 0 0}.modal-head__title[data-v-119165b9]{font-weight:700;font-size:18px;line-height:25px}.modal-wrap-body[data-v-119165b9]{background-color:#fff;border-radius:0 0 8px 8px;overflow:auto}.modal-validation-body[data-v-a39cfe2f]{display:flex;flex-direction:column;gap:10px;padding:20px}.widget-input-check[data-v-f4a3dc6c]{display:grid;place-items:center;height:20px;aspect-ratio:1/1;border:2px solid #1a1a1a;border-radius:4px;cursor:pointer;background-color:#fff}.widget-input-check_active[data-v-f4a3dc6c]{background-color:#2f2f2f}.widget-input-check>i[data-v-f4a3dc6c]{font-size:12px;height:12px;color:#fff}.widget-card[data-v-bca33c5b]{display:flex}.widget-card-toggle[data-v-bca33c5b]{padding:10px}.widget-card-wrap[data-v-bca33c5b]{display:flex;flex-grow:1;background-color:#fff;border:1px solid #cbcbcb;border-radius:8px}.widget-card-arrow[data-v-bca33c5b]{padding:10px;cursor:pointer}.card-icon-arrow[data-v-bca33c5b]{display:block;transition:transform var(--fast)}.card-icon-arrow_active[data-v-bca33c5b]{transform:rotate(90deg)}.widget-card-title[data-v-bca33c5b]{margin:0;font-weight:600;font-size:18px;line-height:20px}.widget-card-content[data-v-bca33c5b]{padding:9px 0;flex-grow:1}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
2
  "use strict";/*!
3
- * eservices-core v1.2.13
3
+ * eservices-core v1.2.15
4
4
  * (c) 2023 ESERVICES
5
5
  */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),yt=require("jenesius-vue-modal"),y=require("jenesius-vue-form"),vt=require("object-hash"),Ge=require("vue-router"),Xt=require("date-and-time"),Zt=require("socket.io-client");const f=(t,e)=>{const r=t.__vccOpts||t;for(const[o,s]of e)r[o]=s;return r},Qt={props:{name:String},setup(t,e){let r="unknown";try{r=e.slots.default()[0].children}catch{r=t.name}typeof r!="string"&&console.warn(`Name for Icon.vue is not string. ${r}`);try{r=r.replace(/\s+/g,"")}catch{}return()=>n.h("i",{class:`icon icon-${r}`})}},E=f(Qt,[["__scopeId","data-v-0d979509"]]);function en(t,e){return!!t&&t===e||"password is not equal"}function Ae(t){return Number(t.replace(/[^0-9.]/g,""))}function He(t,e=null){let o=String(Ae(t)).split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.length>1&&e!==null&&o[1].length>e&&(o[1]=o[1].substring(0,e)),o.join(".")}const tn=Object.freeze(Object.defineProperty({__proto__:null,numeric:Ae,prettyNumeric:He,validPassword:en},Symbol.toStringTag,{value:"Module"})),H={props:{title:{type:String},modelValue:{default(){return null}},placeholder:[String],required:{type:Boolean,default(){return!1}},rules:{type:Array,default(){return[]}},array:Array,name:String,disabled:Boolean,complex:{type:Boolean,default(){return!1}}},data:()=>({errorMessage:!1,isInsideDisabled:!1,isInsideRequired:!1,value:null}),computed:{arrayParse(){return this.array?this.array.map(t=>["string","number"].includes(typeof t)?{value:t,title:t}:t):[]},currentTitle(){let t="",e=this.arrayParse.find(r=>r.value===this.value);return e&&(t=e.title),t},elemController(){return{_self:this,name:this.name,setValue:t=>{this.setValue(t)},getValue:()=>this.value,validate:()=>this.validate(),disable:()=>{this.isInsideDisabled=!0},enable:()=>{this.isInsideDisabled=!1}}}},emits:["update:modelValue","input"],inject:{formController:{default:null}},methods:{validate(){const t=[...this.rules];this.required&&t.push(e=>e!=null||"Please fill in this field");for(let e=0;e<t.length;e++){let r=t[e](this.value);if(r!==!0)return this.setError(r),!1}return!0},input(t){this.errorMessage=!1,!(this.disabled||this.isInsideDisabled)&&(typeof t=="string"&&t.length===0&&(t=null),this.name&&this.formController&&this.formController.onInput({name:this.name,value:t}),this.setValue(t))},setValue(t){this.value=t,this.$emit("update:modelValue",t),this.$emit("input",t)},select(t){this.input(t)},setError(t){this.errorMessage=t},error(t){this.errorMessage=t}},mounted(){!this.complex&&this.formController&&this.formController.onDepend(this.elemController)},beforeUnmount(){!this.complex&&this.formController&&this.formController.unDepend(this.elemController)},watch:{modelValue(t){this.value=t}}},Pe={props:{password:{type:Boolean,default:()=>!1}},data:()=>({isPasswordVisible:!1}),methods:{togglePasswordVisible(t=!this.isPasswordVisible){this.isPasswordVisible=t}},computed:{inputType(){return this.password&&!this.isPasswordVisible?"password":"text"}}},nn={props:{password:{type:Boolean,default:()=>!1}},data:()=>({isPasswordVisible:!1}),methods:{togglePasswordVisible(t=!this.isPasswordVisible){this.isPasswordVisible=t}}},rn=Object.freeze(Object.defineProperty({__proto__:null,MixinInput:H,MixinInputPassword:nn,MixinInputText:Pe},Symbol.toStringTag,{value:"Module"}));function ve(t,e=[]){let r=t;return e.forEach(o=>{r=o(r)}),r}const on={components:{Icon:E},props:{modify:{type:Function,default:t=>t},pretty:{type:Function,default:t=>t},numeric:{type:Boolean,default:!1},prettyNumeric:{type:Boolean,default:!1}},computed:{prettyValue(){return console.log("pretty value"),this.pretty(ve(this.modelValue,this.arrayInputPrettyModifiers))},arrayInputModifiers(){let t=[];return(this.numeric||this.prettyNumeric)&&t.push(Ae),t},arrayInputPrettyModifiers(){let t=[];return this.prettyNumeric&&t.push(He),t}},methods:{onChange(t){let e=this.modify(ve(t.target.value,this.arrayInputModifiers));this.input(e)},onInput(){const t=this.$refs.input.value,e=this.modify(t);this.input(e),this.$refs.input.value=this.pretty(e)},_onInput(t){let e=this.modify(ve(t.target.value,this.arrayInputModifiers));this.input(e),this.$refs.input.value=this.pretty(ve(this.modelValue,this.arrayInputPrettyModifiers))}},mixins:[H,Pe],name:"InputText"},sn={class:"input-wrap"},an={key:0,class:"input-title"},ln={key:0,class:"input-title_required"},cn=["disabled","error"],dn=["type","placeholder","disabled","error","value"],un={key:1,class:"input-text__error text_sm"};function pn(t,e,r,o,s,i){const l=n.resolveComponent("icon");return n.openBlock(),n.createElementBlock("div",sn,[t.title?(n.openBlock(),n.createElementBlock("p",an,[n.createTextVNode(n.toDisplayString(t.title)+" ",1),t.required?(n.openBlock(),n.createElementBlock("span",ln,"*")):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"input-text-container input_size_md flex",disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage},[n.createElementVNode("input",{class:"input-text",type:t.inputType,placeholder:t.placeholder,disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage,ref:"input",value:r.pretty(t.value),onInput:e[0]||(e[0]=(...a)=>i.onInput&&i.onInput(...a))},null,40,dn),t.password?(n.openBlock(),n.createElementBlock("div",{key:0,class:"input-text__password",onClick:e[1]||(e[1]=a=>t.togglePasswordVisible())},[n.createVNode(l,{class:"cursor_pointer",name:t.isPasswordVisible?"eye-crossed":"eye"},null,8,["name"])])):n.createCommentVNode("",!0),t.errorMessage?(n.openBlock(),n.createElementBlock("p",un,n.toDisplayString(t.errorMessage),1)):n.createCommentVNode("",!0)],8,cn)])}const fn=f(on,[["render",pn],["__scopeId","data-v-65e2ee2d"]]);const mn={mixins:[H],name:"InputToggle"};function hn(t,e,r,o,s,i){return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["input__toggle widget-input",{active:t.value,disabled:t.disabled||t.isInsideDisabled}]),onClick:e[0]||(e[0]=l=>t.input(!t.value))},null,2)}const _n=f(mn,[["render",hn],["__scopeId","data-v-56d58611"]]);const gn={props:["isActive","title"],name:"FragmentInputSelectItem"},yn={class:"item-wrap"};function vn(t,e,r,o,s,i){return n.openBlock(),n.createElementBlock("div",yn,[n.createElementVNode("p",{class:n.normalizeClass(["input-select__item cursor_pointer",{active:r.isActive}])},n.toDisplayString(r.title),3)])}const wn=f(gn,[["render",vn],["__scopeId","data-v-69ab8592"]]);function Z(t,e){if(!t)return console.warn("Element is not provided.");function r(s,i){return s==i.target||s.contains(i.target)}const o=s=>{r(t,s)||(e(),window.removeEventListener("click",o))};window.addEventListener("click",o)}const En={data:()=>({isActive:!1}),computed:{titleValue(){try{return this.arrayParse.find(t=>t.value===this.value).title}catch{return""}}},methods:{active(t=!this.isActive){this.isInsideDisabled||this.disabled||(this.isActive=t)},hide(){this.isActive=!1}},watch:{isActive(t){t&&Z(this.$refs.input,()=>this.hide())}},components:{Icon:E,FragmentInputSelectItem:wn},mixins:[H],name:"InputSelect"},kn={class:"input-wrap"},bn={key:0,class:"input-title"},Cn={key:0,class:"color__text_red"},$n={class:"input-select-container__current input_size_md flex"},Sn={key:0,class:"input-select-value"},Nn={key:1,class:"current-placeholder text_md"},Bn={class:"input-select-list input-select-container__list"},Tn={key:0,class:"input-text__error position_absolute margin-0 text_sm color__text_red"};function Vn(t,e,r,o,s,i){const l=n.resolveComponent("icon"),a=n.resolveComponent("fragment-input-select-item");return n.openBlock(),n.createElementBlock("div",kn,[t.title?(n.openBlock(),n.createElementBlock("p",bn,[n.createTextVNode(n.toDisplayString(t.title)+" ",1),t.required?(n.openBlock(),n.createElementBlock("span",Cn,"*")):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["input-select-container cursor_pointer",{active:t.isActive,disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage}]),onClick:e[1]||(e[1]=c=>i.active()),ref:"input"},[n.createElementVNode("div",$n,[t.value===void 0||t.value===null?(n.openBlock(),n.createElementBlock("span",Nn,n.toDisplayString(t.placeholder),1)):(n.openBlock(),n.createElementBlock("p",Sn,n.toDisplayString(i.titleValue),1)),t.disabled||t.isInsideDisabled?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(l,{key:2,class:"input-select__ico-toggle",name:"caret-down"}))]),n.createElementVNode("div",Bn,[t.value?(n.openBlock(),n.createBlock(a,{key:0,onClick:e[0]||(e[0]=c=>t.input(null))})):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.arrayParse,(c,d)=>(n.openBlock(),n.createBlock(a,{class:"input-select-list__item",key:d,"is-active":c.value===t.value,title:c.title,onClick:u=>t.input(c.value)},null,8,["is-active","title","onClick"]))),128))]),t.errorMessage?(n.openBlock(),n.createElementBlock("p",Tn,n.toDisplayString(t.errorMessage),1)):n.createCommentVNode("",!0)],2)])}const In=f(En,[["render",Vn],["__scopeId","data-v-c4acd469"]]);class wt{static async upload(e,r){const o=new FormData;o.append("file",e);const s=`/close-api/files?entityName=${r}`;return await fetch(s,{method:"POST",body:o}).then(i=>i.json()).then(i=>(i.filename=e.name,i))}}function Oe(t=()=>null){let e=t;const r=n.reactive({wait:!1,error:!1,ready:!1});return r.call=async function(...o){this.wait=!0,this.error=!1,this.ready=!1;try{await e(...o),this.ready=!0}catch{this.error=!0}this.wait=!1},r.setFunction=async function(o){e=o},r}const An=n.defineComponent({props:{entityName:{type:String,required:!0}},emits:["load","change","input"],data:()=>({pw:null}),created(){this.pw=Oe(this.onLoad)},methods:{async onChange(t){t&&this.pw.call(t)},async onLoad(t){const e=await wt.upload(t,this.entityName);this.$emit("load",e),this.name&&this.input(e.id)}},mixins:[H],components:{Icon:E}}),Pn={class:"container-input-file"},On={key:0,class:"process-info input-file__wait text_size_sm"},Rn={key:1,class:"process-info input-file__error text_size_sm text_error"};function Ln(t,e,r,o,s,i){const l=n.resolveComponent("icon");return n.openBlock(),n.createElementBlock("div",Pn,[n.createVNode(l,{name:"plus",class:"icon__file-upload"}),n.createElementVNode("input",{type:"file",class:"input-file",onChange:e[0]||(e[0]=a=>t.onChange(a.target.files[0]))},null,32),t.pw.wait?(n.openBlock(),n.createElementBlock("p",On,"Loading...")):n.createCommentVNode("",!0),t.pw.error?(n.openBlock(),n.createElementBlock("p",Rn,"Error load file")):n.createCommentVNode("",!0)])}const Dn=f(An,[["render",Ln],["__scopeId","data-v-bdbf1475"]]),Fn={InputText:fn,InputToggle:_n,InputSelect:In,InputLoadFile:Dn};const Wn={props:{placeholder:String,error:[Boolean,String]},setup(){return{}},name:"WidgetInputContainer"},Mn=t=>(n.pushScopeId("data-v-1e3f1057"),t=t(),n.popScopeId(),t),jn={class:"widget-input__container"},xn={class:"input-container__content"},Un=Mn(()=>n.createElementVNode("div",{class:"widget-input__underline"},null,-1));function zn(t,e,r,o,s,i){return n.openBlock(),n.createElementBlock("div",jn,[n.createElementVNode("div",xn,[n.renderSlot(t.$slots,"default",{},void 0,!0)]),Un,r.placeholder?(n.openBlock(),n.createElementBlock("p",{key:0,class:n.normalizeClass(["widget-input__placeholder",{"widget-input__placeholder_error":r.error}])},n.toDisplayString(r.placeholder),3)):n.createCommentVNode("",!0)])}const qn=f(Wn,[["render",zn],["__scopeId","data-v-1e3f1057"]]);const Gn={components:{Icon:E,WidgetInputContainer:qn},mixins:[H,Pe],name:"InputText"},Hn=["type","value"];function Jn(t,e,r,o,s,i){const l=n.resolveComponent("icon"),a=n.resolveComponent("widget-input-container");return n.openBlock(),n.createBlock(a,{placeholder:t.placeholder,error:!!t.errorMessage},{default:n.withCtx(()=>[n.createElementVNode("input",{type:t.password&&!t.isPasswordVisible?"password":"text",class:"input-text title_sm",value:t.value,onChange:e[0]||(e[0]=c=>t.input(c.target.value)),onKeyup:e[1]||(e[1]=n.withKeys(c=>t.$emit("enter"),["enter"]))},null,40,Hn),t.password?(n.openBlock(),n.createElementBlock("div",{key:0,class:"input-text__password",onClick:e[2]||(e[2]=c=>t.togglePasswordVisible())},[n.createVNode(l,{class:"cursor_pointer",name:t.isPasswordVisible?"eye-crossed":"eye"},null,8,["name"])])):n.createCommentVNode("",!0)]),_:1},8,["placeholder","error"])}const Kn=f(Gn,[["render",Jn],["__scopeId","data-v-212b50e2"]]),Yn={InputText:Kn};function we(t,e=[]){let r=t;return e.forEach(o=>{r=o(r)}),r}const Xn=n.defineComponent({components:{Icon:E},props:{title:String,modify:{type:Function,default:t=>t},pretty:{type:Function,default:t=>t},numeric:{type:Boolean,default:!1},prettyNumeric:{type:Boolean,default:!1}},computed:{prettyValue(){return console.log("pretty value"),this.pretty(we(this.modelValue,this.arrayInputPrettyModifiers))},arrayInputModifiers(){let t=[];return(this.numeric||this.prettyNumeric)&&t.push(Ae),t},arrayInputPrettyModifiers(){let t=[];return this.prettyNumeric&&t.push(He),t}},methods:{onChange(t){let e=this.modify(we(t.target.value,this.arrayInputModifiers));this.input(e)},onInput(){const t=this.$refs.input.value,e=this.modify(t);this.input(e),this.$refs.input.value=this.pretty(e)},_onInput(t){let e=this.modify(we(t.target.value,this.arrayInputModifiers));this.input(e),this.$refs.input.value=this.pretty(we(this.modelValue,this.arrayInputPrettyModifiers))}},mixins:[H,Pe],name:"InputText"}),Zn={key:0,class:"input-title"},Qn={key:0,class:"color__text_red"},er=["disabled","error"],tr=["type","placeholder","disabled","error","value"],nr={key:1,class:"input-text__error text_sm color__text_red"};function rr(t,e,r,o,s,i){const l=n.resolveComponent("icon");return n.openBlock(),n.createElementBlock(n.Fragment,null,[t.title?(n.openBlock(),n.createElementBlock("p",Zn,[n.createTextVNode(n.toDisplayString(t.title)+" ",1),t.required?(n.openBlock(),n.createElementBlock("span",Qn,"*")):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"input-text-container flex",disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage},[n.createElementVNode("input",{class:"input-text",type:t.inputType,placeholder:t.placeholder,disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage,ref:"input",value:t.pretty(t.value),onInput:e[0]||(e[0]=(...a)=>t.onInput&&t.onInput(...a))},null,40,tr),t.password?(n.openBlock(),n.createElementBlock("div",{key:0,class:"input-text__password",onClick:e[1]||(e[1]=a=>t.togglePasswordVisible())},[n.createVNode(l,{class:"cursor_pointer",name:t.isPasswordVisible?"eye-crossed":"eye"},null,8,["name"])])):n.createCommentVNode("",!0),t.errorMessage?(n.openBlock(),n.createElementBlock("p",nr,n.toDisplayString(t.errorMessage),1)):n.createCommentVNode("",!0)],8,er)],64)}const or=f(Xn,[["render",rr],["__scopeId","data-v-9c3e5ea6"]]),sr={InputText:or},ir={default:Fn,line:Yn,naomi:sr};const ar={components:{Icon:E},props:{title:String,values:[Object,Array,String]},setup(t){Array.isArray(t.values)&&t.values.forEach(l=>{l.func&&console.warn("Prop func is deprecated. Use callback.",l)});const e=n.computed(()=>{if(!o.value)return"30px";let l=0;return Array.isArray(t.values)&&(l+=t.values.length),t.title&&l++,typeof t.values=="string"&&!Array.isArray(t.values)&&l++,l*30+"px"}),r=n.computed(()=>Array.isArray(t.values)?t.values:typeof t.values=="string"?{title:t.values}:[t.values]),o=n.ref(!1);function s(l=!o.value){o.value=l,l&&Z(i.value,()=>s(!1))}const i=n.ref(null);return{isActive:o,array:r,toggle:s,button:i,maxHeight:e}},name:"Button"},lr={class:"widget-button-wrap flex"},cr=["onClick"];function dr(t,e,r,o,s,i){const l=n.resolveComponent("icon");return n.openBlock(),n.createElementBlock("div",lr,[n.createElementVNode("div",{class:n.normalizeClass(["widget-button flex",{active:o.isActive}]),ref:"button"},[n.createElementVNode("div",{class:"widget-button__list flex_column",style:n.normalizeStyle({maxHeight:o.maxHeight})},[r.title?(n.openBlock(),n.createElementBlock("span",{key:0,class:"widget-button__list-elem cursor_pointer",onClick:e[0]||(e[0]=a=>o.toggle())},n.toDisplayString(r.title),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.array,(a,c)=>(n.openBlock(),n.createElementBlock("span",{class:"widget-button__list-elem cursor_pointer",onClick:d=>(a.callback(),o.toggle(!1)),key:c},n.toDisplayString(a.title),9,cr))),128))],4),o.array.length>1?(n.openBlock(),n.createElementBlock("div",{key:0,class:"widget-button__toggle flex flex_center cursor_pointer",onClick:e[1]||(e[1]=n.withModifiers(a=>o.toggle(),["stop"]))},[n.createVNode(l,{class:"widget-button__toggle-icon",name:"angle-small-down"})])):n.createCommentVNode("",!0)],2)])}const Et=f(ar,[["render",dr],["__scopeId","data-v-b6be5c12"]]);const ur={props:{icon:String,func:Function},name:"WidgetFormFunctionItem",components:{Icon:E}};function pr(t,e,r,o,s,i){const l=n.resolveComponent("icon");return n.openBlock(),n.createElementBlock("div",{class:"function-item cursor_pointer",onClick:e[0]||(e[0]=(...a)=>r.func&&r.func(...a))},[n.createVNode(l,{name:r.icon},null,8,["name"])])}const fr=f(ur,[["render",pr],["__scopeId","data-v-73f7eb9f"]]);const mr={props:{title:String},name:"WidgetFormTitle"},hr={class:"form-title"},_r={class:"title_lg color__text_black margin-0"};function gr(t,e,r,o,s,i){return n.openBlock(),n.createElementBlock("div",hr,[n.createElementVNode("h2",_r,n.toDisplayString(r.title),1)])}const yr=f(mr,[["render",gr],["__scopeId","data-v-c91ffa31"]]);const vr={components:{WidgetFormTitle:yr,WidgetFormFunctionItem:fr,WidgetButton:Et},props:{title:String,button:{type:[Array,Object],default:()=>[]},functions:[Array]},name:"WidgetForm"},wr={class:"widget-form flex_column"},Er={class:"widget-form__head flex"},kr={class:"widget-form__head-functions flex"},br={class:"widget-form__body"};function Cr(t,e,r,o,s,i){const l=n.resolveComponent("widget-form-title"),a=n.resolveComponent("widget-button"),c=n.resolveComponent("widget-form-function-item");return n.openBlock(),n.createElementBlock("div",wr,[n.createElementVNode("div",Er,[n.createVNode(l,{title:r.title},null,8,["title"]),Array.isArray(r.button)&&r.button.length||!Array.isArray(r.button)&&r.button?(n.openBlock(),n.createBlock(a,{key:0,class:"widget-form__head-button",values:r.button},null,8,["values"])):n.createCommentVNode("",!0),n.createElementVNode("div",kr,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.functions,(d,u)=>(n.openBlock(),n.createBlock(c,{key:u,icon:d.icon,func:d.callback},null,8,["icon","func"]))),128))])]),n.createElementVNode("div",br,[n.renderSlot(t.$slots,"default",{},void 0,!0)])])}const $r=f(vr,[["render",Cr],["__scopeId","data-v-c3e88e10"]]),Sr={default:{WidgetForm:$r}};const Nr={props:{title:String,subTitle:String,type:[String,Number],double:{type:Boolean,default:()=>!1}},name:"ContainerFormElem"},Br={class:"form-container-item__title flex"},Tr={class:""},Vr={key:0,class:""},Ir={class:"title_sm"},Ar={key:1,class:"form-container-item__right"};function Pr(t,e,r,o,s,i){return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["form-container-item flex",[`form-container-item-${r.type}`]])},[n.createElementVNode("div",Br,[n.createElementVNode("span",Tr,n.toDisplayString(r.title),1)]),n.createElementVNode("div",{class:n.normalizeClass(["form-container-item-center flex_column",{content_double:r.double}])},[n.renderSlot(t.$slots,"default",{},void 0,!0)],2),r.subTitle?(n.openBlock(),n.createElementBlock("div",Vr,[n.createElementVNode("span",Ir,n.toDisplayString(r.subTitle),1),n.renderSlot(t.$slots,"centerRight",{},void 0,!0)])):n.createCommentVNode("",!0),t.$slots.right?(n.openBlock(),n.createElementBlock("div",Ar,[n.renderSlot(t.$slots,"right",{},void 0,!0)])):n.createCommentVNode("",!0)],2)}const Or=f(Nr,[["render",Pr],["__scopeId","data-v-9264f6f4"]]);const Rr={name:"ContainerAuthView"},Lr={class:"container-auth-wrap"},Dr={class:"container-auth-sidebar"},Fr={class:"container-auth-main"};function Wr(t,e,r,o,s,i){return n.openBlock(),n.createElementBlock("div",Lr,[n.createElementVNode("div",Dr,[n.renderSlot(t.$slots,"side",{},void 0,!0)]),n.createElementVNode("div",Fr,[n.renderSlot(t.$slots,"default",{},void 0,!0)])])}const Mr=f(Rr,[["render",Wr],["__scopeId","data-v-0b1a5e81"]]),jr={ContainerFormElem:Or,ContainerAuthView:Mr},xr=n.defineComponent({__name:"widget-spinner",props:{color:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",{class:"loader",style:n.normalizeStyle({"border-left":`1.1em solid ${e.color?e.color:"#fff"}`})},null,4))}});const Q=f(xr,[["__scopeId","data-v-661e0416"]]),Ur={class:"button-element"},zr=n.defineComponent({__name:"WidgetButton",props:{title:{},callback:{type:Function},wait:{type:Boolean},default:{type:Boolean}},setup(t){const e=t;function r(s){s.key==="Enter"&&o.call()}n.onMounted(()=>{e.default&&document.addEventListener("keypress",r)}),n.onUnmounted(()=>{document.removeEventListener("keypress",r)});const o=Oe(e.callback);return(s,i)=>(n.openBlock(),n.createElementBlock("div",{class:"button-wrap",onClick:i[0]||(i[0]=l=>n.unref(o).call())},[n.unref(o).wait||s.wait?(n.openBlock(),n.createBlock(Q,{key:0,class:"button-spinner"})):n.createCommentVNode("",!0),n.createElementVNode("button",Ur,[n.createTextVNode(n.toDisplayString(s.title)+" ",1),n.renderSlot(s.$slots,"default",{},void 0,!0)])]))}});const kt=f(zr,[["__scopeId","data-v-3cf452e1"]]),qr={class:"widget-button-wrap"},Gr={class:"widget-multi-button"},Hr={class:"widget-button-list"},Jr=["onClick"],Kr={class:"button__side"},Yr={key:0,class:"button__size-progress"},Xr=n.defineComponent({__name:"WidgetMultiButton",props:{title:{},array:{}},setup(t){const e=Oe(),r=n.reactive({active:!1});function o(i=!r.active){r.active=i}function s(i){e.setFunction(i),e.call()}return(i,l)=>(n.openBlock(),n.createElementBlock("div",qr,[n.createElementVNode("div",Gr,[n.createElementVNode("div",{class:n.normalizeClass(["button__content",{button__content_active:r.active}])},[i.title?(n.openBlock(),n.createElementBlock("p",{key:0,class:"button__content-title widget-multi-button-row",onClick:l[0]||(l[0]=a=>o())},n.toDisplayString(i.title),1)):n.createCommentVNode("",!0),n.createElementVNode("div",Hr,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.array,(a,c)=>(n.openBlock(),n.createElementBlock("p",{class:"button__content-title widget-multi-button-row",key:c,onClick:d=>(s(a.callback),o(!1))},n.toDisplayString(a.title),9,Jr))),128))])],2),n.createElementVNode("div",Kr,[n.unref(e).wait?(n.openBlock(),n.createElementBlock("div",Yr,[n.createVNode(Q,{class:"button-spinner"})])):i.array&&i.array.length>1?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["button__size-toggle widget-multi-button-toggle",{button__toggle_active:r.active}]),onClick:l[1]||(l[1]=a=>o())},[n.createVNode(E,{class:"button__toggle-icon",name:"angle-small-down"})],2)):n.createCommentVNode("",!0)])])]))}});const Je=f(Xr,[["__scopeId","data-v-3edae6ea"]]),Zr={WidgetButton:kt,WidgetMultiButton:Je},Qr={Icon:E},$=new class{constructor(){this.store=n.reactive([])}add(e,r,{children:o,timeout:s=10}={}){const i=new eo(e,r,s,o||[]);return this.store.push(i),s&&setTimeout(this.remove.bind(this,i.id),s*1e3),i}remove(e){const r=this.store.findIndex(o=>o.id===e);if(r===-1)return!1;this.store.splice(r,1)}removeChild(e,r){throw new Error("Removing children error.")}},bt=class Ct{constructor(e,r,o,s){this.type=e,this.msg=r,this.timeout=o,this.children=s,this.id=Ct.cardId++}};bt.cardId=1;let eo=bt;const to={class:"widget-error"},no={class:"widget-error-wrap"},ro={class:"widget-error-main"},oo={class:"widget-error-text widget-error-message"},so={class:"widget-error__container-close"},io=n.defineComponent({__name:"WidgetError",props:{isGroup:{type:Boolean},message:{}},emits:["close","toggle"],setup(t,{emit:e}){return(r,o)=>(n.openBlock(),n.createElementBlock("div",to,[n.createElementVNode("div",no,[n.createElementVNode("div",ro,[n.createElementVNode("p",oo,n.toDisplayString(r.message),1)]),r.isGroup?(n.openBlock(),n.createElementBlock("p",{key:0,onClick:o[0]||(o[0]=s=>e("toggle")),class:"article-details"},"See details")):n.createCommentVNode("",!0),n.createElementVNode("div",so,[n.createElementVNode("div",{class:"widget-error-close",onClick:o[1]||(o[1]=s=>e("close"))})])])]))}});const it=f(io,[["__scopeId","data-v-8a0a0924"]]),ao={key:0,class:"widget-error-details"},lo=n.defineComponent({__name:"WidgetErrorGroup",props:{card:{}},emits:["closeCard","closeChild"],setup(t,{emit:e}){const r=t,o=n.computed(()=>{var i;return!!((i=r.card.children)!=null&&i.length)}),s=n.ref(!0);return(i,l)=>(n.openBlock(),n.createElementBlock("div",null,[(n.openBlock(),n.createBlock(it,{message:i.card.msg,key:i.card.id,onClose:l[0]||(l[0]=a=>e("closeCard",i.card.id)),onToggle:l[1]||(l[1]=a=>s.value=!s.value),"is-group":o.value},null,8,["message","is-group"])),!s.value&&i.card.children?(n.openBlock(),n.createElementBlock("div",ao,[n.createVNode(n.TransitionGroup,{name:"fade"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.card.children,a=>(n.openBlock(),n.createBlock(it,{key:a.id,message:a.msg,onClose:c=>e("closeChild",a.id)},null,8,["message","onClose"]))),128))]),_:1})])):n.createCommentVNode("",!0)]))}});const co=f(lo,[["__scopeId","data-v-aa732044"]]),uo={class:"container-errors"},po=n.defineComponent({__name:"WidgetNotificationSystem",setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",uo,[n.createVNode(n.TransitionGroup,{name:"fade"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref($).store,o=>(n.openBlock(),n.createBlock(co,{key:o.id,card:o,onCloseCard:s=>n.unref($).remove(o.id),onCloseChild:s=>n.unref($).removeChild(o.id,s)},null,8,["card","onCloseCard","onCloseChild"]))),128))]),_:1})]))}});const $t=f(po,[["__scopeId","data-v-8e9870dd"]]),fo={default:$t};let mo={inputs:ir,forms:Sr,containers:jr,buttons:Zr,icons:Qr,errorSystem:fo};const ho={inputs:tn};function fe(t,e){if(typeof t!="object"||t===null)return;if(e in t)return t[e];let r=e.indexOf(".");if(r>-1){const o=e.substring(0,r);return o in t?fe(t[o],e.substr(r+1)):void 0}return t[e]}function Ke(t){return t.reduce((e,r)=>e.then(o=>r==null?void 0:r(o)),Promise.resolve())}const St=class g extends Error{constructor(e,r=null){super(),this.message=e,this.details=r,this.id=g.ID++}static ParentFormNotFound(){return new g("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new g("Composite object name is undefined",e)}static EntityWithoutName(e){return new g("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new g(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new g("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new g("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new g(`${e} (id) is not a number`)}static UndefinedErrorId(e,r){return g.ApiNotAvailable()}static ApiError(e){return new g("Request error",e)}static ApiNotAvailable(){return new g(`Sorry, we experience difficulties here.
6
6
  Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,r){return!e&&!r?g.ApiNotAvailable():new g(e||"Authorization Error",r)}static ApiResponseParseFailed(){return g.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new g("Object doesn't have id",e)}static ObjectWithIdNotFound(e,r){return new g(`Can't find object with id: ${e}`,r)}static ObjectWithoutConnectToPresentArray(e,r){return new g("Object is not found.",{object:e,array:r})}static EntityWithoutId(e){return new g("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,r){return new g(`Can't find the element with tableIndex ${e}`,r)}static UndefinedError(e,r=[]){return new g(e,r)}static TableArrayAlreadyIncludeProvidedIndexValue(e,r,o){return new g(`Array already includes the element with value ${e}`,{array:r,table:o})}static MetadataEntityIsNotAvailable(e){return new g(`Metadata for the ${e} is not currently available.`)}};St.ID=0;let T=St;const Nt="Please try again later or submit a feedback if problem doesn't go.";function pe(t){return typeof t=="string"?Me(t):_o(t)?Me(t.message):Me(Nt)}function _o(t){return!!(typeof t=="object"&&Object.hasOwnProperty.call(t,"message")&&t!==null)}function Me(t,e=[]){return{message:t,details:e}}class Bt{static getClientData(){return p("/close-api/client-content")}static getNavigation(){return p("/close-api/client/navigation")}}/*!
7
7
  * jenesius-event-emitter v1.0.2
8
8
  * (c) 2022 Jenesius
9
9
  * @license MIT
10
- */const at=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},lt=function(t,e){t in this.events&&this.events[t].forEach(r=>r(e))},ct=function(t,e){const r=this.events[t];if(!r)return;const o=r.indexOf(e);o!==-1&&r.splice(o,1)},dt=function(){this.events={}};class P{constructor(){this.events={}}on(e,r){return at.call(this,e,r)}emit(e,r){return lt.call(this,e,r)}off(e,r){return ct.call(this,e,r)}cleanEvents(){dt.call(this)}static on(e,r){return at.call(P,e,r)}static emit(e,r){return lt.call(P,e,r)}static off(e,r){return ct.call(P,e,r)}static cleanEvents(){dt.call(P)}}P.events={};var Tt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},Ee=(t,e,r)=>(Tt(t,e,"read from private field"),r?r.call(t):e.get(t)),je=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},xe=(t,e,r,o)=>(Tt(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),re,ke,be;const J=class A extends P{constructor(){super(...arguments),je(this,re,void 0),je(this,ke,"front"),this.organizations=[],je(this,be,!1)}set language(e){localStorage.setItem(A.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(A.LOCALSTORAGE_LANGUAGE_KEY)||A.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(A.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){xe(this,re,e)}get router(){if(!Ee(this,re))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return Ee(this,re)}set type(e){xe(this,ke,e)}get type(){return Ee(this,ke)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){xe(this,be,e),this.emit(A.EVENT_READY_UPDATE,e)}get ready(){return Ee(this,be)}onReady(e){return this.on(A.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(A.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(A.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(A.CURRENT_CONTEXT_KEY,String(e)),this.emit(A.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(r=>r.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const r=Number.parseInt(localStorage.getItem(A.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(r)&&this.validateContextId(Number(r))?this.setCurrentContext(r):this.setCurrentContext(Number(e.id))}catch{$.add("error",T.ApiNotAvailable().message)}}loadCustomerData(){return Bt.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var r;return((r=this.person)==null?void 0:r.id)==e?!0:!!this.organizations.find(o=>o.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const r=localStorage.getItem(this.getListKeyById(e));return r&&JSON.parse(r)}setListInformationToLocalStorage(e,r){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(r))}};re=new WeakMap;ke=new WeakMap;be=new WeakMap;J.DEFAULT_LANGUAGE="en";J.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";J.EVENT_CONTEXT_UPDATE="event:context-update";J.EVENT_READY_UPDATE="event:ready-update";J.EVENT_DATA_UPDATE="event:data-update";J.CURRENT_CONTEXT_KEY="CurrentContext";let Vt=J;const _=new Vt;function go(){const t=n.reactive({contextType:_.contextType,contextId:_.contextId,context:_.context});return _.onupdateContext(()=>{t.contextType=_.contextType,t.contextId=_.contextId,t.context=_.context}),t}function yo(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return Nt}})}function p(t,e={}){return _.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=_.contextId),e.redirect="manual",fetch(t,e).then(r=>r.type==="opaqueredirect"?void window.location.replace("/auth"):r).catch(()=>{throw T.ApiNotAvailable()}).then(r=>yo(r).then(o=>{if(!r.ok)throw o;return o}))}class Re{constructor(){}static parseNamesFromListConfig(e){let r=Re.parseFieldsToGraphQL(e.reduce((s,i)=>(i.name&&s.push(i.name),s),[]));function o(s){let i="";for(let l in s)typeof s[l]=="boolean"?i+=` ${l} `:i+=` ${l} { ${o(s[l])} }`;return i}return o(r)}static parseSortFromListConfig(e){let r={};for(let o in e)r[o]=e[o]?"ASC":"DESC";return r}static parseFieldsToGraphQL(e){function r(o,s){if(s.includes(".")){const i=s.indexOf("."),l=s.substring(i+1),a=s.substring(0,i);a in o||(o[a]={}),r(o[a],l)}else o[s]=!0;return o}return e.reduce(r,{})}}class vo{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,r,o)=>(r!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),e[r]=o,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}const It=new vo;function At(t){return t&&t[0].toLowerCase()+t.slice(1)}const wo={props:{message:String},name:"ModalWait",components:{WidgetSpinner:Q}},Eo={class:"modal__wait modal-default flex_column"};function ko(t,e,r,o,s,i){const l=n.resolveComponent("widget-spinner");return n.openBlock(),n.createElementBlock("div",Eo,[n.createVNode(l),n.createElementVNode("p",null,n.toDisplayString(r.message),1)])}const bo=f(wo,[["render",ko],["__scopeId","data-v-4d18289e"]]),Co={error:!0,wait:!1,throw:!0};async function Le(t,e={}){const r={modalWait:null};e=Object.assign({},e,Co);try{e.wait&&(r.modalWait=await yt.openModal(bo,{message:typeof e.wait=="string"?e.wait:""}))}catch(o){console.warn(o)}return Promise.resolve(t()).catch(o=>{let s=o;if(typeof s=="string"&&(s=T.UndefinedError(s)),e.error&&(console.log(s,s.details),s instanceof T?$.add("error",s.message,{children:s.details||[],timeout:12}):s!=null&&s.message?$.add("error",s.message):(console.warn(s),$.add("error",T.ApiResponseParseFailed().message))),e.throw)throw s}).finally(()=>{var o;(o=r.modalWait)==null||o.close()})}function De(t){return Object.keys(t).reduce((e,r)=>{let o=t[r];const s=r.charAt(0).toUpperCase()+r.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=De(o)),e[s]=o,e},{})}function Pt(t,e=2){if(!(typeof t=="string"||typeof t=="number"))return"";let o=String(t).split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.length<2&&(o[1]=""),o[1]=o[1].padEnd(e,"0"),o[1].length>e&&(o[1]=o[1].substring(0,e)),o.join(".")}const de={Request:p,clickOutside:Z,getPropFromObject:fe,runPromiseQueue:Ke,GraphQL:Re,firstChapterToLowerCase:At,requestHandler:Le,valuesToUpperCase:De,prettyMoney:Pt},$o=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Re,Journal:It,Request:p,clickOutside:Z,default:de,firstChapterToLowerCase:At,getPropFromObject:fe,requestHandler:Le,runPromiseQueue:Ke,valuesToUpperCase:De},Symbol.toStringTag,{value:"Module"}));function Ot(t,e=""){for(let r in t){if(typeof t[r]=="object"){Ot(t[r],(e.length?`${e}-`:"")+r);continue}let o="--"+((e.length?`${e}-`:"")+r).replace(/([A-Z])/g,s=>`-${s}`.toLowerCase());document.documentElement.style.setProperty(o,t[r])}}const M={};function So(t){for(let e in t)M[e]=t[e];t.styles&&Ot(t.styles),It.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=M}const No=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function Bo(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&typeof t[1]=="number"}const To="masterId",Vo="masterEntity";function Ve(t,e){if(!Array.isArray(e))return;if(Bo(e))return r(e);e.forEach(r);function r(o){t.append(Vo,o[0]),t.append(To,o[1].toString())}}class V{static async anonymousGetList(e){return await p(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(e,r){const o=new URLSearchParams;function s(l,a){const c=d=>o.append("fields",d);if(typeof a=="string")return c(a);if(Array.isArray(a))return c(a.join(" "));if(typeof a=="object")return c(Object.keys(a).join(" "))}function i(l,a){if(!a||!Object.keys(a).length)return;const c=Object.entries(a).map(([d,u])=>`@${d} ${u}`).join(",");l.append("order",c)}return r&&(s(o,r.fields),i(o,r.order),r.limit&&o.append("limit",r.limit.toString()),r.offset&&o.append("offset",r.offset.toString()),r.filter&&o.append("filter",r.filter.toString()),r.useUsageContext&&o.append("useUsageContext",r.useUsageContext.toString())),await p(`/close-api/data/${e}?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,r){const o=new URLSearchParams;function s(l,a){const c=d=>o.append("fields",d);if(typeof a=="string")return c(a);if(Array.isArray(a))return c(a.join(" "));if(typeof a=="object")return c(Object.keys(a).join(" "))}function i(l,a){if(!a||!Object.keys(a).length)return;const c=Object.entries(a).map(([d,u])=>`@${d} ${u}`).join(",");l.append("order",c)}return r&&(s(o,r.fields),i(o,r.order),r.limit&&o.append("limit",r.limit.toString()),r.offset&&o.append("offset",r.offset.toString()),r.filter&&o.append("filter",r.filter.toString()),r.useUsageContext&&o.append("useUsageContext",r.useUsageContext.toString())),p(`/close-api/data/entities/${e}/count?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,r,o){const s=new URLSearchParams;return Ve(s,o==null?void 0:o.masterEntities),p(`/close-api/data/${e}?${s.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static update(e,r,o,s={}){return p(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:o})})}static readById(e,r,o={}){const s=new URLSearchParams;if(o.fields){let i=o.fields;typeof i=="string"&&(i=[i]),s.append("fields",i.join(" "))}return p(`/close-api/data/entities/${e}/id/${r}?${s.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,r,o,s){const i=new URLSearchParams;return Ve(i,s==null?void 0:s.masterEntities),p(`/close-api/data/entities/${e}/id/${r}?${i.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:o,version:s==null?void 0:s.version})})}static removeById(e,r,o){const s=typeof r=="number"?{Id:r}:r;return V.removeByKeys(e,s,o)}static removeByKeys(e,r,o){return p(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:r,version:o})})}}var Rt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},Ue=(t,e,r)=>(Rt(t,e,"read from private field"),r?r.call(t):e.get(t)),ut=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},pt=(t,e,r,o)=>(Rt(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),oe,Ce;const Ye=class K extends P{constructor(e){super(),ut(this,oe,[]),ut(this,Ce,!1),this.hashParams="",this.offset=0,this.name=e.name}set wait(e){pt(this,Ce,e),this.emit(K.EVENT_CHANGE_WAIT,e)}get wait(){return Ue(this,Ce)}read(e){var s,i;this.wait=!0;const r={};e.order&&(r.order={[(s=e.order)==null?void 0:s.name]:(i=e.order)==null?void 0:i.duration}),e.fields&&(r.fields=e.fields),e.filter&&(r.filter=e.filter);const o=JSON.stringify(r.order)+JSON.stringify(r.filter);return o!==this.hashParams&&(this.offset=0,this.hashParams=o),e.limit&&(r.limit=e.limit),e.offset&&(r.offset=e.offset||this.offset),V.getList(this.name,r).then(l=>(this.offset===0&&(this.array=[]),this.offset+=r.limit,l)).then(l=>{this.array.push(...l)}).then(()=>this.emit(K.EVENT_DATA,this.array)).finally(()=>{this.wait=!1})}set array(e){pt(this,oe,e),this.emit(K.EVENT_DATA,this.array)}add(e){Ue(this,oe).push(...e),this.emit(K.EVENT_DATA,this.array)}get array(){return Ue(this,oe)}static GetFieldNames(e){return e.reduce((r,o)=>(o.name&&(typeof o.name=="string"?r.push(o.name):r.push(...o.name)),r),[])}static getCellInfo(e,r){const o=K.getCellName(e),s=(()=>{let i=o?fe(r,o):null;return i===void 0&&(i=null),e.value?e.value(i,r):i})();return{name:o,value:s}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}};oe=new WeakMap;Ce=new WeakMap;Ye.EVENT_DATA="LIST:DATA";Ye.EVENT_CHANGE_WAIT="LIST:UPDATE-WAIT";let Lt=Ye;const C=Symbol("__ROW_INDEX__");let me=class extends Lt{constructor(e){super(e),this.rowIndex=1,this.changes={new:{},edit:{},remove:[]},this.save=()=>{}}get changed(){return Object.keys(this.changes.new).length||Object.keys(this.changes.edit).length||this.changes.remove.length}create(e){const r=this.wrapData(e);this.changes.new[r[C]]=r,this.emitChanges()}cleanChanges(){this.changes.new={},this.changes.edit={},this.changes.remove=[],this.emitChanges()}edit(e,r){const o=this.wrapData(r,e);if(this.changes.new[e])return this.changes.new[e]=o,this.emitChanges();this.array.find(s=>s[C]===e)&&(this.changes.edit[e]={...this.changes.edit[e],...o},this.emitChanges())}remove(e){if(this.changes.new[e])return delete this.changes.new[e],this.emitChanges();this.array.find(r=>r[C]===e)&&(delete this.changes.edit[e],this.changes.remove.includes(e)||this.changes.remove.push(e),this.emitChanges())}wrapData(e,r){return r===void 0&&!Object.prototype.hasOwnProperty.call(e,C.toString())&&(r=++this.rowIndex),{...e,[C]:r}}emitChanges(){this.emit(y.Form.EVENT_CHANGED,!0)}set array(e){super.array=e.map(r=>this.wrapData(r))}get array(){return super.array}log(e){console.log(`[table] ${e}`)}};me.PROVIDE_NAME="table-controller";function Io(t){return function(r){return{activate(){t(r)},deactivate(){t(null)}}}}function Ao(t){const e=n.reactive(t.array);n.provide(me.PROVIDE_NAME,t);const r=n.reactive(t.changes);t.on(Lt.EVENT_DATA,l=>e.splice(0,e.length,...l)),t.on(y.Form.EVENT_CHANGED,()=>{r.new=Object.keys(t.changes.new).reduce((l,a)=>{const c=Number(a);return l[c]=t.changes.new[c],l},{})});const o=n.computed(()=>[...e.reduce((l,a)=>{const c=a[C];return t.changes.remove.includes(c)||l.push({...a,...t.changes.edit[c]}),l},[]),...Object.values(r.new)]),s=y.Form.getParentForm();return s==null||s.subscribe(t),{activeRow:n.ref(null),array:o}}function Po(t,e){t.read=()=>V.getList(t.name,{fields:e==null?void 0:e.fields}).then(r=>t.array=r).then(()=>t.emit(y.Form.EVENT_READ,t.array)),t.save=()=>{const r=t.name;Object.values(t.changes.new).forEach(async s=>{await V.create(r,s)}),Object.entries(t.changes.edit).forEach(async([s,i])=>{await V.updateById(t.name,o(Number(s)),i)});function o(s){const i=t.array.find(l=>l[C]===s);return i.id|i.Id}t.changes.remove.forEach(async s=>{await V.removeById(r,o(s),0)}),t.emit(y.Form.EVENT_SAVE)}}const Oo=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Ro{static readHistoryById(e,r){return p(`/close-api/audits/history/${e}/${r}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(o=>{const s=o.history.map(i=>{if(!i.changes)return i;const l=i.changes.map(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...i,changes:l}});return{...o,history:s}})}}var Dt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},F=(t,e,r)=>(Dt(t,e,"read from private field"),r?r.call(t):e.get(t)),U=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},z=(t,e,r,o)=>(Dt(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),$e,se,Se,Ne,ie,ae,ze;const q="_______LIST_______ROW_______INDEX________NAME_______",he=class W extends P{constructor(e){super(),this.LIST_ROW_KEY=1,U(this,$e,void 0),this.array=[],U(this,se,[]),U(this,Se,[]),U(this,Ne,new Proxy({},{set:(r,o,s,i)=>(r[o]=s,this.emit(W.EVENT_FILTERS_UPDATE,r),!0),deleteProperty:(r,o)=>(delete r[o],this.emit(W.EVENT_FILTERS_UPDATE,r),!0)})),U(this,ie,!1),U(this,ae,(...r)=>Promise),U(this,ze,()=>{}),z(this,$e,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&z(this,se,e.config)}set config(e){z(this,se,e.map(y.utils.copyObject)),this.emitUpdateConfig()}get config(){return F(this,se)}emitUpdateConfig(){this.emit(W.EVENT_CONFIG_UPDATE,this.config)}get order(){return F(this,Se)}set order(e){z(this,Se,e),this.emit(W.EVENT_ORDER_UPDATE,this.order)}get filters(){return F(this,Ne)}set filters(e){xt(F(this,Ne),e)}set wait(e){z(this,ie,e),this.emit(y.Form.EVENT_WAIT,F(this,ie))}get wait(){return F(this,ie)}get primaryKeys(){return F(this,$e)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(r=>r[q]===e)}indexByKey(e){return this.array.findIndex(r=>r[q]===e)}static getKey(e){return e[q]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,q)}add(...e){const r=this.wrapArray(e);this.array.push(...r),this.emit(W.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const r=this.indexByKey(e);r!==-1&&(this.array.splice(r,1),this.emit(W.EVENT_DATA,this.array))}updateByKey(e,r){const o=this.atByKey(e);o&&(Object.assign(o,r),this.emit(W.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[q]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,q)}set read(e){z(this,ae,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const r=F(this,ae).call(this,...e);return this.wait=!0,r}).finally(()=>this.wait=!1)}set save(e){z(this,ae,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>F(this,ze).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((r,o)=>(o.name&&(typeof o.name=="string"?r.push(o.name):r.push(...o.name)),r),[])}static mergeWithKey(e,r){return{...e,[q]:r}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,r){const o=W.getCellName(e),s=(()=>{let i=o?fe(r,o):null;return i===void 0&&(i=null),e.value?e.value(i,r):i})();return{name:o,value:s}}};$e=new WeakMap;se=new WeakMap;Se=new WeakMap;Ne=new WeakMap;ie=new WeakMap;ae=new WeakMap;ze=new WeakMap;he.EVENT_DATA="list-data: update";he.EVENT_CONFIG_UPDATE="list-config:update";he.EVENT_ORDER_UPDATE="list-order:update";he.EVENT_FILTERS_UPDATE="list-filters:update";let R=he;function Ft(t,e){let r="",o=0,s=!1,i;t.read=(l={})=>{if(t.wait)return i;if(l.clean&&(r="",o=0,s=!1),s)return Promise.resolve([]);let a=e;typeof a=="function"&&(a=a());const c={};if(!t.name)throw new Error("Reading list`s data without name is not available.");a.order&&Array.isArray(a.order)&&a.order.length&&(c.order={[a.order[0]]:a.order[1]||"asc"}),a.fields&&(c.fields=a.fields),a.filter&&(c.filter=a.filter);const d=JSON.stringify(c.order)+JSON.stringify(c.filter)+JSON.stringify(c.fields);return d!==r&&!Number.isNaN(d)&&(o=0,r=d),"limit"in a&&(c.limit=a.limit),c.offset=o||a.offset||0,i=V.getList(t.name,c).then(u=>((o===0||l.clean)&&t.set([]),o+=c.limit,u)).then(u=>(t.add(...u),u.length===0&&(s=!0),u)),i}}function Wt(t){const e=n.reactive({wait:t.wait,array:[]});return t.on(R.EVENT_DATA,r=>{e.array.splice(0,e.array.length,...r.map(o=>Object.freeze(JSON.parse(JSON.stringify(o)))))}),t.on(y.Form.EVENT_WAIT,()=>{e.wait=t.wait}),e}function Mt(t,e){const r="list-flex-config",o=n.inject(r,void 0);if(o)return o;if(!t||!e)throw new Error("Hook useProvideList has two required params: list and defaultSettings");t.on(R.EVENT_CONFIG_UPDATE,()=>{t.read()});const s={list:t,defaultSettings:e};return n.provide(r,s),s}function Lo(t){const e=n.reactive([...t.config]);return t.on(R.EVENT_CONFIG_UPDATE,r=>{e.splice(0,e.length,...r)}),e}function jt(t){const e=t.order||[],r=n.reactive(e);return t.on(R.EVENT_ORDER_UPDATE,o=>{r.splice(0,r.length,...o),t.read()}),r}function Do(t){const e=n.ref(""),r=n.computed(()=>{const o=e.value.toLowerCase();return n.unref(t).filter(s=>e.value.length?Object.values(s).join().toLowerCase().includes(o):!0)});return{search:e,searchArray:r}}function xt(t,e){Object.keys(t).forEach(r=>delete t[r]),Object.entries(e).forEach(([r,o])=>{t[r]=o})}function Fo(t){const e=n.reactive(y.utils.copyObject(t.filters));return t.on(R.EVENT_FILTERS_UPDATE,r=>{xt(e,r),t.read()}),e}function Wo(t){const e=n.reactive([]);function r(a){return e.includes(a)}function o(a){r(a)||e.push(a)}function s(a){const c=e.findIndex(d=>d===a);c!==-1&&e.splice(c,1)}function i(a){const c=n.unref(t);if(a===void 0){e.length===0?c.forEach(o):c.forEach(s);return}r(a)?s(a):o(a)}const l=n.computed(()=>{const a=n.unref(t);return e.length===a.length&&a.length!==0});return[e,i,l,o,s]}class Mo extends R{constructor(e){super(e),this.changes=[],this.save=jo.bind(this)}get changed(){return!!this.changes.find(e=>e.status==="active")}addChange(e,r){this.changes.push({type:e,status:"active",data:this.wrapItem(r)})}}function jo(){const t=this.changes.filter(e=>e.status==="active");return Ke(t.map(e=>{console.log("++")}))}function xo(){const t=n.ref(null);function e(r){t.value=r&&vt(r)}return{activeRow:t,activateRow:e}}const Uo={props:{config:Array},name:"WidgetTableHead"},zo={class:"widget-table__head"},qo={class:"widget-table__head-title"};function Go(t,e,r,o,s,i){return n.openBlock(),n.createElementBlock("tr",zo,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.config,(l,a)=>(n.openBlock(),n.createElementBlock("th",{class:"widget-table__head-cell",key:a},[n.createElementVNode("p",qo,n.toDisplayString(l.title),1)]))),128))])}const Ho=f(Uo,[["render",Go],["__scopeId","data-v-f478f0d8"]]);function Ut(t){return Xe(t,"YYYY/MM/DD HH:mm:ss")}function Xe(t,e="YYYY/MM/DD"){if(!t)return"";try{const r=new Date(t);return Xt.format(r,e)}catch(r){return console.log(r),"Invalid date"}}function Jo(t,e){const r=t.config.map(o=>Ko(o,t,e));return n.h("tr",{class:"widget-table__row widget-table-row"},r)}function Ko(t,e,r){const o=e.values;let{name:s,value:i}=R.getCellInfo(t,o);const l={onClick:[],class:["widget-table__cell widget-table-cell"]};function a(h){l.onClick.push(()=>h(o))}function c(h){Array.isArray(h)?l.class.push(...h):l.class.push(h)}const d=[],u=[];if(t.hide&&t.hide(o))return[n.h("td")];if(t.type)switch(c(`widget-table-cell_${t.type}`),t.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Xe(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Ut(typeof i=="string"?i:null);break}case"multi-select":{u.push(n.h(y.FormField,{type:"single-checkbox",modelValue:e.selected})),a(ft.bind(null,r,!0));break}case"select":{u.push(n.h(y.FormField,{type:"single-radio",modelValue:e.selected})),a(ft.bind(null,r,!1));break}}if(t.checked){const h=t.checked(o);u.push(n.h(y.FormField,{type:"single-checkbox",modelValue:h}))}if(t.onClick&&a(t.onClick),t.link)try{const h=t.link(o);if(h){const b=n.h(Ge.RouterLink,{to:h});u.push(b),c("list-cell-link")}}catch(h){console.warn("Error handle: Add Router link to cell",h)}return t.href&&(u.push(n.h("a",{href:t.href(o),target:"_blank"})),c("list-cell-link")),i!=null&&u.push(n.h("p",{class:"widget-list-cell-text"},i)),t.icon&&u.push(n.h(E,{name:t.icon})),t.class&&(typeof t.class=="function"?c(t.class(o)):c(t.class)),d.push(n.h("td",l,u)),d}function ft(t,e){t.emit("select",e)}function zt(t,e){return()=>{try{return Jo(t,e)}catch(r){return console.warn(r),null}}}const Yo={props:{values:Object,config:Object,selected:Boolean},setup:zt},Xo=["colspan"],mt=n.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{}},emits:["save","remove","close"],setup(t,{emit:e}){const r=t,o=n.ref(),s=n.computed(()=>!r.values&&!R.hasKey(r.values));return n.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(i,l)=>(n.openBlock(),n.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[n.createElementVNode("td",{colspan:i.rowLength},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.component),n.mergeProps(i.$attrs,{values:i.values,new:s.value,onClose:l[0]||(l[0]=a=>e("close")),onSave:l[1]||(l[1]=a=>e("save",a))}),null,16,["values","new"]))],8,Xo)],512))}}),Zo={class:"widget-wait flex gap_10 padding_15"},Qo={class:"text_md"},es=n.defineComponent({__name:"widget-wait",props:{label:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",Zo,[n.createVNode(Q,{color:"var(--primary)",class:"wait-spinner"}),n.createElementVNode("span",Qo,n.toDisplayString(e.label),1)]))}});const qt=f(es,[["__scopeId","data-v-2038b2ba"]]),ts=n.defineComponent({__name:"widget-table",props:{array:{},config:{},mini:{type:Boolean},activeRow:{},selectRows:{},wait:{type:Boolean},classCallback:{type:Function}},emits:["update:activeRow","update:selectRows","save","read"],setup(t,{emit:e}){const r=t,o=n.useSlots(),s=n.computed(()=>{var c;return(c=o==null?void 0:o.default)==null?void 0:c.call(o)[0]}),i=n.computed(()=>r.array.map(c=>({values:c,hash:vt(c)})));function l(c,d=!0){return r.selectRows?d?r.selectRows.indexOf(c)===-1?e("update:selectRows",[...r.selectRows,c]):e("update:selectRows",r.selectRows.filter(h=>h!==c)):e("update:selectRows",[c]):void 0}function a(c){e("save",c),e("update:activeRow",null)}return(c,d)=>(n.openBlock(),n.createElementBlock("div",null,[n.createVNode(n.Transition,{name:"move-horizontal"},{default:n.withCtx(()=>[c.wait?(n.openBlock(),n.createBlock(qt,{key:0,label:"Loading data",color:"black",class:"widget-table-loader"})):n.createCommentVNode("",!0)]),_:1}),n.createElementVNode("table",{class:n.normalizeClass(["widget-table",{"widget-table_mini":c.mini}])},[n.createVNode(Ho,{config:c.config},null,8,["config"]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,({values:u,hash:h},b)=>{var v;return n.openBlock(),n.createElementBlock(n.Fragment,{key:b},[n.createVNode(Yo,{config:c.config,values:u,selected:(v=c.selectRows)==null?void 0:v.includes(u),onSelect:w=>l(u,w),class:n.normalizeClass(c.classCallback?c.classCallback(u):"")},null,8,["config","values","selected","onSelect","class"]),s.value&&c.activeRow===h?(n.openBlock(),n.createBlock(mt,{key:0,component:s.value,"row-length":c.config.length,values:u,onClose:d[0]||(d[0]=w=>e("update:activeRow",null)),onSave:a,onRead:d[1]||(d[1]=w=>e("read"))},null,8,["component","row-length","values"])):n.createCommentVNode("",!0)],64)}),128)),c.activeRow===0?(n.openBlock(),n.createBlock(mt,{key:0,component:s.value,"row-length":c.config.length,onClose:d[2]||(d[2]=u=>e("update:activeRow",null)),onSave:a,onRead:d[3]||(d[3]=u=>e("read"))},null,8,["component","row-length"])):n.createCommentVNode("",!0)])],2)]))}});const ns=Object.freeze(Object.defineProperty({__proto__:null,List:R,Table:Mo,WidgetTable:ts,useListOrder:jt,useListProvide:Mt,useListRead:Ft,useListState:Wt,useTableActiveRow:xo},Symbol.toStringTag,{value:"Module"}));class rs extends P{constructor(){super(),this.EVENT_NEW="event:new-metadata",this.store={}}get(e){return this.store[e]}async load(e){return this.store[e]||this.set(e,await this.loadEntityInformation(e)),this.store[e]}set(e,r){this.store[e]=r,this.emit(this.EVENT_NEW,{entityName:e})}async loadEntityInformation(e){return await Ze.get(e)}}const le=new rs;function os(t){const e=n.ref(le.get(t));return le.on(le.EVENT_NEW,r=>{t===r.entityName&&(e.value=le.get(t))}),e}function ss(t,e){return e.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}class is{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return p(`/open-api/internationalization/language/${e}`)}}let G={};function X(t,...e){if(typeof t!="string")return console.trace(`Label is not provided for translation: ${t}`),"undefined";let r=y.utils.getPropFromObject((this==null?void 0:this.vocabulary)||G,t);if(typeof r=="string")return ht(r,e);const o=y.utils.getPropFromObject(G==null?void 0:G.root,t);return typeof o=="string"?ht(o,e):(typeof r===void 0&&console.warn(`Translation for label "${t}" is not founded.`),t)}function ht(t,e){return e.forEach((r,o)=>{t=t.replaceAll(new RegExp(`\\{${o}}`,"g"),r)}),t}X.setGlobalVocabulary=function(t){G=t};X.getScope=function(t){const e=typeof t=="string"?t:"root";return typeof t!="string"&&console.warn(`SCOPE ${t} for translate is not string.`),X.bind({vocabulary:y.utils.getPropFromObject(G,e.toLowerCase())})};X.setVocabulary=function(t){return typeof t=="string"&&(t=y.utils.getPropFromObject(G,t)),X.bind({vocabulary:t})};function as(t="default"){if(qe.manager)return qe.manager.socket(`/${t}`)}class qe{}function ls(t=window.location.origin+"/socket.io"){qe.manager=new Zt.Manager(t,{reconnectionDelayMax:1e3,withCredentials:!0,transports:["websocket","polling"]})}const cs={class:"breadcrumb__title"},ds=n.defineComponent({__name:"widget-breadcrumb-item",props:{active:{type:Boolean},title:{},link:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["breadcrumb flex",{breadcrumb_active:e.active}])},[n.createElementVNode("p",cs,n.toDisplayString(e.title),1),e.active?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(E,{key:0,class:"breadcrumb__icon",name:"caret-right"}))],2))}});const us=f(ds,[["__scopeId","data-v-1702aee0"]]),ps={class:"widget-breadcrumbs"},fs=n.defineComponent({__name:"widget-breadcrumbs",props:{array:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",ps,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.array,(o,s)=>(n.openBlock(),n.createBlock(us,{key:s,title:o.title,link:o.link,active:s===e.array.length-1},null,8,["title","link","active"]))),128))]))}});const ms=f(fs,[["__scopeId","data-v-1dfb2668"]]),hs={props:{config:Array,values:Object,selected:Boolean},setup:zt};const _s=f(hs,[["__scopeId","data-v-47478206"]]),gs=t=>(n.pushScopeId("data-v-03c9724f"),t=t(),n.popScopeId(),t),ys={class:"head-cell"},vs=gs(()=>n.createElementVNode("div",{class:"head-cell-resize"},null,-1)),ws=n.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(t,{emit:e}){const r=t;return r.title&&console.warn(`For cell ${r.name} using title,it should be replaced with label.`),(o,s)=>(n.openBlock(),n.createElementBlock("th",null,[n.createElementVNode("div",ys,[n.createElementVNode("div",{class:"head-cell-content flex_grow",style:n.normalizeStyle({"min-width":o.minWidth,"max-width":o.maxWidth,width:o.width})},[o.type==="multi-select"?(n.openBlock(),n.createBlock(n.unref(y.FormField),{key:0,type:"single-checkbox",onClick:s[0]||(s[0]=n.withModifiers(i=>e("select"),["stop","prevent"]))})):(n.openBlock(),n.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:s[1]||(s[1]=i=>e("order"))},n.toDisplayString(o.title||o.label),1))],4),o.name&&o.order.length&&o.order[0]===o.name?(n.openBlock(),n.createBlock(n.unref(E),{key:0,class:n.normalizeClass(["head-cell-order",{"head-cell-order_down":o.order.length>1&&o.order[1]==="desc"}])},{default:n.withCtx(()=>[n.createTextVNode("core-arrow-up")]),_:1},8,["class"])):n.createCommentVNode("",!0),vs])]))}});const Es=f(ws,[["__scopeId","data-v-03c9724f"]]),ks=n.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const r=t,o=n.ref(),s=n.ref();n.onMounted(()=>{function c(v,w){let k=-1;do k++,w-=v[k];while(w>0&&k<v.length);return k}function d(v,w){let k=0;for(;w>0&&w>v[k]&&k<v.length;)w-=v[k],k++;return console.log(w,k),k>0?k:0}function u(v){try{s.value.style.insetInlineStart=v+"px"}catch(w){console.log(w)}}function h(v){try{s.value.style.width=v+"px",s.value.style.minWidth=v+"px",s.value.style.maxWidth=v+"px"}catch(w){console.log(w)}}function b(v){return v===null?!1:v.classList.contains("head-cell-resize")}o.value.addEventListener("pointerdown",function(w){var st;function k(I){return I.screenX+S-D}const j=o.value,m=[...j.children].filter(I=>I.localName==="th"),S=((st=j.offsetParent)==null?void 0:st.scrollLeft)||0,x=m.map(I=>I.clientWidth),ee=b(w.target),D=j.getBoundingClientRect().left,ge=k(w),N=c(x,ge),tt=x.slice(0,N).reduce((I,L)=>I+L,0),nt=ge-tt,Fe=j.offsetWidth,te=m[N].clientWidth;if(r.config[N].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",w.screenX),console.log("Widths",x),console.log("max width",Fe),console.log("Start Position",ge),console.log("Position From",N),console.log("Start Position",N),console.log("Global offset (Отступ самой таблицы от края экрана)",D),console.log("Del",nt),console.groupEnd(),s.value.innerText=m[N].textContent||"",s.value.style.display="grid",s.value.style.width=te+"px",s.value.style.cursor="grabbing",u(tt),h(te),document.addEventListener("pointermove",ot,{passive:!0}),document.addEventListener("pointerup",rt);function rt(I){if(console.group("END"),document.removeEventListener("pointermove",ot),document.removeEventListener("pointerup",rt),ee&&(r.config[N].width=s.value.style.width,r.config[N].minWidth=s.value.style.width,r.config[N].maxWidth=s.value.style.width,i(r.config)),!ee){const L=I.screenX+S-D;console.log("ENP Position",L);const ye=d(x,L);if(console.log(N,"->",ye),ye!==N){const ne=r.config[N],We=r.config;We.splice(N,1),We.splice(ye,0,ne),i(We)}else{const ne=r.config[N].name;l(ne)}}s.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function ot(I){if(ee){const ne=k(I)-ge+te;h(ne);return}let L=I.screenX+S-D-nt;L<0&&(L=0),L+te>Fe&&(L=Fe-te),u(L)}})});function i(c){e("update:config",c)}function l(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(r.order.length===0||r.order[0]!==c)return void a([c]);const d=r.order.length===1||r.order[1]==="asc"?"asc":"desc";a([c,d==="asc"?"desc":"asc"])}function a(c){e("update:order",c)}return(c,d)=>(n.openBlock(),n.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:o},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.config,(u,h)=>(n.openBlock(),n.createBlock(Es,n.mergeProps({key:u},u,{onOrder:b=>l(u.name),onSelect:d[0]||(d[0]=b=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),n.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:s},"test",512)],512))}});const bs=f(ks,[["__scopeId","data-v-11644ad4"]]),Cs=50,$s=n.defineComponent({__name:"widget-list",props:{array:{},wait:{type:Boolean},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(t,{emit:e}){const r=t;function o(a,c=!0){var d;if(r.selectedRows)if(!c)i([a]);else{const u=r.selectedRows.indexOf(a);u===-1?r.selectedRows.push(a):(d=r.selectedRows)==null||d.splice(u,1),i(r.selectedRows)}}function s(){var a;if(((a=r.selectedRows)==null?void 0:a.length)!==r.array.length)return i([...r.array]);i([])}function i(a){e("update:selectedRows",a)}function l(a){if(!a)return;const c=a.target;c.scrollTop+c.clientHeight+Cs>c.scrollHeight&&e("scrollEnd")}return(a,c)=>(n.openBlock(),n.createElementBlock("div",{class:"es-list-container",onScrollPassive:l},[n.createElementVNode("table",{class:n.normalizeClass(["widget-list",{"widget-list_load":a.wait}])},[n.createElementVNode("thead",null,[n.createVNode(bs,{onSelect:c[0]||(c[0]=d=>s()),"onUpdate:order":c[1]||(c[1]=d=>e("update:order",d)),"onUpdate:config":c[2]||(c[2]=d=>e("update:config",d)),config:a.config,order:a.order},null,8,["config","order"])]),n.createElementVNode("tbody",{class:n.normalizeClass(["widget-list-body",{"widget-list-body_inactive":a.wait}])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.array,(d,u)=>{var h;return n.openBlock(),n.createBlock(_s,{key:u,class:"widget-list-row",values:d,config:a.config,selected:(h=a.selectedRows)==null?void 0:h.includes(d),onSelect:b=>o(d,b)},null,8,["values","config","selected","onSelect"])}),128))],2)],2)],32))}});const Ss=f($s,[["__scopeId","data-v-eb609a21"]]),Ns={class:"widget-section"},Bs={class:"widget-section__header"},Ts={class:"widget-section-title"},Vs={class:"widget-section__body"},Is=n.defineComponent({__name:"widget-section",props:{title:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",Ns,[n.createElementVNode("div",Bs,[n.createElementVNode("p",Ts,n.toDisplayString(e.title),1)]),n.createElementVNode("div",Vs,[n.renderSlot(e.$slots,"default",{},void 0,!0)])]))}});const As=f(Is,[["__scopeId","data-v-07232553"]]);const Ps={props:{config:Array},name:"WidgetTableHead"},Os={class:"widget-table__head"},Rs={class:"widget-table__head-title"};function Ls(t,e,r,o,s,i){return n.openBlock(),n.createElementBlock("tr",Os,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.config,(l,a)=>(n.openBlock(),n.createElementBlock("th",{class:"widget-table__head-cell",key:a},[n.createElementVNode("p",Rs,n.toDisplayString(l.label||l.title),1)]))),128))])}const Ds=f(Ps,[["render",Ls],["__scopeId","data-v-2d396466"]]);function Fs(t,e,r){const o=t.map(s=>Ws(s,e,r));return n.h("tr",{class:"widget-table__row widget-table-row"},o)}function Ws(t,e,r){const{name:o,value:s}=R.getCellInfo(t,e),i={onClick:[],class:["widget-table__cell widget-table-cell"]};function l(u){i.onClick.push(()=>u(s,e))}function a(u){Array.isArray(u)?i.class.push(...u):i.class.push(u)}const c=[],d=[];if(t.type)switch(a(`widget-table-cell_${t.type}`),t.type){case"edit":{t.icon="edit",l(r.activate);break}case"remove":{l(r.removeRow),t.icon="remove";break}case"select-multi":{l(r.select.bind(r,!0)),a("widget-table-cell_use"),a("widget-table-cell_select"),d.push(n.h("div",{class:{"table-cell-toggle":!0,"table-cell-toggle_active":r.selected.value}}));break}case"select":{l(r.select.bind(r,!1)),a("widget-table-cell_use"),a("widget-table-cell_select"),d.push(n.h("div",{class:{"table-cell-toggle":!0,"table-cell-toggle_active":r.selected.value}}));break}}return t.onClick&&l(t.onClick),t.link&&(d.push(n.h(Ge.RouterLink,{to:t.link(s,e)})),a("list-cell-link")),t.href&&(d.push(n.h("a",{href:t.href(s,e),target:"_blank"})),a("list-cell-link")),s&&d.push(n.h("p",{},s)),t.icon&&d.push(n.h(E,{name:t.icon})),t.class&&a(t.class),c.push(n.h("td",i,d)),c}const Ms={props:{values:Object,config:Object,selected:Et},emits:["set","remove","select"],setup(t,e){const{emit:r}=e,o={activate(){r("set",t.values[C])},deactivate(){r("set",null)},removeRow(){r("remove")},selected:n.computed(()=>t.selected),select(s=!1){r("select",s)}};return()=>Fs(t.config,t.values,o)}},js={class:"widget-table-form"},xs=["colspan"],_t=n.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},controller:{}},setup(t){const e=t,r=n.computed(()=>{var l;return!((l=e.values)!=null&&l[C])}),o=n.inject(me.PROVIDE_NAME);function s(l){o&&(r.value?o.create(l):o.edit(e.values[C],l))}function i(){e.controller.deactivate()}return(l,a)=>(n.openBlock(),n.createElementBlock("tr",js,[n.createElementVNode("td",{colspan:l.rowLength},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.component),{values:l.values,"table-controller":l.controller,onSave:s,onClose:i,new:r.value},null,40,["values","table-controller","new"]))],8,xs)]))}}),Us=n.defineComponent({__name:"widget-table",props:{array:{},config:{},mini:{type:Boolean},activeRow:{},selectRows:{}},emits:["update:activeRow","update:selectRows"],setup(t,{emit:e}){const r=t;n.inject(me.PROVIDE_NAME);const o=n.useSlots(),s=n.computed(()=>{var a;return(a=o==null?void 0:o.default)==null?void 0:a.call(o)[0]});function i(a,c=!0){return r.selectRows?c?r.selectRows.indexOf(a)===-1?e("update:selectRows",[...r.selectRows,a]):e("update:selectRows",r.selectRows.filter(u=>u!==a)):e("update:selectRows",[a]):void 0}const l=Io(a=>e("update:activeRow",a));return n.onMounted(()=>{console.warn("WidgetTable is deprecated. Please use WidgetTable from new Import. Config: ",r.config)}),(a,c)=>(n.openBlock(),n.createElementBlock("table",{class:n.normalizeClass(["widget-table",{"widget-table_mini":a.mini}])},[n.createVNode(Ds,{config:a.config},null,8,["config"]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.array,(d,u)=>{var h;return n.openBlock(),n.createElementBlock(n.Fragment,{key:u},[n.createVNode(Ms,{config:a.config,values:d,selected:(h=a.selectRows)==null?void 0:h.includes(d[n.unref(C)]),onSet:c[0]||(c[0]=b=>e("update:activeRow",b)),onSelect:b=>i(d[n.unref(C)],b)},null,8,["config","values","selected","onSelect"]),a.activeRow===d[n.unref(C)]?(n.openBlock(),n.createBlock(_t,{key:0,component:s.value,controller:n.unref(l)(d[n.unref(C)]),"row-length":a.config.length,values:d},null,8,["component","controller","row-length","values"])):n.createCommentVNode("",!0)],64)}),128)),a.activeRow===0?(n.openBlock(),n.createBlock(_t,{key:0,component:s.value,controller:n.unref(l)(0),"row-length":a.config.length},null,8,["component","controller","row-length"])):n.createCommentVNode("",!0)])],2))}}),zs={class:"widget-form-info flex"},qs={class:"form-titles"},Gs={class:"form-title margin-0"},Hs={class:"form-info text_size_md margin-0"},Js={key:0,class:"form-container-label"},Ks={class:"form-label__title text_size_sm"},Ys=n.defineComponent({__name:"WidgetFormInfo",props:{title:{},info:{},label:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",zs,[n.createElementVNode("div",qs,[n.createElementVNode("p",Gs,n.toDisplayString(e.title),1),n.createElementVNode("p",Hs,n.toDisplayString(e.info),1)]),e.label?(n.openBlock(),n.createElementBlock("div",Js,[n.createElementVNode("div",{class:n.normalizeClass(["form-label",`form-label_${e.label.type}`])},[e.label.icon?(n.openBlock(),n.createBlock(E,{key:0,class:"form-label__icon",name:e.label.icon},null,8,["name"])):n.createCommentVNode("",!0),n.createElementVNode("p",Ks,n.toDisplayString(e.label.title),1)],2)])):n.createCommentVNode("",!0)]))}});const Xs=f(Ys,[["__scopeId","data-v-6ea1062c"]]),Zs={class:"wrap__widget-form"},Qs={class:"widget-form"},ei={class:"widget-form__head"},ti={class:"head-image"},ni={key:1},ri={class:"widget-form__body"},oi=n.defineComponent({__name:"WidgetForm",props:{title:{},info:{},image:{},icon:{},label:{},button:{},wait:{type:Boolean}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",Zs,[n.createElementVNode("div",Qs,[n.createElementVNode("div",ei,[n.createElementVNode("div",ti,[e.wait?(n.openBlock(),n.createBlock(Q,{key:0,color:"#3949AB"})):(n.openBlock(),n.createElementBlock("div",ni,[e.icon?(n.openBlock(),n.createBlock(E,{key:0,class:"form-image",name:e.icon},null,8,["name"])):n.createCommentVNode("",!0)]))]),n.createVNode(Xs,{title:e.title,info:e.info,label:e.label},null,8,["title","info","label"]),e.button&&e.button.length?(n.openBlock(),n.createBlock(Je,{key:0,class:"widget-form__button",array:e.button},null,8,["array"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",ri,[n.renderSlot(e.$slots,"default",{},void 0,!0)])])]))}});const si=f(oi,[["__scopeId","data-v-f076ad65"]]),ii={class:"validation-item-header"},ai={class:"validation-item__title text_bold margin-0"},li={class:"validation-item-content"},ci={class:"text_bold text_md margin-0"},di={class:"text_md margin-0"},ui=n.defineComponent({__name:"modal-validation-item",props:{message:{},status:{},statusName:{},title:{},name:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["validation-item",`validation-item_${e.statusName.toLowerCase()}`])},[n.createElementVNode("div",ii,[n.createElementVNode("p",ai,n.toDisplayString(e.statusName),1)]),n.createElementVNode("div",li,[n.createElementVNode("p",ci,n.toDisplayString(e.title),1),n.createElementVNode("p",di,n.toDisplayString(e.message),1)])],2))}});const pi=f(ui,[["__scopeId","data-v-e6138c02"]]),fi={class:"modal-wrap"},mi={class:"modal-wrap-head"},hi={class:"modal-head__title margin-0"},_i={class:"modal-wrap-body"},gi=n.defineComponent({__name:"modal-wrap",props:{title:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",fi,[n.createElementVNode("div",mi,[n.createElementVNode("p",hi,n.toDisplayString(e.title),1)]),n.createElementVNode("div",_i,[n.renderSlot(e.$slots,"default",{},void 0,!0)])]))}});const yi=f(gi,[["__scopeId","data-v-119165b9"]]),vi={class:"modal-validation-body"},wi=n.defineComponent({__name:"modal-validation",props:{array:{}},setup(t){return(e,r)=>(n.openBlock(),n.createBlock(yi,{title:"Validation results"},{default:n.withCtx(()=>[n.createElementVNode("div",vi,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.array,(o,s)=>(n.openBlock(),n.createBlock(pi,{key:s,message:o.message,name:o.name,status:o.statusCode,"status-name":o.statusName,title:o.title},null,8,["message","name","status","status-name","title"]))),128))])]),_:1}))}});const Ei=f(wi,[["__scopeId","data-v-a39cfe2f"]]),ki=["alt","src"],bi=n.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,r=n.ref();return n.onMounted(()=>{r.value&&(r.value.src=e.src),r.value.onerror=function(){e.default&&(r.value.src=e.default)}}),(o,s)=>(n.openBlock(),n.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:r,src:o.src||o.$props.default},null,8,ki))}}),Ci=n.defineComponent({__name:"widget-input-check",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const r=t;function o(){e("update:modelValue",!r.modelValue)}return(s,i)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["widget-input-check",{"widget-input-check_active":s.modelValue}]),onClick:o},[s.modelValue?(n.openBlock(),n.createBlock(E,{key:0,name:"check"})):n.createCommentVNode("",!0)],2))}});const $i=f(Ci,[["__scopeId","data-v-f4a3dc6c"]]),Si={class:"widget-card"},Ni={class:"widget-card-toggle"},Bi={class:"widget-card-wrap"},Ti={class:"widget-card-content"},Vi={key:0,class:"widget-card-title"},Ii=n.defineComponent({__name:"widget-card",props:{title:{}},setup(t,{expose:e}){const r=n.reactive({selected:!1,hidden:!0});return e({state:r}),(o,s)=>(n.openBlock(),n.createElementBlock("div",Si,[n.createElementVNode("div",Ni,[n.createVNode($i,{modelValue:r.selected,"onUpdate:modelValue":s[0]||(s[0]=i=>r.selected=i)},null,8,["modelValue"])]),n.createElementVNode("div",Bi,[n.createElementVNode("div",{class:"widget-card-arrow",onClick:s[1]||(s[1]=i=>r.hidden=!r.hidden)},[n.createVNode(E,{name:"angle-small-right",class:n.normalizeClass(["card-icon-arrow",{"card-icon-arrow_active":!r.hidden}])},null,8,["class"])]),n.createElementVNode("div",Ti,[o.title?(n.openBlock(),n.createElementBlock("p",Vi,n.toDisplayString(o.title),1)):n.createCommentVNode("",!0),n.renderSlot(o.$slots,"main",{},void 0,!0),r.hidden?n.createCommentVNode("",!0):n.renderSlot(o.$slots,"sub",{key:1},void 0,!0)])])]))}});const Ai=f(Ii,[["__scopeId","data-v-bca33c5b"]]);class B{static parseError(e){let r=e.errors?Object.values(e.errors).map(o=>o[0]):null;throw T.AuthServiceError(e.title,r)}static login(e){return p(M.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:M.applicationName})}).catch(B.parseError)}static registration(e){return e.AppName=M.applicationName,p(M.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(B.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw T.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return B.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return B.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return B.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return B.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,r){return p(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(r)}).catch(B.parseError)}static startLoginProcess(e){return B.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return B.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return B.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,r){return p(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(r)}).catch(B.parseError).then(B.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw T.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}const Gt=class ce{static async create(e){return p(ce.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const r=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return p(ce.url+"?"+r.toString(),{method:"get"})}static async readMessages(e){return p(`${ce.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return p(`${ce.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};Gt.url="/close-api/communications";let ue=Gt;class Pi{static async getDefaultView(e){return p("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function gt(t){return{...t,createdEntities:t.createdEntites}}const Ht=class Be{static async getStartConfig(e,r){return p([Be.url,e,r].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,r){return p([Be.url,e,r].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(gt)}static async runStep(e,r,o,s,i){return p([Be.url,e,r].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:o,token:s,values:i})}).then(gt)}};Ht.url="/close-api/views/process-wizard";let Te=Ht;class Ze{static get url(){return"/close-api/metadata"}static async get(e,r,o){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const s=new URLSearchParams;return r&&s.append("criteria",r),o&&s.append("id",String(o)),await fetch(this.url+`/${e}?${s.toString()}`,{method:"GET"}).then(i=>i.json())}static getById(e,r,o=[]){const s=new URLSearchParams;return Ve(s,o),r&&s.append("id",r),p([this.url,e].join("/")+`?${s.toString()}`)}static getFieldInformation(e,r){return p(`/open-api/metadata/${e}/fields/${r}`)}static getTreatmentListField(e,r){return p(`/open-api/metadata/${e}/list-fields/${r}`)}}class Oi{static invite(e,r,o){return p("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:r,relatedRoleCode:o})})}static accept(e,r){return p("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:r,mark:!0})})}static decline(e,r){return p("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:r,mark:!1})})}}class Qe{static get url(){return"/close-api/rules-validation/"}static validate(e,r){return p(Qe.url+e,{method:"POST",body:JSON.stringify(r)})}}class Ri{static getConfiguration(){return p("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class Jt{static url(){return"/close-api/actions"}static async get({criterion:e}){const r=new URLSearchParams;return e&&r.append("criterion",e),await fetch(this.url()+`?${r.toString()}`,{method:"GET"}).then(o=>o.json())}static getById(e,r,o=[]){const s=new URLSearchParams;return Ve(s,o),p([this.url(),e,r].join("/")+`?${s.toString()}`,{method:"GET"})}}const Kt=class Yt extends P{constructor(e=[]){super(),this.array=n.reactive([]),this.defaultArray=[],this.setDefault(e)}emitUpdate(){this.emit(Yt.EVENT_DATA,this.array)}setDefault(e){const r=JSON.parse(JSON.stringify(e));this.defaultArray=r,this.set(r)}revert(){this.set(this.defaultArray)}set(e){this.array.splice(0,this.array.length,...e),this.emitUpdate()}append(e){this.array.push(e),this.emitUpdate()}moveTo(e,r){if(this.isOutOfRange(e)||this.isOutOfRange(r))throw new Error(`Provided position is out of range: ${e}, ${r}`);const o=this.array[e];this.array.splice(e,1),this.array.splice(r,0,o),this.emitUpdate()}remove(e){this.array.splice(e,1),this.emitUpdate()}isOutOfRange(e){return!(e>=0&&e<this.array.length)}};Kt.EVENT_DATA="list-config:update";let Li=Kt;class Di extends P{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return ue.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return ue.read(e).then(r=>r.length===0?ue.create(e):r[0])}}function Fi(t){const e=y.Form.getParentForm();e?e.subscribe(t):console.warn(T.ParentFormNotFound());const r=n.reactive([]);return t.read=()=>ue.readMessages(t.id).then(o=>(r.splice(0,r.length,...o),o)),{array:r}}function Wi(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function O(t){return Object.keys(t).reduce((e,r)=>{const o=t[r];if(Array.isArray(o)){const s=o.map(i=>typeof i=="string"?`'${i}'`:i).join(", ");return o.length&&e.push(`@${r} in (${s})`),e}if(Wi(o)){let s=function(i){var l;return((l=i.match(/([^Z]*)/))==null?void 0:l[0])+"0000Z"};return o.start&&e.push(`@${r} ge ${s(o.start)}`),o.end&&e.push(`@${r} le ${s(o.end)}`),e}return typeof o=="number"?(e.push(`@${r} eq ${o}`),e):typeof o=="string"?(o.length!==0&&e.push(`@${r} eq '${o}'`),e):(o===null&&e.push(O.is(r,o)),e)},[]).join(" and ")}function _e(t){return typeof t=="string"?`'${t}'`:`${t}`}O.includes=function(e,r){return`@${e} Contains ${_e(r)}`};O.beginWith=function(e,r){return`@${e} BeginWith ${_e(r)}`};O.notEq=function(e,r){return`@${e} nq ${_e(r)}`};O.eq=function(e,r){return Array.isArray(r)?O.in(e,r):`@${e} eq ${_e(r)}`};O.in=function(e,r){const o=r.map(_e).join(", ");return`@${e} in (${o})`};O.and=function(...e){return e.join(" and ")};O.is=function(e,r){return`@${e} is ${r}`};O.or=function(...e){return e.join(" or ")};function Mi(t,e="images"){return`/static-folder/${e}/${t}`}function ji(t,e,r){return t.reduce((o,s)=>{var a;let i=typeof e=="function"?e(s):s[e];const l=(a=o[o.length-1])==null?void 0:a.value;return l&&r(l,i)?o[o.length-1].array.push(s):o.push({value:i,array:[s]}),o},[])}function xi(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function Ui(t,e=1e3){let r=0;return(...o)=>{clearTimeout(r),r=setTimeout(()=>t(...o),e)}}function zi(t,e){const r=n.ref(null);function o(){return t.name?Ze.getById(t.name,e,[]).then(s=>{r.value=s,s.fields.forEach(i=>{i.canSet?t.enable(i.name):t.disable(i.name)})}).catch(()=>{r.value=null;const s=T.MetadataEntityIsNotAvailable(t.name||"FORM_WITHOUT_NAME");$.add("error",s.message)}):Promise.reject()}return t.on(y.Form.EVENT_READ,o),{metadata:r,update:o}}class et extends Error{static UndefinedStatus(){return new et("Status is undefined.")}}class qi extends et{}function Gi(t,e){const r=n.reactive([]);async function o(i,l){if(!i)throw qi.UndefinedStatus();const a=await Jt.get({criterion:i});r.splice(0,r.length),r.push(...a.map(c=>s(c,l)))}return{actions:r,update:o};function s(i,l){return{title:i.title,callback:()=>(()=>Promise.resolve().then(()=>{if(t.changed)return t.save()}).then(()=>fetch(i.url,{method:"POST",body:JSON.stringify({keys:{Id:l},contextId:_.contextId}),headers:{"Content-Type":"application/json"}})).then(c=>c.json()).then(c=>{if(!c.success)throw e!=null&&e.ModalValidationResult&&c.validationEffect?yt.openModal(e.ModalValidationResult,{rules:c.validationEffect.results}):$.add("error",c.message),new Error;return c}).then(c=>{c.message&&$.add("info",c.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(c.affectedEntities)}).then(()=>t.read()))()}}}class Ie{static url(){return"/close-api/presentation"}static getStatuses(e,r){return fetch(`${Ie.url()}/status/${e}/${r}`).then(o=>o.json())}}function Hi(t){const e=n.reactive({title:"Loading",type:"wait"});function r(o){if(t.name&&Number.isInteger(o))return Ie.getStatuses(t.name,o).then(s=>{e.type=s.type,e.title=s.name})}return t.on(y.Form.EVENT_READ,o=>{var l,a;const{code:s,name:i}={code:(l=o.Status)==null?void 0:l.Code,name:(a=o.Status)==null?void 0:a.Name};return t.name?!Number.isInteger(s)&&!i?void console.log("Undefined code or name is Status prop."):Ie.getStatuses(t.name,s).then(c=>{e.type=c.type,e.title=i}):void console.log("Form without name.")}),{label:e,update:r}}function Ji(t,e){const r=Ge.useRoute(),o=n.computed(()=>Number(r.params.id)),s=n.reactive({ready:!1,show:!1});return n.watch(()=>o.value,()=>{s.ready=!1}),n.watch(()=>o.value,()=>{Number.isInteger(o.value)&&t.read()},{immediate:!0}),t.read=de.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!t.name)throw new Error("Form without entity name. Please set form.name");return V.readById(t.name,o.value,{fields:e.fields})}).then(de.valuesToUpperCase).then(i=>(Number.isInteger(i.Version)&&(t.version=i.Version),t.setValues(i),s.show=!0,i)).catch(i=>{throw Object.prototype.hasOwnProperty.call(i,"status")&&[403,404].includes(i.status)&&(s.show=!1),i}).finally(()=>{s.ready=!0})),t.save=de.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!t.name)throw new Error("Form without entity name. Please set form.name");return V.updateById(t.name,o.value,t.changes,{version:t.version})}).then(i=>{t.version=i.version})),t.on(y.Form.EVENT_SAVE,t.read.bind(t)),{formShadowState:s}}function Ki(){const t=n.reactive({contextId:_.contextId,person:_.person,organizations:_.organizations,ready:_.ready,user:_.user}),e=n.computed(()=>{if(!_.ready||!_.person)return null;const o=t.contextId;return _.person.id===o?_.person:_.organizations.find(s=>s.id===o)||null}),r=n.computed(()=>{var o;return t.contextId===((o=t.person)==null?void 0:o.id)});return _.onupdateContext(o=>{t.contextId=o}),_.onupdateData(()=>{t.person=_.person,t.organizations=_.organizations,t.user=_.user}),_.onReady(o=>{t.ready=o}),{state:n.readonly(t),currentContext:e,isPerson:r}}function Yi(t,e){const r=n.reactive({ready:!1,show:!1});function o(){r.ready=!1,r.show=!1}return t.read=()=>{let s=e();return Promise.resolve().then(()=>{if(!t.name)throw T.EntityWithoutName("Use Form Request");return V.readById(t.name,s.id,{fields:s.fields})}).then(de.valuesToUpperCase).then(i=>(i.hasOwnProperty("Version")&&(t.version=Number(i.Version)),t.setValues(i),r.show=!0,i)).catch(i=>{const l=pe(i);throw $.add("error",l.message),l}).finally(()=>{r.ready=!0})},t.save=()=>{let s=e();return Promise.resolve().then(()=>{if(!t.name)throw T.EntityWithoutName("Use Form Request");return V.updateById(t.name,s.id,t.changes,{version:t.version})}).then(i=>{t.version=i.version||i.Version}).catch(i=>{const l=pe(i);throw $.add("error",l.message),l})},t.on(y.Form.EVENT_SAVE,t.read.bind(t)),{shadowFormState:r,initShadow:o}}class Xi{static getRequiredDocuments(e,r,o){const s=new URLSearchParams({entity:e,primaryKey:r,statusCode:o});return fetch(`/close-api/views/required-documents?${s.toString()}`).then(i=>i.json())}}class Y{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Y.url()}/calculator/${e}`)}static calculate(e,r){return p(`/${Y.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:r})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):T.ApiNotAvailable()})}static parseMetadataField(e){function r(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:e.name,label:e.title,required:e.required,type:r(e)}}static createOnlinePayment(e,r){return p(`/${Y.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:r})})}static applyOnlinePayment(e){return p(`/${Y.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class Zi{static getListSettings(e,r){const o=new URLSearchParams;o.set("entity",e),r&&o.set("mark",r);const s=`/close-api/views/list/configs?${o.toString()}`;return p(s)}}function Qi(t){return t.statusName==="Completed"}function ea(t){return t.statusName==="FinalStepWithConfirmation"}function ta(t){return t.statusName==="ValidationError"}function na(t,e,r){let o=null;const s=n.reactive({wait:null});let i=[],l=null;const a=n.ref(null);function c(){a.value=i.find(m=>m.name===l)||null}function d(){var m;return l?((m=i.find(S=>S.name===l))==null?void 0:m.fields)||[]:[]}function u(m){if(c(),ta(m))return void r.onValidation(m.validationResults);if((m.statusName==="FinalStep"||m.statusName==="NextStep")&&(!d().length||ra(d(),r.presets)))return j(r.presets||{});Qi(m)&&r.onCompleted(m),ea(m)&&r.onConfirmation(m)}async function h(){try{await b(),await k()}catch(m){const{message:S}=pe(m);$.add("error",S)}}function b(){return s.wait="Loading process information.",Te.getStartConfig(e,t).then(m=>{i=m.steps.map(S=>({label:S.title,name:S.stepName,number:S.number,fields:S.frontendEntity.objectTypes.reduce((x,ee)=>(ee.properties.forEach(D=>{x.push({name:D.name,label:D.title,type:D.refEntityName||D.dataType})}),x),[])}))}).then(m=>(s.wait=!1,m))}function v(m){return l=m.nextStepName,o=m.token,m}function w(m){const S=pe(m);$.add("error",S.message)}function k(){return s.wait="Starting process",Te.startProcess(e,t).then(v).then(u).catch(w).finally(()=>{s.wait=null})}function j(m={}){return!o||!l?Promise.reject("Not step or token."):(s.wait="Expect the result",Te.runStep(e,t,l,o,m).then(v).then(u).catch(w).finally(()=>{s.wait=!1}))}return{initialize:h,state:s,currentStepConfig:n.readonly(a),next:j}}function ra(t,e){for(let r=0;r<t.length;r++){const o=t[r];if(!y.utils.getPropFromObject(e,o.name))return!1}return!0}const oa="close-api/proxy/Equipment/Search";class sa{static search(e,r,o,s,i){const l=new URLSearchParams;l.append("pattern",e||""),r&&l.append("categoryId",r),o&&l.append("useType",String(o)),s&&l.append("statusCode",s),i&&(l.append("limit",String(i.limit)),l.append("offset",String(i.offset)));const a=`/${oa}?${l.toString()}`;return p(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const ia={clickOutside:Z,requestHandler:Le,valuesToUpperCase:De,prettyDate:Xe,prettyDateWithTime:Ut,Filter:O,staticLink:Mi,groupArrayByField:ji,uuidv4:xi,Request:p,prettyMoney:Pt},aa={widgets:mo,usage:ho,utils:$o,mixins:rn,config:So,types:No};exports.ApplicationManager=Vt;exports.Communication=Di;exports.ComputedMetadata=os;exports.CoreError=T;exports.Filter=O;exports.List=R;exports.ListConfig=Li;exports.Manager=_;exports.MetadataStore=le;exports.ModalValidation=Ei;exports.NotificationSystem=$;exports.ProcessWrap=Oe;exports.Request=p;exports.SYMBOL_ROW=C;exports.Table=me;exports.WidgetBreadcrumbs=ms;exports.WidgetButton=kt;exports.WidgetCard=Ai;exports.WidgetForm=si;exports.WidgetIcon=E;exports.WidgetImage=bi;exports.WidgetList=Ss;exports.WidgetMultiButton=Je;exports.WidgetNotificationSystem=$t;exports.WidgetSection=As;exports.WidgetSpinner=Q;exports.WidgetTable=Us;exports.WidgetWait=qt;exports.actionService=Jt;exports.authService=B;exports.billingService=Y;exports.clickOutside=Z;exports.clientService=Bt;exports.communicationService=ue;exports.configurationService=Zi;exports.dataService=V;exports.debounce=Ui;exports.default=aa;exports.documentsService=Xi;exports.equipmentService=sa;exports.fileService=wt;exports.historyService=Ro;exports.internationalizationService=is;exports.invitationService=Oi;exports.metadataService=Ze;exports.newImport=ns;exports.openService=Ri;exports.parseError=pe;exports.prettifyValueByMetadata=ss;exports.processWizardService=Te;exports.requestHandler=Le;exports.ruleValidationService=Qe;exports.setupSocket=ls;exports.t=X;exports.testTypes=Oo;exports.useCommunication=Fi;exports.useCustomerState=Ki;exports.useFormAction=Gi;exports.useFormLabel=Hi;exports.useFormMetadata=zi;exports.useFormRequest=Yi;exports.useFormRequestData=Ji;exports.useListConfig=Lo;exports.useListFilter=Fo;exports.useListOrder=jt;exports.useListProvide=Mt;exports.useListRead=Ft;exports.useListSearch=Do;exports.useListSelect=Wo;exports.useListState=Wt;exports.useManagerState=go;exports.useSocket=as;exports.useTableRequest=Po;exports.useTableState=Ao;exports.useWizard=na;exports.utils=ia;exports.viewService=Pi;
10
+ */const at=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},lt=function(t,e){t in this.events&&this.events[t].forEach(r=>r(e))},ct=function(t,e){const r=this.events[t];if(!r)return;const o=r.indexOf(e);o!==-1&&r.splice(o,1)},dt=function(){this.events={}};class P{constructor(){this.events={}}on(e,r){return at.call(this,e,r)}emit(e,r){return lt.call(this,e,r)}off(e,r){return ct.call(this,e,r)}cleanEvents(){dt.call(this)}static on(e,r){return at.call(P,e,r)}static emit(e,r){return lt.call(P,e,r)}static off(e,r){return ct.call(P,e,r)}static cleanEvents(){dt.call(P)}}P.events={};var Tt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},Ee=(t,e,r)=>(Tt(t,e,"read from private field"),r?r.call(t):e.get(t)),je=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},xe=(t,e,r,o)=>(Tt(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),re,ke,be;const J=class A extends P{constructor(){super(...arguments),je(this,re,void 0),je(this,ke,"front"),this.organizations=[],je(this,be,!1)}set language(e){localStorage.setItem(A.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(A.LOCALSTORAGE_LANGUAGE_KEY)||A.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(A.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){xe(this,re,e)}get router(){if(!Ee(this,re))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return Ee(this,re)}set type(e){xe(this,ke,e)}get type(){return Ee(this,ke)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){xe(this,be,e),this.emit(A.EVENT_READY_UPDATE,e)}get ready(){return Ee(this,be)}onReady(e){return this.on(A.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(A.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(A.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(A.CURRENT_CONTEXT_KEY,String(e)),this.emit(A.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(r=>r.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const r=Number.parseInt(localStorage.getItem(A.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(r)&&this.validateContextId(Number(r))?this.setCurrentContext(r):this.setCurrentContext(Number(e.id))}catch{$.add("error",T.ApiNotAvailable().message)}}loadCustomerData(){return Bt.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var r;return((r=this.person)==null?void 0:r.id)==e?!0:!!this.organizations.find(o=>o.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const r=localStorage.getItem(this.getListKeyById(e));return r&&JSON.parse(r)}setListInformationToLocalStorage(e,r){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(r))}};re=new WeakMap;ke=new WeakMap;be=new WeakMap;J.DEFAULT_LANGUAGE="en";J.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";J.EVENT_CONTEXT_UPDATE="event:context-update";J.EVENT_READY_UPDATE="event:ready-update";J.EVENT_DATA_UPDATE="event:data-update";J.CURRENT_CONTEXT_KEY="CurrentContext";let Vt=J;const _=new Vt;function go(){const t=n.reactive({contextType:_.contextType,contextId:_.contextId,context:_.context});return _.onupdateContext(()=>{t.contextType=_.contextType,t.contextId=_.contextId,t.context=_.context}),t}function yo(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return Nt}})}function p(t,e={}){return _.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=_.contextId),e.redirect="manual",fetch(t,e).then(r=>r.type==="opaqueredirect"?void window.location.replace("/auth"):r).catch(()=>{throw T.ApiNotAvailable()}).then(r=>yo(r).then(o=>{if(!r.ok)throw o;return o}))}class Re{constructor(){}static parseNamesFromListConfig(e){let r=Re.parseFieldsToGraphQL(e.reduce((s,i)=>(i.name&&s.push(i.name),s),[]));function o(s){let i="";for(let l in s)typeof s[l]=="boolean"?i+=` ${l} `:i+=` ${l} { ${o(s[l])} }`;return i}return o(r)}static parseSortFromListConfig(e){let r={};for(let o in e)r[o]=e[o]?"ASC":"DESC";return r}static parseFieldsToGraphQL(e){function r(o,s){if(s.includes(".")){const i=s.indexOf("."),l=s.substring(i+1),a=s.substring(0,i);a in o||(o[a]={}),r(o[a],l)}else o[s]=!0;return o}return e.reduce(r,{})}}class vo{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,r,o)=>(r!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),e[r]=o,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}const It=new vo;function At(t){return t&&t[0].toLowerCase()+t.slice(1)}const wo={props:{message:String},name:"ModalWait",components:{WidgetSpinner:Q}},Eo={class:"modal__wait modal-default flex_column"};function ko(t,e,r,o,s,i){const l=n.resolveComponent("widget-spinner");return n.openBlock(),n.createElementBlock("div",Eo,[n.createVNode(l),n.createElementVNode("p",null,n.toDisplayString(r.message),1)])}const bo=f(wo,[["render",ko],["__scopeId","data-v-4d18289e"]]),Co={error:!0,wait:!1,throw:!0};async function Le(t,e={}){const r={modalWait:null};e=Object.assign({},e,Co);try{e.wait&&(r.modalWait=await yt.openModal(bo,{message:typeof e.wait=="string"?e.wait:""}))}catch(o){console.warn(o)}return Promise.resolve(t()).catch(o=>{let s=o;if(typeof s=="string"&&(s=T.UndefinedError(s)),e.error&&(console.log(s,s.details),s instanceof T?$.add("error",s.message,{children:s.details||[],timeout:12}):s!=null&&s.message?$.add("error",s.message):(console.warn(s),$.add("error",T.ApiResponseParseFailed().message))),e.throw)throw s}).finally(()=>{var o;(o=r.modalWait)==null||o.close()})}function De(t){return Object.keys(t).reduce((e,r)=>{let o=t[r];const s=r.charAt(0).toUpperCase()+r.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=De(o)),e[s]=o,e},{})}function Pt(t,e=2){if(!(typeof t=="string"||typeof t=="number"))return"";let o=String(t).split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.length<2&&(o[1]=""),o[1]=o[1].padEnd(e,"0"),o[1].length>e&&(o[1]=o[1].substring(0,e)),o.join(".")}const de={Request:p,clickOutside:Z,getPropFromObject:fe,runPromiseQueue:Ke,GraphQL:Re,firstChapterToLowerCase:At,requestHandler:Le,valuesToUpperCase:De,prettyMoney:Pt},$o=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Re,Journal:It,Request:p,clickOutside:Z,default:de,firstChapterToLowerCase:At,getPropFromObject:fe,requestHandler:Le,runPromiseQueue:Ke,valuesToUpperCase:De},Symbol.toStringTag,{value:"Module"}));function Ot(t,e=""){for(let r in t){if(typeof t[r]=="object"){Ot(t[r],(e.length?`${e}-`:"")+r);continue}let o="--"+((e.length?`${e}-`:"")+r).replace(/([A-Z])/g,s=>`-${s}`.toLowerCase());document.documentElement.style.setProperty(o,t[r])}}const M={};function So(t){for(let e in t)M[e]=t[e];t.styles&&Ot(t.styles),It.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=M}const No=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function Bo(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&typeof t[1]=="number"}const To="masterId",Vo="masterEntity";function Ve(t,e){if(!Array.isArray(e))return;if(Bo(e))return r(e);e.forEach(r);function r(o){t.append(Vo,o[0]),t.append(To,o[1].toString())}}class V{static async anonymousGetList(e){return await p(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(e,r){const o=new URLSearchParams;function s(l,a){const c=d=>o.append("fields",d);if(typeof a=="string")return c(a);if(Array.isArray(a))return c(a.join(" "));if(typeof a=="object")return c(Object.keys(a).join(" "))}function i(l,a){if(!a||!Object.keys(a).length)return;const c=Object.entries(a).map(([d,u])=>`@${d} ${u}`).join(",");l.append("order",c)}return r&&(s(o,r.fields),i(o,r.order),r.limit&&o.append("limit",r.limit.toString()),r.offset&&o.append("offset",r.offset.toString()),r.filter&&o.append("filter",r.filter.toString()),r.useUsageContext&&o.append("useUsageContext",r.useUsageContext.toString())),await p(`/close-api/data/${e}?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,r){const o=new URLSearchParams;function s(l,a){const c=d=>o.append("fields",d);if(typeof a=="string")return c(a);if(Array.isArray(a))return c(a.join(" "));if(typeof a=="object")return c(Object.keys(a).join(" "))}function i(l,a){if(!a||!Object.keys(a).length)return;const c=Object.entries(a).map(([d,u])=>`@${d} ${u}`).join(",");l.append("order",c)}return r&&(s(o,r.fields),i(o,r.order),r.limit&&o.append("limit",r.limit.toString()),r.offset&&o.append("offset",r.offset.toString()),r.filter&&o.append("filter",r.filter.toString()),r.useUsageContext&&o.append("useUsageContext",r.useUsageContext.toString())),p(`/close-api/data/entities/${e}/count?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,r,o){const s=new URLSearchParams;return Ve(s,o==null?void 0:o.masterEntities),p(`/close-api/data/${e}?${s.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static update(e,r,o,s={}){return p(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:o})})}static readById(e,r,o={}){const s=new URLSearchParams;if(o.fields){let i=o.fields;typeof i=="string"&&(i=[i]),s.append("fields",i.join(" "))}return p(`/close-api/data/entities/${e}/id/${r}?${s.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,r,o,s){const i=new URLSearchParams;return Ve(i,s==null?void 0:s.masterEntities),p(`/close-api/data/entities/${e}/id/${r}?${i.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:o,version:s==null?void 0:s.version})})}static removeById(e,r,o){const s=typeof r=="number"?{Id:r}:r;return V.removeByKeys(e,s,o)}static removeByKeys(e,r,o){return p(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:r,version:o})})}}var Rt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},Ue=(t,e,r)=>(Rt(t,e,"read from private field"),r?r.call(t):e.get(t)),ut=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},pt=(t,e,r,o)=>(Rt(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),oe,Ce;const Ye=class K extends P{constructor(e){super(),ut(this,oe,[]),ut(this,Ce,!1),this.hashParams="",this.offset=0,this.name=e.name}set wait(e){pt(this,Ce,e),this.emit(K.EVENT_CHANGE_WAIT,e)}get wait(){return Ue(this,Ce)}read(e){var s,i;this.wait=!0;const r={};e.order&&(r.order={[(s=e.order)==null?void 0:s.name]:(i=e.order)==null?void 0:i.duration}),e.fields&&(r.fields=e.fields),e.filter&&(r.filter=e.filter);const o=JSON.stringify(r.order)+JSON.stringify(r.filter);return o!==this.hashParams&&(this.offset=0,this.hashParams=o),e.limit&&(r.limit=e.limit),e.offset&&(r.offset=e.offset||this.offset),V.getList(this.name,r).then(l=>(this.offset===0&&(this.array=[]),this.offset+=r.limit,l)).then(l=>{this.array.push(...l)}).then(()=>this.emit(K.EVENT_DATA,this.array)).finally(()=>{this.wait=!1})}set array(e){pt(this,oe,e),this.emit(K.EVENT_DATA,this.array)}add(e){Ue(this,oe).push(...e),this.emit(K.EVENT_DATA,this.array)}get array(){return Ue(this,oe)}static GetFieldNames(e){return e.reduce((r,o)=>(o.name&&(typeof o.name=="string"?r.push(o.name):r.push(...o.name)),r),[])}static getCellInfo(e,r){const o=K.getCellName(e),s=(()=>{let i=o?fe(r,o):null;return i===void 0&&(i=null),e.value?e.value(i,r):i})();return{name:o,value:s}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}};oe=new WeakMap;Ce=new WeakMap;Ye.EVENT_DATA="LIST:DATA";Ye.EVENT_CHANGE_WAIT="LIST:UPDATE-WAIT";let Lt=Ye;const C=Symbol("__ROW_INDEX__");let me=class extends Lt{constructor(e){super(e),this.rowIndex=1,this.changes={new:{},edit:{},remove:[]},this.save=()=>{}}get changed(){return Object.keys(this.changes.new).length||Object.keys(this.changes.edit).length||this.changes.remove.length}create(e){const r=this.wrapData(e);this.changes.new[r[C]]=r,this.emitChanges()}cleanChanges(){this.changes.new={},this.changes.edit={},this.changes.remove=[],this.emitChanges()}edit(e,r){const o=this.wrapData(r,e);if(this.changes.new[e])return this.changes.new[e]=o,this.emitChanges();this.array.find(s=>s[C]===e)&&(this.changes.edit[e]={...this.changes.edit[e],...o},this.emitChanges())}remove(e){if(this.changes.new[e])return delete this.changes.new[e],this.emitChanges();this.array.find(r=>r[C]===e)&&(delete this.changes.edit[e],this.changes.remove.includes(e)||this.changes.remove.push(e),this.emitChanges())}wrapData(e,r){return r===void 0&&!Object.prototype.hasOwnProperty.call(e,C.toString())&&(r=++this.rowIndex),{...e,[C]:r}}emitChanges(){this.emit(y.Form.EVENT_CHANGED,!0)}set array(e){super.array=e.map(r=>this.wrapData(r))}get array(){return super.array}log(e){console.log(`[table] ${e}`)}};me.PROVIDE_NAME="table-controller";function Io(t){return function(r){return{activate(){t(r)},deactivate(){t(null)}}}}function Ao(t){const e=n.reactive(t.array);n.provide(me.PROVIDE_NAME,t);const r=n.reactive(t.changes);t.on(Lt.EVENT_DATA,l=>e.splice(0,e.length,...l)),t.on(y.Form.EVENT_CHANGED,()=>{r.new=Object.keys(t.changes.new).reduce((l,a)=>{const c=Number(a);return l[c]=t.changes.new[c],l},{})});const o=n.computed(()=>[...e.reduce((l,a)=>{const c=a[C];return t.changes.remove.includes(c)||l.push({...a,...t.changes.edit[c]}),l},[]),...Object.values(r.new)]),s=y.Form.getParentForm();return s==null||s.subscribe(t),{activeRow:n.ref(null),array:o}}function Po(t,e){t.read=()=>V.getList(t.name,{fields:e==null?void 0:e.fields}).then(r=>t.array=r).then(()=>t.emit(y.Form.EVENT_READ,t.array)),t.save=()=>{const r=t.name;Object.values(t.changes.new).forEach(async s=>{await V.create(r,s)}),Object.entries(t.changes.edit).forEach(async([s,i])=>{await V.updateById(t.name,o(Number(s)),i)});function o(s){const i=t.array.find(l=>l[C]===s);return i.id|i.Id}t.changes.remove.forEach(async s=>{await V.removeById(r,o(s),0)}),t.emit(y.Form.EVENT_SAVE)}}const Oo=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Ro{static readHistoryById(e,r){return p(`/close-api/audits/history/${e}/${r}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(o=>{const s=o.history.map(i=>{if(!i.changes)return i;const l=i.changes.map(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...i,changes:l}});return{...o,history:s}})}}var Dt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},F=(t,e,r)=>(Dt(t,e,"read from private field"),r?r.call(t):e.get(t)),U=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},z=(t,e,r,o)=>(Dt(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),$e,se,Se,Ne,ie,ae,ze;const q="_______LIST_______ROW_______INDEX________NAME_______",he=class W extends P{constructor(e){super(),this.LIST_ROW_KEY=1,U(this,$e,void 0),this.array=[],U(this,se,[]),U(this,Se,[]),U(this,Ne,new Proxy({},{set:(r,o,s,i)=>(r[o]=s,this.emit(W.EVENT_FILTERS_UPDATE,r),!0),deleteProperty:(r,o)=>(delete r[o],this.emit(W.EVENT_FILTERS_UPDATE,r),!0)})),U(this,ie,!1),U(this,ae,(...r)=>Promise),U(this,ze,()=>{}),z(this,$e,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&z(this,se,e.config)}set config(e){z(this,se,e.map(y.utils.copyObject)),this.emitUpdateConfig()}get config(){return F(this,se)}emitUpdateConfig(){this.emit(W.EVENT_CONFIG_UPDATE,this.config)}get order(){return F(this,Se)}set order(e){z(this,Se,e),this.emit(W.EVENT_ORDER_UPDATE,this.order)}get filters(){return F(this,Ne)}set filters(e){xt(F(this,Ne),e)}set wait(e){z(this,ie,e),this.emit(y.Form.EVENT_WAIT,F(this,ie))}get wait(){return F(this,ie)}get primaryKeys(){return F(this,$e)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(r=>r[q]===e)}indexByKey(e){return this.array.findIndex(r=>r[q]===e)}static getKey(e){return e[q]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,q)}add(...e){const r=this.wrapArray(e);this.array.push(...r),this.emit(W.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const r=this.indexByKey(e);r!==-1&&(this.array.splice(r,1),this.emit(W.EVENT_DATA,this.array))}updateByKey(e,r){const o=this.atByKey(e);o&&(Object.assign(o,r),this.emit(W.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[q]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,q)}set read(e){z(this,ae,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const r=F(this,ae).call(this,...e);return this.wait=!0,r}).finally(()=>this.wait=!1)}set save(e){z(this,ae,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>F(this,ze).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((r,o)=>(o.name&&(typeof o.name=="string"?r.push(o.name):r.push(...o.name)),r),[])}static mergeWithKey(e,r){return{...e,[q]:r}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,r){const o=W.getCellName(e),s=(()=>{let i=o?fe(r,o):null;return i===void 0&&(i=null),e.value?e.value(i,r):i})();return{name:o,value:s}}};$e=new WeakMap;se=new WeakMap;Se=new WeakMap;Ne=new WeakMap;ie=new WeakMap;ae=new WeakMap;ze=new WeakMap;he.EVENT_DATA="list-data: update";he.EVENT_CONFIG_UPDATE="list-config:update";he.EVENT_ORDER_UPDATE="list-order:update";he.EVENT_FILTERS_UPDATE="list-filters:update";let R=he;function Ft(t,e){let r="",o=0,s=!1,i;t.read=(l={})=>{if(t.wait)return i;if(l.clean&&(r="",o=0,s=!1),s)return Promise.resolve([]);let a=e;typeof a=="function"&&(a=a());const c={};if(!t.name)throw new Error("Reading list`s data without name is not available.");a.order&&Array.isArray(a.order)&&a.order.length&&(c.order={[a.order[0]]:a.order[1]||"asc"}),a.fields&&(c.fields=a.fields),a.filter&&(c.filter=a.filter);const d=JSON.stringify(c.order)+JSON.stringify(c.filter)+JSON.stringify(c.fields);return d!==r&&!Number.isNaN(d)&&(o=0,r=d),"limit"in a&&(c.limit=a.limit),c.offset=o||a.offset||0,i=V.getList(t.name,c).then(u=>((o===0||l.clean)&&t.set([]),o+=c.limit,u)).then(u=>(t.add(...u),u.length===0&&(s=!0),u)),i}}function Wt(t){const e=n.reactive({wait:t.wait,array:[]});return t.on(R.EVENT_DATA,r=>{e.array.splice(0,e.array.length,...r.map(o=>Object.freeze(JSON.parse(JSON.stringify(o)))))}),t.on(y.Form.EVENT_WAIT,()=>{e.wait=t.wait}),e}function Mt(t,e){const r="list-flex-config",o=n.inject(r,void 0);if(o)return o;if(!t||!e)throw new Error("Hook useProvideList has two required params: list and defaultSettings");t.on(R.EVENT_CONFIG_UPDATE,()=>{t.read()});const s={list:t,defaultSettings:e};return n.provide(r,s),s}function Lo(t){const e=n.reactive([...t.config]);return t.on(R.EVENT_CONFIG_UPDATE,r=>{e.splice(0,e.length,...r)}),e}function jt(t){const e=t.order||[],r=n.reactive(e);return t.on(R.EVENT_ORDER_UPDATE,o=>{r.splice(0,r.length,...o),t.read()}),r}function Do(t){const e=n.ref(""),r=n.computed(()=>{const o=e.value.toLowerCase();return n.unref(t).filter(s=>e.value.length?Object.values(s).join().toLowerCase().includes(o):!0)});return{search:e,searchArray:r}}function xt(t,e){Object.keys(t).forEach(r=>delete t[r]),Object.entries(e).forEach(([r,o])=>{t[r]=o})}function Fo(t){const e=n.reactive(y.utils.copyObject(t.filters));return t.on(R.EVENT_FILTERS_UPDATE,r=>{xt(e,r),t.read()}),e}function Wo(t){const e=n.reactive([]);function r(a){return e.includes(a)}function o(a){r(a)||e.push(a)}function s(a){const c=e.findIndex(d=>d===a);c!==-1&&e.splice(c,1)}function i(a){const c=n.unref(t);if(a===void 0){e.length===0?c.forEach(o):c.forEach(s);return}r(a)?s(a):o(a)}const l=n.computed(()=>{const a=n.unref(t);return e.length===a.length&&a.length!==0});return[e,i,l,o,s]}class Mo extends R{constructor(e){super(e),this.changes=[],this.save=jo.bind(this)}get changed(){return!!this.changes.find(e=>e.status==="active")}addChange(e,r){this.changes.push({type:e,status:"active",data:this.wrapItem(r)})}}function jo(){const t=this.changes.filter(e=>e.status==="active");return Ke(t.map(e=>{console.log("++")}))}function xo(){const t=n.ref(null);function e(r){t.value=r&&vt(r)}return{activeRow:t,activateRow:e}}const Uo={props:{config:Array},name:"WidgetTableHead"},zo={class:"widget-table__head"},qo={class:"widget-table__head-title"};function Go(t,e,r,o,s,i){return n.openBlock(),n.createElementBlock("tr",zo,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.config,(l,a)=>(n.openBlock(),n.createElementBlock("th",{class:"widget-table__head-cell",key:a},[n.createElementVNode("p",qo,n.toDisplayString(l.title),1)]))),128))])}const Ho=f(Uo,[["render",Go],["__scopeId","data-v-f478f0d8"]]);function Ut(t){return Xe(t,"YYYY/MM/DD HH:mm:ss")}function Xe(t,e="YYYY/MM/DD"){if(!t)return"";try{const r=new Date(t);return Xt.format(r,e)}catch(r){return console.log(r),"Invalid date"}}function Jo(t,e){const r=t.config.map(o=>Ko(o,t,e));return n.h("tr",{class:"widget-table__row widget-table-row"},r)}function Ko(t,e,r){const o=e.values;let{name:s,value:i}=R.getCellInfo(t,o);const l={onClick:[],class:["widget-table__cell widget-table-cell"]};function a(h){l.onClick.push(()=>h(o))}function c(h){Array.isArray(h)?l.class.push(...h):l.class.push(h)}const d=[],u=[];if(t.hide&&t.hide(o))return[n.h("td")];if(t.type)switch(c(`widget-table-cell_${t.type}`),t.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Xe(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Ut(typeof i=="string"?i:null);break}case"multi-select":{u.push(n.h(y.FormField,{type:"single-checkbox",modelValue:e.selected})),a(ft.bind(null,r,!0));break}case"select":{u.push(n.h(y.FormField,{type:"single-radio",modelValue:e.selected})),a(ft.bind(null,r,!1));break}}if(t.checked){const h=t.checked(o);u.push(n.h(y.FormField,{type:"single-checkbox",modelValue:h}))}if(t.onClick&&a(t.onClick),t.link)try{const h=t.link(o);if(h){const b=n.h(Ge.RouterLink,{to:h});u.push(b),c("list-cell-link")}}catch(h){console.warn("Error handle: Add Router link to cell",h)}return t.href&&(u.push(n.h("a",{href:t.href(o),target:"_blank"})),c("list-cell-link")),i!=null&&u.push(n.h("p",{class:"widget-list-cell-text"},i)),t.icon&&u.push(n.h(E,{name:t.icon})),t.class&&(typeof t.class=="function"?c(t.class(o)):c(t.class)),d.push(n.h("td",l,u)),d}function ft(t,e){t.emit("select",e)}function zt(t,e){return()=>{try{return Jo(t,e)}catch(r){return console.warn(r),null}}}const Yo={props:{values:Object,config:Object,selected:Boolean},setup:zt},Xo=["colspan"],mt=n.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{}},emits:["save","remove","close"],setup(t,{emit:e}){const r=t,o=n.ref(),s=n.computed(()=>!r.values&&!R.hasKey(r.values));return n.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(i,l)=>(n.openBlock(),n.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[n.createElementVNode("td",{colspan:i.rowLength},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.component),n.mergeProps(i.$attrs,{values:i.values,new:s.value,onClose:l[0]||(l[0]=a=>e("close")),onSave:l[1]||(l[1]=a=>e("save",a))}),null,16,["values","new"]))],8,Xo)],512))}}),Zo={class:"widget-wait flex gap_10 padding_15"},Qo={class:"text_md"},es=n.defineComponent({__name:"widget-wait",props:{label:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",Zo,[n.createVNode(Q,{color:"var(--primary)",class:"wait-spinner"}),n.createElementVNode("span",Qo,n.toDisplayString(e.label),1)]))}});const qt=f(es,[["__scopeId","data-v-2038b2ba"]]),ts=n.defineComponent({__name:"widget-table",props:{array:{},config:{},mini:{type:Boolean},activeRow:{},selectRows:{},wait:{type:Boolean},classCallback:{type:Function}},emits:["update:activeRow","update:selectRows","save","read"],setup(t,{emit:e}){const r=t,o=n.useSlots(),s=n.computed(()=>{var c;return(c=o==null?void 0:o.default)==null?void 0:c.call(o)[0]}),i=n.computed(()=>r.array.map(c=>({values:c,hash:vt(c)})));function l(c,d=!0){return r.selectRows?d?r.selectRows.indexOf(c)===-1?e("update:selectRows",[...r.selectRows,c]):e("update:selectRows",r.selectRows.filter(h=>h!==c)):e("update:selectRows",[c]):void 0}function a(c){e("save",c),e("update:activeRow",null)}return(c,d)=>(n.openBlock(),n.createElementBlock("div",null,[n.createVNode(n.Transition,{name:"move-horizontal"},{default:n.withCtx(()=>[c.wait?(n.openBlock(),n.createBlock(qt,{key:0,label:"Loading data",color:"black",class:"widget-table-loader"})):n.createCommentVNode("",!0)]),_:1}),n.createElementVNode("table",{class:n.normalizeClass(["widget-table",{"widget-table_mini":c.mini}])},[n.createVNode(Ho,{config:c.config},null,8,["config"]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,({values:u,hash:h},b)=>{var v;return n.openBlock(),n.createElementBlock(n.Fragment,{key:b},[n.createVNode(Yo,{config:c.config,values:u,selected:(v=c.selectRows)==null?void 0:v.includes(u),onSelect:w=>l(u,w),class:n.normalizeClass(c.classCallback?c.classCallback(u):"")},null,8,["config","values","selected","onSelect","class"]),s.value&&c.activeRow===h?(n.openBlock(),n.createBlock(mt,{key:0,component:s.value,"row-length":c.config.length,values:u,onClose:d[0]||(d[0]=w=>e("update:activeRow",null)),onSave:a,onRead:d[1]||(d[1]=w=>e("read"))},null,8,["component","row-length","values"])):n.createCommentVNode("",!0)],64)}),128)),c.activeRow===0?(n.openBlock(),n.createBlock(mt,{key:0,component:s.value,"row-length":c.config.length,onClose:d[2]||(d[2]=u=>e("update:activeRow",null)),onSave:a,onRead:d[3]||(d[3]=u=>e("read"))},null,8,["component","row-length"])):n.createCommentVNode("",!0)])],2)]))}});const ns=Object.freeze(Object.defineProperty({__proto__:null,List:R,Table:Mo,WidgetTable:ts,useListOrder:jt,useListProvide:Mt,useListRead:Ft,useListState:Wt,useTableActiveRow:xo},Symbol.toStringTag,{value:"Module"}));class rs extends P{constructor(){super(),this.EVENT_NEW="event:new-metadata",this.store={}}get(e){return this.store[e]}async load(e){return this.store[e]||this.set(e,await this.loadEntityInformation(e)),this.store[e]}set(e,r){this.store[e]=r,this.emit(this.EVENT_NEW,{entityName:e})}async loadEntityInformation(e){return await Ze.get(e)}}const le=new rs;function os(t){const e=n.ref(le.get(t));return le.on(le.EVENT_NEW,r=>{t===r.entityName&&(e.value=le.get(t))}),e}function ss(t,e){return e.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}class is{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return p(`/open-api/internationalization/language/${e}`)}}let G={};function X(t,...e){if(typeof t!="string")return console.trace(`Label is not provided for translation: ${t}`),"undefined";let r=y.utils.getPropFromObject((this==null?void 0:this.vocabulary)||G,t);if(typeof r=="string")return ht(r,e);const o=y.utils.getPropFromObject(G==null?void 0:G.root,t);return typeof o=="string"?ht(o,e):(typeof r===void 0&&console.warn(`Translation for label "${t}" is not founded.`),t)}function ht(t,e){return e.forEach((r,o)=>{t=t.replaceAll(new RegExp(`\\{${o}}`,"g"),r)}),t}X.setGlobalVocabulary=function(t){G=t};X.getScope=function(t){const e=typeof t=="string"?t:"root";return typeof t!="string"&&console.warn(`SCOPE ${t} for translate is not string.`),X.bind({vocabulary:y.utils.getPropFromObject(G,e.toLowerCase())})};X.setVocabulary=function(t){return typeof t=="string"&&(t=y.utils.getPropFromObject(G,t)),X.bind({vocabulary:t})};function as(t=""){if(qe.manager)return qe.manager.socket(`/${t}`)}class qe{}function ls(t=window.location.origin+"/socket.io",e={},r={}){const o=new Zt.Manager(t,{reconnectionDelayMax:1e3,withCredentials:!0,transports:["websocket","polling"],...e});qe.manager=o;const s=()=>{setTimeout(()=>{o.open(i=>{i&&s(),i||(console.log("Reconnection to socket success."),r!=null&&r.onReconnect&&r.onReconnect())})},2e3)};o.on("close",s)}const cs={class:"breadcrumb__title"},ds=n.defineComponent({__name:"widget-breadcrumb-item",props:{active:{type:Boolean},title:{},link:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["breadcrumb flex",{breadcrumb_active:e.active}])},[n.createElementVNode("p",cs,n.toDisplayString(e.title),1),e.active?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(E,{key:0,class:"breadcrumb__icon",name:"caret-right"}))],2))}});const us=f(ds,[["__scopeId","data-v-1702aee0"]]),ps={class:"widget-breadcrumbs"},fs=n.defineComponent({__name:"widget-breadcrumbs",props:{array:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",ps,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.array,(o,s)=>(n.openBlock(),n.createBlock(us,{key:s,title:o.title,link:o.link,active:s===e.array.length-1},null,8,["title","link","active"]))),128))]))}});const ms=f(fs,[["__scopeId","data-v-1dfb2668"]]),hs={props:{config:Array,values:Object,selected:Boolean},setup:zt};const _s=f(hs,[["__scopeId","data-v-47478206"]]),gs=t=>(n.pushScopeId("data-v-03c9724f"),t=t(),n.popScopeId(),t),ys={class:"head-cell"},vs=gs(()=>n.createElementVNode("div",{class:"head-cell-resize"},null,-1)),ws=n.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(t,{emit:e}){const r=t;return r.title&&console.warn(`For cell ${r.name} using title,it should be replaced with label.`),(o,s)=>(n.openBlock(),n.createElementBlock("th",null,[n.createElementVNode("div",ys,[n.createElementVNode("div",{class:"head-cell-content flex_grow",style:n.normalizeStyle({"min-width":o.minWidth,"max-width":o.maxWidth,width:o.width})},[o.type==="multi-select"?(n.openBlock(),n.createBlock(n.unref(y.FormField),{key:0,type:"single-checkbox",onClick:s[0]||(s[0]=n.withModifiers(i=>e("select"),["stop","prevent"]))})):(n.openBlock(),n.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:s[1]||(s[1]=i=>e("order"))},n.toDisplayString(o.title||o.label),1))],4),o.name&&o.order.length&&o.order[0]===o.name?(n.openBlock(),n.createBlock(n.unref(E),{key:0,class:n.normalizeClass(["head-cell-order",{"head-cell-order_down":o.order.length>1&&o.order[1]==="desc"}])},{default:n.withCtx(()=>[n.createTextVNode("core-arrow-up")]),_:1},8,["class"])):n.createCommentVNode("",!0),vs])]))}});const Es=f(ws,[["__scopeId","data-v-03c9724f"]]),ks=n.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const r=t,o=n.ref(),s=n.ref();n.onMounted(()=>{function c(v,w){let k=-1;do k++,w-=v[k];while(w>0&&k<v.length);return k}function d(v,w){let k=0;for(;w>0&&w>v[k]&&k<v.length;)w-=v[k],k++;return console.log(w,k),k>0?k:0}function u(v){try{s.value.style.insetInlineStart=v+"px"}catch(w){console.log(w)}}function h(v){try{s.value.style.width=v+"px",s.value.style.minWidth=v+"px",s.value.style.maxWidth=v+"px"}catch(w){console.log(w)}}function b(v){return v===null?!1:v.classList.contains("head-cell-resize")}o.value.addEventListener("pointerdown",function(w){var st;function k(I){return I.screenX+S-D}const j=o.value,m=[...j.children].filter(I=>I.localName==="th"),S=((st=j.offsetParent)==null?void 0:st.scrollLeft)||0,x=m.map(I=>I.clientWidth),ee=b(w.target),D=j.getBoundingClientRect().left,ge=k(w),N=c(x,ge),tt=x.slice(0,N).reduce((I,L)=>I+L,0),nt=ge-tt,Fe=j.offsetWidth,te=m[N].clientWidth;if(r.config[N].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",w.screenX),console.log("Widths",x),console.log("max width",Fe),console.log("Start Position",ge),console.log("Position From",N),console.log("Start Position",N),console.log("Global offset (Отступ самой таблицы от края экрана)",D),console.log("Del",nt),console.groupEnd(),s.value.innerText=m[N].textContent||"",s.value.style.display="grid",s.value.style.width=te+"px",s.value.style.cursor="grabbing",u(tt),h(te),document.addEventListener("pointermove",ot,{passive:!0}),document.addEventListener("pointerup",rt);function rt(I){if(console.group("END"),document.removeEventListener("pointermove",ot),document.removeEventListener("pointerup",rt),ee&&(r.config[N].width=s.value.style.width,r.config[N].minWidth=s.value.style.width,r.config[N].maxWidth=s.value.style.width,i(r.config)),!ee){const L=I.screenX+S-D;console.log("ENP Position",L);const ye=d(x,L);if(console.log(N,"->",ye),ye!==N){const ne=r.config[N],We=r.config;We.splice(N,1),We.splice(ye,0,ne),i(We)}else{const ne=r.config[N].name;l(ne)}}s.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function ot(I){if(ee){const ne=k(I)-ge+te;h(ne);return}let L=I.screenX+S-D-nt;L<0&&(L=0),L+te>Fe&&(L=Fe-te),u(L)}})});function i(c){e("update:config",c)}function l(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(r.order.length===0||r.order[0]!==c)return void a([c]);const d=r.order.length===1||r.order[1]==="asc"?"asc":"desc";a([c,d==="asc"?"desc":"asc"])}function a(c){e("update:order",c)}return(c,d)=>(n.openBlock(),n.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:o},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.config,(u,h)=>(n.openBlock(),n.createBlock(Es,n.mergeProps({key:u},u,{onOrder:b=>l(u.name),onSelect:d[0]||(d[0]=b=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),n.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:s},"test",512)],512))}});const bs=f(ks,[["__scopeId","data-v-11644ad4"]]),Cs=50,$s=n.defineComponent({__name:"widget-list",props:{array:{},wait:{type:Boolean},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(t,{emit:e}){const r=t;function o(a,c=!0){var d;if(r.selectedRows)if(!c)i([a]);else{const u=r.selectedRows.indexOf(a);u===-1?r.selectedRows.push(a):(d=r.selectedRows)==null||d.splice(u,1),i(r.selectedRows)}}function s(){var a;if(((a=r.selectedRows)==null?void 0:a.length)!==r.array.length)return i([...r.array]);i([])}function i(a){e("update:selectedRows",a)}function l(a){if(!a)return;const c=a.target;c.scrollTop+c.clientHeight+Cs>c.scrollHeight&&e("scrollEnd")}return(a,c)=>(n.openBlock(),n.createElementBlock("div",{class:"es-list-container",onScrollPassive:l},[n.createElementVNode("table",{class:n.normalizeClass(["widget-list",{"widget-list_load":a.wait}])},[n.createElementVNode("thead",null,[n.createVNode(bs,{onSelect:c[0]||(c[0]=d=>s()),"onUpdate:order":c[1]||(c[1]=d=>e("update:order",d)),"onUpdate:config":c[2]||(c[2]=d=>e("update:config",d)),config:a.config,order:a.order},null,8,["config","order"])]),n.createElementVNode("tbody",{class:n.normalizeClass(["widget-list-body",{"widget-list-body_inactive":a.wait}])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.array,(d,u)=>{var h;return n.openBlock(),n.createBlock(_s,{key:u,class:"widget-list-row",values:d,config:a.config,selected:(h=a.selectedRows)==null?void 0:h.includes(d),onSelect:b=>o(d,b)},null,8,["values","config","selected","onSelect"])}),128))],2)],2)],32))}});const Ss=f($s,[["__scopeId","data-v-eb609a21"]]),Ns={class:"widget-section"},Bs={class:"widget-section__header"},Ts={class:"widget-section-title"},Vs={class:"widget-section__body"},Is=n.defineComponent({__name:"widget-section",props:{title:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",Ns,[n.createElementVNode("div",Bs,[n.createElementVNode("p",Ts,n.toDisplayString(e.title),1)]),n.createElementVNode("div",Vs,[n.renderSlot(e.$slots,"default",{},void 0,!0)])]))}});const As=f(Is,[["__scopeId","data-v-07232553"]]);const Ps={props:{config:Array},name:"WidgetTableHead"},Os={class:"widget-table__head"},Rs={class:"widget-table__head-title"};function Ls(t,e,r,o,s,i){return n.openBlock(),n.createElementBlock("tr",Os,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.config,(l,a)=>(n.openBlock(),n.createElementBlock("th",{class:"widget-table__head-cell",key:a},[n.createElementVNode("p",Rs,n.toDisplayString(l.label||l.title),1)]))),128))])}const Ds=f(Ps,[["render",Ls],["__scopeId","data-v-2d396466"]]);function Fs(t,e,r){const o=t.map(s=>Ws(s,e,r));return n.h("tr",{class:"widget-table__row widget-table-row"},o)}function Ws(t,e,r){const{name:o,value:s}=R.getCellInfo(t,e),i={onClick:[],class:["widget-table__cell widget-table-cell"]};function l(u){i.onClick.push(()=>u(s,e))}function a(u){Array.isArray(u)?i.class.push(...u):i.class.push(u)}const c=[],d=[];if(t.type)switch(a(`widget-table-cell_${t.type}`),t.type){case"edit":{t.icon="edit",l(r.activate);break}case"remove":{l(r.removeRow),t.icon="remove";break}case"select-multi":{l(r.select.bind(r,!0)),a("widget-table-cell_use"),a("widget-table-cell_select"),d.push(n.h("div",{class:{"table-cell-toggle":!0,"table-cell-toggle_active":r.selected.value}}));break}case"select":{l(r.select.bind(r,!1)),a("widget-table-cell_use"),a("widget-table-cell_select"),d.push(n.h("div",{class:{"table-cell-toggle":!0,"table-cell-toggle_active":r.selected.value}}));break}}return t.onClick&&l(t.onClick),t.link&&(d.push(n.h(Ge.RouterLink,{to:t.link(s,e)})),a("list-cell-link")),t.href&&(d.push(n.h("a",{href:t.href(s,e),target:"_blank"})),a("list-cell-link")),s&&d.push(n.h("p",{},s)),t.icon&&d.push(n.h(E,{name:t.icon})),t.class&&a(t.class),c.push(n.h("td",i,d)),c}const Ms={props:{values:Object,config:Object,selected:Et},emits:["set","remove","select"],setup(t,e){const{emit:r}=e,o={activate(){r("set",t.values[C])},deactivate(){r("set",null)},removeRow(){r("remove")},selected:n.computed(()=>t.selected),select(s=!1){r("select",s)}};return()=>Fs(t.config,t.values,o)}},js={class:"widget-table-form"},xs=["colspan"],_t=n.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},controller:{}},setup(t){const e=t,r=n.computed(()=>{var l;return!((l=e.values)!=null&&l[C])}),o=n.inject(me.PROVIDE_NAME);function s(l){o&&(r.value?o.create(l):o.edit(e.values[C],l))}function i(){e.controller.deactivate()}return(l,a)=>(n.openBlock(),n.createElementBlock("tr",js,[n.createElementVNode("td",{colspan:l.rowLength},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.component),{values:l.values,"table-controller":l.controller,onSave:s,onClose:i,new:r.value},null,40,["values","table-controller","new"]))],8,xs)]))}}),Us=n.defineComponent({__name:"widget-table",props:{array:{},config:{},mini:{type:Boolean},activeRow:{},selectRows:{}},emits:["update:activeRow","update:selectRows"],setup(t,{emit:e}){const r=t;n.inject(me.PROVIDE_NAME);const o=n.useSlots(),s=n.computed(()=>{var a;return(a=o==null?void 0:o.default)==null?void 0:a.call(o)[0]});function i(a,c=!0){return r.selectRows?c?r.selectRows.indexOf(a)===-1?e("update:selectRows",[...r.selectRows,a]):e("update:selectRows",r.selectRows.filter(u=>u!==a)):e("update:selectRows",[a]):void 0}const l=Io(a=>e("update:activeRow",a));return n.onMounted(()=>{console.warn("WidgetTable is deprecated. Please use WidgetTable from new Import. Config: ",r.config)}),(a,c)=>(n.openBlock(),n.createElementBlock("table",{class:n.normalizeClass(["widget-table",{"widget-table_mini":a.mini}])},[n.createVNode(Ds,{config:a.config},null,8,["config"]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.array,(d,u)=>{var h;return n.openBlock(),n.createElementBlock(n.Fragment,{key:u},[n.createVNode(Ms,{config:a.config,values:d,selected:(h=a.selectRows)==null?void 0:h.includes(d[n.unref(C)]),onSet:c[0]||(c[0]=b=>e("update:activeRow",b)),onSelect:b=>i(d[n.unref(C)],b)},null,8,["config","values","selected","onSelect"]),a.activeRow===d[n.unref(C)]?(n.openBlock(),n.createBlock(_t,{key:0,component:s.value,controller:n.unref(l)(d[n.unref(C)]),"row-length":a.config.length,values:d},null,8,["component","controller","row-length","values"])):n.createCommentVNode("",!0)],64)}),128)),a.activeRow===0?(n.openBlock(),n.createBlock(_t,{key:0,component:s.value,controller:n.unref(l)(0),"row-length":a.config.length},null,8,["component","controller","row-length"])):n.createCommentVNode("",!0)])],2))}}),zs={class:"widget-form-info flex"},qs={class:"form-titles"},Gs={class:"form-title margin-0"},Hs={class:"form-info text_size_md margin-0"},Js={key:0,class:"form-container-label"},Ks={class:"form-label__title text_size_sm"},Ys=n.defineComponent({__name:"WidgetFormInfo",props:{title:{},info:{},label:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",zs,[n.createElementVNode("div",qs,[n.createElementVNode("p",Gs,n.toDisplayString(e.title),1),n.createElementVNode("p",Hs,n.toDisplayString(e.info),1)]),e.label?(n.openBlock(),n.createElementBlock("div",Js,[n.createElementVNode("div",{class:n.normalizeClass(["form-label",`form-label_${e.label.type}`])},[e.label.icon?(n.openBlock(),n.createBlock(E,{key:0,class:"form-label__icon",name:e.label.icon},null,8,["name"])):n.createCommentVNode("",!0),n.createElementVNode("p",Ks,n.toDisplayString(e.label.title),1)],2)])):n.createCommentVNode("",!0)]))}});const Xs=f(Ys,[["__scopeId","data-v-6ea1062c"]]),Zs={class:"wrap__widget-form"},Qs={class:"widget-form"},ei={class:"widget-form__head"},ti={class:"head-image"},ni={key:1},ri={class:"widget-form__body"},oi=n.defineComponent({__name:"WidgetForm",props:{title:{},info:{},image:{},icon:{},label:{},button:{},wait:{type:Boolean}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",Zs,[n.createElementVNode("div",Qs,[n.createElementVNode("div",ei,[n.createElementVNode("div",ti,[e.wait?(n.openBlock(),n.createBlock(Q,{key:0,color:"#3949AB"})):(n.openBlock(),n.createElementBlock("div",ni,[e.icon?(n.openBlock(),n.createBlock(E,{key:0,class:"form-image",name:e.icon},null,8,["name"])):n.createCommentVNode("",!0)]))]),n.createVNode(Xs,{title:e.title,info:e.info,label:e.label},null,8,["title","info","label"]),e.button&&e.button.length?(n.openBlock(),n.createBlock(Je,{key:0,class:"widget-form__button",array:e.button},null,8,["array"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",ri,[n.renderSlot(e.$slots,"default",{},void 0,!0)])])]))}});const si=f(oi,[["__scopeId","data-v-f076ad65"]]),ii={class:"validation-item-header"},ai={class:"validation-item__title text_bold margin-0"},li={class:"validation-item-content"},ci={class:"text_bold text_md margin-0"},di={class:"text_md margin-0"},ui=n.defineComponent({__name:"modal-validation-item",props:{message:{},status:{},statusName:{},title:{},name:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["validation-item",`validation-item_${e.statusName.toLowerCase()}`])},[n.createElementVNode("div",ii,[n.createElementVNode("p",ai,n.toDisplayString(e.statusName),1)]),n.createElementVNode("div",li,[n.createElementVNode("p",ci,n.toDisplayString(e.title),1),n.createElementVNode("p",di,n.toDisplayString(e.message),1)])],2))}});const pi=f(ui,[["__scopeId","data-v-e6138c02"]]),fi={class:"modal-wrap"},mi={class:"modal-wrap-head"},hi={class:"modal-head__title margin-0"},_i={class:"modal-wrap-body"},gi=n.defineComponent({__name:"modal-wrap",props:{title:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",fi,[n.createElementVNode("div",mi,[n.createElementVNode("p",hi,n.toDisplayString(e.title),1)]),n.createElementVNode("div",_i,[n.renderSlot(e.$slots,"default",{},void 0,!0)])]))}});const yi=f(gi,[["__scopeId","data-v-119165b9"]]),vi={class:"modal-validation-body"},wi=n.defineComponent({__name:"modal-validation",props:{array:{}},setup(t){return(e,r)=>(n.openBlock(),n.createBlock(yi,{title:"Validation results"},{default:n.withCtx(()=>[n.createElementVNode("div",vi,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.array,(o,s)=>(n.openBlock(),n.createBlock(pi,{key:s,message:o.message,name:o.name,status:o.statusCode,"status-name":o.statusName,title:o.title},null,8,["message","name","status","status-name","title"]))),128))])]),_:1}))}});const Ei=f(wi,[["__scopeId","data-v-a39cfe2f"]]),ki=["alt","src"],bi=n.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,r=n.ref();return n.onMounted(()=>{r.value&&(r.value.src=e.src),r.value.onerror=function(){e.default&&(r.value.src=e.default)}}),(o,s)=>(n.openBlock(),n.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:r,src:o.src||o.$props.default},null,8,ki))}}),Ci=n.defineComponent({__name:"widget-input-check",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const r=t;function o(){e("update:modelValue",!r.modelValue)}return(s,i)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["widget-input-check",{"widget-input-check_active":s.modelValue}]),onClick:o},[s.modelValue?(n.openBlock(),n.createBlock(E,{key:0,name:"check"})):n.createCommentVNode("",!0)],2))}});const $i=f(Ci,[["__scopeId","data-v-f4a3dc6c"]]),Si={class:"widget-card"},Ni={class:"widget-card-toggle"},Bi={class:"widget-card-wrap"},Ti={class:"widget-card-content"},Vi={key:0,class:"widget-card-title"},Ii=n.defineComponent({__name:"widget-card",props:{title:{}},setup(t,{expose:e}){const r=n.reactive({selected:!1,hidden:!0});return e({state:r}),(o,s)=>(n.openBlock(),n.createElementBlock("div",Si,[n.createElementVNode("div",Ni,[n.createVNode($i,{modelValue:r.selected,"onUpdate:modelValue":s[0]||(s[0]=i=>r.selected=i)},null,8,["modelValue"])]),n.createElementVNode("div",Bi,[n.createElementVNode("div",{class:"widget-card-arrow",onClick:s[1]||(s[1]=i=>r.hidden=!r.hidden)},[n.createVNode(E,{name:"angle-small-right",class:n.normalizeClass(["card-icon-arrow",{"card-icon-arrow_active":!r.hidden}])},null,8,["class"])]),n.createElementVNode("div",Ti,[o.title?(n.openBlock(),n.createElementBlock("p",Vi,n.toDisplayString(o.title),1)):n.createCommentVNode("",!0),n.renderSlot(o.$slots,"main",{},void 0,!0),r.hidden?n.createCommentVNode("",!0):n.renderSlot(o.$slots,"sub",{key:1},void 0,!0)])])]))}});const Ai=f(Ii,[["__scopeId","data-v-bca33c5b"]]);class B{static parseError(e){let r=e.errors?Object.values(e.errors).map(o=>o[0]):null;throw T.AuthServiceError(e.title,r)}static login(e){return p(M.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:M.applicationName})}).catch(B.parseError)}static registration(e){return e.AppName=M.applicationName,p(M.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(B.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw T.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return B.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return B.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return B.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return B.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,r){return p(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(r)}).catch(B.parseError)}static startLoginProcess(e){return B.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return B.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return B.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,r){return p(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(r)}).catch(B.parseError).then(B.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw T.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}const Gt=class ce{static async create(e){return p(ce.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const r=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return p(ce.url+"?"+r.toString(),{method:"get"})}static async readMessages(e){return p(`${ce.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return p(`${ce.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};Gt.url="/close-api/communications";let ue=Gt;class Pi{static async getDefaultView(e){return p("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function gt(t){return{...t,createdEntities:t.createdEntites}}const Ht=class Be{static async getStartConfig(e,r){return p([Be.url,e,r].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,r){return p([Be.url,e,r].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(gt)}static async runStep(e,r,o,s,i){return p([Be.url,e,r].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:o,token:s,values:i})}).then(gt)}};Ht.url="/close-api/views/process-wizard";let Te=Ht;class Ze{static get url(){return"/close-api/metadata"}static async get(e,r,o){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const s=new URLSearchParams;return r&&s.append("criteria",r),o&&s.append("id",String(o)),await fetch(this.url+`/${e}?${s.toString()}`,{method:"GET"}).then(i=>i.json())}static getById(e,r,o=[]){const s=new URLSearchParams;return Ve(s,o),r&&s.append("id",r),p([this.url,e].join("/")+`?${s.toString()}`)}static getFieldInformation(e,r){return p(`/open-api/metadata/${e}/fields/${r}`)}static getTreatmentListField(e,r){return p(`/open-api/metadata/${e}/list-fields/${r}`)}}class Oi{static invite(e,r,o){return p("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:r,relatedRoleCode:o})})}static accept(e,r){return p("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:r,mark:!0})})}static decline(e,r){return p("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:r,mark:!1})})}}class Qe{static get url(){return"/close-api/rules-validation/"}static validate(e,r){return p(Qe.url+e,{method:"POST",body:JSON.stringify(r)})}}class Ri{static getConfiguration(){return p("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class Jt{static url(){return"/close-api/actions"}static async get({criterion:e}){const r=new URLSearchParams;return e&&r.append("criterion",e),await fetch(this.url()+`?${r.toString()}`,{method:"GET"}).then(o=>o.json())}static getById(e,r,o=[]){const s=new URLSearchParams;return Ve(s,o),p([this.url(),e,r].join("/")+`?${s.toString()}`,{method:"GET"})}}const Kt=class Yt extends P{constructor(e=[]){super(),this.array=n.reactive([]),this.defaultArray=[],this.setDefault(e)}emitUpdate(){this.emit(Yt.EVENT_DATA,this.array)}setDefault(e){const r=JSON.parse(JSON.stringify(e));this.defaultArray=r,this.set(r)}revert(){this.set(this.defaultArray)}set(e){this.array.splice(0,this.array.length,...e),this.emitUpdate()}append(e){this.array.push(e),this.emitUpdate()}moveTo(e,r){if(this.isOutOfRange(e)||this.isOutOfRange(r))throw new Error(`Provided position is out of range: ${e}, ${r}`);const o=this.array[e];this.array.splice(e,1),this.array.splice(r,0,o),this.emitUpdate()}remove(e){this.array.splice(e,1),this.emitUpdate()}isOutOfRange(e){return!(e>=0&&e<this.array.length)}};Kt.EVENT_DATA="list-config:update";let Li=Kt;class Di extends P{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return ue.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return ue.read(e).then(r=>r.length===0?ue.create(e):r[0])}}function Fi(t){const e=y.Form.getParentForm();e?e.subscribe(t):console.warn(T.ParentFormNotFound());const r=n.reactive([]);return t.read=()=>ue.readMessages(t.id).then(o=>(r.splice(0,r.length,...o),o)),{array:r}}function Wi(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function O(t){return Object.keys(t).reduce((e,r)=>{const o=t[r];if(Array.isArray(o)){const s=o.map(i=>typeof i=="string"?`'${i}'`:i).join(", ");return o.length&&e.push(`@${r} in (${s})`),e}if(Wi(o)){let s=function(i){var l;return((l=i.match(/([^Z]*)/))==null?void 0:l[0])+"0000Z"};return o.start&&e.push(`@${r} ge ${s(o.start)}`),o.end&&e.push(`@${r} le ${s(o.end)}`),e}return typeof o=="number"?(e.push(`@${r} eq ${o}`),e):typeof o=="string"?(o.length!==0&&e.push(`@${r} eq '${o}'`),e):(o===null&&e.push(O.is(r,o)),e)},[]).join(" and ")}function _e(t){return typeof t=="string"?`'${t}'`:`${t}`}O.includes=function(e,r){return`@${e} Contains ${_e(r)}`};O.beginWith=function(e,r){return`@${e} BeginWith ${_e(r)}`};O.notEq=function(e,r){return`@${e} nq ${_e(r)}`};O.eq=function(e,r){return Array.isArray(r)?O.in(e,r):`@${e} eq ${_e(r)}`};O.in=function(e,r){const o=r.map(_e).join(", ");return`@${e} in (${o})`};O.and=function(...e){return e.join(" and ")};O.is=function(e,r){return`@${e} is ${r}`};O.or=function(...e){return e.join(" or ")};function Mi(t,e="images"){return`/static-folder/${e}/${t}`}function ji(t,e,r){return t.reduce((o,s)=>{var a;let i=typeof e=="function"?e(s):s[e];const l=(a=o[o.length-1])==null?void 0:a.value;return l&&r(l,i)?o[o.length-1].array.push(s):o.push({value:i,array:[s]}),o},[])}function xi(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function Ui(t,e=1e3){let r=0;return(...o)=>{clearTimeout(r),r=setTimeout(()=>t(...o),e)}}function zi(t,e){const r=n.ref(null);function o(){return t.name?Ze.getById(t.name,e,[]).then(s=>{r.value=s,s.fields.forEach(i=>{i.canSet?t.enable(i.name):t.disable(i.name)})}).catch(()=>{r.value=null;const s=T.MetadataEntityIsNotAvailable(t.name||"FORM_WITHOUT_NAME");$.add("error",s.message)}):Promise.reject()}return t.on(y.Form.EVENT_READ,o),{metadata:r,update:o}}class et extends Error{static UndefinedStatus(){return new et("Status is undefined.")}}class qi extends et{}function Gi(t,e){const r=n.reactive([]);async function o(i,l){if(!i)throw qi.UndefinedStatus();const a=await Jt.get({criterion:i});r.splice(0,r.length),r.push(...a.map(c=>s(c,l)))}return{actions:r,update:o};function s(i,l){return{title:i.title,callback:()=>(()=>Promise.resolve().then(()=>{if(t.changed)return t.save()}).then(()=>fetch(i.url,{method:"POST",body:JSON.stringify({keys:{Id:l},contextId:_.contextId}),headers:{"Content-Type":"application/json"}})).then(c=>c.json()).then(c=>{if(!c.success)throw e!=null&&e.ModalValidationResult&&c.validationEffect?yt.openModal(e.ModalValidationResult,{rules:c.validationEffect.results}):$.add("error",c.message),new Error;return c}).then(c=>{c.message&&$.add("info",c.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(c.affectedEntities)}).then(()=>t.read()))()}}}class Ie{static url(){return"/close-api/presentation"}static getStatuses(e,r){return fetch(`${Ie.url()}/status/${e}/${r}`).then(o=>o.json())}}function Hi(t){const e=n.reactive({title:"Loading",type:"wait"});function r(o){if(t.name&&Number.isInteger(o))return Ie.getStatuses(t.name,o).then(s=>{e.type=s.type,e.title=s.name})}return t.on(y.Form.EVENT_READ,o=>{var l,a;const{code:s,name:i}={code:(l=o.Status)==null?void 0:l.Code,name:(a=o.Status)==null?void 0:a.Name};return t.name?!Number.isInteger(s)&&!i?void console.log("Undefined code or name is Status prop."):Ie.getStatuses(t.name,s).then(c=>{e.type=c.type,e.title=i}):void console.log("Form without name.")}),{label:e,update:r}}function Ji(t,e){const r=Ge.useRoute(),o=n.computed(()=>Number(r.params.id)),s=n.reactive({ready:!1,show:!1});return n.watch(()=>o.value,()=>{s.ready=!1}),n.watch(()=>o.value,()=>{Number.isInteger(o.value)&&t.read()},{immediate:!0}),t.read=de.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!t.name)throw new Error("Form without entity name. Please set form.name");return V.readById(t.name,o.value,{fields:e.fields})}).then(de.valuesToUpperCase).then(i=>(Number.isInteger(i.Version)&&(t.version=i.Version),t.setValues(i),s.show=!0,i)).catch(i=>{throw Object.prototype.hasOwnProperty.call(i,"status")&&[403,404].includes(i.status)&&(s.show=!1),i}).finally(()=>{s.ready=!0})),t.save=de.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!t.name)throw new Error("Form without entity name. Please set form.name");return V.updateById(t.name,o.value,t.changes,{version:t.version})}).then(i=>{t.version=i.version})),t.on(y.Form.EVENT_SAVE,t.read.bind(t)),{formShadowState:s}}function Ki(){const t=n.reactive({contextId:_.contextId,person:_.person,organizations:_.organizations,ready:_.ready,user:_.user}),e=n.computed(()=>{if(!_.ready||!_.person)return null;const o=t.contextId;return _.person.id===o?_.person:_.organizations.find(s=>s.id===o)||null}),r=n.computed(()=>{var o;return t.contextId===((o=t.person)==null?void 0:o.id)});return _.onupdateContext(o=>{t.contextId=o}),_.onupdateData(()=>{t.person=_.person,t.organizations=_.organizations,t.user=_.user}),_.onReady(o=>{t.ready=o}),{state:n.readonly(t),currentContext:e,isPerson:r}}function Yi(t,e){const r=n.reactive({ready:!1,show:!1});function o(){r.ready=!1,r.show=!1}return t.read=()=>{let s=e();return Promise.resolve().then(()=>{if(!t.name)throw T.EntityWithoutName("Use Form Request");return V.readById(t.name,s.id,{fields:s.fields})}).then(de.valuesToUpperCase).then(i=>(i.hasOwnProperty("Version")&&(t.version=Number(i.Version)),t.setValues(i),r.show=!0,i)).catch(i=>{const l=pe(i);throw $.add("error",l.message),l}).finally(()=>{r.ready=!0})},t.save=()=>{let s=e();return Promise.resolve().then(()=>{if(!t.name)throw T.EntityWithoutName("Use Form Request");return V.updateById(t.name,s.id,t.changes,{version:t.version})}).then(i=>{t.version=i.version||i.Version}).catch(i=>{const l=pe(i);throw $.add("error",l.message),l})},t.on(y.Form.EVENT_SAVE,t.read.bind(t)),{shadowFormState:r,initShadow:o}}class Xi{static getRequiredDocuments(e,r,o){const s=new URLSearchParams({entity:e,primaryKey:r,statusCode:o});return fetch(`/close-api/views/required-documents?${s.toString()}`).then(i=>i.json())}}class Y{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Y.url()}/calculator/${e}`)}static calculate(e,r){return p(`/${Y.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:r})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):T.ApiNotAvailable()})}static parseMetadataField(e){function r(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:e.name,label:e.title,required:e.required,type:r(e)}}static createOnlinePayment(e,r){return p(`/${Y.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:r})})}static applyOnlinePayment(e){return p(`/${Y.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class Zi{static getListSettings(e,r){const o=new URLSearchParams;o.set("entity",e),r&&o.set("mark",r);const s=`/close-api/views/list/configs?${o.toString()}`;return p(s)}}function Qi(t){return t.statusName==="Completed"}function ea(t){return t.statusName==="FinalStepWithConfirmation"}function ta(t){return t.statusName==="ValidationError"}function na(t,e,r){let o=null;const s=n.reactive({wait:null});let i=[],l=null;const a=n.ref(null);function c(){a.value=i.find(m=>m.name===l)||null}function d(){var m;return l?((m=i.find(S=>S.name===l))==null?void 0:m.fields)||[]:[]}function u(m){if(c(),ta(m))return void r.onValidation(m.validationResults);if((m.statusName==="FinalStep"||m.statusName==="NextStep")&&(!d().length||ra(d(),r.presets)))return j(r.presets||{});Qi(m)&&r.onCompleted(m),ea(m)&&r.onConfirmation(m)}async function h(){try{await b(),await k()}catch(m){const{message:S}=pe(m);$.add("error",S)}}function b(){return s.wait="Loading process information.",Te.getStartConfig(e,t).then(m=>{i=m.steps.map(S=>({label:S.title,name:S.stepName,number:S.number,fields:S.frontendEntity.objectTypes.reduce((x,ee)=>(ee.properties.forEach(D=>{x.push({name:D.name,label:D.title,type:D.refEntityName||D.dataType})}),x),[])}))}).then(m=>(s.wait=!1,m))}function v(m){return l=m.nextStepName,o=m.token,m}function w(m){const S=pe(m);$.add("error",S.message)}function k(){return s.wait="Starting process",Te.startProcess(e,t).then(v).then(u).catch(w).finally(()=>{s.wait=null})}function j(m={}){return!o||!l?Promise.reject("Not step or token."):(s.wait="Expect the result",Te.runStep(e,t,l,o,m).then(v).then(u).catch(w).finally(()=>{s.wait=!1}))}return{initialize:h,state:s,currentStepConfig:n.readonly(a),next:j}}function ra(t,e){for(let r=0;r<t.length;r++){const o=t[r];if(!y.utils.getPropFromObject(e,o.name))return!1}return!0}const oa="close-api/proxy/Equipment/Search";class sa{static search(e,r,o,s,i){const l=new URLSearchParams;l.append("pattern",e||""),r&&l.append("categoryId",r),o&&l.append("useType",String(o)),s&&l.append("statusCode",s),i&&(l.append("limit",String(i.limit)),l.append("offset",String(i.offset)));const a=`/${oa}?${l.toString()}`;return p(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const ia={clickOutside:Z,requestHandler:Le,valuesToUpperCase:De,prettyDate:Xe,prettyDateWithTime:Ut,Filter:O,staticLink:Mi,groupArrayByField:ji,uuidv4:xi,Request:p,prettyMoney:Pt},aa={widgets:mo,usage:ho,utils:$o,mixins:rn,config:So,types:No};exports.ApplicationManager=Vt;exports.Communication=Di;exports.ComputedMetadata=os;exports.CoreError=T;exports.Filter=O;exports.List=R;exports.ListConfig=Li;exports.Manager=_;exports.MetadataStore=le;exports.ModalValidation=Ei;exports.NotificationSystem=$;exports.ProcessWrap=Oe;exports.Request=p;exports.SYMBOL_ROW=C;exports.Table=me;exports.WidgetBreadcrumbs=ms;exports.WidgetButton=kt;exports.WidgetCard=Ai;exports.WidgetForm=si;exports.WidgetIcon=E;exports.WidgetImage=bi;exports.WidgetList=Ss;exports.WidgetMultiButton=Je;exports.WidgetNotificationSystem=$t;exports.WidgetSection=As;exports.WidgetSpinner=Q;exports.WidgetTable=Us;exports.WidgetWait=qt;exports.actionService=Jt;exports.authService=B;exports.billingService=Y;exports.clickOutside=Z;exports.clientService=Bt;exports.communicationService=ue;exports.configurationService=Zi;exports.dataService=V;exports.debounce=Ui;exports.default=aa;exports.documentsService=Xi;exports.equipmentService=sa;exports.fileService=wt;exports.historyService=Ro;exports.internationalizationService=is;exports.invitationService=Oi;exports.metadataService=Ze;exports.newImport=ns;exports.openService=Ri;exports.parseError=pe;exports.prettifyValueByMetadata=ss;exports.processWizardService=Te;exports.requestHandler=Le;exports.ruleValidationService=Qe;exports.setupSocket=ls;exports.t=X;exports.testTypes=Oo;exports.useCommunication=Fi;exports.useCustomerState=Ki;exports.useFormAction=Gi;exports.useFormLabel=Hi;exports.useFormMetadata=zi;exports.useFormRequest=Yi;exports.useFormRequestData=Ji;exports.useListConfig=Lo;exports.useListFilter=Fo;exports.useListOrder=jt;exports.useListProvide=Mt;exports.useListRead=Ft;exports.useListSearch=Do;exports.useListSelect=Wo;exports.useListState=Wt;exports.useManagerState=go;exports.useSocket=as;exports.useTableRequest=Po;exports.useTableState=Ao;exports.useWizard=na;exports.utils=ia;exports.viewService=Pi;
11
11
  //# sourceMappingURL=eservices-core.cjs.js.map
@@ -7,7 +7,7 @@ import { RouterLink as Yt, useRoute as Tn } from "vue-router";
7
7
  import Sn from "date-and-time";
8
8
  import { Manager as Cn } from "socket.io-client";
9
9
  /*!
10
- * eservices-core v1.2.13
10
+ * eservices-core v1.2.15
11
11
  * (c) 2023 ESERVICES
12
12
  */
13
13
  const g = (t, e) => {
@@ -2682,18 +2682,28 @@ Ce.setVocabulary = function(t) {
2682
2682
  vocabulary: t
2683
2683
  });
2684
2684
  };
2685
- function Co(t = "default") {
2685
+ function Co(t = "") {
2686
2686
  if (dt.manager)
2687
2687
  return dt.manager.socket(`/${t}`);
2688
2688
  }
2689
2689
  class dt {
2690
2690
  }
2691
- function Io(t = window.location.origin + "/socket.io") {
2692
- dt.manager = new Cn(t, {
2691
+ function Io(t = window.location.origin + "/socket.io", e = {}, n = {}) {
2692
+ const s = new Cn(t, {
2693
2693
  reconnectionDelayMax: 1e3,
2694
2694
  withCredentials: !0,
2695
- transports: ["websocket", "polling"]
2695
+ transports: ["websocket", "polling"],
2696
+ ...e
2696
2697
  });
2698
+ dt.manager = s;
2699
+ const r = () => {
2700
+ setTimeout(() => {
2701
+ s.open((i) => {
2702
+ i && r(), i || (console.log("Reconnection to socket success."), n != null && n.onReconnect && n.onReconnect());
2703
+ });
2704
+ }, 2e3);
2705
+ };
2706
+ s.on("close", r);
2697
2707
  }
2698
2708
  const Ni = { class: "breadcrumb__title" }, Pi = /* @__PURE__ */ b({
2699
2709
  __name: "widget-breadcrumb-item",
@@ -1,11 +1,11 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('[dir=rtl] .icon[data-v-0d979509]{transform:scaleX(-1)}.input-text-container[data-v-65e2ee2d]{position:relative;height:var(--input-height);width:100%;background-color:var(--input-background-color);border:var(--input-border);border-radius:var(--input-border-radius)}.input-text-container[data-v-65e2ee2d]:focus-within{outline:var(--input-border-active)}.input-text__error[data-v-65e2ee2d]{position:absolute;margin:0;top:100%}.input-text[data-v-65e2ee2d]{width:100%;height:100%;padding:0 10px;background-color:transparent;border:0;color:var(--input-color);font-size:var(--input-font-size);outline:none}.input-text[data-v-65e2ee2d]::placeholder{color:var(--input-placeholder-color)}.input-text-container[disabled=true][data-v-65e2ee2d]{background-color:var(--input-background-color-disabled);border:var(--input-border-disabled)}.input-text-container[error=true][data-v-65e2ee2d]{border:var(--input-border-error)}.input-text__password[data-v-65e2ee2d]{padding:0 6px;display:flex;align-items:center}.input-title[data-v-65e2ee2d]{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.input-title_required[data-v-65e2ee2d],.input-text__error[data-v-65e2ee2d]{color:red}.input__toggle[data-v-56d58611]{position:relative;width:40px;height:20px;background-color:var(--input-toggle-background-color);border-radius:var(--input-toggle-border-radius);cursor:pointer;transition:var(--fast);border:var(--input-toggle-border)}.input__toggle[data-v-56d58611]:before{content:"";position:absolute;top:0;bottom:0;margin:auto;left:3px;height:14px;width:14px;border-radius:var(--input-toggle-round-radius);background-color:var(--input-toggle-round-background-color);transition:var(--transition-fast)}.input__toggle.active[data-v-56d58611]{background-color:var(--input-toggle-background-color-active)}.input__toggle.active[data-v-56d58611]:before{transform:translate(20px)}.input__toggle.disabled[data-v-56d58611]{background-color:var(--input-disabled-background-color);border:var(--input-disabled-border)}.input__toggle.disabled[data-v-56d58611]:before{background-color:var(--gray-1)}.input__toggle.disabled[data-v-56d58611]{cursor:auto}.item-wrap[data-v-69ab8592]{display:flex;align-items:center}.input-select__item[data-v-69ab8592]{margin:0;text-overflow:ellipsis;overflow:hidden;color:var(--text-black);transition:var(--fast);font-size:14px;line-height:19px;font-weight:400}.input-select__item.active[data-v-69ab8592]{background-color:var(--main);color:var(--text-white)}.input-select-container[data-v-c4acd469]{position:relative;width:100%;outline:none}.input-select-container.disabled>.input-select-container__current[data-v-c4acd469]{background-color:var(--input-background-color-disabled)}.input-select-container__list[data-v-c4acd469]{display:none;position:absolute;top:calc(100% - 5px);z-index:100;padding-top:4px;border:1px solid var(--gray-1);border-top:0;max-height:250px;width:100%;overflow:auto}.input-select-container.active .input-select-container__list[data-v-c4acd469]{display:block}.input-select-container.active>.input-select-container__current>img[data-v-c4acd469]{transform:rotate(-180deg)}.input-select-container__current[data-v-c4acd469]{display:flex;justify-content:space-between;align-items:center;padding:0 10px 0 0;border:var(--input-border);width:100%;border-radius:var(--input-border-radius);cursor:pointer;background-color:var(--input-background-color)}.current-placeholder[data-v-c4acd469]{padding:0 10px;color:var(--input-placeholder-color)}.input-select__ico-toggle[data-v-c4acd469]{fill:var(--main)}.input-select-container.error>.input-select-container__current[data-v-c4acd469]{border:1px solid var(--error)}.input-select-container.active>.input-select-container__current[data-v-c4acd469]{outline:var(--input-border-active)}.input-select-value[data-v-c4acd469]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;padding:0 16px;color:var(--input-color)}.container-input-file[data-v-bdbf1475]{height:var(--input-height);border:var(--input-border);background-color:var(--input-background-color);border-radius:var(--input-border-radius);padding:5px;display:flex;align-items:center;position:relative}.icon__file-upload[data-v-bdbf1475]{font-size:12px;color:var(--input-color)}.input-file[data-v-bdbf1475]{position:absolute;left:0;top:0;z-index:500;width:100%;height:100%;opacity:0;cursor:pointer}.input-file[data-v-bdbf1475]::-webkit-file-upload-button{visibility:hidden}.process-info[data-v-bdbf1475]{margin:4px 0}.widget-input__container[data-v-1e3f1057]{position:relative;outline:none}.widget-input__underline[data-v-1e3f1057]{height:2px;background-color:var(--input-line-color)}.widget-input__placeholder[data-v-1e3f1057]{margin:2px 0 0;color:var(--input-line-placeholder-color);font-size:var(--input-line-placeholder-font-size);line-height:var(--input-line-placeholder-line-height);-webkit-user-select:none;user-select:none}.widget-input__placeholder_error[data-v-1e3f1057]{color:var(--error)}.input-container__content[data-v-1e3f1057]{width:100%;display:flex}.input-text[data-v-212b50e2]{height:31px;width:100%;border:unset;outline:unset;background-color:transparent;color:var(--input-line-color);font-size:var(--input-line-font-size)}.input-text__password[data-v-212b50e2]{padding:0 6px;display:flex;align-items:center}.input-title[data-v-9c3e5ea6]{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.input-text-container[data-v-9c3e5ea6]{position:relative;height:32px;width:100%;background-color:var(--input-background-color);border:var(--input-border);border-radius:var(--input-border-radius)}.input-text-container[data-v-9c3e5ea6]:focus-within{border:var(--input-border-active)!important}.input-text__error[data-v-9c3e5ea6]{position:absolute;margin:0;top:100%;text-align:right}.input-text[data-v-9c3e5ea6]{width:100%;height:100%;padding:0 10px;background-color:transparent;border:0;color:var(--input-color);font-size:var(--input-font-size)}.input-text[data-v-9c3e5ea6]::placeholder{color:var(--input-placeholder-color)}.input-text-container[disabled=true][data-v-9c3e5ea6]{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.input-text-container[error=true][data-v-9c3e5ea6]{border:var(--input-border-error)}.input-text__password[data-v-9c3e5ea6]{padding:0 6px;display:flex;align-items:center}.input-text[data-v-9c3e5ea6]:focus{border:0;outline:0}.widget-button-wrap[data-v-b6be5c12]{width:fit-content;outline:none;-webkit-user-select:none;user-select:none;position:relative;--size: 30px;max-height:var(--size);height:var(--size)}.widget-button[data-v-b6be5c12]{background-color:var(--widget-button-background);color:var(--widget-button-color);border:var(--widget-button-border);border-radius:var(--widget-button-radius);height:fit-content;overflow:hidden}.widget-button__toggle[data-v-b6be5c12]{height:var(--size);width:var(--size)}.widget-button__toggle[data-v-b6be5c12]:hover{background-color:var(--widget-button-background-hover)}.widget-button__list[data-v-b6be5c12]{overflow:hidden;max-height:var(--size);transition:var(--fast);height:fit-content}.widget-button .widget-button__toggle-icon[data-v-b6be5c12]{transition:var(--fast)}.widget-button.active .widget-button__toggle-icon[data-v-b6be5c12]{transform:rotate(-180deg)}.widget-button__list-elem[data-v-b6be5c12]{line-height:var(--size);font-size:14px;padding:0 10px;transition:var(--extra-fast);min-width:80px}.widget-button__list-elem[data-v-b6be5c12]:hover{background-color:var(--widget-button-background-hover)}.function-item[data-v-73f7eb9f]{padding:10px}.form-title[data-v-c91ffa31]{flex-grow:1}.widget-form[data-v-c3e88e10]{width:100%;max-width:966px;overflow:hidden;border:var(--form-border);background-color:var(--form-background-color);box-shadow:var(--form-shadow);border-radius:var(--form-radius);border-bottom:5px solid var(--form-border-bottom)}.widget-form__head[data-v-c3e88e10]{min-height:60px;align-items:center;background-color:var(--form-head-background-color)}@media screen and (min-width: 769px){.widget-form__head[data-v-c3e88e10]{flex-wrap:nowrap;padding:0 20px 0 40px}.widget-form__head-button[data-v-c3e88e10]{margin-right:15px}}@media screen and (max-width: 768px){.widget-form[data-v-c3e88e10]{width:100%}.widget-form__head[data-v-c3e88e10]{flex-wrap:wrap}}.widget-form__head-functions[data-v-c3e88e10]{height:100%;align-items:center}.widget-form__body[data-v-c3e88e10]{overflow:auto}.form-container-item[data-v-9264f6f4]{flex-wrap:wrap;gap:10px}.form-container-item-center[data-v-9264f6f4]{flex-grow:1;max-width:240px}.form-container-item__title[data-v-9264f6f4]{min-width:180px;max-width:180px;min-height:30px;justify-content:flex-end}.form-container-item__title>span[data-v-9264f6f4]{display:flex;align-items:center;font-size:14px;height:30px;line-height:130%}.form-container-item-1 .form-container-item-center[data-v-9264f6f4]{max-width:unset}.form-container-item__right[data-v-9264f6f4]{flex-grow:1;max-width:240px}.content_double[data-v-9264f6f4]{max-width:480px}.container-auth-wrap[data-v-0b1a5e81]{display:flex;align-items:center;justify-content:center;background-color:var(--container-auth-background-color);border-radius:var(--container-auth-border-radius);box-shadow:var(--container-auth-box-shadow);overflow:hidden;max-width:900px}.container-auth-wrap[data-v-0b1a5e81]{display:flex;width:100%;height:100%}.container-auth-sidebar[data-v-0b1a5e81]{width:300px;background-color:var(--container-auth-sidebar-background-color)}.container-auth-main[data-v-0b1a5e81]{display:flex;flex-direction:column;flex-grow:1;position:relative}@media screen and (min-width: 768px){.container-auth-wrap[data-v-0b1a5e81]{height:500px}.container-auth-wrap>div[data-v-0b1a5e81]{height:100%}.container-auth-sidebar[data-v-0b1a5e81]{height:100%}}@media screen and (max-width: 768px){.container-auth-wrap[data-v-0b1a5e81]{flex-direction:column}.container-auth-sidebar[data-v-0b1a5e81]{height:220px}}.loader[data-v-661e0416],.loader[data-v-661e0416]:after{border-radius:50%;width:14px;height:14px}.loader[data-v-661e0416]{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;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8-661e0416 1.1s infinite linear;animation:load8-661e0416 1.1s infinite linear}@-webkit-keyframes load8-661e0416{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8-661e0416{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.button-wrap[data-v-3cf452e1]{position:relative}.button-spinner[data-v-3cf452e1]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.button-element[data-v-3cf452e1]{height:100%;width:100%;padding:0 20px;cursor:pointer;background-color:transparent;outline:unset;border:unset;color:unset;font-weight:unset;font-size:unset}.widget-button-wrap[data-v-3edae6ea]{--button-size: 40px;max-height:var(--button-size);z-index:1;position:relative;cursor:pointer;width:fit-content}.widget-multi-button[data-v-3edae6ea]{display:flex;background-color:#3949ab;border-radius:20px;overflow:hidden}.button__content[data-v-3edae6ea]{max-height:40px;min-width:80px;transition:.2s;overflow:hidden}.button__content_active[data-v-3edae6ea]{max-height:200px}.button__content-title[data-v-3edae6ea]{white-space:nowrap;font-size:14px;line-height:20px;padding:10px 10px 10px 20px;color:#fff;margin:0;transition:background-color .2s}.button__content-title[data-v-3edae6ea]:hover{background-color:#223296}.button__toggle_active[data-v-3edae6ea]{transform:rotate(180deg)}.button__side[data-v-3edae6ea]{min-width:var(--button-size)}.button__size-toggle[data-v-3edae6ea]{height:var(--button-size)}.button__size-toggle[data-v-3edae6ea]{cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .1s,background-color .2s;color:#fff}.button__size-toggle[data-v-3edae6ea]:hover{background-color:#223296}.button__toggle-icon[data-v-3edae6ea]{height:16px}.button__size-progress[data-v-3edae6ea]{display:flex;align-items:center;justify-content:center;height:var(--button-size)}.widget-error[data-v-8a0a0924]{height:38px;background-color:#ffb694;box-shadow:4px 4px 10px #ff500033}.widget-error-text[data-v-8a0a0924]{margin:0}.widget-error-wrap[data-v-8a0a0924]{height:100%;display:flex;align-items:center;justify-content:center}.widget-error-close[data-v-8a0a0924]{display:flex;align-items:center;justify-content:center;height:100%;width:40px;cursor:pointer}.widget-error-close[data-v-8a0a0924]:after,.widget-error-close[data-v-8a0a0924]:before{position:absolute;content:"";height:20px;width:2px;background-color:#000;border-radius:2px}.widget-error-close[data-v-8a0a0924]:after{transform:rotate(45deg)}.widget-error-close[data-v-8a0a0924]:before{transform:rotate(-45deg)}.widget-error-message[data-v-8a0a0924]{font-size:14px;line-height:130%;letter-spacing:.05em;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.widget-error-main[data-v-8a0a0924]{width:700px}.widget-error__container-close[data-v-8a0a0924]{height:100%}.article-details[data-v-8a0a0924]{font-size:18px;line-height:130%;letter-spacing:.05em;text-decoration-line:underline;font-weight:700;cursor:pointer}.fade-enter-active[data-v-aa732044],.fade-leave-active[data-v-aa732044]{transition:.5s ease;max-height:38px}.fade-enter-from[data-v-aa732044],.fade-leave-to[data-v-aa732044]{opacity:0;max-height:0}.container-errors[data-v-8e9870dd]{display:flex;gap:1px;flex-direction:column;position:fixed;top:0;left:0;width:100%;z-index:11}.fade-enter-active[data-v-8e9870dd],.fade-leave-active[data-v-8e9870dd]{transition:.5s ease;max-height:38px}.fade-enter-from[data-v-8e9870dd],.fade-leave-to[data-v-8e9870dd]{opacity:0;max-height:0}.modal__wait[data-v-4d18289e]{padding:40px 30px;max-width:450px}*{--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}.grid{display:grid}.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}.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}.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}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15,.padding_20{padding:15px}.es-list-container{overflow:auto}.widget-table__head[data-v-f478f0d8]{text-align:start}.widget-table__head-cell[data-v-f478f0d8]{padding:18px;text-align:start}.widget-table__head-title[data-v-f478f0d8]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-weight:600;font-size:14px;line-height:19px;margin:0}.widget-wait[data-v-2038b2ba]{align-items:center}.wait-spinner[data-v-2038b2ba]{padding:8px}.widget-table-loader{padding:10px 0}.breadcrumb[data-v-1702aee0]{gap:8px;align-items:center;color:#828282;cursor:pointer}.breadcrumb__title[data-v-1702aee0]{font-weight:400;font-size:12px;line-height:16px;margin:0}.breadcrumb__icon[data-v-1702aee0]{height:16px}.breadcrumb_active[data-v-1702aee0],.breadcrumb[data-v-1702aee0]:hover{color:#4f4f4f}.widget-breadcrumbs[data-v-1dfb2668]{display:flex;gap:14px}tr[data-v-47478206]{border:1px solid #F3F4FC;height:30px}th[data-v-47478206],td[data-v-47478206]{position:relative;padding:0 11px}th[data-v-47478206]{text-align:left}p[data-v-47478206]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.head-cell[data-v-03c9724f]{padding:0 15px 0 10px;display:flex}.head-cell[data-v-03c9724f]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-03c9724f]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-03c9724f]{position:absolute;inset-inline-end:4px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-03c9724f]{transform:rotate(180deg)}.head-cell-resize[data-v-03c9724f]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-03c9724f]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-03c9724f]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-11644ad4]{position:sticky;top:-1px;z-index:1}.test-block[data-v-11644ad4]{background-color:#e7f2ff;inset-block-start:-1px;position:absolute;z-index:2;-webkit-user-select:none;user-select:none;white-space:nowrap;padding:0 10px;height:calc(100% + 1px);display:none;place-content:center}.widget-list-head th[data-v-11644ad4]{position:sticky;top:0;z-index:2;-webkit-user-select:none;user-select:none}.head-cell[data-v-11644ad4]{display:flex;cursor:pointer;padding:0 10px}.head-cell-label[data-v-11644ad4]{flex-grow:1;margin:0;white-space:nowrap;-webkit-user-select:none;user-select:none}.list-arrow[data-v-11644ad4]{position:relative;display:block;height:15px;width:2px;background-color:gray;border-radius:2px}.list-arrow[data-v-11644ad4]:after,.list-arrow[data-v-11644ad4]:before{position:absolute;display:block;content:"";background-color:gray;height:8px;width:2px;border-radius:2px}.list-arrow[data-v-11644ad4]:after{transform:rotate(-30deg);right:-2px}.list-arrow[data-v-11644ad4]:before{transform:rotate(30deg);left:-2px}.block-list-arrow[data-v-11644ad4]{transition:.1s}.down[data-v-11644ad4]{transform:rotate(180deg)}.head-cell-order[data-v-11644ad4]{display:grid;place-content:center}.widget-list-head-label[data-v-11644ad4]{font-weight:400;font-size:13px;line-height:16px;padding:5px 0}.head-cell-resize[data-v-11644ad4]{position:relative;padding:3px 10px;cursor:col-resize}.head-cell-resize[data-v-11644ad4]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:gray}.widget-list-body[data-v-eb609a21]{position:relative}.widget-list-body[data-v-eb609a21]:after{content:"";background-color:transparent;z-index:-1;transition:.1s}.widget-list-body_inactive[data-v-eb609a21]:after{z-index:0;position:absolute;top:0;background-color:#afafaf80;height:100%;width:100%}.widget-section[data-v-07232553]{background-color:var(--form-section-background-color);box-shadow:var(--form-section-box-shadow);border-radius:var(--form-section-border-radius)}.widget-section__header[data-v-07232553]{border-radius:10px 10px 0 0;display:flex;padding:8px 8px 8px 40px;background-color:var(--form-section-header-background-color)}.widget-section-title[data-v-07232553]{flex-grow:1;font-weight:var(--form-section-title-font-weight);color:var(--form-section-title-color);font-size:var(--form-section-title-font-size);line-height:var(--form-section-title-line-height);margin:0}.widget-section__body[data-v-07232553]{padding:20px 40px}.widget-table__head[data-v-2d396466]{text-align:left;position:sticky;top:-1px;z-index:0}.widget-table__head-cell[data-v-2d396466]{padding:18px}.widget-table__head-title[data-v-2d396466]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-weight:600;font-size:14px;line-height:19px;margin:0}.form-titles[data-v-6ea1062c]{display:flex;flex-direction:column;justify-content:center}.form-label[data-v-6ea1062c]{display:flex;gap:10px;padding:4px 7px;align-items:center}.form-container-label[data-v-6ea1062c]{margin:0 0 0 6px}.form-info[data-v-6ea1062c]{color:#828282}.form-label[data-v-6ea1062c]{background-color:#ff6262;color:#fff;border-radius:4px}.form-title[data-v-6ea1062c]{font-weight:700;font-size:18px;line-height:25px}.form-label__title[data-v-6ea1062c]{margin:0;line-height:16px}.form-label__icon[data-v-6ea1062c]{height:16px;font-size:16px}.form-label_inactive[data-v-6ea1062c]{background-color:gray}.form-label_correct[data-v-6ea1062c]{background-color:green}.form-label_warning[data-v-6ea1062c]{background-color:#ff0}.form-label_error[data-v-6ea1062c]{background-color:#ff6262}.widget-form[data-v-f076ad65]{display:flex;flex-direction:column;gap:10px}.widget-form__head[data-v-f076ad65]{display:flex;gap:16px;align-items:center;z-index:1;padding:10px 0}.widget-form__button[data-v-f076ad65]{margin-left:auto}.wrap__widget-form[data-v-f076ad65]{padding:20px}.widget-form__head[data-v-f076ad65]{position:sticky;top:0}@media screen and (max-width: 768px){.wrap__widget-form[data-v-f076ad65]{padding:10px}.widget-form__head[data-v-f076ad65]{top:15px}}.head-image[data-v-f076ad65]{padding:15px;background-color:#f3f4fc;border-radius:8px}.validation-item[data-v-e6138c02]{display:grid;grid-template-columns:70px 1fr;border:1px solid #00CCB1;border-radius:4px}.validation-item_failed[data-v-e6138c02]{border-color:#ee8030}.validation-item-header[data-v-e6138c02]{display:grid;place-content:center;background-color:#00ccb1}.validation-item_failed .validation-item-header[data-v-e6138c02]{background-color:#ee8030}.validation-item__title[data-v-e6138c02]{font-weight:700;font-size:18px;line-height:25px;color:#fff}.validation-item-content[data-v-e6138c02]{display:flex;flex-direction:column;padding:10px 16px;gap:10px}.modal-wrap[data-v-119165b9]{max-height:80%;display:flex;flex-direction:column}.modal-wrap-head[data-v-119165b9]{display:flex;align-items:center;padding:10px;background:#F3F4FC;border-radius:8px 8px 0 0}.modal-head__title[data-v-119165b9]{font-weight:700;font-size:18px;line-height:25px}.modal-wrap-body[data-v-119165b9]{background-color:#fff;border-radius:0 0 8px 8px;overflow:auto}.modal-validation-body[data-v-a39cfe2f]{display:flex;flex-direction:column;gap:10px;padding:20px}.widget-input-check[data-v-f4a3dc6c]{display:grid;place-items:center;height:20px;aspect-ratio:1/1;border:2px solid #1a1a1a;border-radius:4px;cursor:pointer;background-color:#fff}.widget-input-check_active[data-v-f4a3dc6c]{background-color:#2f2f2f}.widget-input-check>i[data-v-f4a3dc6c]{font-size:12px;height:12px;color:#fff}.widget-card[data-v-bca33c5b]{display:flex}.widget-card-toggle[data-v-bca33c5b]{padding:10px}.widget-card-wrap[data-v-bca33c5b]{display:flex;flex-grow:1;background-color:#fff;border:1px solid #cbcbcb;border-radius:8px}.widget-card-arrow[data-v-bca33c5b]{padding:10px;cursor:pointer}.card-icon-arrow[data-v-bca33c5b]{display:block;transition:transform var(--fast)}.card-icon-arrow_active[data-v-bca33c5b]{transform:rotate(90deg)}.widget-card-title[data-v-bca33c5b]{margin:0;font-weight:600;font-size:18px;line-height:20px}.widget-card-content[data-v-bca33c5b]{padding:9px 0;flex-grow:1}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
2
  (function(d,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("jenesius-vue-modal"),require("jenesius-vue-form"),require("object-hash"),require("vue-router"),require("date-and-time"),require("socket.io-client")):typeof define=="function"&&define.amd?define(["exports","vue","jenesius-vue-modal","jenesius-vue-form","object-hash","vue-router","date-and-time","socket.io-client"],n):(d=typeof globalThis<"u"?globalThis:d||self,n(d["eservices-core"]={},d.Vue,d.JenesiusVueModal,d.JenesiusVueForm,d.ObjectHash,d.VueRouter,d.DateAndTime,d.SocketIoClient))})(this,function(d,n,nt,y,rt,Me,Zt,Qt){"use strict";/*!
3
- * eservices-core v1.2.13
3
+ * eservices-core v1.2.15
4
4
  * (c) 2023 ESERVICES
5
5
  */const ea="",m=(t,e)=>{const r=t.__vccOpts||t;for(const[o,i]of e)r[o]=i;return r},b=m({props:{name:String},setup(t,e){let r="unknown";try{r=e.slots.default()[0].children}catch{r=t.name}typeof r!="string"&&console.warn(`Name for Icon.vue is not string. ${r}`);try{r=r.replace(/\s+/g,"")}catch{}return()=>n.h("i",{class:`icon icon-${r}`})}},[["__scopeId","data-v-0d979509"]]);function en(t,e){return!!t&&t===e||"password is not equal"}function ye(t){return Number(t.replace(/[^0-9.]/g,""))}function Ue(t,e=null){let o=String(ye(t)).split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.length>1&&e!==null&&o[1].length>e&&(o[1]=o[1].substring(0,e)),o.join(".")}const tn=Object.freeze(Object.defineProperty({__proto__:null,numeric:ye,prettyNumeric:Ue,validPassword:en},Symbol.toStringTag,{value:"Module"})),z={props:{title:{type:String},modelValue:{default(){return null}},placeholder:[String],required:{type:Boolean,default(){return!1}},rules:{type:Array,default(){return[]}},array:Array,name:String,disabled:Boolean,complex:{type:Boolean,default(){return!1}}},data:()=>({errorMessage:!1,isInsideDisabled:!1,isInsideRequired:!1,value:null}),computed:{arrayParse(){return this.array?this.array.map(t=>["string","number"].includes(typeof t)?{value:t,title:t}:t):[]},currentTitle(){let t="",e=this.arrayParse.find(r=>r.value===this.value);return e&&(t=e.title),t},elemController(){return{_self:this,name:this.name,setValue:t=>{this.setValue(t)},getValue:()=>this.value,validate:()=>this.validate(),disable:()=>{this.isInsideDisabled=!0},enable:()=>{this.isInsideDisabled=!1}}}},emits:["update:modelValue","input"],inject:{formController:{default:null}},methods:{validate(){const t=[...this.rules];this.required&&t.push(e=>e!=null||"Please fill in this field");for(let e=0;e<t.length;e++){let r=t[e](this.value);if(r!==!0)return this.setError(r),!1}return!0},input(t){this.errorMessage=!1,!(this.disabled||this.isInsideDisabled)&&(typeof t=="string"&&t.length===0&&(t=null),this.name&&this.formController&&this.formController.onInput({name:this.name,value:t}),this.setValue(t))},setValue(t){this.value=t,this.$emit("update:modelValue",t),this.$emit("input",t)},select(t){this.input(t)},setError(t){this.errorMessage=t},error(t){this.errorMessage=t}},mounted(){!this.complex&&this.formController&&this.formController.onDepend(this.elemController)},beforeUnmount(){!this.complex&&this.formController&&this.formController.unDepend(this.elemController)},watch:{modelValue(t){this.value=t}}},we={props:{password:{type:Boolean,default:()=>!1}},data:()=>({isPasswordVisible:!1}),methods:{togglePasswordVisible(t=!this.isPasswordVisible){this.isPasswordVisible=t}},computed:{inputType(){return this.password&&!this.isPasswordVisible?"password":"text"}}},nn=Object.freeze(Object.defineProperty({__proto__:null,MixinInput:z,MixinInputPassword:{props:{password:{type:Boolean,default:()=>!1}},data:()=>({isPasswordVisible:!1}),methods:{togglePasswordVisible(t=!this.isPasswordVisible){this.isPasswordVisible=t}}},MixinInputText:we},Symbol.toStringTag,{value:"Module"})),ra="";function Ee(t,e=[]){let r=t;return e.forEach(o=>{r=o(r)}),r}const rn={components:{Icon:b},props:{modify:{type:Function,default:t=>t},pretty:{type:Function,default:t=>t},numeric:{type:Boolean,default:!1},prettyNumeric:{type:Boolean,default:!1}},computed:{prettyValue(){return console.log("pretty value"),this.pretty(Ee(this.modelValue,this.arrayInputPrettyModifiers))},arrayInputModifiers(){let t=[];return(this.numeric||this.prettyNumeric)&&t.push(ye),t},arrayInputPrettyModifiers(){let t=[];return this.prettyNumeric&&t.push(Ue),t}},methods:{onChange(t){let e=this.modify(Ee(t.target.value,this.arrayInputModifiers));this.input(e)},onInput(){const t=this.$refs.input.value,e=this.modify(t);this.input(e),this.$refs.input.value=this.pretty(e)},_onInput(t){let e=this.modify(Ee(t.target.value,this.arrayInputModifiers));this.input(e),this.$refs.input.value=this.pretty(Ee(this.modelValue,this.arrayInputPrettyModifiers))}},mixins:[z,we],name:"InputText"},on={class:"input-wrap"},sn={key:0,class:"input-title"},an={key:0,class:"input-title_required"},ln=["disabled","error"],cn=["type","placeholder","disabled","error","value"],dn={key:1,class:"input-text__error text_sm"};function un(t,e,r,o,i,s){const l=n.resolveComponent("icon");return n.openBlock(),n.createElementBlock("div",on,[t.title?(n.openBlock(),n.createElementBlock("p",sn,[n.createTextVNode(n.toDisplayString(t.title)+" ",1),t.required?(n.openBlock(),n.createElementBlock("span",an,"*")):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"input-text-container input_size_md flex",disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage},[n.createElementVNode("input",{class:"input-text",type:t.inputType,placeholder:t.placeholder,disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage,ref:"input",value:r.pretty(t.value),onInput:e[0]||(e[0]=(...a)=>s.onInput&&s.onInput(...a))},null,40,cn),t.password?(n.openBlock(),n.createElementBlock("div",{key:0,class:"input-text__password",onClick:e[1]||(e[1]=a=>t.togglePasswordVisible())},[n.createVNode(l,{class:"cursor_pointer",name:t.isPasswordVisible?"eye-crossed":"eye"},null,8,["name"])])):n.createCommentVNode("",!0),t.errorMessage?(n.openBlock(),n.createElementBlock("p",dn,n.toDisplayString(t.errorMessage),1)):n.createCommentVNode("",!0)],8,ln)])}const pn=m(rn,[["render",un],["__scopeId","data-v-65e2ee2d"]]),oa="",fn={mixins:[z],name:"InputToggle"};function mn(t,e,r,o,i,s){return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["input__toggle widget-input",{active:t.value,disabled:t.disabled||t.isInsideDisabled}]),onClick:e[0]||(e[0]=l=>t.input(!t.value))},null,2)}const hn=m(fn,[["render",mn],["__scopeId","data-v-56d58611"]]),ia="",_n={props:["isActive","title"],name:"FragmentInputSelectItem"},gn={class:"item-wrap"};function yn(t,e,r,o,i,s){return n.openBlock(),n.createElementBlock("div",gn,[n.createElementVNode("p",{class:n.normalizeClass(["input-select__item cursor_pointer",{active:r.isActive}])},n.toDisplayString(r.title),3)])}const wn=m(_n,[["render",yn],["__scopeId","data-v-69ab8592"]]);function Y(t,e){if(!t)return console.warn("Element is not provided.");function r(i,s){return i==s.target||i.contains(s.target)}const o=i=>{r(t,i)||(e(),window.removeEventListener("click",o))};window.addEventListener("click",o)}const sa="",En={data:()=>({isActive:!1}),computed:{titleValue(){try{return this.arrayParse.find(t=>t.value===this.value).title}catch{return""}}},methods:{active(t=!this.isActive){this.isInsideDisabled||this.disabled||(this.isActive=t)},hide(){this.isActive=!1}},watch:{isActive(t){t&&Y(this.$refs.input,()=>this.hide())}},components:{Icon:b,FragmentInputSelectItem:wn},mixins:[z],name:"InputSelect"},kn={class:"input-wrap"},bn={key:0,class:"input-title"},Cn={key:0,class:"color__text_red"},$n={class:"input-select-container__current input_size_md flex"},Sn={key:0,class:"input-select-value"},Nn={key:1,class:"current-placeholder text_md"},Bn={class:"input-select-list input-select-container__list"},Tn={key:0,class:"input-text__error position_absolute margin-0 text_sm color__text_red"};function Vn(t,e,r,o,i,s){const l=n.resolveComponent("icon"),a=n.resolveComponent("fragment-input-select-item");return n.openBlock(),n.createElementBlock("div",kn,[t.title?(n.openBlock(),n.createElementBlock("p",bn,[n.createTextVNode(n.toDisplayString(t.title)+" ",1),t.required?(n.openBlock(),n.createElementBlock("span",Cn,"*")):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["input-select-container cursor_pointer",{active:t.isActive,disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage}]),onClick:e[1]||(e[1]=c=>s.active()),ref:"input"},[n.createElementVNode("div",$n,[t.value===void 0||t.value===null?(n.openBlock(),n.createElementBlock("span",Nn,n.toDisplayString(t.placeholder),1)):(n.openBlock(),n.createElementBlock("p",Sn,n.toDisplayString(s.titleValue),1)),t.disabled||t.isInsideDisabled?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(l,{key:2,class:"input-select__ico-toggle",name:"caret-down"}))]),n.createElementVNode("div",Bn,[t.value?(n.openBlock(),n.createBlock(a,{key:0,onClick:e[0]||(e[0]=c=>t.input(null))})):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.arrayParse,(c,u)=>(n.openBlock(),n.createBlock(a,{class:"input-select-list__item",key:u,"is-active":c.value===t.value,title:c.title,onClick:p=>t.input(c.value)},null,8,["is-active","title","onClick"]))),128))]),t.errorMessage?(n.openBlock(),n.createElementBlock("p",Tn,n.toDisplayString(t.errorMessage),1)):n.createCommentVNode("",!0)],2)])}const In=m(En,[["render",Vn],["__scopeId","data-v-c4acd469"]]);class ot{static async upload(e,r){const o=new FormData;o.append("file",e);const i=`/close-api/files?entityName=${r}`;return await fetch(i,{method:"POST",body:o}).then(s=>s.json()).then(s=>(s.filename=e.name,s))}}function ke(t=()=>null){let e=t;const r=n.reactive({wait:!1,error:!1,ready:!1});return r.call=async function(...o){this.wait=!0,this.error=!1,this.ready=!1;try{await e(...o),this.ready=!0}catch{this.error=!0}this.wait=!1},r.setFunction=async function(o){e=o},r}const aa="",An=n.defineComponent({props:{entityName:{type:String,required:!0}},emits:["load","change","input"],data:()=>({pw:null}),created(){this.pw=ke(this.onLoad)},methods:{async onChange(t){t&&this.pw.call(t)},async onLoad(t){const e=await ot.upload(t,this.entityName);this.$emit("load",e),this.name&&this.input(e.id)}},mixins:[z],components:{Icon:b}}),Pn={class:"container-input-file"},On={key:0,class:"process-info input-file__wait text_size_sm"},Rn={key:1,class:"process-info input-file__error text_size_sm text_error"};function Ln(t,e,r,o,i,s){const l=n.resolveComponent("icon");return n.openBlock(),n.createElementBlock("div",Pn,[n.createVNode(l,{name:"plus",class:"icon__file-upload"}),n.createElementVNode("input",{type:"file",class:"input-file",onChange:e[0]||(e[0]=a=>t.onChange(a.target.files[0]))},null,32),t.pw.wait?(n.openBlock(),n.createElementBlock("p",On,"Loading...")):n.createCommentVNode("",!0),t.pw.error?(n.openBlock(),n.createElementBlock("p",Rn,"Error load file")):n.createCommentVNode("",!0)])}const Dn={InputText:pn,InputToggle:hn,InputSelect:In,InputLoadFile:m(An,[["render",Ln],["__scopeId","data-v-bdbf1475"]])},ca="",Wn={props:{placeholder:String,error:[Boolean,String]},setup(){return{}},name:"WidgetInputContainer"},Fn=t=>(n.pushScopeId("data-v-1e3f1057"),t=t(),n.popScopeId(),t),Mn={class:"widget-input__container"},Un={class:"input-container__content"},jn=Fn(()=>n.createElementVNode("div",{class:"widget-input__underline"},null,-1));function zn(t,e,r,o,i,s){return n.openBlock(),n.createElementBlock("div",Mn,[n.createElementVNode("div",Un,[n.renderSlot(t.$slots,"default",{},void 0,!0)]),jn,r.placeholder?(n.openBlock(),n.createElementBlock("p",{key:0,class:n.normalizeClass(["widget-input__placeholder",{"widget-input__placeholder_error":r.error}])},n.toDisplayString(r.placeholder),3)):n.createCommentVNode("",!0)])}const qn=m(Wn,[["render",zn],["__scopeId","data-v-1e3f1057"]]),da="",vn={components:{Icon:b,WidgetInputContainer:qn},mixins:[z,we],name:"InputText"},Gn=["type","value"];function Hn(t,e,r,o,i,s){const l=n.resolveComponent("icon"),a=n.resolveComponent("widget-input-container");return n.openBlock(),n.createBlock(a,{placeholder:t.placeholder,error:!!t.errorMessage},{default:n.withCtx(()=>[n.createElementVNode("input",{type:t.password&&!t.isPasswordVisible?"password":"text",class:"input-text title_sm",value:t.value,onChange:e[0]||(e[0]=c=>t.input(c.target.value)),onKeyup:e[1]||(e[1]=n.withKeys(c=>t.$emit("enter"),["enter"]))},null,40,Gn),t.password?(n.openBlock(),n.createElementBlock("div",{key:0,class:"input-text__password",onClick:e[2]||(e[2]=c=>t.togglePasswordVisible())},[n.createVNode(l,{class:"cursor_pointer",name:t.isPasswordVisible?"eye-crossed":"eye"},null,8,["name"])])):n.createCommentVNode("",!0)]),_:1},8,["placeholder","error"])}const Jn={InputText:m(vn,[["render",Hn],["__scopeId","data-v-212b50e2"]])},pa="";function be(t,e=[]){let r=t;return e.forEach(o=>{r=o(r)}),r}const xn=n.defineComponent({components:{Icon:b},props:{title:String,modify:{type:Function,default:t=>t},pretty:{type:Function,default:t=>t},numeric:{type:Boolean,default:!1},prettyNumeric:{type:Boolean,default:!1}},computed:{prettyValue(){return console.log("pretty value"),this.pretty(be(this.modelValue,this.arrayInputPrettyModifiers))},arrayInputModifiers(){let t=[];return(this.numeric||this.prettyNumeric)&&t.push(ye),t},arrayInputPrettyModifiers(){let t=[];return this.prettyNumeric&&t.push(Ue),t}},methods:{onChange(t){let e=this.modify(be(t.target.value,this.arrayInputModifiers));this.input(e)},onInput(){const t=this.$refs.input.value,e=this.modify(t);this.input(e),this.$refs.input.value=this.pretty(e)},_onInput(t){let e=this.modify(be(t.target.value,this.arrayInputModifiers));this.input(e),this.$refs.input.value=this.pretty(be(this.modelValue,this.arrayInputPrettyModifiers))}},mixins:[z,we],name:"InputText"}),Kn={key:0,class:"input-title"},Yn={key:0,class:"color__text_red"},Xn=["disabled","error"],Zn=["type","placeholder","disabled","error","value"],Qn={key:1,class:"input-text__error text_sm color__text_red"};function er(t,e,r,o,i,s){const l=n.resolveComponent("icon");return n.openBlock(),n.createElementBlock(n.Fragment,null,[t.title?(n.openBlock(),n.createElementBlock("p",Kn,[n.createTextVNode(n.toDisplayString(t.title)+" ",1),t.required?(n.openBlock(),n.createElementBlock("span",Yn,"*")):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"input-text-container flex",disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage},[n.createElementVNode("input",{class:"input-text",type:t.inputType,placeholder:t.placeholder,disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage,ref:"input",value:t.pretty(t.value),onInput:e[0]||(e[0]=(...a)=>t.onInput&&t.onInput(...a))},null,40,Zn),t.password?(n.openBlock(),n.createElementBlock("div",{key:0,class:"input-text__password",onClick:e[1]||(e[1]=a=>t.togglePasswordVisible())},[n.createVNode(l,{class:"cursor_pointer",name:t.isPasswordVisible?"eye-crossed":"eye"},null,8,["name"])])):n.createCommentVNode("",!0),t.errorMessage?(n.openBlock(),n.createElementBlock("p",Qn,n.toDisplayString(t.errorMessage),1)):n.createCommentVNode("",!0)],8,Xn)],64)}const tr={default:Dn,line:Jn,naomi:{InputText:m(xn,[["render",er],["__scopeId","data-v-9c3e5ea6"]])}},ha="",nr={components:{Icon:b},props:{title:String,values:[Object,Array,String]},setup(t){Array.isArray(t.values)&&t.values.forEach(l=>{l.func&&console.warn("Prop func is deprecated. Use callback.",l)});const e=n.computed(()=>{if(!o.value)return"30px";let l=0;return Array.isArray(t.values)&&(l+=t.values.length),t.title&&l++,typeof t.values=="string"&&!Array.isArray(t.values)&&l++,l*30+"px"}),r=n.computed(()=>Array.isArray(t.values)?t.values:typeof t.values=="string"?{title:t.values}:[t.values]),o=n.ref(!1);function i(l=!o.value){o.value=l,l&&Y(s.value,()=>i(!1))}const s=n.ref(null);return{isActive:o,array:r,toggle:i,button:s,maxHeight:e}},name:"Button"},rr={class:"widget-button-wrap flex"},or=["onClick"];function ir(t,e,r,o,i,s){const l=n.resolveComponent("icon");return n.openBlock(),n.createElementBlock("div",rr,[n.createElementVNode("div",{class:n.normalizeClass(["widget-button flex",{active:o.isActive}]),ref:"button"},[n.createElementVNode("div",{class:"widget-button__list flex_column",style:n.normalizeStyle({maxHeight:o.maxHeight})},[r.title?(n.openBlock(),n.createElementBlock("span",{key:0,class:"widget-button__list-elem cursor_pointer",onClick:e[0]||(e[0]=a=>o.toggle())},n.toDisplayString(r.title),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.array,(a,c)=>(n.openBlock(),n.createElementBlock("span",{class:"widget-button__list-elem cursor_pointer",onClick:u=>(a.callback(),o.toggle(!1)),key:c},n.toDisplayString(a.title),9,or))),128))],4),o.array.length>1?(n.openBlock(),n.createElementBlock("div",{key:0,class:"widget-button__toggle flex flex_center cursor_pointer",onClick:e[1]||(e[1]=n.withModifiers(a=>o.toggle(),["stop"]))},[n.createVNode(l,{class:"widget-button__toggle-icon",name:"angle-small-down"})])):n.createCommentVNode("",!0)],2)])}const it=m(nr,[["render",ir],["__scopeId","data-v-b6be5c12"]]),_a="",sr={props:{icon:String,func:Function},name:"WidgetFormFunctionItem",components:{Icon:b}};function ar(t,e,r,o,i,s){const l=n.resolveComponent("icon");return n.openBlock(),n.createElementBlock("div",{class:"function-item cursor_pointer",onClick:e[0]||(e[0]=(...a)=>r.func&&r.func(...a))},[n.createVNode(l,{name:r.icon},null,8,["name"])])}const lr=m(sr,[["render",ar],["__scopeId","data-v-73f7eb9f"]]),ga="",cr={props:{title:String},name:"WidgetFormTitle"},dr={class:"form-title"},ur={class:"title_lg color__text_black margin-0"};function pr(t,e,r,o,i,s){return n.openBlock(),n.createElementBlock("div",dr,[n.createElementVNode("h2",ur,n.toDisplayString(r.title),1)])}const fr=m(cr,[["render",pr],["__scopeId","data-v-c91ffa31"]]),ya="",mr={components:{WidgetFormTitle:fr,WidgetFormFunctionItem:lr,WidgetButton:it},props:{title:String,button:{type:[Array,Object],default:()=>[]},functions:[Array]},name:"WidgetForm"},hr={class:"widget-form flex_column"},_r={class:"widget-form__head flex"},gr={class:"widget-form__head-functions flex"},yr={class:"widget-form__body"};function wr(t,e,r,o,i,s){const l=n.resolveComponent("widget-form-title"),a=n.resolveComponent("widget-button"),c=n.resolveComponent("widget-form-function-item");return n.openBlock(),n.createElementBlock("div",hr,[n.createElementVNode("div",_r,[n.createVNode(l,{title:r.title},null,8,["title"]),Array.isArray(r.button)&&r.button.length||!Array.isArray(r.button)&&r.button?(n.openBlock(),n.createBlock(a,{key:0,class:"widget-form__head-button",values:r.button},null,8,["values"])):n.createCommentVNode("",!0),n.createElementVNode("div",gr,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.functions,(u,p)=>(n.openBlock(),n.createBlock(c,{key:p,icon:u.icon,func:u.callback},null,8,["icon","func"]))),128))])]),n.createElementVNode("div",yr,[n.renderSlot(t.$slots,"default",{},void 0,!0)])])}const Er={default:{WidgetForm:m(mr,[["render",wr],["__scopeId","data-v-c3e88e10"]])}},Ea="",kr={props:{title:String,subTitle:String,type:[String,Number],double:{type:Boolean,default:()=>!1}},name:"ContainerFormElem"},br={class:"form-container-item__title flex"},Cr={class:""},$r={key:0,class:""},Sr={class:"title_sm"},Nr={key:1,class:"form-container-item__right"};function Br(t,e,r,o,i,s){return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["form-container-item flex",[`form-container-item-${r.type}`]])},[n.createElementVNode("div",br,[n.createElementVNode("span",Cr,n.toDisplayString(r.title),1)]),n.createElementVNode("div",{class:n.normalizeClass(["form-container-item-center flex_column",{content_double:r.double}])},[n.renderSlot(t.$slots,"default",{},void 0,!0)],2),r.subTitle?(n.openBlock(),n.createElementBlock("div",$r,[n.createElementVNode("span",Sr,n.toDisplayString(r.subTitle),1),n.renderSlot(t.$slots,"centerRight",{},void 0,!0)])):n.createCommentVNode("",!0),t.$slots.right?(n.openBlock(),n.createElementBlock("div",Nr,[n.renderSlot(t.$slots,"right",{},void 0,!0)])):n.createCommentVNode("",!0)],2)}const Tr=m(kr,[["render",Br],["__scopeId","data-v-9264f6f4"]]),ka="",Vr={name:"ContainerAuthView"},Ir={class:"container-auth-wrap"},Ar={class:"container-auth-sidebar"},Pr={class:"container-auth-main"};function Or(t,e,r,o,i,s){return n.openBlock(),n.createElementBlock("div",Ir,[n.createElementVNode("div",Ar,[n.renderSlot(t.$slots,"side",{},void 0,!0)]),n.createElementVNode("div",Pr,[n.renderSlot(t.$slots,"default",{},void 0,!0)])])}const Rr={ContainerFormElem:Tr,ContainerAuthView:m(Vr,[["render",Or],["__scopeId","data-v-0b1a5e81"]])},Lr=n.defineComponent({__name:"widget-spinner",props:{color:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",{class:"loader",style:n.normalizeStyle({"border-left":`1.1em solid ${e.color?e.color:"#fff"}`})},null,4))}}),Ca="",X=m(Lr,[["__scopeId","data-v-661e0416"]]),Dr={class:"button-element"},Wr=n.defineComponent({__name:"WidgetButton",props:{title:{},callback:{type:Function},wait:{type:Boolean},default:{type:Boolean}},setup(t){const e=t;function r(i){i.key==="Enter"&&o.call()}n.onMounted(()=>{e.default&&document.addEventListener("keypress",r)}),n.onUnmounted(()=>{document.removeEventListener("keypress",r)});const o=ke(e.callback);return(i,s)=>(n.openBlock(),n.createElementBlock("div",{class:"button-wrap",onClick:s[0]||(s[0]=l=>n.unref(o).call())},[n.unref(o).wait||i.wait?(n.openBlock(),n.createBlock(X,{key:0,class:"button-spinner"})):n.createCommentVNode("",!0),n.createElementVNode("button",Dr,[n.createTextVNode(n.toDisplayString(i.title)+" ",1),n.renderSlot(i.$slots,"default",{},void 0,!0)])]))}}),$a="",st=m(Wr,[["__scopeId","data-v-3cf452e1"]]),Fr={class:"widget-button-wrap"},Mr={class:"widget-multi-button"},Ur={class:"widget-button-list"},jr=["onClick"],zr={class:"button__side"},qr={key:0,class:"button__size-progress"},vr=n.defineComponent({__name:"WidgetMultiButton",props:{title:{},array:{}},setup(t){const e=ke(),r=n.reactive({active:!1});function o(s=!r.active){r.active=s}function i(s){e.setFunction(s),e.call()}return(s,l)=>(n.openBlock(),n.createElementBlock("div",Fr,[n.createElementVNode("div",Mr,[n.createElementVNode("div",{class:n.normalizeClass(["button__content",{button__content_active:r.active}])},[s.title?(n.openBlock(),n.createElementBlock("p",{key:0,class:"button__content-title widget-multi-button-row",onClick:l[0]||(l[0]=a=>o())},n.toDisplayString(s.title),1)):n.createCommentVNode("",!0),n.createElementVNode("div",Ur,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.array,(a,c)=>(n.openBlock(),n.createElementBlock("p",{class:"button__content-title widget-multi-button-row",key:c,onClick:u=>(i(a.callback),o(!1))},n.toDisplayString(a.title),9,jr))),128))])],2),n.createElementVNode("div",zr,[n.unref(e).wait?(n.openBlock(),n.createElementBlock("div",qr,[n.createVNode(X,{class:"button-spinner"})])):s.array&&s.array.length>1?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["button__size-toggle widget-multi-button-toggle",{button__toggle_active:r.active}]),onClick:l[1]||(l[1]=a=>o())},[n.createVNode(b,{class:"button__toggle-icon",name:"angle-small-down"})],2)):n.createCommentVNode("",!0)])])]))}}),Sa="",je=m(vr,[["__scopeId","data-v-3edae6ea"]]),Gr={WidgetButton:st,WidgetMultiButton:je},Hr={Icon:b},$=new class{constructor(){this.store=n.reactive([])}add(e,r,{children:o,timeout:i=10}={}){const s=new Jr(e,r,i,o||[]);return this.store.push(s),i&&setTimeout(this.remove.bind(this,s.id),i*1e3),s}remove(e){const r=this.store.findIndex(o=>o.id===e);if(r===-1)return!1;this.store.splice(r,1)}removeChild(e,r){throw new Error("Removing children error.")}},at=class Yt{constructor(e,r,o,i){this.type=e,this.msg=r,this.timeout=o,this.children=i,this.id=Yt.cardId++}};at.cardId=1;let Jr=at;const xr={class:"widget-error"},Kr={class:"widget-error-wrap"},Yr={class:"widget-error-main"},Xr={class:"widget-error-text widget-error-message"},Zr={class:"widget-error__container-close"},Qr=n.defineComponent({__name:"WidgetError",props:{isGroup:{type:Boolean},message:{}},emits:["close","toggle"],setup(t,{emit:e}){return(r,o)=>(n.openBlock(),n.createElementBlock("div",xr,[n.createElementVNode("div",Kr,[n.createElementVNode("div",Yr,[n.createElementVNode("p",Xr,n.toDisplayString(r.message),1)]),r.isGroup?(n.openBlock(),n.createElementBlock("p",{key:0,onClick:o[0]||(o[0]=i=>e("toggle")),class:"article-details"},"See details")):n.createCommentVNode("",!0),n.createElementVNode("div",Zr,[n.createElementVNode("div",{class:"widget-error-close",onClick:o[1]||(o[1]=i=>e("close"))})])])]))}}),Na="",lt=m(Qr,[["__scopeId","data-v-8a0a0924"]]),eo={key:0,class:"widget-error-details"},to=n.defineComponent({__name:"WidgetErrorGroup",props:{card:{}},emits:["closeCard","closeChild"],setup(t,{emit:e}){const r=t,o=n.computed(()=>{var s;return!!((s=r.card.children)!=null&&s.length)}),i=n.ref(!0);return(s,l)=>(n.openBlock(),n.createElementBlock("div",null,[(n.openBlock(),n.createBlock(lt,{message:s.card.msg,key:s.card.id,onClose:l[0]||(l[0]=a=>e("closeCard",s.card.id)),onToggle:l[1]||(l[1]=a=>i.value=!i.value),"is-group":o.value},null,8,["message","is-group"])),!i.value&&s.card.children?(n.openBlock(),n.createElementBlock("div",eo,[n.createVNode(n.TransitionGroup,{name:"fade"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.card.children,a=>(n.openBlock(),n.createBlock(lt,{key:a.id,message:a.msg,onClose:c=>e("closeChild",a.id)},null,8,["message","onClose"]))),128))]),_:1})])):n.createCommentVNode("",!0)]))}}),Ba="",no=m(to,[["__scopeId","data-v-aa732044"]]),ro={class:"container-errors"},oo=n.defineComponent({__name:"WidgetNotificationSystem",setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",ro,[n.createVNode(n.TransitionGroup,{name:"fade"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref($).store,o=>(n.openBlock(),n.createBlock(no,{key:o.id,card:o,onCloseCard:i=>n.unref($).remove(o.id),onCloseChild:i=>n.unref($).removeChild(o.id,i)},null,8,["card","onCloseCard","onCloseChild"]))),128))]),_:1})]))}}),Ta="",ct=m(oo,[["__scopeId","data-v-8e9870dd"]]);let io={inputs:tr,forms:Er,containers:Rr,buttons:Gr,icons:Hr,errorSystem:{default:ct}};const so={inputs:tn};function te(t,e){if(typeof t!="object"||t===null)return;if(e in t)return t[e];let r=e.indexOf(".");if(r>-1){const o=e.substring(0,r);return o in t?te(t[o],e.substr(r+1)):void 0}return t[e]}function ze(t){return t.reduce((e,r)=>e.then(o=>r==null?void 0:r(o)),Promise.resolve())}const dt=class w extends Error{constructor(e,r=null){super(),this.message=e,this.details=r,this.id=w.ID++}static ParentFormNotFound(){return new w("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new w("Composite object name is undefined",e)}static EntityWithoutName(e){return new w("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new w(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new w("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new w("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new w(`${e} (id) is not a number`)}static UndefinedErrorId(e,r){return w.ApiNotAvailable()}static ApiError(e){return new w("Request error",e)}static ApiNotAvailable(){return new w(`Sorry, we experience difficulties here.
6
6
  Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,r){return!e&&!r?w.ApiNotAvailable():new w(e||"Authorization Error",r)}static ApiResponseParseFailed(){return w.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new w("Object doesn't have id",e)}static ObjectWithIdNotFound(e,r){return new w(`Can't find object with id: ${e}`,r)}static ObjectWithoutConnectToPresentArray(e,r){return new w("Object is not found.",{object:e,array:r})}static EntityWithoutId(e){return new w("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,r){return new w(`Can't find the element with tableIndex ${e}`,r)}static UndefinedError(e,r=[]){return new w(e,r)}static TableArrayAlreadyIncludeProvidedIndexValue(e,r,o){return new w(`Array already includes the element with value ${e}`,{array:r,table:o})}static MetadataEntityIsNotAvailable(e){return new w(`Metadata for the ${e} is not currently available.`)}};dt.ID=0;let B=dt;const ut="Please try again later or submit a feedback if problem doesn't go.";function ne(t){return typeof t=="string"?qe(t):ao(t)?qe(t.message):qe(ut)}function ao(t){return!!(typeof t=="object"&&Object.hasOwnProperty.call(t,"message")&&t!==null)}function qe(t,e=[]){return{message:t,details:e}}class pt{static getClientData(){return f("/close-api/client-content")}static getNavigation(){return f("/close-api/client/navigation")}}/*!
7
7
  * jenesius-event-emitter v1.0.2
8
8
  * (c) 2022 Jenesius
9
9
  * @license MIT
10
- */const ft=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},mt=function(t,e){t in this.events&&this.events[t].forEach(r=>r(e))},ht=function(t,e){const r=this.events[t];if(!r)return;const o=r.indexOf(e);o!==-1&&r.splice(o,1)},_t=function(){this.events={}};class P{constructor(){this.events={}}on(e,r){return ft.call(this,e,r)}emit(e,r){return mt.call(this,e,r)}off(e,r){return ht.call(this,e,r)}cleanEvents(){_t.call(this)}static on(e,r){return ft.call(P,e,r)}static emit(e,r){return mt.call(P,e,r)}static off(e,r){return ht.call(P,e,r)}static cleanEvents(){_t.call(P)}}P.events={};var gt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},Ce=(t,e,r)=>(gt(t,e,"read from private field"),r?r.call(t):e.get(t)),ve=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Ge=(t,e,r,o)=>(gt(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),re,$e,Se;const q=class L extends P{constructor(){super(...arguments),ve(this,re,void 0),ve(this,$e,"front"),this.organizations=[],ve(this,Se,!1)}set language(e){localStorage.setItem(L.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(L.LOCALSTORAGE_LANGUAGE_KEY)||L.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(L.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){Ge(this,re,e)}get router(){if(!Ce(this,re))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return Ce(this,re)}set type(e){Ge(this,$e,e)}get type(){return Ce(this,$e)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Ge(this,Se,e),this.emit(L.EVENT_READY_UPDATE,e)}get ready(){return Ce(this,Se)}onReady(e){return this.on(L.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(L.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(L.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(L.CURRENT_CONTEXT_KEY,String(e)),this.emit(L.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(r=>r.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const r=Number.parseInt(localStorage.getItem(L.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(r)&&this.validateContextId(Number(r))?this.setCurrentContext(r):this.setCurrentContext(Number(e.id))}catch{$.add("error",B.ApiNotAvailable().message)}}loadCustomerData(){return pt.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var r;return((r=this.person)==null?void 0:r.id)==e?!0:!!this.organizations.find(o=>o.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const r=localStorage.getItem(this.getListKeyById(e));return r&&JSON.parse(r)}setListInformationToLocalStorage(e,r){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(r))}};re=new WeakMap,$e=new WeakMap,Se=new WeakMap,q.DEFAULT_LANGUAGE="en",q.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",q.EVENT_CONTEXT_UPDATE="event:context-update",q.EVENT_READY_UPDATE="event:ready-update",q.EVENT_DATA_UPDATE="event:data-update",q.CURRENT_CONTEXT_KEY="CurrentContext";let yt=q;const g=new yt;function lo(){const t=n.reactive({contextType:g.contextType,contextId:g.contextId,context:g.context});return g.onupdateContext(()=>{t.contextType=g.contextType,t.contextId=g.contextId,t.context=g.context}),t}function co(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return ut}})}function f(t,e={}){return g.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=g.contextId),e.redirect="manual",fetch(t,e).then(r=>r.type==="opaqueredirect"?void window.location.replace("/auth"):r).catch(()=>{throw B.ApiNotAvailable()}).then(r=>co(r).then(o=>{if(!r.ok)throw o;return o}))}class Ne{constructor(){}static parseNamesFromListConfig(e){let r=Ne.parseFieldsToGraphQL(e.reduce((i,s)=>(s.name&&i.push(s.name),i),[]));function o(i){let s="";for(let l in i)typeof i[l]=="boolean"?s+=` ${l} `:s+=` ${l} { ${o(i[l])} }`;return s}return o(r)}static parseSortFromListConfig(e){let r={};for(let o in e)r[o]=e[o]?"ASC":"DESC";return r}static parseFieldsToGraphQL(e){function r(o,i){if(i.includes(".")){const s=i.indexOf("."),l=i.substring(s+1),a=i.substring(0,s);a in o||(o[a]={}),r(o[a],l)}else o[i]=!0;return o}return e.reduce(r,{})}}class uo{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,r,o)=>(r!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),e[r]=o,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}const wt=new uo;function Et(t){return t&&t[0].toLowerCase()+t.slice(1)}const Ia="",po={props:{message:String},name:"ModalWait",components:{WidgetSpinner:X}},fo={class:"modal__wait modal-default flex_column"};function mo(t,e,r,o,i,s){const l=n.resolveComponent("widget-spinner");return n.openBlock(),n.createElementBlock("div",fo,[n.createVNode(l),n.createElementVNode("p",null,n.toDisplayString(r.message),1)])}const ho=m(po,[["render",mo],["__scopeId","data-v-4d18289e"]]),_o={error:!0,wait:!1,throw:!0};async function Be(t,e={}){const r={modalWait:null};e=Object.assign({},e,_o);try{e.wait&&(r.modalWait=await nt.openModal(ho,{message:typeof e.wait=="string"?e.wait:""}))}catch(o){console.warn(o)}return Promise.resolve(t()).catch(o=>{let i=o;if(typeof i=="string"&&(i=B.UndefinedError(i)),e.error&&(console.log(i,i.details),i instanceof B?$.add("error",i.message,{children:i.details||[],timeout:12}):i!=null&&i.message?$.add("error",i.message):(console.warn(i),$.add("error",B.ApiResponseParseFailed().message))),e.throw)throw i}).finally(()=>{var o;(o=r.modalWait)==null||o.close()})}function Te(t){return Object.keys(t).reduce((e,r)=>{let o=t[r];const i=r.charAt(0).toUpperCase()+r.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=Te(o)),e[i]=o,e},{})}function kt(t,e=2){if(!(typeof t=="string"||typeof t=="number"))return"";let o=String(t).split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.length<2&&(o[1]=""),o[1]=o[1].padEnd(e,"0"),o[1].length>e&&(o[1]=o[1].substring(0,e)),o.join(".")}const oe={Request:f,clickOutside:Y,getPropFromObject:te,runPromiseQueue:ze,GraphQL:Ne,firstChapterToLowerCase:Et,requestHandler:Be,valuesToUpperCase:Te,prettyMoney:kt},go=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Ne,Journal:wt,Request:f,clickOutside:Y,default:oe,firstChapterToLowerCase:Et,getPropFromObject:te,requestHandler:Be,runPromiseQueue:ze,valuesToUpperCase:Te},Symbol.toStringTag,{value:"Module"}));function bt(t,e=""){for(let r in t){if(typeof t[r]=="object"){bt(t[r],(e.length?`${e}-`:"")+r);continue}let o="--"+((e.length?`${e}-`:"")+r).replace(/([A-Z])/g,i=>`-${i}`.toLowerCase());document.documentElement.style.setProperty(o,t[r])}}const j={};function yo(t){for(let e in t)j[e]=t[e];t.styles&&bt(t.styles),wt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=j}const wo=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function Eo(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&typeof t[1]=="number"}const ko="masterId",bo="masterEntity";function Ve(t,e){if(!Array.isArray(e))return;if(Eo(e))return r(e);e.forEach(r);function r(o){t.append(bo,o[0]),t.append(ko,o[1].toString())}}class A{static async anonymousGetList(e){return await f(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(e,r){const o=new URLSearchParams;function i(l,a){const c=u=>o.append("fields",u);if(typeof a=="string")return c(a);if(Array.isArray(a))return c(a.join(" "));if(typeof a=="object")return c(Object.keys(a).join(" "))}function s(l,a){if(!a||!Object.keys(a).length)return;const c=Object.entries(a).map(([u,p])=>`@${u} ${p}`).join(",");l.append("order",c)}return r&&(i(o,r.fields),s(o,r.order),r.limit&&o.append("limit",r.limit.toString()),r.offset&&o.append("offset",r.offset.toString()),r.filter&&o.append("filter",r.filter.toString()),r.useUsageContext&&o.append("useUsageContext",r.useUsageContext.toString())),await f(`/close-api/data/${e}?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,r){const o=new URLSearchParams;function i(l,a){const c=u=>o.append("fields",u);if(typeof a=="string")return c(a);if(Array.isArray(a))return c(a.join(" "));if(typeof a=="object")return c(Object.keys(a).join(" "))}function s(l,a){if(!a||!Object.keys(a).length)return;const c=Object.entries(a).map(([u,p])=>`@${u} ${p}`).join(",");l.append("order",c)}return r&&(i(o,r.fields),s(o,r.order),r.limit&&o.append("limit",r.limit.toString()),r.offset&&o.append("offset",r.offset.toString()),r.filter&&o.append("filter",r.filter.toString()),r.useUsageContext&&o.append("useUsageContext",r.useUsageContext.toString())),f(`/close-api/data/entities/${e}/count?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,r,o){const i=new URLSearchParams;return Ve(i,o==null?void 0:o.masterEntities),f(`/close-api/data/${e}?${i.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static update(e,r,o,i={}){return f(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:o})})}static readById(e,r,o={}){const i=new URLSearchParams;if(o.fields){let s=o.fields;typeof s=="string"&&(s=[s]),i.append("fields",s.join(" "))}return f(`/close-api/data/entities/${e}/id/${r}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,r,o,i){const s=new URLSearchParams;return Ve(s,i==null?void 0:i.masterEntities),f(`/close-api/data/entities/${e}/id/${r}?${s.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:o,version:i==null?void 0:i.version})})}static removeById(e,r,o){const i=typeof r=="number"?{Id:r}:r;return A.removeByKeys(e,i,o)}static removeByKeys(e,r,o){return f(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:r,version:o})})}}var Ct=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},He=(t,e,r)=>(Ct(t,e,"read from private field"),r?r.call(t):e.get(t)),$t=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},St=(t,e,r,o)=>(Ct(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),ie,Ie;const Je=class ee extends P{constructor(e){super(),$t(this,ie,[]),$t(this,Ie,!1),this.hashParams="",this.offset=0,this.name=e.name}set wait(e){St(this,Ie,e),this.emit(ee.EVENT_CHANGE_WAIT,e)}get wait(){return He(this,Ie)}read(e){var i,s;this.wait=!0;const r={};e.order&&(r.order={[(i=e.order)==null?void 0:i.name]:(s=e.order)==null?void 0:s.duration}),e.fields&&(r.fields=e.fields),e.filter&&(r.filter=e.filter);const o=JSON.stringify(r.order)+JSON.stringify(r.filter);return o!==this.hashParams&&(this.offset=0,this.hashParams=o),e.limit&&(r.limit=e.limit),e.offset&&(r.offset=e.offset||this.offset),A.getList(this.name,r).then(l=>(this.offset===0&&(this.array=[]),this.offset+=r.limit,l)).then(l=>{this.array.push(...l)}).then(()=>this.emit(ee.EVENT_DATA,this.array)).finally(()=>{this.wait=!1})}set array(e){St(this,ie,e),this.emit(ee.EVENT_DATA,this.array)}add(e){He(this,ie).push(...e),this.emit(ee.EVENT_DATA,this.array)}get array(){return He(this,ie)}static GetFieldNames(e){return e.reduce((r,o)=>(o.name&&(typeof o.name=="string"?r.push(o.name):r.push(...o.name)),r),[])}static getCellInfo(e,r){const o=ee.getCellName(e),i=(()=>{let s=o?te(r,o):null;return s===void 0&&(s=null),e.value?e.value(s,r):s})();return{name:o,value:i}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}};ie=new WeakMap,Ie=new WeakMap,Je.EVENT_DATA="LIST:DATA",Je.EVENT_CHANGE_WAIT="LIST:UPDATE-WAIT";let Nt=Je;const S=Symbol("__ROW_INDEX__");let se=class extends Nt{constructor(e){super(e),this.rowIndex=1,this.changes={new:{},edit:{},remove:[]},this.save=()=>{}}get changed(){return Object.keys(this.changes.new).length||Object.keys(this.changes.edit).length||this.changes.remove.length}create(e){const r=this.wrapData(e);this.changes.new[r[S]]=r,this.emitChanges()}cleanChanges(){this.changes.new={},this.changes.edit={},this.changes.remove=[],this.emitChanges()}edit(e,r){const o=this.wrapData(r,e);if(this.changes.new[e])return this.changes.new[e]=o,this.emitChanges();this.array.find(i=>i[S]===e)&&(this.changes.edit[e]={...this.changes.edit[e],...o},this.emitChanges())}remove(e){if(this.changes.new[e])return delete this.changes.new[e],this.emitChanges();this.array.find(r=>r[S]===e)&&(delete this.changes.edit[e],this.changes.remove.includes(e)||this.changes.remove.push(e),this.emitChanges())}wrapData(e,r){return r===void 0&&!Object.prototype.hasOwnProperty.call(e,S.toString())&&(r=++this.rowIndex),{...e,[S]:r}}emitChanges(){this.emit(y.Form.EVENT_CHANGED,!0)}set array(e){super.array=e.map(r=>this.wrapData(r))}get array(){return super.array}log(e){console.log(`[table] ${e}`)}};se.PROVIDE_NAME="table-controller";function Co(t){return function(r){return{activate(){t(r)},deactivate(){t(null)}}}}function $o(t){const e=n.reactive(t.array);n.provide(se.PROVIDE_NAME,t);const r=n.reactive(t.changes);t.on(Nt.EVENT_DATA,l=>e.splice(0,e.length,...l)),t.on(y.Form.EVENT_CHANGED,()=>{r.new=Object.keys(t.changes.new).reduce((l,a)=>{const c=Number(a);return l[c]=t.changes.new[c],l},{})});const o=n.computed(()=>[...e.reduce((l,a)=>{const c=a[S];return t.changes.remove.includes(c)||l.push({...a,...t.changes.edit[c]}),l},[]),...Object.values(r.new)]),i=y.Form.getParentForm();return i==null||i.subscribe(t),{activeRow:n.ref(null),array:o}}function So(t,e){t.read=()=>A.getList(t.name,{fields:e==null?void 0:e.fields}).then(r=>t.array=r).then(()=>t.emit(y.Form.EVENT_READ,t.array)),t.save=()=>{const r=t.name;Object.values(t.changes.new).forEach(async i=>{await A.create(r,i)}),Object.entries(t.changes.edit).forEach(async([i,s])=>{await A.updateById(t.name,o(Number(i)),s)});function o(i){const s=t.array.find(l=>l[S]===i);return s.id|s.Id}t.changes.remove.forEach(async i=>{await A.removeById(r,o(i),0)}),t.emit(y.Form.EVENT_SAVE)}}const Aa="",No=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Bo{static readHistoryById(e,r){return f(`/close-api/audits/history/${e}/${r}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(o=>{const i=o.history.map(s=>{if(!s.changes)return s;const l=s.changes.map(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...s,changes:l}});return{...o,history:i}})}}var Bt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},F=(t,e,r)=>(Bt(t,e,"read from private field"),r?r.call(t):e.get(t)),v=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},G=(t,e,r,o)=>(Bt(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),Ae,ae,Pe,Oe,le,ce,xe;const H="_______LIST_______ROW_______INDEX________NAME_______",de=class U extends P{constructor(e){super(),this.LIST_ROW_KEY=1,v(this,Ae,void 0),this.array=[],v(this,ae,[]),v(this,Pe,[]),v(this,Oe,new Proxy({},{set:(r,o,i,s)=>(r[o]=i,this.emit(U.EVENT_FILTERS_UPDATE,r),!0),deleteProperty:(r,o)=>(delete r[o],this.emit(U.EVENT_FILTERS_UPDATE,r),!0)})),v(this,le,!1),v(this,ce,(...r)=>Promise),v(this,xe,()=>{}),G(this,Ae,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&G(this,ae,e.config)}set config(e){G(this,ae,e.map(y.utils.copyObject)),this.emitUpdateConfig()}get config(){return F(this,ae)}emitUpdateConfig(){this.emit(U.EVENT_CONFIG_UPDATE,this.config)}get order(){return F(this,Pe)}set order(e){G(this,Pe,e),this.emit(U.EVENT_ORDER_UPDATE,this.order)}get filters(){return F(this,Oe)}set filters(e){Pt(F(this,Oe),e)}set wait(e){G(this,le,e),this.emit(y.Form.EVENT_WAIT,F(this,le))}get wait(){return F(this,le)}get primaryKeys(){return F(this,Ae)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(r=>r[H]===e)}indexByKey(e){return this.array.findIndex(r=>r[H]===e)}static getKey(e){return e[H]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,H)}add(...e){const r=this.wrapArray(e);this.array.push(...r),this.emit(U.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const r=this.indexByKey(e);r!==-1&&(this.array.splice(r,1),this.emit(U.EVENT_DATA,this.array))}updateByKey(e,r){const o=this.atByKey(e);o&&(Object.assign(o,r),this.emit(U.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[H]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,H)}set read(e){G(this,ce,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const r=F(this,ce).call(this,...e);return this.wait=!0,r}).finally(()=>this.wait=!1)}set save(e){G(this,ce,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>F(this,xe).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((r,o)=>(o.name&&(typeof o.name=="string"?r.push(o.name):r.push(...o.name)),r),[])}static mergeWithKey(e,r){return{...e,[H]:r}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,r){const o=U.getCellName(e),i=(()=>{let s=o?te(r,o):null;return s===void 0&&(s=null),e.value?e.value(s,r):s})();return{name:o,value:i}}};Ae=new WeakMap,ae=new WeakMap,Pe=new WeakMap,Oe=new WeakMap,le=new WeakMap,ce=new WeakMap,xe=new WeakMap,de.EVENT_DATA="list-data: update",de.EVENT_CONFIG_UPDATE="list-config:update",de.EVENT_ORDER_UPDATE="list-order:update",de.EVENT_FILTERS_UPDATE="list-filters:update";let D=de;function Tt(t,e){let r="",o=0,i=!1,s;t.read=(l={})=>{if(t.wait)return s;if(l.clean&&(r="",o=0,i=!1),i)return Promise.resolve([]);let a=e;typeof a=="function"&&(a=a());const c={};if(!t.name)throw new Error("Reading list`s data without name is not available.");a.order&&Array.isArray(a.order)&&a.order.length&&(c.order={[a.order[0]]:a.order[1]||"asc"}),a.fields&&(c.fields=a.fields),a.filter&&(c.filter=a.filter);const u=JSON.stringify(c.order)+JSON.stringify(c.filter)+JSON.stringify(c.fields);return u!==r&&!Number.isNaN(u)&&(o=0,r=u),"limit"in a&&(c.limit=a.limit),c.offset=o||a.offset||0,s=A.getList(t.name,c).then(p=>((o===0||l.clean)&&t.set([]),o+=c.limit,p)).then(p=>(t.add(...p),p.length===0&&(i=!0),p)),s}}function Vt(t){const e=n.reactive({wait:t.wait,array:[]});return t.on(D.EVENT_DATA,r=>{e.array.splice(0,e.array.length,...r.map(o=>Object.freeze(JSON.parse(JSON.stringify(o)))))}),t.on(y.Form.EVENT_WAIT,()=>{e.wait=t.wait}),e}function It(t,e){const r="list-flex-config",o=n.inject(r,void 0);if(o)return o;if(!t||!e)throw new Error("Hook useProvideList has two required params: list and defaultSettings");t.on(D.EVENT_CONFIG_UPDATE,()=>{t.read()});const i={list:t,defaultSettings:e};return n.provide(r,i),i}function To(t){const e=n.reactive([...t.config]);return t.on(D.EVENT_CONFIG_UPDATE,r=>{e.splice(0,e.length,...r)}),e}function At(t){const e=t.order||[],r=n.reactive(e);return t.on(D.EVENT_ORDER_UPDATE,o=>{r.splice(0,r.length,...o),t.read()}),r}function Vo(t){const e=n.ref(""),r=n.computed(()=>{const o=e.value.toLowerCase();return n.unref(t).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(o):!0)});return{search:e,searchArray:r}}function Pt(t,e){Object.keys(t).forEach(r=>delete t[r]),Object.entries(e).forEach(([r,o])=>{t[r]=o})}function Io(t){const e=n.reactive(y.utils.copyObject(t.filters));return t.on(D.EVENT_FILTERS_UPDATE,r=>{Pt(e,r),t.read()}),e}function Ao(t){const e=n.reactive([]);function r(a){return e.includes(a)}function o(a){r(a)||e.push(a)}function i(a){const c=e.findIndex(u=>u===a);c!==-1&&e.splice(c,1)}function s(a){const c=n.unref(t);if(a===void 0){e.length===0?c.forEach(o):c.forEach(i);return}r(a)?i(a):o(a)}const l=n.computed(()=>{const a=n.unref(t);return e.length===a.length&&a.length!==0});return[e,s,l,o,i]}class Po extends D{constructor(e){super(e),this.changes=[],this.save=Oo.bind(this)}get changed(){return!!this.changes.find(e=>e.status==="active")}addChange(e,r){this.changes.push({type:e,status:"active",data:this.wrapItem(r)})}}function Oo(){const t=this.changes.filter(e=>e.status==="active");return ze(t.map(e=>{console.log("++")}))}function Ro(){const t=n.ref(null);function e(r){t.value=r&&rt(r)}return{activeRow:t,activateRow:e}}const Pa="",Lo={props:{config:Array},name:"WidgetTableHead"},Do={class:"widget-table__head"},Wo={class:"widget-table__head-title"};function Fo(t,e,r,o,i,s){return n.openBlock(),n.createElementBlock("tr",Do,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.config,(l,a)=>(n.openBlock(),n.createElementBlock("th",{class:"widget-table__head-cell",key:a},[n.createElementVNode("p",Wo,n.toDisplayString(l.title),1)]))),128))])}const Mo=m(Lo,[["render",Fo],["__scopeId","data-v-f478f0d8"]]);function Ot(t){return Ke(t,"YYYY/MM/DD HH:mm:ss")}function Ke(t,e="YYYY/MM/DD"){if(!t)return"";try{const r=new Date(t);return Zt.format(r,e)}catch(r){return console.log(r),"Invalid date"}}function Uo(t,e){const r=t.config.map(o=>jo(o,t,e));return n.h("tr",{class:"widget-table__row widget-table-row"},r)}function jo(t,e,r){const o=e.values;let{name:i,value:s}=D.getCellInfo(t,o);const l={onClick:[],class:["widget-table__cell widget-table-cell"]};function a(_){l.onClick.push(()=>_(o))}function c(_){Array.isArray(_)?l.class.push(..._):l.class.push(_)}const u=[],p=[];if(t.hide&&t.hide(o))return[n.h("td")];if(t.type)switch(c(`widget-table-cell_${t.type}`),t.type){case"number":{typeof s=="number"&&(s=new Intl.NumberFormat().format(s));break}case"date":{s=Ke(typeof s=="string"?s:null);break}case"dateTime":case"dateWithTime":{s=Ot(typeof s=="string"?s:null);break}case"multi-select":{p.push(n.h(y.FormField,{type:"single-checkbox",modelValue:e.selected})),a(Rt.bind(null,r,!0));break}case"select":{p.push(n.h(y.FormField,{type:"single-radio",modelValue:e.selected})),a(Rt.bind(null,r,!1));break}}if(t.checked){const _=t.checked(o);p.push(n.h(y.FormField,{type:"single-checkbox",modelValue:_}))}if(t.onClick&&a(t.onClick),t.link)try{const _=t.link(o);if(_){const N=n.h(Me.RouterLink,{to:_});p.push(N),c("list-cell-link")}}catch(_){console.warn("Error handle: Add Router link to cell",_)}return t.href&&(p.push(n.h("a",{href:t.href(o),target:"_blank"})),c("list-cell-link")),s!=null&&p.push(n.h("p",{class:"widget-list-cell-text"},s)),t.icon&&p.push(n.h(b,{name:t.icon})),t.class&&(typeof t.class=="function"?c(t.class(o)):c(t.class)),u.push(n.h("td",l,p)),u}function Rt(t,e){t.emit("select",e)}function Lt(t,e){return()=>{try{return Uo(t,e)}catch(r){return console.warn(r),null}}}const zo={props:{values:Object,config:Object,selected:Boolean},setup:Lt},qo=["colspan"],Dt=n.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{}},emits:["save","remove","close"],setup(t,{emit:e}){const r=t,o=n.ref(),i=n.computed(()=>!r.values&&!D.hasKey(r.values));return n.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(s,l)=>(n.openBlock(),n.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[n.createElementVNode("td",{colspan:s.rowLength},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(s.component),n.mergeProps(s.$attrs,{values:s.values,new:i.value,onClose:l[0]||(l[0]=a=>e("close")),onSave:l[1]||(l[1]=a=>e("save",a))}),null,16,["values","new"]))],8,qo)],512))}}),vo={class:"widget-wait flex gap_10 padding_15"},Go={class:"text_md"},Ho=n.defineComponent({__name:"widget-wait",props:{label:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",vo,[n.createVNode(X,{color:"var(--primary)",class:"wait-spinner"}),n.createElementVNode("span",Go,n.toDisplayString(e.label),1)]))}}),Oa="",Wt=m(Ho,[["__scopeId","data-v-2038b2ba"]]),Jo=n.defineComponent({__name:"widget-table",props:{array:{},config:{},mini:{type:Boolean},activeRow:{},selectRows:{},wait:{type:Boolean},classCallback:{type:Function}},emits:["update:activeRow","update:selectRows","save","read"],setup(t,{emit:e}){const r=t,o=n.useSlots(),i=n.computed(()=>{var c;return(c=o==null?void 0:o.default)==null?void 0:c.call(o)[0]}),s=n.computed(()=>r.array.map(c=>({values:c,hash:rt(c)})));function l(c,u=!0){return r.selectRows?u?r.selectRows.indexOf(c)===-1?e("update:selectRows",[...r.selectRows,c]):e("update:selectRows",r.selectRows.filter(_=>_!==c)):e("update:selectRows",[c]):void 0}function a(c){e("save",c),e("update:activeRow",null)}return(c,u)=>(n.openBlock(),n.createElementBlock("div",null,[n.createVNode(n.Transition,{name:"move-horizontal"},{default:n.withCtx(()=>[c.wait?(n.openBlock(),n.createBlock(Wt,{key:0,label:"Loading data",color:"black",class:"widget-table-loader"})):n.createCommentVNode("",!0)]),_:1}),n.createElementVNode("table",{class:n.normalizeClass(["widget-table",{"widget-table_mini":c.mini}])},[n.createVNode(Mo,{config:c.config},null,8,["config"]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value,({values:p,hash:_},N)=>{var E;return n.openBlock(),n.createElementBlock(n.Fragment,{key:N},[n.createVNode(zo,{config:c.config,values:p,selected:(E=c.selectRows)==null?void 0:E.includes(p),onSelect:k=>l(p,k),class:n.normalizeClass(c.classCallback?c.classCallback(p):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&c.activeRow===_?(n.openBlock(),n.createBlock(Dt,{key:0,component:i.value,"row-length":c.config.length,values:p,onClose:u[0]||(u[0]=k=>e("update:activeRow",null)),onSave:a,onRead:u[1]||(u[1]=k=>e("read"))},null,8,["component","row-length","values"])):n.createCommentVNode("",!0)],64)}),128)),c.activeRow===0?(n.openBlock(),n.createBlock(Dt,{key:0,component:i.value,"row-length":c.config.length,onClose:u[2]||(u[2]=p=>e("update:activeRow",null)),onSave:a,onRead:u[3]||(u[3]=p=>e("read"))},null,8,["component","row-length"])):n.createCommentVNode("",!0)])],2)]))}}),Ra="",xo=Object.freeze(Object.defineProperty({__proto__:null,List:D,Table:Po,WidgetTable:Jo,useListOrder:At,useListProvide:It,useListRead:Tt,useListState:Vt,useTableActiveRow:Ro},Symbol.toStringTag,{value:"Module"}));class Ko extends P{constructor(){super(),this.EVENT_NEW="event:new-metadata",this.store={}}get(e){return this.store[e]}async load(e){return this.store[e]||this.set(e,await this.loadEntityInformation(e)),this.store[e]}set(e,r){this.store[e]=r,this.emit(this.EVENT_NEW,{entityName:e})}async loadEntityInformation(e){return await Xe.get(e)}}const ue=new Ko;function Yo(t){const e=n.ref(ue.get(t));return ue.on(ue.EVENT_NEW,r=>{t===r.entityName&&(e.value=ue.get(t))}),e}function Xo(t,e){return e.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}class Zo{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return f(`/open-api/internationalization/language/${e}`)}}let J={};function Z(t,...e){if(typeof t!="string")return console.trace(`Label is not provided for translation: ${t}`),"undefined";let r=y.utils.getPropFromObject((this==null?void 0:this.vocabulary)||J,t);if(typeof r=="string")return Ft(r,e);const o=y.utils.getPropFromObject(J==null?void 0:J.root,t);return typeof o=="string"?Ft(o,e):(typeof r===void 0&&console.warn(`Translation for label "${t}" is not founded.`),t)}function Ft(t,e){return e.forEach((r,o)=>{t=t.replaceAll(new RegExp(`\\{${o}}`,"g"),r)}),t}Z.setGlobalVocabulary=function(t){J=t},Z.getScope=function(t){const e=typeof t=="string"?t:"root";return typeof t!="string"&&console.warn(`SCOPE ${t} for translate is not string.`),Z.bind({vocabulary:y.utils.getPropFromObject(J,e.toLowerCase())})},Z.setVocabulary=function(t){return typeof t=="string"&&(t=y.utils.getPropFromObject(J,t)),Z.bind({vocabulary:t})};function Qo(t="default"){if(Ye.manager)return Ye.manager.socket(`/${t}`)}class Ye{}function ei(t=window.location.origin+"/socket.io"){Ye.manager=new Qt.Manager(t,{reconnectionDelayMax:1e3,withCredentials:!0,transports:["websocket","polling"]})}const ti={class:"breadcrumb__title"},ni=n.defineComponent({__name:"widget-breadcrumb-item",props:{active:{type:Boolean},title:{},link:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["breadcrumb flex",{breadcrumb_active:e.active}])},[n.createElementVNode("p",ti,n.toDisplayString(e.title),1),e.active?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(b,{key:0,class:"breadcrumb__icon",name:"caret-right"}))],2))}}),La="",ri=m(ni,[["__scopeId","data-v-1702aee0"]]),oi={class:"widget-breadcrumbs"},ii=n.defineComponent({__name:"widget-breadcrumbs",props:{array:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",oi,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.array,(o,i)=>(n.openBlock(),n.createBlock(ri,{key:i,title:o.title,link:o.link,active:i===e.array.length-1},null,8,["title","link","active"]))),128))]))}}),Da="",si=m(ii,[["__scopeId","data-v-1dfb2668"]]),ai={props:{config:Array,values:Object,selected:Boolean},setup:Lt},Wa="",li=m(ai,[["__scopeId","data-v-47478206"]]),ci=t=>(n.pushScopeId("data-v-03c9724f"),t=t(),n.popScopeId(),t),di={class:"head-cell"},ui=ci(()=>n.createElementVNode("div",{class:"head-cell-resize"},null,-1)),pi=n.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(t,{emit:e}){const r=t;return r.title&&console.warn(`For cell ${r.name} using title,it should be replaced with label.`),(o,i)=>(n.openBlock(),n.createElementBlock("th",null,[n.createElementVNode("div",di,[n.createElementVNode("div",{class:"head-cell-content flex_grow",style:n.normalizeStyle({"min-width":o.minWidth,"max-width":o.maxWidth,width:o.width})},[o.type==="multi-select"?(n.openBlock(),n.createBlock(n.unref(y.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=n.withModifiers(s=>e("select"),["stop","prevent"]))})):(n.openBlock(),n.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=s=>e("order"))},n.toDisplayString(o.title||o.label),1))],4),o.name&&o.order.length&&o.order[0]===o.name?(n.openBlock(),n.createBlock(n.unref(b),{key:0,class:n.normalizeClass(["head-cell-order",{"head-cell-order_down":o.order.length>1&&o.order[1]==="desc"}])},{default:n.withCtx(()=>[n.createTextVNode("core-arrow-up")]),_:1},8,["class"])):n.createCommentVNode("",!0),ui])]))}}),Fa="",fi=m(pi,[["__scopeId","data-v-03c9724f"]]),mi=n.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const r=t,o=n.ref(),i=n.ref();n.onMounted(()=>{function c(E,k){let C=-1;do C++,k-=E[C];while(k>0&&C<E.length);return C}function u(E,k){let C=0;for(;k>0&&k>E[C]&&C<E.length;)k-=E[C],C++;return console.log(k,C),C>0?C:0}function p(E){try{i.value.style.insetInlineStart=E+"px"}catch(k){console.log(k)}}function _(E){try{i.value.style.width=E+"px",i.value.style.minWidth=E+"px",i.value.style.maxWidth=E+"px"}catch(k){console.log(k)}}function N(E){return E===null?!1:E.classList.contains("head-cell-resize")}o.value.addEventListener("pointerdown",function(k){var Kt;function C(R){return R.screenX+V-M}const x=o.value,h=[...x.children].filter(R=>R.localName==="th"),V=((Kt=x.offsetParent)==null?void 0:Kt.scrollLeft)||0,K=h.map(R=>R.clientWidth),me=N(k.target),M=x.getBoundingClientRect().left,De=C(k),I=c(K,De),Gt=K.slice(0,I).reduce((R,W)=>R+W,0),Ht=De-Gt,et=x.offsetWidth,he=h[I].clientWidth;if(r.config[I].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",k.screenX),console.log("Widths",K),console.log("max width",et),console.log("Start Position",De),console.log("Position From",I),console.log("Start Position",I),console.log("Global offset (Отступ самой таблицы от края экрана)",M),console.log("Del",Ht),console.groupEnd(),i.value.innerText=h[I].textContent||"",i.value.style.display="grid",i.value.style.width=he+"px",i.value.style.cursor="grabbing",p(Gt),_(he),document.addEventListener("pointermove",xt,{passive:!0}),document.addEventListener("pointerup",Jt);function Jt(R){if(console.group("END"),document.removeEventListener("pointermove",xt),document.removeEventListener("pointerup",Jt),me&&(r.config[I].width=i.value.style.width,r.config[I].minWidth=i.value.style.width,r.config[I].maxWidth=i.value.style.width,s(r.config)),!me){const W=R.screenX+V-M;console.log("ENP Position",W);const We=u(K,W);if(console.log(I,"->",We),We!==I){const _e=r.config[I],tt=r.config;tt.splice(I,1),tt.splice(We,0,_e),s(tt)}else{const _e=r.config[I].name;l(_e)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function xt(R){if(me){const _e=C(R)-De+he;_(_e);return}let W=R.screenX+V-M-Ht;W<0&&(W=0),W+he>et&&(W=et-he),p(W)}})});function s(c){e("update:config",c)}function l(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(r.order.length===0||r.order[0]!==c)return void a([c]);const u=r.order.length===1||r.order[1]==="asc"?"asc":"desc";a([c,u==="asc"?"desc":"asc"])}function a(c){e("update:order",c)}return(c,u)=>(n.openBlock(),n.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:o},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.config,(p,_)=>(n.openBlock(),n.createBlock(fi,n.mergeProps({key:p},p,{onOrder:N=>l(p.name),onSelect:u[0]||(u[0]=N=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),n.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),Ma="",hi=m(mi,[["__scopeId","data-v-11644ad4"]]),_i=50,gi=n.defineComponent({__name:"widget-list",props:{array:{},wait:{type:Boolean},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(t,{emit:e}){const r=t;function o(a,c=!0){var u;if(r.selectedRows)if(!c)s([a]);else{const p=r.selectedRows.indexOf(a);p===-1?r.selectedRows.push(a):(u=r.selectedRows)==null||u.splice(p,1),s(r.selectedRows)}}function i(){var a;if(((a=r.selectedRows)==null?void 0:a.length)!==r.array.length)return s([...r.array]);s([])}function s(a){e("update:selectedRows",a)}function l(a){if(!a)return;const c=a.target;c.scrollTop+c.clientHeight+_i>c.scrollHeight&&e("scrollEnd")}return(a,c)=>(n.openBlock(),n.createElementBlock("div",{class:"es-list-container",onScrollPassive:l},[n.createElementVNode("table",{class:n.normalizeClass(["widget-list",{"widget-list_load":a.wait}])},[n.createElementVNode("thead",null,[n.createVNode(hi,{onSelect:c[0]||(c[0]=u=>i()),"onUpdate:order":c[1]||(c[1]=u=>e("update:order",u)),"onUpdate:config":c[2]||(c[2]=u=>e("update:config",u)),config:a.config,order:a.order},null,8,["config","order"])]),n.createElementVNode("tbody",{class:n.normalizeClass(["widget-list-body",{"widget-list-body_inactive":a.wait}])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.array,(u,p)=>{var _;return n.openBlock(),n.createBlock(li,{key:p,class:"widget-list-row",values:u,config:a.config,selected:(_=a.selectedRows)==null?void 0:_.includes(u),onSelect:N=>o(u,N)},null,8,["values","config","selected","onSelect"])}),128))],2)],2)],32))}}),Ua="",yi=m(gi,[["__scopeId","data-v-eb609a21"]]),wi={class:"widget-section"},Ei={class:"widget-section__header"},ki={class:"widget-section-title"},bi={class:"widget-section__body"},Ci=n.defineComponent({__name:"widget-section",props:{title:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",wi,[n.createElementVNode("div",Ei,[n.createElementVNode("p",ki,n.toDisplayString(e.title),1)]),n.createElementVNode("div",bi,[n.renderSlot(e.$slots,"default",{},void 0,!0)])]))}}),ja="",$i=m(Ci,[["__scopeId","data-v-07232553"]]),za="",Si={props:{config:Array},name:"WidgetTableHead"},Ni={class:"widget-table__head"},Bi={class:"widget-table__head-title"};function Ti(t,e,r,o,i,s){return n.openBlock(),n.createElementBlock("tr",Ni,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.config,(l,a)=>(n.openBlock(),n.createElementBlock("th",{class:"widget-table__head-cell",key:a},[n.createElementVNode("p",Bi,n.toDisplayString(l.label||l.title),1)]))),128))])}const Vi=m(Si,[["render",Ti],["__scopeId","data-v-2d396466"]]);function Ii(t,e,r){const o=t.map(i=>Ai(i,e,r));return n.h("tr",{class:"widget-table__row widget-table-row"},o)}function Ai(t,e,r){const{name:o,value:i}=D.getCellInfo(t,e),s={onClick:[],class:["widget-table__cell widget-table-cell"]};function l(p){s.onClick.push(()=>p(i,e))}function a(p){Array.isArray(p)?s.class.push(...p):s.class.push(p)}const c=[],u=[];if(t.type)switch(a(`widget-table-cell_${t.type}`),t.type){case"edit":{t.icon="edit",l(r.activate);break}case"remove":{l(r.removeRow),t.icon="remove";break}case"select-multi":{l(r.select.bind(r,!0)),a("widget-table-cell_use"),a("widget-table-cell_select"),u.push(n.h("div",{class:{"table-cell-toggle":!0,"table-cell-toggle_active":r.selected.value}}));break}case"select":{l(r.select.bind(r,!1)),a("widget-table-cell_use"),a("widget-table-cell_select"),u.push(n.h("div",{class:{"table-cell-toggle":!0,"table-cell-toggle_active":r.selected.value}}));break}}return t.onClick&&l(t.onClick),t.link&&(u.push(n.h(Me.RouterLink,{to:t.link(i,e)})),a("list-cell-link")),t.href&&(u.push(n.h("a",{href:t.href(i,e),target:"_blank"})),a("list-cell-link")),i&&u.push(n.h("p",{},i)),t.icon&&u.push(n.h(b,{name:t.icon})),t.class&&a(t.class),c.push(n.h("td",s,u)),c}const Pi={props:{values:Object,config:Object,selected:it},emits:["set","remove","select"],setup(t,e){const{emit:r}=e,o={activate(){r("set",t.values[S])},deactivate(){r("set",null)},removeRow(){r("remove")},selected:n.computed(()=>t.selected),select(i=!1){r("select",i)}};return()=>Ii(t.config,t.values,o)}},Oi={class:"widget-table-form"},Ri=["colspan"],Mt=n.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},controller:{}},setup(t){const e=t,r=n.computed(()=>{var l;return!((l=e.values)!=null&&l[S])}),o=n.inject(se.PROVIDE_NAME);function i(l){o&&(r.value?o.create(l):o.edit(e.values[S],l))}function s(){e.controller.deactivate()}return(l,a)=>(n.openBlock(),n.createElementBlock("tr",Oi,[n.createElementVNode("td",{colspan:l.rowLength},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.component),{values:l.values,"table-controller":l.controller,onSave:i,onClose:s,new:r.value},null,40,["values","table-controller","new"]))],8,Ri)]))}}),Li=n.defineComponent({__name:"widget-table",props:{array:{},config:{},mini:{type:Boolean},activeRow:{},selectRows:{}},emits:["update:activeRow","update:selectRows"],setup(t,{emit:e}){const r=t;n.inject(se.PROVIDE_NAME);const o=n.useSlots(),i=n.computed(()=>{var a;return(a=o==null?void 0:o.default)==null?void 0:a.call(o)[0]});function s(a,c=!0){return r.selectRows?c?r.selectRows.indexOf(a)===-1?e("update:selectRows",[...r.selectRows,a]):e("update:selectRows",r.selectRows.filter(p=>p!==a)):e("update:selectRows",[a]):void 0}const l=Co(a=>e("update:activeRow",a));return n.onMounted(()=>{console.warn("WidgetTable is deprecated. Please use WidgetTable from new Import. Config: ",r.config)}),(a,c)=>(n.openBlock(),n.createElementBlock("table",{class:n.normalizeClass(["widget-table",{"widget-table_mini":a.mini}])},[n.createVNode(Vi,{config:a.config},null,8,["config"]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.array,(u,p)=>{var _;return n.openBlock(),n.createElementBlock(n.Fragment,{key:p},[n.createVNode(Pi,{config:a.config,values:u,selected:(_=a.selectRows)==null?void 0:_.includes(u[n.unref(S)]),onSet:c[0]||(c[0]=N=>e("update:activeRow",N)),onSelect:N=>s(u[n.unref(S)],N)},null,8,["config","values","selected","onSelect"]),a.activeRow===u[n.unref(S)]?(n.openBlock(),n.createBlock(Mt,{key:0,component:i.value,controller:n.unref(l)(u[n.unref(S)]),"row-length":a.config.length,values:u},null,8,["component","controller","row-length","values"])):n.createCommentVNode("",!0)],64)}),128)),a.activeRow===0?(n.openBlock(),n.createBlock(Mt,{key:0,component:i.value,controller:n.unref(l)(0),"row-length":a.config.length},null,8,["component","controller","row-length"])):n.createCommentVNode("",!0)])],2))}}),Di={class:"widget-form-info flex"},Wi={class:"form-titles"},Fi={class:"form-title margin-0"},Mi={class:"form-info text_size_md margin-0"},Ui={key:0,class:"form-container-label"},ji={class:"form-label__title text_size_sm"},zi=n.defineComponent({__name:"WidgetFormInfo",props:{title:{},info:{},label:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",Di,[n.createElementVNode("div",Wi,[n.createElementVNode("p",Fi,n.toDisplayString(e.title),1),n.createElementVNode("p",Mi,n.toDisplayString(e.info),1)]),e.label?(n.openBlock(),n.createElementBlock("div",Ui,[n.createElementVNode("div",{class:n.normalizeClass(["form-label",`form-label_${e.label.type}`])},[e.label.icon?(n.openBlock(),n.createBlock(b,{key:0,class:"form-label__icon",name:e.label.icon},null,8,["name"])):n.createCommentVNode("",!0),n.createElementVNode("p",ji,n.toDisplayString(e.label.title),1)],2)])):n.createCommentVNode("",!0)]))}}),qa="",qi=m(zi,[["__scopeId","data-v-6ea1062c"]]),vi={class:"wrap__widget-form"},Gi={class:"widget-form"},Hi={class:"widget-form__head"},Ji={class:"head-image"},xi={key:1},Ki={class:"widget-form__body"},Yi=n.defineComponent({__name:"WidgetForm",props:{title:{},info:{},image:{},icon:{},label:{},button:{},wait:{type:Boolean}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",vi,[n.createElementVNode("div",Gi,[n.createElementVNode("div",Hi,[n.createElementVNode("div",Ji,[e.wait?(n.openBlock(),n.createBlock(X,{key:0,color:"#3949AB"})):(n.openBlock(),n.createElementBlock("div",xi,[e.icon?(n.openBlock(),n.createBlock(b,{key:0,class:"form-image",name:e.icon},null,8,["name"])):n.createCommentVNode("",!0)]))]),n.createVNode(qi,{title:e.title,info:e.info,label:e.label},null,8,["title","info","label"]),e.button&&e.button.length?(n.openBlock(),n.createBlock(je,{key:0,class:"widget-form__button",array:e.button},null,8,["array"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",Ki,[n.renderSlot(e.$slots,"default",{},void 0,!0)])])]))}}),va="",Xi=m(Yi,[["__scopeId","data-v-f076ad65"]]),Zi={class:"validation-item-header"},Qi={class:"validation-item__title text_bold margin-0"},es={class:"validation-item-content"},ts={class:"text_bold text_md margin-0"},ns={class:"text_md margin-0"},rs=n.defineComponent({__name:"modal-validation-item",props:{message:{},status:{},statusName:{},title:{},name:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["validation-item",`validation-item_${e.statusName.toLowerCase()}`])},[n.createElementVNode("div",Zi,[n.createElementVNode("p",Qi,n.toDisplayString(e.statusName),1)]),n.createElementVNode("div",es,[n.createElementVNode("p",ts,n.toDisplayString(e.title),1),n.createElementVNode("p",ns,n.toDisplayString(e.message),1)])],2))}}),Ga="",os=m(rs,[["__scopeId","data-v-e6138c02"]]),is={class:"modal-wrap"},ss={class:"modal-wrap-head"},as={class:"modal-head__title margin-0"},ls={class:"modal-wrap-body"},cs=n.defineComponent({__name:"modal-wrap",props:{title:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",is,[n.createElementVNode("div",ss,[n.createElementVNode("p",as,n.toDisplayString(e.title),1)]),n.createElementVNode("div",ls,[n.renderSlot(e.$slots,"default",{},void 0,!0)])]))}}),Ha="",ds=m(cs,[["__scopeId","data-v-119165b9"]]),us={class:"modal-validation-body"},ps=n.defineComponent({__name:"modal-validation",props:{array:{}},setup(t){return(e,r)=>(n.openBlock(),n.createBlock(ds,{title:"Validation results"},{default:n.withCtx(()=>[n.createElementVNode("div",us,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.array,(o,i)=>(n.openBlock(),n.createBlock(os,{key:i,message:o.message,name:o.name,status:o.statusCode,"status-name":o.statusName,title:o.title},null,8,["message","name","status","status-name","title"]))),128))])]),_:1}))}}),Ja="",fs=m(ps,[["__scopeId","data-v-a39cfe2f"]]),ms=["alt","src"],hs=n.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,r=n.ref();return n.onMounted(()=>{r.value&&(r.value.src=e.src),r.value.onerror=function(){e.default&&(r.value.src=e.default)}}),(o,i)=>(n.openBlock(),n.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:r,src:o.src||o.$props.default},null,8,ms))}}),_s=n.defineComponent({__name:"widget-input-check",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const r=t;function o(){e("update:modelValue",!r.modelValue)}return(i,s)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["widget-input-check",{"widget-input-check_active":i.modelValue}]),onClick:o},[i.modelValue?(n.openBlock(),n.createBlock(b,{key:0,name:"check"})):n.createCommentVNode("",!0)],2))}}),xa="",gs=m(_s,[["__scopeId","data-v-f4a3dc6c"]]),ys={class:"widget-card"},ws={class:"widget-card-toggle"},Es={class:"widget-card-wrap"},ks={class:"widget-card-content"},bs={key:0,class:"widget-card-title"},Cs=n.defineComponent({__name:"widget-card",props:{title:{}},setup(t,{expose:e}){const r=n.reactive({selected:!1,hidden:!0});return e({state:r}),(o,i)=>(n.openBlock(),n.createElementBlock("div",ys,[n.createElementVNode("div",ws,[n.createVNode(gs,{modelValue:r.selected,"onUpdate:modelValue":i[0]||(i[0]=s=>r.selected=s)},null,8,["modelValue"])]),n.createElementVNode("div",Es,[n.createElementVNode("div",{class:"widget-card-arrow",onClick:i[1]||(i[1]=s=>r.hidden=!r.hidden)},[n.createVNode(b,{name:"angle-small-right",class:n.normalizeClass(["card-icon-arrow",{"card-icon-arrow_active":!r.hidden}])},null,8,["class"])]),n.createElementVNode("div",ks,[o.title?(n.openBlock(),n.createElementBlock("p",bs,n.toDisplayString(o.title),1)):n.createCommentVNode("",!0),n.renderSlot(o.$slots,"main",{},void 0,!0),r.hidden?n.createCommentVNode("",!0):n.renderSlot(o.$slots,"sub",{key:1},void 0,!0)])])]))}}),Ka="",$s=m(Cs,[["__scopeId","data-v-bca33c5b"]]);class T{static parseError(e){let r=e.errors?Object.values(e.errors).map(o=>o[0]):null;throw B.AuthServiceError(e.title,r)}static login(e){return f(j.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:j.applicationName})}).catch(T.parseError)}static registration(e){return e.AppName=j.applicationName,f(j.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(T.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw B.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return T.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return T.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return T.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return T.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,r){return f(`${j.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(r)}).catch(T.parseError)}static startLoginProcess(e){return T.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return T.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return T.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,r){return f(`${j.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(r)}).catch(T.parseError).then(T.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw B.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}const Ut=class ge{static async create(e){return f(ge.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const r=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return f(ge.url+"?"+r.toString(),{method:"get"})}static async readMessages(e){return f(`${ge.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return f(`${ge.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};Ut.url="/close-api/communications";let pe=Ut;class Ss{static async getDefaultView(e){return f("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function jt(t){return{...t,createdEntities:t.createdEntites}}const zt=class Fe{static async getStartConfig(e,r){return f([Fe.url,e,r].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,r){return f([Fe.url,e,r].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(jt)}static async runStep(e,r,o,i,s){return f([Fe.url,e,r].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:o,token:i,values:s})}).then(jt)}};zt.url="/close-api/views/process-wizard";let Re=zt;class Xe{static get url(){return"/close-api/metadata"}static async get(e,r,o){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const i=new URLSearchParams;return r&&i.append("criteria",r),o&&i.append("id",String(o)),await fetch(this.url+`/${e}?${i.toString()}`,{method:"GET"}).then(s=>s.json())}static getById(e,r,o=[]){const i=new URLSearchParams;return Ve(i,o),r&&i.append("id",r),f([this.url,e].join("/")+`?${i.toString()}`)}static getFieldInformation(e,r){return f(`/open-api/metadata/${e}/fields/${r}`)}static getTreatmentListField(e,r){return f(`/open-api/metadata/${e}/list-fields/${r}`)}}class Ns{static invite(e,r,o){return f("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:r,relatedRoleCode:o})})}static accept(e,r){return f("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:r,mark:!0})})}static decline(e,r){return f("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:r,mark:!1})})}}class Ze{static get url(){return"/close-api/rules-validation/"}static validate(e,r){return f(Ze.url+e,{method:"POST",body:JSON.stringify(r)})}}class Bs{static getConfiguration(){return f("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class qt{static url(){return"/close-api/actions"}static async get({criterion:e}){const r=new URLSearchParams;return e&&r.append("criterion",e),await fetch(this.url()+`?${r.toString()}`,{method:"GET"}).then(o=>o.json())}static getById(e,r,o=[]){const i=new URLSearchParams;return Ve(i,o),f([this.url(),e,r].join("/")+`?${i.toString()}`,{method:"GET"})}}const vt=class Xt extends P{constructor(e=[]){super(),this.array=n.reactive([]),this.defaultArray=[],this.setDefault(e)}emitUpdate(){this.emit(Xt.EVENT_DATA,this.array)}setDefault(e){const r=JSON.parse(JSON.stringify(e));this.defaultArray=r,this.set(r)}revert(){this.set(this.defaultArray)}set(e){this.array.splice(0,this.array.length,...e),this.emitUpdate()}append(e){this.array.push(e),this.emitUpdate()}moveTo(e,r){if(this.isOutOfRange(e)||this.isOutOfRange(r))throw new Error(`Provided position is out of range: ${e}, ${r}`);const o=this.array[e];this.array.splice(e,1),this.array.splice(r,0,o),this.emitUpdate()}remove(e){this.array.splice(e,1),this.emitUpdate()}isOutOfRange(e){return!(e>=0&&e<this.array.length)}};vt.EVENT_DATA="list-config:update";let Ts=vt;class Vs extends P{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return pe.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return pe.read(e).then(r=>r.length===0?pe.create(e):r[0])}}function Is(t){const e=y.Form.getParentForm();e?e.subscribe(t):console.warn(B.ParentFormNotFound());const r=n.reactive([]);return t.read=()=>pe.readMessages(t.id).then(o=>(r.splice(0,r.length,...o),o)),{array:r}}function As(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function O(t){return Object.keys(t).reduce((e,r)=>{const o=t[r];if(Array.isArray(o)){const i=o.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return o.length&&e.push(`@${r} in (${i})`),e}if(As(o)){let i=function(s){var l;return((l=s.match(/([^Z]*)/))==null?void 0:l[0])+"0000Z"};return o.start&&e.push(`@${r} ge ${i(o.start)}`),o.end&&e.push(`@${r} le ${i(o.end)}`),e}return typeof o=="number"?(e.push(`@${r} eq ${o}`),e):typeof o=="string"?(o.length!==0&&e.push(`@${r} eq '${o}'`),e):(o===null&&e.push(O.is(r,o)),e)},[]).join(" and ")}function fe(t){return typeof t=="string"?`'${t}'`:`${t}`}O.includes=function(e,r){return`@${e} Contains ${fe(r)}`},O.beginWith=function(e,r){return`@${e} BeginWith ${fe(r)}`},O.notEq=function(e,r){return`@${e} nq ${fe(r)}`},O.eq=function(e,r){return Array.isArray(r)?O.in(e,r):`@${e} eq ${fe(r)}`},O.in=function(e,r){const o=r.map(fe).join(", ");return`@${e} in (${o})`},O.and=function(...e){return e.join(" and ")},O.is=function(e,r){return`@${e} is ${r}`},O.or=function(...e){return e.join(" or ")};function Ps(t,e="images"){return`/static-folder/${e}/${t}`}function Os(t,e,r){return t.reduce((o,i)=>{var a;let s=typeof e=="function"?e(i):i[e];const l=(a=o[o.length-1])==null?void 0:a.value;return l&&r(l,s)?o[o.length-1].array.push(i):o.push({value:s,array:[i]}),o},[])}function Rs(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function Ls(t,e=1e3){let r=0;return(...o)=>{clearTimeout(r),r=setTimeout(()=>t(...o),e)}}function Ds(t,e){const r=n.ref(null);function o(){return t.name?Xe.getById(t.name,e,[]).then(i=>{r.value=i,i.fields.forEach(s=>{s.canSet?t.enable(s.name):t.disable(s.name)})}).catch(()=>{r.value=null;const i=B.MetadataEntityIsNotAvailable(t.name||"FORM_WITHOUT_NAME");$.add("error",i.message)}):Promise.reject()}return t.on(y.Form.EVENT_READ,o),{metadata:r,update:o}}class Qe extends Error{static UndefinedStatus(){return new Qe("Status is undefined.")}}class Ws extends Qe{}function Fs(t,e){const r=n.reactive([]);async function o(s,l){if(!s)throw Ws.UndefinedStatus();const a=await qt.get({criterion:s});r.splice(0,r.length),r.push(...a.map(c=>i(c,l)))}return{actions:r,update:o};function i(s,l){return{title:s.title,callback:()=>(()=>Promise.resolve().then(()=>{if(t.changed)return t.save()}).then(()=>fetch(s.url,{method:"POST",body:JSON.stringify({keys:{Id:l},contextId:g.contextId}),headers:{"Content-Type":"application/json"}})).then(c=>c.json()).then(c=>{if(!c.success)throw e!=null&&e.ModalValidationResult&&c.validationEffect?nt.openModal(e.ModalValidationResult,{rules:c.validationEffect.results}):$.add("error",c.message),new Error;return c}).then(c=>{c.message&&$.add("info",c.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(c.affectedEntities)}).then(()=>t.read()))()}}}class Le{static url(){return"/close-api/presentation"}static getStatuses(e,r){return fetch(`${Le.url()}/status/${e}/${r}`).then(o=>o.json())}}function Ms(t){const e=n.reactive({title:"Loading",type:"wait"});function r(o){if(t.name&&Number.isInteger(o))return Le.getStatuses(t.name,o).then(i=>{e.type=i.type,e.title=i.name})}return t.on(y.Form.EVENT_READ,o=>{var l,a;const{code:i,name:s}={code:(l=o.Status)==null?void 0:l.Code,name:(a=o.Status)==null?void 0:a.Name};return t.name?!Number.isInteger(i)&&!s?void console.log("Undefined code or name is Status prop."):Le.getStatuses(t.name,i).then(c=>{e.type=c.type,e.title=s}):void console.log("Form without name.")}),{label:e,update:r}}function Us(t,e){const r=Me.useRoute(),o=n.computed(()=>Number(r.params.id)),i=n.reactive({ready:!1,show:!1});return n.watch(()=>o.value,()=>{i.ready=!1}),n.watch(()=>o.value,()=>{Number.isInteger(o.value)&&t.read()},{immediate:!0}),t.read=oe.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!t.name)throw new Error("Form without entity name. Please set form.name");return A.readById(t.name,o.value,{fields:e.fields})}).then(oe.valuesToUpperCase).then(s=>(Number.isInteger(s.Version)&&(t.version=s.Version),t.setValues(s),i.show=!0,s)).catch(s=>{throw Object.prototype.hasOwnProperty.call(s,"status")&&[403,404].includes(s.status)&&(i.show=!1),s}).finally(()=>{i.ready=!0})),t.save=oe.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!t.name)throw new Error("Form without entity name. Please set form.name");return A.updateById(t.name,o.value,t.changes,{version:t.version})}).then(s=>{t.version=s.version})),t.on(y.Form.EVENT_SAVE,t.read.bind(t)),{formShadowState:i}}function js(){const t=n.reactive({contextId:g.contextId,person:g.person,organizations:g.organizations,ready:g.ready,user:g.user}),e=n.computed(()=>{if(!g.ready||!g.person)return null;const o=t.contextId;return g.person.id===o?g.person:g.organizations.find(i=>i.id===o)||null}),r=n.computed(()=>{var o;return t.contextId===((o=t.person)==null?void 0:o.id)});return g.onupdateContext(o=>{t.contextId=o}),g.onupdateData(()=>{t.person=g.person,t.organizations=g.organizations,t.user=g.user}),g.onReady(o=>{t.ready=o}),{state:n.readonly(t),currentContext:e,isPerson:r}}function zs(t,e){const r=n.reactive({ready:!1,show:!1});function o(){r.ready=!1,r.show=!1}return t.read=()=>{let i=e();return Promise.resolve().then(()=>{if(!t.name)throw B.EntityWithoutName("Use Form Request");return A.readById(t.name,i.id,{fields:i.fields})}).then(oe.valuesToUpperCase).then(s=>(s.hasOwnProperty("Version")&&(t.version=Number(s.Version)),t.setValues(s),r.show=!0,s)).catch(s=>{const l=ne(s);throw $.add("error",l.message),l}).finally(()=>{r.ready=!0})},t.save=()=>{let i=e();return Promise.resolve().then(()=>{if(!t.name)throw B.EntityWithoutName("Use Form Request");return A.updateById(t.name,i.id,t.changes,{version:t.version})}).then(s=>{t.version=s.version||s.Version}).catch(s=>{const l=ne(s);throw $.add("error",l.message),l})},t.on(y.Form.EVENT_SAVE,t.read.bind(t)),{shadowFormState:r,initShadow:o}}class qs{static getRequiredDocuments(e,r,o){const i=new URLSearchParams({entity:e,primaryKey:r,statusCode:o});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(s=>s.json())}}class Q{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Q.url()}/calculator/${e}`)}static calculate(e,r){return f(`/${Q.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:r})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):B.ApiNotAvailable()})}static parseMetadataField(e){function r(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:e.name,label:e.title,required:e.required,type:r(e)}}static createOnlinePayment(e,r){return f(`/${Q.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:r})})}static applyOnlinePayment(e){return f(`/${Q.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class vs{static getListSettings(e,r){const o=new URLSearchParams;o.set("entity",e),r&&o.set("mark",r);const i=`/close-api/views/list/configs?${o.toString()}`;return f(i)}}function Gs(t){return t.statusName==="Completed"}function Hs(t){return t.statusName==="FinalStepWithConfirmation"}function Js(t){return t.statusName==="ValidationError"}function xs(t,e,r){let o=null;const i=n.reactive({wait:null});let s=[],l=null;const a=n.ref(null);function c(){a.value=s.find(h=>h.name===l)||null}function u(){var h;return l?((h=s.find(V=>V.name===l))==null?void 0:h.fields)||[]:[]}function p(h){if(c(),Js(h))return void r.onValidation(h.validationResults);if((h.statusName==="FinalStep"||h.statusName==="NextStep")&&(!u().length||Ks(u(),r.presets)))return x(r.presets||{});Gs(h)&&r.onCompleted(h),Hs(h)&&r.onConfirmation(h)}async function _(){try{await N(),await C()}catch(h){const{message:V}=ne(h);$.add("error",V)}}function N(){return i.wait="Loading process information.",Re.getStartConfig(e,t).then(h=>{s=h.steps.map(V=>({label:V.title,name:V.stepName,number:V.number,fields:V.frontendEntity.objectTypes.reduce((K,me)=>(me.properties.forEach(M=>{K.push({name:M.name,label:M.title,type:M.refEntityName||M.dataType})}),K),[])}))}).then(h=>(i.wait=!1,h))}function E(h){return l=h.nextStepName,o=h.token,h}function k(h){const V=ne(h);$.add("error",V.message)}function C(){return i.wait="Starting process",Re.startProcess(e,t).then(E).then(p).catch(k).finally(()=>{i.wait=null})}function x(h={}){return!o||!l?Promise.reject("Not step or token."):(i.wait="Expect the result",Re.runStep(e,t,l,o,h).then(E).then(p).catch(k).finally(()=>{i.wait=!1}))}return{initialize:_,state:i,currentStepConfig:n.readonly(a),next:x}}function Ks(t,e){for(let r=0;r<t.length;r++){const o=t[r];if(!y.utils.getPropFromObject(e,o.name))return!1}return!0}const Ys="close-api/proxy/Equipment/Search";class Xs{static search(e,r,o,i,s){const l=new URLSearchParams;l.append("pattern",e||""),r&&l.append("categoryId",r),o&&l.append("useType",String(o)),i&&l.append("statusCode",i),s&&(l.append("limit",String(s.limit)),l.append("offset",String(s.offset)));const a=`/${Ys}?${l.toString()}`;return f(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Zs={clickOutside:Y,requestHandler:Be,valuesToUpperCase:Te,prettyDate:Ke,prettyDateWithTime:Ot,Filter:O,staticLink:Ps,groupArrayByField:Os,uuidv4:Rs,Request:f,prettyMoney:kt},Qs={widgets:io,usage:so,utils:go,mixins:nn,config:yo,types:wo};d.ApplicationManager=yt,d.Communication=Vs,d.ComputedMetadata=Yo,d.CoreError=B,d.Filter=O,d.List=D,d.ListConfig=Ts,d.Manager=g,d.MetadataStore=ue,d.ModalValidation=fs,d.NotificationSystem=$,d.ProcessWrap=ke,d.Request=f,d.SYMBOL_ROW=S,d.Table=se,d.WidgetBreadcrumbs=si,d.WidgetButton=st,d.WidgetCard=$s,d.WidgetForm=Xi,d.WidgetIcon=b,d.WidgetImage=hs,d.WidgetList=yi,d.WidgetMultiButton=je,d.WidgetNotificationSystem=ct,d.WidgetSection=$i,d.WidgetSpinner=X,d.WidgetTable=Li,d.WidgetWait=Wt,d.actionService=qt,d.authService=T,d.billingService=Q,d.clickOutside=Y,d.clientService=pt,d.communicationService=pe,d.configurationService=vs,d.dataService=A,d.debounce=Ls,d.default=Qs,d.documentsService=qs,d.equipmentService=Xs,d.fileService=ot,d.historyService=Bo,d.internationalizationService=Zo,d.invitationService=Ns,d.metadataService=Xe,d.newImport=xo,d.openService=Bs,d.parseError=ne,d.prettifyValueByMetadata=Xo,d.processWizardService=Re,d.requestHandler=Be,d.ruleValidationService=Ze,d.setupSocket=ei,d.t=Z,d.testTypes=No,d.useCommunication=Is,d.useCustomerState=js,d.useFormAction=Fs,d.useFormLabel=Ms,d.useFormMetadata=Ds,d.useFormRequest=zs,d.useFormRequestData=Us,d.useListConfig=To,d.useListFilter=Io,d.useListOrder=At,d.useListProvide=It,d.useListRead=Tt,d.useListSearch=Vo,d.useListSelect=Ao,d.useListState=Vt,d.useManagerState=lo,d.useSocket=Qo,d.useTableRequest=So,d.useTableState=$o,d.useWizard=xs,d.utils=Zs,d.viewService=Ss,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
10
+ */const ft=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},mt=function(t,e){t in this.events&&this.events[t].forEach(r=>r(e))},ht=function(t,e){const r=this.events[t];if(!r)return;const o=r.indexOf(e);o!==-1&&r.splice(o,1)},_t=function(){this.events={}};class P{constructor(){this.events={}}on(e,r){return ft.call(this,e,r)}emit(e,r){return mt.call(this,e,r)}off(e,r){return ht.call(this,e,r)}cleanEvents(){_t.call(this)}static on(e,r){return ft.call(P,e,r)}static emit(e,r){return mt.call(P,e,r)}static off(e,r){return ht.call(P,e,r)}static cleanEvents(){_t.call(P)}}P.events={};var gt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},Ce=(t,e,r)=>(gt(t,e,"read from private field"),r?r.call(t):e.get(t)),ve=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Ge=(t,e,r,o)=>(gt(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),re,$e,Se;const q=class L extends P{constructor(){super(...arguments),ve(this,re,void 0),ve(this,$e,"front"),this.organizations=[],ve(this,Se,!1)}set language(e){localStorage.setItem(L.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(L.LOCALSTORAGE_LANGUAGE_KEY)||L.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(L.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){Ge(this,re,e)}get router(){if(!Ce(this,re))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return Ce(this,re)}set type(e){Ge(this,$e,e)}get type(){return Ce(this,$e)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Ge(this,Se,e),this.emit(L.EVENT_READY_UPDATE,e)}get ready(){return Ce(this,Se)}onReady(e){return this.on(L.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(L.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(L.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(L.CURRENT_CONTEXT_KEY,String(e)),this.emit(L.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(r=>r.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const r=Number.parseInt(localStorage.getItem(L.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(r)&&this.validateContextId(Number(r))?this.setCurrentContext(r):this.setCurrentContext(Number(e.id))}catch{$.add("error",B.ApiNotAvailable().message)}}loadCustomerData(){return pt.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var r;return((r=this.person)==null?void 0:r.id)==e?!0:!!this.organizations.find(o=>o.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const r=localStorage.getItem(this.getListKeyById(e));return r&&JSON.parse(r)}setListInformationToLocalStorage(e,r){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(r))}};re=new WeakMap,$e=new WeakMap,Se=new WeakMap,q.DEFAULT_LANGUAGE="en",q.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",q.EVENT_CONTEXT_UPDATE="event:context-update",q.EVENT_READY_UPDATE="event:ready-update",q.EVENT_DATA_UPDATE="event:data-update",q.CURRENT_CONTEXT_KEY="CurrentContext";let yt=q;const g=new yt;function lo(){const t=n.reactive({contextType:g.contextType,contextId:g.contextId,context:g.context});return g.onupdateContext(()=>{t.contextType=g.contextType,t.contextId=g.contextId,t.context=g.context}),t}function co(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return ut}})}function f(t,e={}){return g.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=g.contextId),e.redirect="manual",fetch(t,e).then(r=>r.type==="opaqueredirect"?void window.location.replace("/auth"):r).catch(()=>{throw B.ApiNotAvailable()}).then(r=>co(r).then(o=>{if(!r.ok)throw o;return o}))}class Ne{constructor(){}static parseNamesFromListConfig(e){let r=Ne.parseFieldsToGraphQL(e.reduce((i,s)=>(s.name&&i.push(s.name),i),[]));function o(i){let s="";for(let l in i)typeof i[l]=="boolean"?s+=` ${l} `:s+=` ${l} { ${o(i[l])} }`;return s}return o(r)}static parseSortFromListConfig(e){let r={};for(let o in e)r[o]=e[o]?"ASC":"DESC";return r}static parseFieldsToGraphQL(e){function r(o,i){if(i.includes(".")){const s=i.indexOf("."),l=i.substring(s+1),a=i.substring(0,s);a in o||(o[a]={}),r(o[a],l)}else o[i]=!0;return o}return e.reduce(r,{})}}class uo{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,r,o)=>(r!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),e[r]=o,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}const wt=new uo;function Et(t){return t&&t[0].toLowerCase()+t.slice(1)}const Ia="",po={props:{message:String},name:"ModalWait",components:{WidgetSpinner:X}},fo={class:"modal__wait modal-default flex_column"};function mo(t,e,r,o,i,s){const l=n.resolveComponent("widget-spinner");return n.openBlock(),n.createElementBlock("div",fo,[n.createVNode(l),n.createElementVNode("p",null,n.toDisplayString(r.message),1)])}const ho=m(po,[["render",mo],["__scopeId","data-v-4d18289e"]]),_o={error:!0,wait:!1,throw:!0};async function Be(t,e={}){const r={modalWait:null};e=Object.assign({},e,_o);try{e.wait&&(r.modalWait=await nt.openModal(ho,{message:typeof e.wait=="string"?e.wait:""}))}catch(o){console.warn(o)}return Promise.resolve(t()).catch(o=>{let i=o;if(typeof i=="string"&&(i=B.UndefinedError(i)),e.error&&(console.log(i,i.details),i instanceof B?$.add("error",i.message,{children:i.details||[],timeout:12}):i!=null&&i.message?$.add("error",i.message):(console.warn(i),$.add("error",B.ApiResponseParseFailed().message))),e.throw)throw i}).finally(()=>{var o;(o=r.modalWait)==null||o.close()})}function Te(t){return Object.keys(t).reduce((e,r)=>{let o=t[r];const i=r.charAt(0).toUpperCase()+r.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=Te(o)),e[i]=o,e},{})}function kt(t,e=2){if(!(typeof t=="string"||typeof t=="number"))return"";let o=String(t).split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.length<2&&(o[1]=""),o[1]=o[1].padEnd(e,"0"),o[1].length>e&&(o[1]=o[1].substring(0,e)),o.join(".")}const oe={Request:f,clickOutside:Y,getPropFromObject:te,runPromiseQueue:ze,GraphQL:Ne,firstChapterToLowerCase:Et,requestHandler:Be,valuesToUpperCase:Te,prettyMoney:kt},go=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Ne,Journal:wt,Request:f,clickOutside:Y,default:oe,firstChapterToLowerCase:Et,getPropFromObject:te,requestHandler:Be,runPromiseQueue:ze,valuesToUpperCase:Te},Symbol.toStringTag,{value:"Module"}));function bt(t,e=""){for(let r in t){if(typeof t[r]=="object"){bt(t[r],(e.length?`${e}-`:"")+r);continue}let o="--"+((e.length?`${e}-`:"")+r).replace(/([A-Z])/g,i=>`-${i}`.toLowerCase());document.documentElement.style.setProperty(o,t[r])}}const j={};function yo(t){for(let e in t)j[e]=t[e];t.styles&&bt(t.styles),wt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=j}const wo=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function Eo(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&typeof t[1]=="number"}const ko="masterId",bo="masterEntity";function Ve(t,e){if(!Array.isArray(e))return;if(Eo(e))return r(e);e.forEach(r);function r(o){t.append(bo,o[0]),t.append(ko,o[1].toString())}}class A{static async anonymousGetList(e){return await f(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(e,r){const o=new URLSearchParams;function i(l,a){const c=u=>o.append("fields",u);if(typeof a=="string")return c(a);if(Array.isArray(a))return c(a.join(" "));if(typeof a=="object")return c(Object.keys(a).join(" "))}function s(l,a){if(!a||!Object.keys(a).length)return;const c=Object.entries(a).map(([u,p])=>`@${u} ${p}`).join(",");l.append("order",c)}return r&&(i(o,r.fields),s(o,r.order),r.limit&&o.append("limit",r.limit.toString()),r.offset&&o.append("offset",r.offset.toString()),r.filter&&o.append("filter",r.filter.toString()),r.useUsageContext&&o.append("useUsageContext",r.useUsageContext.toString())),await f(`/close-api/data/${e}?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,r){const o=new URLSearchParams;function i(l,a){const c=u=>o.append("fields",u);if(typeof a=="string")return c(a);if(Array.isArray(a))return c(a.join(" "));if(typeof a=="object")return c(Object.keys(a).join(" "))}function s(l,a){if(!a||!Object.keys(a).length)return;const c=Object.entries(a).map(([u,p])=>`@${u} ${p}`).join(",");l.append("order",c)}return r&&(i(o,r.fields),s(o,r.order),r.limit&&o.append("limit",r.limit.toString()),r.offset&&o.append("offset",r.offset.toString()),r.filter&&o.append("filter",r.filter.toString()),r.useUsageContext&&o.append("useUsageContext",r.useUsageContext.toString())),f(`/close-api/data/entities/${e}/count?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,r,o){const i=new URLSearchParams;return Ve(i,o==null?void 0:o.masterEntities),f(`/close-api/data/${e}?${i.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static update(e,r,o,i={}){return f(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:o})})}static readById(e,r,o={}){const i=new URLSearchParams;if(o.fields){let s=o.fields;typeof s=="string"&&(s=[s]),i.append("fields",s.join(" "))}return f(`/close-api/data/entities/${e}/id/${r}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,r,o,i){const s=new URLSearchParams;return Ve(s,i==null?void 0:i.masterEntities),f(`/close-api/data/entities/${e}/id/${r}?${s.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:o,version:i==null?void 0:i.version})})}static removeById(e,r,o){const i=typeof r=="number"?{Id:r}:r;return A.removeByKeys(e,i,o)}static removeByKeys(e,r,o){return f(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:r,version:o})})}}var Ct=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},He=(t,e,r)=>(Ct(t,e,"read from private field"),r?r.call(t):e.get(t)),$t=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},St=(t,e,r,o)=>(Ct(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),ie,Ie;const Je=class ee extends P{constructor(e){super(),$t(this,ie,[]),$t(this,Ie,!1),this.hashParams="",this.offset=0,this.name=e.name}set wait(e){St(this,Ie,e),this.emit(ee.EVENT_CHANGE_WAIT,e)}get wait(){return He(this,Ie)}read(e){var i,s;this.wait=!0;const r={};e.order&&(r.order={[(i=e.order)==null?void 0:i.name]:(s=e.order)==null?void 0:s.duration}),e.fields&&(r.fields=e.fields),e.filter&&(r.filter=e.filter);const o=JSON.stringify(r.order)+JSON.stringify(r.filter);return o!==this.hashParams&&(this.offset=0,this.hashParams=o),e.limit&&(r.limit=e.limit),e.offset&&(r.offset=e.offset||this.offset),A.getList(this.name,r).then(l=>(this.offset===0&&(this.array=[]),this.offset+=r.limit,l)).then(l=>{this.array.push(...l)}).then(()=>this.emit(ee.EVENT_DATA,this.array)).finally(()=>{this.wait=!1})}set array(e){St(this,ie,e),this.emit(ee.EVENT_DATA,this.array)}add(e){He(this,ie).push(...e),this.emit(ee.EVENT_DATA,this.array)}get array(){return He(this,ie)}static GetFieldNames(e){return e.reduce((r,o)=>(o.name&&(typeof o.name=="string"?r.push(o.name):r.push(...o.name)),r),[])}static getCellInfo(e,r){const o=ee.getCellName(e),i=(()=>{let s=o?te(r,o):null;return s===void 0&&(s=null),e.value?e.value(s,r):s})();return{name:o,value:i}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}};ie=new WeakMap,Ie=new WeakMap,Je.EVENT_DATA="LIST:DATA",Je.EVENT_CHANGE_WAIT="LIST:UPDATE-WAIT";let Nt=Je;const S=Symbol("__ROW_INDEX__");let se=class extends Nt{constructor(e){super(e),this.rowIndex=1,this.changes={new:{},edit:{},remove:[]},this.save=()=>{}}get changed(){return Object.keys(this.changes.new).length||Object.keys(this.changes.edit).length||this.changes.remove.length}create(e){const r=this.wrapData(e);this.changes.new[r[S]]=r,this.emitChanges()}cleanChanges(){this.changes.new={},this.changes.edit={},this.changes.remove=[],this.emitChanges()}edit(e,r){const o=this.wrapData(r,e);if(this.changes.new[e])return this.changes.new[e]=o,this.emitChanges();this.array.find(i=>i[S]===e)&&(this.changes.edit[e]={...this.changes.edit[e],...o},this.emitChanges())}remove(e){if(this.changes.new[e])return delete this.changes.new[e],this.emitChanges();this.array.find(r=>r[S]===e)&&(delete this.changes.edit[e],this.changes.remove.includes(e)||this.changes.remove.push(e),this.emitChanges())}wrapData(e,r){return r===void 0&&!Object.prototype.hasOwnProperty.call(e,S.toString())&&(r=++this.rowIndex),{...e,[S]:r}}emitChanges(){this.emit(y.Form.EVENT_CHANGED,!0)}set array(e){super.array=e.map(r=>this.wrapData(r))}get array(){return super.array}log(e){console.log(`[table] ${e}`)}};se.PROVIDE_NAME="table-controller";function Co(t){return function(r){return{activate(){t(r)},deactivate(){t(null)}}}}function $o(t){const e=n.reactive(t.array);n.provide(se.PROVIDE_NAME,t);const r=n.reactive(t.changes);t.on(Nt.EVENT_DATA,l=>e.splice(0,e.length,...l)),t.on(y.Form.EVENT_CHANGED,()=>{r.new=Object.keys(t.changes.new).reduce((l,a)=>{const c=Number(a);return l[c]=t.changes.new[c],l},{})});const o=n.computed(()=>[...e.reduce((l,a)=>{const c=a[S];return t.changes.remove.includes(c)||l.push({...a,...t.changes.edit[c]}),l},[]),...Object.values(r.new)]),i=y.Form.getParentForm();return i==null||i.subscribe(t),{activeRow:n.ref(null),array:o}}function So(t,e){t.read=()=>A.getList(t.name,{fields:e==null?void 0:e.fields}).then(r=>t.array=r).then(()=>t.emit(y.Form.EVENT_READ,t.array)),t.save=()=>{const r=t.name;Object.values(t.changes.new).forEach(async i=>{await A.create(r,i)}),Object.entries(t.changes.edit).forEach(async([i,s])=>{await A.updateById(t.name,o(Number(i)),s)});function o(i){const s=t.array.find(l=>l[S]===i);return s.id|s.Id}t.changes.remove.forEach(async i=>{await A.removeById(r,o(i),0)}),t.emit(y.Form.EVENT_SAVE)}}const Aa="",No=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Bo{static readHistoryById(e,r){return f(`/close-api/audits/history/${e}/${r}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(o=>{const i=o.history.map(s=>{if(!s.changes)return s;const l=s.changes.map(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...s,changes:l}});return{...o,history:i}})}}var Bt=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},F=(t,e,r)=>(Bt(t,e,"read from private field"),r?r.call(t):e.get(t)),v=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},G=(t,e,r,o)=>(Bt(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),Ae,ae,Pe,Oe,le,ce,xe;const H="_______LIST_______ROW_______INDEX________NAME_______",de=class U extends P{constructor(e){super(),this.LIST_ROW_KEY=1,v(this,Ae,void 0),this.array=[],v(this,ae,[]),v(this,Pe,[]),v(this,Oe,new Proxy({},{set:(r,o,i,s)=>(r[o]=i,this.emit(U.EVENT_FILTERS_UPDATE,r),!0),deleteProperty:(r,o)=>(delete r[o],this.emit(U.EVENT_FILTERS_UPDATE,r),!0)})),v(this,le,!1),v(this,ce,(...r)=>Promise),v(this,xe,()=>{}),G(this,Ae,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&G(this,ae,e.config)}set config(e){G(this,ae,e.map(y.utils.copyObject)),this.emitUpdateConfig()}get config(){return F(this,ae)}emitUpdateConfig(){this.emit(U.EVENT_CONFIG_UPDATE,this.config)}get order(){return F(this,Pe)}set order(e){G(this,Pe,e),this.emit(U.EVENT_ORDER_UPDATE,this.order)}get filters(){return F(this,Oe)}set filters(e){Pt(F(this,Oe),e)}set wait(e){G(this,le,e),this.emit(y.Form.EVENT_WAIT,F(this,le))}get wait(){return F(this,le)}get primaryKeys(){return F(this,Ae)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(r=>r[H]===e)}indexByKey(e){return this.array.findIndex(r=>r[H]===e)}static getKey(e){return e[H]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,H)}add(...e){const r=this.wrapArray(e);this.array.push(...r),this.emit(U.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const r=this.indexByKey(e);r!==-1&&(this.array.splice(r,1),this.emit(U.EVENT_DATA,this.array))}updateByKey(e,r){const o=this.atByKey(e);o&&(Object.assign(o,r),this.emit(U.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[H]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,H)}set read(e){G(this,ce,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const r=F(this,ce).call(this,...e);return this.wait=!0,r}).finally(()=>this.wait=!1)}set save(e){G(this,ce,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>F(this,xe).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((r,o)=>(o.name&&(typeof o.name=="string"?r.push(o.name):r.push(...o.name)),r),[])}static mergeWithKey(e,r){return{...e,[H]:r}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,r){const o=U.getCellName(e),i=(()=>{let s=o?te(r,o):null;return s===void 0&&(s=null),e.value?e.value(s,r):s})();return{name:o,value:i}}};Ae=new WeakMap,ae=new WeakMap,Pe=new WeakMap,Oe=new WeakMap,le=new WeakMap,ce=new WeakMap,xe=new WeakMap,de.EVENT_DATA="list-data: update",de.EVENT_CONFIG_UPDATE="list-config:update",de.EVENT_ORDER_UPDATE="list-order:update",de.EVENT_FILTERS_UPDATE="list-filters:update";let D=de;function Tt(t,e){let r="",o=0,i=!1,s;t.read=(l={})=>{if(t.wait)return s;if(l.clean&&(r="",o=0,i=!1),i)return Promise.resolve([]);let a=e;typeof a=="function"&&(a=a());const c={};if(!t.name)throw new Error("Reading list`s data without name is not available.");a.order&&Array.isArray(a.order)&&a.order.length&&(c.order={[a.order[0]]:a.order[1]||"asc"}),a.fields&&(c.fields=a.fields),a.filter&&(c.filter=a.filter);const u=JSON.stringify(c.order)+JSON.stringify(c.filter)+JSON.stringify(c.fields);return u!==r&&!Number.isNaN(u)&&(o=0,r=u),"limit"in a&&(c.limit=a.limit),c.offset=o||a.offset||0,s=A.getList(t.name,c).then(p=>((o===0||l.clean)&&t.set([]),o+=c.limit,p)).then(p=>(t.add(...p),p.length===0&&(i=!0),p)),s}}function Vt(t){const e=n.reactive({wait:t.wait,array:[]});return t.on(D.EVENT_DATA,r=>{e.array.splice(0,e.array.length,...r.map(o=>Object.freeze(JSON.parse(JSON.stringify(o)))))}),t.on(y.Form.EVENT_WAIT,()=>{e.wait=t.wait}),e}function It(t,e){const r="list-flex-config",o=n.inject(r,void 0);if(o)return o;if(!t||!e)throw new Error("Hook useProvideList has two required params: list and defaultSettings");t.on(D.EVENT_CONFIG_UPDATE,()=>{t.read()});const i={list:t,defaultSettings:e};return n.provide(r,i),i}function To(t){const e=n.reactive([...t.config]);return t.on(D.EVENT_CONFIG_UPDATE,r=>{e.splice(0,e.length,...r)}),e}function At(t){const e=t.order||[],r=n.reactive(e);return t.on(D.EVENT_ORDER_UPDATE,o=>{r.splice(0,r.length,...o),t.read()}),r}function Vo(t){const e=n.ref(""),r=n.computed(()=>{const o=e.value.toLowerCase();return n.unref(t).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(o):!0)});return{search:e,searchArray:r}}function Pt(t,e){Object.keys(t).forEach(r=>delete t[r]),Object.entries(e).forEach(([r,o])=>{t[r]=o})}function Io(t){const e=n.reactive(y.utils.copyObject(t.filters));return t.on(D.EVENT_FILTERS_UPDATE,r=>{Pt(e,r),t.read()}),e}function Ao(t){const e=n.reactive([]);function r(a){return e.includes(a)}function o(a){r(a)||e.push(a)}function i(a){const c=e.findIndex(u=>u===a);c!==-1&&e.splice(c,1)}function s(a){const c=n.unref(t);if(a===void 0){e.length===0?c.forEach(o):c.forEach(i);return}r(a)?i(a):o(a)}const l=n.computed(()=>{const a=n.unref(t);return e.length===a.length&&a.length!==0});return[e,s,l,o,i]}class Po extends D{constructor(e){super(e),this.changes=[],this.save=Oo.bind(this)}get changed(){return!!this.changes.find(e=>e.status==="active")}addChange(e,r){this.changes.push({type:e,status:"active",data:this.wrapItem(r)})}}function Oo(){const t=this.changes.filter(e=>e.status==="active");return ze(t.map(e=>{console.log("++")}))}function Ro(){const t=n.ref(null);function e(r){t.value=r&&rt(r)}return{activeRow:t,activateRow:e}}const Pa="",Lo={props:{config:Array},name:"WidgetTableHead"},Do={class:"widget-table__head"},Wo={class:"widget-table__head-title"};function Fo(t,e,r,o,i,s){return n.openBlock(),n.createElementBlock("tr",Do,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.config,(l,a)=>(n.openBlock(),n.createElementBlock("th",{class:"widget-table__head-cell",key:a},[n.createElementVNode("p",Wo,n.toDisplayString(l.title),1)]))),128))])}const Mo=m(Lo,[["render",Fo],["__scopeId","data-v-f478f0d8"]]);function Ot(t){return Ke(t,"YYYY/MM/DD HH:mm:ss")}function Ke(t,e="YYYY/MM/DD"){if(!t)return"";try{const r=new Date(t);return Zt.format(r,e)}catch(r){return console.log(r),"Invalid date"}}function Uo(t,e){const r=t.config.map(o=>jo(o,t,e));return n.h("tr",{class:"widget-table__row widget-table-row"},r)}function jo(t,e,r){const o=e.values;let{name:i,value:s}=D.getCellInfo(t,o);const l={onClick:[],class:["widget-table__cell widget-table-cell"]};function a(_){l.onClick.push(()=>_(o))}function c(_){Array.isArray(_)?l.class.push(..._):l.class.push(_)}const u=[],p=[];if(t.hide&&t.hide(o))return[n.h("td")];if(t.type)switch(c(`widget-table-cell_${t.type}`),t.type){case"number":{typeof s=="number"&&(s=new Intl.NumberFormat().format(s));break}case"date":{s=Ke(typeof s=="string"?s:null);break}case"dateTime":case"dateWithTime":{s=Ot(typeof s=="string"?s:null);break}case"multi-select":{p.push(n.h(y.FormField,{type:"single-checkbox",modelValue:e.selected})),a(Rt.bind(null,r,!0));break}case"select":{p.push(n.h(y.FormField,{type:"single-radio",modelValue:e.selected})),a(Rt.bind(null,r,!1));break}}if(t.checked){const _=t.checked(o);p.push(n.h(y.FormField,{type:"single-checkbox",modelValue:_}))}if(t.onClick&&a(t.onClick),t.link)try{const _=t.link(o);if(_){const N=n.h(Me.RouterLink,{to:_});p.push(N),c("list-cell-link")}}catch(_){console.warn("Error handle: Add Router link to cell",_)}return t.href&&(p.push(n.h("a",{href:t.href(o),target:"_blank"})),c("list-cell-link")),s!=null&&p.push(n.h("p",{class:"widget-list-cell-text"},s)),t.icon&&p.push(n.h(b,{name:t.icon})),t.class&&(typeof t.class=="function"?c(t.class(o)):c(t.class)),u.push(n.h("td",l,p)),u}function Rt(t,e){t.emit("select",e)}function Lt(t,e){return()=>{try{return Uo(t,e)}catch(r){return console.warn(r),null}}}const zo={props:{values:Object,config:Object,selected:Boolean},setup:Lt},qo=["colspan"],Dt=n.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{}},emits:["save","remove","close"],setup(t,{emit:e}){const r=t,o=n.ref(),i=n.computed(()=>!r.values&&!D.hasKey(r.values));return n.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(s,l)=>(n.openBlock(),n.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[n.createElementVNode("td",{colspan:s.rowLength},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(s.component),n.mergeProps(s.$attrs,{values:s.values,new:i.value,onClose:l[0]||(l[0]=a=>e("close")),onSave:l[1]||(l[1]=a=>e("save",a))}),null,16,["values","new"]))],8,qo)],512))}}),vo={class:"widget-wait flex gap_10 padding_15"},Go={class:"text_md"},Ho=n.defineComponent({__name:"widget-wait",props:{label:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",vo,[n.createVNode(X,{color:"var(--primary)",class:"wait-spinner"}),n.createElementVNode("span",Go,n.toDisplayString(e.label),1)]))}}),Oa="",Wt=m(Ho,[["__scopeId","data-v-2038b2ba"]]),Jo=n.defineComponent({__name:"widget-table",props:{array:{},config:{},mini:{type:Boolean},activeRow:{},selectRows:{},wait:{type:Boolean},classCallback:{type:Function}},emits:["update:activeRow","update:selectRows","save","read"],setup(t,{emit:e}){const r=t,o=n.useSlots(),i=n.computed(()=>{var c;return(c=o==null?void 0:o.default)==null?void 0:c.call(o)[0]}),s=n.computed(()=>r.array.map(c=>({values:c,hash:rt(c)})));function l(c,u=!0){return r.selectRows?u?r.selectRows.indexOf(c)===-1?e("update:selectRows",[...r.selectRows,c]):e("update:selectRows",r.selectRows.filter(_=>_!==c)):e("update:selectRows",[c]):void 0}function a(c){e("save",c),e("update:activeRow",null)}return(c,u)=>(n.openBlock(),n.createElementBlock("div",null,[n.createVNode(n.Transition,{name:"move-horizontal"},{default:n.withCtx(()=>[c.wait?(n.openBlock(),n.createBlock(Wt,{key:0,label:"Loading data",color:"black",class:"widget-table-loader"})):n.createCommentVNode("",!0)]),_:1}),n.createElementVNode("table",{class:n.normalizeClass(["widget-table",{"widget-table_mini":c.mini}])},[n.createVNode(Mo,{config:c.config},null,8,["config"]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value,({values:p,hash:_},N)=>{var E;return n.openBlock(),n.createElementBlock(n.Fragment,{key:N},[n.createVNode(zo,{config:c.config,values:p,selected:(E=c.selectRows)==null?void 0:E.includes(p),onSelect:k=>l(p,k),class:n.normalizeClass(c.classCallback?c.classCallback(p):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&c.activeRow===_?(n.openBlock(),n.createBlock(Dt,{key:0,component:i.value,"row-length":c.config.length,values:p,onClose:u[0]||(u[0]=k=>e("update:activeRow",null)),onSave:a,onRead:u[1]||(u[1]=k=>e("read"))},null,8,["component","row-length","values"])):n.createCommentVNode("",!0)],64)}),128)),c.activeRow===0?(n.openBlock(),n.createBlock(Dt,{key:0,component:i.value,"row-length":c.config.length,onClose:u[2]||(u[2]=p=>e("update:activeRow",null)),onSave:a,onRead:u[3]||(u[3]=p=>e("read"))},null,8,["component","row-length"])):n.createCommentVNode("",!0)])],2)]))}}),Ra="",xo=Object.freeze(Object.defineProperty({__proto__:null,List:D,Table:Po,WidgetTable:Jo,useListOrder:At,useListProvide:It,useListRead:Tt,useListState:Vt,useTableActiveRow:Ro},Symbol.toStringTag,{value:"Module"}));class Ko extends P{constructor(){super(),this.EVENT_NEW="event:new-metadata",this.store={}}get(e){return this.store[e]}async load(e){return this.store[e]||this.set(e,await this.loadEntityInformation(e)),this.store[e]}set(e,r){this.store[e]=r,this.emit(this.EVENT_NEW,{entityName:e})}async loadEntityInformation(e){return await Xe.get(e)}}const ue=new Ko;function Yo(t){const e=n.ref(ue.get(t));return ue.on(ue.EVENT_NEW,r=>{t===r.entityName&&(e.value=ue.get(t))}),e}function Xo(t,e){return e.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}class Zo{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return f(`/open-api/internationalization/language/${e}`)}}let J={};function Z(t,...e){if(typeof t!="string")return console.trace(`Label is not provided for translation: ${t}`),"undefined";let r=y.utils.getPropFromObject((this==null?void 0:this.vocabulary)||J,t);if(typeof r=="string")return Ft(r,e);const o=y.utils.getPropFromObject(J==null?void 0:J.root,t);return typeof o=="string"?Ft(o,e):(typeof r===void 0&&console.warn(`Translation for label "${t}" is not founded.`),t)}function Ft(t,e){return e.forEach((r,o)=>{t=t.replaceAll(new RegExp(`\\{${o}}`,"g"),r)}),t}Z.setGlobalVocabulary=function(t){J=t},Z.getScope=function(t){const e=typeof t=="string"?t:"root";return typeof t!="string"&&console.warn(`SCOPE ${t} for translate is not string.`),Z.bind({vocabulary:y.utils.getPropFromObject(J,e.toLowerCase())})},Z.setVocabulary=function(t){return typeof t=="string"&&(t=y.utils.getPropFromObject(J,t)),Z.bind({vocabulary:t})};function Qo(t=""){if(Ye.manager)return Ye.manager.socket(`/${t}`)}class Ye{}function ei(t=window.location.origin+"/socket.io",e={},r={}){const o=new Qt.Manager(t,{reconnectionDelayMax:1e3,withCredentials:!0,transports:["websocket","polling"],...e});Ye.manager=o;const i=()=>{setTimeout(()=>{o.open(s=>{s&&i(),s||(console.log("Reconnection to socket success."),r!=null&&r.onReconnect&&r.onReconnect())})},2e3)};o.on("close",i)}const ti={class:"breadcrumb__title"},ni=n.defineComponent({__name:"widget-breadcrumb-item",props:{active:{type:Boolean},title:{},link:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["breadcrumb flex",{breadcrumb_active:e.active}])},[n.createElementVNode("p",ti,n.toDisplayString(e.title),1),e.active?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(b,{key:0,class:"breadcrumb__icon",name:"caret-right"}))],2))}}),La="",ri=m(ni,[["__scopeId","data-v-1702aee0"]]),oi={class:"widget-breadcrumbs"},ii=n.defineComponent({__name:"widget-breadcrumbs",props:{array:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",oi,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.array,(o,i)=>(n.openBlock(),n.createBlock(ri,{key:i,title:o.title,link:o.link,active:i===e.array.length-1},null,8,["title","link","active"]))),128))]))}}),Da="",si=m(ii,[["__scopeId","data-v-1dfb2668"]]),ai={props:{config:Array,values:Object,selected:Boolean},setup:Lt},Wa="",li=m(ai,[["__scopeId","data-v-47478206"]]),ci=t=>(n.pushScopeId("data-v-03c9724f"),t=t(),n.popScopeId(),t),di={class:"head-cell"},ui=ci(()=>n.createElementVNode("div",{class:"head-cell-resize"},null,-1)),pi=n.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(t,{emit:e}){const r=t;return r.title&&console.warn(`For cell ${r.name} using title,it should be replaced with label.`),(o,i)=>(n.openBlock(),n.createElementBlock("th",null,[n.createElementVNode("div",di,[n.createElementVNode("div",{class:"head-cell-content flex_grow",style:n.normalizeStyle({"min-width":o.minWidth,"max-width":o.maxWidth,width:o.width})},[o.type==="multi-select"?(n.openBlock(),n.createBlock(n.unref(y.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=n.withModifiers(s=>e("select"),["stop","prevent"]))})):(n.openBlock(),n.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=s=>e("order"))},n.toDisplayString(o.title||o.label),1))],4),o.name&&o.order.length&&o.order[0]===o.name?(n.openBlock(),n.createBlock(n.unref(b),{key:0,class:n.normalizeClass(["head-cell-order",{"head-cell-order_down":o.order.length>1&&o.order[1]==="desc"}])},{default:n.withCtx(()=>[n.createTextVNode("core-arrow-up")]),_:1},8,["class"])):n.createCommentVNode("",!0),ui])]))}}),Fa="",fi=m(pi,[["__scopeId","data-v-03c9724f"]]),mi=n.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const r=t,o=n.ref(),i=n.ref();n.onMounted(()=>{function c(E,k){let C=-1;do C++,k-=E[C];while(k>0&&C<E.length);return C}function u(E,k){let C=0;for(;k>0&&k>E[C]&&C<E.length;)k-=E[C],C++;return console.log(k,C),C>0?C:0}function p(E){try{i.value.style.insetInlineStart=E+"px"}catch(k){console.log(k)}}function _(E){try{i.value.style.width=E+"px",i.value.style.minWidth=E+"px",i.value.style.maxWidth=E+"px"}catch(k){console.log(k)}}function N(E){return E===null?!1:E.classList.contains("head-cell-resize")}o.value.addEventListener("pointerdown",function(k){var Kt;function C(R){return R.screenX+V-M}const x=o.value,h=[...x.children].filter(R=>R.localName==="th"),V=((Kt=x.offsetParent)==null?void 0:Kt.scrollLeft)||0,K=h.map(R=>R.clientWidth),me=N(k.target),M=x.getBoundingClientRect().left,De=C(k),I=c(K,De),Gt=K.slice(0,I).reduce((R,W)=>R+W,0),Ht=De-Gt,et=x.offsetWidth,he=h[I].clientWidth;if(r.config[I].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",k.screenX),console.log("Widths",K),console.log("max width",et),console.log("Start Position",De),console.log("Position From",I),console.log("Start Position",I),console.log("Global offset (Отступ самой таблицы от края экрана)",M),console.log("Del",Ht),console.groupEnd(),i.value.innerText=h[I].textContent||"",i.value.style.display="grid",i.value.style.width=he+"px",i.value.style.cursor="grabbing",p(Gt),_(he),document.addEventListener("pointermove",xt,{passive:!0}),document.addEventListener("pointerup",Jt);function Jt(R){if(console.group("END"),document.removeEventListener("pointermove",xt),document.removeEventListener("pointerup",Jt),me&&(r.config[I].width=i.value.style.width,r.config[I].minWidth=i.value.style.width,r.config[I].maxWidth=i.value.style.width,s(r.config)),!me){const W=R.screenX+V-M;console.log("ENP Position",W);const We=u(K,W);if(console.log(I,"->",We),We!==I){const _e=r.config[I],tt=r.config;tt.splice(I,1),tt.splice(We,0,_e),s(tt)}else{const _e=r.config[I].name;l(_e)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function xt(R){if(me){const _e=C(R)-De+he;_(_e);return}let W=R.screenX+V-M-Ht;W<0&&(W=0),W+he>et&&(W=et-he),p(W)}})});function s(c){e("update:config",c)}function l(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(r.order.length===0||r.order[0]!==c)return void a([c]);const u=r.order.length===1||r.order[1]==="asc"?"asc":"desc";a([c,u==="asc"?"desc":"asc"])}function a(c){e("update:order",c)}return(c,u)=>(n.openBlock(),n.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:o},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.config,(p,_)=>(n.openBlock(),n.createBlock(fi,n.mergeProps({key:p},p,{onOrder:N=>l(p.name),onSelect:u[0]||(u[0]=N=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),n.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),Ma="",hi=m(mi,[["__scopeId","data-v-11644ad4"]]),_i=50,gi=n.defineComponent({__name:"widget-list",props:{array:{},wait:{type:Boolean},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(t,{emit:e}){const r=t;function o(a,c=!0){var u;if(r.selectedRows)if(!c)s([a]);else{const p=r.selectedRows.indexOf(a);p===-1?r.selectedRows.push(a):(u=r.selectedRows)==null||u.splice(p,1),s(r.selectedRows)}}function i(){var a;if(((a=r.selectedRows)==null?void 0:a.length)!==r.array.length)return s([...r.array]);s([])}function s(a){e("update:selectedRows",a)}function l(a){if(!a)return;const c=a.target;c.scrollTop+c.clientHeight+_i>c.scrollHeight&&e("scrollEnd")}return(a,c)=>(n.openBlock(),n.createElementBlock("div",{class:"es-list-container",onScrollPassive:l},[n.createElementVNode("table",{class:n.normalizeClass(["widget-list",{"widget-list_load":a.wait}])},[n.createElementVNode("thead",null,[n.createVNode(hi,{onSelect:c[0]||(c[0]=u=>i()),"onUpdate:order":c[1]||(c[1]=u=>e("update:order",u)),"onUpdate:config":c[2]||(c[2]=u=>e("update:config",u)),config:a.config,order:a.order},null,8,["config","order"])]),n.createElementVNode("tbody",{class:n.normalizeClass(["widget-list-body",{"widget-list-body_inactive":a.wait}])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.array,(u,p)=>{var _;return n.openBlock(),n.createBlock(li,{key:p,class:"widget-list-row",values:u,config:a.config,selected:(_=a.selectedRows)==null?void 0:_.includes(u),onSelect:N=>o(u,N)},null,8,["values","config","selected","onSelect"])}),128))],2)],2)],32))}}),Ua="",yi=m(gi,[["__scopeId","data-v-eb609a21"]]),wi={class:"widget-section"},Ei={class:"widget-section__header"},ki={class:"widget-section-title"},bi={class:"widget-section__body"},Ci=n.defineComponent({__name:"widget-section",props:{title:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",wi,[n.createElementVNode("div",Ei,[n.createElementVNode("p",ki,n.toDisplayString(e.title),1)]),n.createElementVNode("div",bi,[n.renderSlot(e.$slots,"default",{},void 0,!0)])]))}}),ja="",$i=m(Ci,[["__scopeId","data-v-07232553"]]),za="",Si={props:{config:Array},name:"WidgetTableHead"},Ni={class:"widget-table__head"},Bi={class:"widget-table__head-title"};function Ti(t,e,r,o,i,s){return n.openBlock(),n.createElementBlock("tr",Ni,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.config,(l,a)=>(n.openBlock(),n.createElementBlock("th",{class:"widget-table__head-cell",key:a},[n.createElementVNode("p",Bi,n.toDisplayString(l.label||l.title),1)]))),128))])}const Vi=m(Si,[["render",Ti],["__scopeId","data-v-2d396466"]]);function Ii(t,e,r){const o=t.map(i=>Ai(i,e,r));return n.h("tr",{class:"widget-table__row widget-table-row"},o)}function Ai(t,e,r){const{name:o,value:i}=D.getCellInfo(t,e),s={onClick:[],class:["widget-table__cell widget-table-cell"]};function l(p){s.onClick.push(()=>p(i,e))}function a(p){Array.isArray(p)?s.class.push(...p):s.class.push(p)}const c=[],u=[];if(t.type)switch(a(`widget-table-cell_${t.type}`),t.type){case"edit":{t.icon="edit",l(r.activate);break}case"remove":{l(r.removeRow),t.icon="remove";break}case"select-multi":{l(r.select.bind(r,!0)),a("widget-table-cell_use"),a("widget-table-cell_select"),u.push(n.h("div",{class:{"table-cell-toggle":!0,"table-cell-toggle_active":r.selected.value}}));break}case"select":{l(r.select.bind(r,!1)),a("widget-table-cell_use"),a("widget-table-cell_select"),u.push(n.h("div",{class:{"table-cell-toggle":!0,"table-cell-toggle_active":r.selected.value}}));break}}return t.onClick&&l(t.onClick),t.link&&(u.push(n.h(Me.RouterLink,{to:t.link(i,e)})),a("list-cell-link")),t.href&&(u.push(n.h("a",{href:t.href(i,e),target:"_blank"})),a("list-cell-link")),i&&u.push(n.h("p",{},i)),t.icon&&u.push(n.h(b,{name:t.icon})),t.class&&a(t.class),c.push(n.h("td",s,u)),c}const Pi={props:{values:Object,config:Object,selected:it},emits:["set","remove","select"],setup(t,e){const{emit:r}=e,o={activate(){r("set",t.values[S])},deactivate(){r("set",null)},removeRow(){r("remove")},selected:n.computed(()=>t.selected),select(i=!1){r("select",i)}};return()=>Ii(t.config,t.values,o)}},Oi={class:"widget-table-form"},Ri=["colspan"],Mt=n.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},controller:{}},setup(t){const e=t,r=n.computed(()=>{var l;return!((l=e.values)!=null&&l[S])}),o=n.inject(se.PROVIDE_NAME);function i(l){o&&(r.value?o.create(l):o.edit(e.values[S],l))}function s(){e.controller.deactivate()}return(l,a)=>(n.openBlock(),n.createElementBlock("tr",Oi,[n.createElementVNode("td",{colspan:l.rowLength},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.component),{values:l.values,"table-controller":l.controller,onSave:i,onClose:s,new:r.value},null,40,["values","table-controller","new"]))],8,Ri)]))}}),Li=n.defineComponent({__name:"widget-table",props:{array:{},config:{},mini:{type:Boolean},activeRow:{},selectRows:{}},emits:["update:activeRow","update:selectRows"],setup(t,{emit:e}){const r=t;n.inject(se.PROVIDE_NAME);const o=n.useSlots(),i=n.computed(()=>{var a;return(a=o==null?void 0:o.default)==null?void 0:a.call(o)[0]});function s(a,c=!0){return r.selectRows?c?r.selectRows.indexOf(a)===-1?e("update:selectRows",[...r.selectRows,a]):e("update:selectRows",r.selectRows.filter(p=>p!==a)):e("update:selectRows",[a]):void 0}const l=Co(a=>e("update:activeRow",a));return n.onMounted(()=>{console.warn("WidgetTable is deprecated. Please use WidgetTable from new Import. Config: ",r.config)}),(a,c)=>(n.openBlock(),n.createElementBlock("table",{class:n.normalizeClass(["widget-table",{"widget-table_mini":a.mini}])},[n.createVNode(Vi,{config:a.config},null,8,["config"]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.array,(u,p)=>{var _;return n.openBlock(),n.createElementBlock(n.Fragment,{key:p},[n.createVNode(Pi,{config:a.config,values:u,selected:(_=a.selectRows)==null?void 0:_.includes(u[n.unref(S)]),onSet:c[0]||(c[0]=N=>e("update:activeRow",N)),onSelect:N=>s(u[n.unref(S)],N)},null,8,["config","values","selected","onSelect"]),a.activeRow===u[n.unref(S)]?(n.openBlock(),n.createBlock(Mt,{key:0,component:i.value,controller:n.unref(l)(u[n.unref(S)]),"row-length":a.config.length,values:u},null,8,["component","controller","row-length","values"])):n.createCommentVNode("",!0)],64)}),128)),a.activeRow===0?(n.openBlock(),n.createBlock(Mt,{key:0,component:i.value,controller:n.unref(l)(0),"row-length":a.config.length},null,8,["component","controller","row-length"])):n.createCommentVNode("",!0)])],2))}}),Di={class:"widget-form-info flex"},Wi={class:"form-titles"},Fi={class:"form-title margin-0"},Mi={class:"form-info text_size_md margin-0"},Ui={key:0,class:"form-container-label"},ji={class:"form-label__title text_size_sm"},zi=n.defineComponent({__name:"WidgetFormInfo",props:{title:{},info:{},label:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",Di,[n.createElementVNode("div",Wi,[n.createElementVNode("p",Fi,n.toDisplayString(e.title),1),n.createElementVNode("p",Mi,n.toDisplayString(e.info),1)]),e.label?(n.openBlock(),n.createElementBlock("div",Ui,[n.createElementVNode("div",{class:n.normalizeClass(["form-label",`form-label_${e.label.type}`])},[e.label.icon?(n.openBlock(),n.createBlock(b,{key:0,class:"form-label__icon",name:e.label.icon},null,8,["name"])):n.createCommentVNode("",!0),n.createElementVNode("p",ji,n.toDisplayString(e.label.title),1)],2)])):n.createCommentVNode("",!0)]))}}),qa="",qi=m(zi,[["__scopeId","data-v-6ea1062c"]]),vi={class:"wrap__widget-form"},Gi={class:"widget-form"},Hi={class:"widget-form__head"},Ji={class:"head-image"},xi={key:1},Ki={class:"widget-form__body"},Yi=n.defineComponent({__name:"WidgetForm",props:{title:{},info:{},image:{},icon:{},label:{},button:{},wait:{type:Boolean}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",vi,[n.createElementVNode("div",Gi,[n.createElementVNode("div",Hi,[n.createElementVNode("div",Ji,[e.wait?(n.openBlock(),n.createBlock(X,{key:0,color:"#3949AB"})):(n.openBlock(),n.createElementBlock("div",xi,[e.icon?(n.openBlock(),n.createBlock(b,{key:0,class:"form-image",name:e.icon},null,8,["name"])):n.createCommentVNode("",!0)]))]),n.createVNode(qi,{title:e.title,info:e.info,label:e.label},null,8,["title","info","label"]),e.button&&e.button.length?(n.openBlock(),n.createBlock(je,{key:0,class:"widget-form__button",array:e.button},null,8,["array"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",Ki,[n.renderSlot(e.$slots,"default",{},void 0,!0)])])]))}}),va="",Xi=m(Yi,[["__scopeId","data-v-f076ad65"]]),Zi={class:"validation-item-header"},Qi={class:"validation-item__title text_bold margin-0"},es={class:"validation-item-content"},ts={class:"text_bold text_md margin-0"},ns={class:"text_md margin-0"},rs=n.defineComponent({__name:"modal-validation-item",props:{message:{},status:{},statusName:{},title:{},name:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["validation-item",`validation-item_${e.statusName.toLowerCase()}`])},[n.createElementVNode("div",Zi,[n.createElementVNode("p",Qi,n.toDisplayString(e.statusName),1)]),n.createElementVNode("div",es,[n.createElementVNode("p",ts,n.toDisplayString(e.title),1),n.createElementVNode("p",ns,n.toDisplayString(e.message),1)])],2))}}),Ga="",os=m(rs,[["__scopeId","data-v-e6138c02"]]),is={class:"modal-wrap"},ss={class:"modal-wrap-head"},as={class:"modal-head__title margin-0"},ls={class:"modal-wrap-body"},cs=n.defineComponent({__name:"modal-wrap",props:{title:{}},setup(t){return(e,r)=>(n.openBlock(),n.createElementBlock("div",is,[n.createElementVNode("div",ss,[n.createElementVNode("p",as,n.toDisplayString(e.title),1)]),n.createElementVNode("div",ls,[n.renderSlot(e.$slots,"default",{},void 0,!0)])]))}}),Ha="",ds=m(cs,[["__scopeId","data-v-119165b9"]]),us={class:"modal-validation-body"},ps=n.defineComponent({__name:"modal-validation",props:{array:{}},setup(t){return(e,r)=>(n.openBlock(),n.createBlock(ds,{title:"Validation results"},{default:n.withCtx(()=>[n.createElementVNode("div",us,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.array,(o,i)=>(n.openBlock(),n.createBlock(os,{key:i,message:o.message,name:o.name,status:o.statusCode,"status-name":o.statusName,title:o.title},null,8,["message","name","status","status-name","title"]))),128))])]),_:1}))}}),Ja="",fs=m(ps,[["__scopeId","data-v-a39cfe2f"]]),ms=["alt","src"],hs=n.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,r=n.ref();return n.onMounted(()=>{r.value&&(r.value.src=e.src),r.value.onerror=function(){e.default&&(r.value.src=e.default)}}),(o,i)=>(n.openBlock(),n.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:r,src:o.src||o.$props.default},null,8,ms))}}),_s=n.defineComponent({__name:"widget-input-check",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const r=t;function o(){e("update:modelValue",!r.modelValue)}return(i,s)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["widget-input-check",{"widget-input-check_active":i.modelValue}]),onClick:o},[i.modelValue?(n.openBlock(),n.createBlock(b,{key:0,name:"check"})):n.createCommentVNode("",!0)],2))}}),xa="",gs=m(_s,[["__scopeId","data-v-f4a3dc6c"]]),ys={class:"widget-card"},ws={class:"widget-card-toggle"},Es={class:"widget-card-wrap"},ks={class:"widget-card-content"},bs={key:0,class:"widget-card-title"},Cs=n.defineComponent({__name:"widget-card",props:{title:{}},setup(t,{expose:e}){const r=n.reactive({selected:!1,hidden:!0});return e({state:r}),(o,i)=>(n.openBlock(),n.createElementBlock("div",ys,[n.createElementVNode("div",ws,[n.createVNode(gs,{modelValue:r.selected,"onUpdate:modelValue":i[0]||(i[0]=s=>r.selected=s)},null,8,["modelValue"])]),n.createElementVNode("div",Es,[n.createElementVNode("div",{class:"widget-card-arrow",onClick:i[1]||(i[1]=s=>r.hidden=!r.hidden)},[n.createVNode(b,{name:"angle-small-right",class:n.normalizeClass(["card-icon-arrow",{"card-icon-arrow_active":!r.hidden}])},null,8,["class"])]),n.createElementVNode("div",ks,[o.title?(n.openBlock(),n.createElementBlock("p",bs,n.toDisplayString(o.title),1)):n.createCommentVNode("",!0),n.renderSlot(o.$slots,"main",{},void 0,!0),r.hidden?n.createCommentVNode("",!0):n.renderSlot(o.$slots,"sub",{key:1},void 0,!0)])])]))}}),Ka="",$s=m(Cs,[["__scopeId","data-v-bca33c5b"]]);class T{static parseError(e){let r=e.errors?Object.values(e.errors).map(o=>o[0]):null;throw B.AuthServiceError(e.title,r)}static login(e){return f(j.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:j.applicationName})}).catch(T.parseError)}static registration(e){return e.AppName=j.applicationName,f(j.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(T.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw B.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return T.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return T.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return T.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return T.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,r){return f(`${j.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(r)}).catch(T.parseError)}static startLoginProcess(e){return T.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return T.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return T.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,r){return f(`${j.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(r)}).catch(T.parseError).then(T.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw B.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}const Ut=class ge{static async create(e){return f(ge.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const r=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return f(ge.url+"?"+r.toString(),{method:"get"})}static async readMessages(e){return f(`${ge.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return f(`${ge.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};Ut.url="/close-api/communications";let pe=Ut;class Ss{static async getDefaultView(e){return f("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function jt(t){return{...t,createdEntities:t.createdEntites}}const zt=class Fe{static async getStartConfig(e,r){return f([Fe.url,e,r].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,r){return f([Fe.url,e,r].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(jt)}static async runStep(e,r,o,i,s){return f([Fe.url,e,r].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:o,token:i,values:s})}).then(jt)}};zt.url="/close-api/views/process-wizard";let Re=zt;class Xe{static get url(){return"/close-api/metadata"}static async get(e,r,o){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const i=new URLSearchParams;return r&&i.append("criteria",r),o&&i.append("id",String(o)),await fetch(this.url+`/${e}?${i.toString()}`,{method:"GET"}).then(s=>s.json())}static getById(e,r,o=[]){const i=new URLSearchParams;return Ve(i,o),r&&i.append("id",r),f([this.url,e].join("/")+`?${i.toString()}`)}static getFieldInformation(e,r){return f(`/open-api/metadata/${e}/fields/${r}`)}static getTreatmentListField(e,r){return f(`/open-api/metadata/${e}/list-fields/${r}`)}}class Ns{static invite(e,r,o){return f("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:r,relatedRoleCode:o})})}static accept(e,r){return f("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:r,mark:!0})})}static decline(e,r){return f("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:r,mark:!1})})}}class Ze{static get url(){return"/close-api/rules-validation/"}static validate(e,r){return f(Ze.url+e,{method:"POST",body:JSON.stringify(r)})}}class Bs{static getConfiguration(){return f("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class qt{static url(){return"/close-api/actions"}static async get({criterion:e}){const r=new URLSearchParams;return e&&r.append("criterion",e),await fetch(this.url()+`?${r.toString()}`,{method:"GET"}).then(o=>o.json())}static getById(e,r,o=[]){const i=new URLSearchParams;return Ve(i,o),f([this.url(),e,r].join("/")+`?${i.toString()}`,{method:"GET"})}}const vt=class Xt extends P{constructor(e=[]){super(),this.array=n.reactive([]),this.defaultArray=[],this.setDefault(e)}emitUpdate(){this.emit(Xt.EVENT_DATA,this.array)}setDefault(e){const r=JSON.parse(JSON.stringify(e));this.defaultArray=r,this.set(r)}revert(){this.set(this.defaultArray)}set(e){this.array.splice(0,this.array.length,...e),this.emitUpdate()}append(e){this.array.push(e),this.emitUpdate()}moveTo(e,r){if(this.isOutOfRange(e)||this.isOutOfRange(r))throw new Error(`Provided position is out of range: ${e}, ${r}`);const o=this.array[e];this.array.splice(e,1),this.array.splice(r,0,o),this.emitUpdate()}remove(e){this.array.splice(e,1),this.emitUpdate()}isOutOfRange(e){return!(e>=0&&e<this.array.length)}};vt.EVENT_DATA="list-config:update";let Ts=vt;class Vs extends P{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return pe.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return pe.read(e).then(r=>r.length===0?pe.create(e):r[0])}}function Is(t){const e=y.Form.getParentForm();e?e.subscribe(t):console.warn(B.ParentFormNotFound());const r=n.reactive([]);return t.read=()=>pe.readMessages(t.id).then(o=>(r.splice(0,r.length,...o),o)),{array:r}}function As(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function O(t){return Object.keys(t).reduce((e,r)=>{const o=t[r];if(Array.isArray(o)){const i=o.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return o.length&&e.push(`@${r} in (${i})`),e}if(As(o)){let i=function(s){var l;return((l=s.match(/([^Z]*)/))==null?void 0:l[0])+"0000Z"};return o.start&&e.push(`@${r} ge ${i(o.start)}`),o.end&&e.push(`@${r} le ${i(o.end)}`),e}return typeof o=="number"?(e.push(`@${r} eq ${o}`),e):typeof o=="string"?(o.length!==0&&e.push(`@${r} eq '${o}'`),e):(o===null&&e.push(O.is(r,o)),e)},[]).join(" and ")}function fe(t){return typeof t=="string"?`'${t}'`:`${t}`}O.includes=function(e,r){return`@${e} Contains ${fe(r)}`},O.beginWith=function(e,r){return`@${e} BeginWith ${fe(r)}`},O.notEq=function(e,r){return`@${e} nq ${fe(r)}`},O.eq=function(e,r){return Array.isArray(r)?O.in(e,r):`@${e} eq ${fe(r)}`},O.in=function(e,r){const o=r.map(fe).join(", ");return`@${e} in (${o})`},O.and=function(...e){return e.join(" and ")},O.is=function(e,r){return`@${e} is ${r}`},O.or=function(...e){return e.join(" or ")};function Ps(t,e="images"){return`/static-folder/${e}/${t}`}function Os(t,e,r){return t.reduce((o,i)=>{var a;let s=typeof e=="function"?e(i):i[e];const l=(a=o[o.length-1])==null?void 0:a.value;return l&&r(l,s)?o[o.length-1].array.push(i):o.push({value:s,array:[i]}),o},[])}function Rs(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function Ls(t,e=1e3){let r=0;return(...o)=>{clearTimeout(r),r=setTimeout(()=>t(...o),e)}}function Ds(t,e){const r=n.ref(null);function o(){return t.name?Xe.getById(t.name,e,[]).then(i=>{r.value=i,i.fields.forEach(s=>{s.canSet?t.enable(s.name):t.disable(s.name)})}).catch(()=>{r.value=null;const i=B.MetadataEntityIsNotAvailable(t.name||"FORM_WITHOUT_NAME");$.add("error",i.message)}):Promise.reject()}return t.on(y.Form.EVENT_READ,o),{metadata:r,update:o}}class Qe extends Error{static UndefinedStatus(){return new Qe("Status is undefined.")}}class Ws extends Qe{}function Fs(t,e){const r=n.reactive([]);async function o(s,l){if(!s)throw Ws.UndefinedStatus();const a=await qt.get({criterion:s});r.splice(0,r.length),r.push(...a.map(c=>i(c,l)))}return{actions:r,update:o};function i(s,l){return{title:s.title,callback:()=>(()=>Promise.resolve().then(()=>{if(t.changed)return t.save()}).then(()=>fetch(s.url,{method:"POST",body:JSON.stringify({keys:{Id:l},contextId:g.contextId}),headers:{"Content-Type":"application/json"}})).then(c=>c.json()).then(c=>{if(!c.success)throw e!=null&&e.ModalValidationResult&&c.validationEffect?nt.openModal(e.ModalValidationResult,{rules:c.validationEffect.results}):$.add("error",c.message),new Error;return c}).then(c=>{c.message&&$.add("info",c.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(c.affectedEntities)}).then(()=>t.read()))()}}}class Le{static url(){return"/close-api/presentation"}static getStatuses(e,r){return fetch(`${Le.url()}/status/${e}/${r}`).then(o=>o.json())}}function Ms(t){const e=n.reactive({title:"Loading",type:"wait"});function r(o){if(t.name&&Number.isInteger(o))return Le.getStatuses(t.name,o).then(i=>{e.type=i.type,e.title=i.name})}return t.on(y.Form.EVENT_READ,o=>{var l,a;const{code:i,name:s}={code:(l=o.Status)==null?void 0:l.Code,name:(a=o.Status)==null?void 0:a.Name};return t.name?!Number.isInteger(i)&&!s?void console.log("Undefined code or name is Status prop."):Le.getStatuses(t.name,i).then(c=>{e.type=c.type,e.title=s}):void console.log("Form without name.")}),{label:e,update:r}}function Us(t,e){const r=Me.useRoute(),o=n.computed(()=>Number(r.params.id)),i=n.reactive({ready:!1,show:!1});return n.watch(()=>o.value,()=>{i.ready=!1}),n.watch(()=>o.value,()=>{Number.isInteger(o.value)&&t.read()},{immediate:!0}),t.read=oe.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!t.name)throw new Error("Form without entity name. Please set form.name");return A.readById(t.name,o.value,{fields:e.fields})}).then(oe.valuesToUpperCase).then(s=>(Number.isInteger(s.Version)&&(t.version=s.Version),t.setValues(s),i.show=!0,s)).catch(s=>{throw Object.prototype.hasOwnProperty.call(s,"status")&&[403,404].includes(s.status)&&(i.show=!1),s}).finally(()=>{i.ready=!0})),t.save=oe.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!t.name)throw new Error("Form without entity name. Please set form.name");return A.updateById(t.name,o.value,t.changes,{version:t.version})}).then(s=>{t.version=s.version})),t.on(y.Form.EVENT_SAVE,t.read.bind(t)),{formShadowState:i}}function js(){const t=n.reactive({contextId:g.contextId,person:g.person,organizations:g.organizations,ready:g.ready,user:g.user}),e=n.computed(()=>{if(!g.ready||!g.person)return null;const o=t.contextId;return g.person.id===o?g.person:g.organizations.find(i=>i.id===o)||null}),r=n.computed(()=>{var o;return t.contextId===((o=t.person)==null?void 0:o.id)});return g.onupdateContext(o=>{t.contextId=o}),g.onupdateData(()=>{t.person=g.person,t.organizations=g.organizations,t.user=g.user}),g.onReady(o=>{t.ready=o}),{state:n.readonly(t),currentContext:e,isPerson:r}}function zs(t,e){const r=n.reactive({ready:!1,show:!1});function o(){r.ready=!1,r.show=!1}return t.read=()=>{let i=e();return Promise.resolve().then(()=>{if(!t.name)throw B.EntityWithoutName("Use Form Request");return A.readById(t.name,i.id,{fields:i.fields})}).then(oe.valuesToUpperCase).then(s=>(s.hasOwnProperty("Version")&&(t.version=Number(s.Version)),t.setValues(s),r.show=!0,s)).catch(s=>{const l=ne(s);throw $.add("error",l.message),l}).finally(()=>{r.ready=!0})},t.save=()=>{let i=e();return Promise.resolve().then(()=>{if(!t.name)throw B.EntityWithoutName("Use Form Request");return A.updateById(t.name,i.id,t.changes,{version:t.version})}).then(s=>{t.version=s.version||s.Version}).catch(s=>{const l=ne(s);throw $.add("error",l.message),l})},t.on(y.Form.EVENT_SAVE,t.read.bind(t)),{shadowFormState:r,initShadow:o}}class qs{static getRequiredDocuments(e,r,o){const i=new URLSearchParams({entity:e,primaryKey:r,statusCode:o});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(s=>s.json())}}class Q{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${Q.url()}/calculator/${e}`)}static calculate(e,r){return f(`/${Q.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:r})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):B.ApiNotAvailable()})}static parseMetadataField(e){function r(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:e.name,label:e.title,required:e.required,type:r(e)}}static createOnlinePayment(e,r){return f(`/${Q.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:r})})}static applyOnlinePayment(e){return f(`/${Q.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class vs{static getListSettings(e,r){const o=new URLSearchParams;o.set("entity",e),r&&o.set("mark",r);const i=`/close-api/views/list/configs?${o.toString()}`;return f(i)}}function Gs(t){return t.statusName==="Completed"}function Hs(t){return t.statusName==="FinalStepWithConfirmation"}function Js(t){return t.statusName==="ValidationError"}function xs(t,e,r){let o=null;const i=n.reactive({wait:null});let s=[],l=null;const a=n.ref(null);function c(){a.value=s.find(h=>h.name===l)||null}function u(){var h;return l?((h=s.find(V=>V.name===l))==null?void 0:h.fields)||[]:[]}function p(h){if(c(),Js(h))return void r.onValidation(h.validationResults);if((h.statusName==="FinalStep"||h.statusName==="NextStep")&&(!u().length||Ks(u(),r.presets)))return x(r.presets||{});Gs(h)&&r.onCompleted(h),Hs(h)&&r.onConfirmation(h)}async function _(){try{await N(),await C()}catch(h){const{message:V}=ne(h);$.add("error",V)}}function N(){return i.wait="Loading process information.",Re.getStartConfig(e,t).then(h=>{s=h.steps.map(V=>({label:V.title,name:V.stepName,number:V.number,fields:V.frontendEntity.objectTypes.reduce((K,me)=>(me.properties.forEach(M=>{K.push({name:M.name,label:M.title,type:M.refEntityName||M.dataType})}),K),[])}))}).then(h=>(i.wait=!1,h))}function E(h){return l=h.nextStepName,o=h.token,h}function k(h){const V=ne(h);$.add("error",V.message)}function C(){return i.wait="Starting process",Re.startProcess(e,t).then(E).then(p).catch(k).finally(()=>{i.wait=null})}function x(h={}){return!o||!l?Promise.reject("Not step or token."):(i.wait="Expect the result",Re.runStep(e,t,l,o,h).then(E).then(p).catch(k).finally(()=>{i.wait=!1}))}return{initialize:_,state:i,currentStepConfig:n.readonly(a),next:x}}function Ks(t,e){for(let r=0;r<t.length;r++){const o=t[r];if(!y.utils.getPropFromObject(e,o.name))return!1}return!0}const Ys="close-api/proxy/Equipment/Search";class Xs{static search(e,r,o,i,s){const l=new URLSearchParams;l.append("pattern",e||""),r&&l.append("categoryId",r),o&&l.append("useType",String(o)),i&&l.append("statusCode",i),s&&(l.append("limit",String(s.limit)),l.append("offset",String(s.offset)));const a=`/${Ys}?${l.toString()}`;return f(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Zs={clickOutside:Y,requestHandler:Be,valuesToUpperCase:Te,prettyDate:Ke,prettyDateWithTime:Ot,Filter:O,staticLink:Ps,groupArrayByField:Os,uuidv4:Rs,Request:f,prettyMoney:kt},Qs={widgets:io,usage:so,utils:go,mixins:nn,config:yo,types:wo};d.ApplicationManager=yt,d.Communication=Vs,d.ComputedMetadata=Yo,d.CoreError=B,d.Filter=O,d.List=D,d.ListConfig=Ts,d.Manager=g,d.MetadataStore=ue,d.ModalValidation=fs,d.NotificationSystem=$,d.ProcessWrap=ke,d.Request=f,d.SYMBOL_ROW=S,d.Table=se,d.WidgetBreadcrumbs=si,d.WidgetButton=st,d.WidgetCard=$s,d.WidgetForm=Xi,d.WidgetIcon=b,d.WidgetImage=hs,d.WidgetList=yi,d.WidgetMultiButton=je,d.WidgetNotificationSystem=ct,d.WidgetSection=$i,d.WidgetSpinner=X,d.WidgetTable=Li,d.WidgetWait=Wt,d.actionService=qt,d.authService=T,d.billingService=Q,d.clickOutside=Y,d.clientService=pt,d.communicationService=pe,d.configurationService=vs,d.dataService=A,d.debounce=Ls,d.default=Qs,d.documentsService=qs,d.equipmentService=Xs,d.fileService=ot,d.historyService=Bo,d.internationalizationService=Zo,d.invitationService=Ns,d.metadataService=Xe,d.newImport=xo,d.openService=Bs,d.parseError=ne,d.prettifyValueByMetadata=Xo,d.processWizardService=Re,d.requestHandler=Be,d.ruleValidationService=Ze,d.setupSocket=ei,d.t=Z,d.testTypes=No,d.useCommunication=Is,d.useCustomerState=js,d.useFormAction=Fs,d.useFormLabel=Ms,d.useFormMetadata=Ds,d.useFormRequest=zs,d.useFormRequestData=Us,d.useListConfig=To,d.useListFilter=Io,d.useListOrder=At,d.useListProvide=It,d.useListRead=Tt,d.useListSearch=Vo,d.useListSelect=Ao,d.useListState=Vt,d.useManagerState=lo,d.useSocket=Qo,d.useTableRequest=So,d.useTableState=$o,d.useWizard=xs,d.utils=Zs,d.viewService=Ss,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
11
11
  //# sourceMappingURL=eservices-core.umd.js.map
@@ -1,4 +1,8 @@
1
+ import { ManagerOptions } from "socket.io-client";
1
2
  declare type SocketNamespace = 'default' | string;
2
3
  export declare function useSocket(namespace?: SocketNamespace): import("socket.io-client").Socket<import("@socket.io/component-emitter").DefaultEventsMap, import("@socket.io/component-emitter").DefaultEventsMap> | undefined;
3
- export declare function setupSocket(URI?: string): void;
4
+ export declare function setupSocket(URI?: string, params?: Partial<ManagerOptions>, options?: Partial<IUseSocketOptions>): void;
5
+ interface IUseSocketOptions {
6
+ onReconnect: () => void;
7
+ }
4
8
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eservices-core",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "description": "Core library",
5
5
  "author": "",
6
6
  "scripts": {
@@ -46,7 +46,7 @@
46
46
  "jenesius-vue-form": "^3.0.0-rc.0",
47
47
  "jenesius-vue-modal": "^1.5.0",
48
48
  "object-hash": "^3.0.0",
49
- "socket.io-client": "^4.5.2",
49
+ "socket.io-client": "4.7.2",
50
50
  "vue": "^3.3.4",
51
51
  "vue-router": "4.0.16"
52
52
  },