eservices-core 1.3.0 → 1.3.2
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.
- package/dist/eservices-core.cjs.js +3 -3
- package/dist/eservices-core.es.js +315 -306
- package/dist/eservices-core.umd.js +3 -3
- package/dist/frontend/core/index.d.ts +3 -2
- package/dist/frontend/core/services/metadata-service.d.ts +1 -1
- package/dist/frontend/core/widgets/buttons/index.d.ts +1 -1
- package/dist/frontend/core/widgets/index.d.ts +1 -1
- package/dist/frontend/core/widgets/new/widget-table.vue.d.ts +1 -1
- package/dist/frontend/src/constants.d.ts +1 -1
- package/dist/frontend/src/hooks/use-list-active-row.d.ts +8 -0
- package/dist/frontend/src/index.d.ts +5 -0
- package/dist/frontend/src/types/list-type.d.ts +11 -8
- package/dist/frontend/src/widgets/table/widget-table-head.vue.d.ts +2 -2
- package/dist/frontend/src/widgets/table/widget-table.vue.d.ts +10 -18
- package/dist/frontend/tests/unit/hooks/use-list-active-row.spec.d.ts +1 -0
- package/dist/frontend/tests/wait.d.ts +1 -0
- package/package.json +2 -1
- /package/dist/frontend/tests/{unit/get-prop-from-object.spec.d.ts → integrations/icon.spec.d.ts} +0 -0
- /package/dist/frontend/tests/{unit/graphql.spec.d.ts → integrations/table.spec.d.ts} +0 -0
|
@@ -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}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.es-list-container{overflow:auto}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.widget-table__head[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-48d3df56]{border:1px solid #F3F4FC;height:30px}th[data-v-48d3df56],td[data-v-48d3df56]{position:relative;padding:0 11px}th[data-v-48d3df56]{text-align:left}p[data-v-48d3df56]{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-a0fe6a42]{position:relative}.widget-list-body[data-v-a0fe6a42]:after{content:"";background-color:transparent;z-index:-1;transition:.1s}.widget-list-body_inactive[data-v-a0fe6a42]: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}.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}.widget-table__head-cell[data-v-fe89c589]{padding:18px;text-align:start}.widget-table__head-label[data-v-fe89c589]{font-weight:600;font-size:14px;line-height:19px}[dir=rtl] .icon[data-v-e287c8d9]{transform:scaleX(-1)}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
2
|
(function(p,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("jenesius-vue-modal"),require("jenesius-vue-form"),require("object-hash"),require("vue-router"),require("date-and-time")):typeof define=="function"&&define.amd?define(["exports","vue","jenesius-vue-modal","jenesius-vue-form","object-hash","vue-router","date-and-time"],r):(p=typeof globalThis<"u"?globalThis:p||self,r(p["eservices-core"]={},p.Vue,p.JenesiusVueModal,p.JenesiusVueForm,p.ObjectHash,p.VueRouter,p.DateAndTime))})(this,function(p,r,lt,k,ct,je,dt){"use strict";/*!
|
|
3
|
-
* eservices-core v1.3.
|
|
3
|
+
* eservices-core v1.3.2
|
|
4
4
|
* (c) 2023 ESERVICES
|
|
5
|
-
*/const Ea="",E=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},T=E({props:{name:String},setup(t,e){let n="unknown";try{n=e.slots.default()[0].children}catch{n=t.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>r.h("i",{class:`icon icon-${n}`})}},[["__scopeId","data-v-0d979509"]]);function ln(t,e){return!!t&&t===e||"password is not equal"}function we(t){return Number(t.replace(/[^0-9.]/g,""))}function qe(t,e=null){let o=String(we(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 cn=Object.freeze(Object.defineProperty({__proto__:null,numeric:we,prettyNumeric:qe,validPassword:ln},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(n=>n.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 n=t[e](this.value);if(n!==!0)return this.setError(n),!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}}},Ee={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"}}},dn=Object.freeze(Object.defineProperty({__proto__:null,MixinInput:H,MixinInputPassword:{props:{password:{type:Boolean,default:()=>!1}},data:()=>({isPasswordVisible:!1}),methods:{togglePasswordVisible(t=!this.isPasswordVisible){this.isPasswordVisible=t}}},MixinInputText:Ee},Symbol.toStringTag,{value:"Module"})),ba="";function Ce(t,e=[]){let n=t;return e.forEach(o=>{n=o(n)}),n}const un={components:{Icon:T},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(Ce(this.modelValue,this.arrayInputPrettyModifiers))},arrayInputModifiers(){let t=[];return(this.numeric||this.prettyNumeric)&&t.push(we),t},arrayInputPrettyModifiers(){let t=[];return this.prettyNumeric&&t.push(qe),t}},methods:{onChange(t){let e=this.modify(Ce(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(Ce(t.target.value,this.arrayInputModifiers));this.input(e),this.$refs.input.value=this.pretty(Ce(this.modelValue,this.arrayInputPrettyModifiers))}},mixins:[H,Ee],name:"InputText"},pn={class:"input-wrap"},fn={key:0,class:"input-title"},mn={key:0,class:"input-title_required"},hn=["disabled","error"],gn=["type","placeholder","disabled","error","value"],_n={key:1,class:"input-text__error text_sm"};function yn(t,e,n,o,s,i){const c=r.resolveComponent("icon");return r.openBlock(),r.createElementBlock("div",pn,[t.title?(r.openBlock(),r.createElementBlock("p",fn,[r.createTextVNode(r.toDisplayString(t.title)+" ",1),t.required?(r.openBlock(),r.createElementBlock("span",mn,"*")):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"input-text-container input_size_md flex",disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage},[r.createElementVNode("input",{class:"input-text",type:t.inputType,placeholder:t.placeholder,disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage,ref:"input",value:n.pretty(t.value),onInput:e[0]||(e[0]=(...l)=>i.onInput&&i.onInput(...l))},null,40,gn),t.password?(r.openBlock(),r.createElementBlock("div",{key:0,class:"input-text__password",onClick:e[1]||(e[1]=l=>t.togglePasswordVisible())},[r.createVNode(c,{class:"cursor_pointer",name:t.isPasswordVisible?"eye-crossed":"eye"},null,8,["name"])])):r.createCommentVNode("",!0),t.errorMessage?(r.openBlock(),r.createElementBlock("p",_n,r.toDisplayString(t.errorMessage),1)):r.createCommentVNode("",!0)],8,hn)])}const wn=E(un,[["render",yn],["__scopeId","data-v-65e2ee2d"]]),$a="",En={mixins:[H],name:"InputToggle"};function Cn(t,e,n,o,s,i){return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["input__toggle widget-input",{active:t.value,disabled:t.disabled||t.isInsideDisabled}]),onClick:e[0]||(e[0]=c=>t.input(!t.value))},null,2)}const kn=E(En,[["render",Cn],["__scopeId","data-v-56d58611"]]),Sa="",bn={props:["isActive","title"],name:"FragmentInputSelectItem"},$n={class:"item-wrap"};function Sn(t,e,n,o,s,i){return r.openBlock(),r.createElementBlock("div",$n,[r.createElementVNode("p",{class:r.normalizeClass(["input-select__item cursor_pointer",{active:n.isActive}])},r.toDisplayString(n.title),3)])}const Nn=E(bn,[["render",Sn],["__scopeId","data-v-69ab8592"]]);function Z(t,e){if(!t)return console.warn("Element is not provided.");function n(s,i){return s==i.target||s.contains(i.target)}const o=s=>{n(t,s)||(e(),window.removeEventListener("click",o))};window.addEventListener("click",o)}const Na="",Tn={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:T,FragmentInputSelectItem:Nn},mixins:[H],name:"InputSelect"},Bn={class:"input-wrap"},In={key:0,class:"input-title"},Vn={key:0,class:"color__text_red"},An={class:"input-select-container__current input_size_md flex"},Fn={key:0,class:"input-select-value"},Pn={key:1,class:"current-placeholder text_md"},On={class:"input-select-list input-select-container__list"},Dn={key:0,class:"input-text__error position_absolute margin-0 text_sm color__text_red"};function Ln(t,e,n,o,s,i){const c=r.resolveComponent("icon"),l=r.resolveComponent("fragment-input-select-item");return r.openBlock(),r.createElementBlock("div",Bn,[t.title?(r.openBlock(),r.createElementBlock("p",In,[r.createTextVNode(r.toDisplayString(t.title)+" ",1),t.required?(r.openBlock(),r.createElementBlock("span",Vn,"*")):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["input-select-container cursor_pointer",{active:t.isActive,disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage}]),onClick:e[1]||(e[1]=a=>i.active()),ref:"input"},[r.createElementVNode("div",An,[t.value===void 0||t.value===null?(r.openBlock(),r.createElementBlock("span",Pn,r.toDisplayString(t.placeholder),1)):(r.openBlock(),r.createElementBlock("p",Fn,r.toDisplayString(i.titleValue),1)),t.disabled||t.isInsideDisabled?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(c,{key:2,class:"input-select__ico-toggle",name:"caret-down"}))]),r.createElementVNode("div",On,[t.value?(r.openBlock(),r.createBlock(l,{key:0,onClick:e[0]||(e[0]=a=>t.input(null))})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.arrayParse,(a,u)=>(r.openBlock(),r.createBlock(l,{class:"input-select-list__item",key:u,"is-active":a.value===t.value,title:a.title,onClick:d=>t.input(a.value)},null,8,["is-active","title","onClick"]))),128))]),t.errorMessage?(r.openBlock(),r.createElementBlock("p",Dn,r.toDisplayString(t.errorMessage),1)):r.createCommentVNode("",!0)],2)])}const Rn=E(Tn,[["render",Ln],["__scopeId","data-v-c4acd469"]]);class ut{static async upload(e,n){const o=new FormData;o.append("file",e);const s=`/close-api/files?entityName=${n}`;return await fetch(s,{method:"POST",body:o}).then(i=>i.json()).then(i=>(i.filename=e.name,i))}}function ke(t=()=>null){console.warn("ProcessWrap deprecated! Use AsyncWrap");let e=t;const n=r.reactive({wait:!1,error:!1,ready:!1});return n.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},n.setFunction=async function(o){e=o},n}const Ta="",Wn=r.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 ut.upload(t,this.entityName);this.$emit("load",e),this.name&&this.input(e.id)}},mixins:[H],components:{Icon:T}}),Mn={class:"container-input-file"},vn={key:0,class:"process-info input-file__wait text_size_sm"},Un={key:1,class:"process-info input-file__error text_size_sm text_error"};function jn(t,e,n,o,s,i){const c=r.resolveComponent("icon");return r.openBlock(),r.createElementBlock("div",Mn,[r.createVNode(c,{name:"plus",class:"icon__file-upload"}),r.createElementVNode("input",{type:"file",class:"input-file",onChange:e[0]||(e[0]=l=>t.onChange(l.target.files[0]))},null,32),t.pw.wait?(r.openBlock(),r.createElementBlock("p",vn,"Loading...")):r.createCommentVNode("",!0),t.pw.error?(r.openBlock(),r.createElementBlock("p",Un,"Error load file")):r.createCommentVNode("",!0)])}const qn={InputText:wn,InputToggle:kn,InputSelect:Rn,InputLoadFile:E(Wn,[["render",jn],["__scopeId","data-v-bdbf1475"]])},Ia="",zn={props:{placeholder:String,error:[Boolean,String]},setup(){return{}},name:"WidgetInputContainer"},Gn=t=>(r.pushScopeId("data-v-1e3f1057"),t=t(),r.popScopeId(),t),Hn={class:"widget-input__container"},Jn={class:"input-container__content"},xn=Gn(()=>r.createElementVNode("div",{class:"widget-input__underline"},null,-1));function Kn(t,e,n,o,s,i){return r.openBlock(),r.createElementBlock("div",Hn,[r.createElementVNode("div",Jn,[r.renderSlot(t.$slots,"default",{},void 0,!0)]),xn,n.placeholder?(r.openBlock(),r.createElementBlock("p",{key:0,class:r.normalizeClass(["widget-input__placeholder",{"widget-input__placeholder_error":n.error}])},r.toDisplayString(n.placeholder),3)):r.createCommentVNode("",!0)])}const Yn=E(zn,[["render",Kn],["__scopeId","data-v-1e3f1057"]]),Va="",Xn={components:{Icon:T,WidgetInputContainer:Yn},mixins:[H,Ee],name:"InputText"},Zn=["type","value"];function Qn(t,e,n,o,s,i){const c=r.resolveComponent("icon"),l=r.resolveComponent("widget-input-container");return r.openBlock(),r.createBlock(l,{placeholder:t.placeholder,error:!!t.errorMessage},{default:r.withCtx(()=>[r.createElementVNode("input",{type:t.password&&!t.isPasswordVisible?"password":"text",class:"input-text title_sm",value:t.value,onChange:e[0]||(e[0]=a=>t.input(a.target.value)),onKeyup:e[1]||(e[1]=r.withKeys(a=>t.$emit("enter"),["enter"]))},null,40,Zn),t.password?(r.openBlock(),r.createElementBlock("div",{key:0,class:"input-text__password",onClick:e[2]||(e[2]=a=>t.togglePasswordVisible())},[r.createVNode(c,{class:"cursor_pointer",name:t.isPasswordVisible?"eye-crossed":"eye"},null,8,["name"])])):r.createCommentVNode("",!0)]),_:1},8,["placeholder","error"])}const er={InputText:E(Xn,[["render",Qn],["__scopeId","data-v-212b50e2"]])},Fa="";function be(t,e=[]){let n=t;return e.forEach(o=>{n=o(n)}),n}const tr=r.defineComponent({components:{Icon:T},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(we),t},arrayInputPrettyModifiers(){let t=[];return this.prettyNumeric&&t.push(qe),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:[H,Ee],name:"InputText"}),nr={key:0,class:"input-title"},rr={key:0,class:"color__text_red"},or=["disabled","error"],sr=["type","placeholder","disabled","error","value"],ir={key:1,class:"input-text__error text_sm color__text_red"};function ar(t,e,n,o,s,i){const c=r.resolveComponent("icon");return r.openBlock(),r.createElementBlock(r.Fragment,null,[t.title?(r.openBlock(),r.createElementBlock("p",nr,[r.createTextVNode(r.toDisplayString(t.title)+" ",1),t.required?(r.openBlock(),r.createElementBlock("span",rr,"*")):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"input-text-container flex",disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage},[r.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]=(...l)=>t.onInput&&t.onInput(...l))},null,40,sr),t.password?(r.openBlock(),r.createElementBlock("div",{key:0,class:"input-text__password",onClick:e[1]||(e[1]=l=>t.togglePasswordVisible())},[r.createVNode(c,{class:"cursor_pointer",name:t.isPasswordVisible?"eye-crossed":"eye"},null,8,["name"])])):r.createCommentVNode("",!0),t.errorMessage?(r.openBlock(),r.createElementBlock("p",ir,r.toDisplayString(t.errorMessage),1)):r.createCommentVNode("",!0)],8,or)],64)}const lr={default:qn,line:er,naomi:{InputText:E(tr,[["render",ar],["__scopeId","data-v-9c3e5ea6"]])}},Da="",cr={components:{Icon:T},props:{title:String,values:[Object,Array,String]},setup(t){Array.isArray(t.values)&&t.values.forEach(c=>{c.func&&console.warn("Prop func is deprecated. Use callback.",c)});const e=r.computed(()=>{if(!o.value)return"30px";let c=0;return Array.isArray(t.values)&&(c+=t.values.length),t.title&&c++,typeof t.values=="string"&&!Array.isArray(t.values)&&c++,c*30+"px"}),n=r.computed(()=>Array.isArray(t.values)?t.values:typeof t.values=="string"?{title:t.values}:[t.values]),o=r.ref(!1);function s(c=!o.value){o.value=c,c&&Z(i.value,()=>s(!1))}const i=r.ref(null);return{isActive:o,array:n,toggle:s,button:i,maxHeight:e}},name:"Button"},dr={class:"widget-button-wrap flex"},ur=["onClick"];function pr(t,e,n,o,s,i){const c=r.resolveComponent("icon");return r.openBlock(),r.createElementBlock("div",dr,[r.createElementVNode("div",{class:r.normalizeClass(["widget-button flex",{active:o.isActive}]),ref:"button"},[r.createElementVNode("div",{class:"widget-button__list flex_column",style:r.normalizeStyle({maxHeight:o.maxHeight})},[n.title?(r.openBlock(),r.createElementBlock("span",{key:0,class:"widget-button__list-elem cursor_pointer",onClick:e[0]||(e[0]=l=>o.toggle())},r.toDisplayString(n.title),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.array,(l,a)=>(r.openBlock(),r.createElementBlock("span",{class:"widget-button__list-elem cursor_pointer",onClick:u=>(l.callback(),o.toggle(!1)),key:a},r.toDisplayString(l.title),9,ur))),128))],4),o.array.length>1?(r.openBlock(),r.createElementBlock("div",{key:0,class:"widget-button__toggle flex flex_center cursor_pointer",onClick:e[1]||(e[1]=r.withModifiers(l=>o.toggle(),["stop"]))},[r.createVNode(c,{class:"widget-button__toggle-icon",name:"angle-small-down"})])):r.createCommentVNode("",!0)],2)])}const fr=E(cr,[["render",pr],["__scopeId","data-v-b6be5c12"]]),La="",mr={props:{icon:String,func:Function},name:"WidgetFormFunctionItem",components:{Icon:T}};function hr(t,e,n,o,s,i){const c=r.resolveComponent("icon");return r.openBlock(),r.createElementBlock("div",{class:"function-item cursor_pointer",onClick:e[0]||(e[0]=(...l)=>n.func&&n.func(...l))},[r.createVNode(c,{name:n.icon},null,8,["name"])])}const gr=E(mr,[["render",hr],["__scopeId","data-v-73f7eb9f"]]),Ra="",_r={props:{title:String},name:"WidgetFormTitle"},yr={class:"form-title"},wr={class:"title_lg color__text_black margin-0"};function Er(t,e,n,o,s,i){return r.openBlock(),r.createElementBlock("div",yr,[r.createElementVNode("h2",wr,r.toDisplayString(n.title),1)])}const Cr=E(_r,[["render",Er],["__scopeId","data-v-c91ffa31"]]),Wa="",kr={components:{WidgetFormTitle:Cr,WidgetFormFunctionItem:gr,WidgetButton:fr},props:{title:String,button:{type:[Array,Object],default:()=>[]},functions:[Array]},name:"WidgetForm"},br={class:"widget-form flex_column"},$r={class:"widget-form__head flex"},Sr={class:"widget-form__head-functions flex"},Nr={class:"widget-form__body"};function Tr(t,e,n,o,s,i){const c=r.resolveComponent("widget-form-title"),l=r.resolveComponent("widget-button"),a=r.resolveComponent("widget-form-function-item");return r.openBlock(),r.createElementBlock("div",br,[r.createElementVNode("div",$r,[r.createVNode(c,{title:n.title},null,8,["title"]),Array.isArray(n.button)&&n.button.length||!Array.isArray(n.button)&&n.button?(r.openBlock(),r.createBlock(l,{key:0,class:"widget-form__head-button",values:n.button},null,8,["values"])):r.createCommentVNode("",!0),r.createElementVNode("div",Sr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.functions,(u,d)=>(r.openBlock(),r.createBlock(a,{key:d,icon:u.icon,func:u.callback},null,8,["icon","func"]))),128))])]),r.createElementVNode("div",Nr,[r.renderSlot(t.$slots,"default",{},void 0,!0)])])}const Br={default:{WidgetForm:E(kr,[["render",Tr],["__scopeId","data-v-c3e88e10"]])}},va="",Ir={props:{title:String,subTitle:String,type:[String,Number],double:{type:Boolean,default:()=>!1}},name:"ContainerFormElem"},Vr={class:"form-container-item__title flex"},Ar={class:""},Fr={key:0,class:""},Pr={class:"title_sm"},Or={key:1,class:"form-container-item__right"};function Dr(t,e,n,o,s,i){return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["form-container-item flex",[`form-container-item-${n.type}`]])},[r.createElementVNode("div",Vr,[r.createElementVNode("span",Ar,r.toDisplayString(n.title),1)]),r.createElementVNode("div",{class:r.normalizeClass(["form-container-item-center flex_column",{content_double:n.double}])},[r.renderSlot(t.$slots,"default",{},void 0,!0)],2),n.subTitle?(r.openBlock(),r.createElementBlock("div",Fr,[r.createElementVNode("span",Pr,r.toDisplayString(n.subTitle),1),r.renderSlot(t.$slots,"centerRight",{},void 0,!0)])):r.createCommentVNode("",!0),t.$slots.right?(r.openBlock(),r.createElementBlock("div",Or,[r.renderSlot(t.$slots,"right",{},void 0,!0)])):r.createCommentVNode("",!0)],2)}const Lr=E(Ir,[["render",Dr],["__scopeId","data-v-9264f6f4"]]),Ua="",Rr={name:"ContainerAuthView"},Wr={class:"container-auth-wrap"},Mr={class:"container-auth-sidebar"},vr={class:"container-auth-main"};function Ur(t,e,n,o,s,i){return r.openBlock(),r.createElementBlock("div",Wr,[r.createElementVNode("div",Mr,[r.renderSlot(t.$slots,"side",{},void 0,!0)]),r.createElementVNode("div",vr,[r.renderSlot(t.$slots,"default",{},void 0,!0)])])}const jr={ContainerFormElem:Lr,ContainerAuthView:E(Rr,[["render",Ur],["__scopeId","data-v-0b1a5e81"]])},qr=r.defineComponent({__name:"widget-spinner",props:{color:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:"loader",style:r.normalizeStyle({"border-left":`1.1em solid ${e.color?e.color:"#fff"}`})},null,4))}}),qa="",Q=E(qr,[["__scopeId","data-v-661e0416"]]),zr={class:"button-element"},Gr=r.defineComponent({__name:"WidgetButton",props:{title:{},callback:{type:Function},wait:{type:Boolean},default:{type:Boolean}},setup(t){const e=t;function n(s){s.key==="Enter"&&o.call()}r.onMounted(()=>{e.default&&document.addEventListener("keypress",n)}),r.onUnmounted(()=>{document.removeEventListener("keypress",n)});const o=ke(e.callback);return(s,i)=>(r.openBlock(),r.createElementBlock("div",{class:"button-wrap",onClick:i[0]||(i[0]=c=>r.unref(o).call())},[r.unref(o).wait||s.wait?(r.openBlock(),r.createBlock(Q,{key:0,class:"button-spinner"})):r.createCommentVNode("",!0),r.createElementVNode("button",zr,[r.createTextVNode(r.toDisplayString(s.title)+" ",1),r.renderSlot(s.$slots,"default",{},void 0,!0)])]))}}),za="",pt=E(Gr,[["__scopeId","data-v-3cf452e1"]]),Hr={class:"widget-button-wrap"},Jr={class:"widget-multi-button"},xr={class:"widget-button-list"},Kr=["onClick"],Yr={class:"button__side"},Xr={key:0,class:"button__size-progress"},Zr=r.defineComponent({__name:"WidgetMultiButton",props:{title:{},array:{}},setup(t){const e=ke(),n=r.reactive({active:!1});function o(i=!n.active){n.active=i}function s(i){e.setFunction(i),e.call()}return(i,c)=>(r.openBlock(),r.createElementBlock("div",Hr,[r.createElementVNode("div",Jr,[r.createElementVNode("div",{class:r.normalizeClass(["button__content",{button__content_active:n.active}])},[i.title?(r.openBlock(),r.createElementBlock("p",{key:0,class:"button__content-title widget-multi-button-row",onClick:c[0]||(c[0]=l=>o())},r.toDisplayString(i.title),1)):r.createCommentVNode("",!0),r.createElementVNode("div",xr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.array,(l,a)=>(r.openBlock(),r.createElementBlock("p",{class:"button__content-title widget-multi-button-row",key:a,onClick:u=>(s(l.callback),o(!1))},r.toDisplayString(l.title),9,Kr))),128))])],2),r.createElementVNode("div",Yr,[r.unref(e).wait?(r.openBlock(),r.createElementBlock("div",Xr,[r.createVNode(Q,{class:"button-spinner"})])):i.array&&i.array.length>1?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["button__size-toggle widget-multi-button-toggle",{button__toggle_active:n.active}]),onClick:c[1]||(c[1]=l=>o())},[r.createVNode(T,{class:"button__toggle-icon",name:"angle-small-down"})],2)):r.createCommentVNode("",!0)])])]))}}),Ga="",ze=E(Zr,[["__scopeId","data-v-3edae6ea"]]),Qr={WidgetButton:pt,WidgetMultiButton:ze},eo={Icon:T},B=new class{constructor(){this.store=r.reactive([])}add(e,n,{children:o,timeout:s=10,click:i=()=>{}}={}){const c=new to(e,n,s,o||[],i);return this.store.push(c),s&&setTimeout(this.remove.bind(this,c.id),s*1e3),c}remove(e){const n=this.store.findIndex(o=>o.id===e);if(n===-1)return!1;this.store.splice(n,1)}removeChild(e,n){throw new Error("Removing children error.")}},ft=class sn{constructor(e,n,o,s,i){this.type=e,this.msg=n,this.timeout=o,this.children=s,this.click=i,this.id=sn.cardId++}};ft.cardId=1;let to=ft;const no={class:"widget-error"},ro={class:"widget-error-wrap"},oo={class:"widget-error-main"},so={class:"widget-error-text widget-error-message"},io={class:"widget-error__container-close"},ao=r.defineComponent({__name:"WidgetError",props:{isGroup:{type:Boolean},message:{}},emits:["close","toggle"],setup(t,{emit:e}){return(n,o)=>(r.openBlock(),r.createElementBlock("div",no,[r.createElementVNode("div",ro,[r.createElementVNode("div",oo,[r.createElementVNode("p",so,r.toDisplayString(n.message),1)]),n.isGroup?(r.openBlock(),r.createElementBlock("p",{key:0,onClick:o[0]||(o[0]=s=>e("toggle")),class:"article-details"},"See details")):r.createCommentVNode("",!0),r.createElementVNode("div",io,[r.createElementVNode("div",{class:"widget-error-close",onClick:o[1]||(o[1]=s=>e("close"))})])])]))}}),Ha="",mt=E(ao,[["__scopeId","data-v-8a0a0924"]]),lo={key:0,class:"widget-error-details"},co=r.defineComponent({__name:"WidgetErrorGroup",props:{card:{}},emits:["closeCard","closeChild"],setup(t,{emit:e}){const n=t,o=r.computed(()=>{var i;return!!((i=n.card.children)!=null&&i.length)}),s=r.ref(!0);return(i,c)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createBlock(mt,{message:i.card.msg,key:i.card.id,onClose:c[0]||(c[0]=l=>e("closeCard",i.card.id)),onToggle:c[1]||(c[1]=l=>s.value=!s.value),"is-group":o.value},null,8,["message","is-group"])),!s.value&&i.card.children?(r.openBlock(),r.createElementBlock("div",lo,[r.createVNode(r.TransitionGroup,{name:"fade"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.card.children,l=>(r.openBlock(),r.createBlock(mt,{key:l.id,message:l.msg,onClose:a=>e("closeChild",l.id)},null,8,["message","onClose"]))),128))]),_:1})])):r.createCommentVNode("",!0)]))}}),Ja="",uo=E(co,[["__scopeId","data-v-aa732044"]]),po={class:"container-errors"},fo=r.defineComponent({__name:"WidgetNotificationSystem",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",po,[r.createVNode(r.TransitionGroup,{name:"fade"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(B).store,o=>(r.openBlock(),r.createBlock(uo,{key:o.id,card:o,onCloseCard:s=>r.unref(B).remove(o.id),onCloseChild:s=>r.unref(B).removeChild(o.id,s)},null,8,["card","onCloseCard","onCloseChild"]))),128))]),_:1})]))}}),xa="",ht=E(fo,[["__scopeId","data-v-8e9870dd"]]);let mo={inputs:lr,forms:Br,containers:jr,buttons:Qr,icons:eo,errorSystem:{default:ht}};const ho={inputs:cn};function re(t,e){if(typeof t!="object"||t===null)return;if(e in t)return t[e];let n=e.indexOf(".");if(n>-1){const o=e.substring(0,n);return o in t?re(t[o],e.substr(n+1)):void 0}return t[e]}function Ge(t){return t.reduce((e,n)=>e.then(o=>n==null?void 0:n(o)),Promise.resolve())}const gt=class $ extends Error{constructor(e,n=null){super(),this.message=e,this.details=n,this.id=$.ID++}static ParentFormNotFound(){return new $("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new $("Composite object name is undefined",e)}static EntityWithoutName(e){return new $("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new $(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new $("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new $("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new $(`${e} (id) is not a number`)}static UndefinedErrorId(e,n){return $.ApiNotAvailable()}static ApiError(e){return new $("Request error",e)}static ApiNotAvailable(){return new $(`Sorry, we experience difficulties here.
|
|
5
|
+
*/const Ea="",C=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},T=C({props:{name:String},setup(t,e){let n="unknown";try{n=e.slots.default()[0].children}catch{n=t.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>r.h("i",{class:`icon icon-${n}`})}},[["__scopeId","data-v-0d979509"]]);function ln(t,e){return!!t&&t===e||"password is not equal"}function we(t){return Number(t.replace(/[^0-9.]/g,""))}function qe(t,e=null){let o=String(we(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 cn=Object.freeze(Object.defineProperty({__proto__:null,numeric:we,prettyNumeric:qe,validPassword:ln},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(n=>n.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 n=t[e](this.value);if(n!==!0)return this.setError(n),!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}}},Ce={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"}}},dn=Object.freeze(Object.defineProperty({__proto__:null,MixinInput:H,MixinInputPassword:{props:{password:{type:Boolean,default:()=>!1}},data:()=>({isPasswordVisible:!1}),methods:{togglePasswordVisible(t=!this.isPasswordVisible){this.isPasswordVisible=t}}},MixinInputText:Ce},Symbol.toStringTag,{value:"Module"})),$a="";function Ee(t,e=[]){let n=t;return e.forEach(o=>{n=o(n)}),n}const un={components:{Icon:T},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(we),t},arrayInputPrettyModifiers(){let t=[];return this.prettyNumeric&&t.push(qe),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:[H,Ce],name:"InputText"},pn={class:"input-wrap"},fn={key:0,class:"input-title"},mn={key:0,class:"input-title_required"},hn=["disabled","error"],gn=["type","placeholder","disabled","error","value"],_n={key:1,class:"input-text__error text_sm"};function yn(t,e,n,o,s,i){const c=r.resolveComponent("icon");return r.openBlock(),r.createElementBlock("div",pn,[t.title?(r.openBlock(),r.createElementBlock("p",fn,[r.createTextVNode(r.toDisplayString(t.title)+" ",1),t.required?(r.openBlock(),r.createElementBlock("span",mn,"*")):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"input-text-container input_size_md flex",disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage},[r.createElementVNode("input",{class:"input-text",type:t.inputType,placeholder:t.placeholder,disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage,ref:"input",value:n.pretty(t.value),onInput:e[0]||(e[0]=(...a)=>i.onInput&&i.onInput(...a))},null,40,gn),t.password?(r.openBlock(),r.createElementBlock("div",{key:0,class:"input-text__password",onClick:e[1]||(e[1]=a=>t.togglePasswordVisible())},[r.createVNode(c,{class:"cursor_pointer",name:t.isPasswordVisible?"eye-crossed":"eye"},null,8,["name"])])):r.createCommentVNode("",!0),t.errorMessage?(r.openBlock(),r.createElementBlock("p",_n,r.toDisplayString(t.errorMessage),1)):r.createCommentVNode("",!0)],8,hn)])}const wn=C(un,[["render",yn],["__scopeId","data-v-65e2ee2d"]]),Sa="",Cn={mixins:[H],name:"InputToggle"};function En(t,e,n,o,s,i){return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["input__toggle widget-input",{active:t.value,disabled:t.disabled||t.isInsideDisabled}]),onClick:e[0]||(e[0]=c=>t.input(!t.value))},null,2)}const kn=C(Cn,[["render",En],["__scopeId","data-v-56d58611"]]),Na="",bn={props:["isActive","title"],name:"FragmentInputSelectItem"},$n={class:"item-wrap"};function Sn(t,e,n,o,s,i){return r.openBlock(),r.createElementBlock("div",$n,[r.createElementVNode("p",{class:r.normalizeClass(["input-select__item cursor_pointer",{active:n.isActive}])},r.toDisplayString(n.title),3)])}const Nn=C(bn,[["render",Sn],["__scopeId","data-v-69ab8592"]]);function Z(t,e){if(!t)return console.warn("Element is not provided.");function n(s,i){return s==i.target||s.contains(i.target)}const o=s=>{n(t,s)||(e(),window.removeEventListener("click",o))};window.addEventListener("click",o)}const Ta="",Tn={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:T,FragmentInputSelectItem:Nn},mixins:[H],name:"InputSelect"},Bn={class:"input-wrap"},In={key:0,class:"input-title"},Vn={key:0,class:"color__text_red"},An={class:"input-select-container__current input_size_md flex"},Fn={key:0,class:"input-select-value"},Pn={key:1,class:"current-placeholder text_md"},On={class:"input-select-list input-select-container__list"},Ln={key:0,class:"input-text__error position_absolute margin-0 text_sm color__text_red"};function Dn(t,e,n,o,s,i){const c=r.resolveComponent("icon"),a=r.resolveComponent("fragment-input-select-item");return r.openBlock(),r.createElementBlock("div",Bn,[t.title?(r.openBlock(),r.createElementBlock("p",In,[r.createTextVNode(r.toDisplayString(t.title)+" ",1),t.required?(r.openBlock(),r.createElementBlock("span",Vn,"*")):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["input-select-container cursor_pointer",{active:t.isActive,disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage}]),onClick:e[1]||(e[1]=l=>i.active()),ref:"input"},[r.createElementVNode("div",An,[t.value===void 0||t.value===null?(r.openBlock(),r.createElementBlock("span",Pn,r.toDisplayString(t.placeholder),1)):(r.openBlock(),r.createElementBlock("p",Fn,r.toDisplayString(i.titleValue),1)),t.disabled||t.isInsideDisabled?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(c,{key:2,class:"input-select__ico-toggle",name:"caret-down"}))]),r.createElementVNode("div",On,[t.value?(r.openBlock(),r.createBlock(a,{key:0,onClick:e[0]||(e[0]=l=>t.input(null))})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.arrayParse,(l,u)=>(r.openBlock(),r.createBlock(a,{class:"input-select-list__item",key:u,"is-active":l.value===t.value,title:l.title,onClick:d=>t.input(l.value)},null,8,["is-active","title","onClick"]))),128))]),t.errorMessage?(r.openBlock(),r.createElementBlock("p",Ln,r.toDisplayString(t.errorMessage),1)):r.createCommentVNode("",!0)],2)])}const Rn=C(Tn,[["render",Dn],["__scopeId","data-v-c4acd469"]]);class ut{static async upload(e,n){const o=new FormData;o.append("file",e);const s=`/close-api/files?entityName=${n}`;return await fetch(s,{method:"POST",body:o}).then(i=>i.json()).then(i=>(i.filename=e.name,i))}}function ke(t=()=>null){console.warn("ProcessWrap deprecated! Use AsyncWrap");let e=t;const n=r.reactive({wait:!1,error:!1,ready:!1});return n.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},n.setFunction=async function(o){e=o},n}const Ba="",Wn=r.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 ut.upload(t,this.entityName);this.$emit("load",e),this.name&&this.input(e.id)}},mixins:[H],components:{Icon:T}}),Mn={class:"container-input-file"},vn={key:0,class:"process-info input-file__wait text_size_sm"},Un={key:1,class:"process-info input-file__error text_size_sm text_error"};function jn(t,e,n,o,s,i){const c=r.resolveComponent("icon");return r.openBlock(),r.createElementBlock("div",Mn,[r.createVNode(c,{name:"plus",class:"icon__file-upload"}),r.createElementVNode("input",{type:"file",class:"input-file",onChange:e[0]||(e[0]=a=>t.onChange(a.target.files[0]))},null,32),t.pw.wait?(r.openBlock(),r.createElementBlock("p",vn,"Loading...")):r.createCommentVNode("",!0),t.pw.error?(r.openBlock(),r.createElementBlock("p",Un,"Error load file")):r.createCommentVNode("",!0)])}const qn={InputText:wn,InputToggle:kn,InputSelect:Rn,InputLoadFile:C(Wn,[["render",jn],["__scopeId","data-v-bdbf1475"]])},Va="",zn={props:{placeholder:String,error:[Boolean,String]},setup(){return{}},name:"WidgetInputContainer"},Gn=t=>(r.pushScopeId("data-v-1e3f1057"),t=t(),r.popScopeId(),t),Hn={class:"widget-input__container"},Jn={class:"input-container__content"},Kn=Gn(()=>r.createElementVNode("div",{class:"widget-input__underline"},null,-1));function Yn(t,e,n,o,s,i){return r.openBlock(),r.createElementBlock("div",Hn,[r.createElementVNode("div",Jn,[r.renderSlot(t.$slots,"default",{},void 0,!0)]),Kn,n.placeholder?(r.openBlock(),r.createElementBlock("p",{key:0,class:r.normalizeClass(["widget-input__placeholder",{"widget-input__placeholder_error":n.error}])},r.toDisplayString(n.placeholder),3)):r.createCommentVNode("",!0)])}const xn=C(zn,[["render",Yn],["__scopeId","data-v-1e3f1057"]]),Aa="",Xn={components:{Icon:T,WidgetInputContainer:xn},mixins:[H,Ce],name:"InputText"},Zn=["type","value"];function Qn(t,e,n,o,s,i){const c=r.resolveComponent("icon"),a=r.resolveComponent("widget-input-container");return r.openBlock(),r.createBlock(a,{placeholder:t.placeholder,error:!!t.errorMessage},{default:r.withCtx(()=>[r.createElementVNode("input",{type:t.password&&!t.isPasswordVisible?"password":"text",class:"input-text title_sm",value:t.value,onChange:e[0]||(e[0]=l=>t.input(l.target.value)),onKeyup:e[1]||(e[1]=r.withKeys(l=>t.$emit("enter"),["enter"]))},null,40,Zn),t.password?(r.openBlock(),r.createElementBlock("div",{key:0,class:"input-text__password",onClick:e[2]||(e[2]=l=>t.togglePasswordVisible())},[r.createVNode(c,{class:"cursor_pointer",name:t.isPasswordVisible?"eye-crossed":"eye"},null,8,["name"])])):r.createCommentVNode("",!0)]),_:1},8,["placeholder","error"])}const er={InputText:C(Xn,[["render",Qn],["__scopeId","data-v-212b50e2"]])},Pa="";function be(t,e=[]){let n=t;return e.forEach(o=>{n=o(n)}),n}const tr=r.defineComponent({components:{Icon:T},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(we),t},arrayInputPrettyModifiers(){let t=[];return this.prettyNumeric&&t.push(qe),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:[H,Ce],name:"InputText"}),nr={key:0,class:"input-title"},rr={key:0,class:"color__text_red"},or=["disabled","error"],sr=["type","placeholder","disabled","error","value"],ir={key:1,class:"input-text__error text_sm color__text_red"};function ar(t,e,n,o,s,i){const c=r.resolveComponent("icon");return r.openBlock(),r.createElementBlock(r.Fragment,null,[t.title?(r.openBlock(),r.createElementBlock("p",nr,[r.createTextVNode(r.toDisplayString(t.title)+" ",1),t.required?(r.openBlock(),r.createElementBlock("span",rr,"*")):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"input-text-container flex",disabled:t.disabled||t.isInsideDisabled,error:!!t.errorMessage},[r.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,sr),t.password?(r.openBlock(),r.createElementBlock("div",{key:0,class:"input-text__password",onClick:e[1]||(e[1]=a=>t.togglePasswordVisible())},[r.createVNode(c,{class:"cursor_pointer",name:t.isPasswordVisible?"eye-crossed":"eye"},null,8,["name"])])):r.createCommentVNode("",!0),t.errorMessage?(r.openBlock(),r.createElementBlock("p",ir,r.toDisplayString(t.errorMessage),1)):r.createCommentVNode("",!0)],8,or)],64)}const lr={default:qn,line:er,naomi:{InputText:C(tr,[["render",ar],["__scopeId","data-v-9c3e5ea6"]])}},Da="",cr={components:{Icon:T},props:{title:String,values:[Object,Array,String]},setup(t){Array.isArray(t.values)&&t.values.forEach(c=>{c.func&&console.warn("Prop func is deprecated. Use callback.",c)});const e=r.computed(()=>{if(!o.value)return"30px";let c=0;return Array.isArray(t.values)&&(c+=t.values.length),t.title&&c++,typeof t.values=="string"&&!Array.isArray(t.values)&&c++,c*30+"px"}),n=r.computed(()=>Array.isArray(t.values)?t.values:typeof t.values=="string"?{title:t.values}:[t.values]),o=r.ref(!1);function s(c=!o.value){o.value=c,c&&Z(i.value,()=>s(!1))}const i=r.ref(null);return{isActive:o,array:n,toggle:s,button:i,maxHeight:e}},name:"Button"},dr={class:"widget-button-wrap flex"},ur=["onClick"];function pr(t,e,n,o,s,i){const c=r.resolveComponent("icon");return r.openBlock(),r.createElementBlock("div",dr,[r.createElementVNode("div",{class:r.normalizeClass(["widget-button flex",{active:o.isActive}]),ref:"button"},[r.createElementVNode("div",{class:"widget-button__list flex_column",style:r.normalizeStyle({maxHeight:o.maxHeight})},[n.title?(r.openBlock(),r.createElementBlock("span",{key:0,class:"widget-button__list-elem cursor_pointer",onClick:e[0]||(e[0]=a=>o.toggle())},r.toDisplayString(n.title),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.array,(a,l)=>(r.openBlock(),r.createElementBlock("span",{class:"widget-button__list-elem cursor_pointer",onClick:u=>(a.callback(),o.toggle(!1)),key:l},r.toDisplayString(a.title),9,ur))),128))],4),o.array.length>1?(r.openBlock(),r.createElementBlock("div",{key:0,class:"widget-button__toggle flex flex_center cursor_pointer",onClick:e[1]||(e[1]=r.withModifiers(a=>o.toggle(),["stop"]))},[r.createVNode(c,{class:"widget-button__toggle-icon",name:"angle-small-down"})])):r.createCommentVNode("",!0)],2)])}const fr=C(cr,[["render",pr],["__scopeId","data-v-b6be5c12"]]),Ra="",mr={props:{icon:String,func:Function},name:"WidgetFormFunctionItem",components:{Icon:T}};function hr(t,e,n,o,s,i){const c=r.resolveComponent("icon");return r.openBlock(),r.createElementBlock("div",{class:"function-item cursor_pointer",onClick:e[0]||(e[0]=(...a)=>n.func&&n.func(...a))},[r.createVNode(c,{name:n.icon},null,8,["name"])])}const gr=C(mr,[["render",hr],["__scopeId","data-v-73f7eb9f"]]),Wa="",_r={props:{title:String},name:"WidgetFormTitle"},yr={class:"form-title"},wr={class:"title_lg color__text_black margin-0"};function Cr(t,e,n,o,s,i){return r.openBlock(),r.createElementBlock("div",yr,[r.createElementVNode("h2",wr,r.toDisplayString(n.title),1)])}const Er=C(_r,[["render",Cr],["__scopeId","data-v-c91ffa31"]]),Ma="",kr={components:{WidgetFormTitle:Er,WidgetFormFunctionItem:gr,WidgetButton:fr},props:{title:String,button:{type:[Array,Object],default:()=>[]},functions:[Array]},name:"WidgetForm"},br={class:"widget-form flex_column"},$r={class:"widget-form__head flex"},Sr={class:"widget-form__head-functions flex"},Nr={class:"widget-form__body"};function Tr(t,e,n,o,s,i){const c=r.resolveComponent("widget-form-title"),a=r.resolveComponent("widget-button"),l=r.resolveComponent("widget-form-function-item");return r.openBlock(),r.createElementBlock("div",br,[r.createElementVNode("div",$r,[r.createVNode(c,{title:n.title},null,8,["title"]),Array.isArray(n.button)&&n.button.length||!Array.isArray(n.button)&&n.button?(r.openBlock(),r.createBlock(a,{key:0,class:"widget-form__head-button",values:n.button},null,8,["values"])):r.createCommentVNode("",!0),r.createElementVNode("div",Sr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.functions,(u,d)=>(r.openBlock(),r.createBlock(l,{key:d,icon:u.icon,func:u.callback},null,8,["icon","func"]))),128))])]),r.createElementVNode("div",Nr,[r.renderSlot(t.$slots,"default",{},void 0,!0)])])}const Br={default:{WidgetForm:C(kr,[["render",Tr],["__scopeId","data-v-c3e88e10"]])}},Ua="",Ir={props:{title:String,subTitle:String,type:[String,Number],double:{type:Boolean,default:()=>!1}},name:"ContainerFormElem"},Vr={class:"form-container-item__title flex"},Ar={class:""},Fr={key:0,class:""},Pr={class:"title_sm"},Or={key:1,class:"form-container-item__right"};function Lr(t,e,n,o,s,i){return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["form-container-item flex",[`form-container-item-${n.type}`]])},[r.createElementVNode("div",Vr,[r.createElementVNode("span",Ar,r.toDisplayString(n.title),1)]),r.createElementVNode("div",{class:r.normalizeClass(["form-container-item-center flex_column",{content_double:n.double}])},[r.renderSlot(t.$slots,"default",{},void 0,!0)],2),n.subTitle?(r.openBlock(),r.createElementBlock("div",Fr,[r.createElementVNode("span",Pr,r.toDisplayString(n.subTitle),1),r.renderSlot(t.$slots,"centerRight",{},void 0,!0)])):r.createCommentVNode("",!0),t.$slots.right?(r.openBlock(),r.createElementBlock("div",Or,[r.renderSlot(t.$slots,"right",{},void 0,!0)])):r.createCommentVNode("",!0)],2)}const Dr=C(Ir,[["render",Lr],["__scopeId","data-v-9264f6f4"]]),ja="",Rr={name:"ContainerAuthView"},Wr={class:"container-auth-wrap"},Mr={class:"container-auth-sidebar"},vr={class:"container-auth-main"};function Ur(t,e,n,o,s,i){return r.openBlock(),r.createElementBlock("div",Wr,[r.createElementVNode("div",Mr,[r.renderSlot(t.$slots,"side",{},void 0,!0)]),r.createElementVNode("div",vr,[r.renderSlot(t.$slots,"default",{},void 0,!0)])])}const jr={ContainerFormElem:Dr,ContainerAuthView:C(Rr,[["render",Ur],["__scopeId","data-v-0b1a5e81"]])},qr=r.defineComponent({__name:"widget-spinner",props:{color:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:"loader",style:r.normalizeStyle({"border-left":`1.1em solid ${e.color?e.color:"#fff"}`})},null,4))}}),za="",Q=C(qr,[["__scopeId","data-v-661e0416"]]),zr={class:"button-element"},Gr=r.defineComponent({__name:"WidgetButton",props:{title:{},callback:{type:Function},wait:{type:Boolean},default:{type:Boolean}},setup(t){const e=t;function n(s){s.key==="Enter"&&o.call()}r.onMounted(()=>{e.default&&document.addEventListener("keypress",n)}),r.onUnmounted(()=>{document.removeEventListener("keypress",n)});const o=ke(e.callback);return(s,i)=>(r.openBlock(),r.createElementBlock("div",{class:"button-wrap",onClick:i[0]||(i[0]=c=>r.unref(o).call())},[r.unref(o).wait||s.wait?(r.openBlock(),r.createBlock(Q,{key:0,class:"button-spinner"})):r.createCommentVNode("",!0),r.createElementVNode("button",zr,[r.createTextVNode(r.toDisplayString(s.title)+" ",1),r.renderSlot(s.$slots,"default",{},void 0,!0)])]))}}),Ga="",pt=C(Gr,[["__scopeId","data-v-3cf452e1"]]),Hr={class:"widget-button-wrap"},Jr={class:"widget-multi-button"},Kr={class:"widget-button-list"},Yr=["onClick"],xr={class:"button__side"},Xr={key:0,class:"button__size-progress"},Zr=r.defineComponent({__name:"WidgetMultiButton",props:{title:{},array:{}},setup(t){const e=ke(),n=r.reactive({active:!1});function o(i=!n.active){n.active=i}function s(i){e.setFunction(i),e.call()}return(i,c)=>(r.openBlock(),r.createElementBlock("div",Hr,[r.createElementVNode("div",Jr,[r.createElementVNode("div",{class:r.normalizeClass(["button__content",{button__content_active:n.active}])},[i.title?(r.openBlock(),r.createElementBlock("p",{key:0,class:"button__content-title widget-multi-button-row",onClick:c[0]||(c[0]=a=>o())},r.toDisplayString(i.title),1)):r.createCommentVNode("",!0),r.createElementVNode("div",Kr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.array,(a,l)=>(r.openBlock(),r.createElementBlock("p",{class:"button__content-title widget-multi-button-row",key:l,onClick:u=>(s(a.callback),o(!1))},r.toDisplayString(a.title),9,Yr))),128))])],2),r.createElementVNode("div",xr,[r.unref(e).wait?(r.openBlock(),r.createElementBlock("div",Xr,[r.createVNode(Q,{class:"button-spinner"})])):i.array&&i.array.length>1?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["button__size-toggle widget-multi-button-toggle",{button__toggle_active:n.active}]),onClick:c[1]||(c[1]=a=>o())},[r.createVNode(T,{class:"button__toggle-icon",name:"angle-small-down"})],2)):r.createCommentVNode("",!0)])])]))}}),Ha="",ze=C(Zr,[["__scopeId","data-v-3edae6ea"]]),Qr={WidgetButton:pt,WidgetMultiButton:ze},eo={Icon:T},B=new class{constructor(){this.store=r.reactive([])}add(e,n,{children:o,timeout:s=10,click:i=()=>{}}={}){const c=new to(e,n,s,o||[],i);return this.store.push(c),s&&setTimeout(this.remove.bind(this,c.id),s*1e3),c}remove(e){const n=this.store.findIndex(o=>o.id===e);if(n===-1)return!1;this.store.splice(n,1)}removeChild(e,n){throw new Error("Removing children error.")}},ft=class sn{constructor(e,n,o,s,i){this.type=e,this.msg=n,this.timeout=o,this.children=s,this.click=i,this.id=sn.cardId++}};ft.cardId=1;let to=ft;const no={class:"widget-error"},ro={class:"widget-error-wrap"},oo={class:"widget-error-main"},so={class:"widget-error-text widget-error-message"},io={class:"widget-error__container-close"},ao=r.defineComponent({__name:"WidgetError",props:{isGroup:{type:Boolean},message:{}},emits:["close","toggle"],setup(t,{emit:e}){return(n,o)=>(r.openBlock(),r.createElementBlock("div",no,[r.createElementVNode("div",ro,[r.createElementVNode("div",oo,[r.createElementVNode("p",so,r.toDisplayString(n.message),1)]),n.isGroup?(r.openBlock(),r.createElementBlock("p",{key:0,onClick:o[0]||(o[0]=s=>e("toggle")),class:"article-details"},"See details")):r.createCommentVNode("",!0),r.createElementVNode("div",io,[r.createElementVNode("div",{class:"widget-error-close",onClick:o[1]||(o[1]=s=>e("close"))})])])]))}}),Ja="",mt=C(ao,[["__scopeId","data-v-8a0a0924"]]),lo={key:0,class:"widget-error-details"},co=r.defineComponent({__name:"WidgetErrorGroup",props:{card:{}},emits:["closeCard","closeChild"],setup(t,{emit:e}){const n=t,o=r.computed(()=>{var i;return!!((i=n.card.children)!=null&&i.length)}),s=r.ref(!0);return(i,c)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createBlock(mt,{message:i.card.msg,key:i.card.id,onClose:c[0]||(c[0]=a=>e("closeCard",i.card.id)),onToggle:c[1]||(c[1]=a=>s.value=!s.value),"is-group":o.value},null,8,["message","is-group"])),!s.value&&i.card.children?(r.openBlock(),r.createElementBlock("div",lo,[r.createVNode(r.TransitionGroup,{name:"fade"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.card.children,a=>(r.openBlock(),r.createBlock(mt,{key:a.id,message:a.msg,onClose:l=>e("closeChild",a.id)},null,8,["message","onClose"]))),128))]),_:1})])):r.createCommentVNode("",!0)]))}}),Ka="",uo=C(co,[["__scopeId","data-v-aa732044"]]),po={class:"container-errors"},fo=r.defineComponent({__name:"WidgetNotificationSystem",setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",po,[r.createVNode(r.TransitionGroup,{name:"fade"},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(B).store,o=>(r.openBlock(),r.createBlock(uo,{key:o.id,card:o,onCloseCard:s=>r.unref(B).remove(o.id),onCloseChild:s=>r.unref(B).removeChild(o.id,s)},null,8,["card","onCloseCard","onCloseChild"]))),128))]),_:1})]))}}),Ya="",ht=C(fo,[["__scopeId","data-v-8e9870dd"]]);let mo={inputs:lr,forms:Br,containers:jr,buttons:Qr,icons:eo,errorSystem:{default:ht}};const ho={inputs:cn};function re(t,e){if(typeof t!="object"||t===null)return;if(e in t)return t[e];let n=e.indexOf(".");if(n>-1){const o=e.substring(0,n);return o in t?re(t[o],e.substr(n+1)):void 0}return t[e]}function Ge(t){return t.reduce((e,n)=>e.then(o=>n==null?void 0:n(o)),Promise.resolve())}const gt=class $ extends Error{constructor(e,n=null){super(),this.message=e,this.details=n,this.id=$.ID++}static ParentFormNotFound(){return new $("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new $("Composite object name is undefined",e)}static EntityWithoutName(e){return new $("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new $(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new $("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new $("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new $(`${e} (id) is not a number`)}static UndefinedErrorId(e,n){return $.ApiNotAvailable()}static ApiError(e){return new $("Request error",e)}static ApiNotAvailable(){return new $(`Sorry, we experience difficulties here.
|
|
6
6
|
Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,n){return!e&&!n?$.ApiNotAvailable():new $(e||"Authorization Error",n)}static ApiResponseParseFailed(){return $.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new $("Object doesn't have id",e)}static ObjectWithIdNotFound(e,n){return new $(`Can't find object with id: ${e}`,n)}static ObjectWithoutConnectToPresentArray(e,n){return new $("Object is not found.",{object:e,array:n})}static EntityWithoutId(e){return new $("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,n){return new $(`Can't find the element with tableIndex ${e}`,n)}static UndefinedError(e,n=[]){return new $(e,n)}static TableArrayAlreadyIncludeProvidedIndexValue(e,n,o){return new $(`Array already includes the element with value ${e}`,{array:n,table:o})}static MetadataEntityIsNotAvailable(e){return new $(`Metadata for the ${e} is not currently available.`)}};gt.ID=0;let A=gt;const _t="Please try again later or submit a feedback if problem doesn't go.";function oe(t){return typeof t=="string"?He(t):go(t)?He(t.message):He(_t)}function go(t){return!!(typeof t=="object"&&Object.hasOwnProperty.call(t,"message")&&t!==null)}function He(t,e=[]){return{message:t,details:e}}class yt{static getClientData(){return w("/close-api/client-content")}static getNavigation(){return w("/close-api/client/navigation")}}/*!
|
|
7
7
|
* jenesius-event-emitter v1.0.2
|
|
8
8
|
* (c) 2022 Jenesius
|
|
9
9
|
* @license MIT
|
|
10
|
-
*/const wt=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},Et=function(t,e){t in this.events&&this.events[t].forEach(n=>n(e))},Ct=function(t,e){const n=this.events[t];if(!n)return;const o=n.indexOf(e);o!==-1&&n.splice(o,1)},kt=function(){this.events={}};class O{constructor(){this.events={}}on(e,n){return wt.call(this,e,n)}emit(e,n){return Et.call(this,e,n)}off(e,n){return Ct.call(this,e,n)}cleanEvents(){kt.call(this)}static on(e,n){return wt.call(O,e,n)}static emit(e,n){return Et.call(O,e,n)}static off(e,n){return Ct.call(O,e,n)}static cleanEvents(){kt.call(O)}}O.events={};var bt=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},$e=(t,e,n)=>(bt(t,e,"read from private field"),n?n.call(t):e.get(t)),Je=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},xe=(t,e,n,o)=>(bt(t,e,"write to private field"),o?o.call(t,n):e.set(t,n),n),se,Se,Ne;const J=class R extends O{constructor(){super(...arguments),Je(this,se,void 0),Je(this,Se,"front"),this.organizations=[],Je(this,Ne,!1)}set language(e){localStorage.setItem(R.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(R.LOCALSTORAGE_LANGUAGE_KEY)||R.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(R.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,se,e)}get router(){if(!$e(this,se))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return $e(this,se)}set type(e){xe(this,Se,e)}get type(){return $e(this,Se)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){xe(this,Ne,e),this.emit(R.EVENT_READY_UPDATE,e)}get ready(){return $e(this,Ne)}onReady(e){return this.on(R.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(R.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(R.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(R.CURRENT_CONTEXT_KEY,String(e)),this.emit(R.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(n=>n.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const n=Number.parseInt(localStorage.getItem(R.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(n)&&this.validateContextId(Number(n))?this.setCurrentContext(n):this.setCurrentContext(Number(e.id))}catch{B.add("error",A.ApiNotAvailable().message)}}loadCustomerData(){return yt.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var n;return((n=this.person)==null?void 0:n.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 n=localStorage.getItem(this.getListKeyById(e));return n&&JSON.parse(n)}setListInformationToLocalStorage(e,n){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(n))}};se=new WeakMap,Se=new WeakMap,Ne=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 $t=J;const C=new $t;function _o(){const t=r.reactive({contextType:C.contextType,contextId:C.contextId,context:C.context});return C.onupdateContext(()=>{t.contextType=C.contextType,t.contextId=C.contextId,t.context=C.context}),t}function yo(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return _t}})}function w(t,e={}){return C.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=C.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw A.ApiNotAvailable()}).then(n=>yo(n).then(o=>{if(!n.ok)throw o;return o}))}class Te{constructor(){}static parseNamesFromListConfig(e){let n=Te.parseFieldsToGraphQL(e.reduce((s,i)=>(i.name&&s.push(i.name),s),[]));function o(s){let i="";for(let c in s)typeof s[c]=="boolean"?i+=` ${c} `:i+=` ${c} { ${o(s[c])} }`;return i}return o(n)}static parseSortFromListConfig(e){let n={};for(let o in e)n[o]=e[o]?"ASC":"DESC";return n}static parseFieldsToGraphQL(e){function n(o,s){if(s.includes(".")){const i=s.indexOf("."),c=s.substring(i+1),l=s.substring(0,i);l in o||(o[l]={}),n(o[l],c)}else o[s]=!0;return o}return e.reduce(n,{})}}class wo{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,n,o)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),e[n]=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 St=new wo;function Nt(t){return t&&t[0].toLowerCase()+t.slice(1)}const Ya="",Eo={props:{message:String},name:"ModalWait",components:{WidgetSpinner:Q}},Co={class:"modal__wait modal-default flex_column"};function ko(t,e,n,o,s,i){const c=r.resolveComponent("widget-spinner");return r.openBlock(),r.createElementBlock("div",Co,[r.createVNode(c),r.createElementVNode("p",null,r.toDisplayString(n.message),1)])}const bo=E(Eo,[["render",ko],["__scopeId","data-v-4d18289e"]]),$o={error:!0,wait:!1,throw:!0};async function Be(t,e={}){const n={modalWait:null};e=Object.assign({},e,$o);try{e.wait&&(n.modalWait=await lt.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=A.UndefinedError(s)),e.error&&(console.log(s,s.details),s instanceof A?B.add("error",s.message,{children:s.details||[],timeout:12}):s!=null&&s.message?B.add("error",s.message):(console.warn(s),B.add("error",A.ApiResponseParseFailed().message))),e.throw)throw s}).finally(()=>{var o;(o=n.modalWait)==null||o.close()})}function Ie(t){return Object.keys(t).reduce((e,n)=>{let o=t[n];const s=n.charAt(0).toUpperCase()+n.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=Ie(o)),e[s]=o,e},{})}function Tt(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 ie={Request:w,clickOutside:Z,getPropFromObject:re,runPromiseQueue:Ge,GraphQL:Te,firstChapterToLowerCase:Nt,requestHandler:Be,valuesToUpperCase:Ie,prettyMoney:Tt},So=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Te,Journal:St,Request:w,clickOutside:Z,default:ie,firstChapterToLowerCase:Nt,getPropFromObject:re,requestHandler:Be,runPromiseQueue:Ge,valuesToUpperCase:Ie},Symbol.toStringTag,{value:"Module"}));function Bt(t,e=""){for(let n in t){if(typeof t[n]=="object"){Bt(t[n],(e.length?`${e}-`:"")+n);continue}let o="--"+((e.length?`${e}-`:"")+n).replace(/([A-Z])/g,s=>`-${s}`.toLowerCase());document.documentElement.style.setProperty(o,t[n])}}const M={};function No(t){for(let e in t)M[e]=t[e];t.styles&&Bt(t.styles),St.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=M}const To=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 Io="masterId",Vo="masterEntity";function Ve(t,e){if(!Array.isArray(e))return;if(Bo(e))return n(e);e.forEach(n);function n(o){t.append(Vo,o[0]),t.append(Io,o[1].toString())}}class I{static async anonymousGetList(e){return await w(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const n=(s,i)=>o.append(s,i),o=new URLSearchParams;if(e.fields){const s=e.fields;typeof s=="string"?n("fields",s):Array.isArray(s)?n("fields",s.join(" ")):typeof s=="object"&&n("fields",Object.keys(s).join(" "))}if(e.order){let s=e.order;const c=(Array.isArray(s)?[s]:Object.entries(s)).map(([l,a="desc"])=>`@${l} ${a}`).join(",");n("order",c)}return e.limit&&n("limit",e.limit.toString()),e.offset&&n("offset",e.offset.toString()),e.filter&&n("filter",e.filter.toString()),e.useUsageContext&&o.append("useUsageContext",e.useUsageContext.toString()),o}static async getList(e,n){const o=I.getSearchParamsForEntityListRead(n||{});return await w(`/close-api/data/${e}?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,n){const o=I.getSearchParamsForEntityListRead(n||{});return w(`/close-api/data/entities/${e}/count?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,n,o){const s=new URLSearchParams;return Ve(s,o==null?void 0:o.masterEntities),w(`/close-api/data/${e}?${s.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:n})})}static update(e,n,o,s={}){return w(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:o})})}static readById(e,n,o={}){const s=new URLSearchParams;if(o.fields){let i=o.fields;typeof i=="string"&&(i=[i]),s.append("fields",i.join(" "))}return w(`/close-api/data/entities/${e}/id/${n}?${s.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,n,o,s){const i=new URLSearchParams;return Ve(i,s==null?void 0:s.masterEntities),w(`/close-api/data/entities/${e}/id/${n}?${i.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:o,version:s==null?void 0:s.version})})}static removeById(e,n,o){const s=typeof n=="number"?{Id:n}:n;return I.removeByKeys(e,s,o)}static removeByKeys(e,n,o){return w(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:n,version:o})})}}var It=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Ke=(t,e,n)=>(It(t,e,"read from private field"),n?n.call(t):e.get(t)),Vt=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},At=(t,e,n,o)=>(It(t,e,"write to private field"),o?o.call(t,n):e.set(t,n),n),ae,Ae;const Ye=class ne extends O{constructor(e){super(),Vt(this,ae,[]),Vt(this,Ae,!1),this.hashParams="",this.offset=0,this.name=e.name}set wait(e){At(this,Ae,e),this.emit(ne.EVENT_CHANGE_WAIT,e)}get wait(){return Ke(this,Ae)}read(e){var s,i;this.wait=!0;const n={};e.order&&(n.order={[(s=e.order)==null?void 0:s.name]:(i=e.order)==null?void 0:i.duration}),e.fields&&(n.fields=e.fields),e.filter&&(n.filter=e.filter);const o=JSON.stringify(n.order)+JSON.stringify(n.filter);return o!==this.hashParams&&(this.offset=0,this.hashParams=o),e.limit&&(n.limit=e.limit),e.offset&&(n.offset=e.offset||this.offset),I.getList(this.name,n).then(c=>(this.offset===0&&(this.array=[]),this.offset+=n.limit,c)).then(c=>{this.array.push(...c)}).then(()=>this.emit(ne.EVENT_DATA,this.array)).finally(()=>{this.wait=!1})}set array(e){At(this,ae,e),this.emit(ne.EVENT_DATA,this.array)}add(e){Ke(this,ae).push(...e),this.emit(ne.EVENT_DATA,this.array)}get array(){return Ke(this,ae)}static GetFieldNames(e){return e.reduce((n,o)=>(o.name&&(typeof o.name=="string"?n.push(o.name):n.push(...o.name)),n),[])}static getCellInfo(e,n){const o=ne.getCellName(e),s=(()=>{let i=o?re(n,o):null;return i===void 0&&(i=null),e.value?e.value(i,n):i})();return{name:o,value:s}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}};ae=new WeakMap,Ae=new WeakMap,Ye.EVENT_DATA="LIST:DATA",Ye.EVENT_CHANGE_WAIT="LIST:UPDATE-WAIT";let Ft=Ye;const z=Symbol("__ROW_INDEX__");let Xe=class extends Ft{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 n=this.wrapData(e);this.changes.new[n[z]]=n,this.emitChanges()}cleanChanges(){this.changes.new={},this.changes.edit={},this.changes.remove=[],this.emitChanges()}edit(e,n){const o=this.wrapData(n,e);if(this.changes.new[e])return this.changes.new[e]=o,this.emitChanges();this.array.find(s=>s[z]===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(n=>n[z]===e)&&(delete this.changes.edit[e],this.changes.remove.includes(e)||this.changes.remove.push(e),this.emitChanges())}wrapData(e,n){return n===void 0&&!Object.prototype.hasOwnProperty.call(e,z.toString())&&(n=++this.rowIndex),{...e,[z]:n}}emitChanges(){this.emit(k.Form.EVENT_CHANGED,!0)}set array(e){super.array=e.map(n=>this.wrapData(n))}get array(){return super.array}log(e){console.log(`[table] ${e}`)}};Xe.PROVIDE_NAME="table-controller";function Ao(t){const e=r.reactive(t.array);r.provide(Xe.PROVIDE_NAME,t);const n=r.reactive(t.changes);t.on(Ft.EVENT_DATA,c=>e.splice(0,e.length,...c)),t.on(k.Form.EVENT_CHANGED,()=>{n.new=Object.keys(t.changes.new).reduce((c,l)=>{const a=Number(l);return c[a]=t.changes.new[a],c},{})});const o=r.computed(()=>[...e.reduce((c,l)=>{const a=l[z];return t.changes.remove.includes(a)||c.push({...l,...t.changes.edit[a]}),c},[]),...Object.values(n.new)]),s=k.Form.getParentForm();return s==null||s.subscribe(t),{activeRow:r.ref(null),array:o}}function Fo(t,e){t.read=()=>I.getList(t.name,{fields:e==null?void 0:e.fields}).then(n=>t.array=n).then(()=>t.emit(k.Form.EVENT_READ,t.array)),t.save=()=>{const n=t.name;Object.values(t.changes.new).forEach(async s=>{await I.create(n,s)}),Object.entries(t.changes.edit).forEach(async([s,i])=>{await I.updateById(t.name,o(Number(s)),i)});function o(s){const i=t.array.find(c=>c[z]===s);return i.id|i.Id}t.changes.remove.forEach(async s=>{await I.removeById(n,o(s),0)}),t.emit(k.Form.EVENT_SAVE)}}const Xa="",Po=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Oo{static readHistoryById(e,n){return w(`/close-api/audits/history/${e}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(o=>{const s=o.history.map(i=>{if(!i.changes)return i;const c=i.changes.map(l=>({...l,oldValue:l.originalValue,name:l.fieldName}));return{...i,changes:c}});return{...o,history:s}})}}var Pt=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},j=(t,e,n)=>(Pt(t,e,"read from private field"),n?n.call(t):e.get(t)),x=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},K=(t,e,n,o)=>(Pt(t,e,"write to private field"),o?o.call(t,n):e.set(t,n),n),Fe,le,Pe,Oe,ce,de,Ze;const Y="_______LIST_______ROW_______INDEX________NAME_______",ue=class q extends O{constructor(e){super(),this.LIST_ROW_KEY=1,x(this,Fe,void 0),this.array=[],x(this,le,[]),x(this,Pe,[]),x(this,Oe,new Proxy({},{set:(n,o,s,i)=>(n[o]=s,this.emit(q.EVENT_FILTERS_UPDATE,n),!0),deleteProperty:(n,o)=>(delete n[o],this.emit(q.EVENT_FILTERS_UPDATE,n),!0)})),x(this,ce,!1),x(this,de,(...n)=>Promise),x(this,Ze,()=>{}),K(this,Fe,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&K(this,le,e.config)}set config(e){K(this,le,e.map(k.utils.copyObject)),this.emitUpdateConfig()}get config(){return j(this,le)}emitUpdateConfig(){this.emit(q.EVENT_CONFIG_UPDATE,this.config)}get order(){return j(this,Pe)}set order(e){K(this,Pe,e),this.emit(q.EVENT_ORDER_UPDATE,this.order)}get filters(){return j(this,Oe)}set filters(e){Wt(j(this,Oe),e)}set wait(e){K(this,ce,e),this.emit(k.Form.EVENT_WAIT,j(this,ce))}get wait(){return j(this,ce)}get primaryKeys(){return j(this,Fe)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(n=>n[Y]===e)}indexByKey(e){return this.array.findIndex(n=>n[Y]===e)}static getKey(e){return e[Y]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,Y)}add(...e){const n=this.wrapArray(e);this.array.push(...n),this.emit(q.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const n=this.indexByKey(e);n!==-1&&(this.array.splice(n,1),this.emit(q.EVENT_DATA,this.array))}updateByKey(e,n){const o=this.atByKey(e);o&&(Object.assign(o,n),this.emit(q.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[Y]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,Y)}set read(e){K(this,de,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const n=j(this,de).call(this,...e);return this.wait=!0,n}).finally(()=>this.wait=!1)}set save(e){K(this,de,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>j(this,Ze).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((n,o)=>(o.name&&(typeof o.name=="string"?n.push(o.name):n.push(...o.name)),n),[])}static mergeWithKey(e,n){return{...e,[Y]:n}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,n){const o=q.getCellName(e),s=(()=>{let i=o?re(n,o):null;return i===void 0&&(i=null),e.value?e.value(i,n):i})();return{name:o,value:s}}};Fe=new WeakMap,le=new WeakMap,Pe=new WeakMap,Oe=new WeakMap,ce=new WeakMap,de=new WeakMap,Ze=new WeakMap,ue.EVENT_DATA="list-data: update",ue.EVENT_CONFIG_UPDATE="list-config:update",ue.EVENT_ORDER_UPDATE="list-order:update",ue.EVENT_FILTERS_UPDATE="list-filters:update";let v=ue;function Ot(t,e){let n="",o=0,s=!1,i;t.read=(c={})=>{if(t.wait)return i;if(c.clean&&(n="",o=0,s=!1),s)return Promise.resolve([]);let l=e;typeof l=="function"&&(l=l());const a={};if(!t.name)throw new Error("Reading list`s data without name is not available.");l.order&&Array.isArray(l.order)&&l.order.length&&(a.order={[l.order[0]]:l.order[1]||"asc"}),l.fields&&(a.fields=l.fields),l.filter&&(a.filter=l.filter);const u=JSON.stringify(a.order)+JSON.stringify(a.filter)+JSON.stringify(a.fields);return u!==n&&!Number.isNaN(u)&&(o=0,n=u),"limit"in l&&(a.limit=l.limit),a.offset=o||l.offset||0,i=I.getList(t.name,a).then(d=>((o===0||c.clean)&&t.set([]),o+=a.limit,d)).then(d=>(t.add(...d),d.length===0&&(s=!0),d)),i}}function Dt(t){const e=r.reactive({wait:t.wait,array:[]});return t.on(v.EVENT_DATA,n=>{e.array.splice(0,e.array.length,...n.map(o=>Object.freeze(JSON.parse(JSON.stringify(o)))))}),t.on(k.Form.EVENT_WAIT,()=>{e.wait=t.wait}),e}function Lt(t,e){const n="list-flex-config",o=r.inject(n,void 0);if(o)return o;if(!t||!e)throw new Error("Hook useProvideList has two required params: list and defaultSettings");t.on(v.EVENT_CONFIG_UPDATE,()=>{t.read()});const s={list:t,defaultSettings:e};return r.provide(n,s),s}function Do(t){const e=r.reactive([...t.config]);return t.on(v.EVENT_CONFIG_UPDATE,n=>{e.splice(0,e.length,...n)}),e}function Rt(t){const e=t.order||[],n=r.reactive(e);return t.on(v.EVENT_ORDER_UPDATE,o=>{n.splice(0,n.length,...o),t.read()}),n}function Lo(t){const e=r.ref(""),n=r.computed(()=>{const o=e.value.toLowerCase();return r.unref(t).filter(s=>e.value.length?Object.values(s).join().toLowerCase().includes(o):!0)});return{search:e,searchArray:n}}function Wt(t,e){Object.keys(t).forEach(n=>delete t[n]),Object.entries(e).forEach(([n,o])=>{t[n]=o})}function Ro(t){const e=r.reactive(k.utils.copyObject(t.filters));return t.on(v.EVENT_FILTERS_UPDATE,n=>{Wt(e,n),t.read()}),e}function Wo(t){const e=r.reactive([]);function n(l){return e.includes(l)}function o(l){n(l)||e.push(l)}function s(l){const a=e.findIndex(u=>u===l);a!==-1&&e.splice(a,1)}function i(l){const a=r.unref(t);if(l===void 0){e.length===0?a.forEach(o):a.forEach(s);return}n(l)?s(l):o(l)}const c=r.computed(()=>{const l=r.unref(t);return e.length===l.length&&l.length!==0});return[e,i,c,o,s]}class Mo extends v{constructor(e){super(e),this.changes=[],this.save=vo.bind(this)}get changed(){return!!this.changes.find(e=>e.status==="active")}addChange(e,n){this.changes.push({type:e,status:"active",data:this.wrapItem(n)})}}function vo(){const t=this.changes.filter(e=>e.status==="active");return Ge(t.map(e=>{console.log("++")}))}function Uo(){const t=r.ref(null);function e(n){t.value=n&&ct(n)}return{activeRow:t,activateRow:e}}const Za="",jo={props:{config:Array},name:"WidgetTableHead"},qo={class:"widget-table__head"},zo={class:"widget-table__head-title"};function Go(t,e,n,o,s,i){return r.openBlock(),r.createElementBlock("tr",qo,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.config,(c,l)=>(r.openBlock(),r.createElementBlock("th",{class:"widget-table__head-cell",key:l},[r.createElementVNode("p",zo,r.toDisplayString(c.title),1)]))),128))])}const Ho=E(jo,[["render",Go],["__scopeId","data-v-f478f0d8"]]);function Jo(t){return Mt(t,"YYYY/MM/DD HH:mm:ss")}function Mt(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return dt.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const xo=function(){let t=!1;const e=[];function n(){return t}function o(a,u){n()&&console[a](...u),e.push(u)}function s(...a){o("log",a)}function i(...a){o("warn",a)}function c(...a){o("error",a)}function l(a=!0){t=a}return{info:s,warn:i,history:e,display:l,error:c}}();function De(){return xo}function Ko(t,e){const n=t.config.map(o=>Yo(o,t,e));return r.h("tr",{class:"widget-table__row widget-table-row"},n)}function Yo(t,e,n){const o=e.values,s=De();let{name:i,value:c}=v.getCellInfo(t,o);const l={onClick:[],class:["widget-table__cell widget-table-cell"]};function a(m){l.onClick.push(()=>m(o))}function u(m){Array.isArray(m)?l.class.push(...m):l.class.push(m)}const d=[],f=[];if(M.handleListCell)try{M.handleListCell(t,o,e,f)}catch(m){s.error("get-table-row","handle list cell",m)}if(t.hide&&t.hide(o))return[r.h("td")];if(t.type)switch(u(`widget-table-cell_${t.type}`),t.type){case"number":{typeof c=="number"&&(c=new Intl.NumberFormat().format(c));break}case"date":{c=Mt(typeof c=="string"?c:null);break}case"dateTime":case"dateWithTime":{c=Jo(typeof c=="string"?c:null);break}case"multi-select":{f.push(r.h(k.FormField,{type:"single-checkbox",modelValue:e.selected})),a(vt.bind(null,n,!0));break}case"select":{f.push(r.h(k.FormField,{type:"single-radio",modelValue:e.selected})),a(vt.bind(null,n,!1));break}}if(t.checked){const m=t.checked(o);f.push(r.h(k.FormField,{type:"single-checkbox",modelValue:m}))}if(t.onClick&&a(t.onClick),t.link)try{const m=t.link(o);if(m){const h=r.h(je.RouterLink,{to:m});f.push(h),u("list-cell-link")}}catch(m){console.warn("Error handle: Add Router link to cell",m)}return t.href&&(f.push(r.h("a",{href:t.href(o),target:"_blank"})),u("list-cell-link")),c!=null&&f.push(r.h("p",{class:"widget-list-cell-text"},c)),t.icon&&f.push(r.h(T,{name:t.icon})),t.class&&(typeof t.class=="function"?u(t.class(o)):u(t.class)),d.push(r.h("td",l,f)),d}function vt(t,e){t.emit("select",e)}function Ut(t,e){return()=>{try{return Ko(t,e)}catch(n){return console.warn(n),null}}}const Xo={props:{values:Object,config:Object,selected:Boolean},setup:Ut},Zo=["colspan"],jt=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{}},emits:["save","remove","close"],setup(t,{emit:e}){const n=t,o=r.ref(),s=r.computed(()=>!n.values&&!v.hasKey(n.values));return r.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(i,c)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[r.createElementVNode("td",{colspan:i.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.component),r.mergeProps(i.$attrs,{values:i.values,new:s.value,onClose:c[0]||(c[0]=l=>e("close")),onSave:c[1]||(c[1]=l=>e("save",l))}),null,16,["values","new"]))],8,Zo)],512))}}),Qo={class:"widget-wait flex gap_10 padding_15"},es={class:"text_md"},ts=r.defineComponent({__name:"widget-wait",props:{label:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Qo,[r.createVNode(Q,{color:"var(--primary)",class:"wait-spinner"}),r.createElementVNode("span",es,r.toDisplayString(e.label),1)]))}}),Qa="",qt=E(ts,[["__scopeId","data-v-2038b2ba"]]),ns=r.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 n=t,o=r.useSlots(),s=r.computed(()=>{var a;return(a=o==null?void 0:o.default)==null?void 0:a.call(o)[0]}),i=r.computed(()=>n.array.map(a=>({values:a,hash:ct(a)})));function c(a,u=!0){return n.selectRows?u?n.selectRows.indexOf(a)===-1?e("update:selectRows",[...n.selectRows,a]):e("update:selectRows",n.selectRows.filter(f=>f!==a)):e("update:selectRows",[a]):void 0}function l(a){e("save",a),e("update:activeRow",null)}return(a,u)=>(r.openBlock(),r.createElementBlock("div",null,[r.createVNode(r.Transition,{name:"move-horizontal"},{default:r.withCtx(()=>[a.wait?(r.openBlock(),r.createBlock(qt,{key:0,label:"Loading data",color:"black",class:"widget-table-loader"})):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("table",{class:r.normalizeClass(["widget-table",{"widget-table_mini":a.mini}])},[r.createVNode(Ho,{config:a.config},null,8,["config"]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,({values:d,hash:f},m)=>{var h;return r.openBlock(),r.createElementBlock(r.Fragment,{key:m},[r.createVNode(Xo,{config:a.config,values:d,selected:(h=a.selectRows)==null?void 0:h.includes(d),onSelect:_=>c(d,_),class:r.normalizeClass(a.classCallback?a.classCallback(d):"")},null,8,["config","values","selected","onSelect","class"]),s.value&&a.activeRow===f?(r.openBlock(),r.createBlock(jt,{key:0,component:s.value,"row-length":a.config.length,values:d,onClose:u[0]||(u[0]=_=>e("update:activeRow",null)),onSave:l,onRead:u[1]||(u[1]=_=>e("read"))},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64)}),128)),a.activeRow===0?(r.openBlock(),r.createBlock(jt,{key:0,component:s.value,"row-length":a.config.length,onClose:u[2]||(u[2]=d=>e("update:activeRow",null)),onSave:l,onRead:u[3]||(u[3]=d=>e("read"))},null,8,["component","row-length"])):r.createCommentVNode("",!0)])],2)]))}}),el="",rs=Object.freeze(Object.defineProperty({__proto__:null,List:v,Table:Mo,WidgetTable:ns,useListOrder:Rt,useListProvide:Lt,useListRead:Ot,useListState:Dt,useTableActiveRow:Uo},Symbol.toStringTag,{value:"Module"}));class os extends O{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,n){this.store[e]=n,this.emit(this.EVENT_NEW,{entityName:e})}async loadEntityInformation(e){return await Qe.get(e)}}const pe=new os;function ss(t){const e=r.ref(pe.get(t));return pe.on(pe.EVENT_NEW,n=>{t===n.entityName&&(e.value=pe.get(t))}),e}function is(t,e){try{return e.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch(n){De().error("prettify value by metadata",t,n)}}class as{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return w(`/open-api/internationalization/language/${e}`)}}let X={};function ee(t,...e){if(typeof t!="string")return console.trace(`Label is not provided for translation: ${t}`),"undefined";let n=k.utils.getPropFromObject((this==null?void 0:this.vocabulary)||X,t);if(typeof n=="string")return zt(n,e);const o=k.utils.getPropFromObject(X==null?void 0:X.root,t);return typeof o=="string"?zt(o,e):(typeof n===void 0&&console.warn(`Translation for label "${t}" is not founded.`),t)}function zt(t,e){return e.forEach((n,o)=>{t=t.replaceAll(new RegExp(`\\{${o}}`,"g"),n)}),t}ee.setGlobalVocabulary=function(t){X=t},ee.getScope=function(t){const e=typeof t=="string"?t:"root";return typeof t!="string"&&console.warn(`SCOPE ${t} for translate is not string.`),ee.bind({vocabulary:k.utils.getPropFromObject(X,e.toLowerCase())})},ee.setVocabulary=function(t){return typeof t=="string"&&(t=k.utils.getPropFromObject(X,t)),ee.bind({vocabulary:t})};function ls(){return cs}const cs=function(){let t=1,e;const n=new Set,o=new Set,s=De();function i(){return{safeQueue:o,requestId:t,handlers:n}}function c(h){const _=[...n.values()];s.info("use-socket",`Handlers array length is ${n.size}. Response event: ${h.event}. Request id: ${h.requestId}`),_.forEach(g=>{const b=h.requestId;(g.requestId&&g.requestId===b||!g.requestId&&g.event===h.event)&&(s.info("use-socket",`Find appropriated handler: ${t}, event: ${g.event}`),g.callback(h.data,h),g.once&&(n.delete(g),s.info("use-socket","Handler was removed by *once* params was passed. ",g)))})}function l(h){console.log(`%cInitializing sockets: %c${h}`,"color: purple","color: black"),e=new WebSocket(h),e.onclose=function(_){s.error(`Connection to server was stopped: ${_.code} ${_.reason}`),setTimeout(()=>l(h))},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...o.values()].forEach(_=>{a(_),o.delete(_)})},e.onerror=function(_){console.warn(_)},e.onmessage=_=>{try{const g=JSON.parse(_.data);if(!Gt(g)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(g);return}c(g)}catch(g){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(g)}}}function a(h){e.send(h)}function u(h,_){n.add({event:h,callback:_})}function d(h,_){n.add({event:h,callback:_,once:!0})}function f(){return e&&(e==null?void 0:e.readyState)===1}function m(h,_,g){const b=++t,y=JSON.stringify({requestId:b,event:h,data:_,contextId:C.contextId,url:window.location.href});return f()?a(y):(o.add(y),s.info("use-socket","Socket is not connected. Message was send to save-queue.",y)),new Promise((S,W)=>{n.add({event:h,requestId:b,once:!0,callback:(V,P)=>{if(s.info("use-socket","Promise was resolve with next data:",V),ds(P))return void W(V);g&&g(V,P),S(V)}})})}return{get socket(){return e},on:u,once:d,emit:m,initialization:l,getDevInfo:i}}(),ds=t=>!!Gt(t)&&t.event==="request-error",Gt=t=>!!t&&typeof t=="object"&&t!==null&&"event"in t&&typeof t.event=="string"&&"requestId"in t&&typeof t.requestId=="number"&&"data"in t,us={class:"breadcrumb__title"},ps=r.defineComponent({__name:"widget-breadcrumb-item",props:{active:{type:Boolean},title:{},link:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["breadcrumb flex",{breadcrumb_active:e.active}])},[r.createElementVNode("p",us,r.toDisplayString(e.title),1),e.active?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(T,{key:0,class:"breadcrumb__icon",name:"caret-right"}))],2))}}),tl="",fs=E(ps,[["__scopeId","data-v-1702aee0"]]),ms={class:"widget-breadcrumbs"},hs=r.defineComponent({__name:"widget-breadcrumbs",props:{array:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",ms,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.array,(o,s)=>(r.openBlock(),r.createBlock(fs,{key:s,title:o.title,link:o.link,active:s===e.array.length-1},null,8,["title","link","active"]))),128))]))}}),nl="",gs=E(hs,[["__scopeId","data-v-1dfb2668"]]),_s={props:{config:Array,values:Object,selected:Boolean},setup:Ut},rl="",ys=E(_s,[["__scopeId","data-v-48d3df56"]]),ws=t=>(r.pushScopeId("data-v-03c9724f"),t=t(),r.popScopeId(),t),Es={class:"head-cell"},Cs=ws(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),ks=r.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(t,{emit:e}){const n=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(o,s)=>(r.openBlock(),r.createElementBlock("th",null,[r.createElementVNode("div",Es,[r.createElementVNode("div",{class:"head-cell-content flex_grow",style:r.normalizeStyle({"min-width":o.minWidth,"max-width":o.maxWidth,width:o.width})},[o.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(k.FormField),{key:0,type:"single-checkbox",onClick:s[0]||(s[0]=r.withModifiers(i=>e("select"),["stop","prevent"]))})):(r.openBlock(),r.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:s[1]||(s[1]=i=>e("order"))},r.toDisplayString(o.title||o.label),1))],4),o.name&&o.order.length&&o.order[0]===o.name?(r.openBlock(),r.createBlock(r.unref(st),{key:0,class:r.normalizeClass(["head-cell-order",{"head-cell-order_down":o.order.length>1&&o.order[1]==="desc"}])},{default:r.withCtx(()=>[r.createTextVNode("core-arrow-up")]),_:1},8,["class"])):r.createCommentVNode("",!0),Cs])]))}}),ol="",bs=E(ks,[["__scopeId","data-v-03c9724f"]]),$s=r.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const n=t,o=r.ref(),s=r.ref();r.onMounted(()=>{function a(h,_){let g=-1;do g++,_-=h[g];while(_>0&&g<h.length);return g}function u(h,_){let g=0;for(;_>0&&_>h[g]&&g<h.length;)_-=h[g],g++;return console.log(_,g),g>0?g:0}function d(h){try{s.value.style.insetInlineStart=h+"px"}catch(_){console.log(_)}}function f(h){try{s.value.style.width=h+"px",s.value.style.minWidth=h+"px",s.value.style.maxWidth=h+"px"}catch(_){console.log(_)}}function m(h){return h===null?!1:h.classList.contains("head-cell-resize")}o.value.addEventListener("pointerdown",function(_){var on;function g(L){return L.screenX+S-P}const b=o.value,y=[...b.children].filter(L=>L.localName==="th"),S=((on=b.offsetParent)==null?void 0:on.scrollLeft)||0,W=y.map(L=>L.clientWidth),V=m(_.target),P=b.getBoundingClientRect().left,G=g(_),N=a(W,G),he=W.slice(0,N).reduce((L,U)=>L+U,0),Me=G-he,it=b.offsetWidth,ge=y[N].clientWidth;if(n.config[N].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",_.screenX),console.log("Widths",W),console.log("max width",it),console.log("Start Position",G),console.log("Position From",N),console.log("Start Position",N),console.log("Global offset (Отступ самой таблицы от края экрана)",P),console.log("Del",Me),console.groupEnd(),s.value.innerText=y[N].textContent||"",s.value.style.display="grid",s.value.style.width=ge+"px",s.value.style.cursor="grabbing",d(he),f(ge),document.addEventListener("pointermove",rn,{passive:!0}),document.addEventListener("pointerup",nn);function nn(L){if(console.group("END"),document.removeEventListener("pointermove",rn),document.removeEventListener("pointerup",nn),V&&(n.config[N].width=s.value.style.width,n.config[N].minWidth=s.value.style.width,n.config[N].maxWidth=s.value.style.width,i(n.config)),!V){const U=L.screenX+S-P;console.log("ENP Position",U);const ve=u(W,U);if(console.log(N,"->",ve),ve!==N){const _e=n.config[N],at=n.config;at.splice(N,1),at.splice(ve,0,_e),i(at)}else{const _e=n.config[N].name;c(_e)}}s.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function rn(L){if(V){const _e=g(L)-G+ge;f(_e);return}let U=L.screenX+S-P-Me;U<0&&(U=0),U+ge>it&&(U=it-ge),d(U)}})});function i(a){e("update:config",a)}function c(a){if(!a)return;if(Array.isArray(a)){if(a.length<1)return;a=a[0]}if(n.order.length===0||n.order[0]!==a)return void l([a]);const u=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([a,u==="asc"?"desc":"asc"])}function l(a){e("update:order",a)}return(a,u)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:o},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.config,(d,f)=>(r.openBlock(),r.createBlock(bs,r.mergeProps({key:d},d,{onOrder:m=>c(d.name),onSelect:u[0]||(u[0]=m=>e("select")),order:a.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:s},"test",512)],512))}}),sl="",Ss=E($s,[["__scopeId","data-v-11644ad4"]]),Ns=50,Ts=r.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 n=t;function o(l,a=!0){if(n.selectedRows)if(!a)i(n.selectedRows.includes(l)?[]:[l]);else{const u=[...n.selectedRows],d=u.indexOf(l);d===-1?u.push(l):u==null||u.splice(d,1),i(u)}}function s(){var l;if(((l=n.selectedRows)==null?void 0:l.length)!==n.array.length)return i([...n.array]);i([])}function i(l){e("update:selectedRows",l)}function c(l){if(!l)return;const a=l.target;a.scrollTop+a.clientHeight+Ns>a.scrollHeight&&e("scrollEnd")}return(l,a)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:c},[r.createElementVNode("table",{class:r.normalizeClass(["widget-list",{"widget-list_load":l.wait}])},[r.createElementVNode("thead",null,[r.createVNode(Ss,{onSelect:a[0]||(a[0]=u=>s()),"onUpdate:order":a[1]||(a[1]=u=>e("update:order",u)),"onUpdate:config":a[2]||(a[2]=u=>e("update:config",u)),config:l.config,order:l.order},null,8,["config","order"])]),r.createElementVNode("tbody",{class:r.normalizeClass(["widget-list-body",{"widget-list-body_inactive":l.wait}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(u,d)=>{var f;return r.openBlock(),r.createBlock(ys,{key:d,class:"widget-list-row",values:u,config:l.config,selected:(f=l.selectedRows)==null?void 0:f.includes(u),onSelect:m=>o(u,m)},null,8,["values","config","selected","onSelect"])}),128))],2)],2)],32))}}),il="",Bs=E(Ts,[["__scopeId","data-v-a0fe6a42"]]),Is={class:"widget-section"},Vs={class:"widget-section__header"},As={class:"widget-section-title"},Fs={class:"widget-section__body"},Ps=r.defineComponent({__name:"widget-section",props:{title:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Is,[r.createElementVNode("div",Vs,[r.createElementVNode("p",As,r.toDisplayString(e.title),1)]),r.createElementVNode("div",Fs,[r.renderSlot(e.$slots,"default",{},void 0,!0)])]))}}),al="",Os=E(Ps,[["__scopeId","data-v-07232553"]]),Ds={class:"widget-form-info flex"},Ls={class:"form-titles"},Rs={class:"form-title margin-0"},Ws={class:"form-info text_size_md margin-0"},Ms={key:0,class:"form-container-label"},vs={class:"form-label__title text_size_sm"},Us=r.defineComponent({__name:"WidgetFormInfo",props:{title:{},info:{},label:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Ds,[r.createElementVNode("div",Ls,[r.createElementVNode("p",Rs,r.toDisplayString(e.title),1),r.createElementVNode("p",Ws,r.toDisplayString(e.info),1)]),e.label?(r.openBlock(),r.createElementBlock("div",Ms,[r.createElementVNode("div",{class:r.normalizeClass(["form-label",`form-label_${e.label.type}`])},[e.label.icon?(r.openBlock(),r.createBlock(T,{key:0,class:"form-label__icon",name:e.label.icon},null,8,["name"])):r.createCommentVNode("",!0),r.createElementVNode("p",vs,r.toDisplayString(e.label.title),1)],2)])):r.createCommentVNode("",!0)]))}}),ll="",js=E(Us,[["__scopeId","data-v-6ea1062c"]]),qs={class:"wrap__widget-form"},zs={class:"widget-form"},Gs={class:"widget-form__head"},Hs={class:"head-image"},Js={key:1},xs={class:"widget-form__body"},Ks=r.defineComponent({__name:"WidgetForm",props:{title:{},info:{},image:{},icon:{},label:{},button:{},wait:{type:Boolean}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",qs,[r.createElementVNode("div",zs,[r.createElementVNode("div",Gs,[r.createElementVNode("div",Hs,[e.wait?(r.openBlock(),r.createBlock(Q,{key:0,color:"#3949AB"})):(r.openBlock(),r.createElementBlock("div",Js,[e.icon?(r.openBlock(),r.createBlock(T,{key:0,class:"form-image",name:e.icon},null,8,["name"])):r.createCommentVNode("",!0)]))]),r.createVNode(js,{title:e.title,info:e.info,label:e.label},null,8,["title","info","label"]),e.button&&e.button.length?(r.openBlock(),r.createBlock(ze,{key:0,class:"widget-form__button",array:e.button},null,8,["array"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",xs,[r.renderSlot(e.$slots,"default",{},void 0,!0)])])]))}}),cl="",Ys=E(Ks,[["__scopeId","data-v-f076ad65"]]),Xs={class:"validation-item-header"},Zs={class:"validation-item__title text_bold margin-0"},Qs={class:"validation-item-content"},ei={class:"text_bold text_md margin-0"},ti={class:"text_md margin-0"},ni=r.defineComponent({__name:"modal-validation-item",props:{message:{},status:{},statusName:{},title:{},name:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["validation-item",`validation-item_${e.statusName.toLowerCase()}`])},[r.createElementVNode("div",Xs,[r.createElementVNode("p",Zs,r.toDisplayString(e.statusName),1)]),r.createElementVNode("div",Qs,[r.createElementVNode("p",ei,r.toDisplayString(e.title),1),r.createElementVNode("p",ti,r.toDisplayString(e.message),1)])],2))}}),dl="",ri=E(ni,[["__scopeId","data-v-e6138c02"]]),oi={class:"modal-wrap"},si={class:"modal-wrap-head"},ii={class:"modal-head__title margin-0"},ai={class:"modal-wrap-body"},li=r.defineComponent({__name:"modal-wrap",props:{title:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",oi,[r.createElementVNode("div",si,[r.createElementVNode("p",ii,r.toDisplayString(e.title),1)]),r.createElementVNode("div",ai,[r.renderSlot(e.$slots,"default",{},void 0,!0)])]))}}),ul="",ci=E(li,[["__scopeId","data-v-119165b9"]]),di={class:"modal-validation-body"},ui=r.defineComponent({__name:"modal-validation",props:{array:{}},setup(t){return(e,n)=>(r.openBlock(),r.createBlock(ci,{title:"Validation results"},{default:r.withCtx(()=>[r.createElementVNode("div",di,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.array,(o,s)=>(r.openBlock(),r.createBlock(ri,{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}))}}),pl="",pi=E(ui,[["__scopeId","data-v-a39cfe2f"]]),fi=["alt","src"],mi=r.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,n=r.ref();return r.onMounted(()=>{n.value&&(n.value.src=e.src),n.value.onerror=function(){e.default&&(n.value.src=e.default)}}),(o,s)=>(r.openBlock(),r.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:n,src:o.src||o.$props.default},null,8,fi))}}),hi=r.defineComponent({__name:"widget-input-check",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t;function o(){e("update:modelValue",!n.modelValue)}return(s,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["widget-input-check",{"widget-input-check_active":s.modelValue}]),onClick:o},[s.modelValue?(r.openBlock(),r.createBlock(T,{key:0,name:"check"})):r.createCommentVNode("",!0)],2))}}),fl="",gi=E(hi,[["__scopeId","data-v-f4a3dc6c"]]),_i={class:"widget-card"},yi={class:"widget-card-toggle"},wi={class:"widget-card-wrap"},Ei={class:"widget-card-content"},Ci={key:0,class:"widget-card-title"},ki=r.defineComponent({__name:"widget-card",props:{title:{}},setup(t,{expose:e}){const n=r.reactive({selected:!1,hidden:!0});return e({state:n}),(o,s)=>(r.openBlock(),r.createElementBlock("div",_i,[r.createElementVNode("div",yi,[r.createVNode(gi,{modelValue:n.selected,"onUpdate:modelValue":s[0]||(s[0]=i=>n.selected=i)},null,8,["modelValue"])]),r.createElementVNode("div",wi,[r.createElementVNode("div",{class:"widget-card-arrow",onClick:s[1]||(s[1]=i=>n.hidden=!n.hidden)},[r.createVNode(T,{name:"angle-small-right",class:r.normalizeClass(["card-icon-arrow",{"card-icon-arrow_active":!n.hidden}])},null,8,["class"])]),r.createElementVNode("div",Ei,[o.title?(r.openBlock(),r.createElementBlock("p",Ci,r.toDisplayString(o.title),1)):r.createCommentVNode("",!0),r.renderSlot(o.$slots,"main",{},void 0,!0),n.hidden?r.createCommentVNode("",!0):r.renderSlot(o.$slots,"sub",{key:1},void 0,!0)])])]))}}),ml="",bi=E(ki,[["__scopeId","data-v-bca33c5b"]]);class F{static parseError(e){let n=e.errors?Object.values(e.errors).map(o=>o[0]):null;throw A.AuthServiceError(e.title,n)}static login(e){return w(M.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:M.applicationName})}).catch(F.parseError)}static registration(e){return e.AppName=M.applicationName,w(M.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(F.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw A.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return F.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return F.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return F.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return F.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,n){return w(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).catch(F.parseError)}static startLoginProcess(e){return F.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return F.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return F.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,n){return w(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).catch(F.parseError).then(F.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw A.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}const Ht=class ye{static async create(e){return w(ye.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const n=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return w(ye.url+"?"+n.toString(),{method:"get"})}static async readMessages(e){return w(`${ye.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return w(`${ye.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};Ht.url="/close-api/communications";let fe=Ht;class $i{static async getDefaultView(e){return w("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function Jt(t){return{...t,createdEntities:t.createdEntites}}const xt=class Ue{static async getStartConfig(e,n){return w([Ue.url,e,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,n){return w([Ue.url,e,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(Jt)}static async runStep(e,n,o,s,i){return w([Ue.url,e,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:o,token:s,values:i})}).then(Jt)}};xt.url="/close-api/views/process-wizard";let Le=xt;class Qe{static get url(){return"/close-api/metadata"}static async get(e,n,o){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const s=new URLSearchParams;return n&&s.append("criteria",n),o&&s.append("id",String(o)),await fetch(this.url+`/${e}?${s.toString()}`,{method:"GET"}).then(i=>i.json())}static getById(e,n,o=[]){const s=new URLSearchParams;return Ve(s,o),n&&s.append("id",n),w([this.url,e].join("/")+`?${s.toString()}`)}static getFieldInformation(e,n){return w(`/open-api/metadata/${e}/fields/${n}`)}static getTreatmentListField(e,n){return w(`/open-api/metadata/${e}/list-fields/${n}`)}}class Si{static invite(e,n,o){return w("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:n,relatedRoleCode:o})})}static accept(e,n){return w("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!0})})}static decline(e,n){return w("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!1})})}}class et{static get url(){return"/close-api/rules-validation/"}static validate(e,n){return w(et.url+e,{method:"POST",body:JSON.stringify(n)})}}class Ni{static getConfiguration(){return w("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class Kt{static url(){return"/close-api/actions"}static async get({criterion:e}){const n=new URLSearchParams;return e&&n.append("criterion",e),await fetch(this.url()+`?${n.toString()}`,{method:"GET"}).then(o=>o.json())}static getById(e,n,o=[]){const s=new URLSearchParams;return Ve(s,o),w([this.url(),e,n].join("/")+`?${s.toString()}`,{method:"GET"})}}const Yt=class an extends O{constructor(e=[]){super(),this.array=r.reactive([]),this.defaultArray=[],this.setDefault(e)}emitUpdate(){this.emit(an.EVENT_DATA,this.array)}setDefault(e){const n=JSON.parse(JSON.stringify(e));this.defaultArray=n,this.set(n)}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,n){if(this.isOutOfRange(e)||this.isOutOfRange(n))throw new Error(`Provided position is out of range: ${e}, ${n}`);const o=this.array[e];this.array.splice(e,1),this.array.splice(n,0,o),this.emitUpdate()}remove(e){this.array.splice(e,1),this.emitUpdate()}isOutOfRange(e){return!(e>=0&&e<this.array.length)}};Yt.EVENT_DATA="list-config:update";let Ti=Yt;class Bi extends O{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return fe.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return fe.read(e).then(n=>n.length===0?fe.create(e):n[0])}}function Ii(t){const e=k.Form.getParentForm();e?e.subscribe(t):console.warn(A.ParentFormNotFound());const n=r.reactive([]);return t.read=()=>fe.readMessages(t.id).then(o=>(n.splice(0,n.length,...o),o)),{array:n}}function Vi(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function D(t){return Object.keys(t).reduce((e,n)=>{const o=t[n];if(Array.isArray(o)){const s=o.map(i=>typeof i=="string"?`'${i}'`:i).join(", ");return o.length&&e.push(`@${n} in (${s})`),e}if(Vi(o)){let s=function(i){var c;return((c=i.match(/([^Z]*)/))==null?void 0:c[0])+"0000Z"};return o.start&&e.push(`@${n} ge ${s(o.start)}`),o.end&&e.push(`@${n} le ${s(o.end)}`),e}return typeof o=="number"?(e.push(`@${n} eq ${o}`),e):typeof o=="string"?(o.length!==0&&e.push(`@${n} eq '${o}'`),e):(o===null&&e.push(D.is(n,o)),e)},[]).join(" and ")}function me(t){return typeof t=="string"?`'${t}'`:`${t}`}D.includes=function(e,n){return`@${e} Contains ${me(n)}`},D.beginWith=function(e,n){return`@${e} BeginWith ${me(n)}`},D.notEq=function(e,n){return`@${e} nq ${me(n)}`},D.eq=function(e,n){return Array.isArray(n)?D.in(e,n):`@${e} eq ${me(n)}`},D.in=function(e,n){const o=n.map(me).join(", ");return`@${e} in (${o})`},D.and=function(...e){return e.join(" and ")},D.is=function(e,n){return`@${e} is ${n}`},D.or=function(...e){return e.join(" or ")};function Ai(t,e="images"){return`/static-folder/${e}/${t}`}function Fi(t,e,n){return t.reduce((o,s)=>{var l;let i=typeof e=="function"?e(s):s[e];const c=(l=o[o.length-1])==null?void 0:l.value;return c&&n(c,i)?o[o.length-1].array.push(s):o.push({value:i,array:[s]}),o},[])}function Pi(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function Oi(t,e=1e3){let n=0;return(...o)=>{clearTimeout(n),n=setTimeout(()=>t(...o),e)}}function Di(t,e){const n=r.ref(null);function o(){return t.name?Qe.getById(t.name,e,[]).then(s=>{n.value=s,s.fields.forEach(i=>{i.canSet?t.enable(i.name):t.disable(i.name)})}).catch(()=>{n.value=null;const s=A.MetadataEntityIsNotAvailable(t.name||"FORM_WITHOUT_NAME");B.add("error",s.message)}):Promise.reject()}return t.on(k.Form.EVENT_READ,o),{metadata:n,update:o}}class tt extends Error{static UndefinedStatus(){return new tt("Status is undefined.")}}class Li extends tt{}function Ri(t,e){const n=r.reactive([]);async function o(i,c){if(!i)throw Li.UndefinedStatus();const l=await Kt.get({criterion:i});n.splice(0,n.length),n.push(...l.map(a=>s(a,c)))}return{actions:n,update:o};function s(i,c){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:c},contextId:C.contextId}),headers:{"Content-Type":"application/json"}})).then(a=>a.json()).then(a=>{if(!a.success)throw e!=null&&e.ModalValidationResult&&a.validationEffect?lt.openModal(e.ModalValidationResult,{rules:a.validationEffect.results}):B.add("error",a.message),new Error;return a}).then(a=>{a.message&&B.add("info",a.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(a.affectedEntities)}).then(()=>t.read()))()}}}class Re{static url(){return"/close-api/presentation"}static getStatuses(e,n){return fetch(`${Re.url()}/status/${e}/${n}`).then(o=>o.json())}}function Wi(t){const e=r.reactive({title:"Loading",type:"wait"});function n(o){if(t.name&&Number.isInteger(o))return Re.getStatuses(t.name,o).then(s=>{e.type=s.type,e.title=s.name})}return t.on(k.Form.EVENT_READ,o=>{var c,l;const{code:s,name:i}={code:(c=o.Status)==null?void 0:c.Code,name:(l=o.Status)==null?void 0:l.Name};return t.name?!Number.isInteger(s)&&!i?void console.log("Undefined code or name is Status prop."):Re.getStatuses(t.name,s).then(a=>{e.type=a.type,e.title=i}):void console.log("Form without name.")}),{label:e,update:n}}function Mi(t,e){const n=je.useRoute(),o=r.computed(()=>Number(n.params.id)),s=r.reactive({ready:!1,show:!1});return r.watch(()=>o.value,()=>{s.ready=!1}),r.watch(()=>o.value,()=>{Number.isInteger(o.value)&&t.read()},{immediate:!0}),t.read=ie.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!t.name)throw new Error("Form without entity name. Please set form.name");return I.readById(t.name,o.value,{fields:e.fields})}).then(ie.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=ie.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!t.name)throw new Error("Form without entity name. Please set form.name");return I.updateById(t.name,o.value,t.changes,{version:t.version})}).then(i=>{t.version=i.version})),t.on(k.Form.EVENT_SAVE,t.read.bind(t)),{formShadowState:s}}function vi(){const t=r.reactive({contextId:C.contextId,person:C.person,organizations:C.organizations,ready:C.ready,user:C.user}),e=r.computed(()=>{if(!C.ready||!C.person)return null;const o=t.contextId;return C.person.id===o?C.person:C.organizations.find(s=>s.id===o)||null}),n=r.computed(()=>{var o;return t.contextId===((o=t.person)==null?void 0:o.id)});return C.onupdateContext(o=>{t.contextId=o}),C.onupdateData(()=>{t.person=C.person,t.organizations=C.organizations,t.user=C.user}),C.onReady(o=>{t.ready=o}),{state:r.readonly(t),currentContext:e,isPerson:n}}function Ui(t,e){const n=r.reactive({ready:!1,show:!1});function o(){n.ready=!1,n.show=!1}return t.read=()=>{let s=e();return Promise.resolve().then(()=>{if(!t.name)throw A.EntityWithoutName("Use Form Request");return I.readById(t.name,s.id,{fields:s.fields})}).then(ie.valuesToUpperCase).then(i=>(i.hasOwnProperty("Version")&&(t.version=Number(i.Version)),t.setValues(i),n.show=!0,i)).catch(i=>{const c=oe(i);throw B.add("error",c.message),c}).finally(()=>{n.ready=!0})},t.save=()=>{let s=e();return Promise.resolve().then(()=>{if(!t.name)throw A.EntityWithoutName("Use Form Request");return I.updateById(t.name,s.id,t.changes,{version:t.version})}).then(i=>{t.version=i.version||i.Version}).catch(i=>{const c=oe(i);throw B.add("error",c.message),c})},t.on(k.Form.EVENT_SAVE,t.read.bind(t)),{shadowFormState:n,initShadow:o}}class ji{static getRequiredDocuments(e,n,o){const s=new URLSearchParams({entity:e,primaryKey:n,statusCode:o});return fetch(`/close-api/views/required-documents?${s.toString()}`).then(i=>i.json())}}class te{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${te.url()}/calculator/${e}`)}static calculate(e,n){return w(`/${te.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:n})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):A.ApiNotAvailable()})}static parseMetadataField(e){function n(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:e.name,label:e.title,required:e.required,type:n(e)}}static createOnlinePayment(e,n){return w(`/${te.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:n})})}static applyOnlinePayment(e){return w(`/${te.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class qi{static getListSettings(e,n){const o=new URLSearchParams;o.set("entity",e),n&&o.set("mark",n);const s=`/close-api/views/list/configs?${o.toString()}`;return w(s)}}function zi(t){return t.statusName==="Completed"}function Gi(t){return t.statusName==="FinalStepWithConfirmation"}function Hi(t){return t.statusName==="ValidationError"}function Ji(t,e,n){let o=null;const s=r.reactive({wait:null});let i=[],c=null;const l=r.ref(null);function a(){l.value=i.find(y=>y.name===c)||null}function u(){var y;return c?((y=i.find(S=>S.name===c))==null?void 0:y.fields)||[]:[]}function d(y){if(a(),Hi(y))return void n.onValidation(y.validationResults);if((y.statusName==="FinalStep"||y.statusName==="NextStep")&&(!u().length||xi(u(),n.presets)))return b(n.presets||{});zi(y)&&n.onCompleted(y),Gi(y)&&n.onConfirmation(y)}async function f(){try{await m(),await g()}catch(y){const{message:S}=oe(y);B.add("error",S)}}function m(){return s.wait="Loading process information.",Le.getStartConfig(e,t).then(y=>{i=y.steps.map(S=>({label:S.title,name:S.stepName,number:S.number,fields:S.frontendEntity.objectTypes.reduce((W,V)=>(V.properties.forEach(P=>{W.push({name:P.name,label:P.title,type:P.refEntityName||P.dataType})}),W),[])}))}).then(y=>(s.wait=!1,y))}function h(y){return c=y.nextStepName,o=y.token,y}function _(y){const S=oe(y);B.add("error",S.message)}function g(){return s.wait="Starting process",Le.startProcess(e,t).then(h).then(d).catch(_).finally(()=>{s.wait=null})}function b(y={}){return!o||!c?Promise.reject("Not step or token."):(s.wait="Expect the result",Le.runStep(e,t,c,o,y).then(h).then(d).catch(_).finally(()=>{s.wait=!1}))}return{initialize:f,state:s,currentStepConfig:r.readonly(l),next:b}}function xi(t,e){for(let n=0;n<t.length;n++){const o=t[n];if(!k.utils.getPropFromObject(e,o.name))return!1}return!0}const Ki="close-api/proxy/Equipment/Search";class Yi{static search(e,n,o,s,i){const c=new URLSearchParams;c.append("pattern",e||""),n&&c.append("categoryId",n),o&&c.append("useType",String(o)),s&&c.append("statusCode",s),i&&(c.append("limit",String(i.limit)),c.append("offset",String(i.offset)));const l=`/${Ki}?${c.toString()}`;return w(l,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Xi={class:"widget-table__head"},Zi={class:"widget-table__head-label margin_0 text_overflow"},Qi=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("tr",Xi,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.config,(o,s)=>(r.openBlock(),r.createElementBlock("th",{class:"widget-table__head-cell",key:s},[r.createElementVNode("p",Zi,r.toDisplayString(o.label),1)]))),128))]))}}),hl="",ea=E(Qi,[["__scopeId","data-v-fe89c589"]]);function ta(t){return typeof t.name=="string"?t.name:Array.isArray(t.name)?t.name[0]:null}function na(t,e){const n=ta(t);let o=n?k.utils.getPropFromObject(e,n):null;return o===void 0&&(o=null),t.value?t.value(o,e):o}function ra(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var nt={exports:{}},rt,Xt;function oa(){if(Xt)return rt;Xt=1;var t=1e3,e=t*60,n=e*60,o=n*24,s=o*7,i=o*365.25;rt=function(d,f){f=f||{};var m=typeof d;if(m==="string"&&d.length>0)return c(d);if(m==="number"&&isFinite(d))return f.long?a(d):l(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function c(d){if(d=String(d),!(d.length>100)){var f=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(f){var m=parseFloat(f[1]),h=(f[2]||"ms").toLowerCase();switch(h){case"years":case"year":case"yrs":case"yr":case"y":return m*i;case"weeks":case"week":case"w":return m*s;case"days":case"day":case"d":return m*o;case"hours":case"hour":case"hrs":case"hr":case"h":return m*n;case"minutes":case"minute":case"mins":case"min":case"m":return m*e;case"seconds":case"second":case"secs":case"sec":case"s":return m*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function l(d){var f=Math.abs(d);return f>=o?Math.round(d/o)+"d":f>=n?Math.round(d/n)+"h":f>=e?Math.round(d/e)+"m":f>=t?Math.round(d/t)+"s":d+"ms"}function a(d){var f=Math.abs(d);return f>=o?u(d,f,o,"day"):f>=n?u(d,f,n,"hour"):f>=e?u(d,f,e,"minute"):f>=t?u(d,f,t,"second"):d+" ms"}function u(d,f,m,h){var _=f>=m*1.5;return Math.round(d/m)+" "+h+(_?"s":"")}return rt}function sa(t){n.debug=n,n.default=n,n.coerce=a,n.disable=i,n.enable=s,n.enabled=c,n.humanize=oa(),n.destroy=u,Object.keys(t).forEach(d=>{n[d]=t[d]}),n.names=[],n.skips=[],n.formatters={};function e(d){let f=0;for(let m=0;m<d.length;m++)f=(f<<5)-f+d.charCodeAt(m),f|=0;return n.colors[Math.abs(f)%n.colors.length]}n.selectColor=e;function n(d){let f,m=null,h,_;function g(...b){if(!g.enabled)return;const y=g,S=Number(new Date),W=S-(f||S);y.diff=W,y.prev=f,y.curr=S,f=S,b[0]=n.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let V=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(G,N)=>{if(G==="%%")return"%";V++;const he=n.formatters[N];if(typeof he=="function"){const Me=b[V];G=he.call(y,Me),b.splice(V,1),V--}return G}),n.formatArgs.call(y,b),(y.log||n.log).apply(y,b)}return g.namespace=d,g.useColors=n.useColors(),g.color=n.selectColor(d),g.extend=o,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(h!==n.namespaces&&(h=n.namespaces,_=n.enabled(d)),_),set:b=>{m=b}}),typeof n.init=="function"&&n.init(g),g}function o(d,f){const m=n(this.namespace+(typeof f>"u"?":":f)+d);return m.log=this.log,m}function s(d){n.save(d),n.namespaces=d,n.names=[],n.skips=[];let f;const m=(typeof d=="string"?d:"").split(/[\s,]+/),h=m.length;for(f=0;f<h;f++)m[f]&&(d=m[f].replace(/\*/g,".*?"),d[0]==="-"?n.skips.push(new RegExp("^"+d.slice(1)+"$")):n.names.push(new RegExp("^"+d+"$")))}function i(){const d=[...n.names.map(l),...n.skips.map(l).map(f=>"-"+f)].join(",");return n.enable(""),d}function c(d){if(d[d.length-1]==="*")return!0;let f,m;for(f=0,m=n.skips.length;f<m;f++)if(n.skips[f].test(d))return!1;for(f=0,m=n.names.length;f<m;f++)if(n.names[f].test(d))return!0;return!1}function l(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function a(d){return d instanceof Error?d.stack||d.message:d}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var ia=sa;(function(t,e){e.formatArgs=o,e.save=s,e.load=i,e.useColors=n,e.storage=c(),e.destroy=(()=>{let a=!1;return()=>{a||(a=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;a.splice(1,0,u,"color: inherit");let d=0,f=0;a[0].replace(/%[a-zA-Z%]/g,m=>{m!=="%%"&&(d++,m==="%c"&&(f=d))}),a.splice(f,0,u)}e.log=console.debug||console.log||(()=>{});function s(a){try{a?e.storage.setItem("debug",a):e.storage.removeItem("debug")}catch{}}function i(){let a;try{a=e.storage.getItem("debug")}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=process.env.DEBUG),a}function c(){try{return localStorage}catch{}}t.exports=ia(e);const{formatters:l}=t.exports;l.j=function(a){try{return JSON.stringify(a)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(nt,nt.exports);var aa=nt.exports;const la=ra(aa);function ca(t){return["eservices-core",t].join(":")}function ot(t){return We(t,"YYYY/MM/DD HH:mm:ss")}function We(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return dt.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const gl="",st=E({props:{name:String},setup(t,e){let n="unknown";try{n=e.slots.default()[0].children}catch{n=t.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>r.h("i",{class:`icon icon-${n}`})}},[["__scopeId","data-v-e287c8d9"]]),da=la(ca("setup-list-row"));function ua(t,e){const n=t.config.map(o=>pa(o,t,e));return r.h("tr",{class:"widget-table__row widget-table-row"},n)}function pa(t,e,n){const o=e.values;let s=na(t,o);const i={onClick:[],class:["widget-table__cell widget-table-cell"]};function c(d){i.onClick.push(()=>d(o))}function l(d){Array.isArray(d)?i.class.push(...d):i.class.push(d)}const a=[],u=[];if(t.hide&&t.hide(o))return[r.h("td")];if(t.type)switch(l(`widget-table-cell_${t.type}`),t.type){case"number":{typeof s=="number"&&(s=new Intl.NumberFormat().format(s));break}case"date":{s=We(typeof s=="string"?s:null);break}case"dateTime":case"dateWithTime":{s=ot(typeof s=="string"?s:null);break}case"multi-select":{u.push(r.h(k.FormField,{type:"single-checkbox",modelValue:e.selected})),c(Zt.bind(null,n,!0));break}case"select":{u.push(r.h(k.FormField,{type:"single-radio",modelValue:e.selected})),c(Zt.bind(null,n,!1));break}}if(t.onClick&&c(t.onClick),t.link)try{const d=t.link(o);if(d){const f=r.h(je.RouterLink,{to:d});u.push(f),l("widget-table-cell_link")}}catch(d){da("Can't add router link",d)}return t.href&&(u.push(r.h("a",{href:t.href(o),target:"_blank"})),l("widget-table-cell_link")),typeof s=="string"&&u.push(r.h("p",{class:"widget-list-cell-text"},s)),t.icon&&u.push(r.h(st,{name:t.icon})),t.class&&(typeof t.class=="function"?l(t.class(o)):l(t.class)),a.push(r.h("td",i,u)),a}function Zt(t,e){t.emit("select",e)}function fa(t,e){return()=>{try{return ua(t,e)}catch(n){return console.warn(n),null}}}const ma={props:{values:Object,config:Object,selected:Boolean},setup:fa},ha=["colspan"],Qt=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(t,{emit:e}){const n=r.ref();return r.onMounted(()=>{setTimeout(()=>{n.value&&n.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(o,s)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:n},[r.createElementVNode("td",{colspan:o.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(o.component),r.mergeProps(o.$attrs,{values:o.values,new:o.isNew,onClose:s[0]||(s[0]=i=>e("close")),onSave:s[1]||(s[1]=i=>e("save",i))}),null,16,["values","new"]))],8,ha)],512))}}),en={TABLE_ACTIVE_NEW:"table-active-new"},ga={class:"widget-table"},tn="update:selectedRows",_a=r.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},wait:{type:Boolean},classCallback:{}},emits:["update:activeRow","save","read"],setup(t,{emit:e}){const n=t,o=r.useSlots(),s=r.computed(()=>{var l;return(l=o==null?void 0:o.default)==null?void 0:l.call(o)[0]});function i(l,a=!0){if(!n.selectedRows)return;if(!a)return e(tn,n.selectedRows.includes(l)?[]:[l]);const u=[...n.selectedRows],d=u.indexOf(l);return d===-1?u.push(l):u.splice(d,1),e(tn,u)}function c(l){e("save",l),e("update:activeRow",null)}return(l,a)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",ga,[r.createVNode(ea,{config:l.config},null,8,["config"]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(u,d)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:d},[r.createVNode(ma,{config:l.config,values:u,selected:l.selectedRows.includes(u),onSelect:f=>i(u,f),class:r.normalizeClass(l.classCallback?l.classCallback(u):"")},null,8,["config","values","selected","onSelect","class"]),s.value&&l.activeRow===u?(r.openBlock(),r.createBlock(Qt,{key:0,component:s.value,"row-length":l.config.length,values:u,onClose:a[0]||(a[0]=f=>e("update:activeRow",null)),onRead:a[1]||(a[1]=f=>e("read")),onSave:c,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),l.activeRow===r.unref(en).TABLE_ACTIVE_NEW?(r.openBlock(),r.createBlock(Qt,{key:0,component:s.value,"row-length":l.config.length,onClose:a[2]||(a[2]=u=>e("update:activeRow",null)),onRead:a[3]||(a[3]=u=>e("read")),onSave:c,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),ya={clickOutside:Z,requestHandler:Be,valuesToUpperCase:Ie,prettyDate:We,prettyDateWithTime:ot,Filter:D,staticLink:Ai,groupArrayByField:Fi,uuidv4:Pi,Request:w,prettyMoney:Tt},wa={widgets:mo,usage:ho,utils:So,mixins:dn,config:No,types:To};p.ApplicationManager=$t,p.Communication=Bi,p.ComputedMetadata=ss,p.CoreError=A,p.Filter=D,p.List=v,p.ListConfig=Ti,p.Manager=C,p.MetadataStore=pe,p.ModalValidation=pi,p.NotificationSystem=B,p.ProcessWrap=ke,p.Request=w,p.SYMBOL_ROW=z,p.Table=Xe,p.WidgetBreadcrumbs=gs,p.WidgetButton=pt,p.WidgetCard=bi,p.WidgetForm=Ys,p.WidgetIcon=st,p.WidgetImage=mi,p.WidgetList=Bs,p.WidgetMultiButton=ze,p.WidgetNotificationSystem=ht,p.WidgetSection=Os,p.WidgetSpinner=Q,p.WidgetTable=_a,p.WidgetWait=qt,p.actionService=Kt,p.authService=F,p.billingService=te,p.clickOutside=Z,p.clientService=yt,p.communicationService=fe,p.configurationService=qi,p.constants=en,p.dataService=I,p.debounce=Oi,p.default=wa,p.documentsService=ji,p.equipmentService=Yi,p.fileService=ut,p.historyService=Oo,p.internationalizationService=as,p.invitationService=Si,p.metadataService=Qe,p.newImport=rs,p.openService=Ni,p.parseError=oe,p.prettifyValueByMetadata=is,p.prettyDate=We,p.prettyDateWithTime=ot,p.processWizardService=Le,p.requestHandler=Be,p.ruleValidationService=et,p.t=ee,p.testTypes=Po,p.useCommunication=Ii,p.useCustomerState=vi,p.useFormAction=Ri,p.useFormLabel=Wi,p.useFormMetadata=Di,p.useFormRequest=Ui,p.useFormRequestData=Mi,p.useListConfig=Do,p.useListFilter=Ro,p.useListOrder=Rt,p.useListProvide=Lt,p.useListRead=Ot,p.useListSearch=Lo,p.useListSelect=Wo,p.useListState=Dt,p.useLogger=De,p.useManagerState=_o,p.useSocket=ls,p.useTableRequest=Fo,p.useTableState=Ao,p.useWizard=Ji,p.utils=ya,p.viewService=$i,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
10
|
+
*/const wt=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},Ct=function(t,e){t in this.events&&this.events[t].forEach(n=>n(e))},Et=function(t,e){const n=this.events[t];if(!n)return;const o=n.indexOf(e);o!==-1&&n.splice(o,1)},kt=function(){this.events={}};class O{constructor(){this.events={}}on(e,n){return wt.call(this,e,n)}emit(e,n){return Ct.call(this,e,n)}off(e,n){return Et.call(this,e,n)}cleanEvents(){kt.call(this)}static on(e,n){return wt.call(O,e,n)}static emit(e,n){return Ct.call(O,e,n)}static off(e,n){return Et.call(O,e,n)}static cleanEvents(){kt.call(O)}}O.events={};var bt=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},$e=(t,e,n)=>(bt(t,e,"read from private field"),n?n.call(t):e.get(t)),Je=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Ke=(t,e,n,o)=>(bt(t,e,"write to private field"),o?o.call(t,n):e.set(t,n),n),se,Se,Ne;const J=class R extends O{constructor(){super(...arguments),Je(this,se,void 0),Je(this,Se,"front"),this.organizations=[],Je(this,Ne,!1)}set language(e){localStorage.setItem(R.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(R.LOCALSTORAGE_LANGUAGE_KEY)||R.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(R.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){Ke(this,se,e)}get router(){if(!$e(this,se))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return $e(this,se)}set type(e){Ke(this,Se,e)}get type(){return $e(this,Se)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Ke(this,Ne,e),this.emit(R.EVENT_READY_UPDATE,e)}get ready(){return $e(this,Ne)}onReady(e){return this.on(R.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(R.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(R.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(R.CURRENT_CONTEXT_KEY,String(e)),this.emit(R.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(n=>n.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const n=Number.parseInt(localStorage.getItem(R.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(n)&&this.validateContextId(Number(n))?this.setCurrentContext(n):this.setCurrentContext(Number(e.id))}catch{B.add("error",A.ApiNotAvailable().message)}}loadCustomerData(){return yt.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var n;return((n=this.person)==null?void 0:n.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 n=localStorage.getItem(this.getListKeyById(e));return n&&JSON.parse(n)}setListInformationToLocalStorage(e,n){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(n))}};se=new WeakMap,Se=new WeakMap,Ne=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 $t=J;const E=new $t;function _o(){const t=r.reactive({contextType:E.contextType,contextId:E.contextId,context:E.context});return E.onupdateContext(()=>{t.contextType=E.contextType,t.contextId=E.contextId,t.context=E.context}),t}function yo(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return _t}})}function w(t,e={}){return E.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=E.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw A.ApiNotAvailable()}).then(n=>yo(n).then(o=>{if(!n.ok)throw o;return o}))}class Te{constructor(){}static parseNamesFromListConfig(e){let n=Te.parseFieldsToGraphQL(e.reduce((s,i)=>(i.name&&s.push(i.name),s),[]));function o(s){let i="";for(let c in s)typeof s[c]=="boolean"?i+=` ${c} `:i+=` ${c} { ${o(s[c])} }`;return i}return o(n)}static parseSortFromListConfig(e){let n={};for(let o in e)n[o]=e[o]?"ASC":"DESC";return n}static parseFieldsToGraphQL(e){function n(o,s){if(s.includes(".")){const i=s.indexOf("."),c=s.substring(i+1),a=s.substring(0,i);a in o||(o[a]={}),n(o[a],c)}else o[s]=!0;return o}return e.reduce(n,{})}}class wo{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,n,o)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),e[n]=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 St=new wo;function Nt(t){return t&&t[0].toLowerCase()+t.slice(1)}const Xa="",Co={props:{message:String},name:"ModalWait",components:{WidgetSpinner:Q}},Eo={class:"modal__wait modal-default flex_column"};function ko(t,e,n,o,s,i){const c=r.resolveComponent("widget-spinner");return r.openBlock(),r.createElementBlock("div",Eo,[r.createVNode(c),r.createElementVNode("p",null,r.toDisplayString(n.message),1)])}const bo=C(Co,[["render",ko],["__scopeId","data-v-4d18289e"]]),$o={error:!0,wait:!1,throw:!0};async function Be(t,e={}){const n={modalWait:null};e=Object.assign({},e,$o);try{e.wait&&(n.modalWait=await lt.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=A.UndefinedError(s)),e.error&&(console.log(s,s.details),s instanceof A?B.add("error",s.message,{children:s.details||[],timeout:12}):s!=null&&s.message?B.add("error",s.message):(console.warn(s),B.add("error",A.ApiResponseParseFailed().message))),e.throw)throw s}).finally(()=>{var o;(o=n.modalWait)==null||o.close()})}function Ie(t){return Object.keys(t).reduce((e,n)=>{let o=t[n];const s=n.charAt(0).toUpperCase()+n.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=Ie(o)),e[s]=o,e},{})}function Tt(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 ie={Request:w,clickOutside:Z,getPropFromObject:re,runPromiseQueue:Ge,GraphQL:Te,firstChapterToLowerCase:Nt,requestHandler:Be,valuesToUpperCase:Ie,prettyMoney:Tt},So=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:Te,Journal:St,Request:w,clickOutside:Z,default:ie,firstChapterToLowerCase:Nt,getPropFromObject:re,requestHandler:Be,runPromiseQueue:Ge,valuesToUpperCase:Ie},Symbol.toStringTag,{value:"Module"}));function Bt(t,e=""){for(let n in t){if(typeof t[n]=="object"){Bt(t[n],(e.length?`${e}-`:"")+n);continue}let o="--"+((e.length?`${e}-`:"")+n).replace(/([A-Z])/g,s=>`-${s}`.toLowerCase());document.documentElement.style.setProperty(o,t[n])}}const M={};function No(t){for(let e in t)M[e]=t[e];t.styles&&Bt(t.styles),St.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=M}const To=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 Io="masterId",Vo="masterEntity";function Ve(t,e){if(!Array.isArray(e))return;if(Bo(e))return n(e);e.forEach(n);function n(o){t.append(Vo,o[0]),t.append(Io,o[1].toString())}}class I{static async anonymousGetList(e){return await w(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const n=(s,i)=>o.append(s,i),o=new URLSearchParams;if(e.fields){const s=e.fields;typeof s=="string"?n("fields",s):Array.isArray(s)?n("fields",s.join(" ")):typeof s=="object"&&n("fields",Object.keys(s).join(" "))}if(e.order){let s=e.order;const c=(Array.isArray(s)?[s]:Object.entries(s)).map(([a,l="desc"])=>`@${a} ${l}`).join(",");n("order",c)}return e.limit&&n("limit",e.limit.toString()),e.offset&&n("offset",e.offset.toString()),e.filter&&n("filter",e.filter.toString()),e.useUsageContext&&o.append("useUsageContext",e.useUsageContext.toString()),o}static async getList(e,n){const o=I.getSearchParamsForEntityListRead(n||{});return await w(`/close-api/data/${e}?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,n){const o=I.getSearchParamsForEntityListRead(n||{});return w(`/close-api/data/entities/${e}/count?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,n,o){const s=new URLSearchParams;return Ve(s,o==null?void 0:o.masterEntities),w(`/close-api/data/${e}?${s.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:n})})}static update(e,n,o,s={}){return w(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:o})})}static readById(e,n,o={}){const s=new URLSearchParams;if(o.fields){let i=o.fields;typeof i=="string"&&(i=[i]),s.append("fields",i.join(" "))}return w(`/close-api/data/entities/${e}/id/${n}?${s.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,n,o,s){const i=new URLSearchParams;return Ve(i,s==null?void 0:s.masterEntities),w(`/close-api/data/entities/${e}/id/${n}?${i.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:o,version:s==null?void 0:s.version})})}static removeById(e,n,o){const s=typeof n=="number"?{Id:n}:n;return I.removeByKeys(e,s,o)}static removeByKeys(e,n,o){return w(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:n,version:o})})}}var It=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Ye=(t,e,n)=>(It(t,e,"read from private field"),n?n.call(t):e.get(t)),Vt=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},At=(t,e,n,o)=>(It(t,e,"write to private field"),o?o.call(t,n):e.set(t,n),n),ae,Ae;const xe=class ne extends O{constructor(e){super(),Vt(this,ae,[]),Vt(this,Ae,!1),this.hashParams="",this.offset=0,this.name=e.name}set wait(e){At(this,Ae,e),this.emit(ne.EVENT_CHANGE_WAIT,e)}get wait(){return Ye(this,Ae)}read(e){var s,i;this.wait=!0;const n={};e.order&&(n.order={[(s=e.order)==null?void 0:s.name]:(i=e.order)==null?void 0:i.duration}),e.fields&&(n.fields=e.fields),e.filter&&(n.filter=e.filter);const o=JSON.stringify(n.order)+JSON.stringify(n.filter);return o!==this.hashParams&&(this.offset=0,this.hashParams=o),e.limit&&(n.limit=e.limit),e.offset&&(n.offset=e.offset||this.offset),I.getList(this.name,n).then(c=>(this.offset===0&&(this.array=[]),this.offset+=n.limit,c)).then(c=>{this.array.push(...c)}).then(()=>this.emit(ne.EVENT_DATA,this.array)).finally(()=>{this.wait=!1})}set array(e){At(this,ae,e),this.emit(ne.EVENT_DATA,this.array)}add(e){Ye(this,ae).push(...e),this.emit(ne.EVENT_DATA,this.array)}get array(){return Ye(this,ae)}static GetFieldNames(e){return e.reduce((n,o)=>(o.name&&(typeof o.name=="string"?n.push(o.name):n.push(...o.name)),n),[])}static getCellInfo(e,n){const o=ne.getCellName(e),s=(()=>{let i=o?re(n,o):null;return i===void 0&&(i=null),e.value?e.value(i,n):i})();return{name:o,value:s}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}};ae=new WeakMap,Ae=new WeakMap,xe.EVENT_DATA="LIST:DATA",xe.EVENT_CHANGE_WAIT="LIST:UPDATE-WAIT";let Ft=xe;const z=Symbol("__ROW_INDEX__");let Xe=class extends Ft{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 n=this.wrapData(e);this.changes.new[n[z]]=n,this.emitChanges()}cleanChanges(){this.changes.new={},this.changes.edit={},this.changes.remove=[],this.emitChanges()}edit(e,n){const o=this.wrapData(n,e);if(this.changes.new[e])return this.changes.new[e]=o,this.emitChanges();this.array.find(s=>s[z]===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(n=>n[z]===e)&&(delete this.changes.edit[e],this.changes.remove.includes(e)||this.changes.remove.push(e),this.emitChanges())}wrapData(e,n){return n===void 0&&!Object.prototype.hasOwnProperty.call(e,z.toString())&&(n=++this.rowIndex),{...e,[z]:n}}emitChanges(){this.emit(k.Form.EVENT_CHANGED,!0)}set array(e){super.array=e.map(n=>this.wrapData(n))}get array(){return super.array}log(e){console.log(`[table] ${e}`)}};Xe.PROVIDE_NAME="table-controller";function Ao(t){const e=r.reactive(t.array);r.provide(Xe.PROVIDE_NAME,t);const n=r.reactive(t.changes);t.on(Ft.EVENT_DATA,c=>e.splice(0,e.length,...c)),t.on(k.Form.EVENT_CHANGED,()=>{n.new=Object.keys(t.changes.new).reduce((c,a)=>{const l=Number(a);return c[l]=t.changes.new[l],c},{})});const o=r.computed(()=>[...e.reduce((c,a)=>{const l=a[z];return t.changes.remove.includes(l)||c.push({...a,...t.changes.edit[l]}),c},[]),...Object.values(n.new)]),s=k.Form.getParentForm();return s==null||s.subscribe(t),{activeRow:r.ref(null),array:o}}function Fo(t,e){t.read=()=>I.getList(t.name,{fields:e==null?void 0:e.fields}).then(n=>t.array=n).then(()=>t.emit(k.Form.EVENT_READ,t.array)),t.save=()=>{const n=t.name;Object.values(t.changes.new).forEach(async s=>{await I.create(n,s)}),Object.entries(t.changes.edit).forEach(async([s,i])=>{await I.updateById(t.name,o(Number(s)),i)});function o(s){const i=t.array.find(c=>c[z]===s);return i.id|i.Id}t.changes.remove.forEach(async s=>{await I.removeById(n,o(s),0)}),t.emit(k.Form.EVENT_SAVE)}}const Za="",Po=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Oo{static readHistoryById(e,n){return w(`/close-api/audits/history/${e}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(o=>{const s=o.history.map(i=>{if(!i.changes)return i;const c=i.changes.map(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...i,changes:c}});return{...o,history:s}})}}var Pt=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},j=(t,e,n)=>(Pt(t,e,"read from private field"),n?n.call(t):e.get(t)),K=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Y=(t,e,n,o)=>(Pt(t,e,"write to private field"),o?o.call(t,n):e.set(t,n),n),Fe,le,Pe,Oe,ce,de,Ze;const x="_______LIST_______ROW_______INDEX________NAME_______",ue=class q extends O{constructor(e){super(),this.LIST_ROW_KEY=1,K(this,Fe,void 0),this.array=[],K(this,le,[]),K(this,Pe,[]),K(this,Oe,new Proxy({},{set:(n,o,s,i)=>(n[o]=s,this.emit(q.EVENT_FILTERS_UPDATE,n),!0),deleteProperty:(n,o)=>(delete n[o],this.emit(q.EVENT_FILTERS_UPDATE,n),!0)})),K(this,ce,!1),K(this,de,(...n)=>Promise),K(this,Ze,()=>{}),Y(this,Fe,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&Y(this,le,e.config)}set config(e){Y(this,le,e.map(k.utils.copyObject)),this.emitUpdateConfig()}get config(){return j(this,le)}emitUpdateConfig(){this.emit(q.EVENT_CONFIG_UPDATE,this.config)}get order(){return j(this,Pe)}set order(e){Y(this,Pe,e),this.emit(q.EVENT_ORDER_UPDATE,this.order)}get filters(){return j(this,Oe)}set filters(e){Wt(j(this,Oe),e)}set wait(e){Y(this,ce,e),this.emit(k.Form.EVENT_WAIT,j(this,ce))}get wait(){return j(this,ce)}get primaryKeys(){return j(this,Fe)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(n=>n[x]===e)}indexByKey(e){return this.array.findIndex(n=>n[x]===e)}static getKey(e){return e[x]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,x)}add(...e){const n=this.wrapArray(e);this.array.push(...n),this.emit(q.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const n=this.indexByKey(e);n!==-1&&(this.array.splice(n,1),this.emit(q.EVENT_DATA,this.array))}updateByKey(e,n){const o=this.atByKey(e);o&&(Object.assign(o,n),this.emit(q.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[x]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,x)}set read(e){Y(this,de,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const n=j(this,de).call(this,...e);return this.wait=!0,n}).finally(()=>this.wait=!1)}set save(e){Y(this,de,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>j(this,Ze).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((n,o)=>(o.name&&(typeof o.name=="string"?n.push(o.name):n.push(...o.name)),n),[])}static mergeWithKey(e,n){return{...e,[x]:n}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,n){const o=q.getCellName(e),s=(()=>{let i=o?re(n,o):null;return i===void 0&&(i=null),e.value?e.value(i,n):i})();return{name:o,value:s}}};Fe=new WeakMap,le=new WeakMap,Pe=new WeakMap,Oe=new WeakMap,ce=new WeakMap,de=new WeakMap,Ze=new WeakMap,ue.EVENT_DATA="list-data: update",ue.EVENT_CONFIG_UPDATE="list-config:update",ue.EVENT_ORDER_UPDATE="list-order:update",ue.EVENT_FILTERS_UPDATE="list-filters:update";let v=ue;function Ot(t,e){let n="",o=0,s=!1,i;t.read=(c={})=>{if(t.wait)return i;if(c.clean&&(n="",o=0,s=!1),s)return Promise.resolve([]);let a=e;typeof a=="function"&&(a=a());const l={};if(!t.name)throw new Error("Reading list`s data without name is not available.");a.order&&Array.isArray(a.order)&&a.order.length&&(l.order={[a.order[0]]:a.order[1]||"asc"}),a.fields&&(l.fields=a.fields),a.filter&&(l.filter=a.filter);const u=JSON.stringify(l.order)+JSON.stringify(l.filter)+JSON.stringify(l.fields);return u!==n&&!Number.isNaN(u)&&(o=0,n=u),"limit"in a&&(l.limit=a.limit),l.offset=o||a.offset||0,i=I.getList(t.name,l).then(d=>((o===0||c.clean)&&t.set([]),o+=l.limit,d)).then(d=>(t.add(...d),d.length===0&&(s=!0),d)),i}}function Lt(t){const e=r.reactive({wait:t.wait,array:[]});return t.on(v.EVENT_DATA,n=>{e.array.splice(0,e.array.length,...n.map(o=>Object.freeze(JSON.parse(JSON.stringify(o)))))}),t.on(k.Form.EVENT_WAIT,()=>{e.wait=t.wait}),e}function Dt(t,e){const n="list-flex-config",o=r.inject(n,void 0);if(o)return o;if(!t||!e)throw new Error("Hook useProvideList has two required params: list and defaultSettings");t.on(v.EVENT_CONFIG_UPDATE,()=>{t.read()});const s={list:t,defaultSettings:e};return r.provide(n,s),s}function Lo(t){const e=r.reactive([...t.config]);return t.on(v.EVENT_CONFIG_UPDATE,n=>{e.splice(0,e.length,...n)}),e}function Rt(t){const e=t.order||[],n=r.reactive(e);return t.on(v.EVENT_ORDER_UPDATE,o=>{n.splice(0,n.length,...o),t.read()}),n}function Do(t){const e=r.ref(""),n=r.computed(()=>{const o=e.value.toLowerCase();return r.unref(t).filter(s=>e.value.length?Object.values(s).join().toLowerCase().includes(o):!0)});return{search:e,searchArray:n}}function Wt(t,e){Object.keys(t).forEach(n=>delete t[n]),Object.entries(e).forEach(([n,o])=>{t[n]=o})}function Ro(t){const e=r.reactive(k.utils.copyObject(t.filters));return t.on(v.EVENT_FILTERS_UPDATE,n=>{Wt(e,n),t.read()}),e}function Wo(t){const e=r.reactive([]);function n(a){return e.includes(a)}function o(a){n(a)||e.push(a)}function s(a){const l=e.findIndex(u=>u===a);l!==-1&&e.splice(l,1)}function i(a){const l=r.unref(t);if(a===void 0){e.length===0?l.forEach(o):l.forEach(s);return}n(a)?s(a):o(a)}const c=r.computed(()=>{const a=r.unref(t);return e.length===a.length&&a.length!==0});return[e,i,c,o,s]}class Mo extends v{constructor(e){super(e),this.changes=[],this.save=vo.bind(this)}get changed(){return!!this.changes.find(e=>e.status==="active")}addChange(e,n){this.changes.push({type:e,status:"active",data:this.wrapItem(n)})}}function vo(){const t=this.changes.filter(e=>e.status==="active");return Ge(t.map(e=>{console.log("++")}))}function Uo(){const t=r.ref(null);function e(n){t.value=n&&ct(n)}return{activeRow:t,activateRow:e}}const Qa="",jo={props:{config:Array},name:"WidgetTableHead"},qo={class:"widget-table__head"},zo={class:"widget-table__head-title"};function Go(t,e,n,o,s,i){return r.openBlock(),r.createElementBlock("tr",qo,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.config,(c,a)=>(r.openBlock(),r.createElementBlock("th",{class:"widget-table__head-cell",key:a},[r.createElementVNode("p",zo,r.toDisplayString(c.title),1)]))),128))])}const Ho=C(jo,[["render",Go],["__scopeId","data-v-f478f0d8"]]);function Jo(t){return Mt(t,"YYYY/MM/DD HH:mm:ss")}function Mt(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return dt.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const Ko=function(){let t=!1;const e=[];function n(){return t}function o(l,u){n()&&console[l](...u),e.push(u)}function s(...l){o("log",l)}function i(...l){o("warn",l)}function c(...l){o("error",l)}function a(l=!0){t=l}return{info:s,warn:i,history:e,display:a,error:c}}();function Le(){return Ko}function Yo(t,e){const n=t.config.map(o=>xo(o,t,e));return r.h("tr",{class:"widget-table__row widget-table-row"},n)}function xo(t,e,n){const o=e.values,s=Le();let{name:i,value:c}=v.getCellInfo(t,o);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function l(m){a.onClick.push(()=>m(o))}function u(m){Array.isArray(m)?a.class.push(...m):a.class.push(m)}const d=[],f=[];if(M.handleListCell)try{M.handleListCell(t,o,e,f)}catch(m){s.error("get-table-row","handle list cell",m)}if(t.hide&&t.hide(o))return[r.h("td")];if(t.type)switch(u(`widget-table-cell_${t.type}`),t.type){case"number":{typeof c=="number"&&(c=new Intl.NumberFormat().format(c));break}case"date":{c=Mt(typeof c=="string"?c:null);break}case"dateTime":case"dateWithTime":{c=Jo(typeof c=="string"?c:null);break}case"multi-select":{f.push(r.h(k.FormField,{type:"single-checkbox",modelValue:e.selected})),l(vt.bind(null,n,!0));break}case"select":{f.push(r.h(k.FormField,{type:"single-radio",modelValue:e.selected})),l(vt.bind(null,n,!1));break}}if(t.checked){const m=t.checked(o);f.push(r.h(k.FormField,{type:"single-checkbox",modelValue:m}))}if(t.onClick&&l(t.onClick),t.link)try{const m=t.link(o);if(m){const h=r.h(je.RouterLink,{to:m});f.push(h),u("list-cell-link")}}catch(m){console.warn("Error handle: Add Router link to cell",m)}return t.href&&(f.push(r.h("a",{href:t.href(o),target:"_blank"})),u("list-cell-link")),c!=null&&f.push(r.h("p",{class:"widget-list-cell-text"},c)),t.icon&&f.push(r.h(T,{name:t.icon})),t.class&&(typeof t.class=="function"?u(t.class(o)):u(t.class)),d.push(r.h("td",a,f)),d}function vt(t,e){t.emit("select",e)}function Ut(t,e){return()=>{try{return Yo(t,e)}catch(n){return console.warn(n),null}}}const Xo={props:{values:Object,config:Object,selected:Boolean},setup:Ut},Zo=["colspan"],jt=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{}},emits:["save","remove","close"],setup(t,{emit:e}){const n=t,o=r.ref(),s=r.computed(()=>!n.values&&!v.hasKey(n.values));return r.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(i,c)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[r.createElementVNode("td",{colspan:i.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.component),r.mergeProps(i.$attrs,{values:i.values,new:s.value,onClose:c[0]||(c[0]=a=>e("close")),onSave:c[1]||(c[1]=a=>e("save",a))}),null,16,["values","new"]))],8,Zo)],512))}}),Qo={class:"widget-wait flex gap_10 padding_15"},es={class:"text_md"},ts=r.defineComponent({__name:"widget-wait",props:{label:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Qo,[r.createVNode(Q,{color:"var(--primary)",class:"wait-spinner"}),r.createElementVNode("span",es,r.toDisplayString(e.label),1)]))}}),el="",qt=C(ts,[["__scopeId","data-v-2038b2ba"]]),ns=r.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 n=t,o=r.useSlots(),s=r.computed(()=>{var l;return(l=o==null?void 0:o.default)==null?void 0:l.call(o)[0]}),i=r.computed(()=>n.array.map(l=>({values:l,hash:ct(l)})));function c(l,u=!0){return n.selectRows?u?n.selectRows.indexOf(l)===-1?e("update:selectRows",[...n.selectRows,l]):e("update:selectRows",n.selectRows.filter(f=>f!==l)):e("update:selectRows",[l]):void 0}function a(l){e("save",l),e("update:activeRow",null)}return(l,u)=>(r.openBlock(),r.createElementBlock("div",null,[r.createVNode(r.Transition,{name:"move-horizontal"},{default:r.withCtx(()=>[l.wait?(r.openBlock(),r.createBlock(qt,{key:0,label:"Loading data",color:"black",class:"widget-table-loader"})):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("table",{class:r.normalizeClass(["widget-table",{"widget-table_mini":l.mini}])},[r.createVNode(Ho,{config:l.config},null,8,["config"]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,({values:d,hash:f},m)=>{var h;return r.openBlock(),r.createElementBlock(r.Fragment,{key:m},[r.createVNode(Xo,{config:l.config,values:d,selected:(h=l.selectRows)==null?void 0:h.includes(d),onSelect:_=>c(d,_),class:r.normalizeClass(l.classCallback?l.classCallback(d):"")},null,8,["config","values","selected","onSelect","class"]),s.value&&l.activeRow===f?(r.openBlock(),r.createBlock(jt,{key:0,component:s.value,"row-length":l.config.length,values:d,onClose:u[0]||(u[0]=_=>e("update:activeRow",null)),onSave:a,onRead:u[1]||(u[1]=_=>e("read"))},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64)}),128)),l.activeRow===0?(r.openBlock(),r.createBlock(jt,{key:0,component:s.value,"row-length":l.config.length,onClose:u[2]||(u[2]=d=>e("update:activeRow",null)),onSave:a,onRead:u[3]||(u[3]=d=>e("read"))},null,8,["component","row-length"])):r.createCommentVNode("",!0)])],2)]))}}),tl="",rs=Object.freeze(Object.defineProperty({__proto__:null,List:v,Table:Mo,WidgetTable:ns,useListOrder:Rt,useListProvide:Dt,useListRead:Ot,useListState:Lt,useTableActiveRow:Uo},Symbol.toStringTag,{value:"Module"}));class os extends O{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,n){this.store[e]=n,this.emit(this.EVENT_NEW,{entityName:e})}async loadEntityInformation(e){return await Qe.get(e)}}const pe=new os;function ss(t){const e=r.ref(pe.get(t));return pe.on(pe.EVENT_NEW,n=>{t===n.entityName&&(e.value=pe.get(t))}),e}function is(t,e){try{return e.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch(n){Le().error("prettify value by metadata",t,n)}}class as{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return w(`/open-api/internationalization/language/${e}`)}}let X={};function ee(t,...e){if(typeof t!="string")return console.trace(`Label is not provided for translation: ${t}`),"undefined";let n=k.utils.getPropFromObject((this==null?void 0:this.vocabulary)||X,t);if(typeof n=="string")return zt(n,e);const o=k.utils.getPropFromObject(X==null?void 0:X.root,t);return typeof o=="string"?zt(o,e):(typeof n===void 0&&console.warn(`Translation for label "${t}" is not founded.`),t)}function zt(t,e){return e.forEach((n,o)=>{t=t.replaceAll(new RegExp(`\\{${o}}`,"g"),n)}),t}ee.setGlobalVocabulary=function(t){X=t},ee.getScope=function(t){const e=typeof t=="string"?t:"root";return typeof t!="string"&&console.warn(`SCOPE ${t} for translate is not string.`),ee.bind({vocabulary:k.utils.getPropFromObject(X,e.toLowerCase())})},ee.setVocabulary=function(t){return typeof t=="string"&&(t=k.utils.getPropFromObject(X,t)),ee.bind({vocabulary:t})};function ls(){return cs}const cs=function(){let t=1,e;const n=new Set,o=new Set,s=Le();function i(){return{safeQueue:o,requestId:t,handlers:n}}function c(h){const _=[...n.values()];s.info("use-socket",`Handlers array length is ${n.size}. Response event: ${h.event}. Request id: ${h.requestId}`),_.forEach(g=>{const b=h.requestId;(g.requestId&&g.requestId===b||!g.requestId&&g.event===h.event)&&(s.info("use-socket",`Find appropriated handler: ${t}, event: ${g.event}`),g.callback(h.data,h),g.once&&(n.delete(g),s.info("use-socket","Handler was removed by *once* params was passed. ",g)))})}function a(h){console.log(`%cInitializing sockets: %c${h}`,"color: purple","color: black"),e=new WebSocket(h),e.onclose=function(_){s.error(`Connection to server was stopped: ${_.code} ${_.reason}`),setTimeout(()=>a(h))},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...o.values()].forEach(_=>{l(_),o.delete(_)})},e.onerror=function(_){console.warn(_)},e.onmessage=_=>{try{const g=JSON.parse(_.data);if(!Gt(g)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(g);return}c(g)}catch(g){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(g)}}}function l(h){e.send(h)}function u(h,_){n.add({event:h,callback:_})}function d(h,_){n.add({event:h,callback:_,once:!0})}function f(){return e&&(e==null?void 0:e.readyState)===1}function m(h,_,g){const b=++t,y=JSON.stringify({requestId:b,event:h,data:_,contextId:E.contextId,url:window.location.href});return f()?l(y):(o.add(y),s.info("use-socket","Socket is not connected. Message was send to save-queue.",y)),new Promise((S,W)=>{n.add({event:h,requestId:b,once:!0,callback:(V,P)=>{if(s.info("use-socket","Promise was resolve with next data:",V),ds(P))return void W(V);g&&g(V,P),S(V)}})})}return{get socket(){return e},on:u,once:d,emit:m,initialization:a,getDevInfo:i}}(),ds=t=>!!Gt(t)&&t.event==="request-error",Gt=t=>!!t&&typeof t=="object"&&t!==null&&"event"in t&&typeof t.event=="string"&&"requestId"in t&&typeof t.requestId=="number"&&"data"in t,us={class:"breadcrumb__title"},ps=r.defineComponent({__name:"widget-breadcrumb-item",props:{active:{type:Boolean},title:{},link:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["breadcrumb flex",{breadcrumb_active:e.active}])},[r.createElementVNode("p",us,r.toDisplayString(e.title),1),e.active?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(T,{key:0,class:"breadcrumb__icon",name:"caret-right"}))],2))}}),nl="",fs=C(ps,[["__scopeId","data-v-1702aee0"]]),ms={class:"widget-breadcrumbs"},hs=r.defineComponent({__name:"widget-breadcrumbs",props:{array:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",ms,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.array,(o,s)=>(r.openBlock(),r.createBlock(fs,{key:s,title:o.title,link:o.link,active:s===e.array.length-1},null,8,["title","link","active"]))),128))]))}}),rl="",gs=C(hs,[["__scopeId","data-v-1dfb2668"]]),_s={props:{config:Array,values:Object,selected:Boolean},setup:Ut},ol="",ys=C(_s,[["__scopeId","data-v-48d3df56"]]),ws=t=>(r.pushScopeId("data-v-03c9724f"),t=t(),r.popScopeId(),t),Cs={class:"head-cell"},Es=ws(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),ks=r.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(t,{emit:e}){const n=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(o,s)=>(r.openBlock(),r.createElementBlock("th",null,[r.createElementVNode("div",Cs,[r.createElementVNode("div",{class:"head-cell-content flex_grow",style:r.normalizeStyle({"min-width":o.minWidth,"max-width":o.maxWidth,width:o.width})},[o.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(k.FormField),{key:0,type:"single-checkbox",onClick:s[0]||(s[0]=r.withModifiers(i=>e("select"),["stop","prevent"]))})):(r.openBlock(),r.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:s[1]||(s[1]=i=>e("order"))},r.toDisplayString(o.title||o.label),1))],4),o.name&&o.order.length&&o.order[0]===o.name?(r.openBlock(),r.createBlock(r.unref(st),{key:0,class:r.normalizeClass(["head-cell-order",{"head-cell-order_down":o.order.length>1&&o.order[1]==="desc"}])},{default:r.withCtx(()=>[r.createTextVNode("core-arrow-up")]),_:1},8,["class"])):r.createCommentVNode("",!0),Es])]))}}),sl="",bs=C(ks,[["__scopeId","data-v-03c9724f"]]),$s=r.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const n=t,o=r.ref(),s=r.ref();r.onMounted(()=>{function l(h,_){let g=-1;do g++,_-=h[g];while(_>0&&g<h.length);return g}function u(h,_){let g=0;for(;_>0&&_>h[g]&&g<h.length;)_-=h[g],g++;return console.log(_,g),g>0?g:0}function d(h){try{s.value.style.insetInlineStart=h+"px"}catch(_){console.log(_)}}function f(h){try{s.value.style.width=h+"px",s.value.style.minWidth=h+"px",s.value.style.maxWidth=h+"px"}catch(_){console.log(_)}}function m(h){return h===null?!1:h.classList.contains("head-cell-resize")}o.value.addEventListener("pointerdown",function(_){var on;function g(D){return D.screenX+S-P}const b=o.value,y=[...b.children].filter(D=>D.localName==="th"),S=((on=b.offsetParent)==null?void 0:on.scrollLeft)||0,W=y.map(D=>D.clientWidth),V=m(_.target),P=b.getBoundingClientRect().left,G=g(_),N=l(W,G),he=W.slice(0,N).reduce((D,U)=>D+U,0),Me=G-he,it=b.offsetWidth,ge=y[N].clientWidth;if(n.config[N].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",_.screenX),console.log("Widths",W),console.log("max width",it),console.log("Start Position",G),console.log("Position From",N),console.log("Start Position",N),console.log("Global offset (Отступ самой таблицы от края экрана)",P),console.log("Del",Me),console.groupEnd(),s.value.innerText=y[N].textContent||"",s.value.style.display="grid",s.value.style.width=ge+"px",s.value.style.cursor="grabbing",d(he),f(ge),document.addEventListener("pointermove",rn,{passive:!0}),document.addEventListener("pointerup",nn);function nn(D){if(console.group("END"),document.removeEventListener("pointermove",rn),document.removeEventListener("pointerup",nn),V&&(n.config[N].width=s.value.style.width,n.config[N].minWidth=s.value.style.width,n.config[N].maxWidth=s.value.style.width,i(n.config)),!V){const U=D.screenX+S-P;console.log("ENP Position",U);const ve=u(W,U);if(console.log(N,"->",ve),ve!==N){const _e=n.config[N],at=n.config;at.splice(N,1),at.splice(ve,0,_e),i(at)}else{const _e=n.config[N].name;c(_e)}}s.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function rn(D){if(V){const _e=g(D)-G+ge;f(_e);return}let U=D.screenX+S-P-Me;U<0&&(U=0),U+ge>it&&(U=it-ge),d(U)}})});function i(l){e("update:config",l)}function c(l){if(!l)return;if(Array.isArray(l)){if(l.length<1)return;l=l[0]}if(n.order.length===0||n.order[0]!==l)return void a([l]);const u=n.order.length===1||n.order[1]==="asc"?"asc":"desc";a([l,u==="asc"?"desc":"asc"])}function a(l){e("update:order",l)}return(l,u)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:o},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.config,(d,f)=>(r.openBlock(),r.createBlock(bs,r.mergeProps({key:d},d,{onOrder:m=>c(d.name),onSelect:u[0]||(u[0]=m=>e("select")),order:l.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:s},"test",512)],512))}}),il="",Ss=C($s,[["__scopeId","data-v-11644ad4"]]),Ns=50,Ts=r.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 n=t;function o(a,l=!0){if(n.selectedRows)if(!l)i(n.selectedRows.includes(a)?[]:[a]);else{const u=[...n.selectedRows],d=u.indexOf(a);d===-1?u.push(a):u==null||u.splice(d,1),i(u)}}function s(){var a;if(((a=n.selectedRows)==null?void 0:a.length)!==n.array.length)return i([...n.array]);i([])}function i(a){e("update:selectedRows",a)}function c(a){if(!a)return;const l=a.target;l.scrollTop+l.clientHeight+Ns>l.scrollHeight&&e("scrollEnd")}return(a,l)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:c},[r.createElementVNode("table",{class:r.normalizeClass(["widget-list",{"widget-list_load":a.wait}])},[r.createElementVNode("thead",null,[r.createVNode(Ss,{onSelect:l[0]||(l[0]=u=>s()),"onUpdate:order":l[1]||(l[1]=u=>e("update:order",u)),"onUpdate:config":l[2]||(l[2]=u=>e("update:config",u)),config:a.config,order:a.order},null,8,["config","order"])]),r.createElementVNode("tbody",{class:r.normalizeClass(["widget-list-body",{"widget-list-body_inactive":a.wait}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.array,(u,d)=>{var f;return r.openBlock(),r.createBlock(ys,{key:d,class:"widget-list-row",values:u,config:a.config,selected:(f=a.selectedRows)==null?void 0:f.includes(u),onSelect:m=>o(u,m)},null,8,["values","config","selected","onSelect"])}),128))],2)],2)],32))}}),al="",Bs=C(Ts,[["__scopeId","data-v-a0fe6a42"]]),Is={class:"widget-section"},Vs={class:"widget-section__header"},As={class:"widget-section-title"},Fs={class:"widget-section__body"},Ps=r.defineComponent({__name:"widget-section",props:{title:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Is,[r.createElementVNode("div",Vs,[r.createElementVNode("p",As,r.toDisplayString(e.title),1)]),r.createElementVNode("div",Fs,[r.renderSlot(e.$slots,"default",{},void 0,!0)])]))}}),ll="",Os=C(Ps,[["__scopeId","data-v-07232553"]]),Ls={class:"widget-form-info flex"},Ds={class:"form-titles"},Rs={class:"form-title margin-0"},Ws={class:"form-info text_size_md margin-0"},Ms={key:0,class:"form-container-label"},vs={class:"form-label__title text_size_sm"},Us=r.defineComponent({__name:"WidgetFormInfo",props:{title:{},info:{},label:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",Ls,[r.createElementVNode("div",Ds,[r.createElementVNode("p",Rs,r.toDisplayString(e.title),1),r.createElementVNode("p",Ws,r.toDisplayString(e.info),1)]),e.label?(r.openBlock(),r.createElementBlock("div",Ms,[r.createElementVNode("div",{class:r.normalizeClass(["form-label",`form-label_${e.label.type}`])},[e.label.icon?(r.openBlock(),r.createBlock(T,{key:0,class:"form-label__icon",name:e.label.icon},null,8,["name"])):r.createCommentVNode("",!0),r.createElementVNode("p",vs,r.toDisplayString(e.label.title),1)],2)])):r.createCommentVNode("",!0)]))}}),cl="",js=C(Us,[["__scopeId","data-v-6ea1062c"]]),qs={class:"wrap__widget-form"},zs={class:"widget-form"},Gs={class:"widget-form__head"},Hs={class:"head-image"},Js={key:1},Ks={class:"widget-form__body"},Ys=r.defineComponent({__name:"WidgetForm",props:{title:{},info:{},image:{},icon:{},label:{},button:{},wait:{type:Boolean}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",qs,[r.createElementVNode("div",zs,[r.createElementVNode("div",Gs,[r.createElementVNode("div",Hs,[e.wait?(r.openBlock(),r.createBlock(Q,{key:0,color:"#3949AB"})):(r.openBlock(),r.createElementBlock("div",Js,[e.icon?(r.openBlock(),r.createBlock(T,{key:0,class:"form-image",name:e.icon},null,8,["name"])):r.createCommentVNode("",!0)]))]),r.createVNode(js,{title:e.title,info:e.info,label:e.label},null,8,["title","info","label"]),e.button&&e.button.length?(r.openBlock(),r.createBlock(ze,{key:0,class:"widget-form__button",array:e.button},null,8,["array"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",Ks,[r.renderSlot(e.$slots,"default",{},void 0,!0)])])]))}}),dl="",xs=C(Ys,[["__scopeId","data-v-f076ad65"]]),Xs={class:"validation-item-header"},Zs={class:"validation-item__title text_bold margin-0"},Qs={class:"validation-item-content"},ei={class:"text_bold text_md margin-0"},ti={class:"text_md margin-0"},ni=r.defineComponent({__name:"modal-validation-item",props:{message:{},status:{},statusName:{},title:{},name:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["validation-item",`validation-item_${e.statusName.toLowerCase()}`])},[r.createElementVNode("div",Xs,[r.createElementVNode("p",Zs,r.toDisplayString(e.statusName),1)]),r.createElementVNode("div",Qs,[r.createElementVNode("p",ei,r.toDisplayString(e.title),1),r.createElementVNode("p",ti,r.toDisplayString(e.message),1)])],2))}}),ul="",ri=C(ni,[["__scopeId","data-v-e6138c02"]]),oi={class:"modal-wrap"},si={class:"modal-wrap-head"},ii={class:"modal-head__title margin-0"},ai={class:"modal-wrap-body"},li=r.defineComponent({__name:"modal-wrap",props:{title:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("div",oi,[r.createElementVNode("div",si,[r.createElementVNode("p",ii,r.toDisplayString(e.title),1)]),r.createElementVNode("div",ai,[r.renderSlot(e.$slots,"default",{},void 0,!0)])]))}}),pl="",ci=C(li,[["__scopeId","data-v-119165b9"]]),di={class:"modal-validation-body"},ui=r.defineComponent({__name:"modal-validation",props:{array:{}},setup(t){return(e,n)=>(r.openBlock(),r.createBlock(ci,{title:"Validation results"},{default:r.withCtx(()=>[r.createElementVNode("div",di,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.array,(o,s)=>(r.openBlock(),r.createBlock(ri,{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}))}}),fl="",pi=C(ui,[["__scopeId","data-v-a39cfe2f"]]),fi=["alt","src"],mi=r.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,n=r.ref();return r.onMounted(()=>{n.value&&(n.value.src=e.src),n.value.onerror=function(){e.default&&(n.value.src=e.default)}}),(o,s)=>(r.openBlock(),r.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:n,src:o.src||o.$props.default},null,8,fi))}}),hi=r.defineComponent({__name:"widget-input-check",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t;function o(){e("update:modelValue",!n.modelValue)}return(s,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["widget-input-check",{"widget-input-check_active":s.modelValue}]),onClick:o},[s.modelValue?(r.openBlock(),r.createBlock(T,{key:0,name:"check"})):r.createCommentVNode("",!0)],2))}}),ml="",gi=C(hi,[["__scopeId","data-v-f4a3dc6c"]]),_i={class:"widget-card"},yi={class:"widget-card-toggle"},wi={class:"widget-card-wrap"},Ci={class:"widget-card-content"},Ei={key:0,class:"widget-card-title"},ki=r.defineComponent({__name:"widget-card",props:{title:{}},setup(t,{expose:e}){const n=r.reactive({selected:!1,hidden:!0});return e({state:n}),(o,s)=>(r.openBlock(),r.createElementBlock("div",_i,[r.createElementVNode("div",yi,[r.createVNode(gi,{modelValue:n.selected,"onUpdate:modelValue":s[0]||(s[0]=i=>n.selected=i)},null,8,["modelValue"])]),r.createElementVNode("div",wi,[r.createElementVNode("div",{class:"widget-card-arrow",onClick:s[1]||(s[1]=i=>n.hidden=!n.hidden)},[r.createVNode(T,{name:"angle-small-right",class:r.normalizeClass(["card-icon-arrow",{"card-icon-arrow_active":!n.hidden}])},null,8,["class"])]),r.createElementVNode("div",Ci,[o.title?(r.openBlock(),r.createElementBlock("p",Ei,r.toDisplayString(o.title),1)):r.createCommentVNode("",!0),r.renderSlot(o.$slots,"main",{},void 0,!0),n.hidden?r.createCommentVNode("",!0):r.renderSlot(o.$slots,"sub",{key:1},void 0,!0)])])]))}}),hl="",bi=C(ki,[["__scopeId","data-v-bca33c5b"]]);class F{static parseError(e){let n=e.errors?Object.values(e.errors).map(o=>o[0]):null;throw A.AuthServiceError(e.title,n)}static login(e){return w(M.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:M.applicationName})}).catch(F.parseError)}static registration(e){return e.AppName=M.applicationName,w(M.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(F.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw A.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return F.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return F.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return F.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return F.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,n){return w(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).catch(F.parseError)}static startLoginProcess(e){return F.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return F.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return F.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,n){return w(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).catch(F.parseError).then(F.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw A.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}const Ht=class ye{static async create(e){return w(ye.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const n=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return w(ye.url+"?"+n.toString(),{method:"get"})}static async readMessages(e){return w(`${ye.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return w(`${ye.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};Ht.url="/close-api/communications";let fe=Ht;class $i{static async getDefaultView(e){return w("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function Jt(t){return{...t,createdEntities:t.createdEntites}}const Kt=class Ue{static async getStartConfig(e,n){return w([Ue.url,e,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,n){return w([Ue.url,e,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(Jt)}static async runStep(e,n,o,s,i){return w([Ue.url,e,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:o,token:s,values:i})}).then(Jt)}};Kt.url="/close-api/views/process-wizard";let De=Kt;class Qe{static get url(){return"/close-api/metadata"}static async get(e,n,o){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const s=new URLSearchParams;return n&&s.append("criteria",n),o&&s.append("id",String(o)),await fetch(this.url+`/${e}?${s.toString()}`,{method:"GET"}).then(i=>i.json())}static getById(e,n,o=[]){const s=new URLSearchParams;return Ve(s,o),n&&s.append("id",n),w([this.url,e].join("/")+`?${s.toString()}`)}static getFieldInformation(e,n){return w(`/open-api/metadata/${e}/fields/${n}`)}static getTreatmentListField(e,n){return w(`/open-api/metadata/${e}/list-fields/${n}`)}}class Si{static invite(e,n,o){return w("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:n,relatedRoleCode:o})})}static accept(e,n){return w("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!0})})}static decline(e,n){return w("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!1})})}}class et{static get url(){return"/close-api/rules-validation/"}static validate(e,n){return w(et.url+e,{method:"POST",body:JSON.stringify(n)})}}class Ni{static getConfiguration(){return w("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class Yt{static url(){return"/close-api/actions"}static async get({criterion:e}){const n=new URLSearchParams;return e&&n.append("criterion",e),await fetch(this.url()+`?${n.toString()}`,{method:"GET"}).then(o=>o.json())}static getById(e,n,o=[]){const s=new URLSearchParams;return Ve(s,o),w([this.url(),e,n].join("/")+`?${s.toString()}`,{method:"GET"})}}const xt=class an extends O{constructor(e=[]){super(),this.array=r.reactive([]),this.defaultArray=[],this.setDefault(e)}emitUpdate(){this.emit(an.EVENT_DATA,this.array)}setDefault(e){const n=JSON.parse(JSON.stringify(e));this.defaultArray=n,this.set(n)}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,n){if(this.isOutOfRange(e)||this.isOutOfRange(n))throw new Error(`Provided position is out of range: ${e}, ${n}`);const o=this.array[e];this.array.splice(e,1),this.array.splice(n,0,o),this.emitUpdate()}remove(e){this.array.splice(e,1),this.emitUpdate()}isOutOfRange(e){return!(e>=0&&e<this.array.length)}};xt.EVENT_DATA="list-config:update";let Ti=xt;class Bi extends O{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return fe.createMessage({talkId:this.id,text:e})}static checkAndGenerate(e){return fe.read(e).then(n=>n.length===0?fe.create(e):n[0])}}function Ii(t){const e=k.Form.getParentForm();e?e.subscribe(t):console.warn(A.ParentFormNotFound());const n=r.reactive([]);return t.read=()=>fe.readMessages(t.id).then(o=>(n.splice(0,n.length,...o),o)),{array:n}}function Vi(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function L(t){return Object.keys(t).reduce((e,n)=>{const o=t[n];if(Array.isArray(o)){const s=o.map(i=>typeof i=="string"?`'${i}'`:i).join(", ");return o.length&&e.push(`@${n} in (${s})`),e}if(Vi(o)){let s=function(i){var c;return((c=i.match(/([^Z]*)/))==null?void 0:c[0])+"0000Z"};return o.start&&e.push(`@${n} ge ${s(o.start)}`),o.end&&e.push(`@${n} le ${s(o.end)}`),e}return typeof o=="number"?(e.push(`@${n} eq ${o}`),e):typeof o=="string"?(o.length!==0&&e.push(`@${n} eq '${o}'`),e):(o===null&&e.push(L.is(n,o)),e)},[]).join(" and ")}function me(t){return typeof t=="string"?`'${t}'`:`${t}`}L.includes=function(e,n){return`@${e} Contains ${me(n)}`},L.beginWith=function(e,n){return`@${e} BeginWith ${me(n)}`},L.notEq=function(e,n){return`@${e} nq ${me(n)}`},L.eq=function(e,n){return Array.isArray(n)?L.in(e,n):`@${e} eq ${me(n)}`},L.in=function(e,n){const o=n.map(me).join(", ");return`@${e} in (${o})`},L.and=function(...e){return e.join(" and ")},L.is=function(e,n){return`@${e} is ${n}`},L.or=function(...e){return e.join(" or ")};function Ai(t,e="images"){return`/static-folder/${e}/${t}`}function Fi(t,e,n){return t.reduce((o,s)=>{var a;let i=typeof e=="function"?e(s):s[e];const c=(a=o[o.length-1])==null?void 0:a.value;return c&&n(c,i)?o[o.length-1].array.push(s):o.push({value:i,array:[s]}),o},[])}function Pi(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function Oi(t,e=1e3){let n=0;return(...o)=>{clearTimeout(n),n=setTimeout(()=>t(...o),e)}}function Li(t,e){const n=r.ref(null);function o(){return t.name?Qe.getById(t.name,e,[]).then(s=>{n.value=s,s.fields.forEach(i=>{i.canSet?t.enable(i.name):t.disable(i.name)})}).catch(()=>{n.value=null;const s=A.MetadataEntityIsNotAvailable(t.name||"FORM_WITHOUT_NAME");B.add("error",s.message)}):Promise.reject()}return t.on(k.Form.EVENT_READ,o),{metadata:n,update:o}}class tt extends Error{static UndefinedStatus(){return new tt("Status is undefined.")}}class Di extends tt{}function Ri(t,e){const n=r.reactive([]);async function o(i,c){if(!i)throw Di.UndefinedStatus();const a=await Yt.get({criterion:i});n.splice(0,n.length),n.push(...a.map(l=>s(l,c)))}return{actions:n,update:o};function s(i,c){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:c},contextId:E.contextId}),headers:{"Content-Type":"application/json"}})).then(l=>l.json()).then(l=>{if(!l.success)throw e!=null&&e.ModalValidationResult&&l.validationEffect?lt.openModal(e.ModalValidationResult,{rules:l.validationEffect.results}):B.add("error",l.message),new Error;return l}).then(l=>{l.message&&B.add("info",l.message),e!=null&&e.handleAffectedEntities&&e.handleAffectedEntities(l.affectedEntities)}).then(()=>t.read()))()}}}class Re{static url(){return"/close-api/presentation"}static getStatuses(e,n){return fetch(`${Re.url()}/status/${e}/${n}`).then(o=>o.json())}}function Wi(t){const e=r.reactive({title:"Loading",type:"wait"});function n(o){if(t.name&&Number.isInteger(o))return Re.getStatuses(t.name,o).then(s=>{e.type=s.type,e.title=s.name})}return t.on(k.Form.EVENT_READ,o=>{var c,a;const{code:s,name:i}={code:(c=o.Status)==null?void 0:c.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."):Re.getStatuses(t.name,s).then(l=>{e.type=l.type,e.title=i}):void console.log("Form without name.")}),{label:e,update:n}}function Mi(t,e){const n=je.useRoute(),o=r.computed(()=>Number(n.params.id)),s=r.reactive({ready:!1,show:!1});return r.watch(()=>o.value,()=>{s.ready=!1}),r.watch(()=>o.value,()=>{Number.isInteger(o.value)&&t.read()},{immediate:!0}),t.read=ie.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!t.name)throw new Error("Form without entity name. Please set form.name");return I.readById(t.name,o.value,{fields:e.fields})}).then(ie.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=ie.requestHandler.bind(null,()=>Promise.resolve().then(()=>{if(!t.name)throw new Error("Form without entity name. Please set form.name");return I.updateById(t.name,o.value,t.changes,{version:t.version})}).then(i=>{t.version=i.version})),t.on(k.Form.EVENT_SAVE,t.read.bind(t)),{formShadowState:s}}function vi(){const t=r.reactive({contextId:E.contextId,person:E.person,organizations:E.organizations,ready:E.ready,user:E.user}),e=r.computed(()=>{if(!E.ready||!E.person)return null;const o=t.contextId;return E.person.id===o?E.person:E.organizations.find(s=>s.id===o)||null}),n=r.computed(()=>{var o;return t.contextId===((o=t.person)==null?void 0:o.id)});return E.onupdateContext(o=>{t.contextId=o}),E.onupdateData(()=>{t.person=E.person,t.organizations=E.organizations,t.user=E.user}),E.onReady(o=>{t.ready=o}),{state:r.readonly(t),currentContext:e,isPerson:n}}function Ui(t,e){const n=r.reactive({ready:!1,show:!1});function o(){n.ready=!1,n.show=!1}return t.read=()=>{let s=e();return Promise.resolve().then(()=>{if(!t.name)throw A.EntityWithoutName("Use Form Request");return I.readById(t.name,s.id,{fields:s.fields})}).then(ie.valuesToUpperCase).then(i=>(i.hasOwnProperty("Version")&&(t.version=Number(i.Version)),t.setValues(i),n.show=!0,i)).catch(i=>{const c=oe(i);throw B.add("error",c.message),c}).finally(()=>{n.ready=!0})},t.save=()=>{let s=e();return Promise.resolve().then(()=>{if(!t.name)throw A.EntityWithoutName("Use Form Request");return I.updateById(t.name,s.id,t.changes,{version:t.version})}).then(i=>{t.version=i.version||i.Version}).catch(i=>{const c=oe(i);throw B.add("error",c.message),c})},t.on(k.Form.EVENT_SAVE,t.read.bind(t)),{shadowFormState:n,initShadow:o}}class ji{static getRequiredDocuments(e,n,o){const s=new URLSearchParams({entity:e,primaryKey:n,statusCode:o});return fetch(`/close-api/views/required-documents?${s.toString()}`).then(i=>i.json())}}class te{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${te.url()}/calculator/${e}`)}static calculate(e,n){return w(`/${te.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:n})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):A.ApiNotAvailable()})}static parseMetadataField(e){function n(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:e.name,label:e.title,required:e.required,type:n(e)}}static createOnlinePayment(e,n){return w(`/${te.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:n})})}static applyOnlinePayment(e){return w(`/${te.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class qi{static getListSettings(e,n){const o=new URLSearchParams;o.set("entity",e),n&&o.set("mark",n);const s=`/close-api/views/list/configs?${o.toString()}`;return w(s)}}function zi(t){return t.statusName==="Completed"}function Gi(t){return t.statusName==="FinalStepWithConfirmation"}function Hi(t){return t.statusName==="ValidationError"}function Ji(t,e,n){let o=null;const s=r.reactive({wait:null});let i=[],c=null;const a=r.ref(null);function l(){a.value=i.find(y=>y.name===c)||null}function u(){var y;return c?((y=i.find(S=>S.name===c))==null?void 0:y.fields)||[]:[]}function d(y){if(l(),Hi(y))return void n.onValidation(y.validationResults);if((y.statusName==="FinalStep"||y.statusName==="NextStep")&&(!u().length||Ki(u(),n.presets)))return b(n.presets||{});zi(y)&&n.onCompleted(y),Gi(y)&&n.onConfirmation(y)}async function f(){try{await m(),await g()}catch(y){const{message:S}=oe(y);B.add("error",S)}}function m(){return s.wait="Loading process information.",De.getStartConfig(e,t).then(y=>{i=y.steps.map(S=>({label:S.title,name:S.stepName,number:S.number,fields:S.frontendEntity.objectTypes.reduce((W,V)=>(V.properties.forEach(P=>{W.push({name:P.name,label:P.title,type:P.refEntityName||P.dataType})}),W),[])}))}).then(y=>(s.wait=!1,y))}function h(y){return c=y.nextStepName,o=y.token,y}function _(y){const S=oe(y);B.add("error",S.message)}function g(){return s.wait="Starting process",De.startProcess(e,t).then(h).then(d).catch(_).finally(()=>{s.wait=null})}function b(y={}){return!o||!c?Promise.reject("Not step or token."):(s.wait="Expect the result",De.runStep(e,t,c,o,y).then(h).then(d).catch(_).finally(()=>{s.wait=!1}))}return{initialize:f,state:s,currentStepConfig:r.readonly(a),next:b}}function Ki(t,e){for(let n=0;n<t.length;n++){const o=t[n];if(!k.utils.getPropFromObject(e,o.name))return!1}return!0}const Yi="close-api/proxy/Equipment/Search";class xi{static search(e,n,o,s,i){const c=new URLSearchParams;c.append("pattern",e||""),n&&c.append("categoryId",n),o&&c.append("useType",String(o)),s&&c.append("statusCode",s),i&&(c.append("limit",String(i.limit)),c.append("offset",String(i.offset)));const a=`/${Yi}?${c.toString()}`;return w(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Xi={class:"widget-table__head"},Zi={class:"widget-table__head-label margin_0 text_overflow"},Qi=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(t){return(e,n)=>(r.openBlock(),r.createElementBlock("tr",Xi,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.config,(o,s)=>(r.openBlock(),r.createElementBlock("th",{class:"widget-table__head-cell",key:s},[r.createElementVNode("p",Zi,r.toDisplayString(o.label),1)]))),128))]))}}),gl="",ea=C(Qi,[["__scopeId","data-v-fe89c589"]]);function ta(t){return typeof t.name=="string"?t.name:Array.isArray(t.name)?t.name[0]:null}function na(t,e){const n=ta(t);let o=n?k.utils.getPropFromObject(e,n):null;return o===void 0&&(o=null),t.value?t.value(o,e):o}function ra(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var nt={exports:{}},rt,Xt;function oa(){if(Xt)return rt;Xt=1;var t=1e3,e=t*60,n=e*60,o=n*24,s=o*7,i=o*365.25;rt=function(d,f){f=f||{};var m=typeof d;if(m==="string"&&d.length>0)return c(d);if(m==="number"&&isFinite(d))return f.long?l(d):a(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function c(d){if(d=String(d),!(d.length>100)){var f=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(f){var m=parseFloat(f[1]),h=(f[2]||"ms").toLowerCase();switch(h){case"years":case"year":case"yrs":case"yr":case"y":return m*i;case"weeks":case"week":case"w":return m*s;case"days":case"day":case"d":return m*o;case"hours":case"hour":case"hrs":case"hr":case"h":return m*n;case"minutes":case"minute":case"mins":case"min":case"m":return m*e;case"seconds":case"second":case"secs":case"sec":case"s":return m*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function a(d){var f=Math.abs(d);return f>=o?Math.round(d/o)+"d":f>=n?Math.round(d/n)+"h":f>=e?Math.round(d/e)+"m":f>=t?Math.round(d/t)+"s":d+"ms"}function l(d){var f=Math.abs(d);return f>=o?u(d,f,o,"day"):f>=n?u(d,f,n,"hour"):f>=e?u(d,f,e,"minute"):f>=t?u(d,f,t,"second"):d+" ms"}function u(d,f,m,h){var _=f>=m*1.5;return Math.round(d/m)+" "+h+(_?"s":"")}return rt}function sa(t){n.debug=n,n.default=n,n.coerce=l,n.disable=i,n.enable=s,n.enabled=c,n.humanize=oa(),n.destroy=u,Object.keys(t).forEach(d=>{n[d]=t[d]}),n.names=[],n.skips=[],n.formatters={};function e(d){let f=0;for(let m=0;m<d.length;m++)f=(f<<5)-f+d.charCodeAt(m),f|=0;return n.colors[Math.abs(f)%n.colors.length]}n.selectColor=e;function n(d){let f,m=null,h,_;function g(...b){if(!g.enabled)return;const y=g,S=Number(new Date),W=S-(f||S);y.diff=W,y.prev=f,y.curr=S,f=S,b[0]=n.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let V=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(G,N)=>{if(G==="%%")return"%";V++;const he=n.formatters[N];if(typeof he=="function"){const Me=b[V];G=he.call(y,Me),b.splice(V,1),V--}return G}),n.formatArgs.call(y,b),(y.log||n.log).apply(y,b)}return g.namespace=d,g.useColors=n.useColors(),g.color=n.selectColor(d),g.extend=o,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(h!==n.namespaces&&(h=n.namespaces,_=n.enabled(d)),_),set:b=>{m=b}}),typeof n.init=="function"&&n.init(g),g}function o(d,f){const m=n(this.namespace+(typeof f>"u"?":":f)+d);return m.log=this.log,m}function s(d){n.save(d),n.namespaces=d,n.names=[],n.skips=[];let f;const m=(typeof d=="string"?d:"").split(/[\s,]+/),h=m.length;for(f=0;f<h;f++)m[f]&&(d=m[f].replace(/\*/g,".*?"),d[0]==="-"?n.skips.push(new RegExp("^"+d.slice(1)+"$")):n.names.push(new RegExp("^"+d+"$")))}function i(){const d=[...n.names.map(a),...n.skips.map(a).map(f=>"-"+f)].join(",");return n.enable(""),d}function c(d){if(d[d.length-1]==="*")return!0;let f,m;for(f=0,m=n.skips.length;f<m;f++)if(n.skips[f].test(d))return!1;for(f=0,m=n.names.length;f<m;f++)if(n.names[f].test(d))return!0;return!1}function a(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function l(d){return d instanceof Error?d.stack||d.message:d}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var ia=sa;(function(t,e){e.formatArgs=o,e.save=s,e.load=i,e.useColors=n,e.storage=c(),e.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;l.splice(1,0,u,"color: inherit");let d=0,f=0;l[0].replace(/%[a-zA-Z%]/g,m=>{m!=="%%"&&(d++,m==="%c"&&(f=d))}),l.splice(f,0,u)}e.log=console.debug||console.log||(()=>{});function s(l){try{l?e.storage.setItem("debug",l):e.storage.removeItem("debug")}catch{}}function i(){let l;try{l=e.storage.getItem("debug")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=process.env.DEBUG),l}function c(){try{return localStorage}catch{}}t.exports=ia(e);const{formatters:a}=t.exports;a.j=function(l){try{return JSON.stringify(l)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(nt,nt.exports);var aa=nt.exports;const la=ra(aa);function ca(t){return["eservices-core",t].join(":")}function ot(t){return We(t,"YYYY/MM/DD HH:mm:ss")}function We(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return dt.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const _l="",st=C({props:{name:String},setup(t,e){let n="unknown";try{n=e.slots.default()[0].children}catch{n=t.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>r.h("i",{class:`icon icon-${n}`})}},[["__scopeId","data-v-e287c8d9"]]),da=la(ca("setup-list-row"));function ua(t,e){const n=t.config.map(o=>pa(o,t,e));return r.h("tr",{class:"widget-table__row widget-table-row"},n)}function pa(t,e,n){const o=e.values;let s=na(t,o);const i={onClick:[],class:["widget-table__cell widget-table-cell"]};function c(d){i.onClick.push(()=>d(o))}function a(d){Array.isArray(d)?i.class.push(...d):i.class.push(d)}const l=[],u=[];if(t.hide&&t.hide(o))return[r.h("td")];if(t.type)switch(a(`widget-table-cell_${t.type}`),t.type){case"number":{typeof s=="number"&&(s=new Intl.NumberFormat().format(s));break}case"date":{s=We(typeof s=="string"?s:null);break}case"dateTime":case"dateWithTime":{s=ot(typeof s=="string"?s:null);break}case"multi-select":{u.push(r.h(k.FormField,{type:"single-checkbox",modelValue:e.selected})),c(Zt.bind(null,n,!0));break}case"select":{u.push(r.h(k.FormField,{type:"single-radio",modelValue:e.selected})),c(Zt.bind(null,n,!1));break}}if(t.onClick&&c(t.onClick),t.link)try{const d=t.link(o);if(d){const f=r.h(je.RouterLink,{to:d});u.push(f),a("widget-table-cell_link")}}catch(d){da("Can't add router link",d)}return t.href&&(u.push(r.h("a",{href:t.href(o),target:"_blank"})),a("widget-table-cell_link")),(typeof s=="string"||typeof s=="number")&&u.push(r.h("p",{class:"widget-list-cell-text"},s)),t.icon&&u.push(r.h(st,{name:t.icon})),t.class&&(typeof t.class=="function"?a(t.class(o)):a(t.class)),l.push(r.h("td",i,u)),l}function Zt(t,e){t.emit("select",e)}function fa(t,e){return()=>{try{return ua(t,e)}catch(n){return console.warn(n),null}}}const ma={props:{values:Object,config:Object,selected:Boolean},setup:fa},ha=["colspan"],Qt=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(t,{emit:e}){const n=r.ref();return r.onMounted(()=>{setTimeout(()=>{n.value&&n.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(o,s)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:n},[r.createElementVNode("td",{colspan:o.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(o.component),r.mergeProps(o.$attrs,{values:o.values,new:o.isNew,onClose:s[0]||(s[0]=i=>e("close")),onSave:s[1]||(s[1]=i=>e("save",i))}),null,16,["values","new"]))],8,ha)],512))}}),en={LIST_ACTIVE_NEW:"list-active-new"},ga={class:"widget-table"},tn="update:selectedRows",_a=r.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{}},emits:["update:activeRow","save"],setup(t,{emit:e}){const n=t,o=r.useSlots(),s=r.computed(()=>{var a;return(a=o==null?void 0:o.default)==null?void 0:a.call(o)[0]});function i(a,l=!0){if(!n.selectedRows)return;if(!l)return e(tn,n.selectedRows.includes(a)?[]:[a]);const u=[...n.selectedRows],d=u.indexOf(a);return d===-1?u.push(a):u.splice(d,1),e(tn,u)}function c(a){e("save",a),e("update:activeRow",null)}return(a,l)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",ga,[r.createVNode(ea,{config:a.config},null,8,["config"]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.array,(u,d)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:d},[r.createVNode(ma,{config:a.config,values:u,selected:a.selectedRows.includes(u),onSelect:f=>i(u,f),class:r.normalizeClass(a.classCallback?a.classCallback(u):"")},null,8,["config","values","selected","onSelect","class"]),s.value&&a.activeRow===u?(r.openBlock(),r.createBlock(Qt,{key:0,component:s.value,"row-length":a.config.length,values:u,onClose:l[0]||(l[0]=f=>e("update:activeRow",null)),onSave:c,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),a.activeRow===r.unref(en).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(Qt,{key:0,component:s.value,"row-length":a.config.length,onClose:l[1]||(l[1]=u=>e("update:activeRow",null)),onSave:c,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}});function ya(){const t=r.ref(null);function e(n){t.value=n}return{activeRow:t,activateRow:e}}const wa={clickOutside:Z,requestHandler:Be,valuesToUpperCase:Ie,prettyDate:We,prettyDateWithTime:ot,Filter:L,staticLink:Ai,groupArrayByField:Fi,uuidv4:Pi,Request:w,prettyMoney:Tt},Ca={widgets:mo,usage:ho,utils:So,mixins:dn,config:No,types:To};p.ApplicationManager=$t,p.Communication=Bi,p.ComputedMetadata=ss,p.CoreError=A,p.Filter=L,p.List=v,p.ListConfig=Ti,p.Manager=E,p.MetadataStore=pe,p.ModalValidation=pi,p.NotificationSystem=B,p.ProcessWrap=ke,p.Request=w,p.SYMBOL_ROW=z,p.Table=Xe,p.WidgetBreadcrumbs=gs,p.WidgetButton=pt,p.WidgetCard=bi,p.WidgetForm=xs,p.WidgetIcon=st,p.WidgetImage=mi,p.WidgetList=Bs,p.WidgetMultiButton=ze,p.WidgetNotificationSystem=ht,p.WidgetSection=Os,p.WidgetSpinner=Q,p.WidgetTable=_a,p.WidgetWait=qt,p.actionService=Yt,p.authService=F,p.billingService=te,p.clickOutside=Z,p.clientService=yt,p.communicationService=fe,p.configurationService=qi,p.constants=en,p.dataService=I,p.debounce=Oi,p.default=Ca,p.documentsService=ji,p.equipmentService=xi,p.fileService=ut,p.historyService=Oo,p.internationalizationService=as,p.invitationService=Si,p.metadataService=Qe,p.newImport=rs,p.openService=Ni,p.parseError=oe,p.prettifyValueByMetadata=is,p.prettyDate=We,p.prettyDateWithTime=ot,p.processWizardService=De,p.requestHandler=Be,p.ruleValidationService=et,p.t=ee,p.testTypes=Po,p.useCommunication=Ii,p.useCustomerState=vi,p.useFormAction=Ri,p.useFormLabel=Wi,p.useFormMetadata=Li,p.useFormRequest=Ui,p.useFormRequestData=Mi,p.useListActiveRow=ya,p.useListConfig=Lo,p.useListFilter=Ro,p.useListOrder=Rt,p.useListProvide=Dt,p.useListRead=Ot,p.useListSearch=Do,p.useListSelect=Wo,p.useListState=Lt,p.useLogger=Le,p.useManagerState=_o,p.useSocket=ls,p.useTableRequest=Fo,p.useTableState=Ao,p.useWizard=Ji,p.utils=wa,p.viewService=$i,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
11
11
|
//# sourceMappingURL=eservices-core.umd.js.map
|