@sankhyalabs/ezui 7.1.0-dev.2 → 7.1.0-dev.21
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/cjs/{ApplicationUtils-d04f5c94.js → ApplicationUtils-4fb87a9e.js} +1 -1
- package/dist/cjs/{app-globals-c128c97e.js → app-globals-cb31a206.js} +1 -1
- package/dist/cjs/ez-actions-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-avatar.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -2
- package/dist/cjs/{ez-combo-box-list_4.cjs.entry.js → ez-combo-box-list_5.cjs.entry.js} +150 -3
- package/dist/cjs/ez-combo-box.cjs.entry.js +2 -2
- package/dist/cjs/ez-date-input.cjs.entry.js +11 -4
- package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-dialog.cjs.entry.js +2 -2
- package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +15 -7
- package/dist/cjs/ez-form.cjs.entry.js +17 -6
- package/dist/cjs/ez-grid.cjs.entry.js +12 -5
- package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-link-builder_6.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal-container.cjs.entry.js +16 -17
- package/dist/cjs/ez-modal.cjs.entry.js +2 -2
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +3 -1
- package/dist/cjs/ez-pagination.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +20 -8
- package/dist/cjs/ez-search-plus.cjs.entry.js +18 -4
- package/dist/cjs/ez-search-result-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +30 -26
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
- package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/ez-sortable-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-spinner.cjs.entry.js +1 -1
- package/dist/cjs/ez-split-button.cjs.entry.js +2 -2
- package/dist/cjs/ez-split-item.cjs.entry.js +2 -2
- package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-tooltip.cjs.entry.js +13 -2
- package/dist/cjs/ez-tree.cjs.entry.js +155 -8
- package/dist/cjs/ez-upload.cjs.entry.js +2 -2
- package/dist/cjs/ezui.cjs.js +3 -3
- package/dist/cjs/filter-column.cjs.entry.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +2 -2
- package/dist/cjs/{index-00d0166b.js → index-e61642ff.js} +24 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{purify-47a2f27b.js → purify-b30a5718.js} +41 -12
- package/dist/cjs/{search-column-9aa090ec.js → search-column-51e50b59.js} +3 -3
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ez-chip/ez-chip.css +3 -0
- package/dist/collection/components/ez-date-input/ez-date-input.js +28 -3
- package/dist/collection/components/ez-dialog/ez-dialog.css +6 -1
- package/dist/collection/components/ez-form/ez-form.js +23 -1
- package/dist/collection/components/ez-form-view/ez-form-view.js +24 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +4 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ImageInput.tpl.js +4 -0
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +3 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +5 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +3 -0
- package/dist/collection/components/ez-image-input/ez-image-input.css +173 -0
- package/dist/collection/components/ez-image-input/ez-image-input.js +324 -0
- package/dist/collection/components/ez-modal/ez-modal.css +3 -0
- package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -9
- package/dist/collection/components/ez-modal-container/ez-modal-container.js +32 -15
- package/dist/collection/components/ez-number-input/ez-number-input.js +16 -0
- package/dist/collection/components/ez-popup/ez-popup.css +9 -4
- package/dist/collection/components/ez-popup/ez-popup.js +24 -7
- package/dist/collection/components/ez-search/ez-search.js +41 -19
- package/dist/collection/components/ez-search-plus/ez-search-plus.js +16 -2
- package/dist/collection/components/ez-split-button/ez-split-button.css +7 -2
- package/dist/collection/components/ez-text-input/ez-text-input.css +3 -3
- package/dist/collection/components/ez-tooltip/ez-tooltip.js +13 -2
- package/dist/collection/components/ez-tree/ez-tree.css +4 -0
- package/dist/collection/components/ez-tree/ez-tree.js +185 -6
- package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +4 -1
- package/dist/collection/components/ez-tree/types/Node.js +7 -0
- package/dist/collection/components/ez-tree/types/Tree.js +19 -0
- package/dist/collection/components/ez-tree/types/UpdateItemConfig.js +1 -0
- package/dist/collection/utils/form/DataBinder.js +1 -1
- package/dist/collection/utils/form/FormMetadata.js +12 -2
- package/dist/collection/utils/i18n/locales/en-us.js +8 -0
- package/dist/collection/utils/i18n/locales/es-es.js +8 -0
- package/dist/collection/utils/i18n/locales/pt-br.js +8 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +530 -105
- package/dist/esm/{ApplicationUtils-12768f5a.js → ApplicationUtils-985c24ae.js} +1 -1
- package/dist/esm/{app-globals-9507c20e.js → app-globals-75f8a758.js} +1 -1
- package/dist/esm/ez-actions-button.entry.js +2 -2
- package/dist/esm/ez-alert-list.entry.js +1 -1
- package/dist/esm/ez-avatar.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +2 -2
- package/dist/esm/{ez-combo-box-list_4.entry.js → ez-combo-box-list_5.entry.js} +150 -4
- package/dist/esm/ez-combo-box.entry.js +2 -2
- package/dist/esm/ez-date-input.entry.js +11 -4
- package/dist/esm/ez-date-time-input.entry.js +1 -1
- package/dist/esm/ez-dialog.entry.js +2 -2
- package/dist/esm/ez-double-list.entry.js +1 -1
- package/dist/esm/ez-file-item.entry.js +1 -1
- package/dist/esm/ez-form-view.entry.js +15 -7
- package/dist/esm/ez-form.entry.js +17 -6
- package/dist/esm/ez-grid.entry.js +12 -5
- package/dist/esm/ez-guide-navigator.entry.js +1 -1
- package/dist/esm/ez-link-builder_6.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-modal-container.entry.js +16 -17
- package/dist/esm/ez-modal.entry.js +2 -2
- package/dist/esm/ez-multi-selection-list.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +3 -1
- package/dist/esm/ez-pagination.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +20 -8
- package/dist/esm/ez-search-plus.entry.js +18 -4
- package/dist/esm/ez-search-result-list.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +25 -21
- package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
- package/dist/esm/ez-skeleton.entry.js +1 -1
- package/dist/esm/ez-sortable-list.entry.js +1 -1
- package/dist/esm/ez-spinner.entry.js +1 -1
- package/dist/esm/ez-split-button.entry.js +2 -2
- package/dist/esm/ez-split-item.entry.js +2 -2
- package/dist/esm/ez-text-input.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ez-tooltip.entry.js +13 -2
- package/dist/esm/ez-tree.entry.js +155 -8
- package/dist/esm/ez-upload.entry.js +2 -2
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/filter-column.entry.js +1 -1
- package/dist/esm/{index-62fc771e.js → index-a3b24b5d.js} +24 -0
- package/dist/esm/index-baa5e267.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{purify-dc6814bf.js → purify-9357603c.js} +41 -12
- package/dist/esm/{search-column-83562552.js → search-column-0c42248b.js} +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-e882635e.entry.js → p-0aafbc30.entry.js} +1 -1
- package/dist/ezui/{p-0c0eb410.entry.js → p-0e325699.entry.js} +1 -1
- package/dist/ezui/{p-5a11cf56.js → p-0ec5c128.js} +1 -1
- package/dist/ezui/p-1bf40959.entry.js +1 -0
- package/dist/ezui/p-1c3f43e8.entry.js +1 -0
- package/dist/ezui/{p-1cde96f9.entry.js → p-2676e2a3.entry.js} +1 -1
- package/dist/ezui/{p-e27d7dc2.entry.js → p-28af6826.entry.js} +1 -1
- package/dist/ezui/{p-1adf7139.entry.js → p-2b23906a.entry.js} +1 -1
- package/dist/ezui/{p-1730ee24.entry.js → p-2e5de2a7.entry.js} +1 -1
- package/dist/ezui/{p-5ab08b60.entry.js → p-2fd16ff2.entry.js} +1 -1
- package/dist/ezui/{p-d66bf34e.entry.js → p-3d71e8e1.entry.js} +2 -2
- package/dist/ezui/{p-6f119d5f.entry.js → p-3fcf79c7.entry.js} +1 -1
- package/dist/ezui/p-474076b3.js +1 -0
- package/dist/ezui/{p-a401041c.entry.js → p-47d9256e.entry.js} +1 -1
- package/dist/ezui/{p-124699e0.entry.js → p-4ea5c8a7.entry.js} +1 -1
- package/dist/ezui/p-582c3f90.entry.js +1 -0
- package/dist/ezui/{p-6a9a20a0.entry.js → p-5e6de2c1.entry.js} +1 -1
- package/dist/ezui/{p-2a70f094.entry.js → p-6570ca10.entry.js} +1 -1
- package/dist/ezui/{p-e99cbb51.entry.js → p-67f9fadb.entry.js} +1 -1
- package/dist/ezui/p-6a982147.js +1 -0
- package/dist/ezui/p-6c484770.entry.js +1 -0
- package/dist/ezui/{p-1266fe78.entry.js → p-6d7f2fdc.entry.js} +1 -1
- package/dist/ezui/p-6f466aec.entry.js +1 -0
- package/dist/ezui/{p-3fe05d6b.entry.js → p-714452c7.entry.js} +1 -1
- package/dist/ezui/{p-957d08cd.entry.js → p-7624767b.entry.js} +1 -1
- package/dist/ezui/p-782fe2e3.entry.js +1 -0
- package/dist/ezui/p-8709c4f6.entry.js +1 -0
- package/dist/ezui/{p-8dc267ff.entry.js → p-8a8006e6.entry.js} +1 -1
- package/dist/ezui/{p-0e49c0ff.entry.js → p-8d626d2b.entry.js} +1 -1
- package/dist/ezui/{p-79277e43.entry.js → p-9568a93d.entry.js} +1 -1
- package/dist/ezui/p-9771ea3c.entry.js +1 -0
- package/dist/ezui/p-98218fbc.js +1 -0
- package/dist/ezui/p-9d004e22.entry.js +1 -0
- package/dist/ezui/{p-eee3c7ff.entry.js → p-a13e65a4.entry.js} +1 -1
- package/dist/ezui/{p-e8c6c973.entry.js → p-a1a63294.entry.js} +1 -1
- package/dist/ezui/p-c711900a.entry.js +1 -0
- package/dist/ezui/p-cfa26133.entry.js +1 -0
- package/dist/ezui/{p-a7eab406.entry.js → p-dc192d01.entry.js} +1 -1
- package/dist/ezui/p-dff9862b.js +3 -0
- package/dist/ezui/{p-59a98e31.entry.js → p-e2e0dd76.entry.js} +1 -1
- package/dist/ezui/{p-2ba2d792.entry.js → p-e4a579f2.entry.js} +1 -1
- package/dist/ezui/{p-59092a66.entry.js → p-e82a12c6.entry.js} +1 -1
- package/dist/ezui/p-f1bbf23f.entry.js +1 -0
- package/dist/ezui/p-f34ec732.entry.js +1 -0
- package/dist/ezui/p-f45ddc1f.entry.js +1 -0
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +5 -1
- package/dist/types/components/ez-form/ez-form.d.ts +5 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +4 -0
- package/dist/types/components/ez-form-view/fieldbuilder/FieldBuilder.d.ts +3 -1
- package/dist/types/components/ez-form-view/fieldbuilder/templates/ImageInput.tpl.d.ts +2 -0
- package/dist/types/components/ez-image-input/ez-image-input.d.ts +42 -0
- package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +6 -2
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +4 -0
- package/dist/types/components/ez-popup/ez-popup.d.ts +3 -0
- package/dist/types/components/ez-search/ez-search.d.ts +5 -6
- package/dist/types/components/ez-search-plus/ez-search-plus.d.ts +1 -0
- package/dist/types/components/ez-tooltip/ez-tooltip.d.ts +3 -0
- package/dist/types/components/ez-tree/ez-tree.d.ts +20 -1
- package/dist/types/components/ez-tree/types/Node.d.ts +1 -0
- package/dist/types/components/ez-tree/types/Tree.d.ts +1 -0
- package/dist/types/components/ez-tree/types/UpdateItemConfig.d.ts +4 -0
- package/dist/types/components.d.ts +140 -1
- package/dist/types/utils/form/interfaces/IFormSheetMetadata.d.ts +1 -0
- package/dist/types/utils/form/interfaces/ITabConfig.d.ts +1 -0
- package/dist/types/utils/i18n/locales/en-us.d.ts +8 -0
- package/dist/types/utils/i18n/locales/es-es.d.ts +8 -0
- package/dist/types/utils/i18n/locales/pt-br.d.ts +8 -0
- package/dist/types/utils/i18n/translations.d.ts +24 -0
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-02f6e3b0.entry.js +0 -1
- package/dist/ezui/p-0b333f09.entry.js +0 -1
- package/dist/ezui/p-14807f4e.js +0 -1
- package/dist/ezui/p-191cfbc8.entry.js +0 -1
- package/dist/ezui/p-1bfef8e5.entry.js +0 -1
- package/dist/ezui/p-228a4d2f.js +0 -3
- package/dist/ezui/p-2df50161.entry.js +0 -1
- package/dist/ezui/p-4e1df756.entry.js +0 -1
- package/dist/ezui/p-623161e2.js +0 -1
- package/dist/ezui/p-641ee538.js +0 -1
- package/dist/ezui/p-7f8c1fce.entry.js +0 -1
- package/dist/ezui/p-8bb3aeb0.entry.js +0 -1
- package/dist/ezui/p-ba7e908a.entry.js +0 -1
- package/dist/ezui/p-bd6146c5.entry.js +0 -1
- package/dist/ezui/p-c943f7c4.entry.js +0 -1
- package/dist/ezui/p-d0e6911e.entry.js +0 -1
- package/dist/ezui/p-e46a4d06.entry.js +0 -1
- package/dist/ezui/p-f958dcb1.entry.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,r as t,c as i,f as r,H as s,g as o}from"./p-23a36bb6.js";import{ElementIDUtils as a,StringUtils as n,ObjectUtils as l}from"@sankhyalabs/core";import{i as h}from"./p-641ee538.js";const c=(e,t)=>t?e.iconExpanded||"chevron-down":e.iconContracted||"chevron-right",d=e=>e.tooltip||e.label,m=t=>{const{node:i,selectedId:r,itemClick:s,iconClick:o,iconResolver:n,tooltipResolver:l,itemsList:h,itemDoubleClick:c}=t;if(!i.visible)return;const d=i.item,v=t.level||1,u=i.isDisabled(),b=!u&&d.expanded,g=i.isExpandable(),f=!u&&!i.isPlaceHolder;return f&&h.push(d),e("ul",{class:1===v?"first-level":void 0},e("li",Object.assign({title:l(d,!u,v),class:"tree-item "+(d.id!==r?"tree-item-error":""),onClick:()=>f&&s(d),onDblClick:()=>f&&c(d)},{disabled:u,selected:d.id===r,[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:a.getInternalIDInfo(`ezTreeItem_${d.id}`)}),e("div",{class:"item-label-container"},e("div",{class:"item-icon-box"},g&&e("ez-icon",{id:d.id,class:"item-icon",size:"small",iconName:n(d,b,v),onClick:e=>function(e){e.stopPropagation(),f&&o(d)}(e)})),e("label",{class:"item-label "+(d.bold?"item-label--bold":"")},d.label)),function(t,i,r){if(null!=i)return"string"==typeof i?e("div",{class:`tree-item-badge ${r?null:i}`},"error"===i&&e("ez-icon",{id:`${t}-badge-error`,class:"tree-item-badge-error-icon",size:"x-small",style:{color:"white"},iconName:"alert-circle"})):"text"===i.type?e("div",{id:`${t}-badge-text`,class:"tree-item-badge-text"},i.text):e("div",null,e("ez-icon",{id:`${t}-badge-icon`,class:"tree-item-badge-icon",style:{"--ez-icon--color":`var(--ez-tree__badge--icon-color--${i.iconColor||"default"})`},iconName:i.iconName}))}(d.id,d.badge,d.id===r)),b&&i.getChildren().map((t=>e(m,{selectedId:r,node:t,itemClick:s,iconClick:o,level:v+1,iconResolver:n,tooltipResolver:l,itemsList:h,itemDoubleClick:c}))))};class v{constructor(e,t,i,r=!1){this.children=new Map,this.visible=!0,this.item=t,this.parent=i,this._tree=e,this.isPlaceHolder=r,t&&!r?(this._isLazyLoad="function"==typeof t.children||t.childrenCount>0,Array.isArray(t.children)&&(Array.from(t.children).forEach((e=>this.addChild(this._tree,e))),this._childrenLoaded=!0)):(this._isLazyLoad=!1,this._childrenLoaded=!0)}refresh(e){if(this.isPlaceHolder)return;this.item=Object.assign({},e),this._isLazyLoad="function"==typeof this.item.children||this.item.childrenCount>0;const t=this.children;this.children=new Map,Array.isArray(this.item.children)?(void 0===this.item.expanded&&(this.item.expanded=!0),Array.from(this.item.children).forEach((e=>{const i=t.get(e.id);i?(void 0===e.expanded&&(e.expanded=i.item.expanded),i.refresh(e),this.children.set(e.id,i)):(void 0===e.expanded&&(e.expanded=!0),this.addChild(this._tree,Object.assign({},e)))})),this._childrenLoaded=!0):this._childrenLoaded=!1}isDisabled(){return!this.isPlaceHolder&&this._tree.isNodeDisabled(this.item.id,this.item.disabled)}updateChildren(e){this.isPlaceHolder||this.refresh(Object.assign(Object.assign({},this.item),{children:e}))}addChild(e,t){this.children.has(t.id)||this.children.set(t.id,new v(e,t,this))}addPlaceHolder(){this.children.clear();const e=this.item.id;this.children.set(e,new v(void 0,{id:`placeholder_${e}`,label:"Carregando..."},this,!0))}getNode(e){if(this.children.has(e))return this.children.get(e);const t=Array.from(this.children.values());for(const i of t){const t=i.getNode(e);if(t)return t}}needLoad(){return this._isLazyLoad&&!this._childrenLoaded}isExpandable(){return!!this._isLazyLoad||this.children.size>0}getChildren(){return this.isPlaceHolder?[]:(this.needLoad()&&this._tree.loadChildren(this),Array.from(this.children.values()))}}class u extends v{constructor(e){super(void 0),this._disabledValues=new Map,this._changeCallback=e}async addChildAt(e,t){const i=this.getNode(e);null!=i&&(i.addChild(this,t),this._changeCallback())}setDisabled(e,t){this._disabledValues.set(e,t),this._changeCallback()}isNodeDisabled(e,t){return this._disabledValues.has(e)?this._disabledValues.get(e):t}load(e){if(e===this._currentItems)return;this._currentItems=e;const t=this.children;this.children=new Map,this._disabledValues.clear(),e.forEach((e=>{const i=t.get(e.id);i?(i.refresh(e),this.children.set(e.id,i)):this.addChild(this,Object.assign({},e))}))}async setFilterPattern(e,t=!0){if(e&&t&&e.includes(".")){const t=e.split(".").map((e=>n.replaceAccentuatedCharsKeepSymbols(e.trim())));await this.applyLayeredFilter(this,t,0)}else this._filterPattern=n.replaceAccentuatedCharsKeepSymbols(e),this.setAllChildrenExpanded(this,!1),this.applyFilter(this);this._changeCallback()}updateItem(e){if(null==e)return;const t=this.getNode(e.id);null!=t&&(Object.keys(e).forEach((i=>t.item[i]=e[i])),null==e.children?t.children.clear():Array.isArray(e.children)&&t.updateChildren(e.children),this._changeCallback())}async open(e){return new Promise((async t=>{await this.walkPath(this,e,(e=>e.item.expanded=!0)),t()}))}setAllChildrenVisible(e){e.children.forEach((e=>{e.visible=!0,this.setAllChildrenVisible(e)}))}applyFilter(e){if(!this._filterPattern)return e.visible=!0,void this.setAllChildrenVisible(e);if(e.children.forEach((e=>{this.applyFilter(e)})),null==e.item)return;let t=!1;if(n.replaceAccentuatedCharsKeepSymbols(e.item.label).includes(this._filterPattern))t=!0,e.item.expanded=!0,this.setAllChildrenVisible(e);else{const i=Array.from(e.children.values());for(let r=0;r<i.length;r++)if(i[r].visible){t=!0,e.item.expanded=!0;break}}e.visible=t}async applyLayeredFilter(e,t,i){if(!e.item){const r=(await Promise.all(Array.from(e.children.values()).map((e=>this.applyLayeredFilter(e,t,i))))).some(Boolean);return e.visible=r,r}if(!n.replaceAccentuatedCharsKeepSymbols(e.item.label).includes(t[i])){const r=(await Promise.all(Array.from(e.children.values()).map((e=>this.applyLayeredFilter(e,t,i))))).some(Boolean);return r&&(e.item.expanded=!0),e.visible=r,r}if(i===t.length-1)return e.visible=!0,this.setAllChildrenVisible(e),!0;const r=(await Promise.all(Array.from(e.children.values()).map((e=>this.applyLayeredFilter(e,t,i+1))))).some(Boolean);return r&&(e.item.expanded=!0),e.visible=r,r}async walkPath(e,t,i,r=0){return new Promise((async s=>{const o=t.split(">>").map((e=>e.trim()));if(o.length>r){const s=e.getNode(o[r]);s&&(s.needLoad()&&await this.loadLevel(s),i(s),await this.walkPath(s,t,i,r+1))}s()}))}async loadChildren(e){return new Promise((t=>{this.loadLevel(e).then((()=>{t(),this._changeCallback()}))}))}expandAll(){this.setAllChildrenExpanded(this,!0),this._changeCallback()}collapseAll(){this.setAllChildrenExpanded(this,!1),this._changeCallback()}setAllChildrenExpanded(e,t){e.item&&!e.isPlaceHolder&&(e.item.expanded=t),e.children.forEach((e=>{this.setAllChildrenExpanded(e,t)}))}async loadLevel(e){return new Promise((t=>{e.addPlaceHolder(),(0,e.item.children)(e.item).then((i=>{e.updateChildren(i),t()}))}))}}const b=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.ezOpenItem=i(this,"ezOpenItem",7),this.ezDbClickItem=i(this,"ezDbClickItem",7),this._onItemClick=e=>{this._onIconClick(e)},this._onIconClick=e=>{this.openClose(e),this.value=e},this._tree=new u((()=>r(this))),this._waintingForLoad=void 0,this.items=[],this.value=void 0,this.selectedId=void 0,this.iconResolver=c,this.tooltipResolver=void 0,this.enableHierarchicalFilter=!0}async selectItem(e){const t=this._tree.getNode(e);this.value=t?t.item:void 0}async openItem(e){this._waintingForLoad=!0,await this._tree.open(e),this._waintingForLoad=!1}async disableItem(e){[].concat(e).forEach((e=>this._tree.setDisabled(e,!0)))}async enableItem(e){[].concat(e).forEach((e=>this._tree.setDisabled(e,!1)))}async addChild(e,t){var i;null==t&&(t=null===(i=this.value)||void 0===i?void 0:i.id),this._tree.addChildAt(t,e);const r=this._tree.getNode(t);r&&(r.item.expanded=!0)}async applyFilter(e){await this._tree.setFilterPattern(e,this.enableHierarchicalFilter)}async expandAll(){this._tree.expandAll()}async collapseAll(){this._tree.collapseAll()}async updateItem(e){var t;this._tree.updateItem(e),null==(null===(t=this._tree)||void 0===t?void 0:t.getNode(this.selectedId))&&(this.value=this._visibleItems?this._visibleItems[0]:void 0)}async getItem(e){return new Promise((t=>{const i=this._tree.getNode(e);t(null==i?void 0:i.item)}))}async getCurrentPath(){var e,t,i;const r=null===(e=this._tree)||void 0===e?void 0:e.getNode(this.selectedId);if(null==r)return;const s=[];let o,a=null===(t=r.parent)||void 0===t?void 0:t.item;for(s.push(this.getItemPathAttrs(r.item));null!=a;)s.unshift(this.getItemPathAttrs(a)),o=this._tree.getNode(a.id),a=null===(i=null==o?void 0:o.parent)||void 0===i?void 0:i.item;return s}async getParent(e){return new Promise((t=>{var i;const r=this._tree.getNode(e);r&&t(null===(i=r.parent)||void 0===i?void 0:i.item),t(void 0)}))}observeItems(e,t){l.objectToString(e)!==l.objectToString(t)&&this._tree.load(this.items||[])}observeValue(){var e;this.ezChange.emit(this.value),this.selectedId=null===(e=this.value)||void 0===e?void 0:e.id}onKeyDownListener(e){if(!this.value)return;let t=!1;switch(e.key){case"ArrowUp":this.previousItem(),t=!0;break;case"ArrowDown":this.nextItem(),t=!0;break;case"ArrowLeft":this.previousLevel(),t=!0;break;case"ArrowRight":this.nextLevel(),t=!0;break;case" ":this.openClose(this.value),t=!0}t&&(e.stopPropagation(),e.preventDefault())}getItemPathAttrs({id:e,label:t}){return{id:e,label:t}}openClose(e){if(null==e)return;const t=!e.expanded;e.expanded=t,t&&this.ezOpenItem.emit(e),this._tree.updateItem(e)}previousLevel(){var e;if(this.value)if(this.value.expanded)this.value.expanded=!1,this._tree.updateItem(this.value);else{const t=null===(e=this._tree.getNode(this.value.id).parent)||void 0===e?void 0:e.item;t&&(this.value=t)}}nextLevel(){this.value&&this._tree.getNode(this.value.id).isExpandable()&&(this.value.expanded?this.nextItem():(this.value.expanded=!0,this._tree.updateItem(this.value)))}indexOf(e){if(null==e)return-1;for(let t=0;t<this._visibleItems.length;t++)if(this._visibleItems[t].id===e)return t;return-1}selectNextItem(e){var t;const i=this.indexOf(null===(t=this.value)||void 0===t?void 0:t.id)+e;i>-1&&i<this._visibleItems.length&&(this.value=this._visibleItems[i])}nextItem(){this.selectNextItem(1)}previousItem(){this.selectNextItem(-1)}connectedCallback(){this.items&&this._tree.load(this.items)}async componentWillLoad(){this.i18n=await h()}componentWillRender(){var e;if(!this.selectedId||(null===(e=this.value)||void 0===e?void 0:e.id)===this.selectedId)return;const t=this._tree.getNode(this.selectedId);t&&(this.value=t.item)}render(){if(a.addIDInfoIfNotExists(this._element,"ezTree"),null!=this.items)return this._visibleItems=[],e(s,{tabindex:"-1"},this._waintingForLoad?e("label",null,this.i18n("app.loading"),"..."):this._tree.getChildren().map((t=>{var i;return e(m,{selectedId:null===(i=this.value)||void 0===i?void 0:i.id,node:t,itemClick:this._onItemClick,iconClick:this._onIconClick,iconResolver:this.iconResolver,tooltipResolver:this.tooltipResolver||d,itemsList:this._visibleItems,itemDoubleClick:e=>this.ezDbClickItem.emit(e)})})))}get _element(){return o(this)}static get watchers(){return{items:["observeItems"],value:["observeValue"]}}};b.style=":host{--ez-tree--border-radius:var(--border--radius-small, 8px);--ez-tree--padding-inline-start:20px;--ez-tree--margin:var(--space--extra-small, 3px);--ez-tree--margin-right:0px;--ez-tree--font-family:var(--font-pattern, Arial);--ez-tree--font-size:var(--text--medium, 14px);--ez-tree--selected--font-weight:var(--text-weight--large, 600);--ez-tree--font-weight:var(--text-weight--small, 400);--ez-tree--color:var(--title--primary, #2B3A54);--ez-tree--selected--color:var(--color--primary, #008561);--ez-tree--disabled--color:var(--text--disable, #AFB6C0);--ez-tree--font-weight--bold:var(--text-weight--large, 600);--ez-tree__tree-item--height:var(--size-medium, 18px);--ez-tree__tree-item--padding:var(--space--small, 6px);--ez-tree__tree-item--background-color:var(--background--xlight, #FFFFFF);--ez-tree__tree-item--selected--background-color:var(--color--primary-300, #E2F4EF);--ez-tree__tree-item--hover--background-color:var(--background--medium, #F0F3F7);--ez-tree__tree-item--disabled--background-color:var(--ez-tree__tree-Item--background-color);--ez-tree__item-icon-box--height:var(--ez-tree__tree-item--height);--ez-tree__item-icon-box--width:var(--size-medium, 18px);--ez-tree__item-icon-box--padding:var(--ez-tree__tree-item--padding);--ez-tree__badge--icon-color--default:var(--title--primary, #2B3A54);--ez-tree__badge--icon-color--error:var(--color--error, #da4453);--ez-tree__badge--icon-color--success:var(--color-alert--success-800, #157a00);--ez-tree__badge--icon-color--warning:var(--color--warning, #f2d410);--ez-tree__badge--icon-color--disabled:var(--text--disable, #AFB6C0);display:flex;flex-direction:column;margin:0 var(--ez-tree--margin) var(--ez-tree--margin) var(--ez-tree--margin);outline:none}ul{list-style-type:none;margin:0;cursor:default;padding-inline-start:var(--ez-tree--padding-inline-start)}ul.first-level{padding-inline-start:0}.tree-item-badge{width:16px;height:16px;background:transparent;border-radius:50%;transition:all 300ms ease-in-out;display:flex;align-items:center;justify-content:center}.tree-item-badge-error-icon{--ez-icon--color:white}.tree-item-badge-text{font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.tree-item-badge.error{background:var(--color--error)}.tree-item-badge.warning{background:var(--color--warning)}.tree-item-badge.success{background:var(--color--success)}.item-label-container{display:flex;align-items:center;overflow:hidden}.tree-item{display:flex;align-items:center;cursor:pointer;margin-top:var(--ez-tree--margin);margin-right:var(--ez-tree--margin-right);border-radius:var(--ez-tree--border-radius);height:var(--ez-tree__tree-item--height);padding:var(--ez-tree__tree-item--padding);justify-content:space-between}.tree-item[selected]{background-color:var(--ez-tree__tree-item--selected--background-color)}.tree-item:hover{background-color:var(--ez-tree__tree-item--hover--background-color)}.tree-item[disabled],.tree-item[disabled]:hover{background-color:var(--ez-tree__tree-item--disabled--background-color)}.item-icon-box{display:flex;align-items:center;justify-content:center;width:var(--ez-tree__item-icon-box--width);height:var(--ez-tree__item-icon-box--height);padding:var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) var(--ez-tree__item-icon-box--padding) 0}.item-icon{--ez-icon--color:var(--ez-tree--color)}.item-icon:hover{cursor:pointer}.tree-item[selected] .item-icon{--ez-icon--color:var(--ez-tree--selected--color)}.tree-item[disabled] .item-icon{cursor:unset;--ez-icon--color:var(--ez-tree--disabled--color)}.item-label{cursor:inherit;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-family:var(--ez-tree--font-family);font-size:var(--ez-tree--font-size);font-weight:var(--ez-tree--font-weight);color:var(--ez-tree--color)}.item-label--bold{font-weight:var(--ez-tree--font-weight--bold)}.tree-item[selected] .item-label{color:var(--ez-tree--selected--color);font-weight:var(--ez-tree--selected--font-weight)}.tree-item[disabled] .item-label{color:var(--ez-tree--disabled--color)}";export{b as ez_tree}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as h}from"./p-23a36bb6.js";import{C as o}from"./p-ec7db713.js";import{ObjectUtils as r,StringUtils as n,ElementIDUtils as a}from"@sankhyalabs/core";import{A as l}from"./p-5a11cf56.js";import"./p-ab574d59.js";import"./p-b853763b.js";import{i as c}from"./p-641ee538.js";import"./p-30ffb9ed.js";import{r as d,a as u}from"./p-40a60148.js";const v=class{constructor(s){t(this,s),this.ezChange=i(this,"ezChange",7),this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=300,this._maxWidthValue=0,this._tabPressed=!1,this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this._preSelection=void 0,this._visibleOptions=void 0,this._startLoading=!1,this._showLoading=!0,this._showLoadingDescription=!1,this._criteria=void 0,this.value=void 0,this.label=void 0,this.enabled=!0,this.errorMessage=void 0,this.optionLoader=void 0,this.contextProperties=void 0,this.showSelectedValue=!0,this.showOptionValue=!0,this.suppressEmptyOption=!1,this.stopPropagateEnterKeyEvent=!1,this.mode="regular",this.canShowError=!0,this.hideErrorOnFocusOut=!0,this.listOptionsPosition=void 0,this.isTextSearch=!1,this.ignoreLimitCharsToSearch=!1,this.options=void 0,this.suppressSearch=!1,this.ensureClearButtonVisible=!1,this.suppressPreLoad=!0,this.autoFocus=!1,this.alternativePlaceholder=void 0,this.showMore=void 0,this.suppressInputPersist=!1}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,!(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())&&this.errorMessage&&this.setInputValue())}getValue(t){return"object"==typeof t?null==t?void 0:t.value:t}validateNewValue(t,i){const s=this.getValue(t),e=this.getValue(i);return!("[object Object]"===s||s===e)}async observeValue(t,i){if(this._textInput&&this.validateNewValue(t,i)){if("string"==typeof t)return void await this.handleValueAsString(t);const i=this.getSelectedOption(t),s=this.getSelectedOption(this._currentValue);this.isDifferentValues(s,i)&&(this._currentValue=i,this.setInputValue(),this.ezChange.emit(null!=i?i:void 0)),this.resetOptions()}}observeOptions(t,i){!t.length&&this.suppressPreLoad||(null==t?void 0:t.join(""))!==(null==i?void 0:i.join(""))&&this.loadOptions(p.PRELOAD)}async getValueAsync(){return new Promise(this._showLoading?t=>{let i=setInterval((()=>{this._showLoading||(clearInterval(i),t(this.value))}),100)}:t=>t(this.value))}async setFocus(t){this._textInput&&this._textInput.setFocus(t)}async setBlur(){this._textInput&&this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async clearValue(){this.clearSearch()}async handleValueAsString(t){this.getSelectedOption(t)?this.setInputValue():(await this.loadDescriptionValue(t),this._currentValue&&(this.setInputValue(),this.ezChange.emit(this.value),this._currentValue=this.value))}isDifferentValues(t,i){return r.objectToString(t||{})!==r.objectToString(i||{})}getFormattedText(t){if(null==t)return;let i=this.showSelectedValue&&null!=t.value?t.label?`${t.value} - ${t.label}`:t.value:t.label;return i=null==i?void 0:i.replace(new RegExp(this._startHighlightTag,"g"),"").replace(new RegExp(this._endHighlightTag,"g"),""),i}getText(){const t=this.getSelectedOption(this._currentValue),i=this.getFormattedText(t);return d(i)}getSelectedOption(t){return"string"==typeof t||t instanceof String?this._visibleOptions.find((i=>i.value===t)):t?Object.assign(Object.assign({},t),{value:u(null==t?void 0:t.value),label:u(null==t?void 0:t.label)}):t}updateVisibleOptions(){let t=this._source||[];this._visibleOptions=this.suppressEmptyOption?t:[{value:void 0,label:""}].concat(t),this._maxWidthValue=this.getMaxWidthValue()}getMaxWidthValue(){var t;const i=[];return null===(t=this._visibleOptions)||void 0===t||t.forEach((t=>{const s=this.getWidthValue(t.value);i.includes(s)||i.push(s)})),i.length>1?Math.max(...i):0}getWidthValue(t){if(null!=this._itemValueBasis){const i=this._itemValueBasis;if(null!=t)return i.innerHTML=t,i.clientWidth>0?i.clientWidth+2:0;i.innerHTML=""}return 0}showOptions(){this.enabled&&(this.isOptionsVisible()||this._ezPopOverPlusElement.showUnder(this._textInput))}hideOptions(){this._ezPopOverPlusElement.hide()}isOptionsVisible(){return this._ezPopOverPlusElement.opened}selectCurrentOption(t=!0){void 0!==this._preSelection?(this.selectOption(this._visibleOptions[this._preSelection],t),this._preSelection=void 0):this.controlListWithOnlyOne()}updateSource(t){this._startLoading=!1,t instanceof Promise?(this._showLoading=!0,this._showLoadingDescription=!0,t.then((t=>{this.updateSource(t)})).finally((()=>{this._showLoading=!1,this._showLoadingDescription=!1})),this.updateVisibleOptions()):(this._showLoading=!1,Array.isArray(t)?(this._source=t,this.updateVisibleOptions(),this._tabPressed&&(this._tabPressed=!1,this.controlEmptySearch(!1))):this.selectOption(t))}clearSource(){this._source=[],this.updateVisibleOptions()}selectOption(t,i=!0){var s,e;const h=this.getSelectedOption(this.value),o=Object.assign(Object.assign({},t),{value:u(null==t?void 0:t.value),label:u(null==t?void 0:t.label)}),r=Object.assign(Object.assign({},o),{value:d(null==o?void 0:o.value),label:d(null==o?void 0:o.label)});if((null===(s=null==h?void 0:h.value)||void 0===s?void 0:s.toString())!==(null===(e=null==r?void 0:r.value)||void 0===e?void 0:e.toString())||null==h&&null!=r&&"value"in r){const t=(null==r?void 0:r.value)?r:void 0;this.value=t,this._currentValue=t}else this.setInputValue(),this.resetOptions();this._visibleOptions=[],this.clearSource(),i&&setTimeout((()=>{this.setFocus()}),0)}loadOptions(t,i=""){this._criteria=i,this._startLoading=!0,this.updateSource(this.optionLoader?this.optionLoader({mode:t,argument:i},this.contextProperties):this.options)}cancelPreselection(){!this._textInput.value&&this._currentValue&&this._source.length>0?this.selectOption(void 0):window.setTimeout((()=>{this.setInputValue()}),this._deboucingTime),this.resetOptions()}setInputValue(t=!0){if(this.suppressInputPersist)return void this.clearSearch();const i=this.getText();(this._textInput.value||"")!==i&&(this._textInput.value=i,t&&(this.errorMessage=null))}clearSearch(){this.value=null,this._currentValue=null,this._textInput.value=""}controlListWithOnlyOne(t=!0){var i,s;const e=null===(i=this._visibleOptions)||void 0===i?void 0:i.filter((t=>""!==t.label&&null!=t.value));if((null==e?void 0:e.length)>0){const i=new RegExp(this._startHighlightTag,"g"),h=new RegExp(this._endHighlightTag,"g");let o=n.decodeHtmlEntities(e[0].label);const r={value:null===(s=e[0].value)||void 0===s?void 0:s.replace(i,"").replace(h,""),label:null==o?void 0:o.replace(i,"").replace(h,"")};this.selectOption(r,t)}}controlEmptySearch(t=!0){var i;(null===(i=this._visibleOptions)||void 0===i?void 0:i.length)?this.controlListWithOnlyOne(t):(this.clearSearch(),l.info(this.i18n("ez-search.emptyList")))}async loadDescriptionValue(t){var i,s;if(null==t)return;if((null===(i=this.options)||void 0===i?void 0:i.length)>0)return void this.loadOptionValue(t);const e={mode:p.PREDICTIVE,argument:t},h=await(null===(s=this.optionLoader)||void 0===s?void 0:s.call(this,e,this.contextProperties));null!=h&&(h instanceof Promise?h.then((t=>{this.setDescriptionValue(t)})):this.setDescriptionValue(h))}setDescriptionValue(t){const i=(null==t?void 0:t[0])||t;null!=i&&Object.keys(i).length?(this._currentValue=i?Object.assign(Object.assign({},i),{value:u(i.value),label:u(i.label)}):i,this.value=this._currentValue,this.setTextInputValue()):this.showNoResultMessage()}setTextInputValue(){if(this._textInput&&null==this._textInput.value){if(null==this.value)return;const t="string"==typeof this.value?this.value:this.getFormattedText(this.value);this._textInput.value=d(t)}}loadOptionValue(t){var i;const s=null===(i=this.options)||void 0===i?void 0:i.find((i=>i.value===t));null!=s?this.selectOption(s):this.showNoResultMessage()}async showNoResultMessage(){this.clearSearch(),l.info(this.i18n("ez-search.emptySearch",{field:this.getFieldLabel()}))}getFieldLabel(){var t;return null===(t=this.label)||void 0===t?void 0:t.replace(this.i18n("app.requiredInfo"),"").toUpperCase()}resetOptions(){this.showMore?this.handleResetOptionsWithShowMoreVisible():(this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions())}handleResetOptionsWithShowMoreVisible(){setTimeout((()=>{this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}),100)}async handleInitialValue(){if(!this.getValue(this.value))return;if("string"==typeof this.value)return void await this.handleValueAsString(this.value);let t=this.getFormattedText(this.value);t=d(t),this._textInput.value=t}async componentWillLoad(){if(this.i18n=await c(),void 0===this.options){this.options=[];const t=this.el.querySelectorAll("option");t&&t.forEach((t=>{let i=t.innerText,s=t.getAttribute("value"),e=t.getAttribute("details");s||(s=i),this.options.push({label:i,value:s,details:e}),t.hidden=!0}))}this.updateSource([])}componentDidRender(){var t;null===(t=this._optionsList)||void 0===t||t.querySelectorAll(".item").forEach((t=>{a.addIDInfoIfNotExists(t,"itemSearch")}))}async componentDidLoad(){this._currentValue=this.value,o.applyVarsTextInput(this.el,this._textInput),this._resizeObserver=new ResizeObserver((t=>{window.requestAnimationFrame((()=>{Array.isArray(t)}))})),this._intersectionObserver=new IntersectionObserver((t=>{t.forEach((t=>{!t.isIntersecting&&this._ezPopOverPlusElement&&this._ezPopOverPlusElement.hide()}))}),{threshold:.1}),this._textInput&&this._intersectionObserver.observe(this._textInput),await this.handleInitialValue(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}disconnectedCallback(){var t,i;null===(t=this._resizeObserver)||void 0===t||t.disconnect(),null===(i=this._intersectionObserver)||void 0===i||i.disconnect()}handlerIconClick(){this.loadOptions(p.ADVANCED)}buildNumberArgument(t){return this.isTextSearch?NaN:Number(t||void 0)}onTextInputChangeHandler(t){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=window.setTimeout((()=>{this.onTextInputChangeHandler(t)}),this._deboucingTime));const s=null===(i=t.target.value)||void 0===i?void 0:i.trim(),e=this.buildNumberArgument(s);this._criteria||(this._textInput.value=t.data||s),this._criteria=s,s?(this._showLoading=!1,this.clearSource(),this.ignoreLimitCharsToSearch||!isNaN(e)||s.length>=this._limitCharsToSearch?(this._showLoading=!0,this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions(p.PREDICTIVE,isNaN(e)?s:e.toString())}),this._deboucingTime),this.showOptions()):this.hideOptions()):(this.hideOptions(),this._showLoading=!1,this.clearSource())}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=null)}async keyDownHandler(t){switch(this._tabPressed=!1,t.ctrlKey&&("f"!==t.key&&"F"!==t.key||(this.loadOptions(p.ADVANCED),t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault())),t.key){case"ArrowDown":t.stopPropagation(),this.canShowListOptions()&&t.preventDefault(),this.isOptionsVisible()||this.showOptions(),await this._searchList.nextOption();break;case"ArrowUp":t.stopPropagation(),this.canShowListOptions()&&t.preventDefault(),await this._searchList.previousOption();break;case"Enter":this.handleEventPropagation(t),this.selectCurrentOption();break;case"Escape":this.cancelPreselection();break;case"Tab":this._tabPressed=!0,this.selectCurrentOption(!1)}}handleEventPropagation(t){this._ezPopOverPlusElement.opened&&this.stopPropagateEnterKeyEvent&&t.stopPropagation()}onTextInputFocusOutHandler(){this.hideErrorOnFocusOut&&this.cancelPreselection()}canShowListOptions(){return!this._showLoading&&this._visibleOptions.length>0}canShowLoadSpinDescription(){return this._showLoadingDescription&&!this._ezPopOverPlusElement.opened}onChangePreSelection(t){this._preSelection=t}async handleClickShowMore(){var t,i;if(!this.optionLoader)return;const s=null!==(i=null===(t=this._textInput)||void 0===t?void 0:t.value)&&void 0!==i?i:"",e={mode:p.ADVANCED,argument:s},h=await this.optionLoader(e,this.contextProperties);h&&!Array.isArray(h)&&this.selectOption(h)}renderShowMore(){if(this.showMore&&!this._showLoading)return s("div",{style:{display:"flex",justifyContent:"center"},"data-element-id":a.getInternalIDInfo("showMore")},s("ez-button",{onClick:async()=>await this.handleClickShowMore(),variant:"tertiary",style:{width:"100%",justifyContent:"center"},label:this.i18n("ez-search.showMore")}))}render(){var t;return a.addIDInfoIfNotExists(this.el,"input"),s(e,null,s("ez-text-input",{"data-element-id":a.getInternalIDInfo("textInput"),class:this.suppressSearch?"suppressed-search-input":"",ref:t=>this._textInput=t,"data-slave-mode":"true",enabled:this.enabled&&!this.suppressSearch,onInput:t=>this.onTextInputChangeHandler(t),onFocusout:()=>this.onTextInputFocusOutHandler(),onKeyDown:t=>this.keyDownHandler(t),label:this.label,canShowError:this.canShowError,errorMessage:this.errorMessage,mode:this.mode,alternativePlaceholder:this.alternativePlaceholder},s("button",{class:"btn",slot:"leftIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.handlerIconClick()},this.canShowLoadSpinDescription()?s("div",{class:"message__loading"}):s("ez-icon",{iconName:"search"})),(null===(t=this._textInput)||void 0===t?void 0:t.value)&&(this._criteria||this.value)||this.ensureClearButtonVisible?s("button",{class:"btn btn__close",slot:"rightIcon",disabled:!this.enabled,tabindex:-1,onClick:()=>this.clearSearch()},s("ez-icon",{iconName:"close"})):void 0),s("ez-popover-plus",{ref:t=>this._ezPopOverPlusElement=t,autoClose:!1,overlayType:"none",useAnchorSize:!0,anchorElement:[this._textInput,this.el],"data-element-id":this.el.getAttribute("data-element-id"),onEzVisibilityChange:t=>t.stopPropagation()},s("div",null,s("search-list",{ref:t=>this._searchList=t,showLoading:this._showLoading,visibleOptions:this._visibleOptions,textEmptyList:this.i18n("ez-search.emptyList"),canShowListOptions:this.canShowListOptions(),value:this.value,showOptionValue:this.showOptionValue,preSelection:this._preSelection,onChangeValue:({detail:t})=>this.selectOption(t),onChangePreSelection:({detail:t})=>this.onChangePreSelection(t)}),this.renderShowMore())))}get el(){return h(this)}static get watchers(){return{errorMessage:["observeErrorMessage"],value:["observeValue"],options:["observeOptions"]}}};var p;!function(t){t.ADVANCED="ADVANCED",t.PRELOAD="PRELOAD",t.PREDICTIVE="PREDICTIVE"}(p||(p={})),v.style=":host{--ez-search--height:42px;--ez-search--width:100%;--ez-search__icon--width:48px;--ez-search--border-radius:var(--border--radius-medium, 12px);--ez-search--border-radius-small:var(--border--radius-small, 6px);--ez-search--font-size:var(--text--medium, 14px);--ez-search--font-family:var(--font-pattern, Arial);--ez-search--font-weight--large:var(--text-weight--large, 500);--ez-search--font-weight--medium:var(--text-weight--medium, 400);--ez-search--background-color--xlight:var(--background--xlight, #fff);--ez-search--background-medium:var(--background--medium, #f0f3f7);--ez-search--line-height:calc(var(--text--medium, 14px) + 4px);--ez-search__input--background-color:var(--background--medium, #e0e0e0);--ez-search__input--border:var(--border--medium, 2px solid);--ez-search__input--border-color:var(--ez-search__input--background-color);--ez-search__input--focus--border-color:var(--color--primary, #008561);--ez-search__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-search__input--disabled--color:var(--text--disable, #AFB6C0);--ez-search__input--error--border-color:#CC2936;--ez-search__btn--color:var(--title--primary, #2B3A54);--ez-search__btn-disabled--color:var(--text--disable, #AFB6C0);--ez-search__btn-hover--color:var(--color--primary, #4e4e4e);--ez-search__label--color:var(--title--primary, #2B3A54);--ez-search--space--medium:var(--space--medium, 12px);--ez-search--space--small:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-search--width)}ez-icon{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.suppressed-search-input{--ez-text-input__input--border-color:var(--color--strokes, #dce0e8);--ez-text-input__input--disabled--background-color:var(--background--xlight, #fff);--ez-text-input__input--disabled--color:var(--title--primary, #2B3A54)}.btn{outline:none;border:none;background:none;cursor:pointer;color:var(--ez-search__btn--color)}.btn:disabled{cursor:not-allowed;color:var(--ez-search__btn-disabled--color)}.btn:disabled:hover{cursor:not-allowed;color:var(--ez-search__btn-disabled--color)}.btn:hover{color:var(--ez-search__btn-hover--color)}.btn__close{visibility:hidden}ez-text-input:hover .btn__close,ez-text-input:focus .btn__close{visibility:visible}";export{v as ez_search}
|
package/dist/ezui/p-14807f4e.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i}from"./p-641ee538.js";const o=async function(){await i(),console.log("Global initialization ez-ui completed!")};export{o as g}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as o,H as a,g as i}from"./p-23a36bb6.js";import{KeyboardManager as n}from"@sankhyalabs/core";import{i as s}from"./p-641ee538.js";var l;!function(e){e.CLOSE="CLOSE",e.OK="OK",e.CANCEL="CANCEL",e.LOAD="LOAD"}(l||(l={}));const r=l;var c;!function(e){e.ENABLED="ENABLED",e.DISABLED="DISABLED",e.HIDDEN="HIDDEN"}(c||(c={}));const d=c,h=class{constructor(o){e(this,o),this.ezModalAction=t(this,"ezModalAction",7),this.modalTitle=void 0,this.modalSubTitle=void 0,this.showTitleBar=!0,this.cancelButtonLabel=void 0,this.okButtonLabel=void 0,this.cancelButtonStatus=void 0,this.okButtonStatus=void 0,this.showCloseButton=!0}async handleEzModalAction(e){var t;(null==e?void 0:e.target)&&(null==e?void 0:e.target)===(null===(t=this._element)||void 0===t?void 0:t.parentElement)&&this.closeModal()}cancelIsVisible(){return this.cancelButtonStatus!==d.HIDDEN&&null!=this.cancelButtonLabel}okIsVisible(){return this.okButtonStatus!==d.HIDDEN&&null!=this.okButtonLabel}async componentWillLoad(){this.i18n=await s()}componentDidLoad(){window.requestAnimationFrame((()=>{this.ezModalAction.emit(r.LOAD),this._modalRef.focus()})),this._keyboardManager=new n({propagate:!1,element:this._element}).bind("Enter",this.ezModalAction.emit.bind(r.OK)).bind("Escape",(()=>this.closeModal())).bind("Esc",(()=>this.closeModal()))}disconnectedCallback(){var e;null===(e=this._keyboardManager)||void 0===e||e.unbindAllShortcutKeys()}closeModal(){this.ezModalAction.emit("CLOSE")}focusLast(){null!=this._okButton&&this._okButton.setFocus()}focusFirst(){this._closeButton.focus()}render(){return o(a,null,o("button",{class:"ez-modal-container__focus-ctrl",onFocusin:()=>this.focusLast()}),o("div",{ref:e=>this._modalRef=e,tabIndex:-1,class:"ez-modal-container__header-container"},this.showTitleBar&&o("div",{class:"ez-modal-container__header ez-margin-bottom--medium"},o("div",{class:"ez-col ez-align--middle ez-modal-container__title"},o("h2",{class:"ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small"},this.modalTitle),this.modalSubTitle&&o("div",{class:"ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small"},this.modalSubTitle)),this.showCloseButton&&o("button",{ref:e=>this._closeButton=e,class:"ez-modal-container__close-button",onClick:()=>this.ezModalAction.emit(r.CLOSE),"aria-label":this.i18n("app.close")},o("ez-icon",{class:"ez-modal-container__close-icon",size:"medium",iconName:"close"})))),o("div",{tabIndex:-1,class:"ez-modal-container__content"},o("slot",null)),o("div",{tabIndex:-1,class:"ez-modal-container__footer"},this.cancelIsVisible()&&o("ez-button",{label:this.cancelButtonLabel||this.i18n("app.cancel"),enabled:this.cancelButtonStatus!==d.DISABLED,onClick:()=>this.ezModalAction.emit(r.CANCEL)}),this.okIsVisible()&&o("ez-button",{ref:e=>this._okButton=e,class:"ez-button--primary",label:this.okButtonLabel||this.i18n("app.ok"),enabled:this.okButtonStatus!==d.DISABLED,onClick:()=>this.ezModalAction.emit(r.OK)})),o("button",{class:"ez-modal-container__focus-ctrl",onFocusin:()=>this.focusFirst()}))}get _element(){return i(this)}};h.style=".sc-ez-modal-container-h{--ez-modal-container-overflow-y:auto;--ez-modal-container-overflow-x:hidden;display:grid;grid-template-rows:0 auto 1fr auto 0;width:100%;height:100%}.ez-modal-container__header-container.sc-ez-modal-container{outline:none}.ez-modal-container__header.sc-ez-modal-container{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:space-between;align-items:start}.ez-modal-container__content.sc-ez-modal-container{overflow-y:var(--ez-modal-container-overflow-y);overflow-x:var(--ez-modal-container-overflow-x);outline:none}.ez-modal-container__content.sc-ez-modal-container::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}.ez-modal-container__footer.sc-ez-modal-container{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium);width:100%;padding-top:var(--space--small, 6px)}.ez-modal-container__title.sc-ez-modal-container{display:grid}.ez-modal-container__close-button.sc-ez-modal-container{cursor:pointer;background-color:transparent;border:none;outline:none;padding:var(--space--6, 6px) 0px}.ez-modal-container__close-icon.sc-ez-modal-container{--icon--color:var(--title--primary, #2B3A54)}.ez-modal-container__focus-ctrl.sc-ez-modal-container{height:0px;background-color:transparent;border:none}";export{h as ez_modal_container}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as d,h as i,H as o,g as l}from"./p-23a36bb6.js";import{FloatingManager as e,KeyboardManager as a}from"@sankhyalabs/core";import{i as n}from"./p-641ee538.js";const s=class{constructor(i){t(this,i),this.ezCloseModal=d(this,"ezCloseModal",7),this.ezOpenModal=d(this,"ezOpenModal",7),this.ezModalAction=d(this,"ezModalAction",7),this.modalSize=void 0,this.align=void 0,this.heightMode="regular",this.opened=!0,this.closeEsc=!1,this.closeOutsideClick=!1,this.closeOutsideLeave=!1,this.scrim="medium"}observeOpened(){this.opened?this._overlayId=e.subscribeOverlayControl(this._modalRef):e.unsubscribeOverlayControl(this._modalRef||this._overlayId)}closeModal(){this.opened=!1,this.ezCloseModal.emit(this.opened)}async componentWillLoad(){this.i18n=await n()}componentDidLoad(){this.observeOpened(),this._keyboardManager=new a({propagate:!1,element:this._element,enableShadowDom:!0}).bind("Enter",this.ezModalAction.emit.bind("OK")).bind("Escape",(()=>this.closeModal())).bind("Esc",(()=>this.closeModal()))}componentDidRender(){this.modalFocus()}disconnectedCallback(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}modalFocus(){this.opened&&requestAnimationFrame((()=>{const t=this._element.shadowRoot.querySelector("ez-modal-container");this._modalRef&&null===t&&this._modalRef.focus()}))}onMouseDownHandler(t){this.closeOutsideClick&&t.target===this._overlay&&this.closeModal()}onMouseLeaveHandler(){this.closeOutsideLeave&&this.closeModal()}render(){const t="left"===this.align?"left":"right",d="regular"===this.heightMode?`modal__content--${t}`:"";return i(o,null,this.opened?i("div",{ref:t=>this._modalRef=t,class:`modal modal__screen-${this.scrim} ${"regular"===this.heightMode?"modal__vertical-padding":""}`,onMouseDown:t=>this.onMouseDownHandler(t),tabIndex:-1,"aria-label":this.i18n("ez-modal.close")},i("div",{class:`modal__container modal__container--${t}`,ref:t=>this._overlay=t},i("div",{onMouseLeave:()=>this.onMouseLeaveHandler(),class:`modal__content ${d} ${this.modalSize}`},i("slot",null)))):void 0)}get _element(){return l(this)}static get watchers(){return{opened:["observeOpened"]}}};s.style=":host{--ez-modal-z-index:var(--elevation--22, 22);--ez-modal-vertical-padding:var(--space--large, 24px);--ez-modal-content-padding:24px;display:block}.modal{position:fixed;display:flex;top:0px;z-index:var(--ez-modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;outline:none}.modal__screen-light{background:rgba(0, 4, 12, 0.1)}.modal__screen-none{background:none}.modal__screen-medium{backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.modal__vertical-padding{padding:var(--ez-modal-vertical-padding) 0}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;box-sizing:border-box;max-height:100%;height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:var(--ez-modal-content-padding);box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";export{s as ez_modal}
|
package/dist/ezui/p-228a4d2f.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{c as t,a as e}from"./p-112455b1.js";var n=t((function(t){
|
|
2
|
-
/*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE */
|
|
3
|
-
t.exports=function(){const{entries:t,setPrototypeOf:e,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:i}=Object;let{freeze:r,seal:a,create:l}=Object,{apply:s,construct:c}="undefined"!=typeof Reflect&&Reflect;r||(r=function(t){return t}),a||(a=function(t){return t}),s||(s=function(t,e){for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return t.apply(e,o)}),c||(c=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return new t(...n)});const u=k(Array.prototype.forEach),f=k(Array.prototype.lastIndexOf),p=k(Array.prototype.pop),m=k(Array.prototype.push),d=k(Array.prototype.splice),h=k(String.prototype.toLowerCase),g=k(String.prototype.toString),y=k(String.prototype.match),b=k(String.prototype.replace),w=k(String.prototype.indexOf),x=k(String.prototype.trim),v=k(Object.prototype.hasOwnProperty),T=k(RegExp.prototype.test),S=(A=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return c(A,e)});var A;function k(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return s(t,e,o)}}function E(t,o){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;e&&e(t,null);let r=o.length;for(;r--;){let e=o[r];if("string"==typeof e){const t=i(e);t!==e&&(n(o)||(o[r]=t),e=t)}t[e]=!0}return t}function R(t){for(let e=0;e<t.length;e++)v(t,e)||(t[e]=null);return t}function _(e){const n=l(null);for(const[o,i]of t(e))v(e,o)&&(n[o]=Array.isArray(i)?R(i):i&&"object"==typeof i&&i.constructor===Object?_(i):i);return n}function z(t,e){for(;null!==t;){const n=i(t,e);if(n){if(n.get)return k(n.get);if("function"==typeof n.value)return k(n.value)}t=o(t)}return function(){return null}}const D=r(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),O=r(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","slot","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),L=r(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),M=r(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),I=r(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),F=r(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),P=r(["#text"]),N=r(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),C=r(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),j=r(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),U=r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),H=a(/\$\{[\w\W]*/gm),q=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),Y=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$=a(/^(?:\w+script|data):/i),G=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var J=Object.freeze({__proto__:null,ARIA_ATTR:Y,ATTR_WHITESPACE:G,CUSTOM_ELEMENT:V,DATA_ATTR:q,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:$,MUSTACHE_EXPR:B,TMPLIT_EXPR:H});const Q=1,Z=3,tt=7,et=8,nt=9,ot=function(){return"undefined"==typeof window?null:window},it=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";e&&e.hasAttribute(o)&&(n=e.getAttribute(o));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};var rt=function e(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ot();const o=t=>e(t);if(o.version="3.2.7",o.removed=[],!n||!n.document||n.document.nodeType!==nt||!n.Element)return o.isSupported=!1,o;let{document:i}=n;const a=i,s=a.currentScript,{DocumentFragment:c,HTMLTemplateElement:A,Node:k,Element:R,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:H,DOMParser:q,trustedTypes:Y}=n,$=R.prototype,G=z($,"cloneNode"),V=z($,"remove"),rt=z($,"nextSibling"),at=z($,"childNodes"),lt=z($,"parentNode");if("function"==typeof A){const t=i.createElement("template");t.content&&t.content.ownerDocument&&(i=t.content.ownerDocument)}let st,ct="";const{implementation:ut,createNodeIterator:ft,createDocumentFragment:pt,getElementsByTagName:mt}=i,{importNode:dt}=a;let ht={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof t&&"function"==typeof lt&&ut&&void 0!==ut.createHTMLDocument;const{MUSTACHE_EXPR:gt,ERB_EXPR:yt,TMPLIT_EXPR:bt,DATA_ATTR:wt,ARIA_ATTR:xt,IS_SCRIPT_OR_DATA:vt,ATTR_WHITESPACE:Tt,CUSTOM_ELEMENT:St}=J;let{IS_ALLOWED_URI:At}=J,kt=null;const Et=E({},[...D,...O,...L,...I,...P]);let Rt=null;const _t=E({},[...N,...C,...j,...U]);let zt=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Dt=null,Ot=null,Lt=!0,Mt=!0,It=!1,Ft=!0,Pt=!1,Nt=!0,Ct=!1,jt=!1,Ut=!1,Bt=!1,Wt=!1,Ht=!1,qt=!0,Yt=!1;const Xt="user-content-";let $t=!0,Gt=!1,Kt={},Vt=null;const Jt=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Qt=null;const Zt=E({},["audio","video","img","source","image","track"]);let te=null;const ee=E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ne="http://www.w3.org/1998/Math/MathML",oe="http://www.w3.org/2000/svg",ie="http://www.w3.org/1999/xhtml";let re=ie,ae=!1,le=null;const se=E({},[ne,oe,ie],g);let ce=E({},["mi","mo","mn","ms","mtext"]),ue=E({},["annotation-xml"]);const fe=E({},["title","style","font","a","script"]);let pe=null;const me=["application/xhtml+xml","text/html"],de="text/html";let he=null,ge=null;const ye=i.createElement("form"),be=function(t){return t instanceof RegExp||t instanceof Function},we=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ge||ge!==t){if(t&&"object"==typeof t||(t={}),t=_(t),pe=-1===me.indexOf(t.PARSER_MEDIA_TYPE)?de:t.PARSER_MEDIA_TYPE,he="application/xhtml+xml"===pe?g:h,kt=v(t,"ALLOWED_TAGS")?E({},t.ALLOWED_TAGS,he):Et,Rt=v(t,"ALLOWED_ATTR")?E({},t.ALLOWED_ATTR,he):_t,le=v(t,"ALLOWED_NAMESPACES")?E({},t.ALLOWED_NAMESPACES,g):se,te=v(t,"ADD_URI_SAFE_ATTR")?E(_(ee),t.ADD_URI_SAFE_ATTR,he):ee,Qt=v(t,"ADD_DATA_URI_TAGS")?E(_(Zt),t.ADD_DATA_URI_TAGS,he):Zt,Vt=v(t,"FORBID_CONTENTS")?E({},t.FORBID_CONTENTS,he):Jt,Dt=v(t,"FORBID_TAGS")?E({},t.FORBID_TAGS,he):_({}),Ot=v(t,"FORBID_ATTR")?E({},t.FORBID_ATTR,he):_({}),Kt=!!v(t,"USE_PROFILES")&&t.USE_PROFILES,Lt=!1!==t.ALLOW_ARIA_ATTR,Mt=!1!==t.ALLOW_DATA_ATTR,It=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Ft=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Pt=t.SAFE_FOR_TEMPLATES||!1,Nt=!1!==t.SAFE_FOR_XML,Ct=t.WHOLE_DOCUMENT||!1,Bt=t.RETURN_DOM||!1,Wt=t.RETURN_DOM_FRAGMENT||!1,Ht=t.RETURN_TRUSTED_TYPE||!1,Ut=t.FORCE_BODY||!1,qt=!1!==t.SANITIZE_DOM,Yt=t.SANITIZE_NAMED_PROPS||!1,$t=!1!==t.KEEP_CONTENT,Gt=t.IN_PLACE||!1,At=t.ALLOWED_URI_REGEXP||X,re=t.NAMESPACE||ie,ce=t.MATHML_TEXT_INTEGRATION_POINTS||ce,ue=t.HTML_INTEGRATION_POINTS||ue,zt=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&be(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(zt.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&be(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(zt.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(zt.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pt&&(Mt=!1),Wt&&(Bt=!0),Kt&&(kt=E({},P),Rt=[],!0===Kt.html&&(E(kt,D),E(Rt,N)),!0===Kt.svg&&(E(kt,O),E(Rt,C),E(Rt,U)),!0===Kt.svgFilters&&(E(kt,L),E(Rt,C),E(Rt,U)),!0===Kt.mathMl&&(E(kt,I),E(Rt,j),E(Rt,U))),t.ADD_TAGS&&(kt===Et&&(kt=_(kt)),E(kt,t.ADD_TAGS,he)),t.ADD_ATTR&&(Rt===_t&&(Rt=_(Rt)),E(Rt,t.ADD_ATTR,he)),t.ADD_URI_SAFE_ATTR&&E(te,t.ADD_URI_SAFE_ATTR,he),t.FORBID_CONTENTS&&(Vt===Jt&&(Vt=_(Vt)),E(Vt,t.FORBID_CONTENTS,he)),$t&&(kt["#text"]=!0),Ct&&E(kt,["html","head","body"]),kt.table&&(E(kt,["tbody"]),delete Dt.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');st=t.TRUSTED_TYPES_POLICY,ct=st.createHTML("")}else void 0===st&&(st=it(Y,s)),null!==st&&"string"==typeof ct&&(ct=st.createHTML(""));r&&r(t),ge=t}},xe=E({},[...O,...L,...M]),ve=E({},[...I,...F]),Te=function(t){let e=lt(t);e&&e.tagName||(e={namespaceURI:re,tagName:"template"});const n=h(t.tagName),o=h(e.tagName);return!!le[t.namespaceURI]&&(t.namespaceURI===oe?e.namespaceURI===ie?"svg"===n:e.namespaceURI===ne?"svg"===n&&("annotation-xml"===o||ce[o]):Boolean(xe[n]):t.namespaceURI===ne?e.namespaceURI===ie?"math"===n:e.namespaceURI===oe?"math"===n&&ue[o]:Boolean(ve[n]):t.namespaceURI===ie?!(e.namespaceURI===oe&&!ue[o])&&!(e.namespaceURI===ne&&!ce[o])&&!ve[n]&&(fe[n]||!xe[n]):!("application/xhtml+xml"!==pe||!le[t.namespaceURI]))},Se=function(t){m(o.removed,{element:t});try{lt(t).removeChild(t)}catch(e){V(t)}},Ae=function(t,e){try{m(o.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){m(o.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(Bt||Wt)try{Se(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},ke=function(t){let e=null,n=null;if(Ut)t="<remove></remove>"+t;else{const e=y(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===pe&&re===ie&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const o=st?st.createHTML(t):t;if(re===ie)try{e=(new q).parseFromString(o,pe)}catch(t){}if(!e||!e.documentElement){e=ut.createDocument(re,"template",null);try{e.documentElement.innerHTML=ae?ct:o}catch(t){}}const r=e.body||e.documentElement;return t&&n&&r.insertBefore(i.createTextNode(n),r.childNodes[0]||null),re===ie?mt.call(e,Ct?"html":"body")[0]:Ct?e.documentElement:r},Ee=function(t){return ft.call(t.ownerDocument||t,t,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},Re=function(t){return t instanceof H&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof W)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)},_e=function(t){return"function"==typeof k&&t instanceof k};function ze(t,e,n){u(t,(t=>{t.call(o,e,n,ge)}))}const De=function(t){let e=null;if(ze(ht.beforeSanitizeElements,t,null),Re(t))return Se(t),!0;const n=he(t.nodeName);if(ze(ht.uponSanitizeElement,t,{tagName:n,allowedTags:kt}),Nt&&t.hasChildNodes()&&!_e(t.firstElementChild)&&T(/<[/\w!]/g,t.innerHTML)&&T(/<[/\w!]/g,t.textContent))return Se(t),!0;if(t.nodeType===tt)return Se(t),!0;if(Nt&&t.nodeType===et&&T(/<[/\w]/g,t.data))return Se(t),!0;if(!kt[n]||Dt[n]){if(!Dt[n]&&Le(n)){if(zt.tagNameCheck instanceof RegExp&&T(zt.tagNameCheck,n))return!1;if(zt.tagNameCheck instanceof Function&&zt.tagNameCheck(n))return!1}if($t&&!Vt[n]){const e=lt(t)||t.parentNode,n=at(t)||t.childNodes;if(n&&e)for(let o=n.length-1;o>=0;--o){const i=G(n[o],!0);i.__removalCount=(t.__removalCount||0)+1,e.insertBefore(i,rt(t))}}return Se(t),!0}return t instanceof R&&!Te(t)?(Se(t),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!T(/<\/no(script|embed|frames)/i,t.innerHTML)?(Pt&&t.nodeType===Z&&(e=t.textContent,u([gt,yt,bt],(t=>{e=b(e,t," ")})),t.textContent!==e&&(m(o.removed,{element:t.cloneNode()}),t.textContent=e)),ze(ht.afterSanitizeElements,t,null),!1):(Se(t),!0)},Oe=function(t,e,n){if(qt&&("id"===e||"name"===e)&&(n in i||n in ye))return!1;if(Mt&&!Ot[e]&&T(wt,e));else if(Lt&&T(xt,e));else if(!Rt[e]||Ot[e]){if(!(Le(t)&&(zt.tagNameCheck instanceof RegExp&&T(zt.tagNameCheck,t)||zt.tagNameCheck instanceof Function&&zt.tagNameCheck(t))&&(zt.attributeNameCheck instanceof RegExp&&T(zt.attributeNameCheck,e)||zt.attributeNameCheck instanceof Function&&zt.attributeNameCheck(e,t))||"is"===e&&zt.allowCustomizedBuiltInElements&&(zt.tagNameCheck instanceof RegExp&&T(zt.tagNameCheck,n)||zt.tagNameCheck instanceof Function&&zt.tagNameCheck(n))))return!1}else if(te[e]);else if(T(At,b(n,Tt,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==w(n,"data:")||!Qt[t])if(It&&!T(vt,b(n,Tt,"")));else if(n)return!1;return!0},Le=function(t){return"annotation-xml"!==t&&y(t,St)},Me=function(t){ze(ht.beforeSanitizeAttributes,t,null);const{attributes:e}=t;if(!e||Re(t))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Rt,forceKeepAttr:void 0};let i=e.length;for(;i--;){const r=e[i],{name:a,namespaceURI:l,value:s}=r,c=he(a),f=s;let m="value"===a?f:x(f);if(n.attrName=c,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,ze(ht.uponSanitizeAttribute,t,n),m=n.attrValue,!Yt||"id"!==c&&"name"!==c||(Ae(a,t),m=Xt+m),Nt&&T(/((--!?|])>)|<\/(style|title|textarea)/i,m)){Ae(a,t);continue}if("attributename"===c&&y(m,"href")){Ae(a,t);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){Ae(a,t);continue}if(!Ft&&T(/\/>/i,m)){Ae(a,t);continue}Pt&&u([gt,yt,bt],(t=>{m=b(m,t," ")}));const d=he(t.nodeName);if(Oe(d,c,m)){if(st&&"object"==typeof Y&&"function"==typeof Y.getAttributeType)if(l);else switch(Y.getAttributeType(d,c)){case"TrustedHTML":m=st.createHTML(m);break;case"TrustedScriptURL":m=st.createScriptURL(m)}if(m!==f)try{l?t.setAttributeNS(l,a,m):t.setAttribute(a,m),Re(t)?Se(t):p(o.removed)}catch(e){Ae(a,t)}}else Ae(a,t)}ze(ht.afterSanitizeAttributes,t,null)},Ie=function t(e){let n=null;const o=Ee(e);for(ze(ht.beforeSanitizeShadowDOM,e,null);n=o.nextNode();)ze(ht.uponSanitizeShadowNode,n,null),De(n),Me(n),n.content instanceof c&&t(n.content);ze(ht.afterSanitizeShadowDOM,e,null)};return o.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,i=null,r=null,l=null;if(ae=!t,ae&&(t="\x3c!--\x3e"),"string"!=typeof t&&!_e(t)){if("function"!=typeof t.toString)throw S("toString is not a function");if("string"!=typeof(t=t.toString()))throw S("dirty is not a string, aborting")}if(!o.isSupported)return t;if(jt||we(e),o.removed=[],"string"==typeof t&&(Gt=!1),Gt){if(t.nodeName){const e=he(t.nodeName);if(!kt[e]||Dt[e])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof k)n=ke("\x3c!----\x3e"),i=n.ownerDocument.importNode(t,!0),i.nodeType===Q&&"BODY"===i.nodeName||"HTML"===i.nodeName?n=i:n.appendChild(i);else{if(!Bt&&!Pt&&!Ct&&-1===t.indexOf("<"))return st&&Ht?st.createHTML(t):t;if(n=ke(t),!n)return Bt?null:Ht?ct:""}n&&Ut&&Se(n.firstChild);const s=Ee(Gt?t:n);for(;r=s.nextNode();)De(r),Me(r),r.content instanceof c&&Ie(r.content);if(Gt)return t;if(Bt){if(Wt)for(l=pt.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(Rt.shadowroot||Rt.shadowrootmode)&&(l=dt.call(a,l,!0)),l}let f=Ct?n.outerHTML:n.innerHTML;return Ct&&kt["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&T(K,n.ownerDocument.doctype.name)&&(f="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+f),Pt&&u([gt,yt,bt],(t=>{f=b(f,t," ")})),st&&Ht?st.createHTML(f):f},o.setConfig=function(){we(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),jt=!0},o.clearConfig=function(){ge=null,jt=!1},o.isValidAttribute=function(t,e,n){ge||we({});const o=he(t),i=he(e);return Oe(o,i,n)},o.addHook=function(t,e){"function"==typeof e&&m(ht[t],e)},o.removeHook=function(t,e){if(void 0!==e){const n=f(ht[t],e);return-1===n?void 0:d(ht[t],n,1)[0]}return p(ht[t])},o.removeHooks=function(t){ht[t]=[]},o.removeAllHooks=function(){ht={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return rt}()}));export{n as p}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as o,H as e,g as l}from"./p-23a36bb6.js";import{KeyboardManager as s,FloatingManager as n}from"@sankhyalabs/core";import{i as a}from"./p-641ee538.js";const d=class{constructor(o){t(this,o),this.ezClosePopup=i(this,"ezClosePopup",7),this.ezPopupAction=i(this,"ezPopupAction",7),this.size="medium",this.opened=!1,this.useHeader=!0,this.heightMode="full",this.ezTitle=void 0,this.enabledScroll=!1,this.autoClose=!0,this.footerButtons=[]}observeConfig(){this.manageOverflow()}async componentWillLoad(){this.i18n=await a()}componentDidLoad(){this.popUpFocus(),this._keyboardManager=new s({propagate:!1,element:this._element,enableShadowDom:!0}).bind("Enter",this.ezPopupAction.emit.bind("OK")).bind("Escape",(()=>this.closePopup())).bind("Esc",(()=>this.closePopup()))}disconnectedCallback(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}closePopup(){this.opened=!1,this.manageOverflow(),this.ezClosePopup.emit()}manageOverflow(){window.document.body.style.overflow=this.opened?"hidden":""}manageOverlay(){this.opened?this._overlayId=n.subscribeOverlayControl(this._popupRef):n.unsubscribeOverlayControl(this._popupRef||this._overlayId)}popUpFocus(){this.opened&&this._popupRef&&this._popupRef.focus()}getGridSize(){const t={"x-small":"col--sd-3 ez-popup__size-limit--x-small",small:"col--sd-5",medium:"col--sd-6",large:"col--sd-9","x-large":"col--sd-11",default:"ez-popup__size-limit--x-small",auto:""};return this.size&&t.hasOwnProperty(this.size)&&t[this.size]||t.medium}getDialogClass(){let t="popup__container";return"auto"===this.heightMode&&(t+=" popup__container--auto"),this.enabledScroll&&(t+=" popup__overflow-y--auto"),t+=` ${this.getGridSize()}`,t}componentDidRender(){this.manageOverlay(),this.popUpFocus()}handleAutoClose(t){if(!this.opened||!this._popupRef||!this.autoClose)return;if(this._popupRef.contains(t.target))return;const i=this._popupRef.querySelector("slot");if(i&&i.assignedElements().length>0){const o=i.assignedElements();for(const i of o)if(i.contains(t.target))return}this._popupRef.shadowRoot&&this._popupRef.shadowRoot.contains(t.target)||this.closePopup()}handleDefaultPropsButtonsByIndex(t){switch(t){case 0:return{label:this.i18n?this.i18n("app.confirm"):"Confirmar",variant:"primary",size:"small",onClick:()=>{this.closePopup(),this.ezPopupAction.emit("OK")}};case 1:return{label:this.i18n?this.i18n("app.cancel"):"Cancelar",variant:"secondary",size:"small",onClick:()=>{this.closePopup()}};case 2:return{label:this.i18n?this.i18n("app.close"):"Fechar",variant:"tertiary",size:"small",onClick:()=>{this.closePopup()}}}}render(){return o(e,null,this.opened&&o("div",{class:"overlay",tabIndex:-1,onClick:this.handleAutoClose.bind(this)},o("dialog",{ref:t=>this._popupRef=t,class:this.getDialogClass()},this.useHeader&&o("header",{class:"popup__header"},!!this.ezTitle&&o("h1",{class:"popup__title"},this.ezTitle),o("ez-button",{class:this.ezTitle?"btn-close":"btn-close btn-close--solo",variant:"tertiary",mode:"icon",iconName:"close",size:"small",onClick:this.closePopup.bind(this)})),o("main",{class:"popup__expandable-content"},o("slot",null)),this.footerButtons.length>0&&o("footer",{class:"popup__footer"},this.footerButtons.slice(0,3).map(((t,i)=>o("ez-button",Object.assign({key:i},this.handleDefaultPropsButtonsByIndex(i),t))))))))}get _element(){return l(this)}static get watchers(){return{opened:["observeConfig"]}}};d.style=':host{display:flex;width:auto;--ez-popup-z-index:var(--elevation--24, 24);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--24, 24px);--ez-popup__title--font-family:var(--font--pattern, "Roboto");--ez-popup__title--font-size:var(--font-size--xxlarge, 22px);--ez-popup__title--color:var(--title--primary, #00281D);--ez-popup__title--font-weight:var(--font-weight--regular, 400)}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index, 24);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup__container{width:100%;max-height:90%;height:100%;display:flex;flex-direction:column;overflow:hidden;outline:none;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding);margin:0;border:none;position:unset;gap:var(--space--16, 16px)}.popup__container--auto{height:auto}.popup__overflow-y--auto{overflow-y:auto}.popup__content{box-sizing:border-box;height:100%;width:100%}.popup__expandable-content{box-sizing:border-box;width:100%;flex:1;font-family:var(--font--pattern, "Roboto");font-size:var(--font-size--default, 14px);color:var(--title--primary, #00281D);font-weight:var(--font-weight--regular, 400);line-height:var(--line-height--24, 24px)}.popup__header{width:100%;display:flex;align-items:center}.popup__title{display:flex;margin:0;width:100%;font-family:var(--ez-popup__title--font-family);font-size:var(--ez-popup__title--font-size);font-weight:var(--ez-popup__title--font-weight);color:var(--ez-popup__title--color);line-height:var(--line-height--32, 32px)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close--solo{width:100%}.popup__footer{display:flex;width:100%;flex-direction:row-reverse;gap:var(--space--8, 8px)}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}.ez-popup__size-limit--x-small{min-width:350px;max-width:560px}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}';export{d as ez_popup}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,r as a,c as t,g as n,H as r}from"./p-23a36bb6.js";import{ObjectUtils as o,StringUtils as l,UserInterface as i,ElementIDUtils as s}from"@sankhyalabs/core";import{C as d}from"./p-b853763b.js";import{g as c}from"./p-641ee538.js";function m(a,t,n,r,o){return e("div",{class:"ez-col ez-col--sd-12 ez-align--middle ez-padding-bottom--large"},e("ez-check",{enabled:!n,label:t,mode:o?d.SWITCH:d.REGULAR,"data-field-name":a,"data-context-name":r,key:a}))}function h(a,t,n,r,o,l,i){return e("div",{class:"ez-col ez-col--sd-12"},e("ez-number-input",{class:"ez-input__no-margin",enabled:!n,label:t,precision:r,prettyPrecision:o,"data-field-name":a,"data-context-name":l,key:a,canShowError:i}))}const u=({name:a,label:t,readOnly:n,contextName:r,canShowError:o,props:l})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-text-input",{class:"ez-input__no-margin",label:t,"data-field-name":a,"data-context-name":r,key:a,enabled:!n,canShowError:o,mask:null==l?void 0:l.mask,"clean-value-mask":null==l?void 0:l.cleanValueMask})),p=new Map;p.set(i.CHECKBOX,(e=>m(e.name,e.label,e.readOnly,e.contextName,!1))),p.set(i.SWITCH,(e=>m(e.name,e.label,e.readOnly,e.contextName,!0))),p.set(i.OPTIONSELECTOR,(({name:a,label:t,readOnly:n,required:r,props:o,contextName:l,canShowError:i})=>{const s=null==o?void 0:o.options;let d;if("string"==typeof s){const e=JSON.parse(s);d=Object.keys(e).map((a=>({value:a,label:e[a]})))}else d=s;return e("div",{class:"ez-col ez-col--sd-12"},e("ez-combo-box",{class:"ez-input__no-margin",enabled:!n,suppressEmptyOption:r,label:t,"data-field-name":a,"data-context-name":l,key:a,options:d,canShowError:i}))})),p.set(i.DATE,(({name:a,label:t,readOnly:n,canShowError:r})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-date-input",{class:"ez-input__no-margin",enabled:!n,label:t,"data-field-name":a,key:a,canShowError:r})))),p.set(i.TIME,(({name:a,label:t,readOnly:n,canShowError:r,props:o})=>{var l;return e("div",{class:"ez-col ez-col--sd-12"},e("ez-time-input",{class:"ez-input__no-margin",enabled:!n,label:t,"data-field-name":a,key:a,canShowError:r,"show-seconds":null!==(l=null==o?void 0:o.showSeconds)&&void 0!==l&&l}))})),p.set(i.ELAPSEDTIME,(({name:a,label:t,readOnly:n,canShowError:r})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-time-input",{class:"ez-input__no-margin",enabled:!n,label:t,"data-field-name":a,key:a,canShowError:r,showSeconds:!0})))),p.set(i.DATETIME,(({name:a,label:t,readOnly:n,contextName:r,canShowError:o})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-date-time-input",{class:"ez-input__no-margin",enabled:!n,label:t,"data-field-name":a,"data-context-name":r,key:a,canShowError:o})))),p.set(i.FILE,(({name:a,label:t,readOnly:n,contextName:r,props:l})=>{const i=o.removeEmptyValues({subTitle:l.subTitle,requestHeaders:Object.assign(Object.assign({},l.STORAGESTRATEGY&&{STORAGESTRATEGY:l.STORAGESTRATEGY}),l.INTERNAL_FILENAME&&{INTERNAL_FILENAME:l.INTERNAL_FILENAME})});return e("div",{class:"ez-col ez-col--sd-12"},e("ez-upload",Object.assign({enabled:!n,label:t,"data-field-name":a,"data-context-name":r,key:a},i)))})),p.set(i.DECIMALNUMBER,(({name:e,label:a,readOnly:t,props:n,contextName:r,canShowError:o})=>{var l,i;const s=Number(null!==(l=null==n?void 0:n.precision)&&void 0!==l?l:2);return h(e,a,t,s,Number(null!==(i=null==n?void 0:n.prettyPrecision)&&void 0!==i?i:s),r,o)})),p.set(i.INTEGERNUMBER,(({name:e,label:a,readOnly:t,contextName:n,canShowError:r})=>h(e,a,t,0,0,n,r))),p.set(i.SEARCH,(({name:a,label:t,readOnly:n,required:r,contextName:o,canShowError:l,optionLoader:i,props:s})=>{var d;return e("div",{class:"ez-col ez-col--sd-12"},e("ez-search",{class:"ez-input__no-margin",enabled:!n,suppressEmptyOption:r,label:t,"data-field-name":a,"data-context-name":o,key:a,canShowError:l,optionLoader:i,ignoreLimitCharsToSearch:null!==(d=null==s?void 0:s.ignoreLimitCharsToSearch)&&void 0!==d&&d}))})),p.set(i.SEARCHPLUS,(({name:a,label:t,readOnly:n,contextName:r,canShowError:o,optionLoader:i,props:s})=>{const d=!l.isEmpty(null==s?void 0:s.DESCRIPTIONFIELD);return e("div",{class:"ez-col ez-col--sd-12"},e("ez-search-plus",{class:"ez-input__no-margin",enabled:!n,label:t,"data-field-name":a,"data-context-name":r,key:a,canShowError:o,optionLoader:i,hideDescriptionInput:!d}))})),p.set(i.LONGTEXT,(({name:a,label:t,readOnly:n,contextName:r,rows:o,canShowError:l})=>e("div",{class:"ez-col ez-col--sd-12",key:a},e("ez-text-area",{enabled:!n,label:t,"data-field-name":a,"data-context-name":r,rows:o,canShowError:l})))),p.set(i.HTML,(({name:a,label:t,readOnly:n,contextName:r,rows:o,canShowError:l})=>e("div",{class:"ez-col ez-col--sd-12"},e("ez-rich-text",{key:a,enabled:!n,label:t,"data-field-name":a,"data-context-name":r,rows:o,canShowError:l}))));const w=e=>{const a=c(),t=p.get(e.userInterface)||u,n=e.required?`${e.label}${a("app.requiredInfo")}`:e.label,r=t(Object.assign(Object.assign({},e),{label:n}));return r.t["data-form-item"]=e.name,r};class z{constructor(e){this.elem=e}addRightElement(e){this.removeRightElement(),e.classList.add("ez-padding-left--small"),e.setAttribute("data-custom-item","true"),this.elem.classList.add("ez-col--nowrap"),this.elem.appendChild(e)}removeRightElement(){Array.from(this.elem.querySelectorAll('[data-custom-item="true"]')).forEach((e=>e.remove()))}get fieldName(){return this.elem.getAttribute("data-form-item")}}class v{constructor(e,a){this.items=new Map,this.formId=a,e.forEach((e=>{const a=new z(e);this.items.set(a.fieldName,a)}))}getItem(e){return this.items.get(e)}get formName(){return this.formId}}const b=class{constructor(e){a(this,e),this.ezContentReady=t(this,"ezContentReady",7),this.formItemsReady=t(this,"formItemsReady",7),this._customEditors=new Map,this.fields=void 0,this.selectedRecord=void 0,this.singleColumn=!1}async showUp(){this.singleColumn||this._element.scrollIntoView({behavior:"smooth",block:"start"})}async addCustomEditor(e,a,t){const n=new Map(this._customEditors);n.set(e,{customEditor:a,detailContext:t}),this._customEditors=n}async setFieldProp(e,a,t){const n=this.fields.map((n=>(n.name!==e||!t&&0!==t||(n.props=n.props||{},n.props[a]=t),n)));this.fields=[...n]}groupFields(e){const a=new Map;return e.forEach((e=>{const t=e.group;if(t){let n=a.get(t);null==n&&(n=[],a.set(t,n)),n.push(e)}else a.set(e.name,e)})),a}componentDidRender(){this._formElements=Array.from(this._element.querySelectorAll("[data-field-name]")),this.ezContentReady.emit(this._formElements);const e=new v(Array.from(this._element.querySelectorAll("[data-form-item]")));this.formItemsReady.emit(e)}isItemFullWidth(e){return[i.FILE,i.LONGTEXT,i.HTML].includes(e)}buildFormItemElement(a,t=""){var n;if(this.isItemFullWidth(a.userInterface)&&(t+=" input-full_width"),this._customEditors.has(a.name)){const r=null===(n=this._formElements.map((e=>({name:e.dataset.fieldName,value:e.value}))).find((e=>e.name===a.name)))||void 0===n?void 0:n.value,o=this._customEditors.get(a.name).customEditor;return e("div",{class:t},e("ez-custom-form-input",{"data-field-name":a.name,customEditor:o,formViewField:a,builderFallback:w,value:r,selectedRecord:this.selectedRecord}))}return e("div",{class:t},w(a))}render(){if(s.addIDInfoIfNotExists(this._element,"ezFormView"),null==this.fields)return;let a=[],t=Array.from(this.groupFields(this.fields).entries()).map((([t,n])=>{if(Array.isArray(n))return e("ez-collapsible-box",{id:`group-${t}`,label:t,"header-size":"large",key:t},e("div",{class:`form-view__content ${this.singleColumn&&"form-view__content--single-column"}`},n.map((e=>this.buildFormItemElement(e)))));a.push(n)})),n=a.map((e=>this.buildFormItemElement(e))),o=e("div",{class:`form-view__content ${this.singleColumn&&"form-view__content--single-column"}`},n);return e(r,null,o,t)}get _element(){return n(this)}};b.style=".sc-ez-form-view-h{display:flex;flex-wrap:wrap;width:100%;--ez-form-view__item--min-width:220px;--ez-form-view__item--max-width:440px;--ez-form-view__item--width:var(--space--small);--ez-form-view__item--padding:var(--space--small)}.form-view__content.sc-ez-form-view{display:grid;grid-template-columns:repeat(auto-fill, minmax(var(--ez-form-view__item--min-width), 1fr));gap:var(--ez-form-view__item--width);padding-inline:var(--ez-form-view__item--padding);width:100%}.form-view__content--single-column.sc-ez-form-view{grid-template-columns:repeat(1, minmax(var(--ez-form-view__item--min-width), var(--ez-form-view__item--max-width)))}.input-full_width.sc-ez-form-view{grid-column:1 / -1;width:100%}";export{b as ez_form_view}
|
package/dist/ezui/p-623161e2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{UserInterface as t,Action as s,StringUtils as i,ApplicationContext as e,ObjectUtils as n,WaitingChangeException as a,DataUnitAction as h}from"@sankhyalabs/core";import{A as r}from"./p-5a11cf56.js";import{g as o}from"./p-641ee538.js";import{h as l}from"./p-23a36bb6.js";const c=(s,i)=>{var e,n;let a,h,{name:r,label:o,group:l}=Object.assign({},i),{readOnly:c,required:d}=Object.assign({},i);return s&&(o=o||s.label,r=r||s.name,d=null!==(e=s.required)&&void 0!==e?e:null==i?void 0:i.required,c=null!==(n=s.readOnly)&&void 0!==n?n:null==i?void 0:i.readOnly,a=s.properties,h=s.userInterface),{name:r,label:o,group:l,readOnly:c,required:d,props:a,userInterface:h||t.SHORTTEXT}};class d{constructor(t,s,i){this._dataUnit=t,this._validationSource=s,this._validator=i,this._i18n=o()}validate(t=!0){return new Promise(((s,i)=>{const e=this._dataUnit.getModifiedRecords();for(let s=0;s<e.length;s++){const n=e[s],a=[];let h=this.validateRequired(n);if(h&&!h.isValid&&a.push(h),this._validator&&(h=this._validator.validateRecord(n),h&&!h.isValid&&a.push(h)),a.length>0){if(!t&&a[0].invalidFields.length>0){this._validationSource.markAsInvalid(a[0].invalidFields[0],n.__record__id__),i();break}this.processValidationResult(a,n.__record__id__),i();break}}return s()}))}validateRequired(t){const s=this._validationSource.getRequiredFields(),i=[];if(new Set(s).forEach((s=>{const e=t[s];if(null==e||""===e){const e=this._validationSource.getMessageForField(s,t.__record__id__);i.push(e?{name:s,message:e}:{name:s,message:this._i18n("utils.requiredField")})}})),i.length>0)return{isValid:!1,invalidFields:i,infoMessage:this._i18n("utils.requiredFieldMessage")}}processValidationResult(t,s){t.forEach((t=>{const i=t.invalidFields;if(this._dataUnit.savingCanceled(i,s),i&&i.forEach((t=>{this.markAsInvalid(t,s)})),t.infoMessage&&r.info(t.infoMessage),t.errorMessage){const{errorTitle:s,errorMessage:i}=t;r.error(s,i)}}))}markAsInvalid(t,s){this._dataUnit.setInvalidField(t.name,t.message,s),this._validationSource.markAsInvalid(t,s)}}class u{constructor(t){this.onDataUnitEvent=t=>{var i;switch(t.type){case s.MULTIPLE_EDITION_CHANGED:this.clearInvalid(),this.updateAllFieldsValues();break;case s.DATA_LOADED:case s.DATA_SAVED:case s.RECORDS_REMOVED:case s.RECORDS_ADDED:case s.RECORDS_COPIED:case s.EDITION_CANCELED:case s.SELECTION_CHANGED:case s.NEXT_SELECTED:case s.PREVIOUS_SELECTED:this.clearInvalid();case s.DATA_CHANGED:case s.CHANGE_UNDONE:case s.CHANGE_REDONE:case s.RECORD_LOADED:this.updateAllFieldsValues(),this.clearFieldError(Object.keys(t.payload)[0]);break;case s.FIELD_INVALIDATED:null===(i=this._fields)||void 0===i||i.forEach((t=>{this.updateErrorMessage(t.fieldName,t.field)}))}},this._uuid=i.generateUUID(),this._fields=new Map,this._dataUnit=t,this.applyDefaultValues(),this._dataUnit.subscribe(this.onDataUnitEvent),this._dataUnit.addInterceptor(this),this.setContextDataBinder(t)}get dataBinderId(){return this._uuid}setContextDataBinder(t){const s=e.getContextValue("__DATABINDER_BY_DATAUNIT__")||new Map,i=[...s.get(t.dataUnitId)||[],this];s.set(t.dataUnitId,i),e.setContextValue("__DATABINDER_BY_DATAUNIT__",s)}applyDefaultValues(){const t=(this._dataUnit.getAddedRecords()||[]).map((t=>t.__record__id__));if(t.length>0){const s=this.getDefaultValues();s&&Object.keys(s).forEach((i=>{this._dataUnit.setFieldValue(i,s[i],t)}))}}bind(t,s,i,e){t.forEach((t=>{const{fieldName:i,contextName:e}=t.dataset;null!=e&&e!==s||this.updateBind(i,t)})),this._formMetadata=i,this._recordValidatorProcessor=new d(this._dataUnit,{getRequiredFields:()=>this.getFormRequiredFields(),markAsInvalid:t=>this.markInvalid(t),getMessageForField:t=>this.getErrorMessage(t)},e)}getFormRequiredFields(){return this._formMetadata.getRequiredFields()}disconnectDataUnit(){const t=e.getContextValue("__DATABINDER_BY_DATAUNIT__")||new Map,s=t.get(this._dataUnit.dataUnitId).filter((t=>t.dataBinderId!==this.dataBinderId));t.set(this._dataUnit.dataUnitId,s),e.setContextValue("__DATABINDER_BY_DATAUNIT__",t)}onDisconnectedCallback(){this._dataUnit.unsubscribe(this.onDataUnitEvent),this._dataUnit.removeInterceptor(this),this.disconnectDataUnit()}getCurrentRecordId(){const t=this._dataUnit.getSelectedRecord();return null==t?void 0:t.__record__id__}markInvalid(t){if(this._fields.has(t.name)){const s=this._fields.get(t.name).field;this.updateErrorMessage(t.name,s,t.message)}}setFocus(t){if(!this._fields.has(t))return;const s=this._fields.get(t).field;"function"==typeof s.setFocus&&s.setFocus()}clearInvalid(t){this._dataUnit.clearInvalid(t),this._fields.forEach((t=>{t.field.errorMessage=""}))}clearFieldError(t){var s;const i=null===(s=this._fields.get(t))||void 0===s?void 0:s.field;i.errorMessage&&(i.errorMessage="",this._dataUnit.clearInvalid(this.getCurrentRecordId(),t))}updateFieldValue(t,s){const i=this._fields.get(t);try{i&&(i.listen=!1),this._dataUnit.isMultipleEdition&&this.hasMultipleValuesBetweenRecords(t)?(s.value=void 0,s.alternativePlaceholder="Múltiplos Valores"):(s.value=this._dataUnit.getFieldValue(t),s.alternativePlaceholder=void 0),this.updateErrorMessage(t,s)}finally{i&&(i.listen=!0)}}hasMultipleValuesBetweenRecords(t){var s,i;const e=null!==(i=null===(s=this._dataUnit.getSelectionInfo())||void 0===s?void 0:s.records)&&void 0!==i?i:[];if(e.length<=1)return!1;const a=e[0][t];return!e.every((s=>n.equals(s[t],a)))}validate(){return this._recordValidatorProcessor.validate()}static async validateByDataunit(t){try{const s=this.getDataBindersByDataUnit(t);return await Promise.all(s.map((t=>t.validate()))),!0}catch(t){return!1}}static getDataBindersByDataUnit(t){const s=e.getContextValue("__DATABINDER_BY_DATAUNIT__");return(null==s?void 0:s.get(t.dataUnitId))||[]}updateErrorMessage(t,s,i){null==i&&(i=this._dataUnit.getInvalidMessage(this.getCurrentRecordId(),t)),s.errorMessage||(s.errorMessage=i)}getErrorMessage(t){if(this._fields.has(t))return this._fields.get(t).field.errorMessage}updateBind(t,s){const i=this._fields.get(t);i&&i.destroy(),this.bindSearchOptionsLoader(t,s),this.updateFieldValue(t,s),this.updateErrorMessage(t,s),this._fields.set(t,_.create(t,s,((t,s)=>this.changeStarted(t,s)),(t=>this.cancelWaitingChange(t)),((t,s)=>this.setFieldValue(t,s)))),this.applyEzUploadContext(t,s)}changeStarted(t,s){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),!s.blocking&&null==s.promise){const i=this._fields.get(t);i&&(s.promise=new Promise(((t,s)=>{i.waitingChangePromiseResolve=t,i.waitingChangePromiseReject=s})))}this._dataUnit.startChange(t,s)}cancelWaitingChange(t){if(this._dataUnit.waitingForChange(t)){this._dataUnit.cancelWaitingChange(t);const s=this._fields.get(t);s&&s.rejectWaitingChange(new a("Change canceled",t))}}setFieldValue(t,s){if(0===this._dataUnit.records.length&&this._dataUnit.addRecord(),this._dataUnit.clearInvalid(this.getCurrentRecordId(),t),this._dataUnit.isMultipleEdition){const i=this._dataUnit.getSelectionInfo();this._dataUnit.setFieldValue(t,s,i.recordIds)}else{const i=this._dataUnit.getSelectedRecord();this._dataUnit.setFieldValue(t,s,i?[i.__record__id__]:void 0)}if(this._dataUnit.waitingForChange(t)){const s=this._fields.get(t);s&&s.acceptWaitingChange()}}bindSearchOptionsLoader(t,s){if(("EZ-SEARCH"===s.nodeName||"EZ-SEARCH-PLUS"===s.nodeName)&&null==s.optionLoader){const i=e.getContextValue("EZ-SEARCH-PLUS"===s.nodeName?"__EZUI__SEARCH__PLUS__OPTION__LOADER__":"__EZUI__SEARCH__OPTION__LOADER__");i&&(s.optionLoader=(s,e)=>i(s,t,this._dataUnit,e))}}applyEzUploadContext(t,s){var i,n;if("EZ-UPLOAD"===s.nodeName){s.urlUpload=e.getContextValue("__EZUI__UPLOAD__ADD__URL__"),s.urlDelete=e.getContextValue("__EZUI__UPLOAD__DEL__URL__");const a=this._dataUnit.getField(t),h=null===(i=a.properties)||void 0===i?void 0:i.DESTINATION;h&&(s.requestHeaders={XTRAINF:`{"destination": "${h}"}`}),s.maxFiles=(null===(n=a.properties)||void 0===n?void 0:n.MAX_FILES)||0}}updateAllFieldsValues(){var t;null===(t=this._fields)||void 0===t||t.forEach((t=>{this.updateFieldValue(t.fieldName,t.field)}))}interceptAction(t){if(t.type===s.RECORDS_COPIED){const i=this._formMetadata.getCleanOnCopyFields();if(i)return new h(s.RECORDS_COPIED,t.payload.map((t=>{const s=Object.assign({},t);return i.forEach((t=>delete s[t])),s})))}if(t.type===s.SAVING_DATA)return new Promise((s=>{this.validate().then((()=>s(t))).catch((()=>{}))}));if(t.type===s.RECORDS_ADDED){const i=this.getDefaultValues();if(i)return new h(s.RECORDS_ADDED,t.payload.map((t=>Object.assign(Object.assign({},t),i))))}return t}getDefaultValues(){var t;const s=null===(t=this._formMetadata)||void 0===t?void 0:t.getDefaultValues();if(s){const t={};for(const i in s)t[i]=this._dataUnit.valueFromString(i,s[i]);return t}}}class _{constructor(){this.listen=!0,this.startChangeEventName="ezStartChange",this.cancelWaitingChangeEventName="ezCancelWaitingChange",this.changeEventName="ezChange"}destroy(){this.field.removeEventListener(this.startChangeEventName,this.startChangeListener),this.field.removeEventListener(this.cancelWaitingChangeEventName,this.cancelWaitingChangeListener),this.field.removeEventListener(this.changeEventName,this.changeListener)}acceptWaitingChange(){this.waitingChangePromiseResolve&&(this.waitingChangePromiseResolve(),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}rejectWaitingChange(t){this.waitingChangePromiseReject&&(this.waitingChangePromiseReject(t),this.waitingChangePromiseReject=void 0,this.waitingChangePromiseResolve=void 0)}static create(t,s,i,e,n){const a=new _;return a.field=s,a.fieldName=t,a.startChangeListener=s=>{a.listen&&i(t,s.detail)},a.field.addEventListener(a.startChangeEventName,a.startChangeListener),a.cancelWaitingChangeListener=()=>{a.listen&&e(t)},a.field.addEventListener(a.cancelWaitingChangeEventName,a.cancelWaitingChangeListener),a.changeListener=s=>{a.listen&&n(t,s.detail)},a.field.addEventListener(a.changeEventName,a.changeListener),a}}const v="ctrl+f",f=240,p=String(210)+"px",A=(t,s,i)=>l("ez-search",{class:"ez-padding--small ez-margin--none",style:{"--ez-text-input__margin-bottom":"0px","--ez-search--width":p},canShowError:!1,showSelectedValue:!1,showOptionValue:!1,suppressEmptyOption:!0,label:t.label,value:null,optionLoader:s,onEzChange:t=>i(t.detail),ignoreLimitCharsToSearch:!0}),g=async t=>{requestAnimationFrame((async()=>{if(t){const s=t.t;if(!s)return;s.value=null,await s.setFocus()}}))};export{u as D,d as R,v as S,A as a,c as b,f as c,g as f}
|
package/dist/ezui/p-641ee538.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ApplicationContext as e,LangUtils as t}from"@sankhyalabs/core";const i=e=>"string"==typeof e,o=()=>{let e,t;const i=new Promise(((i,o)=>{e=i,t=o}));return i.resolve=e,i.reject=t,i},s=e=>null==e?"":""+e,r=/###/g,a=e=>e&&e.indexOf("###")>-1?e.replace(r,"."):e,n=e=>!e||i(e),l=(e,t,o)=>{const s=i(t)?t.split("."):t;let r=0;for(;r<s.length-1;){if(n(e))return{};const t=a(s[r]);!e[t]&&o&&(e[t]=new o),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++r}return n(e)?{}:{obj:e,k:a(s[r])}},u=(e,t,i)=>{const{obj:o,k:s}=l(e,t,Object);if(void 0!==o||1===t.length)return void(o[s]=i);let r=t[t.length-1],a=t.slice(0,t.length-1),n=l(e,a,Object);for(;void 0===n.obj&&a.length;)r=`${a[a.length-1]}.${r}`,a=a.slice(0,a.length-1),n=l(e,a,Object),n&&n.obj&&void 0!==n.obj[`${n.k}.${r}`]&&(n.obj=void 0);n.obj[`${n.k}.${r}`]=i},c=(e,t)=>{const{obj:i,k:o}=l(e,t);if(i)return i[o]},d=(e,t,i)=>{const o=c(e,i);return void 0!==o?o:c(t,i)},h=(e,t,o)=>{for(const s in t)"__proto__"!==s&&"constructor"!==s&&(s in e?i(e[s])||e[s]instanceof String||i(t[s])||t[s]instanceof String?o&&(e[s]=t[s]):h(e[s],t[s],o):e[s]=t[s]);return e},p=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var m={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const g=e=>i(e)?e.replace(/[&<>"'\/]/g,(e=>m[e])):e,f=[" ",",","?","!",";"],v=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}(20),b=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const o=t.split(i);let s=e;for(let e=0;e<o.length;){if(!s||"object"!=typeof s)return;let t,r="";for(let a=e;a<o.length;++a)if(a!==e&&(r+=i),r+=o[a],t=s[r],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<o.length-1)continue;e+=a-e+1;break}s=t}return s},y=e=>e&&e.replace("_","-"),x={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class S{constructor(e){this.init(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||x,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,o,s){return s&&!this.debug?null:(i(e[0])&&(e[0]=`${o}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new S(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new S(this.logger,e)}}var w=new S;class C{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const i=this.observers[e].get(t)||0;this.observers[e].set(t,i+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];this.observers[e]&&Array.from(this.observers[e].entries()).forEach((e=>{let[t,o]=e;for(let e=0;e<o;e++)t(...i)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((t=>{let[o,s]=t;for(let t=0;t<s;t++)o.apply(o,[e,...i])}))}}class P extends C{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,o){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,a=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let n;e.indexOf(".")>-1?n=e.split("."):(n=[e,t],o&&(Array.isArray(o)?n.push(...o):i(o)&&r?n.push(...o.split(r)):n.push(o)));const l=c(this.data,n);return!l&&!t&&!o&&e.indexOf(".")>-1&&(e=n[0],t=n[1],o=n.slice(2).join(".")),!l&&a&&i(o)?b(this.data&&this.data[e]&&this.data[e][t],o,r):l}addResource(e,t,i,o){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const r=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator;let a=[e,t];i&&(a=a.concat(r?i.split(r):i)),e.indexOf(".")>-1&&(a=e.split("."),o=t,t=a[1]),this.addNamespaces(t),u(this.data,a,o),s.silent||this.emit("added",e,t,i,o)}addResources(e,t,o){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const s in o)(i(o[s])||Array.isArray(o[s]))&&this.addResource(e,t,s,o[s],{silent:!0});s.silent||this.emit("added",e,t,o)}addResourceBundle(e,t,i,o,s){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),o=i,i=t,t=a[1]),this.addNamespaces(t);let n=c(this.data,a)||{};r.skipCopy||(i=JSON.parse(JSON.stringify(i))),o?h(n,i,s):n={...n,...i},u(this.data,a,n),r.silent||this.emit("added",e,t,i)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var z={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,i,o,s){return e.forEach((e=>{this.processors[e]&&(t=this.processors[e].process(t,i,o,s))})),t}};const A={};class N extends C{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o;super(),i=e,o=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((e=>{i[e]&&(o[e]=i[e])})),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=w.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){if(null==e)return!1;const t=this.resolve(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}});return t&&void 0!==t.res}extractFromKey(e,t){let o=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===o&&(o=":");const s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const a=o&&e.indexOf(o)>-1,n=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,i)=>{t=t||"",i=i||"";const o=f.filter((e=>t.indexOf(e)<0&&i.indexOf(e)<0));if(0===o.length)return!0;const s=v.getRegExp(`(${o.map((e=>"?"===e?"\\?":e)).join("|")})`);let r=!s.test(e);if(!r){const t=e.indexOf(i);t>0&&!s.test(e.substring(0,t))&&(r=!0)}return r})(e,o,s));if(a&&!n){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:i(r)?[r]:r};const a=e.split(o);(o!==s||o===s&&this.options.ns.indexOf(a[0])>-1)&&(r=a.shift()),e=a.join(s)}return{key:e,namespaces:i(r)?[r]:r}}translate(e,t,o){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const s=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:a,namespaces:n}=this.extractFromKey(e[e.length-1],t),l=n[n.length-1],u=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(c){const e=t.nsSeparator||this.options.nsSeparator;return s?{res:`${l}${e}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:`${l}${e}${a}`}return s?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:a}const d=this.resolve(e,t);let h=d&&d.res;const p=d&&d.usedKey||a,m=d&&d.exactUsedKey||a,g=Object.prototype.toString.apply(h),f=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,b=!i(h)&&"boolean"!=typeof h&&"number"!=typeof h;if(!(v&&h&&b&&["[object Number]","[object Function]","[object RegExp]"].indexOf(g)<0)||i(f)&&Array.isArray(h))if(v&&i(f)&&Array.isArray(h))h=h.join(f),h&&(h=this.extendTranslation(h,e,t,o));else{let s=!1,n=!1;const c=void 0!==t.count&&!i(t.count),p=N.hasDefaultValue(t),m=c?this.pluralResolver.getSuffix(u,t.count,t):"",g=t.ordinal&&c?this.pluralResolver.getSuffix(u,t.count,{ordinal:!1}):"",f=c&&!t.ordinal&&0===t.count&&this.pluralResolver.shouldUseIntlApi(),v=f&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${m}`]||t[`defaultValue${g}`]||t.defaultValue;!this.isValidLookup(h)&&p&&(s=!0,h=v),this.isValidLookup(h)||(n=!0,h=a);const b=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:h,y=p&&v!==h&&this.options.updateMissing;if(n||s||y){if(this.logger.log(y?"updateKey":"missingKey",u,l,a,y?v:h),r){const e=this.resolve(a,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const i=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&i&&i[0])for(let t=0;t<i.length;t++)e.push(i[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const o=(e,i,o)=>{const s=p&&o!==h?o:b;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,i,s,y,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,l,i,s,y,t),this.emit("missingKey",e,l,i,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&c?e.forEach((e=>{const i=this.pluralResolver.getSuffixes(e,t);f&&t[`defaultValue${this.options.pluralSeparator}zero`]&&i.indexOf(`${this.options.pluralSeparator}zero`)<0&&i.push(`${this.options.pluralSeparator}zero`),i.forEach((i=>{o([e],a+i,t[`defaultValue${i}`]||v)}))})):o(e,a,v))}h=this.extendTranslation(h,e,t,d,o),n&&h===a&&this.options.appendNamespaceToMissingKey&&(h=`${l}:${a}`),(n||s)&&this.options.parseMissingKeyHandler&&(h="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,s?h:void 0):this.options.parseMissingKeyHandler(h))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,h,{...t,ns:n}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(d.res=e,d.usedParams=this.getUsedParamsDetails(t),d):e}if(r){const e=Array.isArray(h),i=e?[]:{},o=e?m:p;for(const e in h)if(Object.prototype.hasOwnProperty.call(h,e)){const s=`${o}${r}${e}`;i[e]=this.translate(s,{...t,joinArrays:!1,ns:n}),i[e]===s&&(i[e]=h[e])}h=i}}return s?(d.res=h,d.usedParams=this.getUsedParamsDetails(t),d):h}extendTranslation(e,t,o,s,r){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const n=i(e)&&(o&&o.interpolation&&void 0!==o.interpolation.skipOnVariables?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(n){const t=e.match(this.interpolator.nestingRegexp);l=t&&t.length}let u=o.replace&&!i(o.replace)?o.replace:o;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,o.lng||this.language||s.usedLng,o),n){const t=e.match(this.interpolator.nestingRegexp);l<(t&&t.length)&&(o.nest=!1)}!o.lng&&"v1"!==this.options.compatibilityAPI&&s&&s.res&&(o.lng=this.language||s.usedLng),!1!==o.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];return r&&r[0]===i[0]&&!o.context?(a.logger.warn(`It seems you are nesting recursively key: ${i[0]} in key: ${t[0]}`),null):a.translate(...i,t)}),o)),o.interpolation&&this.interpolator.reset()}const n=o.postProcess||this.options.postProcess,l=i(n)?[n]:n;return null!=e&&l&&l.length&&!1!==o.applyPostProcessor&&(e=z.handle(l,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(o)},...o}:o,this)),e}resolve(e){let t,o,s,r,a,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const l=this.extractFromKey(e,n),u=l.key;o=u;let c=l.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=void 0!==n.count&&!i(n.count),h=d&&!n.ordinal&&0===n.count&&this.pluralResolver.shouldUseIntlApi(),p=void 0!==n.context&&(i(n.context)||"number"==typeof n.context)&&""!==n.context,m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);c.forEach((e=>{this.isValidLookup(t)||(a=e,!A[`${m[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(A[`${m[0]}-${e}`]=!0,this.logger.warn(`key "${o}" for languages "${m.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach((i=>{if(this.isValidLookup(t))return;r=i;const o=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(o,u,i,e,n);else{let e;d&&(e=this.pluralResolver.getSuffix(i,n.count,n));const t=`${this.options.pluralSeparator}zero`,s=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(o.push(u+e),n.ordinal&&0===e.indexOf(s)&&o.push(u+e.replace(s,this.options.pluralSeparator)),h&&o.push(u+t)),p){const i=`${u}${this.options.contextSeparator}${n.context}`;o.push(i),d&&(o.push(i+e),n.ordinal&&0===e.indexOf(s)&&o.push(i+e.replace(s,this.options.pluralSeparator)),h&&o.push(i+t))}}let a;for(;a=o.pop();)this.isValidLookup(t)||(s=a,t=this.getResource(i,e,a,n))})))}))})),{res:t,usedKey:o,exactUsedKey:s,usedLng:r,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,i,o):this.resourceStore.getResource(e,t,i,o)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=e.replace&&!i(e.replace);let s=o?e.replace:e;if(o&&void 0!==e.count&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!o){s={...s};for(const e of t)delete s[e]}return s}static hasDefaultValue(e){const t="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t===i.substring(0,t.length)&&void 0!==e[i])return!0;return!1}}const L=e=>e.charAt(0).toUpperCase()+e.slice(1);class k{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=w.create("languageUtils")}getScriptPartFromCode(e){if(!(e=y(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=y(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(i(e)&&e.indexOf("-")>-1){if("undefined"!=typeof Intl&&void 0!==Intl.getCanonicalLocales)try{let t=Intl.getCanonicalLocales(e)[0];if(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)return t}catch(e){}const t=["hans","hant","latn","cyrl","cans","mong","arab"];let i=e.split("-");return this.options.lowerCaseLng?i=i.map((e=>e.toLowerCase())):2===i.length?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=L(i[1].toLowerCase()))):3===i.length&&(i[0]=i[0].toLowerCase(),2===i[1].length&&(i[1]=i[1].toUpperCase()),"sgn"!==i[0]&&2===i[2].length&&(i[2]=i[2].toUpperCase()),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=L(i[1].toLowerCase())),t.indexOf(i[2].toLowerCase())>-1&&(i[2]=L(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const i=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(i)||(t=i)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const i=this.getLanguagePartFromCode(e);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find((e=>e===i?e:e.indexOf("-")<0&&i.indexOf("-")<0?void 0:e.indexOf("-")>0&&i.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===i||0===e.indexOf(i)&&i.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),i(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let o=e[t];return o||(o=e[this.getScriptPartFromCode(t)]),o||(o=e[this.formatLanguageCode(t)]),o||(o=e[this.getLanguagePartFromCode(t)]),o||(o=e.default),o||[]}toResolveHierarchy(e,t){const o=this.getFallbackCodes(t||this.options.fallbackLng||[],e),s=[],r=e=>{e&&(this.isSupportedCode(e)?s.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return i(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):i(e)&&r(this.formatLanguageCode(e)),o.forEach((e=>{s.indexOf(e)<0&&r(this.formatLanguageCode(e))})),s}}let R=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],E={1:e=>Number(e>1),2:e=>Number(1!=e),3:()=>0,4:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),5:e=>Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5),6:e=>Number(1==e?0:e>=2&&e<=4?1:2),7:e=>Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),8:e=>Number(1==e?0:2==e?1:8!=e&&11!=e?2:3),9:e=>Number(e>=2),10:e=>Number(1==e?0:2==e?1:e<7?2:e<11?3:4),11:e=>Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3),12:e=>Number(e%10!=1||e%100==11),13:e=>Number(0!==e),14:e=>Number(1==e?0:2==e?1:3==e?2:3),15:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2),16:e=>Number(e%10==1&&e%100!=11?0:0!==e?1:2),17:e=>Number(1==e||e%10==1&&e%100!=11?0:1),18:e=>Number(0==e?0:1==e?1:2),19:e=>Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3),20:e=>Number(1==e?0:0==e||e%100>0&&e%100<20?1:2),21:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0),22:e=>Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)};const T=["v1","v2","v3"],M=["v4"],$={zero:0,one:1,two:2,few:3,many:4,other:5};class O{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=w.create("pluralResolver"),this.options.compatibilityJSON&&!M.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(()=>{const e={};return R.forEach((t=>{t.lngs.forEach((i=>{e[i]={numbers:t.nr,plurals:E[t.fc]}}))})),e})(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi()){const i=y("dev"===e?"en":e),o=t.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:o});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let r;try{r=new Intl.PluralRules(i,{type:o})}catch(i){if(!e.match(/-|_/))return;const o=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(o,t)}return this.pluralRulesCache[s]=r,r}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){const t=this.getRule(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return this.shouldUseIntlApi()?t&&t.resolvedOptions().pluralCategories.length>1:t&&t.numbers.length>1}getPluralFormsOfKey(e,t){return this.getSuffixes(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=this.getRule(e,t);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort(((e,t)=>$[e]-$[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):i.numbers.map((i=>this.getSuffix(e,i,t))):[]}getSuffix(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=this.getRule(e,i);return o?this.shouldUseIntlApi()?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o.select(t)}`:this.getSuffixRetroCompatible(o,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const i=e.plurals(e.noAbs?t:Math.abs(t));let o=e.numbers[i];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===o?o="plural":1===o&&(o=""));const s=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?`_plural_${o.toString()}`:s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?s():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}shouldUseIntlApi(){return!T.includes(this.options.compatibilityJSON)}}const F=function(e,t,o){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=d(e,t,o);return!a&&r&&i(o)&&(a=b(e,o,s),void 0===a&&(a=b(t,o,s))),a},I=e=>e.replace(/\$/g,"$$$$");class j{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=w.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:i,useRawValueToEscape:o,prefix:s,prefixEscaped:r,suffix:a,suffixEscaped:n,formatSeparator:l,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:m,nestingSuffixEscaped:f,nestingOptionsSeparator:v,maxReplaces:b,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:g,this.escapeValue=void 0===i||i,this.useRawValueToEscape=void 0!==o&&o,this.prefix=s?p(s):r||"{{",this.suffix=a?p(a):n||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?p(d):h||p("$t("),this.nestingSuffix=m?p(m):f||p(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=b||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,o,r){let a,n,l;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){const i=F(t,u,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,o,{...r,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),s=i.shift().trim(),a=i.join(this.formatSeparator).trim();return this.format(F(t,u,s,this.options.keySeparator,this.options.ignoreJSONStructure),a,o,{...r,...t,interpolationkey:s})};this.resetRegExp();const d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>I(e)},{regex:this.regexp,safeValue:e=>I(this.escapeValue?this.escape(e):e)}].forEach((t=>{for(l=0;a=t.regex.exec(e);){const o=a[1].trim();if(n=c(o),void 0===n)if("function"==typeof d){const t=d(e,a,r);n=i(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,o))n="";else{if(h){n=a[0];continue}this.logger.warn(`missed to pass in variable ${o} for interpolating ${e}`),n=""}else i(n)||this.useRawValueToEscape||(n=s(n));const u=t.safeValue(n);if(e=e.replace(a[0],u),h?(t.regex.lastIndex+=n.length,t.regex.lastIndex-=a[0].length):t.regex.lastIndex=0,l++,l>=this.maxReplaces)break}})),e}nest(e,t){let o,r,a,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const l=(e,t)=>{const i=this.nestingOptionsSeparator;if(e.indexOf(i)<0)return e;const o=e.split(new RegExp(`${i}[ ]*{`));let s=`{${o[1]}`;e=o[0],s=this.interpolate(s,a);const r=s.match(/'/g),n=s.match(/"/g);(r&&r.length%2==0&&!n||n.length%2!=0)&&(s=s.replace(/'/g,'"'));try{a=JSON.parse(s),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${i}${s}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;o=this.nestingRegexp.exec(e);){let u=[];a={...n},a=a.replace&&!i(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(-1!==o[0].indexOf(this.formatSeparator)&&!/{.*}/.test(o[1])){const e=o[1].split(this.formatSeparator).map((e=>e.trim()));o[1]=e.shift(),u=e,c=!0}if(r=t(l.call(this,o[1].trim(),a),a),r&&o[0]===e&&!i(r))return r;i(r)||(r=s(r)),r||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),r=""),c&&(r=u.reduce(((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:o[1].trim()})),r.trim())),e=e.replace(o[0],r),this.regexp.lastIndex=0}return e}}const D=e=>{const t={};return(i,o,s)=>{let r=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(r={...r,[s.interpolationkey]:void 0});const a=o+JSON.stringify(r);let n=t[a];return n||(n=e(y(o),s),t[a]=n),n(i)}};class B{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=w.create("formatter"),this.options=e,this.formats={number:D(((e,t)=>{const i=new Intl.NumberFormat(e,{...t});return e=>i.format(e)})),currency:D(((e,t)=>{const i=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>i.format(e)})),datetime:D(((e,t)=>{const i=new Intl.DateTimeFormat(e,{...t});return e=>i.format(e)})),relativetime:D(((e,t)=>{const i=new Intl.RelativeTimeFormat(e,{...t});return e=>i.format(e,t.range||"day")})),list:D(((e,t)=>{const i=new Intl.ListFormat(e,{...t});return e=>i.format(e)}))},this.init(e)}init(e){this.formatSeparator=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=D(t)}format(e,t,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const s=t.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find((e=>e.indexOf(")")>-1))){const e=s.findIndex((e=>e.indexOf(")")>-1));s[0]=[s[0],...s.splice(1,e)].join(this.formatSeparator)}return s.reduce(((e,t)=>{const{formatName:s,formatOptions:r}=(e=>{let t=e.toLowerCase().trim();const i={};if(e.indexOf("(")>-1){const o=e.split("(");t=o[0].toLowerCase().trim();const s=o[1].substring(0,o[1].length-1);"currency"===t&&s.indexOf(":")<0?i.currency||(i.currency=s.trim()):"relativetime"===t&&s.indexOf(":")<0?i.range||(i.range=s.trim()):s.split(";").forEach((e=>{if(e){const[t,...o]=e.split(":"),s=o.join(":").trim().replace(/^'+|'+$/g,""),r=t.trim();i[r]||(i[r]=s),"false"===s&&(i[r]=!1),"true"===s&&(i[r]=!0),isNaN(s)||(i[r]=parseInt(s,10))}}))}return{formatName:t,formatOptions:i}})(t);if(this.formats[s]){let t=e;try{const a=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{};t=this.formats[s](e,a.locale||a.lng||o.locale||o.lng||i,{...r,...o,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${s}`),e}),e)}}class U extends C{constructor(e,t,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=i,this.languageUtils=i.languageUtils,this.options=o,this.logger=w.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(i,o.backend,o)}queueLoad(e,t,i,o){const s={},r={},a={},n={};return e.forEach((e=>{let o=!0;t.forEach((t=>{const a=`${e}|${t}`;!i.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===r[a]&&(r[a]=!0):(this.state[a]=1,o=!1,void 0===r[a]&&(r[a]=!0),void 0===s[a]&&(s[a]=!0),void 0===n[t]&&(n[t]=!0)))})),o||(a[e]=!0)})),(Object.keys(s).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(s),pending:Object.keys(r),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(n)}}loaded(e,t,i){const o=e.split("|"),s=o[0],r=o[1];t&&this.emit("failedLoading",s,r,t),!t&&i&&this.store.addResourceBundle(s,r,i,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&i&&(this.state[e]=0);const a={};this.queue.forEach((i=>{((e,t,i)=>{const{obj:o,k:s}=l(e,t,Object);o[s]=o[s]||[],o[s].push(i)})(i.loaded,[s],r),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(i,e),t&&i.errors.push(t),0!==i.pendingCount||i.done||(Object.keys(i.loaded).forEach((e=>{a[e]||(a[e]={});const t=i.loaded[e];t.length&&t.forEach((t=>{void 0===a[e][t]&&(a[e][t]=!0)}))})),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((e=>!e.done))}read(e,t,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,r=arguments.length>5?arguments[5]:void 0;if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:i,tried:o,wait:s,callback:r});this.readingCalls++;const a=(a,n)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&n&&o<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,i,o+1,2*s,r)}),s):r(a,n)},n=this.backend[i].bind(this.backend);if(2!==n.length)return n(e,t,a);try{const i=n(e,t);i&&"function"==typeof i.then?i.then((e=>a(null,e))).catch(a):a(null,i)}catch(e){a(e)}}prepareLoading(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();i(e)&&(e=this.languageUtils.toResolveHierarchy(e)),i(t)&&(t=[t]);const r=this.queueLoad(e,t,o,s);if(!r.toLoad.length)return r.pending.length||s(),null;r.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,i){this.prepareLoading(e,t,{},i)}reload(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const i=e.split("|"),o=i[0],s=i[1];this.read(o,s,"read",void 0,void 0,((i,r)=>{i&&this.logger.warn(`${t}loading namespace ${s} for language ${o} failed`,i),!i&&r&&this.logger.log(`${t}loaded namespace ${s} for language ${o}`,r),this.loaded(e,i,r)}))}saveMissing(e,t,i,o,s){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn(`did not save key "${i}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=i&&""!==i){if(this.backend&&this.backend.create){const n={...r,isUpdate:s},l=this.backend.create.bind(this.backend);if(l.length<6)try{let s;s=5===l.length?l(e,t,i,o,n):l(e,t,i,o),s&&"function"==typeof s.then?s.then((e=>a(null,e))).catch(a):a(null,s)}catch(e){a(e)}else l(e,t,i,o,a,n)}e&&e[0]&&this.store.addResource(e[0],t,i,o)}}}const q=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),i(e[1])&&(t.defaultValue=e[1]),i(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const i=e[3]||e[2];Object.keys(i).forEach((e=>{t[e]=i[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),V=e=>(i(e.ns)&&(e.ns=[e.ns]),i(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),i(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),G=()=>{};class H extends C{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var i;if(super(),this.options=V(e),this.services={},this.logger=w,this.modules={external:[]},i=this,Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((e=>{"function"==typeof i[e]&&(i[e]=i[e].bind(i))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(s=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&(i(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=q();this.options={...r,...this.options,...V(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const a=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;w.init(this.modules.logger?a(this.modules.logger):null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=B);const i=new k(this.options);this.store=new P(this.options.resources,this.options);const o=this.services;o.logger=w,o.resourceStore=this.store,o.languageUtils=i,o.pluralResolver=new O(i,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(o.formatter=a(t),o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new j(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new U(a(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(function(t){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];e.emit(t,...o)})),this.modules.languageDetector&&(o.languageDetector=a(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=a(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new N(this.services,this.options),this.translator.on("*",(function(t){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];e.emit(t,...o)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,s||(s=G),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=function(){return e.store[t](...arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const n=o(),l=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),n.resolve(t),s(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),n}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G;const o=i(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],i=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};o?i(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>i(e))),this.options.preload&&this.options.preload.forEach((e=>i(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,i){const s=o();return"function"==typeof e&&(i=e,e=void 0),"function"==typeof t&&(i=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),i||(i=G),this.services.backendConnector.reload(e,t,(e=>{s.resolve(),i(e)})),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&z.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var s=this;this.isLanguageChangingTo=e;const r=o();this.emit("languageChanging",e);const a=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},n=(e,i)=>{i?(a(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,r.resolve((function(){return s.t(...arguments)})),t&&t(e,(function(){return s.t(...arguments)}))},l=t=>{e||t||!this.services.languageDetector||(t=[]);const o=i(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);o&&(this.language||a(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(o)),this.loadResources(o,(e=>{n(e,o)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(e):l(this.services.languageDetector.detect()),r}getFixedT(e,t,o){var s=this;const r=function(e,t){let i;if("object"!=typeof t){for(var a=arguments.length,n=new Array(a>2?a-2:0),l=2;l<a;l++)n[l-2]=arguments[l];i=s.options.overloadTranslationOptionHandler([e,t].concat(n))}else i={...t};i.lng=i.lng||r.lng,i.lngs=i.lngs||r.lngs,i.ns=i.ns||r.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||o||r.keyPrefix);const u=s.options.keySeparator||".";let c;return c=i.keyPrefix&&Array.isArray(e)?e.map((e=>`${i.keyPrefix}${u}${e}`)):i.keyPrefix?`${i.keyPrefix}${u}${e}`:e,s.t(c,i)};return i(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=o,r}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=t.lng||this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,s=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;const r=(e,t)=>{const i=this.services.backendConnector.state[`${e}|${t}`];return-1===i||0===i||2===i};if(t.precheck){const e=t.precheck(this,r);if(void 0!==e)return e}return!(!this.hasResourceBundle(i,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!r(i,e)||o&&!r(s,e)))}loadNamespaces(e,t){const s=o();return this.options.ns?(i(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{s.resolve(),t&&t(e)})),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=o();i(e)&&(e=[e]);const r=this.options.preload||[],a=e.filter((e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return a.length?(this.options.preload=r.concat(a),this.loadResources((e=>{s.resolve(),t&&t(e)})),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new k(q());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new H(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G;const i=e.forkResourceStore;i&&delete e.forkResourceStore;const o={...this.options,...e,isClone:!0},s=new H(o);return void 0===e.debug&&void 0===e.prefix||(s.logger=s.logger.clone(e)),["store","services","language"].forEach((e=>{s[e]=this[e]})),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i&&(s.store=new P(this.store.data,o),s.services.resourceStore=s.store),s.translator=new N(s.services,o),s.translator.on("*",(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];s.emit(e,...i)})),s.init(o,t),s.translator.options=o,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const W=H.createInstance();function K(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_(e)}function J(e){var t=function(e){if("object"!=_(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=_(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_(t)?t:t+""}function Y(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,J(o.key),o)}}W.createInstance=H.createInstance;var X=[],Z=X.forEach,Q=X.slice;function ee(e){return Z.call(Q.call(arguments,1),(function(t){if(t)for(var i in t)void 0===e[i]&&(e[i]=t[i])})),e}var te=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,ie=function(e,t,i){var o=i||{};o.path=o.path||"/";var s=encodeURIComponent(t),r="".concat(e,"=").concat(s);if(o.maxAge>0){var a=o.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");r+="; Max-Age=".concat(Math.floor(a))}if(o.domain){if(!te.test(o.domain))throw new TypeError("option domain is invalid");r+="; Domain=".concat(o.domain)}if(o.path){if(!te.test(o.path))throw new TypeError("option path is invalid");r+="; Path=".concat(o.path)}if(o.expires){if("function"!=typeof o.expires.toUTCString)throw new TypeError("option expires is invalid");r+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(r+="; HttpOnly"),o.secure&&(r+="; Secure"),o.sameSite)switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r},oe={name:"cookie",lookup:function(e){var t;if(e.lookupCookie&&"undefined"!=typeof document){var i=function(e){for(var t="".concat(e,"="),i=document.cookie.split(";"),o=0;o<i.length;o++){for(var s=i[o];" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return s.substring(t.length,s.length)}return null}(e.lookupCookie);i&&(t=i)}return t},cacheUserLanguage:function(e,t){t.lookupCookie&&"undefined"!=typeof document&&function(e,t,i,o){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};i&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+60*i*1e3)),o&&(s.domain=o),document.cookie=ie(e,encodeURIComponent(t),s)}(t.lookupCookie,e,t.cookieMinutes,t.cookieDomain,t.cookieOptions)}},se={name:"querystring",lookup:function(e){var t;if("undefined"!=typeof window){var i=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=i.substring(1).split("&"),s=0;s<o.length;s++){var r=o[s].indexOf("=");r>0&&o[s].substring(0,r)===e.lookupQuerystring&&(t=o[s].substring(r+1))}}return t}},re=null,ae=function(){if(null!==re)return re;try{re="undefined"!==window&&null!==window.localStorage;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){re=!1}return re},ne={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&ae()){var i=window.localStorage.getItem(e.lookupLocalStorage);i&&(t=i)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&ae()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},le=null,ue=function(){if(null!==le)return le;try{le="undefined"!==window&&null!==window.sessionStorage;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){le=!1}return le},ce={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&ue()){var i=window.sessionStorage.getItem(e.lookupSessionStorage);i&&(t=i)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&ue()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},de={name:"navigator",lookup:function(){var e=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var t=0;t<navigator.languages.length;t++)e.push(navigator.languages[t]);navigator.userLanguage&&e.push(navigator.userLanguage),navigator.language&&e.push(navigator.language)}return e.length>0?e:void 0}},he={name:"htmlTag",lookup:function(e){var t,i=e.htmlTag||("undefined"!=typeof document?document.documentElement:null);return i&&"function"==typeof i.getAttribute&&(t=i.getAttribute("lang")),t}},pe={name:"path",lookup:function(e){var t;if("undefined"!=typeof window){var i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(i instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof i[e.lookupFromPathIndex])return;t=i[e.lookupFromPathIndex].replace("/","")}else t=i[0].replace("/","")}return t}},me={name:"subdomain",lookup:function(e){var t="number"==typeof e.lookupFromSubdomainIndex?e.lookupFromSubdomainIndex+1:1,i="undefined"!=typeof window&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[t]}},ge=!1;try{ge=!0}catch(e){}var fe=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];function ve(){return{order:fe,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(e){return e}}}ge||fe.splice(1,1);var be,ye=function(){return e=function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};K(this,e),this.type="languageDetector",this.detectors={},this.init(t,i)},t=[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=ee(t,this.options||{},ve()),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(e){return e.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(oe),this.addDetector(se),this.addDetector(ne),this.addDetector(ce),this.addDetector(de),this.addDetector(he),this.addDetector(pe),this.addDetector(me)}},{key:"addDetector",value:function(e){return this.detectors[e.name]=e,this}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var i=[];return e.forEach((function(e){if(t.detectors[e]){var o=t.detectors[e].lookup(t.options);o&&"string"==typeof o&&(o=[o]),o&&(i=i.concat(o))}})),i=i.map((function(e){return t.options.convertDetectedLanguage(e)})),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(e,t){var i=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){i.detectors[t]&&i.detectors[t].cacheUserLanguage(e,i.options)})))}}],t&&Y(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();ye.type="languageDetector",function(e){e.PT_BR="pt_BR",e.EN_US="en_US",e.ES_ES="es_ES"}(be||(be={}));const xe={[be.PT_BR]:{translation:{app:{collapse:"Resumir",expand:"Expandir",close:"Fechar",profile:"Perfil",warning:"Aviso",edit:"Editar",remove:"Remover",yes:"Sim",no:"Não",loading:"Carregando",apply:"Aplicar",cancel:"Cancelar",confirm:"Confirmar",ok:"OK",alerts:"Avisos",requiredInfo:" (obrigatório) *"},"ez-upload":{enable:"Arraste e solte ou clique para adicionar arquivos",disable:"Somente leitura",replaceFileTitle:"Substituir arquivo",replaceFileMessage:'Já existe um arquivo chamado "{{fileName}}". Deseja substituí-lo?',maxFilesError:"A quantidade máxima de arquivos é {{maxFiles}}.",emptyFileError:'Erro de permissão: O arquivo "{{fileName}}" não pode ser enviado.',missingUploadUrlError:"Endereço de upload não informado.",maxFileSizeError:"O tamanho máximo dos arquivos é de {{maxSize}}.",uploadErrorTitle:"Enviando arquivo",uploadingMessage:"Há arquivos sendo enviados. Por favor aguarde a conclusão ou cancele o envio."},"ez-calendar":{month:{0:"Janeiro",1:"Fevereiro",2:"Março",3:"Abril",4:"Maio",5:"Junho",6:"Julho",7:"Agosto",8:"Setembro",9:"Outubro",10:"Novembro",11:"Dezembro"},weekDay:{0:"D",1:"S",2:"T",3:"Q",4:"Q",5:"S",6:"S"},today:"Hoje"},"ez-collapsible-box":{confirmRemove:"Deseja realmente remover o grupo <b>{{label}}</b>?"},"ez-combo-box":{placeholder:"Selecione um item",noResults:"Nenhum resultado encontrado"},"ez-classic-combo-box":{emptyOption:"Selecione um item",noResults:"Nenhum resultado encontrado"},"ez-date-time-input":{invalidDate:"O valor digitado não é uma data e hora válida"},"ez-date-input":{invalidDate:"O valor digitado não é uma data válida"},"ez-dialog":{confirmButton:"Botão de confirmação ou OK",closeButton:"Botão de fechar ou X"},"ez-double-list":{noItemsAvailable:"Nenhum {{entity}} disponível",noItemsSelected:"Nenhum {{entity}} selecionado",moveAllTo:"Mover todos para {{list}}",moveTo:"Mover para {{list}}",moveToFirstPosition:"Mover para a primeira posição",moveUp:"Mover para cima",moveDown:"Mover para baixo",moveToLastPosition:"Mover para a última posição"},"ez-file-item":{invalidProgress:"O progresso de upload deve ser um número entre 0 e 100."},"ez-grid":{filterAppliedSuccess:"Filtro de coluna aplicado com sucesso!",cancelPagination:"Cancelar paginação",pageLabel:"Página {{currentPage}}",previousPage:"Página anterior",nextPage:"Próxima página",returnToPreviousPage:"Retorna à página anterior.",goToNextPage:"Avança para a próxima página.",remainingPageLabel:" de {{count}} ou mais",remainingTotalLabel:" de {{total}}",nextRecord:"Avança para o próximo registro.",previousRecord:"Retorna ao registro anterior.",searchColumn:"Busca por coluna.",sortAscending:"Ordenar Ascendente",sortDescending:"Ordenar Descendente",pinColumn:"Fixar coluna",unpinColumn:"Desafixar coluna",filter:"Filtrar",columnCantBeOrder:"Coluna não pode ser ordenada",filterColumnHeader:"Filtro da coluna {{columnLabel}}",clearSelection:"Limpar Seleção",page:"Página",more:"mais",to:"para",of:"de",next:"Próximo",last:"Último",first:"Primeiro",previous:"Anterior",loadingOoo:"Carregar",selectAll:"Selecionar tudo",searchOoo:"Procurar",blanks:"Vazio",filterOoo:"Filtrar",applyFilter:"Aplicar filtro",equals:"Igual",lessThan:"Menor que",greaterThan:"Maior que",contains:"Contém",startsWith:"Começa com",endsWith:"Termina com",group:"Grupo",columns:"Colunas",rowGroupColumns:"Colunas do grupo de linhas",rowGroupColumnsEmptyMessage:"Colunas do grupo de linhas vazias",valueColumns:"Valores das colunas",pivotMode:"Modo pivô",groups:"Grupos",values:"Valores",pivots:"Pivôs",valueColumnsEmptyMessage:"Valores de colunas vazias",pivotColumnsEmptyMessage:"Pivôs de colunas vazias",toolPanelButton:"Botão de painel de ferramentas",noRowsToShow:"Não há registros para mostrar.",valueAggregation:"Agregar valor",autosizeThiscolumn:"Redimensionar esta coluna",autosizeAllColumns:"Redimensionar todas colunas",groupBy:"Agrupar por",ungroupBy:"Desagrupar por",resetColumns:"Resetar colunas",expandAll:"Expandir tudo",collapseAll:"Contrair tudo",toolPanel:"Painel de ferramentas",export:"Exportar",csvExport:"Exportar para CSV",excelExport:"Exportar para Excel",pinLeft:"Fixar coluna",pinRight:"Fixar a direita",noPin:"Desfixar coluna",sum:"Soma",min:"Mínimo",max:"Máximo",none:"Nenhum",count:"Contagem",average:"Média",copy:"Copiar",copyWithHeaders:"Copiar com cabeçalho",copyWithGroupHeaders:"Copiar com cabeçalhos de grupo",ctrlC:"Ctrl+C",paste:"Colar",ctrlV:"Ctrl+V",labelSearchColumn:"Buscar colunas (Ctrl+F)"},"ez-guide-navigator":{searchGuide:"Buscar guia",hideMenu:"Ocultar menu"},"ez-list":{moveToGroup:"Mover para {{groupName}}"},"ez-modal":{close:"Fechar modal"},"ez-multi-selection-list":{selectAll:"Selecionar todos",search:"Buscar...",empty:"(Vazio)",initMessage:"Selecione os valores a serem filtrados através do campo de busca.",emptyResults:"Nenhum resultado encontrado."},"ez-number-input":{invalidNumber:"O valor digitado não é um número válido"},"ez-pagination":{previousPage:"Página anterior",nextPage:"Próxima página"},"ez-rich-text":{listShortcut:"Aplica estilo de lista ao texto selecionado.",linkShortcut:"Abre popup de link.",imageShortcut:"Abre popup de imagem.",boldShortcut:"Aplica estilo negrito ao texto selecionado.",italicShortcut:"Aplica estilo itálico ao texto selecionado.",underlineShortcut:"Aplica estilo sublinhado ao texto selecionado.",breakLineShortcut:"Aplica quebra de linha.",undoShortcut:"Desfaz a última alteração de texto.",redoShortcut:"Refaz a última alteração de texto.",edit:"Editar",preview:"Pré-visualizar",title:{preview:"Ctrl + P",edit:"Ir para modo edição",undo:"Desfazer (Ctrl + Z)",redo:"Refazer (Ctrl + X)",link:"Inserir link (Ctrl + K)",image:"Inserir imagem (Ctrl + O)",list:"Lista (Ctrl + L)",underline:"Sublinhado (Ctrl + U)",italic:"Itálico (Ctrl + I)",bold:"Negrito (Ctrl + B)"}},"ez-link-builder":{addLinkTitle:"Adicionar link",addLinkSubtitle:"Insira um link no texto para abrir novas páginas.",submit:"Enviar",urlInputLabel:"Insira a URL destino",textInputLabel:"Insira o texto a ser exibido",openInNewPage:"Abrir em uma nova página."},"ez-simple-image-uploader":{uploadTitle:"Upload de imagens",uploadSubtitle:"Envie seus arquivos preenchendo apenas 1 campo por vez.",submit:"Enviar",tooltipMessage:"O arquivo selecionado abaixo será priorizado!",urlInputLabel:"Insira a URL da imagem",orText:"OU",removeFile:"Remover arquivo",dragDropText:"Arraste e solte ou clique para adicionar arquivos",imageAlt:"Imagem",imageTooLarge:"A imagem deve ter menos de {{maxSize}}."},"ez-search":{emptyList:"Nenhum resultado encontrado",emptySearch:"Nenhum resultado de {{field}} encontrado",showMore:"Mostrar mais"},"ez-search-plus":{emptyList:"Nenhum resultado encontrado",optionLoaderNotDefined:"optionLoader não definido",defaultCodeLabel:"Cód."},"ez-sortable-list":{emptyMessage:"Nenhum item na lista",entityLabel:"item",entityLabelPlural:"itens",total:"Total de",search:"Buscar"},"ez-split-button":{moreOptions:"Mais opções"},"ez-text-edit":{emptyFieldWarning:"Não é possível salvar um campo em branco."},"ez-time-input":{invalidTime:"Favor inserir um horário válido."},"ez-sidebar":{unPinMenu:"Desafixar menu",pushPinMenu:"Fixar menu",hideMenu:"Recolher menu"},"ez-form":{mainTab:"Principal",labelSearchField:"Buscar campos (Ctrl+F)"},utils:{requiredFieldMessage:"Há pelo menos um campo obrigatório não preenchido.",requiredField:"Essa informação é obrigatória.",selectAllPage:"Selecionar apenas a página atual",loadingAllRecords:"Carregando todos os {{count}} registros",selectAllRecords:"Selecionar todos os {{total}} registros",waitForLoad:"Aguarde o carregamento para selecionar o registro de todas as páginas",allRecordsSelected:"Todos os <strong>{{selectionCount}} registros</strong> da grade estão selecionados.",selectedRecords:"Há <strong>{{selectionCount}} registro{{plural}}</strong> selecionado{{plural}} na grade."},spinner:{loading:"Carregando..."}}},[be.EN_US]:{translation:{app:{collapse:"Collapse",expand:"Expand",close:"Close",profile:"Profile",warning:"Warning",edit:"Edit",remove:"Remove",yes:"Yes",no:"No",loading:"Loading",apply:"Apply",cancel:"Cancel",confirm:"Confirm",ok:"OK",alerts:"Alerts",requiredInfo:" (required) *"},"ez-upload":{enable:"Drag and drop or click to add files",disable:"Read only",replaceFileTitle:"Replace file",replaceFileMessage:'A file named "{{fileName}}" already exists. Do you want to replace it?',maxFilesError:"The maximum number of files is {{maxFiles}}.",emptyFileError:'Permission error: The file "{{fileName}}" cannot be uploaded.',missingUploadUrlError:"Upload URL not provided.",maxFileSizeError:"The maximum file size is {{maxSize}}.",uploadErrorTitle:"Uploading file",uploadingMessage:"Files are being uploaded. Please wait for completion or cancel the upload."},"ez-calendar":{month:{0:"January",1:"February",2:"March",3:"April",4:"May",5:"June",6:"July",7:"August",8:"September",9:"October",10:"November",11:"December"},weekDay:{0:"S",1:"M",2:"T",3:"W",4:"T",5:"F",6:"S"},today:"Today"},"ez-collapsible-box":{confirmRemove:"Do you really want to remove the group <b>{{label}}</b>?"},"ez-combo-box":{placeholder:"Select an item",noResults:"No results found"},"ez-classic-combo-box":{emptyOption:"Select an item",noResults:"No results found"},"ez-date-time-input":{invalidDate:"The entered value is not a valid date and time"},"ez-date-input":{invalidDate:"The entered value is not a valid date"},"ez-dialog":{confirmButton:"Confirm or OK button",closeButton:"Close or X button"},"ez-double-list":{noItemsAvailable:"No {{entity}} available",noItemsSelected:"No {{entity}} selected",moveAllTo:"Move all to {{list}}",moveTo:"Move to {{list}}",moveToFirstPosition:"Move to the first position",moveUp:"Move up",moveDown:"Move down",moveToLastPosition:"Move to the last position"},"ez-file-item":{invalidProgress:"The upload progress must be a number between 0 and 100."},"ez-grid":{filterAppliedSuccess:"Column filter applied successfully!",cancelPagination:"Cancel pagination",pageLabel:"Page {{currentPage}}",previousPage:"Previous page",nextPage:"Next page",returnToPreviousPage:"Return to the previous page.",goToNextPage:"Move to the next page.",remainingPageLabel:" from {{count}} or more",remainingTotalLabel:" from {{total}}",nextRecord:"Move to the next record.",previousRecord:"Return to the previous record.",searchColumn:"Search by column.",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",pinColumn:"Pin column",unpinColumn:"Unpin column",filter:"Filter",columnCantBeOrder:"Column cannot be sorted",filterColumnHeader:"Filter for column {{columnLabel}}",clearSelection:"Clear Selection",page:"Page",more:"more",to:"to",of:"of",next:"Next",last:"Last",first:"First",previous:"Previous",loadingOoo:"Loading",selectAll:"Select all",searchOoo:"Search",blanks:"Blanks",filterOoo:"Filter",applyFilter:"Apply filter",equals:"Equals",lessThan:"Less than",greaterThan:"Greater than",contains:"Contains",startsWith:"Starts with",endsWith:"Ends with",group:"Group",columns:"Columns",rowGroupColumns:"Row group columns",rowGroupColumnsEmptyMessage:"Row group columns empty",valueColumns:"Value columns",pivotMode:"Pivot mode",groups:"Groups",values:"Values",pivots:"Pivots",valueColumnsEmptyMessage:"Value columns empty",pivotColumnsEmptyMessage:"Pivot columns empty",toolPanelButton:"Tool panel button",noRowsToShow:"No rows to show.",valueAggregation:"Aggregate value",autosizeThiscolumn:"Autosize this column",autosizeAllColumns:"Autosize all columns",groupBy:"Group by",ungroupBy:"Ungroup by",resetColumns:"Reset columns",expandAll:"Expand all",collapseAll:"Collapse all",toolPanel:"Tool panel",export:"Export",csvExport:"Export to CSV",excelExport:"Export to Excel",pinLeft:"Pin left",pinRight:"Pin right",noPin:"Unpin column",sum:"Sum",min:"Min",max:"Max",none:"None",count:"Count",average:"Average",copy:"Copy",copyWithHeaders:"Copy with headers",copyWithGroupHeaders:"Copy with group headers",ctrlC:"Ctrl+C",paste:"Paste",ctrlV:"Ctrl+V",labelSearchColumn:"Search columns (Ctrl+F)"},"ez-guide-navigator":{searchGuide:"Search guide",hideMenu:"Hide menu"},"ez-list":{moveToGroup:"Move to {{groupName}}"},"ez-modal":{close:"Close modal"},"ez-multi-selection-list":{selectAll:"Select all",search:"Search...",empty:"(Empty)",initMessage:"Select the values to be filtered through the search field.",emptyResults:"No results found."},"ez-number-input":{invalidNumber:"The entered value is not a valid number"},"ez-pagination":{previousPage:"Previous page",nextPage:"Next page"},"ez-rich-text":{listShortcut:"Applies list style to the selected text.",linkShortcut:"Opens link popup.",imageShortcut:"Opens image popup.",boldShortcut:"Applies bold style to the selected text.",italicShortcut:"Applies italic style to the selected text.",underlineShortcut:"Applies underline style to the selected text.",breakLineShortcut:"Applies line break.",undoShortcut:"Undoes the last text change.",redoShortcut:"Redoes the last text change.",edit:"Edit",preview:"Preview",title:{preview:"Ctrl + P",edit:"Switch to edit mode",undo:"Undo (Ctrl + Z)",redo:"Redo (Ctrl + X)",link:"Insert link (Ctrl + K)",image:"Insert image (Ctrl + O)",list:"List (Ctrl + L)",underline:"Underline (Ctrl + U)",italic:"Italic (Ctrl + I)",bold:"Bold (Ctrl + B)"}},"ez-link-builder":{addLinkTitle:"Add link",addLinkSubtitle:"Insert a link into the text to open new pages.",submit:"Submit",urlInputLabel:"Enter the destination URL",textInputLabel:"Enter the text to display",openInNewPage:"Open in a new page."},"ez-simple-image-uploader":{uploadTitle:"Image Upload",uploadSubtitle:"Upload your files by filling only 1 field at a time.",submit:"Submit",tooltipMessage:"The selected file below will be prioritized!",urlInputLabel:"Enter the image URL",orText:"OR",removeFile:"Remove file",dragDropText:"Drag and drop or click to add files",imageAlt:"Image",imageTooLarge:"The image must be smaller than {{maxSize}}."},"ez-search":{emptyList:"No results found",emptySearch:"No results for {{field}} found",showMore:"Show more"},"ez-search-plus":{emptyList:"No results found",optionLoaderNotDefined:"optionLoader not defined",defaultCodeLabel:"Code"},"ez-sortable-list":{emptyMessage:"No items in the list",entityLabel:"item",entityLabelPlural:"items",total:"Total of",search:"Search"},"ez-split-button":{moreOptions:"More options"},"ez-text-edit":{emptyFieldWarning:"It is not possible to save an empty field."},"ez-time-input":{invalidTime:"Please enter a valid time."},"ez-sidebar":{unPinMenu:"Unpin menu",pushPinMenu:"Pin menu",hideMenu:"Hide menu"},"ez-form":{mainTab:"Main",labelSearchField:"Search fields (Ctrl+F)"},utils:{requiredFieldMessage:"There is at least one required field not filled.",requiredField:"This information is required.",selectAllPage:"Select only the current page",loadingAllRecords:"Loading all {{count}} records",selectAllRecords:"Select all {{total}} records",waitForLoad:"Wait for loading to select records from all pages",allRecordsSelected:"All <strong>{{selectionCount}} records</strong> in the grid are selected.",selectedRecords:"There <strong>{{selectionCount}} record{{plural}}</strong> selected in the grid."},spinner:{loading:"Loading..."}}},[be.ES_ES]:{translation:{app:{collapse:"Colapsar",expand:"Expandir",close:"Cerrar",profile:"Perfil",warning:"Aviso",edit:"Editar",remove:"Eliminar",yes:"Sí",no:"No",loading:"Cargando",apply:"Aplicar",cancel:"Cancelar",confirm:"Confirmar",ok:"OK",alerts:"Avisos",requiredInfo:" (obligatorio) *"},"ez-upload":{enable:"Arrastra y suelta o haz clic para subir archivos",disable:"Solo lectura",replaceFileTitle:"Reemplazar archivo",replaceFileMessage:'Ya existe un archivo llamado "{{fileName}}". ¿Desea reemplazarlo?',maxFilesError:"La cantidad máxima de archivos es {{maxFiles}}.",emptyFileError:'Error de permiso: El archivo "{{fileName}}" no puede ser enviado.',missingUploadUrlError:"Dirección de carga no informada.",maxFileSizeError:"El tamaño máximo de los archivos es de {{maxSize}}.",uploadErrorTitle:"Subiendo archivo",uploadingMessage:"Se están subiendo archivos. Por favor, espere a que se complete o cancele la subida."},"ez-calendar":{month:{0:"Enero",1:"Febrero",2:"Marzo",3:"Abril",4:"Mayo",5:"Junio",6:"Julio",7:"Agosto",8:"Septiembre",9:"Octubre",10:"Noviembre",11:"Diciembre"},weekDay:{0:"D",1:"L",2:"M",3:"M",4:"J",5:"V",6:"S"},today:"Hoy"},"ez-collapsible-box":{confirmRemove:"¿Realmente desea eliminar el grupo <b>{{label}}</b>?"},"ez-combo-box":{placeholder:"Seleccione un elemento",noResults:"No se encontraron resultados"},"ez-classic-combo-box":{emptyOption:"Seleccione un elemento",noResults:"No se encontraron resultados"},"ez-date-time-input":{invalidDate:"El valor ingresado no es una fecha y hora válida"},"ez-date-input":{invalidDate:"El valor ingresado no es una fecha válida"},"ez-dialog":{confirmButton:"Botón de confirmación o OK",closeButton:"Botón de cerrar o X"},"ez-double-list":{noItemsAvailable:"No hay {{entity}} disponible",noItemsSelected:"No hay {{entity}} seleccionado",moveAllTo:"Mover todos a {{list}}",moveTo:"Mover a {{list}}",moveToFirstPosition:"Mover a la primera posición",moveUp:"Mover hacia arriba",moveDown:"Mover hacia abajo",moveToLastPosition:"Mover a la última posición"},"ez-file-item":{invalidProgress:"El progreso de carga debe ser un número entre 0 y 100."},"ez-grid":{filterAppliedSuccess:"¡Filtro de columna aplicado con éxito!",cancelPagination:"Cancelar paginación",pageLabel:"Página {{currentPage}}",previousPage:"Página anterior",nextPage:"Página siguiente",returnToPreviousPage:"Volver a la página anterior.",goToNextPage:"Avanzar a la página siguiente.",remainingPageLabel:" de {{count}} o más",remainingTotalLabel:" de {{total}}",nextRecord:"Avanzar al siguiente registro.",previousRecord:"Volver al registro anterior.",searchColumn:"Buscar por columna.",sortAscending:"Ordenar Ascendente",sortDescending:"Ordenar Descendente",pinColumn:"Fijar columna",unpinColumn:"Desafijar columna",filter:"Filtrar",columnCantBeOrder:"La columna no se puede ordenar",filterColumnHeader:"Filtro de la columna {{columnLabel}}",clearSelection:"Limpiar Selección",page:"Página",more:"más",to:"a",of:"de",next:"Siguiente",last:"Último",first:"Primero",previous:"Anterior",loadingOoo:"Cargando",selectAll:"Seleccionar todo",searchOoo:"Buscar",blanks:"Vacío",filterOoo:"Filtrar",applyFilter:"Aplicar filtro",equals:"Igual",lessThan:"Menor que",greaterThan:"Mayor que",contains:"Contiene",startsWith:"Empieza con",endsWith:"Termina con",group:"Grupo",columns:"Columnas",rowGroupColumns:"Columnas del grupo de filas",rowGroupColumnsEmptyMessage:"Columnas del grupo de filas vacías",valueColumns:"Valores de las columnas",pivotMode:"Modo pivote",groups:"Grupos",values:"Valores",pivots:"Pivotes",valueColumnsEmptyMessage:"Valores de columnas vacías",pivotColumnsEmptyMessage:"Pivotes de columnas vacías",toolPanelButton:"Botón del panel de herramientas",noRowsToShow:"No hay registros para mostrar.",valueAggregation:"Agregar valor",autosizeThiscolumn:"Redimensionar esta columna",autosizeAllColumns:"Redimensionar todas las columnas",groupBy:"Agrupar por",ungroupBy:"Desagrupar por",resetColumns:"Restablecer columnas",expandAll:"Expandir todo",collapseAll:"Contraer todo",toolPanel:"Panel de herramientas",export:"Exportar",csvExport:"Exportar a CSV",excelExport:"Exportar a Excel",pinLeft:"Fijar a la izquierda",pinRight:"Fijar a la derecha",noPin:"Desfijar columna",sum:"Suma",min:"Mínimo",max:"Máximo",none:"Ninguno",count:"Conteo",average:"Promedio",copy:"Copiar",copyWithHeaders:"Copiar con encabezados",copyWithGroupHeaders:"Copiar con encabezados de grupo",ctrlC:"Ctrl+C",paste:"Pegar",ctrlV:"Ctrl+V",labelSearchColumn:"Buscar columnas (Ctrl+F)"},"ez-guide-navigator":{searchGuide:"Buscar guía",hideMenu:"Ocultar menú"},"ez-list":{moveToGroup:"Mover a {{groupName}}"},"ez-modal":{close:"Cerrar modal"},"ez-multi-selection-list":{selectAll:"Seleccionar todos",search:"Buscar...",empty:"(Vacío)",initMessage:"Seleccione los valores a filtrar a través del campo de búsqueda.",emptyResults:"No se encontraron resultados."},"ez-number-input":{invalidNumber:"El valor ingresado no es un número válido"},"ez-pagination":{previousPage:"Página anterior",nextPage:"Página siguiente"},"ez-rich-text":{listShortcut:"Aplica estilo de lista al texto seleccionado.",linkShortcut:"Abre popup de enlace.",imageShortcut:"Abre popup de imagen.",boldShortcut:"Aplica estilo negrita al texto seleccionado.",italicShortcut:"Aplica estilo cursiva al texto seleccionado.",underlineShortcut:"Aplica estilo subrayado al texto seleccionado.",breakLineShortcut:"Aplica salto de línea.",undoShortcut:"Deshace el último cambio de texto.",redoShortcut:"Rehace el último cambio de texto.",edit:"Editar",preview:"Previsualizar",title:{preview:"Ctrl + P",edit:"Ir al modo de edición",undo:"Deshacer (Ctrl + Z)",redo:"Rehacer (Ctrl + X)",link:"Insertar enlace (Ctrl + K)",image:"Insertar imagen (Ctrl + O)",list:"Lista (Ctrl + L)",underline:"Subrayado (Ctrl + U)",italic:"Cursiva (Ctrl + I)",bold:"Negrita (Ctrl + B)"}},"ez-link-builder":{addLinkTitle:"Agregar enlace",addLinkSubtitle:"Inserte un enlace en el texto para abrir nuevas páginas.",submit:"Enviar",urlInputLabel:"Ingrese la URL de destino",textInputLabel:"Ingrese el texto a mostrar",openInNewPage:"Abrir en una nueva página."},"ez-simple-image-uploader":{uploadTitle:"Subida de imágenes",uploadSubtitle:"Sube tus archivos llenando solo 1 campo a la vez.",submit:"Enviar",tooltipMessage:"¡El archivo seleccionado a continuación será priorizado!",urlInputLabel:"Ingrese la URL de la imagen",orText:"O",removeFile:"Eliminar archivo",dragDropText:"Arrastra y suelta o haz clic para agregar archivos",imageAlt:"Imagen",imageTooLarge:"La imagen debe tener menos de {{maxSize}}."},"ez-search":{emptyList:"No se encontraron resultados",emptySearch:"No se encontraron resultados de {{field}}",showMore:"Mostrar más"},"ez-search-plus":{emptyList:"No se encontraron resultados",optionLoaderNotDefined:"optionLoader no definido",defaultCodeLabel:"Cód."},"ez-sortable-list":{emptyMessage:"No hay elementos en la lista",entityLabel:"elemento",entityLabelPlural:"elementos",total:"Total de",search:"Buscar"},"ez-split-button":{moreOptions:"Más opciones"},"ez-text-edit":{emptyFieldWarning:"No es posible guardar un campo vacío."},"ez-time-input":{invalidTime:"Por favor, ingrese una hora válida."},"ez-sidebar":{unPinMenu:"Desanclar menú",pushPinMenu:"Anclar menú",hideMenu:"Ocultar menú"},"ez-form":{mainTab:"Principal",labelSearchField:"Buscar campos (Ctrl+F)"},utils:{requiredFieldMessage:"Hay al menos un campo obligatorio sin completar.",requiredField:"Esta información es obligatoria.",selectAllPage:"Seleccionar solo la página actual",loadingAllRecords:"Cargando todos los {{count}} registros",selectAllRecords:"Seleccionar todos los {{total}} registros",waitForLoad:"Espere a que se carguen para seleccionar los registros de todas las páginas",allRecordsSelected:"Todos los <strong>{{selectionCount}} registros</strong> en la cuadrícula están seleccionados.",selectedRecords:"Hay <strong>{{selectionCount}} registro{{plural}}</strong> seleccionado{{plural}} en la cuadrícula."},spinner:{loading:"Cargando..."}}}},Se="__EZ_UI_I18N_INSTANCE__";function we(){return e.getContextValue(Se)}const Ce=async i=>{let o=we();if(!o){const s=W.createInstance(),r={resources:xe,fallbackLng:be.PT_BR};await s.use(ye).init(r);const a=t.getLanguage(),n=null!=i?i:a;await s.changeLanguage(n),e.setContextValue(Se,s.t),o=s.t}return o};export{we as g,Ce as i}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as l,h as a,g as r}from"./p-23a36bb6.js";import{ElementIDUtils as o}from"@sankhyalabs/core";const i=class{constructor(a){e(this,a),this.valueChange=l(this,"valueChange",7),this.removeChip=l(this,"removeChip",7),this.actionClick=l(this,"actionClick",7),this.iconClick=l(this,"iconClick",7),this.label=void 0,this.enabled=!0,this.removePosition=void 0,this.mode=void 0,this.value=!1,this.showNativeTooltip=!1,this.disableAutoUpdateValue=!1,this.maxWidth=void 0,this.size="default",this.iconNameLeft=void 0,this.iconNameRight=void 0,this.type="primary",this.tabIndex=0,this.removeWithKeyboard=!1,this._isOverflowing=!1}async setFocus(){this._containerElem.focus()}async setBlur(){this._containerElem.blur()}handleValueChange(){this.swichState(),this.valueChange.emit(this.value)}handleClick(){if(this.enabled)return"action"===this.mode?this.actionClick.emit():this.disableAutoUpdateValue?void 0:this.handleValueChange()}handleClickRemoveButton(e){this.enabled&&(e.stopPropagation(),this.removeChip.emit())}handleIconClick(e,l){this.enabled&&(e.stopPropagation(),this.iconClick.emit({icon:l}))}swichState(){this.enabled&&(this.value=!this.value)}checkIsOverflowing(){this._isOverflowing=!!this._labelElem&&this._labelElem.offsetWidth<this._labelElem.scrollWidth}handleDeleteKey(){this.removeWithKeyboard?this.removeChip.emit():"action"===this.mode?this.actionClick.emit():(this.swichState(),this.valueChange.emit(this.value))}handleKeyDown(e){"Enter"!==e.key&&"Backspace"!==e.key&&"Delete"!==e.key||(e.preventDefault(),this.handleDeleteKey())}componentDidLoad(){this._element&&o.addIDInfo(this._element,"ezChip"),this._containerElem&&this._containerElem.setAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME,o.getInternalIDInfo("button")),this.checkIsOverflowing()}render(){let e="default";return this.enabled?this.value&&"action"!==this.mode&&(e="active"):e="disabled",a("ez-tooltip",{active:this.showNativeTooltip||this._isOverflowing,message:this.label},a("button",{ref:e=>this._containerElem=e,class:{"label__container--row-reverse":"left"===this.removePosition,label__container:!0},"data-color-state":e,"data-color-type":this.type,"data-size":this.size,onClick:this.handleClick.bind(this),tabIndex:this.tabIndex,style:{maxWidth:this.maxWidth},onKeyDown:this.handleKeyDown.bind(this)},this.iconNameLeft&&a("ez-icon",{size:"medium","icon-name":this.iconNameLeft,onClick:e=>this.handleIconClick(e,"left")}),a("slot",{name:"leftIcon"}),a("label",{ref:e=>this._labelElem=e,class:{"label__text--disabled":!this.enabled,label__text:!0}},this.label),a("slot",{name:"rightIcon"}),this.iconNameRight&&a("ez-icon",{size:"medium","icon-name":this.iconNameRight,onClick:e=>this.handleIconClick(e,"right")}),"action"!==this.mode&&this.removePosition&&a("ez-icon",{class:"btn-close",size:"medium","icon-name":"close",onClick:e=>this.handleClickRemoveButton(e)})))}get _element(){return r(this)}};i.style=':host{--ez-label-chip--height:32px;--ez-label-chip__label--font-size:var(--font-size--default, 14px);--ez-label-chip__label--font-family:var(--font-pattern, Arial);--ez-label-chip__label--font-weight:var(--font-weight--regular, 400);--ez-label-chip__horizontal-padding:var(--space--8, 8px);--ez-label-chip__label--text--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label--icon--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--border-radius:var(--border--radius-large, 24px);--ez-label-chip__label__container--border:1px solid;--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container-color--disabled:var(--color--gray-80, #F9F9F9);--ez-label-chip__label__container--background-color:var(--color--ocean-green-600, #008561);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--ocean-green-700, #00684C);--ez-label-chip__label__container--default--color--active:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--text--disabled:var(--color--gray-300, #A4A5A7);--ez-label-chip__label__container--default--border-color--active:var(--color--ocean-green-200);--ez-label-chip__label__container--secondary--border-color--active:var(--color--gray-200)}.label__text{cursor:pointer;white-space:nowrap;user-select:none;text-overflow:ellipsis;overflow:hidden;max-width:100%;font-family:var(--ez-label-chip__label--font-family);font-size:var(--ez-label-chip__label--font-size);font-weight:var(--ez-label-chip__label--font-weight)}.label__text--disabled{cursor:not-allowed}.label__container{cursor:pointer;width:max-content;display:flex;flex-wrap:wrap;align-items:center;gap:var(--space--4);outline:none;height:var(--ez-label-chip--height);border:var(--ez-label-chip__label__container--border);border-radius:var(--ez-label-chip__label__container--border-radius);padding:0 var(--ez-label-chip__horizontal-padding);outline-color:var(--ez-label-chip__label__container--default--border-color--active)}.label__container[data-size="default"]{height:var(--ez-label-chip--height, 32px)}.label__container[data-size="medium"]{height:42px}.label__container[data-size="large"]{height:50px}.label__container--row-reverse{flex-direction:row-reverse}.label__container--disabled{cursor:not-allowed}.label__container:hover{-webkit-transition:150ms -webkit-filter linear;transition:150ms filter linear, 150ms -webkit-filter linear;filter:brightness(90%)}.label__container:focus{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--ez-label-chip__label__container--default--border-color--active)}.label__container:active{-webkit-transition:150ms -webkit-filter linear;transition:150ms filter linear, 150ms -webkit-filter linear;filter:brightness(85%)}.label__container ez-icon{--ez-icon--color:var(--ez-label-chip__label--icon--primary)}:host .label__container ::slotted(ez-icon){--ez-icon--color:var(--ez-label-chip__label--icon--primary)}.label__container[data-color-state="default"]{border-color:var(--ez-label-chip__label__container--border-color-strokes);background-color:var(--ez-label-chip__label__container--background-color);color:var(--ez-label-chip__label--text--primary)}.label__container[data-color-state="active"]{border-color:var(--ez-label-chip__label__container--border-color-active);background-color:var(--ez-label-chip__label__container--default--background-color--active);color:var(--ez-label-chip__label__container--default--color--active)}.label__container:focus{box-shadow:0 0 0 2px var(--color--gray-70), 0 0 0 4px var(--ez-label-chip__label__container--default--border-color--active)}.label__container[data-color-type="secondary"]{--ez-label-chip__label--icon--primary:var(--color--gray-300, #A4A5A7);--ez-label-chip__label__container--border-color-strokes:var(--color--gray-200, #D2D2D3);--ez-label-chip__label__container--background-color:var(--color--gray-70, #F7F7F8);--ez-label-chip__label--text--primary:var(--color--ocean-green-1000, #00281D);--ez-label-chip__label__container--border-color-active:var(--color--gray-200, #D2D2D3);--ez-label-chip__label__container--default--background-color--active:var(--color--primary-300, #6BB8A3);--ez-label-chip__label__container--default--color--active:var(--color--ocean-green-600, #008561);--ez-label-chip__label__container--default--border-color--active:var(--color--ocean-green-600, #008561)}.label__container[data-color-type="error"]{--ez-label-chip__label--icon--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--red-600, #BD0025);--ez-label-chip__label--text--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--red-700, #97001E);--ez-label-chip__label__container--default--color--active:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-type="error-light"]{--ez-label-chip__label--icon--primary:var(--color--red-600, #BD0025);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--red-200, #F2CCD3);--ez-label-chip__label--text--primary:var(--color--red-600, #BD0025);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--red-300, #E599A8);--ez-label-chip__label__container--default--color--active:var(--color--red-600, #BD0025);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-type="warning"]{--ez-label-chip__label--icon--primary:var(--color--yellow-900, #604701);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--yellow-600, #EFB103);--ez-label-chip__label--text--primary:var(--color--yellow-900, #604701);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--yellow-700, #BF8E02);--ez-label-chip__label__container--default--color--active:var(--color--yellow-900, #604701);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-type="warning-light"]{--ez-label-chip__label--icon--primary:var(--color--yellow-600, #EFB103);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--yellow-200, #FDF6E4);--ez-label-chip__label--text--primary:var(--color--yellow-600, #EFB103);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--yellow-300, #F6EB8A);--ez-label-chip__label__container--default--color--active:var(--color--yellow-600, #EFB103);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-type="success"]{--ez-label-chip__label--icon--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--green-600, #157A00);--ez-label-chip__label--text--primary:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--green-700, #116200);--ez-label-chip__label__container--default--color--active:var(--color--gray-70, #FFFFFF);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-type="success-light"]{--ez-label-chip__label--icon--primary:var(--color--green-600, #157A00);--ez-label-chip__label__container--border-color-strokes:transparent;--ez-label-chip__label__container--background-color:var(--color--green-200, #C8E6C9);--ez-label-chip__label--text--primary:var(--color--green-600, #157A00);--ez-label-chip__label__container--border-color-active:transparent;--ez-label-chip__label__container--default--background-color--active:var(--color--green-300, #A5D6A7);--ez-label-chip__label__container--default--color--active:var(--color--green-600, #157A00);--ez-label-chip__label__container--default--border-color--active:transparent}.label__container[data-color-state="disabled"]{border-color:var(--ez-label-chip__label__container-color--disabled);background-color:var(--ez-label-chip__label__container-color--disabled);color:var(--ez-label-chip__label__container--text--disabled);cursor:not-allowed;filter:none}.label__container[data-color-state="disabled"] ez-icon{--ez-icon--color:var(--ez-label-chip__label__container--text--disabled)}:host .label__container[data-color-state="disabled"] ::slotted(ez-icon){--ez-icon--color:var(--ez-label-chip__label__container--text--disabled)}';export{i as ez_chip}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,g as e}from"./p-23a36bb6.js";import{NumberUtils as h,StringUtils as r,ElementIDUtils as n}from"@sankhyalabs/core";import{C as a}from"./p-ec7db713.js";import{i as o}from"./p-641ee538.js";const l=class{constructor(s){t(this,s),this.ezChange=i(this,"ezChange",7),this.ezStartChange=i(this,"ezStartChange",7),this.ezCancelWaitingChange=i(this,"ezCancelWaitingChange",7),this._focused=!1,this._changePending=!1,this._valuePromiseCallbacks=[],this._value=void 0,this.label=void 0,this.value=void 0,this.enabled=!0,this.canShowError=!0,this.errorMessage=void 0,this.allowNegative=!0,this.precision=void 0,this.prettyPrecision=void 0,this.mode="regular",this.autoFocus=!1,this.alternativePlaceholder=void 0}async setFocus(t){this._textInput.setFocus(t)}async setBlur(){this._textInput.setBlur()}async isInvalid(){return"string"==typeof this.errorMessage&&""!==this.errorMessage.trim()}async getValueAsync(){return this._changePending?new Promise((t=>{this._valuePromiseCallbacks.push(t)})):Promise.resolve(this.value)}observeLabel(){this._textInput&&(this._textInput.label=this.label)}observeErrorMessage(){var t;this._textInput&&(this._textInput.errorMessage=this.errorMessage,(null===(t=this.errorMessage)||void 0===t?void 0:t.trim())||this.setInputValue())}observeValue(t,i){this._textInput&&t!=i&&this.handleNewValue(t,i),this._changePending=!1}observePrecision(){this._textInput&&this.setInputValue()}handleNewValue(t,i){const s=this.validateValue(t),e=this.validateValue(i);if(null===s&&(this._value=""),s===e)return;const h=this.getTextValue(s)||"",r=this.getParsedNumber(h);(this._value||"")===h||void 0===r&&this._focused||(this._value=h,this._focused=!1,this.errorMessage=""),this.ezChange.emit(null===s?void 0:s)}validateValue(t){return isNaN(t)||void 0===t?null:t}getTextValue(t){if(null==t)return;let i=this.precision>=0?h.format(t.toString(),Number(this.precision),Number(this.prettyPrecision)):t.toString();return 0===this.precision?r.replaceAll(i,".",""):i}changeValue(t){this.errorMessage="",this.value!=t?this.value=void 0===t?null:t:(this.setInputValue(),this.ezCancelWaitingChange.emit())}setError(t){this.value=null,this.errorMessage=t,this.ezCancelWaitingChange.emit()}handleBlur(){if(this._changePending)try{const t=this.getParsedNumber();if(void 0!==t&&isNaN(t))this.setError(this.i18n("ez-number-input.invalidNumber"));else try{this.changeValue(t)}catch(t){return void this.setError(t.message)}}finally{for(const t of this._valuePromiseCallbacks)t(this.value);this._valuePromiseCallbacks=[]}}handleInput(){this.getParsedNumber()!==this.value&&(this._focused=!0,this._changePending=!0,this.ezStartChange.emit({waitmessage:"",blocking:!1}))}getParsedNumber(t=this._textInput.value){return(null==t?void 0:t.trim())?h.stringToNumber(t):void 0}setInputValue(){const t=this.getTextValue(this.value)||"";(this._value||"")!==t&&(this._value=t,this._textInput.value=this._value)}async componentWillLoad(){this.i18n=await o()}componentDidLoad(){a.applyVarsTextInput(this._elem,this._textInput),this.setInputValue(),this.autoFocus&&requestAnimationFrame((()=>{this.setFocus({selectText:!0})}))}render(){n.addIDInfoIfNotExists(this._elem,"input");let t=this.precision>0?"0123456789,.":"0123456789";return this.allowNegative&&(t+="-"),s("ez-text-input",{class:"number__input","data-element-id":n.getInternalIDInfo("textInput"),ref:t=>this._textInput=t,"data-slave-mode":"true",label:this.label,onBlur:()=>this.handleBlur(),onInput:()=>this.handleInput(),restrict:t,enabled:this.enabled,errorMessage:this.errorMessage,mode:this.mode,canShowError:this.canShowError,value:this._value,alternativePlaceholder:this.alternativePlaceholder})}get _elem(){return e(this)}static get watchers(){return{label:["observeLabel"],errorMessage:["observeErrorMessage"],value:["observeValue"],precision:["observePrecision"],prettyPrecision:["observePrecision"]}}};l.style=":host{--ez-number-input__min-width:0px;--ez-number-input__max-width:100%;display:block;width:100%}.number__input{height:100%;min-width:var(--ez-number-input__min-width);max-width:var(--ez-number-input__max-width)}";export{l as ez_number_input}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as o,H as i,g as e}from"./p-23a36bb6.js";import{a,c as s,o as r,f as l,s as h,b as n}from"./p-2a806303.js";import{ElementIDUtils as p}from"@sankhyalabs/core";const d=class{constructor(o){t(this,o),this._opened=!1,this.message=void 0,this.anchoringElement=void 0,this.placement="bottom",this.gapOptions={horizontalGap:0,verticalGap:0},this.type="default",this.debouncingTime=500,this.active=!0,this.maxWidth=200,this.useAnchorSize=!1,this.strategy="absolute"}watchAnchoringElement(t,o){t&&(this.setEvents(t),this.removeEvents(o))}watchMessage(t){t?this.updatePosition():this.closeTooltip()}openTooltip(){this.message&&this.active&&(this._debouncingTimeout&&clearTimeout(this._debouncingTimeout),this._debouncingTimeout=setTimeout((()=>{this._opened=!0,this._tooltipElement.style.display="block",this.updatePosition()}),this.debouncingTime))}closeTooltip(){clearTimeout(this._debouncingTimeout),this._tooltipElement.style.display="none",this._opened=!1}async updatePosition(t=this.anchoringElement){if(t&&this._opened){if(this.useAnchorSize){const o=t.getBoundingClientRect().width;this._tooltipElement.style.width=`${o}px`}this._cleanup&&this._cleanup(),this._cleanup=a(t,this._tooltipElement,(()=>{s(t,this._tooltipElement,{placement:this.placement,strategy:this.strategy,middleware:[r(5),l(),h({padding:8}),n({element:this._arrowElement})]}).then((({x:t,y:o,placement:i,middlewareData:e})=>{const a=i.includes("bottom")?o+this.gapOptions.verticalGap:o-this.gapOptions.verticalGap,s=i.includes("start")?t+this.gapOptions.horizontalGap:t-this.gapOptions.horizontalGap;if(Object.assign(this._tooltipElement.style,{top:`${a}px`,left:`${s}px`}),e.arrow){const{x:t}=e.arrow,o=i.includes("bottom");Object.assign(this._arrowElement.style,{left:`${t}px`,top:o?-this._arrowElement.offsetHeight/2+"px":"",bottom:o?"":-this._arrowElement.offsetHeight/2+"px"})}}))}))}}handleSlotChange(t){const o=t.target.assignedElements()[0];this.anchoringElement=o}setEvents(t=this.anchoringElement){t&&(this.removeEvents(t),this._mouseEnterHandler=()=>this.openTooltip(),this._mouseLeaveHandler=()=>this.closeTooltip(),t.addEventListener("mouseenter",this._mouseEnterHandler),t.addEventListener("mouseleave",this._mouseLeaveHandler))}removeEvents(t=this.anchoringElement){t&&(this._mouseEnterHandler&&t.removeEventListener("mouseenter",this._mouseEnterHandler),this._mouseLeaveHandler&&t.removeEventListener("mouseleave",this._mouseLeaveHandler))}componentDidLoad(){this.setEvents(),this.addInfoId()}addInfoId(){this._element&&p.addIDInfo(this._element)}disconnectedCallback(){this.removeEvents(),this._cleanup&&this._cleanup(),clearTimeout(this._debouncingTimeout)}render(){return o(i,null,o("div",Object.assign({ref:t=>this._tooltipElement=t},{inert:!0},{class:"tooltip","data-type":this.type,"data-active":this.active.toString(),"data-strategy":this.strategy,style:{maxWidth:this.maxWidth&&!this.useAnchorSize?`${this.maxWidth}px`:void 0},role:"tooltip","data-element-id":p.getInternalIDInfo("tooltip")}),this.message,o("div",{ref:t=>this._arrowElement=t,class:"arrow"})),o("slot",{onSlotchange:t=>{this.handleSlotChange(t)}}))}get _element(){return e(this)}static get watchers(){return{anchoringElement:["watchAnchoringElement"],message:["watchMessage"]}}};d.style=':host{--ez-tooltip--triangle-size:var(--space--8);--ez-tooltip--z-index:var(--elevation--24);--ez-tooltip--padding:var(--space--4) var(--space--8);--ez-tooltip--border-radius:var(--border--radius-8);--ez-tooltip--font-family:var(--font--pattern);--ez-tooltip--font-size:var(--font-size--small);--ez-tooltip--font-weight:var(--font-weight--regular);width:100%}.tooltip{position:absolute;z-index:var(--ez-tooltip--z-index);padding:var(--ez-tooltip--padding);border-radius:var(--ez-tooltip--border-radius);box-sizing:border-box;font-family:var(--ez-tooltip--font-family);font-size:var(--ez-tooltip--font-size);font-weight:var(--ez-tooltip--font-weight);text-align:center;width:max-content;display:none}.tooltip[data-strategy="fixed"]{position:fixed}.arrow{position:absolute;width:var(--ez-tooltip--triangle-size);height:var(--ez-tooltip--triangle-size);transform:rotate(45deg)}.tooltip[data-type="default"]{background:var(--color--petroleum-600);color:var(--color--gray-70)}.tooltip[data-type="default"] .arrow{background:var(--color--petroleum-600)}.tooltip[data-type="error"]{background:var(--color--red-600);color:var(--color--red-100)}.tooltip[data-type="error"] .arrow{background:var(--color--red-600)}.tooltip[data-type="success"]{background:var(--color--green-600);color:var(--color--green-100)}.tooltip[data-type="success"] .arrow{background:var(--color--green-600)}.tooltip[data-type="warning"]{background:var(--color--yellow-600);color:var(--color--yellow-100)}.tooltip[data-type="warning"] .arrow{background:var(--color--yellow-600)}.tooltip[data-active="false"]{display:none !important}';export{d as ez_tooltip}
|