@sankhyalabs/sankhyablocks 1.4.0-beta.2 → 1.4.0-beta.3

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.
Files changed (140) hide show
  1. package/dist/cjs/{index-b0b676c5.js → index-6fcf07f3.js} +159 -1515
  2. package/dist/cjs/loader.cjs.js +2 -18
  3. package/dist/cjs/sankhyablocks.cjs.js +4 -116
  4. package/dist/cjs/snk-application.cjs.entry.js +50 -214
  5. package/dist/cjs/snk-crud.cjs.entry.js +3 -3
  6. package/dist/cjs/snk-data-unit.cjs.entry.js +23 -23
  7. package/dist/cjs/snk-filter-bar_5.cjs.entry.js +902 -0
  8. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  9. package/dist/cjs/snk-filter-detail.cjs.entry.js +3 -3
  10. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  11. package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
  12. package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
  13. package/dist/cjs/snk-filter-personalized.cjs.entry.js +23 -22
  14. package/dist/cjs/snk-filter-search.cjs.entry.js +3 -3
  15. package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
  16. package/dist/cjs/{snk-form.cjs.entry.js → snk-form_2.cjs.entry.js} +119 -5
  17. package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
  18. package/dist/cjs/{taskbar-elements-283c737e.js → taskbar-elements-aedfeae6.js} +1 -1
  19. package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
  20. package/dist/components/index.js +0 -4
  21. package/dist/components/snk-application2.js +10 -174
  22. package/dist/components/snk-crud.js +1 -1
  23. package/dist/components/snk-data-unit.js +2 -2
  24. package/dist/components/snk-filter-bar2.js +4 -2
  25. package/dist/components/snk-filter-detail2.js +1 -1
  26. package/dist/components/snk-filter-item2.js +1 -1
  27. package/dist/components/snk-filter-list2.js +1 -1
  28. package/dist/components/snk-filter-modal2.js +4 -19
  29. package/dist/components/snk-filter-personalized.js +2 -1
  30. package/dist/components/snk-filter-search.js +1 -1
  31. package/dist/components/snk-form2.js +1 -1
  32. package/dist/components/snk-grid2.js +1 -1
  33. package/dist/components/snk-pesquisa2.js +1 -1
  34. package/dist/components/snk-taskbar2.js +1 -1
  35. package/dist/components/teste-pesquisa.js +1 -1
  36. package/dist/{sankhyablocks/index-2b4d2d14.js → esm/index-81dda3cf.js} +160 -1508
  37. package/dist/esm/loader.js +2 -18
  38. package/dist/esm/sankhyablocks.js +4 -116
  39. package/dist/esm/snk-application.entry.js +11 -175
  40. package/dist/esm/snk-crud.entry.js +2 -2
  41. package/dist/esm/snk-data-unit.entry.js +3 -3
  42. package/dist/esm/{snk-filter-bar.entry.js → snk-filter-bar_5.entry.js} +436 -4
  43. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  44. package/dist/esm/snk-filter-detail.entry.js +2 -2
  45. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  46. package/dist/esm/snk-filter-number.entry.js +1 -1
  47. package/dist/esm/snk-filter-period.entry.js +1 -1
  48. package/dist/esm/snk-filter-personalized.entry.js +3 -2
  49. package/dist/esm/snk-filter-search.entry.js +2 -2
  50. package/dist/esm/snk-filter-text.entry.js +1 -1
  51. package/dist/{sankhyablocks/snk-form.entry.js → esm/snk-form_2.entry.js} +117 -4
  52. package/dist/esm/snk-pesquisa.entry.js +2 -2
  53. package/dist/esm/{taskbar-elements-35d64ff9.js → taskbar-elements-38eb5d51.js} +1 -1
  54. package/dist/esm/teste-pesquisa.entry.js +2 -2
  55. package/dist/sankhyablocks/index.esm.js +0 -1
  56. package/dist/sankhyablocks/p-0352c0e2.entry.js +1 -0
  57. package/dist/sankhyablocks/p-07ebda01.entry.js +1 -0
  58. package/dist/sankhyablocks/p-322c0df2.entry.js +1 -0
  59. package/dist/sankhyablocks/p-46caa101.entry.js +1 -0
  60. package/dist/sankhyablocks/p-473cedf9.entry.js +1 -0
  61. package/dist/sankhyablocks/p-586e2522.js +1 -0
  62. package/dist/sankhyablocks/p-86f15ffe.js +1 -0
  63. package/dist/sankhyablocks/p-8f3c5709.entry.js +1 -0
  64. package/dist/sankhyablocks/p-97009a2c.entry.js +1 -0
  65. package/dist/sankhyablocks/p-9be74b46.entry.js +74 -0
  66. package/dist/sankhyablocks/p-9dd2b8cb.js +1 -0
  67. package/dist/sankhyablocks/p-a8b59c61.entry.js +1 -0
  68. package/dist/sankhyablocks/p-aecf3e0a.entry.js +1 -0
  69. package/dist/sankhyablocks/p-c1c3b5d8.entry.js +1 -0
  70. package/dist/sankhyablocks/p-c78cb79a.entry.js +1 -0
  71. package/dist/sankhyablocks/p-c9eec639.entry.js +1 -0
  72. package/dist/sankhyablocks/p-dc482a42.entry.js +1 -0
  73. package/dist/sankhyablocks/p-fac2b6a9.js +2 -0
  74. package/dist/sankhyablocks/p-fb705f81.entry.js +1 -0
  75. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -129
  76. package/package.json +1 -1
  77. package/react/components.d.ts +19 -0
  78. package/react/components.js +19 -0
  79. package/react/components.js.map +1 -1
  80. package/dist/cjs/app-globals-3a1e7e63.js +0 -5
  81. package/dist/cjs/css-shim-b8158822.js +0 -6
  82. package/dist/cjs/dom-36862b77.js +0 -75
  83. package/dist/cjs/index-84fe3b86.js +0 -20
  84. package/dist/cjs/index-93965c41.js +0 -141
  85. package/dist/cjs/index-e90ae303.js +0 -2408
  86. package/dist/cjs/shadow-css-346c0795.js +0 -389
  87. package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -466
  88. package/dist/cjs/snk-filter-item.cjs.entry.js +0 -177
  89. package/dist/cjs/snk-filter-list.cjs.entry.js +0 -91
  90. package/dist/cjs/snk-filter-modal.cjs.entry.js +0 -37
  91. package/dist/cjs/snk-grid.cjs.entry.js +0 -79
  92. package/dist/cjs/snk-taskbar.cjs.entry.js +0 -160
  93. package/dist/cjs/taskbar-processor-6bd0d35c.js +0 -47
  94. package/dist/components/index2.js +0 -2394
  95. package/dist/components/index3.js +0 -139
  96. package/dist/esm/app-globals-0f993ce5.js +0 -3
  97. package/dist/esm/css-shim-b3f2ee8d.js +0 -4
  98. package/dist/esm/dom-665d6011.js +0 -73
  99. package/dist/esm/index-2b4d2d14.js +0 -3262
  100. package/dist/esm/index-5992b7e6.js +0 -139
  101. package/dist/esm/index-c683b2b0.js +0 -2394
  102. package/dist/esm/index-c71285cb.js +0 -17
  103. package/dist/esm/shadow-css-b18e99d7.js +0 -387
  104. package/dist/esm/snk-filter-item.entry.js +0 -173
  105. package/dist/esm/snk-filter-list.entry.js +0 -87
  106. package/dist/esm/snk-filter-modal.entry.js +0 -33
  107. package/dist/esm/snk-form.entry.js +0 -129
  108. package/dist/esm/snk-grid.entry.js +0 -75
  109. package/dist/esm/snk-taskbar.entry.js +0 -156
  110. package/dist/esm/taskbar-processor-aa6772c9.js +0 -45
  111. package/dist/sankhyablocks/SnkMessageBuilder-35a20271.js +0 -199
  112. package/dist/sankhyablocks/app-globals-0f993ce5.js +0 -3
  113. package/dist/sankhyablocks/css-shim-b3f2ee8d.js +0 -4
  114. package/dist/sankhyablocks/dom-665d6011.js +0 -73
  115. package/dist/sankhyablocks/filter-item-type.enum-a79b2fa8.js +0 -14
  116. package/dist/sankhyablocks/index-5992b7e6.js +0 -139
  117. package/dist/sankhyablocks/index-c683b2b0.js +0 -2394
  118. package/dist/sankhyablocks/index-c71285cb.js +0 -17
  119. package/dist/sankhyablocks/shadow-css-b18e99d7.js +0 -387
  120. package/dist/sankhyablocks/snk-application.entry.js +0 -8166
  121. package/dist/sankhyablocks/snk-crud.entry.js +0 -66
  122. package/dist/sankhyablocks/snk-data-unit.entry.js +0 -268
  123. package/dist/sankhyablocks/snk-filter-bar.entry.js +0 -462
  124. package/dist/sankhyablocks/snk-filter-binary-select.entry.js +0 -43
  125. package/dist/sankhyablocks/snk-filter-detail.entry.js +0 -80
  126. package/dist/sankhyablocks/snk-filter-item.entry.js +0 -173
  127. package/dist/sankhyablocks/snk-filter-list.entry.js +0 -87
  128. package/dist/sankhyablocks/snk-filter-modal.entry.js +0 -33
  129. package/dist/sankhyablocks/snk-filter-multi-select.entry.js +0 -19
  130. package/dist/sankhyablocks/snk-filter-number.entry.js +0 -20
  131. package/dist/sankhyablocks/snk-filter-period.entry.js +0 -33
  132. package/dist/sankhyablocks/snk-filter-personalized.entry.js +0 -85
  133. package/dist/sankhyablocks/snk-filter-search.entry.js +0 -40
  134. package/dist/sankhyablocks/snk-filter-text.entry.js +0 -18
  135. package/dist/sankhyablocks/snk-grid.entry.js +0 -75
  136. package/dist/sankhyablocks/snk-pesquisa.entry.js +0 -311
  137. package/dist/sankhyablocks/snk-taskbar.entry.js +0 -156
  138. package/dist/sankhyablocks/taskbar-elements-35d64ff9.js +0 -90
  139. package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +0 -45
  140. package/dist/sankhyablocks/teste-pesquisa.entry.js +0 -33
@@ -1 +0,0 @@
1
-
@@ -0,0 +1 @@
1
+ import{r as a,h as e}from"./p-fac2b6a9.js";import{DataUnit as r,DataType as o,UserInterface as i}from"@sankhyalabs/core";const s=class{constructor(e){a(this,e)}componentWillLoad(){this.dataUnit=new r("testes_com_formulario"),this.dataUnit.metadata={name:"dd://br.com.sankhya.fin.cad.movimentacaoFinanceira/Financeiro",label:"Parceiro",fields:[{name:"CODPARC",label:"Parceiro",dataType:o.NUMBER,userInterface:i.SEARCH,required:!0,properties:{ENTITYNAME:"Parceiro"}}]}}render(){return e("snk-application",null,e("ez-form",{dataUnit:this.dataUnit}))}};s.style=":host{display:block}";export{s as teste_pesquisa}
@@ -0,0 +1 @@
1
+ import{r as s,h as t,H as e}from"./p-fac2b6a9.js";import{F as i}from"./p-9dd2b8cb.js";const r=class{constructor(t){s(this,t)}isSelected(s){return null==this.value||this.value===s}ezChangeListener(s){s.detail||this.assertCheckedOption(s.target),this.updateValue()}assertCheckedOption(s){s===this._checkOne?this._checkTwo.value=!0:this._checkOne.value=!0}updateValue(){if(this._checkOne.value&&this._checkTwo.value)this.value=void 0;else{const[s,t]=this.config.props.options;this.value=this._checkOne.value?s.name:t.name}}render(){if(!this.config||this.config.type!==i.BINARY_SELECT)return;const[s,r]=this.config.props.options;return t(e,null,t("ez-check",{label:s.label,class:"sc-snk-filter-bar editor__ez-check",ref:s=>this._checkOne=s,value:this.isSelected(s.name)}),t("ez-check",{label:r.label,class:"sc-snk-filter-bar editor__ez-check",ref:s=>this._checkTwo=s,value:this.isSelected(r.name)}))}};export{r as snk_filter_binary_select}
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as s,g as a}from"./p-fac2b6a9.js";import{ApplicationContext as n}from"@sankhyalabs/core";const e=class{constructor(s){t(this,s),this.actionClick=i(this,"actionClick",7)}async gridToForm(t=!1){this._backToGrid=!t&&0===await this._viewStack.getSelectedIndex(),this._viewStack.show(1)}async executeAction(t){"GRID_MODE"===t?this._viewStack.show(0):"FORM_MODE"!==t&&"UPDATE"!==t||this.gridToForm("UPDATE"!==t)}insertionModeHandler(){this.gridToForm()}cancelHandler(){this._backToGrid&&this._viewStack.show(0)}componentWillLoad(){let t=this._element.parentElement;for(;t;){if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){this._snkDataUnit=t,this._snkDataUnit.addEventListener("insertionMode",(()=>this.insertionModeHandler())),this._snkDataUnit.addEventListener("cancelEdition",(()=>this.cancelHandler())),this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit||this._snkDataUnit.addEventListener("dataUnitReady",(t=>{this._dataUnit=t.detail})),this._snkDataUnit.addEventListener("dataStateChange",(t=>{this._dataState=t.detail}));break}t=t.parentElement}if(!this.configName){const t=n.getContextValue("__SNK__APPLICATION__");this.configName=t.configName}}render(){return s("ez-view-stack",{ref:t=>this._viewStack=t},s("stack-item",null,s("snk-grid",{configName:this.configName,onGridDoubleClick:()=>this.gridToForm(!0),taskbarManager:this.taskbarManager,onActionClick:t=>this.executeAction(t.detail),actionsList:this.actionsList,statusResolver:this.statusResolver},s("slot",{name:"SnkGridHeader"}),s("slot",{name:"SnkGridFooter"}),s("slot",{name:"SnkGridTaskBar"}))),s("stack-item",null,s("snk-form",{configName:this.configName,actionsList:this.actionsList,onExit:()=>this._viewStack.show(0),recordsValidator:this.recordsValidator,taskbarManager:this.taskbarManager,onActionClick:t=>this.executeAction(t.detail)},s("slot",{name:"SnkFormTaskBar"}))))}get _element(){return a(this)}};e.style=".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";export{e as snk_crud}
@@ -0,0 +1 @@
1
+ import{r as t,h as e}from"./p-fac2b6a9.js";const s=class{constructor(e){t(this,e)}ezChangeListener(t){this.value=t.detail}render(){if(this.config)return e("ez-text-input",{label:this.config.label,value:this.config.value})}};export{s as snk_filter_text}
@@ -0,0 +1 @@
1
+ import{r as s,h as t}from"./p-fac2b6a9.js";import{ApplicationContext as r}from"@sankhyalabs/core";import{F as i}from"./p-9dd2b8cb.js";const e=class{constructor(t){s(this,t)}ezChangeListener(s){this.value=this._searchInput.value}doSearch(s,t){const i=r.getContextValue("__SNK__APPLICATION__");return this.fix&&this.fix(),new Promise(((r,e)=>{i.executePreparedSearch(s,t,this.config.props.searchContext).then((s=>{r(s),this.unfix&&this.unfix()})).catch((s=>{e(s),this.unfix&&this.unfix()}))}))}render(){if(this.config&&this.config.type===i.SEARCH)return t("ez-search",{suppressEmptyOption:!0,value:this.config.value,label:this.config.label,ref:s=>this._searchInput=s,optionLoader:({mode:s,argument:t})=>this.doSearch(s,t)})}};export{e as snk_filter_search}
@@ -0,0 +1 @@
1
+ const e={saveInfo:{clone:"Duplicação realizada!",insert:"Inclusão realizada!",update:"Aleração realizada!"},cancelInfo:{clone:"Duplicação descartada!",insert:"A inclusão descartada!",update:"A edição foi descartada!"},removeInfo:"Registro removido com sucesso!",cancelConfirmationTitle:"Aviso",cancelConfirmation:"As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?",removeConfirmationTitle:"Excluir",removeConfirmation:"Deseja realmente excluir o registro atual?",forbidden:"Sem permissão",forbiddenUpdate:"Não é possível fazer alterações. Verifique as permissões de acesso.",forbiddenInsert:"Não é possível incluir. Verifique as permissões de acesso.",forbiddenClone:"Não é possível duplicar. Verifique as permissões de acesso.",forbiddenRemove:"Não é possível remover. Verifique as permissões de acesso."},i={addFilter:"Adicionar filtro",pinFilter:"Fixar filtro",unpinFilter:"Desfixar filtro",removeFilter:"Remover filtro",cleanFilter:"Limpar",applyFilter:"Aplicar",findFilter:"Buscar filtros...",findField:"Buscar filtros...",modalFindFilter:"Buscar filtro",emptyFiltersList:"Não há filtros disponíveis",emptyAppliedFiltersList:"Não há filtros aplicados",customFilter:"Filtro personalizado",defaultFilter:"Filtro padrão",failToLoadConfig:"Falha ao buscar configuração de filtros",clearAllFilters:"Limpar todos os filtros",successfullyCleaned:"Filtro limpo com sucesso!",activeFilter:"{{ACTIVE_FILTERS}} filtro aplicado",activeFilters:"{{ACTIVE_FILTERS}} filtros aplicados",noActiveFilters:"Nenhum filtro aplicado",modalDefaultFilterTitle:"Filtro padrão",modalInfoTextEditDefault:"Use o layout antigo para editar o seu filtro padrão, em breve traremos uma nova experiência.",modalInfoTextCreateDefault:"Use o layout antigo para criar o seu filtro padrão, em breve traremos uma nova experiência.",modalPersonalizedFilterTitle:"Filtro personalizado",modalPersonalizedFilterSubTitle:"Gerencie seus filtros",modalInfoTextCreateEditPersonalized:"Use o layout antigo para criar ou editar filtros, em breve traremos uma nova experiência",modalOkButtonLabel:"Aplicar",modalCancelButtonLabel:"Limpar"},r={title:{clone:"Duplicar registro",insert:"Cadastrar registro",update:"Alterar registro",clean:"{{ENTITY_NAME}}"},goBackTitle:"Voltar"},a={titleUpdate:"Editar",titlePrevious:"Anterior",titleNext:"Próximo",titleRefresh:"Atualizar",titleClone:"Duplicar",titleRemove:"Excluir",titleMoreOptions:"Mais Opções",titleInsert:"Cadastrar",titleCancel:"Cancelar",titleSave:"Salvar",titleGridMode:"Modo Grade",titleFormMode:"Modo Formulário",titleConfigGrid:"Configuração da grade",forbidden:"Permissão não liberada"};class o{constructor(){this._defaults={snkDataUnit:e,snkForm:r,snkTaskbar:a,snkFilterBar:i},this._currentOperation=t.CLEAN,this.loadAppMessages().then((e=>{this._appMessages=e}),(e=>{console.info("O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages.js",e)}))}set currentOperation(e){this._currentOperation=e}getMessage(e,i){if(null==e)return;var r=e.split(".");let a=this.resolveMessage(r,this._appMessages);if(null==a&&(a=this.resolveMessage(r,this._defaults)),this.customMessageBuilder){const r=this.customMessageBuilder(e,a,i);a=r.message,i=r.params}return this.postProcess(a,i)}resolveMessage(e,i){if(null==i)return;const r=i[e[0]];return r?this.isOperationSensitive(r)?r[this._currentOperation]:1===e.length||null==r||"string"==typeof r?r:this.resolveMessage(e.slice(1),r):void 0}isOperationSensitive(e){return null!=e[t.CLONE]||null!=e[t.INSERT]||null!=e[t.UPDATE]||null!=e[t.CLEAN]}postProcess(e,i){if(e){const r=/(.*?)\{\{(.+?)\}\}/g;let a,o="",t=e;for(;null!==(a=r.exec(e));){const[r,s,l]=a,n=a.index+r.length;t=n<e.length?e.substring(n):"";let d=i?i[l]:void 0;null==d&&(d=""),o+=s+d}return o+t}return e}loadAppMessages(){return new Promise(((e,i)=>{const r="dev"!==window.applicationenv?`/${window.MGE_MODULE_NAME}/labsApps/${window.APPLICATION_NAME}/build/messages/appmessages.js`:"/messages/appmessages.js";import(r).then((i=>{e(i.default)})).catch((e=>{i(e)}))}))}}var t;!function(e){e.CLONE="clone",e.INSERT="insert",e.UPDATE="update",e.CLEAN="clean"}(t||(t={}));export{t as O,o as S}
@@ -0,0 +1 @@
1
+ import{h as e}from"./p-fac2b6a9.js";var t,n,a;!function(e){e.PREVIOUS="PREVIOUS",e.NEXT="NEXT",e.REFRESH="REFRESH",e.UPDATE="UPDATE",e.CLONE="CLONE",e.REMOVE="REMOVE",e.INSERT="INSERT",e.CANCEL="CANCEL",e.SAVE="SAVE",e.GRID_MODE="GRID_MODE",e.FORM_MODE="FORM_MODE",e.CONFIG_GRID="CONFIG_GRID",e.MORE_OPTIONS="MORE_OPTIONS",e.DIVIDER="DIVIDER"}(t||(t={})),function(e){e.UPDATE="UPDATE",e.CLONE="CLONE",e.REMOVE="REMOVE",e.INSERT="INSERT",e.CONFIG_GRID="CONFIG_GRID"}(n||(n={})),function(e){e.CONFIG_GRID="CONFIG_GRID"}(a||(a={}));const s=(e,t,n,a)=>{const{hint:s,text:r,iconName:o}=e;return o?r?l(o,e.name,t,s,r,n,a):i(o,e.name,t,s,n,a):c(e.name,t,r,s,n,a)},r=(n,a,s,r,o,u)=>{const E=s(n);switch(n){case t.PREVIOUS:return i("chevron-left",n,a,E,r,o);case t.NEXT:return i("chevron-right",n,a,E,r,o);case t.REFRESH:return i("sync",n,a,E,r,o);case t.UPDATE:return i("edit",n,a,E,r,o);case t.CLONE:return i("copy",n,a,E,r,o);case t.REMOVE:return i("delete",n,a,E,r,o);case t.INSERT:return l("plus",n,a,E,E,r,o);case t.CANCEL:return c(n,a,E,E,r,o);case t.SAVE:return l("save",n,a,E,E,r,o);case t.GRID_MODE:return i("table",n,a,E,r,o);case t.FORM_MODE:return i("list",n,a,E,r,o);case t.CONFIG_GRID:return i("settings-inverted",n,a,E,r,o);case t.MORE_OPTIONS:return u&&u.length>0?e("ez-actions-button",{title:E,size:"small",class:a,enabled:o(n),onEzAction:e=>r(e.detail.value),actions:u}):void 0;case t.DIVIDER:return e("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium"})}};function c(t,n,a,s,r,c){return e("ez-button",{title:s,label:a,size:"small",class:n,enabled:c(t),onClick:()=>r(t)})}function i(t,n,a,s,r,c){return e("ez-button",{name:t,title:s,mode:"icon",size:"small",class:a,iconName:t,enabled:c(n),onClick:()=>r(n)})}function l(t,n,a,s,r,c,i){return e("ez-button",{name:t,title:r,label:s,size:"small",class:a,enabled:i(n),onClick:()=>c(n)},e("ez-icon",{class:"ez-padding-right--small",slot:"leftIcon",iconName:t}))}export{n as A,t as T,a as V,s as a,r as b}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as i,g as e,H as a}from"./p-fac2b6a9.js";import{Action as n,ApplicationContext as h}from"@sankhyalabs/core";import{ApplicationUtils as o,DialogType as r}from"@sankhyalabs/ezui/dist/collection/utils";import{O as c}from"./p-586e2522.js";const l=class{constructor(i){t(this,i),this.dataStateChange=s(this,"dataStateChange",7),this.dataUnitReady=s(this,"dataUnitReady",7),this.insertionMode=s(this,"insertionMode",7),this.cancelEdition=s(this,"cancelEdition",7),this._onDataUnitResolve=[],this.pageSize=150,this._dataUnitObserver=t=>{const s={insertionMode:!1,hasNext:this.dataUnit.hasNext(),hasPrevious:this.dataUnit.hasPrevious(),copyMode:!1,isDirty:this.dataUnit.isDirty(),hasDirtyRecords:this.dataUnit.hasDirtyRecords(),selectedRecords:this.dataUnit.getSelectedRecords()};if(this.dataUnit.records.forEach((t=>{t.__record__id__.startsWith("NEW_")&&(s.insertionMode=!0,s.copyMode||(s.copyMode=null!=t.__record__source__id__))})),this.dataState=s,t.type===n.DATA_SAVED){const s=this.getMessage("snkDataUnit.saveInfo",t.payload.records[0]);null!=s&&this.showSuccessMessage(s)}if(t.type!==n.RECORDS_ADDED&&t.type!==n.RECORDS_COPIED||this.insertionMode.emit(),t.type===n.EDITION_CANCELED){this.cancelEdition.emit();const t=this.getMessage("snkDataUnit.cancelInfo");null!=t&&this.showSuccessMessage(t)}if(t.type===n.RECORDS_REMOVED){const s=this.getMessage("snkDataUnit.removeInfo",t.payload.cachedRecords[0]);null!=s&&this.showSuccessMessage(s)}this._application.messagesBuilder.currentOperation=this.getMessageOperation()}}observePageSize(){this.dataUnit&&(this.dataUnit.pageSize=this.pageSize)}observeDataUnitName(t,s){s!=t&&(this.dataUnit=void 0,this.dataUnitName=t,this.loadDataUnit())}observeEntityName(t,s){s!=t&&(this.dataUnit=void 0,this.entityName=t,this.loadDataUnit())}observeDataState(t,s){s!=t&&this.dataStateChange.emit(t)}observeDataUnit(){this.dataUnitReady.emit(this.dataUnit)}async getDataUnit(){return new Promise((t=>{this.dataUnit?t(this.dataUnit):this._onDataUnitResolve.push(t)}))}async interceptAction(t){return new Promise((s=>{switch(t.type){case n.RECORDS_ADDED:this.isAllowed("INSERT")?s(t):o.info(this.getMessage("snkDataUnit.forbiddenInsert"));break;case n.RECORDS_COPIED:this.isAllowed("CLONE")?s(t):o.info(this.getMessage("snkDataUnit.forbiddenClone"));break;case n.DATA_CHANGED:case n.CHANGING_DATA:this.isAllowed("UPDATE")?s(t):(this.dataUnit.cancelEdition(),o.alert(this.getMessage("snkDataUnit.forbidden"),this.getMessage("snkDataUnit.forbiddenUpdate")));break;case n.SAVING_DATA:if(this.beforeSave){const i=this.beforeSave(this.dataUnit);i instanceof Promise?i.then((i=>s(i?t:void 0))):s(i?t:void 0)}else s(t);break;case n.DATA_SAVED:this.afterSave?this.afterSave(this.dataUnit):s(t);break;case n.EDITION_CANCELED:if(this.dataState.hasDirtyRecords){const i=this.getMessage("snkDataUnit.cancelConfirmation");if(null==i)s(t);else{const e=this.getMessage("snkDataUnit.cancelConfirmationTitle");o.confirm(e,i).then((i=>s(i?t:void 0)))}}else s(t);break;case n.REMOVING_RECORDS:if(this.isAllowed("REMOVE")){const i=this.getMessage("snkDataUnit.removeConfirmation");if(null==i)s(t);else{const e=this.getMessage("snkDataUnit.removeConfirmationTitle");o.confirm(e,i,"delete",r.CRITICAL,{btnConfirmDanger:!0}).then((i=>s(i?t:void 0)))}}else o.info(this.getMessage("snkDataUnit.forbiddenRemove"));break;default:s(t)}}))}showSuccessMessage(t){o.info(t,{iconName:"check"})}isAllowed(t){return!!this._permissions&&(this._permissions.isSup||this._permissions[t])}getMessage(t,s){return s||(s=this.getMessageParams()),this._application.messagesBuilder.getMessage(t,s)}getMessageParams(){return this.dataState.selectedRecords?this.dataState.selectedRecords[0]:void 0}getMessageOperation(){return this.dataState.copyMode?c.CLONE:this.dataState.insertionMode?c.INSERT:this.dataState.isDirty?c.UPDATE:c.CLEAN}async loadDataUnit(){if(!this.dataUnit&&this._application&&this.entityName){const t=this.dataUnitName?this.dataUnitName:this.entityName;let s;for(this.dataUnit=await this._application.getDataUnit(this.entityName,t),this.dataUnit.pageSize=this.pageSize,this.dataUnit.unsubscribe(this._dataUnitObserver),this.dataUnit.addInterceptor(this),this.dataUnit.subscribe(this._dataUnitObserver);s=this._onDataUnitResolve.pop();)s(this.dataUnit)}}componentWillLoad(){this._application=h.getContextValue("__SNK__APPLICATION__"),this._application.getAllAccess().then((t=>this._permissions=t))}componentDidLoad(){this.loadDataUnit()}render(){return i(a,null)}get element(){return e(this)}static get watchers(){return{pageSize:["observePageSize"],dataUnitName:["observeDataUnitName"],entityName:["observeEntityName"],dataState:["observeDataState"],dataUnit:["observeDataUnit"]}}};l.style=".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";export{l as snk_data_unit}
@@ -0,0 +1 @@
1
+ import{r as s,c as t,h as i,g as e}from"./p-fac2b6a9.js";import{ApplicationContext as a}from"@sankhyalabs/core";import{T as r}from"./p-86f15ffe.js";class n{constructor(s){this._defaultButtons=s}process(s,t,i,e=[]){var a;this.customButtons=new Map,this.buttons="",this.disabledButtons=[],null===(a=this.getButtonsArray(s,t,i))||void 0===a||a.forEach((a=>{let r;if("string"==typeof a)r=a;else{const s=a;this.customButtons.set(s.name,s),r=s.name}this.isEnabled(s,t,r,i,e)||this.disabledButtons.push(r),this.buttons.length>0&&(this.buttons+=","),this.buttons+=r}))}getButtonsArray(s,t,i){const e=this._defaultButtons[s];return t?t.getButtons(s,i,[...e]):e}isEnabled(s,t,i,e,a){const r=!a.includes(i);return t&&t.isEnabled?t.isEnabled(s,e,i,r):r}}const o=class{constructor(i){s(this,i),this.exit=t(this,"exit",7),this.actionClick=t(this,"actionClick",7),this._taskbarProcessor=new n({"snkForm.regular":["PREVIOUS","NEXT","DIVIDER","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","GRID_MODE","INSERT"],"snkForm.finish_edition":["CANCEL","SAVE"]})}getFormConfig(){return this._dataState&&this._dataState.insertionMode?this._insertionFormConfig:this._editionFormConfig}getInsertionHiddenFields(s){const t=[];return null==s||s.forEach((s=>{const i=this._dataUnit.getField(s.name);(null==i?void 0:i.readOnly)&&t.push(s.name)})),t}exitForm(){this._dataUnit.isDirty()?this._dataUnit.cancelEdition({after:()=>this.exit.emit()}):this.exit.emit()}getDisabledButtons(){const s=[];return this._dataState.hasPrevious||s.push("PREVIOUS"),this._dataState.hasNext||s.push("NEXT"),s}loadInsertionConfig(){this._dataUnit&&this._configLoaded&&(this._insertionFormConfig=this._editionFormConfig.filter((s=>{const t=this._dataUnit.getField(s.name);return!(null==t?void 0:t.readOnly)})))}getMessage(s){return this._application.messagesBuilder.getMessage(s,this.getMessageParams())}getMessageParams(){var s;return(null===(s=this._dataState)||void 0===s?void 0:s.selectedRecords)?this._dataState.selectedRecords[0]:void 0}componentWillLoad(){this._application=a.getContextValue("__SNK__APPLICATION__"),this._application&&(this._application.loadFormConfig(this.configName).then((s=>{this._configLoaded=!0,this._editionFormConfig=s,this.loadInsertionConfig()})),this._application.getAllAccess());let s=this._element.parentElement;for(;s;){if("SNK-DATA-UNIT"===s.tagName.toUpperCase()){this._snkDataUnit=s,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.loadInsertionConfig():this._snkDataUnit.addEventListener("dataUnitReady",(s=>{this._dataUnit=s.detail,this.loadInsertionConfig()})),this._snkDataUnit.addEventListener("dataStateChange",(s=>{this._dataState=s.detail}));break}s=s.parentElement}}componentWillRender(){var s;const t=(null===(s=this._dataState)||void 0===s?void 0:s.isDirty)?"snkForm.finish_edition":"snkForm.regular",i=[];this._dataState&&this._dataState.hasPrevious||i.push("PREVIOUS"),this._dataState&&this._dataState.hasNext||i.push("NEXT"),this._taskbarProcessor.process(t,this.taskbarManager,this._dataState,i)}render(){var s;if(this._configLoaded&&this._dataUnit&&this._dataState)return i("section",{class:"snk-form"},i("div",{class:"snk-form__header snk-form__header--fixed ez-row"},i("div",{class:"ez-col ez-col--sd-6 ez-col--tb-6",key:"formHeader"},i("ez-button",{title:this.getMessage("snkForm.goBackTitle"),mode:"icon",iconName:"arrow_back",class:"ez-padding-right--medium",size:"small",onClick:()=>this.exitForm()}),i("h1",{class:"ez-title ez-title--primary ez-title--xlarge ez-align--middle"},this.getMessage("snkForm.title"))),i("div",{class:"ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right"},i("snk-taskbar",{key:"formTaskbar",buttons:this._taskbarProcessor.buttons,disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,actionsList:this.actionsList,primaryButton:(null===(s=this._dataState)||void 0===s?void 0:s.isDirty)?"SAVE":"INSERT",dataUnit:this._dataUnit}))),i("section",null,i("div",{class:"ez-row"},i("div",{class:"ez-col ez-col--sd-12"},i("ez-form",{key:"ezForm"+this._snkDataUnit.entityName,dataUnit:this._dataUnit,config:this.getFormConfig(),recordsValidator:this.recordsValidator})))))}get _element(){return e(this)}};o.style=".sc-snk-form-h{display:block}.snk-form.sc-snk-form{position:relative;padding:var(--space--large);padding-top:var(--space--medium)}.snk-form__header.sc-snk-form{position:relative;padding-top:var(--space--medium);padding-bottom:var(--space--medium);margin-bottom:var(--space--medium)}.snk-form__header--fixed.sc-snk-form{position:sticky;top:0;background:var(--background--body);z-index:var(--more-visible, 2);padding-left:var(--space--large);padding-right:var(--space--large);margin-left:calc(var(--space--large) * -1);margin-right:calc(var(--space--large) * -1);width:calc(100% + (var(--space--large) * 2))}";const h=class{constructor(i){s(this,i),this.actionClick=t(this,"actionClick",7),this.gridDoubleClick=t(this,"gridDoubleClick",7),this._topTaskbarProcessor=new n({snkGridTopTaskbar:["FORM_MODE","CONFIG_GRID","INSERT"]}),this._headerTaskbarProcessor=new n({"snkGridHeaderTaskbar.unselected":["REFRESH"],"snkGridHeaderTaskbar.selected":["UPDATE","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","REFRESH"]})}actionClickHandler(s){s.detail===r.CONFIG_GRID&&this._grid&&this._grid.openGridConfig()}saveConfig(s){const t=a.getContextValue("__SNK__APPLICATION__");t&&t.saveGridConfig(s)}componentWillLoad(){const s=a.getContextValue("__SNK__APPLICATION__");s&&(s.loadGridConfig(this.configName).then((s=>{this._gridConfig=s,this._configLoaded=!0})),s.getAllAccess());let t=this._element.parentElement;for(;t;){if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){this._snkDataUnit=t,this._dataUnit=this._snkDataUnit.dataUnit,this._dataUnit||this._snkDataUnit.addEventListener("dataUnitReady",(s=>{this._dataUnit=s.detail})),this._snkDataUnit.addEventListener("dataStateChange",(s=>{this._dataState=s.detail}));break}t=t.parentElement}}componentWillRender(){this._headerTaskbarProcessor.process(this._dataState&&this._dataState.selectedRecords.length>0?"snkGridHeaderTaskbar.selected":"snkGridHeaderTaskbar.unselected",this.taskbarManager,this._dataState),this._topTaskbarProcessor.process("snkGridTopTaskbar",this.taskbarManager,this._dataState)}render(){if(this._configLoaded&&this._dataUnit)return i("div",{class:"snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large"},i("div",{class:"snk-grid__header ez-padding-bottom--medium ez-margin-bottom--medium"},i("snk-filter-bar",{dataUnit:this._dataUnit,class:"snk-grid__filter-bar ez-align--top",configName:this.configName}),i("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider"}),i("snk-taskbar",{class:"ez-padding-left--medium",onActionClick:s=>this.actionClickHandler(s),key:"topTaskbar",dataUnit:this._dataUnit,buttons:this._topTaskbarProcessor.buttons,disabledButtons:this._topTaskbarProcessor.disabledButtons,customButtons:this._topTaskbarProcessor.customButtons,primaryButton:"INSERT"})),i("ez-grid",{ref:s=>this._grid=s,dataUnit:this._dataUnit,key:"grid-"+this._snkDataUnit.entityName,config:this._gridConfig,onConfigChange:s=>{this.saveConfig(s.detail)},onEzDoubleClick:()=>this.gridDoubleClick.emit(),statusResolver:this.statusResolver},i("snk-taskbar",{dataUnit:this._dataUnit,buttons:this._headerTaskbarProcessor.buttons,disabledButtons:this._headerTaskbarProcessor.disabledButtons,customButtons:this._headerTaskbarProcessor.customButtons,slot:"leftButtons",actionsList:this.actionsList})),i("div",{class:"ez-col ez-col--sd-12"},i("slot",{name:"SnkGridFooter"})))}get _element(){return e(this)}};h.style=".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--small)}";export{o as snk_form,h as snk_grid}
@@ -0,0 +1,74 @@
1
+ import{r as e,c as t,h as n}from"./p-fac2b6a9.js";import{ErrorException as i,WarningException as r,StringUtils as s,DataUnit as o,DataType as a,ChangeOperation as u,DateUtils as c,ObjectUtils as h,WaitingChangeException as l,DependencyType as f,ApplicationContext as d,ErrorTracking as v}from"@sankhyalabs/core";import{ApplicationUtils as p}from"@sankhyalabs/ezui/dist/collection/utils";import{S as m}from"./p-586e2522.js";var y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function w(e,t,n){return e(n={path:t,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var b,g,O=w((function(e,t){var n="undefined"!=typeof self?self:y,i=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,i="Symbol"in e&&"iterator"in Symbol,r="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in e,o="ArrayBuffer"in e;if(o)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function l(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function v(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function p(e){var t=new FileReader,n=v(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&r&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var e,t,n,i=d(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,n=v(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),i=0;i<t.length;i++)n[i]=String.fromCharCode(t[i]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=c(e),t=h(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},f.prototype.delete=function(e){delete this.map[c(e)]},f.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},f.prototype.set=function(e,t){this.map[c(e)]=h(t)},f.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),l(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),l(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),l(e)},i&&(f.prototype[Symbol.iterator]=f.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var n,i,r=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(i=(n=t.method||this.method||"GET").toUpperCase(),w.indexOf(i)>-1?i:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function g(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(r))}})),t}function O(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},y.call(b.prototype),y.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},O.error=function(){var e=new O(null,{status:0,statusText:""});return e.type="error",e};var S=[301,302,303,307,308];O.redirect=function(e,t){if(-1===S.indexOf(t))throw new RangeError("Invalid status code");return new O(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function T(e,n){return new Promise((function(i,s){var o=new b(e,n);if(o.signal&&o.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var e,t,n={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),i=n.shift().trim();if(i){var r=n.join(":").trim();t.append(i,r)}})),t)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL"),i(new O("response"in a?a.response:a.responseText,n))},a.onerror=function(){s(new TypeError("Network request failed"))},a.ontimeout=function(){s(new TypeError("Network request failed"))},a.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&r&&(a.responseType="blob"),o.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",u)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}T.polyfill=!0,e.fetch||(e.fetch=T,e.Headers=f,e.Request=b,e.Response=O),t.Headers=f,t.Request=b,t.Response=O,t.fetch=T,Object.defineProperty(t,"__esModule",{value:!0})}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=i;(t=r.fetch).default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t})),S=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isObjectLike=function(e){return"object"==typeof e&&null!==e}})),T=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.invariant=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}})),D=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getLocation=function(e,t){let i=0,r=1;for(const s of e.body.matchAll(n)){if("number"==typeof s.index||(0,T.invariant)(!1),s.index>=t)break;i=s.index+s[0].length,r+=1}return{line:r,column:t+1-i}};const n=/\r\n|[\n\r]/g})),E=w((function(e,t){function n(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,s=t.line-1,o=t.line+(e.locationOffset.line-1),a=t.column+(1===t.line?n:0),u=`${e.name}:${o}:${a}\n`,c=r.split(/\r\n|[\n\r]/g),h=c[s];if(h.length>120){const e=Math.floor(a/80),t=a%80,n=[];for(let e=0;e<h.length;e+=80)n.push(h.slice(e,e+80));return u+i([[`${o} |`,n[0]],...n.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return u+i([[o-1+" |",c[s-1]],[`${o} |`,h],["|","^".padStart(a)],[`${o+1} |`,c[s+1]]])}function i(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}Object.defineProperty(t,"__esModule",{value:!0}),t.printLocation=function(e){return n(e.source,(0,D.getLocation)(e.source,e.start))},t.printSourceLocation=n})),I=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLError=void 0,t.formatError=function(e){return e.toJSON()},t.printError=function(e){return e.toString()};class n extends Error{constructor(e,...t){var r,s,o;const{nodes:a,source:u,positions:c,path:h,originalError:l,extensions:f}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=h?h:void 0,this.originalError=null!=l?l:void 0,this.nodes=i(Array.isArray(a)?a:a?[a]:void 0);const d=i(null===(r=this.nodes)||void 0===r?void 0:r.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=u?u:null==d||null===(s=d[0])||void 0===s?void 0:s.source,this.positions=null!=c?c:null==d?void 0:d.map((e=>e.start)),this.locations=c&&u?c.map((e=>(0,D.getLocation)(u,e))):null==d?void 0:d.map((e=>(0,D.getLocation)(e.source,e.start)));const v=(0,S.isObjectLike)(null==l?void 0:l.extensions)?null==l?void 0:l.extensions:void 0;this.extensions=null!==(o=null!=f?f:v)&&void 0!==o?o:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=l&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,n):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+(0,E.printLocation)(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+(0,E.printSourceLocation)(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function i(e){return void 0===e||0===e.length?void 0:e}t.GraphQLError=n})),j=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.syntaxError=function(e,t,n){return new I.GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}})),$=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Token=t.QueryDocumentKeys=t.OperationTypeNode=t.Location=void 0,t.isNode=function(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&s.has(t)};class n{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}t.Location=n;class i{constructor(e,t,n,i,r,s){this.kind=e,this.start=t,this.end=n,this.line=i,this.column=r,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}t.Token=i;const r={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};t.QueryDocumentKeys=r;const s=new Set(Object.keys(r));var o;t.OperationTypeNode=o,function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(o||(t.OperationTypeNode=o={}))})),_=w((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveLocation=void 0,t.DirectiveLocation=n,function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(n||(t.DirectiveLocation=n={}))})),N=w((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Kind=void 0,t.Kind=n,function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(n||(t.Kind=n={}))})),A=w((function(e,t){function n(e){return e>=48&&e<=57}function i(e){return e>=97&&e<=122||e>=65&&e<=90}Object.defineProperty(t,"__esModule",{value:!0}),t.isDigit=n,t.isLetter=i,t.isNameContinue=function(e){return i(e)||n(e)||95===e},t.isNameStart=function(e){return i(e)||95===e},t.isWhiteSpace=function(e){return 9===e||32===e}})),k=w((function(e,t){function n(e){let t=0;for(;t<e.length&&(0,A.isWhiteSpace)(e.charCodeAt(t));)++t;return t}Object.defineProperty(t,"__esModule",{value:!0}),t.dedentBlockStringLines=function(e){var t;let i=Number.MAX_SAFE_INTEGER,r=null,s=-1;for(let t=0;t<e.length;++t){var o;const a=e[t],u=n(a);u!==a.length&&(r=null!==(o=r)&&void 0!==o?o:t,s=t,0!==t&&u<i&&(i=u))}return e.map(((e,t)=>0===t?e:e.slice(i))).slice(null!==(t=r)&&void 0!==t?t:0,s+1)},t.isPrintableAsBlockString=function(e){if(""===e)return!0;let t=!0,n=!1,i=!0,r=!1;for(let s=0;s<e.length;++s)switch(e.codePointAt(s)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:case 13:return!1;case 10:if(t&&!r)return!1;r=!0,t=!0,n=!1;break;case 9:case 32:n||(n=t);break;default:i&&(i=n),t=!1}return!t&&(!i||!r)},t.printBlockString=function(e,t){const n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=1===i.length,s=i.length>1&&i.slice(1).every((e=>0===e.length||(0,A.isWhiteSpace)(e.charCodeAt(0)))),o=n.endsWith('\\"""'),a=e.endsWith('"')&&!o,u=e.endsWith("\\"),c=a||u,h=!(null!=t&&t.minimize)&&(!r||e.length>70||c||s||o);let l="";const f=r&&(0,A.isWhiteSpace)(e.charCodeAt(0));return(h&&!f||s)&&(l+="\n"),l+=n,(h||c)&&(l+="\n"),'"""'+l+'"""'}})),x=w((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenKind=void 0,t.TokenKind=n,function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(n||(t.TokenKind=n={}))})),P=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Lexer=void 0,t.isPunctuatorTokenKind=function(e){return e===x.TokenKind.BANG||e===x.TokenKind.DOLLAR||e===x.TokenKind.AMP||e===x.TokenKind.PAREN_L||e===x.TokenKind.PAREN_R||e===x.TokenKind.SPREAD||e===x.TokenKind.COLON||e===x.TokenKind.EQUALS||e===x.TokenKind.AT||e===x.TokenKind.BRACKET_L||e===x.TokenKind.BRACKET_R||e===x.TokenKind.BRACE_L||e===x.TokenKind.PIPE||e===x.TokenKind.BRACE_R};class n{constructor(e){const t=new $.Token(x.TokenKind.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==x.TokenKind.EOF)do{if(e.next)e=e.next;else{const t=c(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===x.TokenKind.COMMENT);return e}}function i(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function r(e,t){return s(e.charCodeAt(t))&&o(e.charCodeAt(t+1))}function s(e){return e>=55296&&e<=56319}function o(e){return e>=56320&&e<=57343}function a(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return x.TokenKind.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function u(e,t,n,i,r){return new $.Token(t,n,i,e.line,1+n-e.lineStart,r)}function c(e,t){const n=e.source.body,s=n.length;let o=t;for(;o<s;){const t=n.charCodeAt(o);switch(t){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:10===n.charCodeAt(o+1)?o+=2:++o,++e.line,e.lineStart=o;continue;case 35:return h(e,o);case 33:return u(e,x.TokenKind.BANG,o,o+1);case 36:return u(e,x.TokenKind.DOLLAR,o,o+1);case 38:return u(e,x.TokenKind.AMP,o,o+1);case 40:return u(e,x.TokenKind.PAREN_L,o,o+1);case 41:return u(e,x.TokenKind.PAREN_R,o,o+1);case 46:if(46===n.charCodeAt(o+1)&&46===n.charCodeAt(o+2))return u(e,x.TokenKind.SPREAD,o,o+3);break;case 58:return u(e,x.TokenKind.COLON,o,o+1);case 61:return u(e,x.TokenKind.EQUALS,o,o+1);case 64:return u(e,x.TokenKind.AT,o,o+1);case 91:return u(e,x.TokenKind.BRACKET_L,o,o+1);case 93:return u(e,x.TokenKind.BRACKET_R,o,o+1);case 123:return u(e,x.TokenKind.BRACE_L,o,o+1);case 124:return u(e,x.TokenKind.PIPE,o,o+1);case 125:return u(e,x.TokenKind.BRACE_R,o,o+1);case 34:return 34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)?b(e,o):d(e,o)}if((0,A.isDigit)(t)||45===t)return l(e,o,t);if((0,A.isNameStart)(t))return g(e,o);throw(0,j.syntaxError)(e.source,o,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":i(t)||r(n,o)?`Unexpected character: ${a(e,o)}.`:`Invalid character: ${a(e,o)}.`)}return u(e,x.TokenKind.EOF,s,s)}function h(e,t){const n=e.source.body,s=n.length;let o=t+1;for(;o<s;){const e=n.charCodeAt(o);if(10===e||13===e)break;if(i(e))++o;else{if(!r(n,o))break;o+=2}}return u(e,x.TokenKind.COMMENT,t,o,n.slice(t+1,o))}function l(e,t,n){const i=e.source.body;let r=t,s=n,o=!1;if(45===s&&(s=i.charCodeAt(++r)),48===s){if(s=i.charCodeAt(++r),(0,A.isDigit)(s))throw(0,j.syntaxError)(e.source,r,`Invalid number, unexpected digit after 0: ${a(e,r)}.`)}else r=f(e,r,s),s=i.charCodeAt(r);if(46===s&&(o=!0,s=i.charCodeAt(++r),r=f(e,r,s),s=i.charCodeAt(r)),69!==s&&101!==s||(o=!0,s=i.charCodeAt(++r),43!==s&&45!==s||(s=i.charCodeAt(++r)),r=f(e,r,s),s=i.charCodeAt(r)),46===s||(0,A.isNameStart)(s))throw(0,j.syntaxError)(e.source,r,`Invalid number, expected digit but got: ${a(e,r)}.`);return u(e,o?x.TokenKind.FLOAT:x.TokenKind.INT,t,r,i.slice(t,r))}function f(e,t,n){if(!(0,A.isDigit)(n))throw(0,j.syntaxError)(e.source,t,`Invalid number, expected digit but got: ${a(e,t)}.`);const i=e.source.body;let r=t+1;for(;(0,A.isDigit)(i.charCodeAt(r));)++r;return r}function d(e,t){const n=e.source.body,s=n.length;let o=t+1,c=o,h="";for(;o<s;){const s=n.charCodeAt(o);if(34===s)return h+=n.slice(c,o),u(e,x.TokenKind.STRING,t,o+1,h);if(92!==s){if(10===s||13===s)break;if(i(s))++o;else{if(!r(n,o))throw(0,j.syntaxError)(e.source,o,`Invalid character within String: ${a(e,o)}.`);o+=2}}else{h+=n.slice(c,o);const t=117===n.charCodeAt(o+1)?123===n.charCodeAt(o+2)?v(e,o):p(e,o):w(e,o);h+=t.value,o+=t.size,c=o}}throw(0,j.syntaxError)(e.source,o,"Unterminated string.")}function v(e,t){const n=e.source.body;let r=0,s=3;for(;s<12;){const e=n.charCodeAt(t+s++);if(125===e){if(s<5||!i(r))break;return{value:String.fromCodePoint(r),size:s}}if(r=r<<4|y(e),r<0)break}throw(0,j.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+s)}".`)}function p(e,t){const n=e.source.body,r=m(n,t+2);if(i(r))return{value:String.fromCodePoint(r),size:6};if(s(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=m(n,t+8);if(o(e))return{value:String.fromCodePoint(r,e),size:12}}throw(0,j.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function m(e,t){return y(e.charCodeAt(t))<<12|y(e.charCodeAt(t+1))<<8|y(e.charCodeAt(t+2))<<4|y(e.charCodeAt(t+3))}function y(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function w(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw(0,j.syntaxError)(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function b(e,t){const n=e.source.body,s=n.length;let o=e.lineStart,c=t+3,h=c,l="";const f=[];for(;c<s;){const s=n.charCodeAt(c);if(34===s&&34===n.charCodeAt(c+1)&&34===n.charCodeAt(c+2)){l+=n.slice(h,c),f.push(l);const i=u(e,x.TokenKind.BLOCK_STRING,t,c+3,(0,k.dedentBlockStringLines)(f).join("\n"));return e.line+=f.length-1,e.lineStart=o,i}if(92!==s||34!==n.charCodeAt(c+1)||34!==n.charCodeAt(c+2)||34!==n.charCodeAt(c+3))if(10!==s&&13!==s)if(i(s))++c;else{if(!r(n,c))throw(0,j.syntaxError)(e.source,c,`Invalid character within String: ${a(e,c)}.`);c+=2}else l+=n.slice(h,c),f.push(l),13===s&&10===n.charCodeAt(c+1)?c+=2:++c,l="",h=c,o=c;else l+=n.slice(h,c),h=c+1,c+=4}throw(0,j.syntaxError)(e.source,c,"Unterminated string.")}function g(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const e=n.charCodeAt(r);if(!(0,A.isNameContinue)(e))break;++r}return u(e,x.TokenKind.NAME,t,r,n.slice(t,r))}t.Lexer=n})),q=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.devAssert=function(e,t){if(!Boolean(e))throw new Error(t)}})),F=w((function(e,t){function n(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const i=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:n(t,i)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const i=Math.min(10,e.length),r=e.length-i,s=[];for(let r=0;r<i;++r)s.push(n(e[r],t));return 1===r?s.push("... 1 more item"):r>1&&s.push(`... ${r} more items`),"["+s.join(", ")+"]"}(e,i);return function(e,t){const i=Object.entries(e);return 0===i.length?"{}":t.length>2?"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]":"{ "+i.map((([e,i])=>e+": "+n(i,t))).join(", ")+" }"}(e,i)}(e,t);default:return String(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.inspect=function(e){return n(e,[])}})),C=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.instanceOf=void 0,t.instanceOf=function(e,t){return e instanceof t}})),U=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Source=void 0,t.isSource=function(e){return(0,C.instanceOf)(e,n)};class n{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||(0,q.devAssert)(!1,`Body must be a string. Received: ${(0,F.inspect)(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||(0,q.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,q.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}t.Source=n})),R=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=void 0,t.parse=function(e,t){return new n(e,t).parseDocument()},t.parseConstValue=function(e,t){const i=new n(e,t);i.expectToken(x.TokenKind.SOF);const r=i.parseConstValueLiteral();return i.expectToken(x.TokenKind.EOF),r},t.parseType=function(e,t){const i=new n(e,t);i.expectToken(x.TokenKind.SOF);const r=i.parseTypeReference();return i.expectToken(x.TokenKind.EOF),r},t.parseValue=function(e,t){const i=new n(e,t);i.expectToken(x.TokenKind.SOF);const r=i.parseValueLiteral(!1);return i.expectToken(x.TokenKind.EOF),r};class n{constructor(e,t={}){const n=(0,U.isSource)(e)?e:new U.Source(e);this._lexer=new P.Lexer(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(x.TokenKind.NAME);return this.node(e,{kind:N.Kind.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:N.Kind.DOCUMENT,definitions:this.many(x.TokenKind.SOF,this.parseDefinition,x.TokenKind.EOF)})}parseDefinition(){if(this.peek(x.TokenKind.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===x.TokenKind.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw(0,j.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(x.TokenKind.BRACE_L))return this.node(e,{kind:N.Kind.OPERATION_DEFINITION,operation:$.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(x.TokenKind.NAME)&&(n=this.parseName()),this.node(e,{kind:N.Kind.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(x.TokenKind.NAME);switch(e.value){case"query":return $.OperationTypeNode.QUERY;case"mutation":return $.OperationTypeNode.MUTATION;case"subscription":return $.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(x.TokenKind.PAREN_L,this.parseVariableDefinition,x.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:N.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(x.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(x.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(x.TokenKind.DOLLAR),this.node(e,{kind:N.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:N.Kind.SELECTION_SET,selections:this.many(x.TokenKind.BRACE_L,this.parseSelection,x.TokenKind.BRACE_R)})}parseSelection(){return this.peek(x.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,i;return this.expectOptionalToken(x.TokenKind.COLON)?(n=t,i=this.parseName()):i=t,this.node(e,{kind:N.Kind.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(x.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){return this.optionalMany(x.TokenKind.PAREN_L,e?this.parseConstArgument:this.parseArgument,x.TokenKind.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(x.TokenKind.COLON),this.node(t,{kind:N.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(x.TokenKind.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(x.TokenKind.NAME)?this.node(e,{kind:N.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:N.Kind.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this.node(e,!0===this._options.allowLegacyFragmentVariables?{kind:N.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}:{kind:N.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case x.TokenKind.BRACKET_L:return this.parseList(e);case x.TokenKind.BRACE_L:return this.parseObject(e);case x.TokenKind.INT:return this.advanceLexer(),this.node(t,{kind:N.Kind.INT,value:t.value});case x.TokenKind.FLOAT:return this.advanceLexer(),this.node(t,{kind:N.Kind.FLOAT,value:t.value});case x.TokenKind.STRING:case x.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case x.TokenKind.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:N.Kind.BOOLEAN,value:!0});case"false":return this.node(t,{kind:N.Kind.BOOLEAN,value:!1});case"null":return this.node(t,{kind:N.Kind.NULL});default:return this.node(t,{kind:N.Kind.ENUM,value:t.value})}case x.TokenKind.DOLLAR:if(e){if(this.expectToken(x.TokenKind.DOLLAR),this._lexer.token.kind===x.TokenKind.NAME)throw(0,j.syntaxError)(this._lexer.source,t.start,`Unexpected variable "$${this._lexer.token.value}" in constant value.`);throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:N.Kind.STRING,value:e.value,block:e.kind===x.TokenKind.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:N.Kind.LIST,values:this.any(x.TokenKind.BRACKET_L,(()=>this.parseValueLiteral(e)),x.TokenKind.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:N.Kind.OBJECT,fields:this.any(x.TokenKind.BRACE_L,(()=>this.parseObjectField(e)),x.TokenKind.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(x.TokenKind.COLON),this.node(t,{kind:N.Kind.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(x.TokenKind.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(x.TokenKind.AT),this.node(t,{kind:N.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(x.TokenKind.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(x.TokenKind.BRACKET_R),t=this.node(e,{kind:N.Kind.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(x.TokenKind.BANG)?this.node(e,{kind:N.Kind.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:N.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(x.TokenKind.STRING)||this.peek(x.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(x.TokenKind.BRACE_L,this.parseOperationTypeDefinition,x.TokenKind.BRACE_R);return this.node(e,{kind:N.Kind.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(x.TokenKind.COLON);const n=this.parseNamedType();return this.node(e,{kind:N.Kind.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:N.Kind.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:N.Kind.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(x.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(x.TokenKind.BRACE_L,this.parseFieldDefinition,x.TokenKind.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(x.TokenKind.COLON);const r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:N.Kind.FIELD_DEFINITION,description:t,name:n,arguments:i,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(x.TokenKind.PAREN_L,this.parseInputValueDef,x.TokenKind.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(x.TokenKind.COLON);const i=this.parseTypeReference();let r;this.expectOptionalToken(x.TokenKind.EQUALS)&&(r=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(e,{kind:N.Kind.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:r,directives:s})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:N.Kind.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:N.Kind.UNION_TYPE_DEFINITION,description:t,name:n,directives:i,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(x.TokenKind.EQUALS)?this.delimitedMany(x.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:N.Kind.ENUM_TYPE_DEFINITION,description:t,name:n,directives:i,values:r})}parseEnumValuesDefinition(){return this.optionalMany(x.TokenKind.BRACE_L,this.parseEnumValueDefinition,x.TokenKind.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:N.Kind.ENUM_VALUE_DEFINITION,description:t,name:n,directives:i})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw(0,j.syntaxError)(this._lexer.source,this._lexer.token.start,`${i(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:N.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:i,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(x.TokenKind.BRACE_L,this.parseInputValueDef,x.TokenKind.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===x.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(x.TokenKind.BRACE_L,this.parseOperationTypeDefinition,x.TokenKind.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:N.Kind.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:N.Kind.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:N.Kind.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:N.Kind.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:N.Kind.UNION_TYPE_EXTENSION,name:t,directives:n,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:N.Kind.ENUM_TYPE_EXTENSION,name:t,directives:n,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:N.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(x.TokenKind.AT);const n=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const s=this.parseDirectiveLocations();return this.node(e,{kind:N.Kind.DIRECTIVE_DEFINITION,description:t,name:n,arguments:i,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(x.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(_.DirectiveLocation,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new $.Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw(0,j.syntaxError)(this._lexer.source,t.start,`Expected ${r(e)}, found ${i(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==x.TokenKind.NAME||t.value!==e)throw(0,j.syntaxError)(this._lexer.source,t.start,`Expected "${e}", found ${i(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===x.TokenKind.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return(0,j.syntaxError)(this._lexer.source,t.start,`Unexpected ${i(t)}.`)}any(e,t,n){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(n);)i.push(t.call(this));return i}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const i=[];do{i.push(t.call(this))}while(!this.expectOptionalToken(n));return i}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==x.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw(0,j.syntaxError)(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function i(e){const t=e.value;return r(e.kind)+(null!=t?` "${t}"`:"")}function r(e){return(0,P.isPunctuatorTokenKind)(e)?`"${e}"`:e}t.Parser=n})),M=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.printString=function(e){return`"${e.replace(n,i)}"`};const n=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function i(e){return r[e.charCodeAt(0)]}const r=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]})),L=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BREAK=void 0,t.getEnterLeaveForKind=i,t.getVisitFn=function(e,t,n){const{enter:r,leave:s}=i(e,t);return n?s:r},t.visit=function(e,t,r=$.QueryDocumentKeys){const s=new Map;for(const e of Object.values(N.Kind))s.set(e,i(t,e));let o,a,u,c=Array.isArray(e),h=[e],l=-1,f=[],d=e;const v=[],p=[];do{l++;const e=l===h.length,i=e&&0!==f.length;if(e){if(a=0===p.length?void 0:v[v.length-1],d=u,u=p.pop(),i)if(c){d=d.slice();let e=0;for(const[t,n]of f){const i=t-e;null===n?(d.splice(i,1),e++):d[i]=n}}else{d=Object.defineProperties({},Object.getOwnPropertyDescriptors(d));for(const[e,t]of f)d[e]=t}l=o.index,h=o.keys,f=o.edits,c=o.inArray,o=o.prev}else if(u){if(a=c?l:h[l],d=u[a],null==d)continue;v.push(a)}let b;if(!Array.isArray(d)){var m,y;(0,$.isNode)(d)||(0,q.devAssert)(!1,`Invalid AST Node: ${(0,F.inspect)(d)}.`);const i=e?null===(m=s.get(d.kind))||void 0===m?void 0:m.leave:null===(y=s.get(d.kind))||void 0===y?void 0:y.enter;if(b=null==i?void 0:i.call(t,d,a,u,v,p),b===n)break;if(!1===b){if(!e){v.pop();continue}}else if(void 0!==b&&(f.push([a,b]),!e)){if(!(0,$.isNode)(b)){v.pop();continue}d=b}}var w;void 0===b&&i&&f.push([a,d]),e?v.pop():(o={inArray:c,index:l,keys:h,edits:f,prev:o},c=Array.isArray(d),h=c?d:null!==(w=r[d.kind])&&void 0!==w?w:[],l=-1,f=[],u&&p.push(u),u=d)}while(void 0!==o);return 0!==f.length?f[f.length-1][1]:e},t.visitInParallel=function(e){const t=new Array(e.length).fill(null),r=Object.create(null);for(const s of Object.values(N.Kind)){let o=!1;const a=new Array(e.length).fill(void 0),u=new Array(e.length).fill(void 0);for(let t=0;t<e.length;++t){const{enter:n,leave:r}=i(e[t],s);o||(o=null!=n||null!=r),a[t]=n,u[t]=r}o&&(r[s]={enter(...i){const r=i[0];for(let o=0;o<e.length;o++)if(null===t[o]){var s;const u=null===(s=a[o])||void 0===s?void 0:s.apply(e[o],i);if(!1===u)t[o]=r;else if(u===n)t[o]=n;else if(void 0!==u)return u}},leave(...i){const r=i[0];for(let o=0;o<e.length;o++)if(null===t[o]){var s;const r=null===(s=u[o])||void 0===s?void 0:s.apply(e[o],i);if(r===n)t[o]=n;else if(void 0!==r&&!1!==r)return r}else t[o]===r&&(t[o]=null)}})}return r};const n=Object.freeze({});function i(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}t.BREAK=n})),V=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.print=function(e){return(0,L.visit)(e,n)};const n={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>i(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=s("(",i(e.variableDefinitions,", "),")"),n=i([e.operation,i([e.name,t]),i(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+s(" = ",n)+s(" ",i(r," "))},SelectionSet:{leave:({selections:e})=>r(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:a}){const u=s("",e,": ")+t;let c=u+s("(",i(n,", "),")");return c.length>80&&(c=u+s("(\n",o(i(n,"\n")),"\n)")),i([c,i(r," "),a]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+s(" ",i(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>i(["...",s("on ",e),i(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:o})=>`fragment ${e}${s("(",i(n,", "),")")} on ${t} ${s("",i(r," ")," ")}`+o},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,k.printBlockString)(e):(0,M.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+i(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+i(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+s("(",i(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>s("",e,"\n")+i(["schema",i(t," "),r(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>s("",e,"\n")+i(["scalar",t,i(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:o,fields:a})=>s("",e,"\n")+i(["type",t,s("implements ",i(n," & ")),i(o," "),r(a)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:u})=>s("",e,"\n")+t+(a(n)?s("(\n",o(i(n,"\n")),"\n)"):s("(",i(n,", "),")"))+": "+r+s(" ",i(u," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:o})=>s("",e,"\n")+i([t+": "+n,s("= ",r),i(o," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:o,fields:a})=>s("",e,"\n")+i(["interface",t,s("implements ",i(n," & ")),i(o," "),r(a)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>s("",e,"\n")+i(["union",t,i(n," "),s("= ",i(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:o})=>s("",e,"\n")+i(["enum",t,i(n," "),r(o)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>s("",e,"\n")+i([t,i(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:o})=>s("",e,"\n")+i(["input",t,i(n," "),r(o)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:u})=>s("",e,"\n")+"directive @"+t+(a(n)?s("(\n",o(i(n,"\n")),"\n)"):s("(",i(n,", "),")"))+(r?" repeatable":"")+" on "+i(u," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>i(["extend schema",i(e," "),r(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>i(["extend scalar",e,i(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:o})=>i(["extend type",e,s("implements ",i(t," & ")),i(n," "),r(o)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:o})=>i(["extend interface",e,s("implements ",i(t," & ")),i(n," "),r(o)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>i(["extend union",e,i(t," "),s("= ",i(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>i(["extend enum",e,i(t," "),r(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>i(["extend input",e,i(t," "),r(n)]," ")}};function i(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function r(e){return s("{\n",o(i(e,"\n")),"\n}")}function s(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function o(e){return s(" ",e.replace(/\n/g,"\n "))}function a(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}})),B=function(e){var t=e.name,n=e.type;this.uri=e.uri,this.name=t,this.type=n},G=function(e){return"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||e instanceof B},J=function e(t,n,i){var r;void 0===n&&(n=""),void 0===i&&(i=G);var s=new Map;function o(e,t){var n=s.get(t);n?n.push.apply(n,e):s.set(t,e)}if(i(t))r=null,o([n],t);else{var a=n?n+".":"";if("undefined"!=typeof FileList&&t instanceof FileList)r=Array.prototype.map.call(t,(function(e,t){return o([""+a+t],e),null}));else if(Array.isArray(t))r=t.map((function(t,n){var r=e(t,""+a+n,i);return r.files.forEach(o),r.clone}));else if(t&&t.constructor===Object)for(var u in r={},t){var c=e(t[u],""+a+u,i);c.files.forEach(o),r[u]=c.clone}else r=t}return{clone:r,files:s}},z=G,H="object"==typeof self?self.FormData:window.FormData,Q=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.defaultJsonSerializer=void 0,t.defaultJsonSerializer={parse:JSON.parse,stringify:JSON.stringify}})),W=w((function(e,t){var n=y&&y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(H),r=function(e){return z(e)||null!==e&&"object"==typeof e&&"function"==typeof e.pipe};t.default=function(e,t,n,s){void 0===s&&(s=Q.defaultJsonSerializer);var o=J({query:e,variables:t,operationName:n},"",r),a=o.clone,u=o.files;if(0===u.size){if(!Array.isArray(e))return s.stringify(a);if(void 0!==t&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");var c=e.reduce((function(e,n,i){return e.push({query:n,variables:t?t[i]:void 0}),e}),[]);return s.stringify(c)}var h=new("undefined"==typeof FormData?i.default:FormData);h.append("operations",s.stringify(a));var l={},f=0;return u.forEach((function(e){l[++f]=e})),h.append("map",s.stringify(l)),f=0,u.forEach((function(e,t){h.append(""+ ++f,t)})),h}})),K=w((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseBatchRequestsExtendedArgs=t.parseRawRequestExtendedArgs=t.parseRequestExtendedArgs=t.parseBatchRequestArgs=t.parseRawRequestArgs=t.parseRequestArgs=void 0,t.parseRequestArgs=function(e,t,n){return e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0}},t.parseRawRequestArgs=function(e,t,n){return e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0}},t.parseBatchRequestArgs=function(e,t){return e.documents?e:{documents:e,requestHeaders:t,signal:void 0}},t.parseRequestExtendedArgs=function(e,t,n,i){return e.document?e:{url:e,document:t,variables:n,requestHeaders:i,signal:void 0}},t.parseRawRequestExtendedArgs=function(e,t,n,i){return e.query?e:{url:e,query:t,variables:n,requestHeaders:i,signal:void 0}},t.parseBatchRequestsExtendedArgs=function(e,t,n){return e.documents?e:{url:e,documents:t,requestHeaders:n,signal:void 0}}})),X=w((function(e,t){var n,i=y&&y.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.ClientError=void 0;var r=function(e){function t(n,i){var r=this,s=t.extractMessage(n)+": "+JSON.stringify({response:n,request:i});return r=e.call(this,s)||this,Object.setPrototypeOf(r,t.prototype),r.response=n,r.request=i,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,t),r}return i(t,e),t.extractMessage=function(e){try{return e.errors[0].message}catch(t){return"GraphQL Error (Code: "+e.status+")"}},t}(Error);t.ClientError=r})),Y=w((function(e,t){var n=y&&y.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},i=y&&y.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}u((i=i.apply(e,t||[])).next())}))},r=y&&y.__generator||function(e,t){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLWebSocketClient=void 0;var s="ping",o="pong",a="complete",u=function(){function e(e,t,n){this._type=e,this._payload=t,this._id=n}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return this._payload},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){var e={type:this.type};return null!=this.id&&null!=this.id&&(e.id=this.id),null!=this.payload&&null!=this.payload&&(e.payload=this.payload),JSON.stringify(e)},enumerable:!1,configurable:!0}),e.parse=function(t,n){var i=JSON.parse(t),r=i.id;return new e(i.type,n(i.payload),r)},e}(),c=function(){function e(e,t){var c=this,f=t.onInit,d=t.onAcknowledged,v=t.onPing,p=t.onPong;this.socketState={acknowledged:!1,lastRequestId:0,subscriptions:{}},this.socket=e,e.onopen=function(){return i(c,void 0,void 0,(function(){var t,n,i,s;return r(this,(function(r){switch(r.label){case 0:return this.socketState.acknowledged=!1,this.socketState.subscriptions={},n=(t=e).send,i=h,f?[4,f()]:[3,2];case 1:return s=r.sent(),[3,3];case 2:s=null,r.label=3;case 3:return n.apply(t,[i.apply(void 0,[s]).text]),[2]}}))}))},e.onclose=function(){c.socketState.acknowledged=!1,c.socketState.subscriptions={}},e.onerror=function(e){console.error(e)},e.onmessage=function(t){try{var i=(void 0===y&&(y=function(e){return e}),u.parse(t.data,y));switch(i.type){case"connection_ack":return void(c.socketState.acknowledged?console.warn("Duplicate CONNECTION_ACK message ignored"):(c.socketState.acknowledged=!0,d&&d(i.payload)));case s:return void(v?v(i.payload).then((function(t){return e.send(l(t).text)})):e.send(l(null).text));case o:return void(p&&p(i.payload))}if(!c.socketState.acknowledged)return;if(null==i.id||!c.socketState.subscriptions[i.id])return;var r=c.socketState.subscriptions[i.id],h=r.query,f=r.variables,m=r.subscriber;switch(i.type){case"next":return!i.payload.errors&&i.payload.data&&m.next&&m.next(i.payload.data),void(i.payload.errors&&m.error&&m.error(new X.ClientError(n(n({},i.payload),{status:200}),{query:h,variables:f})));case"error":return void(m.error&&m.error(new X.ClientError({errors:i.payload,status:200},{query:h,variables:f})));case a:return m.complete&&m.complete(),void delete c.socketState.subscriptions[i.id]}}catch(t){console.error(t),e.close(1006)}var y;e.close(4400,"Unknown graphql-ws message.")}}return e.prototype.makeSubscribe=function(e,t,n,i){var r,s,o=this,c=(this.socketState.lastRequestId++).toString();return this.socketState.subscriptions[c]={query:e,variables:n,subscriber:i},this.socket.send((r=c,s={query:e,operationName:t,variables:n},new u("subscribe",s,r)).text),function(){o.socket.send(function(e){return new u(a,void 0,e)}(c).text),delete o.socketState.subscriptions[c]}},e.prototype.rawRequest=function(e,t){var n=this;return new Promise((function(i,r){var s;n.rawSubscribe(e,{next:function(e,t){return s={data:e,extensions:t}},error:r,complete:function(){return i(s)}},t)}))},e.prototype.request=function(e,t){var n=this;return new Promise((function(i,r){var s;n.subscribe(e,{next:function(e){return s=e},error:r,complete:function(){return i(s)}},t)}))},e.prototype.subscribe=function(e,t,n){var i=Z.resolveRequestDocument(e);return this.makeSubscribe(i.query,i.operationName,n,t)},e.prototype.rawSubscribe=function(e,t,n){return this.makeSubscribe(e,void 0,n,t)},e.prototype.ping=function(e){this.socket.send(function(e){return new u(s,e,void 0)}(e).text)},e.prototype.close=function(){this.socket.close(1e3)},e.PROTOCOL="graphql-transport-ws",e}();function h(e){return new u("connection_init",e)}function l(e){return new u(o,e,void 0)}t.GraphQLWebSocketClient=c})),Z=w((function(e,t){var n=y&&y.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},i=y&&y.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=y&&y.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=y&&y.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t},o=y&&y.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}u((i=i.apply(e,t||[])).next())}))},a=y&&y.__generator||function(e,t){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},u=y&&y.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n},c=y&&y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLWebSocketClient=t.gql=t.resolveRequestDocument=t.batchRequests=t.request=t.rawRequest=t.GraphQLClient=t.ClientError=void 0;var h=s(O),l=h,f=c(W);Object.defineProperty(t,"ClientError",{enumerable:!0,get:function(){return X.ClientError}});var d=function(e){var t={};return e&&("undefined"!=typeof Headers&&e instanceof Headers||e instanceof l.Headers?t=function(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}(e):Array.isArray(e)?e.forEach((function(e){t[e[0]]=e[1]})):t=e),t},v=function(e){return e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim()},p=function(e){var t=e.url,i=e.query,r=e.variables,s=e.operationName,u=e.headers,c=e.fetch,h=e.fetchOptions;return o(void 0,void 0,void 0,(function(){var e;return a(this,(function(o){switch(o.label){case 0:return e=f.default(i,r,s,h.jsonSerializer),[4,c(t,n({method:"POST",headers:n(n({},"string"==typeof e?{"Content-Type":"application/json"}:{}),u),body:e},h))];case 1:return[2,o.sent()]}}))}))},m=function(e){var t=e.url,i=e.query,r=e.variables,s=e.operationName,u=e.headers,c=e.fetch,h=e.fetchOptions;return o(void 0,void 0,void 0,(function(){var e;return a(this,(function(o){switch(o.label){case 0:return e=function(e){var t=e.query,n=e.variables,i=e.operationName,r=e.jsonSerializer;if(!Array.isArray(t)){var s=["query="+encodeURIComponent(v(t))];return n&&s.push("variables="+encodeURIComponent(r.stringify(n))),i&&s.push("operationName="+encodeURIComponent(i)),s.join("&")}if(void 0!==n&&!Array.isArray(n))throw new Error("Cannot create query with given variable type, array expected");var o=t.reduce((function(e,t,i){return e.push({query:v(t),variables:n?r.stringify(n[i]):void 0}),e}),[]);return"query="+encodeURIComponent(r.stringify(o))}({query:i,variables:r,operationName:s,jsonSerializer:h.jsonSerializer}),[4,c(t+"?"+e,n({method:"GET",headers:u},h))];case 1:return[2,o.sent()]}}))}))},w=function(){function e(e,t){this.url=e,this.options=t||{}}return e.prototype.rawRequest=function(e,t,i){return o(this,void 0,void 0,(function(){var r,s,o,c,l,f,v,p,m,y;return a(this,(function(){return r=K.parseRawRequestArgs(e,t,i),o=(s=this.options).headers,l=void 0===(c=s.fetch)?h.default:c,v=void 0===(f=s.method)?"POST":f,p=u(s,["headers","fetch","method"]),m=this.url,void 0!==r.signal&&(p.signal=r.signal),y=D(r.query).operationName,[2,b({url:m,query:r.query,variables:r.variables,headers:n(n({},d(E(o))),d(r.requestHeaders)),operationName:y,fetch:l,method:v,fetchOptions:p})]}))}))},e.prototype.request=function(e,t,i){return o(this,void 0,void 0,(function(){var r,s,o,c,l,f,v,p,m,y,w;return a(this,(function(a){switch(a.label){case 0:return r=K.parseRequestArgs(e,t,i),o=(s=this.options).headers,l=void 0===(c=s.fetch)?h.default:c,v=void 0===(f=s.method)?"POST":f,p=u(s,["headers","fetch","method"]),m=this.url,void 0!==r.signal&&(p.signal=r.signal),y=D(r.document),w=y.operationName,[4,b({url:m,query:y.query,variables:r.variables,headers:n(n({},d(E(o))),d(r.requestHeaders)),operationName:w,fetch:l,method:v,fetchOptions:p})];case 1:return[2,a.sent().data]}}))}))},e.prototype.batchRequests=function(e,t){return o(this,void 0,void 0,(function(){var i,r,s,o,c,l,f,v,p,m,y;return a(this,(function(a){switch(a.label){case 0:return i=K.parseBatchRequestArgs(e,t),s=(r=this.options).headers,c=void 0===(o=r.fetch)?h.default:o,f=void 0===(l=r.method)?"POST":l,v=u(r,["headers","fetch","method"]),p=this.url,void 0!==i.signal&&(v.signal=i.signal),m=i.documents.map((function(e){return D(e.document).query})),y=i.documents.map((function(e){return e.variables})),[4,b({url:p,query:m,variables:y,headers:n(n({},d(E(s))),d(i.requestHeaders)),operationName:void 0,fetch:c,method:f,fetchOptions:v})];case 1:return[2,a.sent().data]}}))}))},e.prototype.setHeaders=function(e){return this.options.headers=e,this},e.prototype.setHeader=function(e,t){var n,i=this.options.headers;return i?i[e]=t:this.options.headers=((n={})[e]=t,n),this},e.prototype.setEndpoint=function(e){return this.url=e,this},e}();function b(e){var t=e.url,i=e.query,r=e.variables,s=e.headers,c=e.operationName,h=e.fetch,l=e.method,f=void 0===l?"POST":l,d=e.fetchOptions;return o(this,void 0,void 0,(function(){var e,o,l,v,y,w,b,g,O,T;return a(this,(function(a){switch(a.label){case 0:return e="POST"===f.toUpperCase()?p:m,o=Array.isArray(i),[4,e({url:t,query:i,variables:r,operationName:c,headers:s,fetch:h,fetchOptions:d})];case 1:return[4,S(l=a.sent(),d.jsonSerializer)];case 2:if(v=a.sent(),y=o&&Array.isArray(v)?!v.some((function(e){return!e.data})):!!v.data,w=!v.errors||"all"===d.errorPolicy||"ignore"===d.errorPolicy,l.ok&&w&&y)return b=l.headers,g=l.status,O=u(v,["errors"]),T="ignore"===d.errorPolicy?O:v,[2,n(n({},o?{data:T}:T),{headers:b,status:g})];throw new X.ClientError(n(n({},"string"==typeof v?{error:v}:v),{status:l.status,headers:l.headers}),{query:i,variables:r})}}))}))}function g(e,t,i,r){return o(this,void 0,void 0,(function(){var s;return a(this,(function(){return s=K.parseRequestExtendedArgs(e,t,i,r),[2,new w(s.url).request(n({},s))]}))}))}function S(e,t){return void 0===t&&(t=Q.defaultJsonSerializer),o(this,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return e.headers.forEach((function(e,t){"content-type"===t.toLowerCase()&&(n=e)})),n&&n.toLowerCase().startsWith("application/json")?(r=(i=t).parse,[4,e.text()]):[3,2];case 1:return[2,r.apply(i,[s.sent()])];case 2:return[2,e.text()]}}))}))}function T(e){var t,n=void 0,i=e.definitions.filter((function(e){return"OperationDefinition"===e.kind}));return 1===i.length&&(n=null===(t=i[0].name)||void 0===t?void 0:t.value),n}function D(e){if("string"==typeof e){var t=void 0;try{t=T(R.parse(e))}catch(e){}return{query:e,operationName:t}}var n=T(e);return{query:V.print(e),operationName:n}}function E(e){return"function"==typeof e?e():e}t.GraphQLClient=w,t.rawRequest=function(e,t,i,r){return o(this,void 0,void 0,(function(){var s;return a(this,(function(){return s=K.parseRawRequestExtendedArgs(e,t,i,r),[2,new w(s.url).rawRequest(n({},s))]}))}))},t.request=g,t.batchRequests=function(e,t,i){return o(this,void 0,void 0,(function(){var r;return a(this,(function(){return r=K.parseBatchRequestsExtendedArgs(e,t,i),[2,new w(r.url).batchRequests(n({},r))]}))}))},t.default=g,t.resolveRequestDocument=D,t.gql=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e.reduce((function(e,n,i){return""+e+n+(i in t?t[i]:"")}),"")},Object.defineProperty(t,"GraphQLWebSocketClient",{enumerable:!0,get:function(){return Y.GraphQLWebSocketClient}})}));class ee{static getQueryParams(e){const t=new Map,n=/[?&]?([^=]+)=([^&]*)/g;let i;for(e=(e=window.unescape(e)).split("+").join(" ");i=n.exec(e);)t.set(window.decodeURIComponent(i[1]),i[2]);return t.set("urlBase",this.getUrlBase()),window.moduleID&&window.URIServiceBroker&&(t.set("moduleID",window.moduleID),t.set("URIServiceBroker",window.URIServiceBroker)),t}static getUrlBase(){return window.mock_url?window.mock_url:`${location.protocol}//${location.hostname}${location.port?":"+location.port:""}`}}class te{constructor(){this.GRAPHQL_PATH="/mge/graphql",this.watingRequestsById=new Map}static get(){if(!te.instance){te.instance=new te;const e=document.querySelector(this.appTagName);null===e?te.instance.resume():(e.addEventListener("applicationLoading",(()=>te.instance.pause())),e.addEventListener("applicationLoaded",(()=>te.instance.resume())))}return this.instance}static addRequestListener(e){te.requestListener.indexOf(e)<0&&te.requestListener.push(e)}static removeRequestListener(e){const t=te.requestListener.indexOf(e);t>-1&&te.requestListener.splice(t,1)}processErrorInfo(e){var t,n;const s="Falha detectada",o=e[0];if(!(o.length>0))return new i(s,"Não há informações sobre o erro");{const e=o[0],a=(null==e?void 0:e.message)?null==e?void 0:e.message:"Não há mensagem de erro",u=(null===(t=null==e?void 0:e.extensions)||void 0===t?void 0:t.level)?e.extensions.level:"ERROR",c=(null===(n=null==e?void 0:e.extensions)||void 0===n?void 0:n.code)?e.extensions.code:"";switch(u){case"WARNING":return new r(s,a,c);default:return new i(s,a,c)}}}async callGraphQL(e){var t;const n=this.getReqKey(e);return e.queryID=n,e.values.queryID=n,this.ready?new Promise((async(t,i)=>{let r=this.getQueryTemplate(e);const s=await this.fecthGrapql([{document:r,variables:e.values}]);s.errors.length>0?i(this.processErrorInfo(s.errors)):t(s.data[0][n])})):(this.watingRequestsById.has(n)||this.watingRequestsById.set(n,new ne(e)),null===(t=this.getWatingRequest(n))||void 0===t?void 0:t.promise)}resolveURL(){return ee.getUrlBase()}getContext(e){const t=ee.getQueryParams(location.search);return{baseUrl:`${this.resolveURL()}/${e}/service.sbr`,appName:"SankhyaBlocks",mgeSession:`${window.skw_session||t.mgeSession}`,globalID:"85C0093DFA240EAB699B4E47A10215BD",resourceID:"br.com.sankhya.mov.bancaria"}}async callServiceBroker(e,t){return new Promise(((n,i)=>{const r=e.split("@"),[s,o]=2===r.length?r:["mge",e],a=this.getContext(s),u=`${a.baseUrl}?serviceName=${o}&counter=21&application=${a.appName}&outputType=json&preventTransform=false&mgeSession=${a.mgeSession}&resourceID=${a.resourceID}&globalID=${a.globalID}&allowConcurrentCalls=true`;document.cookie=`JSESSIONID=${a.mgeSession};`;const c=new XMLHttpRequest;te.requestListener.forEach((e=>e.onRequestStart({url:u,requestBody:t}))),c.open("POST",u,!0),c.withCredentials=!0,c.send(t),c.onreadystatechange=function(){if(4==this.readyState&&200==this.status){try{const e=JSON.parse(this.responseText);1==e.status?n(e.responseBody):i(e)}catch(e){console.warn(`callServiceBroker error to parser response to JSON ${e}`),i(this.responseText)}te.requestListener.forEach((e=>e.onRequestEnd({url:u,requestBody:t})))}else 4==this.readyState&&200!=this.status&&(i(this.responseText),te.requestListener.forEach((e=>e.onRequestEnd({url:u,requestBody:t}))))}}))}getReqKey(e){return window.btoa(s.hashCode(`${e.query}${JSON.stringify(e.values||"")}`)).replace(/=/g,"")}getQueryTemplate(e){return(e.query||"").replaceAll("$queryAlias$",e.queryID)}getWatingRequest(e){return this.watingRequestsById.get(e)}pause(){this.ready=!1}async resume(){if(this.ready=!0,this.watingRequestsById.size>0){const e=[];let t;this.watingRequestsById.forEach((async t=>{let n=this.getQueryTemplate(t.request);e.push({document:n,variables:Object.assign({},t.request.values)})}));let n=[],r=[];t=await this.fecthGrapql(e),n=t.data,r=t.errors,r.forEach((e=>{Object.entries(e).forEach((([e,t])=>{var n;((null===(n=this.getWatingRequest(t.request.variables[t.index].queryID))||void 0===n?void 0:n.reject)||Promise.reject)(new i("Falha detectada",t.message))}))})),n.forEach((e=>{Object.entries(e).forEach((([e,t])=>{var n;((null===(n=this.getWatingRequest(e))||void 0===n?void 0:n.resolve)||Promise.resolve)(t)}))})),this.watingRequestsById.clear()}}async fecthGrapql(e){let t,n=[],r=[],s=`${this.resolveURL()+this.GRAPHQL_PATH}`;window.skw_session&&(s+=`?mgeSession=${window.skw_session}`),te.requestListener.forEach((t=>t.onRequestStart({url:s,requestBody:e})));try{t=await Z.batchRequests(s,e,{"Content-Type":`application/json; charset=${window.SERVER_ENCODING||"UTF-8"}`}),t.forEach(((t,i)=>{var s;(null===(s=null==t?void 0:t.errors)||void 0===s?void 0:s.length)>0?r.push(t.errors.map((t=>this.normalizeErrorResponse(t,e,i)))):n.push(t.data)}))}catch(o){if(this.isHttpError(o))throw te.requestListener.forEach((t=>t.onRequestEnd({url:s,requestBody:e}))),new i("Falha de comunicação",o.message);{t=o.response;const e=o.request;Object.entries(t).forEach((([t,i])=>{i.errors?r.push(i.errors.map((n=>(n.request=e,n.index=Number(t),n)))):i.data&&n.push(i.data)}))}}return te.requestListener.forEach((t=>t.onRequestEnd({url:s,requestBody:e}))),{data:n,errors:r}}isHttpError(e){var t;return!e.response&&!e.request||(null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.status)>=300}normalizeErrorResponse(e,t,n){const i=Object.assign({},t[n]),{variables:r}=i;return i.variables=[],i.variables[n]=r,e.request=i,e.index=Number(n),e}}te.appTagName="snk-application",te.requestListener=[];class ne{constructor(e){this._resolve=()=>{},this._reject=()=>{},this._request=void 0,this._request=e,this._promisse=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promisse}get request(){return this._request}}class ie{constructor(){this.templateByQuery=new Map,this._loadDataTimeout={},this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchDataUnit",Z.gql`query($name: String!) {
2
+ $queryAlias$: fetchDataUnit(name: $name){
3
+ name
4
+ fields{
5
+ name
6
+ defaultValue
7
+ label
8
+ visible
9
+ readOnly
10
+ required
11
+ dataType
12
+ userInterface
13
+ calculated
14
+ properties{
15
+ name
16
+ value
17
+ }
18
+ dependencies{
19
+ masterFields
20
+ type
21
+ expression
22
+ }
23
+ }
24
+ }
25
+ }`),this.templateByQuery.set("fetchData",Z.gql`query($dataunit: String! $limit: Int $offset:Int $filters: [InputFilter!] $sort: [InputSort!]) {
26
+ $queryAlias$: fetchDataUnit(name: $dataunit){
27
+ data(limit: $limit offset: $offset filters: $filters sort: $sort){
28
+ limit
29
+ offset
30
+ total
31
+ hasMore
32
+ records{
33
+ id
34
+ fields {
35
+ name
36
+ value
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }`),this.templateByQuery.set("saveData",Z.gql`mutation($changes: [InputBatchChange!]!) {
42
+ $queryAlias$: batchOperationDataUnit(changes: $changes){
43
+ oldId
44
+ id
45
+ fields {
46
+ name
47
+ value
48
+ }
49
+ }
50
+ }`)}getDataUnit(e,t){const n=new o(`dd://${e}/${t}`);return n.metadataLoader=e=>this.loadMetadata(e),n.dataLoader=(e,t)=>this.loadData(e,t),n.saveLoader=(e,t)=>this.saveData(e,t),n.removeLoader=(e,t)=>this.removeRecords(e,t),n}loadMetadata(e){return new Promise(((t,n)=>{te.get().callGraphQL({values:{name:e.name},query:this.templateByQuery.get("fetchDataUnit")}).then((e=>{var n;const i={name:e.name,label:e.name,fields:[]};null===(n=e.fields)||void 0===n||n.forEach((e=>{let t;Array.isArray(e.properties)&&(t={},e.calculated&&(t.gridHeaderTooltip="Campos calculados não podem ser ordenados"),e.properties.forEach((e=>t[e.name]=e.value))),i.fields.push(Object.assign(Object.assign({},e),{properties:t}))})),t(i)})).catch((e=>{n(e)}))}))}loadData(e,t){const n=e.name;return this._loadDataTimeout[n]&&(clearTimeout(this._loadDataTimeout[n]),delete this._loadDataTimeout[n]),new Promise(((i,r)=>{this._loadDataTimeout[n]=setTimeout((()=>{delete this._loadDataTimeout[n],this.doLoadData(e,t).then((e=>i(e))).catch((e=>r(e)))}),200)}))}doLoadData(e,t){return new Promise(((n,i)=>{var r;const{sort:o,filters:u,limit:c,offset:h,quickFilter:l}=t,f={dataunit:e.name,sort:o,filters:u};if(f.limit=c,f.offset=h,!s.isEmpty(null==l?void 0:l.term)){void 0===f.filter&&(f.filter=[]);const e={name:"__QUICK_FILTER__",expression:"__QUICK_FILTER__",params:[{name:"term",dataType:a.TEXT,value:l.term}]};(null===(r=null==l?void 0:l.fields)||void 0===r?void 0:r.length)>0&&e.params.push({name:"fields",dataType:a.OBJECT,value:l.fields}),f.filter.push(e)}te.get().callGraphQL({values:f,query:this.templateByQuery.get("fetchData")}).then((t=>{const{limit:i,offset:r,total:s,hasMore:o,records:a}=t.data;let u;i&&(u={firstRecord:0==s?0:r+1,lastRecord:r+Math.min(a.length,i),total:s,currentPage:r/i,hasMore:o});const c=[];a.forEach((t=>{const n={__record__id__:t.id};t.fields.forEach((({name:t,value:i})=>{n[t]=e.valueFromString(t,i)})),c.push(n)})),n({paginationInfo:u,records:c})})).catch((e=>{i(e)}))}))}saveData(e,t){const n=t.map((t=>{const{dataUnit:n,record:i,updatingFields:r,operation:s}=t;let o;r&&(o=Object.entries(r).map((([t,n])=>{const i=e.getField(t);return{fieldName:t,dataType:i?i.dataType:a.TEXT,value:e.valueToString(t,n)}})));const u={dataUnit:n,fields:o,operation:s,recordId:i.__record__id__};return t.sourceId&&(u.sourceId=t.sourceId),u}));return new Promise(((t,i)=>{te.get().callGraphQL({values:{changes:n},query:this.templateByQuery.get("saveData")}).then((n=>{const i=[];null==n||n.forEach((t=>{const n={__record__id__:t.id};t.oldId&&(n.__old__id__=t.oldId),t.fields.forEach((({name:t,value:i})=>{n[t]=e.valueFromString(t,i)})),i.push(n)})),t(i)})).catch((e=>{i(e)}))}))}removeRecords(e,t){const n=t.map((t=>({dataUnit:e.name,operation:u.DELETE,recordId:t})));return new Promise(((e,i)=>{te.get().callGraphQL({values:{changes:n},query:this.templateByQuery.get("saveData")}).then((()=>{e(t)})).catch((e=>{i(e)}))}))}}class re{static openAppActivity(e,t){var n;null===(n=window.workspace)||void 0===n||n.openAppActivity(e,t)}}re.resourceID=null===(b=window.workspace)||void 0===b?void 0:b.resourceID;class se{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",Z.gql`query($name: String!) {
51
+ $queryAlias$: fetchResource(name: $name){
52
+ name
53
+ resource
54
+ }
55
+ }`)}async getParam(e,t){const n=`param://${t}?params=${window.btoa(e)}`;return te.get().callGraphQL({values:{name:n},query:this.templateByQuery.get("fetchParam")})}async asString(e,t){const n=await this.getParam(e,t);return this.getValue(n)}async asInteger(e,t){const n=await this.getParam(e,t);return parseInt(this.getValue(n))}async asFloat(e,t){const n=await this.getParam(e,t);return parseFloat(this.getValue(n))}async asBoolean(e,t){const n=await this.getParam(e,t);return"S"==this.getValue(n)}async asDate(e,t){const n=await this.getParam(e,t);return c.strToDate(this.getValue(n))}async getBatchParams(e,t){const n=await this.getParam(e.join(","),t),i={};return n.forEach((e=>i[e.name]=e.resource)),i}getValue(e={}){return Array.isArray(e)&&e.length>0&&(e=e[0]),s.isEmpty(e.resource)?"":e.resource}}class oe{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchResource",Z.gql`query($name: String!) {
56
+ $queryAlias$: fetchResource(name: $name){
57
+ resource
58
+ }
59
+ }`),this.templateByQuery.set("saveResource",Z.gql`mutation($resource: InputResource!) {
60
+ $queryAlias$: saveResource(resource: $resource){
61
+ name
62
+ resource
63
+ }
64
+ }`)}loadResource(e){return new Promise(((t,n)=>{te.get().callGraphQL({values:{name:e},query:this.templateByQuery.get("fetchResource")}).then((e=>{t(null==e?void 0:e.resource)})).catch((e=>{n(e)}))}))}saveResource(e,t){return new Promise(((n,i)=>{te.get().callGraphQL({values:{resource:{name:t,resource:JSON.stringify(e)}},query:this.templateByQuery.get("saveResource")}).then((e=>{n(e)})).catch((e=>{i(e)}))}))}}class ae extends oe{loadFormConfig(e,t){return new Promise(((n,i)=>{this.loadResource(`cfg://form/${t}/${e}`).then((t=>{if(t){const e=JSON.parse(t),{tabs:i,fields:r}=e;if(i){const e=new Map(i.map((e=>[e.label,e])));r.forEach((t=>t.tab=e.get(this.getTabName(t.tab))))}n(r)}else i(`Sem configuração pro formulário "${e}".`)})).catch((e=>{i(e)}))}))}getTabName(e){return"object"==typeof e?e.label:e}}class ue extends oe{constructor(){super(...arguments),this.GRID_CONFIG_VERSION="V3:"}getConfig(e,t){const n=`cfg://grid/${this.GRID_CONFIG_VERSION}${t}`;return new Promise(((e,t)=>{this.loadResource(n).then((t=>{let n;t&&(n=JSON.parse(t)),e(n)})).catch((e=>{t(e)}))}))}saveConfig(e,t){const n=`cfg://grid/${this.GRID_CONFIG_VERSION}${t}`;return new Promise(((t,i)=>{this.saveResource(e,n).then((e=>{t(e)})).catch((e=>{i(e)}))}))}}class ce{constructor(){this._defaultPageSize=100,this._templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this._templateByQuery.set("search",Z.gql`query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
65
+ $queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
66
+ value
67
+ label
68
+ }
69
+ }`)}loadSearchOptions(e,t,n,i){const r=(null==t?void 0:t.trim())||void 0;return t=isNaN(Number(r))&&r?`%${r}`:r,new Promise(((r,s)=>{te.get().callGraphQL({values:{argument:t,entityName:e,criteria:n,options:i},query:this._templateByQuery.get("search")}).then((e=>{r(e)})).catch((e=>{s(e)}))}))}loadAdvancedSearch(e,t,n,i){const r={query:{$:null==n?void 0:n.expression}};(null==n?void 0:n.params.length)>0&&(r.params={param:n.params.map((e=>({$:e.value,type:he(e.dataType)})))});const s={serviceName:"PesquisaSP.getSuggestion",requestBody:{criteria:{entityName:e,compacted:!1,ignoreEntityCriteria:!1,limit:this._defaultPageSize,query:{$:t},orderByDesc:!1,externalCriteria:r,localEntityName:null==i?void 0:i.rootEntity},clientEventList:{clientEvent:[]}}};return new Promise(((e,t)=>{te.get().callServiceBroker("PesquisaSP.getSuggestion",JSON.stringify(s)).then((t=>e(t))).catch((e=>t(e)))}))}}function he(e){switch(e){case a.NUMBER:return"I";case a.DATE:return"D";default:return"S"}}class le extends oe{getData(e){const t=`cfg://auth/${e}`;return new Promise(((e,n)=>{this.loadResource(t).then((t=>{let n=h.stringToObject(t);n&&"object"==typeof n&&e(n)})).catch((e=>{n(e)}))}))}}!function(e){e.INSERT="I",e.UPDATE="A",e.REMOVE="E",e.SHOW="C",e.CONFIG="F",e.CONFIG_NUMBER="N",e.CLONE="D",e.CONFIG_GRID="G"}(g||(g={}));const fe=de;function de(e,t){const n=ve();return(de=function(e){return n[e-=378]})(e,t)}function ve(){const e=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return(ve=function(){return e})()}!function(){const e=de,t=ve();for(;;)try{if(281287==parseInt(e(399))/1*(-parseInt(e(387))/2)+-parseInt(e(401))/3+parseInt(e(381))/4*(-parseInt(e(389))/5)+parseInt(e(388))/6*(-parseInt(e(386))/7)+parseInt(e(379))/8+parseInt(e(396))/9+parseInt(e(383))/10)break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class pe{[fe(397)](e){const t=fe;if(typeof(e=utxt(e[t(390)]))==t(392)&&(e=JSON[t(400)](e)),null==e)throw Error(t(395));const n=new me("S"===e[t(402)]||!0===e[t(402)]);return Array[t(394)](e[t(391)])&&e[t(391)][t(385)]((e=>n.putAccess(e[t(382)],String(e.status)==t(398)))),n}}class me{constructor(e){const t=fe;this.isSup=e,this[t(384)]={}}[fe(378)](e,t){this[fe(384)][e]=t}[fe(393)](e){const t=fe;if(this[t(402)])return!0;let n=!0;return this[t(384)][t(380)](e)&&(n=this.actions[e]),n}isUserSup(){return this.isSup}}class ye{constructor(e){this._app=e,window.addEventListener("error",(e=>this.errorHandler(e))),window.addEventListener("unhandledrejection",(e=>this.rejectionHandler(e)))}rejectionHandler(e){const t=e.reason;t instanceof l||(t?this.processException(t):this._app.isDebugMode().then((e=>{e&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(e){this.processException(e.error)}buildErrorCodeHTML(e){return'<br><a href="#" onclick="try{window.workspace.openHelp(\'_tbcode:'+e.errorCode+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+e.errorCode+"</a>"}processException(e){""!=e.errorCode&&(e.message+=this.buildErrorCodeHTML(e)),e instanceof l||e instanceof r?this._app.alert(e.title,e.message):e instanceof i?this._app.error(e.title,e.message):this._app.isDebugMode().then((t=>{if(t)if(e instanceof Error)this._app.error(e.name,e.message);else{const t=(null==e?void 0:e.title)||"Erro detectado",n="string"==typeof e?e:e.message||`Erro interno "${h.objectToString(e)}"`;this._app.error(t,n)}}))}}function we(){const e=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(we=function(){return e})()}const be=ge;function ge(e,t){const n=we();return(ge=function(e){return n[e-=392]})(e,t)}!function(){const e=ge,t=we();for(;;)try{if(951926==-parseInt(e(398))/1+-parseInt(e(393))/2+parseInt(e(395))/3+-parseInt(e(400))/4*(parseInt(e(392))/5)+-parseInt(e(401))/6*(-parseInt(e(402))/7)+parseInt(e(397))/8+-parseInt(e(399))/9*(-parseInt(e(394))/10))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();const Oe=be(396);class Se{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchTotals",Z.gql`query($filters: [InputFilter!] $name: String!) {
70
+ $queryAlias$: fetchTotals(name: $name, filters: $filters ){
71
+ name
72
+ value
73
+ }
74
+ }`)}async getTotals(e,t,n){let i={name:`totals://${e}/${t}`,filters:n};return te.get().callGraphQL({values:i,query:this.templateByQuery.get("fetchTotals")})}fetchTotals(e,t,n=[]){return new Promise(((i,r)=>{this.getTotals(e,t,n).then((e=>{if(e.length>0){const t=new Map;e.forEach((e=>{t.set(e.name,parseFloat(e.value))})),i(t)}else r("Não foi possível recuperar os totalizadores")})).catch((e=>{r(e)}))}))}}function Te(e){if(null==e)return e;if(e instanceof Date)return e.toISOString();if("object"==typeof e){if(e instanceof Array)return e.map((e=>Te(e)));{const t=Object.assign({},e);return Object.keys(e).forEach((n=>{e[n]?t[n]=Te(e[n]):delete t[n]})),t}}return e}class De extends oe{saveConfig(e,t,n){const i=e.map((e=>{const{id:t,value:n,fixed:i,visible:r}=e,s={id:t};return n&&(s.value=Te(n)),i&&(s.fixed=i),r&&(s.visible=!0),s}));return this.saveResource(i,`cfg://filter/FilterBarState:${t}/${n}`)}getConfig(e,t){return new Promise(((n,i)=>{this.loadResource(`cfg://filter/FilterBarState:${e}/${t}`).then((e=>{let t;e&&(t=JSON.parse(e).items),n(t||[])})).catch((e=>{i(e)}))}))}}const Ee=class{constructor(n){e(this,n),this.applicationLoaded=t(this,"applicationLoaded",7),this.applicationLoading=t(this,"applicationLoading",7),this._authPromises=[],this._duCache=new Map,this._duPromises=new Map,this._requestListener=new Ie}get parameters(){return this._parameters||(this._parameters=new se),this._parameters}get resourceID(){return this._resourceID||(this._resourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||re.resourceID||"unknown.resource.id"),this._resourceID}get auth(){return this._auth?Promise.resolve(this._auth):new Promise(((e,t)=>{const n=this._authPromises.length>0;this._authPromises.push(new je(e,t)),n||this.authFetcher.getData(this.resourceID).then((e=>{for(this._auth=e;this._authPromises.length>0;)this._authPromises.pop().resolve(this._auth)})).catch((e=>{for(;this._authPromises.length>0;)this._authPromises.pop().reject(e)}))}))}async isUserSup(){return new Promise(((e,t)=>{this.auth.then((n=>{this.getAuthList(n).then((t=>{e(t.isSup)})).catch((e=>t(e)))}))}))}async hasAccess(e){return new Promise(((t,n)=>{this.auth.then((i=>{this.getAuthList(i).then((n=>{t(n.isSup||n.actions[e])})).catch((e=>n(e)))}))}))}async getAllAccess(){return new Promise(((e,t)=>{this.auth.then((n=>{this.getAuthList(n).then((t=>{const n={};n.isSup=t.isSup,Object.entries(g).forEach((e=>{n[e[0]]=t.actions[e[1]]||!1})),e(n)})).catch((e=>t(e)))}))}))}async getStringParam(e){return this.parameters.asString(e,this.resourceID)}async getIntParam(e){return this.parameters.asInteger(e,this.resourceID)}async getFloatParam(e){return this.parameters.asFloat(e,this.resourceID)}async getBooleanParam(e){return this.parameters.asBoolean(e,this.resourceID)}async getDateParam(e){return this.parameters.asDate(e,this.resourceID)}async showPopUp(e){this.clearContent(this._popUp),this._popUp.appendChild(e),this._popUp.opened=!0}async showModal(e){this.clearContent(this._rightModal),this._rightModal.appendChild(e),this._rightModal.opened=!0}async closeModal(){this.clearContent(this._rightModal),this._rightModal.opened=!1}async closePopUp(){this.clearContent(this._popUp),this._popUp.opened=!1}async temOpcional(e){const t=e.split(",");return new Promise(((e,n)=>{this.getAttributeFromHTMLWrapper("opc0009").then((i=>{"1"===i?e(!0):Promise.all(t.map((e=>this.getAttributeFromHTMLWrapper("opc"+e)))).then((t=>{e(t.includes("1"))})).catch((e=>{n(e)}))})).catch((e=>{n(e)}))}))}async getConfig(e){let t={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:e,tipo:"T"}}};return new Promise(((e,n)=>{te.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(t)).then((t=>{var n;return e(null===(n=t.config)||void 0===n?void 0:n.data)})).catch((e=>n(e)))}))}async saveConfig(e,t){let n={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:e,tipo:"T",data:t}}};return new Promise(((e,t)=>{te.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(n)).then((t=>e(t))).catch((e=>t(e)))}))}async getAttributeFromHTMLWrapper(e){return Promise.resolve(window[e])}async openApp(e,t){re.openAppActivity(e,t)}getDuPromissesStack(e){let t;return e&&(t=this._duPromises.get(e),t||(t=[],this._duPromises.set(e,t))),t||[]}async createDataunit(e,t){return new Promise(((n,i)=>{const r=this.getDuPromissesStack(t),s=r.length>0;if(r.push(new je(n,i)),!s){const n=this.dataUnitFetcher.getDataUnit(e,this.resourceID);n.loadMetadata().then((()=>{for(t&&this._duCache.set(t,n);r.length>0;)r.pop().resolve(n)})).catch((e=>{for(;r.length>0;)r.pop().reject(e)}))}}))}async getDataUnit(e,t){return new Promise(((n,i)=>{const r=this._duCache.get(t);r?n(r):this.createDataunit(e,t).then((e=>{n(e)})).catch((e=>i(e)))}))}async getResourceID(){return Promise.resolve(this.resourceID)}async alert(e,t,n,i){return p.alert(e,t,n,i)}async error(e,t,n,i){return p.error(e,t,n,i)}async success(e,t,n,i){return p.success(e,t,n,i)}async message(e,t,n,i){return p.message(e,t,n,i)}async confirm(e,t,n,i,r){return p.confirm(e,t,n,i,r)}async info(e,t){return p.info(e,t)}async loadFormConfig(e){return this.formConfigFetcher.loadFormConfig(e,this.resourceID)}async loadGridConfig(e){return this.gridConfigFetcher.getConfig(e,this.resourceID)}async loadTotals(e,t,n){return this.totalsFetcher.fetchTotals(e,t,n)}async saveGridConfig(e){return this.gridConfigFetcher.saveConfig(e,this.resourceID)}async getFilterBarConfig(e){return new Promise(((t,n)=>{this.configName===e&&this._filterBarConfig?t(this._filterBarConfig):this.configName===e&&null!=this._filterConfigPromise?Promise.all([this._filterConfigPromise]).then((e=>t(e[0]))).catch((e=>n(e[0]))):this.filterBarConfigFetcher.getConfig(this.resourceID,e).then((e=>t(e))).catch((e=>n(e)))}))}async saveFilterBarConfig(e,t){return this.filterBarConfigFetcher.saveConfig(e,this.resourceID,t)}async getAuthList(e){return await(new pe).parseFromJSON(e)}get urlParams(){return this._urlParams||(this._urlParams=ee.getQueryParams(location.search)),this._urlParams}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new ie),this._dataUnitFetcher}get formConfigFetcher(){return this._formConfigFetcher||(this._formConfigFetcher=new ae),this._formConfigFetcher}get gridConfigFetcher(){return this._gridConfigFetcher||(this._gridConfigFetcher=new ue),this._gridConfigFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new Se),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new ce),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new le),this._authFetcher}get filterBarConfigFetcher(){return this._filterBarConfigFetcher||(this._filterBarConfigFetcher=new De),this._filterBarConfigFetcher}async executeSearch(e,t,n){const i=null==n?void 0:n.getField(t);if(i){const{mode:t,argument:r}=e,{ENTITYNAME:s,CODEFIELD:o,DESCRIPTIONFIELD:u,ROOTENTITY:c,DESCRIPTIONENTITY:h}=i.properties,l=i.dependencies;let d;const v={rootEntity:c,descriptionFieldName:u,codeFieldName:o,showInactives:!1};return null==l||l.filter((e=>{var t;return null===(t=e.masterFields)||void 0===t?void 0:t.every((e=>{var t;return null===(t=n.getField(e))||void 0===t?void 0:t.visible}))})).forEach((e=>{var t;e.type===f.SEARCHING&&(null===(t=e.masterFields)||void 0===t?void 0:t.length)>0&&(d={expression:e.expression,params:e.masterFields.map((e=>{const t=n.getField(e),i=(null==t?void 0:t.dataType)||a.TEXT,r=n.getFieldValue(e);if(null==r)throw this.alert("Erro ao pesquisar",`É necessario informar o campo ${t.label} para executar a pesquisa.`),new Error(`É necessario informar o campo ${t.label} para executar a pesquisa.`);return{name:e,value:r,dataType:i}}))})})),this.executePreparedSearch(t,r,{entity:s,entityDescription:h,criteria:d,searchOptions:v})}}async executePreparedSearch(e,t,n){const{entity:i,entityDescription:r,criteria:s,searchOptions:o}=n;return"ADVANCED"===e?new Promise((e=>{const n=document.createElement("snk-pesquisa");n.argument=t,n.searchLoader=e=>this.pesquisaFetcher.loadAdvancedSearch(i,e,s,o),n.selectItem=t=>{e(t),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(r),this.showPopUp(n)})):this.pesquisaFetcher.loadSearchOptions(i,t,s,o)}async isDebugMode(){return new Promise((e=>{e(window.isDebugMode)}))}clearContent(e){e&&Array.from(e.children).forEach((t=>{e.removeChild(t)}))}clearPopUpTitle(){this._popUp.ezTitle=""}setPopUpTitle(e){this._popUp.ezTitle=e}componentWillLoad(){this._errorHandler=new ye(this),this.messagesBuilder=new m,d.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${ee.getUrlBase()}/mge/upload/file`),d.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((e,t,n)=>this.executeSearch(e,t,n))),d.setContextValue("__EZUI__GRID_LICENSE__",Oe),this.configName&&(this._filterConfigPromise=new Promise(((e,t)=>{this.filterBarConfigFetcher.getConfig(this.resourceID,this.configName).then((t=>{this._filterBarConfig=t,e(t)})).catch((e=>t(e)))}))),v.init()}connectedCallback(){d.setContextValue("__SNK__APPLICATION__",this),te.addRequestListener(this._requestListener)}disconnectedCallback(){te.removeRequestListener(this._requestListener)}componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{this.applicationLoaded.emit(!0)}))}render(){return n("div",null,n("ez-loading-bar",{ref:e=>this._requestListener.loadingBar=e}),n("ez-popup",{opened:!1,ref:e=>this._popUp=e,onEzClosePopup:()=>this.closePopUp()}),n("ez-modal",{opened:!1,ref:e=>this._rightModal=e,"modal-size":"col col--sd-3",closeOutsideClick:!0}))}};class Ie{constructor(){this._debounceTime=1e3,this._ignoredNameTypes=["totals"],this._countRequest=0}onRequestStart(e){this.isIgnoreLoadingOnRequest(e)||(this._countRequest++,this.loadingBar.show(),this._timerLoading&&clearTimeout(this._timerLoading))}onRequestEnd(e){this.isIgnoreLoadingOnRequest(e)||(this._countRequest--,this._timerLoading=setTimeout((()=>{this._countRequest<=0&&this.loadingBar.hide()}),this._debounceTime))}isIgnoreLoadingOnRequest(e){var t;if(1==(null===(t=null==e?void 0:e.requestBody)||void 0===t?void 0:t.length)){const{name:t}=e.requestBody[0].variables;if(t){const e=t.split(":");return this._ignoredNameTypes.indexOf(e[0])>=0}}return!1}}class je{constructor(e,t){this.resolve=e,this.reject=t}}Ee.style=".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";export{Ee as snk_application}
@@ -0,0 +1 @@
1
+ var E;!function(E){E.MULTI_SELECT="MULTI_SELECT",E.BINARY_SELECT="BINARY_SELECT",E.PERIOD="PERIOD",E.SEARCH="SEARCH",E.TEXT="TEXT",E.NUMBER="NUMBER",E.DEFAULT_FILTER="DEFAULT_FILTER",E.PERSONALIZED="PERSONALIZED"}(E||(E={}));const T=E;export{T as F}
@@ -0,0 +1 @@
1
+ import{r as t,h as e,H as s}from"./p-fac2b6a9.js";import{UserInterface as i,ApplicationContext as a}from"@sankhyalabs/core";import{convertType as n}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{F as r}from"./p-9dd2b8cb.js";const l=class{constructor(e){t(this,e)}getValue(t,e){if(this.value&&e>=0&&e<this.value.length){const s=this.value[e];return t.type===i.SEARCH?s:n(t.dataType,s)}}setValue(t,e){this.value=null==this.value?Array(t).fill(null):[...this.value],this.value[t]=e,0==this.value.filter((t=>null!=t)).length&&(this.value=null)}doSearch(t,e,s){const i=a.getContextValue("__SNK__APPLICATION__");return this.fix&&this.fix(),new Promise(((a,n)=>{i.executePreparedSearch(t,e,s.searchContext).then((t=>{a(t),this.unfix&&this.unfix()})).catch((t=>{n(t),this.unfix&&this.unfix()}))}))}getParamsInterface(){var t,s,a;return(null===(a=null===(s=null===(t=this.config)||void 0===t?void 0:t.props)||void 0===s?void 0:s.personalizedFilter)||void 0===a?void 0:a.parameters).map(((t,s)=>{var a;switch(t.type){case i.SEARCH:return e("ez-search",{suppressEmptyOption:!0,value:this.getValue(t,s),onEzChange:t=>this.setValue(s,t.detail),label:t.label,optionLoader:({mode:e,argument:s})=>this.doSearch(e,s,t)});case i.SWITCH:case i.CHECKBOX:return e("ez-check",{class:"ez-padding-bottom--medium",mode:i.SWITCH===t.type?"switch":"regular",value:this.getValue(t,s),label:t.label,onEzChange:t=>this.setValue(s,t.detail)});case i.DECIMALNUMBER:case i.INTEGERNUMBER:return e("ez-number-input",{label:t.label,value:this.getValue(t,s),precision:null===(a=t.props)||void 0===a?void 0:a.precision,onEzChange:t=>this.setValue(s,t.detail)});case i.OPTIONSELECTOR:return e("ez-combo-box",{label:t.label,value:this.getValue(t,s),options:t.options,onEzChange:t=>{var e;return this.setValue(s,null===(e=t.detail)||void 0===e?void 0:e.value)}});case i.DATE:return e("ez-date-input",{label:t.label,value:this.getValue(t,s),onEzChange:t=>this.setValue(s,t.detail)});case i.DATETIME:return e("ez-date-time-input",{label:t.label,value:this.getValue(t,s),onEzChange:t=>this.setValue(s,t.detail)});default:return e("ez-text-input",{label:t.label,value:this.getValue(t,s),onEzChange:t=>this.setValue(s,t.detail)})}}))}render(){if(this.config&&this.config.type===r.PERSONALIZED)return e(s,null,this.getParamsInterface())}};export{l as snk_filter_personalized}
@@ -0,0 +1 @@
1
+ import{r as s,h as e,H as t}from"./p-fac2b6a9.js";import{ObjectUtils as i,StringUtils as r}from"@sankhyalabs/core";const a=class{constructor(e){s(this,e),this._mdByName={},this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this._specialCharsRegex=/[[.\-\$\+\*,_\&\(\)%\/\\#@!:\|\=\'\"]/gim,this._charsWithAccentuation="ÁÉÍÓÚ_ÃÕ_ÂÊÎÔÛ_ÀÈÌÒÙ_Ü_Ç_áéíóú_ãõ_âêîôû_àèìòù_ü_ç",this._charsWithoutAccentuation="AEIOU_AO_AEIOU_AEIOU_U_C_aeiou_ao_aeiou_aeiou_u_c",this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=450,this._startLoading=!1}observeArgument(){this._textInput&&(this._textInput.value=this.argument)}clearSearch(){this.argument="",this._itemList=void 0}buildDetails(s,e){let t={};for(let i=0;i<s.length;i++){const r=s[i],a=e[r.fieldName];t[r.description]=this.highlightValue(e.__matchFields,r.options&&r.options[a]||a,s,!0)}return t}buildFirstFields(s,e,t=6){return s&&Array.isArray(s)&&s.forEach((s=>{let t=this.removeReference(e,this._mdByName[s]);t&&e.unshift(t)})),e=e.slice(0,t)}doSearch(s){this.searchLoader&&"function"==typeof this.searchLoader&&(this._startLoading=!0,this.searchLoader(s).then((s=>{if(this._startLoading=!1,s){let e=(s=i.stringToObject(s.json.$)).descriptionField,t=s.pkField;if(e&&t){let i=[];s.data.forEach((r=>{var a;let n=this.filterFieldsMetadata(s,r),o=this.buildFirstFields(r.__matchFields,n),l={key:this.highlightValue(r.__matchFields,null===(a=r[t])||void 0===a?void 0:a.toString(),o,!0),title:this.highlightValue(r.__matchFields,r[e],o,!0),details:this.buildDetails(o,r)};i.push(l)})),this._itemList=i}}})).catch((s=>{this._startLoading=!1,this._itemList=[],console.warn(s)})))}filterFieldsMetadata(s,e){return s.fieldsMetadata.filter((t=>{let i=!r.isEmpty(e[t.fieldName])&&!1!==t.visible&&"B"!==t.type&&s.pkField!==t.fieldName&&s.descriptionField!==t.fieldName&&(t.isPrimaryKey||!t.isLinkField)&&!("S"===t.type&&"H"===t.presentationType);return i&&(this._mdByName[t.fieldName]=t),("string"!=typeof e[t.fieldName]||!(e[t.fieldName].indexOf("<img")>-1||e[t.fieldName].indexOf("<svg")>-1))&&i}))}removeAtIndex(s,e){if(e>=0&&e<s.length)return s.splice(e,1)[0]}removeReference(s,e){let t=this.indexOf(s,e);return this.removeAtIndex(s,t)}indexOf(s,e){let t=-1;return Array.isArray(s)&&this.find(s,((s,i)=>(t=i,this.equals(e,s)))),t}equals(s,e){return i.objectToString(s)===i.objectToString(e)}find(s,e){if(s)for(let t=0,i=s.length;t<i;t++)if(e(s[t],t,s))return s[t]}highlightValue(s,e,t,i){let r=this.replaceHtmlEntities(e);if(this.argument&&(i||this.isIn(s,t.fieldName))){const s=this.getArgumentNumber();let e=(isNaN(s)?this.argument:s.toString()).split(/%|,|\s+/),i=0,a=this.replaceAccentuatedChars(r);e.forEach((s=>{if(s){s=this.replaceAccentuatedChars(s);let e=this.getSpecialCharacters(s);null!=e&&e.length>0&&(s=this.removeSpecialCharacters(s)),(t.mask||"CGC_CPF"===t.uiType||"Phone"===t.uiType)&&(s=s.split("").join("\\.?\\-?\\/?\\(?\\)?"));let n=new RegExp(s,"ig");n.lastIndex=i;let o=n.exec(a);if(o&&o.length>0){i=o.index;let s=o[0].length,e=r.substring(i,i+s),t=(null==e?void 0:e.trim())?this._startHighlightTag+e+this._endHighlightTag:"",n=r.substring(0,i),l=r.substring(i+s);r=n+t+l,i+=t.length,a=this.replaceAccentuatedChars(r)}}}))}return r}replaceHtmlEntities(s){return null==s?s:String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}replaceAccentuatedChars(s){return null==s?s:this.replaceToSpace(s,["&amp;","&lt;","&gt;","&quot;"]).replace(/[^\w ]/g,(s=>{let e=this._charsWithAccentuation.indexOf(s);return e>-1&&(s=this._charsWithoutAccentuation.charAt(e)),s||""}))}replaceToSpace(s,e=[]){return null==s||e.forEach((e=>{const t=new RegExp(e,"g");let i="";for(let s=0;s<e.length;s++)i+=" ";s=String(s).replace(t,i)})),s}isIn(s,e){return this.indexOf(s,e)>-1}getSpecialCharacters(s){let e,t=[];for(;e=this._specialCharsRegex.exec(s);)t.push(s[e.index]);return t}removeSpecialCharacters(s){return this.getSpecialCharacters(s).forEach((e=>{s=this.replaceAll(s,e,"")})),s}replaceAll(s,e,t){let i=(null!=s?s:"").indexOf(e);for(;i>-1;)i=(s=s.replace(e,t)).indexOf(e);return s}getArgumentNumber(){return Number(this.argument||void 0)}createOption(s){const{key:e,title:t}=s,i=new RegExp(this._startHighlightTag,"g"),r=new RegExp(this._endHighlightTag,"g"),a={value:null==e?void 0:e.replace(i,"").replace(r,""),label:null==t?void 0:t.replace(i,"").replace(r,"")};this.selectItem(a)}onChangeValue(s){if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=setTimeout((()=>{this.onChangeValue(s)}),this._deboucingTime));this.argument=(s.detail||"").trim();const e=this.getArgumentNumber();this.argument&&(!isNaN(e)||this.argument.length>=this._limitCharsToSearch)?this._changeDeboucingTimeout=setTimeout((()=>{this.doSearch(isNaN(e)?this.argument:e.toString())}),this._deboucingTime):this._itemList=void 0}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=void 0)}onClickSearch(){this.doSearch((this.argument||"").trim())}getMessageView(){return this._startLoading?"Aguarde, buscando registros...":this._itemList?this._itemList.length>=1?`${this._itemList.length} ${this._itemList.length>1?"registros encontrados":"registro encontrado"}`:"Nenhum registro encontrado":"Os resultados de sua pesquisa aparecerão aqui..."}render(){var s;return e(t,null,e("div",{class:"snk-pesquisa"},e("div",{class:"snk-pesquisa__input"},e("ez-text-input",{label:"Buscar",class:"ez-margin-right--medium",canShowError:!1,ref:s=>this._textInput=s,onEzChange:s=>this.onChangeValue(s),value:this.argument},e("ez-icon",{slot:"leftIcon",iconName:"search"}),this.argument&&(null===(s=this._textInput)||void 0===s?void 0:s.value)?e("button",{slot:"rightIcon",class:"snk-pesquisa__btn",onClick:()=>this.clearSearch()},e("ez-icon",{iconName:"close"})):void 0),e("ez-button",{class:"ez-button--primary",label:"Pesquisar",onClick:()=>this.onClickSearch()})),e("label",{class:"snk-pesquisa__records"},this.getMessageView()),e("div",{class:"snk-pesquisa__content"},this._itemList&&this._itemList.map((s=>e("ez-card-item",{onEzClick:s=>this.createOption(s.detail),item:s}))))))}static get watchers(){return{argument:["observeArgument"]}}};a.style=".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__content-scrollbar--background-color-primary:var(--scrollbar--primary, #2B3A54);--snk-pesquisa__content-scrollbar--background-color-secondary:var(--scrollbar--secondary, #E5EAF0);--snk-pesquisa__content-scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__content-scrollbar--width:var(--space--medium, 12px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);max-height:100%;height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__content-scrollbar--background-color-primary) var(--snk-pesquisa__content-scrollbar--background-color-secondary);padding-right:var(--snk-pesquisa__content--padding-right)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__content-scrollbar--background-color-secondary);border-radius:var(--snk-pesquisa__content-scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__content-scrollbar--background-color-primary);border-radius:var(--snk-pesquisa__content-scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__content-scrollbar--background-color-secondary);width:var(--snk-pesquisa__content-scrollbar--width);max-width:var(--snk-pesquisa__content-scrollbar--width);min-width:var(--snk-pesquisa__content-scrollbar--width)}.snk-pesquisa__records.sc-snk-pesquisa{font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);color:var(--snk-pesquisa__records--color);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}";export{a as snk_pesquisa}
@@ -0,0 +1 @@
1
+ import{r as t,h as e}from"./p-fac2b6a9.js";import{F as s}from"./p-9dd2b8cb.js";const i=class{constructor(e){t(this,e)}ezChangeListener(){const t=this._startDate.value,e=this._endDate.value;this.value=t||e?{start:t,end:e}:void 0}getDate(t){const e=this.value?this.value[t]:null;if(e instanceof Date)return e;if("string"==typeof e){let t=new Date(e);return t.setMinutes(t.getMinutes()+t.getTimezoneOffset()),t}return null}render(){if(this.config&&this.config.type===s.PERIOD)return e("div",{class:"ez-col ez-col--nowrap"},e("ez-date-input",{label:this.config.label,ref:t=>this._startDate=t,value:this.getDate("start")}),e("label",{class:"ez-text ez-text--medium ez-text--primary ez-margin--medium"},"até"),e("ez-date-input",{label:this.config.label,ref:t=>this._endDate=t,value:this.getDate("end")}))}};export{i as snk_filter_period}
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as i,H as s}from"./p-fac2b6a9.js";import{ApplicationUtils as l}from"@sankhyalabs/ezui/dist/collection/utils";import{F as r}from"./p-9dd2b8cb.js";const n=class{constructor(i){e(this,i),this.filterChange=t(this,"filterChange",7)}changeConfig(e){this.filterChange.emit(e)}getContentEditor(){switch(this.config.type){case r.BINARY_SELECT:return"snk-filter-binary-select";case r.MULTI_SELECT:return"snk-filter-multi-select";case r.PERIOD:return"snk-filter-period";case r.SEARCH:return"snk-filter-search";case r.NUMBER:return"snk-filter-number";case r.PERSONALIZED:return"snk-filter-personalized"}return"snk-filter-text"}removeItem(){this.changeConfig(Object.assign(Object.assign({},this.config),{visible:!1,fixed:!1,value:void 0}))}getPopUpHeaderButtons(){if(!this.config.hardFixed)return[i("ez-icon",{title:this.getMessage("snkFilterBar.removeFilter"),class:"sc-snk-filter-bar snk-filter-item__editor-header-button",iconName:"delete",onClick:()=>this.removeItem()}),i("ez-icon",{title:this.getMessage(this.config.fixed?"snkFilterBar.unpinFilter":"snkFilterBar.pinFilter"),class:"ez-margin-left--small sc-snk-filter-bar snk-filter-item__editor-header-button",iconName:this.config.fixed?"un-pin":"push-pin",onClick:()=>this.changeConfig(Object.assign(Object.assign({},this.config),{fixed:!this.config.fixed}))})]}apply(){var e;let t=!0;const i=this._editor.value;if(null!=i&&this.config.type===r.PERSONALIZED){const s=(null===(e=this.config.props.personalizedFilter)||void 0===e?void 0:e.parameters)||[];s.length>1&&(s.length>i.length?t=!1:i.forEach((e=>{null==e&&(t=!1)}))),t||(this.keepOpened=!0,l.alert("Filtro parcialmente preenchido","Favor completar todas as informações do filtro.").then((()=>setTimeout((()=>this.keepOpened=!1),1))))}t&&this.changeConfig(Object.assign(Object.assign({},this.config),{value:i}))}clear(){this.changeConfig(Object.assign(Object.assign({},this.config),{value:void 0}))}render(){const e=this.getContentEditor();return i(s,null,i("div",{class:"col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center"},i("div",{class:"ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header"},this.config.detailTitle),this.getPopUpHeaderButtons()),i(e,{ref:e=>this._editor=e,value:this.config.value,config:this.config,fix:()=>this.keepOpened=!0,unfix:()=>this.keepOpened=!1}),i("hr",{class:"sc-snk-filter-bar snk-filter__popover-rule"}),i("div",{class:"ez-col ez-col--sd-12 ez-align--right"},i("ez-button",{label:this.getMessage("snkFilterBar.cleanFilter"),onClick:()=>this.clear(),size:"small"}),i("ez-button",{label:this.getMessage("snkFilterBar.applyFilter"),onClick:()=>this.apply(),size:"small",class:"ez-button--primary ez-padding-left--medium"})))}};export{n as snk_filter_detail}
@@ -0,0 +1 @@
1
+ import{r as s,h as r}from"./p-fac2b6a9.js";import{F as i}from"./p-9dd2b8cb.js";const t=class{constructor(r){s(this,r)}ezChangeListener(s){this.value=s.detail}render(){var s;if(this.config&&this.config.type===i.NUMBER)return r("ez-number-input",{label:this.config.label,value:this.config.value,precision:null===(s=this.config.props)||void 0===s?void 0:s.precision})}};export{t as snk_filter_number}
@@ -0,0 +1 @@
1
+ import{r as t,h as e,H as i,g as s,c as r}from"./p-fac2b6a9.js";import{DataType as l,ObjectUtils as a,StringUtils as n,ErrorException as o,ApplicationContext as h,FloatingManager as c,ArrayUtils as d}from"@sankhyalabs/core";import{F as f}from"./p-9dd2b8cb.js";import{ModalAction as m,ModalButtonStatus as u}from"@sankhyalabs/ezui/dist/collection/components/ez-modal-container";import{toString as b}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{T as k,V as p,A as _,b as v,a as g}from"./p-86f15ffe.js";const F=class{constructor(e){t(this,e),this._updateSequence=[],this._loadingPending=!1,this._configUpdated=!1,this._pendingFilters=[],this._calculateSortIndex=t=>{let e=t.hardFixed?1e6:0;return t.hardFixed||(e+=t.fixed?1e5:0,e+=null==t.value?0:1e4,e+=this._updateSequence.lastIndexOf(t.id)+1),e},this._filtersComparator=(t,e)=>this._calculateSortIndex(e)-this._calculateSortIndex(t)}observeFilterConfig(t,e){if(null!=e&&null==t)this._loadingPending=!0,this._configUpdated=!0;else{const i=new Map(e?e.map((t=>[t.id,t])):void 0);t.forEach((t=>{const e=i.get(t.id);null!=e?(this._configUpdated=this._configUpdated||a.objectToString(e)!=a.objectToString(t),this._loadingPending=this._loadingPending||a.objectToString(e.value)!==a.objectToString(t.value)):(this._configUpdated=!0,this._loadingPending=this._loadingPending||null!=t.value)}))}this.processAfterUpdateConfig()}processPendingFilter(){this._pendingFilters.length>0&&null==this._currentPendingFilter&&(this._currentPendingFilter=this._element.querySelector("#filter-"+this._pendingFilters.pop()),this._currentPendingFilter&&this._currentPendingFilter.showUp(!0).then((()=>{this._currentPendingFilter=void 0,this.processPendingFilter()}))),null==this._currentPendingFilter&&this.processAfterUpdateConfig()}processAfterUpdateConfig(){this._pendingFilters.length>0||(this._loadingPending&&(this._loadingPending=!1,this.dataUnit.loadData()),this._configUpdated&&(this._configUpdated=!1,this._application.saveFilterBarConfig(this.filterConfig,this.configName)))}getMessage(t,e){return this._application.messagesBuilder.getMessage(t,e)}getFilter(t){var e;const i=[];return null===(e=this.filterConfig)||void 0===e||e.filter((t=>this.isActiveFilter(t))).forEach((t=>{const e=(t=>{switch(t.type){case f.DEFAULT_FILTER:return function(t){return{name:t.id,expression:t.props.expression,params:[]}}(t);case f.BINARY_SELECT:return function(t){const{id:e,value:i,props:s}=t;return{name:e,expression:s.options.find((t=>t.name===i)).expression,params:[]}}(t);case f.MULTI_SELECT:return function(t){const{id:e,value:i,props:s}=t;return{name:e,expression:s.expression,params:[{name:e,dataType:l.TEXT,value:i}]}}(t);case f.PERIOD:return function(t){const{id:e,value:i,props:s}=t;let{end:r,start:a}=i;"string"==typeof r&&(r=new Date(r)),"string"==typeof a&&(a=new Date(a));const n=[];let o;return r&&a?(o=s.expression.fullfill,n.push({name:`${e}.START`,dataType:l.DATE,value:b(l.DATE,a)},{name:`${e}.END`,dataType:l.DATE,value:b(l.DATE,r)})):a?(o=s.expression.onlystart,n.push({name:e,dataType:l.DATE,value:b(l.DATE,a)})):(o=s.expression.onlyend,n.push({name:e,dataType:l.DATE,value:b(l.DATE,r)})),{name:e,expression:o,params:n}}(t);case f.SEARCH:return function(t){const{id:e,value:i,props:s}=t;return{name:e,expression:s.expression,params:[{name:e,dataType:l.TEXT,value:b(l.TEXT,i.value)}]}}(t);case f.TEXT:return function(t){const{id:e,value:i,props:s}=t;return{name:e,expression:s.expression,params:[{name:e,dataType:l.TEXT,value:b(l.TEXT,i)}]}}(t);case f.NUMBER:return function(t){const{id:e,value:i,props:s}=t;return{name:e,expression:s.expression,params:[{name:e,dataType:l.NUMBER,value:b(l.NUMBER,i)}]}}(t);case f.PERSONALIZED:return function(t){var e;const{id:i,value:s,props:r}=t;return{name:i,expression:r.expression,params:((null===(e=r.personalizedFilter)||void 0===e?void 0:e.parameters)||[]).map(((t,e)=>{const i=Array.from(s),r=t.dataType;let a=e>=0&&e<i.length?i[e]:null;return null!=a&&"object"==typeof a&&"value"in a&&(a=a.value),null==a&&r===l.BOOLEAN&&(a=!1),{name:t.name,dataType:r,value:"string"==typeof a?a:b(r,a)}}))}}(t);default:return}})(t);e&&i.push(e)})),i}isActiveFilter(t){return t.visible&&null!=t.value||t.type===f.DEFAULT_FILTER}registryFilterProvider(){this.dataUnit.addFilterProvider(this),this.filterConfig&&this.dataUnit.loadData()}getFilterItems(){const t=[],i=[];this.filterConfig.filter((t=>t.visible)).forEach(((s,r)=>{const l=e("snk-filter-item",{id:`filter-${s.id}`,config:s,class:r>0?"ez-padding-left--medium":"",getMessage:(t,e)=>this.getMessage(t,e),key:s.id});return s.fixed||s.hardFixed?t.push(l):i.push(l),l}));const s=[];return s.push(...t),t.length>0&&i.length>0&&s.push(e("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-filter-bar__divider"})),s.push(...i),s}calculateUpdateSequence(t){t&&(this._updateSequence=this._updateSequence.filter((e=>t.id!==e)),this._updateSequence.push(t.id))}normalizeItem(t){const e=Object.assign({},t);return["props","value","hardFixed","fixed"].forEach((t=>{null==e[t]&&delete e[t]})),""===t.value&&delete t.value,e}updateFilter(t){this.filterConfig=this.filterConfig.map((e=>(t=this.normalizeItem(t),e.id===t.id?(a.objectToString(e)!=a.objectToString(t)&&this.calculateUpdateSequence(t),t):e))).sort(((t,e)=>this._filtersComparator(t,e)))}getAddListItems(){const t=this.filterConfig.filter((t=>!t.visible&&this.isListable(t))),e=[{name:"PERSONALIZED_FILTER",label:this.getMessage("snkFilterBar.customFilter"),iconName:"tune",kind:"FOOTER"}];return this.allowDefault&&e.push({name:"DEFAULT_FILTER",label:this.getMessage("snkFilterBar.defaultFilter"),iconName:"configuration",kind:"FOOTER"}),t.map((t=>({name:t.id,label:t.label,kind:"FILTER",iconName:null}))).concat(e)}getActiveClass(){return this.filterConfig.filter((t=>null!=t.value)).length>0?"sc-snk-filter-bar snk-filter-bar__filter-list-items-button--active":""}isListable(t,e=!1){return t.type!==f.DEFAULT_FILTER&&(e||t.type!==f.PERSONALIZED)}getAppliedListItems(){return this.filterConfig.filter((t=>this.isActiveFilter(t)&&this.isListable(t,!0))).map((t=>({name:t.id,label:t.label,kind:"FILTER",iconName:null}))).concat([{name:"CLEAR_ALL_FILTERS",label:this.getMessage("snkFilterBar.clearAllFilters"),iconName:"cleaning",kind:"FOOTER"}])}addPersonalizedFilters(t){const e={};t.forEach((t=>{t.active&&(e[t.id]=!0)})),this.filterConfig=this.filterConfig.map((t=>{var i,s;if(t.type===f.PERSONALIZED){const r=e[t.id];return!t.visible&&r&&(this.calculateUpdateSequence(t),null!=(null===(s=null===(i=t.props)||void 0===i?void 0:i.personalizedFilter)||void 0===s?void 0:s.parameters)&&this._pendingFilters.push(t.id)),this.normalizeItem(Object.assign(Object.assign({},t),r?{visible:r}:{visible:r,value:void 0,fixed:void 0}))}return t})).sort(((t,e)=>this._filtersComparator(t,e)))}openDefaultFilterModal(){const t=document.createElement("snk-filter-modal"),e=this.filterConfig.filter((t=>t.type===f.DEFAULT_FILTER));t.getMessage=(t,e)=>this.getMessage(t,e),t.modalTitle=this.getMessage("snkFilterBar.modalDefaultFilterTitle"),t.infoText=this.getMessage(0==e.length?"snkFilterBar.modalInfoTextCreateDefault":"snkFilterBar.modalInfoTextEditDefault"),t.items=e.map((t=>({id:t.id,active:!0,enabled:!1,label:t.label}))),t.processModalAction=()=>{this._application.closeModal()},this._application.showModal(t)}openPersonalizedModal(){const t=document.createElement("snk-filter-modal"),e=this.filterConfig.filter((t=>t.type===f.PERSONALIZED)).sort(((t,e)=>n.compare(t.label,e.label)));t.getMessage=(t,e)=>this.getMessage(t,e),t.modalTitle=this.getMessage("snkFilterBar.modalPersonalizedFilterTitle"),t.modalSubTitle=this.getMessage("snkFilterBar.modalPersonalizedFilterSubTitle"),t.okButtonLabel=this.getMessage("snkFilterBar.modalOkButtonLabel"),t.cancelButtonLabel=this.getMessage("snkFilterBar.modalCancelButtonLabel"),t.infoText=this.getMessage("snkFilterBar.modalInfoTextCreateEditPersonalized"),t.useSearch=!0,t.items=e.map((t=>({id:t.id,active:t.visible,enabled:!0,label:t.label}))),t.processModalAction=e=>{e===m.CANCEL?t.items=t.items.map((t=>Object.assign(Object.assign({},t),{active:!1}))):(e===m.OK&&this.addPersonalizedFilters(t.items),this._application.closeModal())},this._application.showModal(t)}clearFilters(){let t=!1;return this.filterConfig=this.filterConfig.map((e=>(null!=e.value&&(t=!0),Object.assign(Object.assign({},e),{value:void 0})))).sort(((t,e)=>this._filtersComparator(t,e))),t}loadPermitions(){this._application.isUserSup().then((t=>this.allowDefault=t))}loadConfigFromApplication(){this._application.getFilterBarConfig(this.configName).then((t=>{this.filterConfig=t.map((t=>this.normalizeItem(t))),this.dataUnit&&this.dataUnit.loadData()})).catch((t=>{throw new o(this.getMessage("snkFilterBar.failToLoadConfig"),t)}))}attachDataUnit(){if(null==this.dataUnit){let t=this._element.parentElement;for(;t;)if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){const e=t;this.dataUnit=e.dataUnit,this.dataUnit?this.registryFilterProvider():e.addEventListener("dataUnitReady",(t=>{this.dataUnit=t.detail,this.registryFilterProvider()}));break}t=t.parentElement}else this.registryFilterProvider()}filterChangeListener(t){this.updateFilter(t.detail)}addFilterHandler(t){const e=this.filterConfig.find((e=>e.id===t));"PERSONALIZED_FILTER"===t?this.openPersonalizedModal():"DEFAULT_FILTER"===t?this.openDefaultFilterModal():e&&(this.updateFilter(Object.assign(Object.assign({},e),{visible:!0})),window.requestAnimationFrame((()=>{const e=this._element.querySelector("#filter-"+t);e&&e.showUp()})))}appliedFilterHandler(t){if("CLEAR_ALL_FILTERS"===t)this.clearFilters()&&this._application.info(this.getMessage("snkFilterBar.successfullyCleaned"),{iconName:"check"});else{const e=this._element.querySelector("#filter-"+t);e&&e.showUp(!0)}}componentWillLoad(){this._application=h.getContextValue("__SNK__APPLICATION__"),this._application&&(this.loadPermitions(),this.loadConfigFromApplication()),this.attachDataUnit()}componentDidRender(){this.processPendingFilter()}render(){if(this.dataUnit&&this.filterConfig&&0!==this.filterConfig.length)return e(i,null,e("ez-scroller",{direction:"horizontal"},this.getFilterItems()),e("snk-filter-list",{items:this.getAppliedListItems(),getMessage:(t,e)=>this.getMessage(t,e),emptyText:this.getMessage("snkFilterBar.emptyAppliedFiltersList"),findFilterText:this.getMessage("snkFilterBar.findFilter"),iconName:"filter",class:"ez-padding-left--medium",buttonClass:this.getActiveClass(),onSnkItemSelected:t=>this.appliedFilterHandler(t.detail)}),e("snk-filter-list",{items:this.getAddListItems(),label:this.getMessage("snkFilterBar.addFilter"),getMessage:(t,e)=>this.getMessage(t,e),emptyText:this.getMessage("snkFilterBar.emptyFiltersList"),findFilterText:this.getMessage("snkFilterBar.findField"),class:"ez-padding-left--medium",onSnkItemSelected:t=>this.addFilterHandler(t.detail)},e("ez-icon",{slot:"leftIcon",class:"ez-padding-right--small",iconName:"plus"})))}get _element(){return s(this)}static get watchers(){return{filterConfig:["observeFilterConfig"]}}};F.style='.sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--more-visible, 1);background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;flex-grow:0}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px)}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.preselected.sc-snk-filter-bar{background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:"";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{display:flex;flex-direction:row;border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium);width:100%}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:100%;height:100%}';const x=class{constructor(e){t(this,e),this.filterChange=r(this,"filterChange",7),this.innerClickCheck=(t,e)=>{if(this._popover.keepOpened)return!0;if(e&&t){if(!e.offsetParent)return!0;let i=e;do{if(i===t)return!0}while(null!=(i=i.offsetParent))}return this.detailIsVisible=!1,this.executeCloseCallback(),!1}}async showUp(t=!1){return new Promise((e=>{this._filterItemElement.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"}),t&&window.requestAnimationFrame((()=>{this._closeCallback=e,this.showDetail()}))}))}showDetail(){this._floatingID=c.float(this._popover,this._popoverContainer,{autoClose:!0,innerClickTest:this.innerClickCheck,left:this.getScrollOffset()}),this.detailIsVisible=!0}getScrollOffset(){return`${this._filterItemElement.getBoundingClientRect().left+12}px`}hideDetail(){null!=this._floatingID&&c.close(this._floatingID),this._floatingID=void 0,this.detailIsVisible=!1,this.executeCloseCallback()}executeCloseCallback(){this._closeCallback&&(this._closeCallback(),this._closeCallback=void 0)}clickListener(t){[this._chipElement,this._leftIconElement,this._rightIconElement].includes(t.target)&&(t.target===this._rightIconElement&&null!=this.config.value?this.filterChange.emit(Object.assign(Object.assign({},this.config),{value:void 0})):this.detailIsVisible?this.hideDetail():this.showDetail(),t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation())}mouseDownListener(t){this.detailIsVisible&&[this._chipElement,this._leftIconElement,this._rightIconElement].includes(t.target)&&(t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation())}getLabel(){const{type:t,value:e,label:i,props:s}=this.config;if(e){if(t===f.BINARY_SELECT){const[t,i]=s.options;if(t.name===e)return t.label;if(i.name===e)return i.label}if(t===f.MULTI_SELECT)return`${i}: ${s.options.find((t=>t.value===e)).label}`;if(t===f.PERIOD){let{end:t,start:s}=e;"string"==typeof t&&(t=new Date(t),t.setMinutes(t.getMinutes()+t.getTimezoneOffset())),"string"==typeof s&&(s=new Date(s),s.setMinutes(s.getMinutes()+s.getTimezoneOffset()));const r=new Intl.DateTimeFormat("pt-BR");return t&&s?`${i}: ${r.format(s)} a ${r.format(t)}`:s?`${i}: A partir de ${r.format(s)}`:t?`${i}: Até ${r.format(t)}`:i}return t===f.SEARCH?`${i}: ${e.value} - ${e.label}`:t===f.PERSONALIZED?i:`${i}: ${e}`}return i}componentDidRender(){null==this._floatingID&&this._popover&&this._popover.remove()}filterChangeListener(){this.hideDetail()}getRightIconName(){return null!=this.config.value?"close":this.detailIsVisible?"chevron-up":"chevron-down"}getLeftIconName(){switch(this.config.type){case f.PERIOD:return"calendar";case f.PERSONALIZED:return"tune"}}render(){const t=this.getLeftIconName();return e(i,null,e("ez-chip",{ref:t=>this._chipElement=t,label:this.getLabel(),value:null!=this.config.value},t?e("ez-icon",{ref:t=>this._leftIconElement=t,iconName:t,class:"ez-padding-right--small",slot:"leftIcon"}):void 0,e("ez-icon",{ref:t=>this._rightIconElement=t,iconName:this.getRightIconName(),class:"ez-padding-left--small",slot:"rightIcon"})),e("section",{class:"ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container",ref:t=>this._popoverContainer=t},e("snk-filter-detail",{config:this.config,getMessage:this.getMessage,class:"sc-snk-filter-bar snk-filter__popover ez-padding--small",ref:t=>this._popover=t,key:this.config.id})))}get _filterItemElement(){return s(this)}},z=class{constructor(e){t(this,e),this.snkItemSelected=r(this,"snkItemSelected",7),this.innerClickCheck=(t,e)=>{if(e&&t){if(!e.offsetParent)return!0;let i=e;do{if(i===t||i===this._element)return!0}while(null!=(i=i.offsetParent))}return this._detailIsVisible=!1,!1}}showList(){this._floatingID=c.float(this._popover,this._popoverContainer,{autoClose:!0,innerClickTest:this.innerClickCheck}),this._detailIsVisible=!0,this._showAll=!1,this._filterArgument=""}hideList(){null!=this._floatingID&&c.close(this._floatingID),this._floatingID=void 0,this._detailIsVisible=!1}buttonClick(){this._detailIsVisible?this.hideList():this.showList()}componentDidRender(){null==this._floatingID&&this._popover&&this._popover.remove()}buildItemElement(t){return e("div",{class:"ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item",onClick:()=>this.itemSelected(t.name)},t.iconName?e("ez-icon",{iconName:t.iconName,size:"small",class:`ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${t.iconClass||""}`}):void 0,e("div",{class:`ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${t.labelClass||""}`},t.label))}itemSelected(t){"__SHOWMORE__"===t?this._showAll=!0:(this.hideList(),this.snkItemSelected.emit(t))}getFilterItems(){const t=this.items?d.applyStringFilter(this._filterArgument,this.items.filter((t=>"FILTER"===t.kind))):[];return 0===t.length?e("div",{class:"ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-items-container--empty"},this.emptyText):(!this._filterArgument&&!this._showAll&&t.length>6&&(t.splice(5),t.push({kind:"INTERNAL",label:"Mostrar mais",iconName:"dots-horizontal",name:"__SHOWMORE__",iconClass:"snk-filter-bar__filter-list-item__icon--secondary",labelClass:"snk-filter-bar__filter-list-item__label--secondary"})),e("div",{class:"sc-snk-filter-bar snk-filter-bar__filter-list-items-container"},t.map((t=>this.buildItemElement(t)))))}getFooterItems(){return this.items.filter((t=>"FOOTER"===t.kind))}render(){return e(i,{class:"ez-flex ez-flex--column"},e("ez-button",{class:this.buttonClass,label:this.label,onClick:()=>this.buttonClick(),mode:this.iconName?"icon":void 0,iconName:this.iconName,size:"small"},e("slot",{name:"leftIcon"})),e("section",{class:"ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container",ref:t=>this._popoverContainer=t},e("div",{class:"sc-snk-filter-bar snk-filter__popover ez-padding--small",ref:t=>this._popover=t},e("ez-filter-input",{ref:t=>this._filterInput=t,mode:"slim",label:this.findFilterText,value:this._filterArgument,onEzChange:t=>this._filterArgument=t.detail}),this.getFilterItems(),e("hr",{class:"sc-snk-filter-bar snk-filter__popover-rule"}),this.items?this.getFooterItems().map((t=>this.buildItemElement(t))):void 0)))}get _element(){return s(this)}},T=class{constructor(e){t(this,e)}updateValue(t,e){this.items=this.items.map((i=>i.id===t?Object.assign(Object.assign({},i),{active:e}):i))}getActiveFiltersMsg(){const t=this.items.filter((t=>t.active)).length;return 0===t?this.getMessage("snkFilterBar.noActiveFilters"):this.getMessage(t>1?"snkFilterBar.activeFilters":"snkFilterBar.activeFilter",{ACTIVE_FILTERS:t})}getFilteredItems(){return this.items?d.applyStringFilter(this._filterArgument,this.items):[]}render(){const t=this.items.filter((t=>t.active)).length>0;return e("ez-modal-container",{modalTitle:this.modalTitle,modalSubTitle:this.modalSubTitle,cancelButtonLabel:this.cancelButtonLabel,okButtonLabel:this.okButtonLabel,onEzModalAction:t=>this.processModalAction(t.detail),cancelButtonStatus:t?u.ENABLED:u.DISABLED},e("div",{class:"sc-snk-filter-bar snk-filter-bar__filter-modal-content"},e("div",null,this.useSearch?e("ez-filter-input",{label:this.getMessage("snkFilterBar.modalFindFilter"),onEzChange:t=>this._filterArgument=t.detail}):void 0),this.getFilteredItems().length>0?e("div",{class:"ez-text ez-text--medium ez-text--primary ez-padding-bottom--small"},this.getActiveFiltersMsg()):void 0,e("div",null,this.getFilteredItems().map((t=>e("div",{class:"ez-padding--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item ez-align--middle ez-margin-bottom--small"},e("ez-check",{class:"sc-snk-filter-bar snk-filter-bar__filter-modal-item__check",onEzChange:e=>this.updateValue(t.id,e.detail),enabled:t.enabled,value:t.active,mode:"switch"}),e("div",{class:"ez-text ez-title--primary ez-text--medium ez-margin-left--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item__label"},t.label))))),e("div",{class:"ez-text ez-text--large ez-align--middle ez-text--secondary ez-text--center ez-padding-bottom--large"},this.infoText)))}},y=class{constructor(e){t(this,e),this.actionClick=r(this,"actionClick",7),this._titleKeyByElement={[k.UPDATE]:"snkTaskbar.titleUpdate",[k.PREVIOUS]:"snkTaskbar.titlePrevious",[k.NEXT]:"snkTaskbar.titleNext",[k.REFRESH]:"snkTaskbar.titleRefresh",[k.CLONE]:"snkTaskbar.titleClone",[k.REMOVE]:"snkTaskbar.titleRemove",[k.MORE_OPTIONS]:"snkTaskbar.titleMoreOptions",[k.INSERT]:"snkTaskbar.titleInsert",[k.CANCEL]:"snkTaskbar.titleCancel",[k.SAVE]:"snkTaskbar.titleSave",[k.GRID_MODE]:"snkTaskbar.titleGridMode",[k.CONFIG_GRID]:"snkTaskbar.titleConfigGrid",[k.FORM_MODE]:"snkTaskbar.titleFormMode"}}observeButtons(){this._definitions=void 0}elementsFromString(t){const e=[];return t&&t.split(",").forEach((t=>{t=t.trim(),(p[t]||this.isAllowed(t))&&e.push(t.trim())})),e}isAllowed(t){return!_[t]||!!this._permissions&&(this._permissions.isSup||this._permissions[t])}getTitle(t){let e;return e=this.isAllowed(t)?this._titleKeyByElement[t]:"snkTaskbar.forbidden",e?this._application.messagesBuilder.getMessage(e,{}):""}elementClick(t){if(this.dataUnit)switch(t){case k.PREVIOUS:this.dataUnit.previousRecord();break;case k.NEXT:this.dataUnit.nextRecord();break;case k.REFRESH:this.dataUnit.loadData();break;case k.CLONE:this.dataUnit.copySelected();break;case k.REMOVE:this.dataUnit.removeSelectedRecords();break;case k.INSERT:this.dataUnit.addRecord();break;case k.CANCEL:this.dataUnit.cancelEdition();break;case k.SAVE:this.dataUnit.saveData()}this.actionClick.emit(t)}isEnabled(t){return!(!this.isAllowed(t)||this.disabledButtons&&this.disabledButtons.includes(t))}getElement(t,e){let i=e===this.primaryButton?"ez-button--primary ":"";return t>1&&(i+="ez-padding-left--medium"),k[e.toString()]?v(e,i,(t=>this.getTitle(t)),(t=>this.elementClick(t)),(t=>this.isEnabled(t)),this.actionsList):g(e,i,(t=>this.elementClick(t)),(t=>this.isEnabled(t)))}componentWillLoad(){this._application=h.getContextValue("__SNK__APPLICATION__"),this._application?this._application.getAllAccess().then((t=>this._permissions=t)):this._permissions={}}componentWillRender(){null==this._definitions&&this._permissions&&(this._definitions=this.elementsFromString(this.buttons))}render(){if(void 0===this._definitions)return;let t=0;return e(i,null,this._definitions.map((i=>(i===k.DIVIDER?t=0:t++,k[i]?this.getElement(t,k[i]):this.customButtons.has(i)?this.getElement(t,this.customButtons.get(i)):e("slot",{name:i})))))}static get watchers(){return{buttons:["observeButtons"]}}};y.style=".sc-snk-taskbar-h{display:flex}";export{F as snk_filter_bar,x as snk_filter_item,z as snk_filter_list,T as snk_filter_modal,y as snk_taskbar}
@@ -0,0 +1,2 @@
1
+ let e,t,n,l=!1,o=!1,s=!1,i=!1;const c={},r=e=>"object"==(e=typeof e)||"function"===e,f=(e,t,...n)=>{let l=null,o=null,s=null,i=!1,c=!1;const f=[],u=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?u(l):null!=l&&"boolean"!=typeof l&&((i="function"!=typeof e&&!r(l))&&(l+=""),i&&c?f[f.length-1].t+=l:f.push(i?a(null,l):l),c=i)};if(u(n),t){t.key&&(o=t.key),t.name&&(s=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,f,d);const $=a(e,null);return $.l=t,f.length>0&&($.o=f),$.i=o,$.u=s,$},a=(e,t)=>({$:0,h:e,t,m:null,o:null,l:null,i:null,u:null}),u={},d={forEach:(e,t)=>e.map($).forEach(t),map:(e,t)=>e.map($).map(t).map(y)},$=e=>({vattrs:e.l,vchildren:e.o,vkey:e.i,vname:e.u,vtag:e.h,vtext:e.t}),y=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),f(e.vtag,t,...e.vchildren||[])}const t=a(e.vtag,e.vtext);return t.l=e.vattrs,t.o=e.vchildren,t.i=e.vkey,t.u=e.vname,t},h=e=>ee(e).p,m=(e,t,n)=>{const l=h(e);return{emit:e=>p(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},p=(e,t,n)=>{const l=ae.ce(t,n);return e.dispatchEvent(l),l},b=new WeakMap,w=e=>"sc-"+e.k,k=(e,t,n,l,o,s)=>{if(n!==l){let i=le(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=g(n),s=g(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("key"===t);else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const c=r(l);if((i||c&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&s||o)&&!c&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):le(re,c)?c.slice(2):c[2]+t.slice(3),n&&ae.rel(e,t,n,!1),l&&ae.ael(e,t,l,!1)}},v=/\s/,g=e=>e?e.split(v):[],S=(e,t,n,l)=>{const o=11===t.m.nodeType&&t.m.host?t.m.host:t.m,s=e&&e.l||c,i=t.l||c;for(l in s)l in i||k(o,l,s[l],void 0,n,t.$);for(l in i)k(o,l,s[l],i[l],n,t.$)},j=(o,i,c,r)=>{const f=i.o[c];let a,u,d,$=0;if(l||(s=!0,"slot"===f.h&&(e&&r.classList.add(e+"-s"),f.$|=f.o?2:1)),null!==f.t)a=f.m=fe.createTextNode(f.t);else if(1&f.$)a=f.m=fe.createTextNode("");else if(a=f.m=fe.createElement(2&f.$?"slot-fb":f.h),S(null,f,!1),null!=e&&a["s-si"]!==e&&a.classList.add(a["s-si"]=e),f.o)for($=0;$<f.o.length;++$)u=j(o,f,$,a),u&&a.appendChild(u);return a["s-hn"]=n,3&f.$&&(a["s-sr"]=!0,a["s-cr"]=t,a["s-sn"]=f.u||"",d=o&&o.o&&o.o[c],d&&d.h===f.h&&o.m&&C(o.m,!1)),a},C=(e,t)=>{ae.$|=1;const l=e.childNodes;for(let e=l.length-1;e>=0;e--){const o=l[e];o["s-hn"]!==n&&o["s-ol"]&&(T(o).insertBefore(o,P(o)),o["s-ol"].remove(),o["s-ol"]=void 0,s=!0),t&&C(o,t)}ae.$&=-2},M=(e,t,l,o,s,i)=>{let c,r=e["s-cr"]&&e["s-cr"].parentNode||e;for(r.shadowRoot&&r.tagName===n&&(r=r.shadowRoot);s<=i;++s)o[s]&&(c=j(null,l,s,e),c&&(o[s].m=c,r.insertBefore(c,P(t))))},O=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.m,A(l),o=!0,s["s-ol"]?s["s-ol"].remove():C(s,!0),s.remove())},R=(e,t)=>e.h===t.h&&("slot"===e.h?e.u===t.u:e.i===t.i),P=e=>e&&e["s-ol"]||e,T=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,x=(e,t)=>{const n=t.m=e.m,l=e.o,o=t.o,s=t.t;let i;null===s?("slot"===t.h||S(e,t,!1),null!==l&&null!==o?((e,t,n,l)=>{let o,s,i=0,c=0,r=0,f=0,a=t.length-1,u=t[0],d=t[a],$=l.length-1,y=l[0],h=l[$];for(;i<=a&&c<=$;)if(null==u)u=t[++i];else if(null==d)d=t[--a];else if(null==y)y=l[++c];else if(null==h)h=l[--$];else if(R(u,y))x(u,y),u=t[++i],y=l[++c];else if(R(d,h))x(d,h),d=t[--a],h=l[--$];else if(R(u,h))"slot"!==u.h&&"slot"!==h.h||C(u.m.parentNode,!1),x(u,h),e.insertBefore(u.m,d.m.nextSibling),u=t[++i],h=l[--$];else if(R(d,y))"slot"!==u.h&&"slot"!==h.h||C(d.m.parentNode,!1),x(d,y),e.insertBefore(d.m,u.m),d=t[--a],y=l[++c];else{for(r=-1,f=i;f<=a;++f)if(t[f]&&null!==t[f].i&&t[f].i===y.i){r=f;break}r>=0?(s=t[r],s.h!==y.h?o=j(t&&t[c],n,r,e):(x(s,y),t[r]=void 0,o=s.m),y=l[++c]):(o=j(t&&t[c],n,c,e),y=l[++c]),o&&T(u.m).insertBefore(o,P(u.m))}i>a?M(e,null==l[$+1]?null:l[$+1].m,n,l,c,$):c>$&&O(t,i,a)})(n,l,t,o):null!==o?(null!==e.t&&(n.textContent=""),M(n,null,t,o,0,o.length-1)):null!==l&&O(l,0,l.length-1)):(i=n["s-cr"])?i.parentNode.textContent=s:e.t!==s&&(n.data=s)},E=e=>{const t=e.childNodes;let n,l,o,s,i,c;for(l=0,o=t.length;l<o;l++)if(n=t[l],1===n.nodeType){if(n["s-sr"])for(i=n["s-sn"],n.hidden=!1,s=0;s<o;s++)if(c=t[s].nodeType,t[s]["s-hn"]!==n["s-hn"]||""!==i){if(1===c&&i===t[s].getAttribute("slot")){n.hidden=!0;break}}else if(1===c||3===c&&""!==t[s].textContent.trim()){n.hidden=!0;break}E(n)}},L=[],N=e=>{let t,n,l,s,i,c,r=0;const f=e.childNodes,a=f.length;for(;r<a;r++){if(t=f[r],t["s-sr"]&&(n=t["s-cr"])&&n.parentNode)for(l=n.parentNode.childNodes,s=t["s-sn"],c=l.length-1;c>=0;c--)n=l[c],n["s-cn"]||n["s-nr"]||n["s-hn"]===t["s-hn"]||(W(n,s)?(i=L.find((e=>e.v===n)),o=!0,n["s-sn"]=n["s-sn"]||s,i?i.g=t:L.push({g:t,v:n}),n["s-sr"]&&L.map((e=>{W(e.v,n["s-sn"])&&(i=L.find((e=>e.v===n)),i&&!e.g&&(e.g=i.g))}))):L.some((e=>e.v===n))||L.push({v:n}));1===t.nodeType&&N(t)}},W=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,A=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(A)},D=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},F=(e,t)=>{if(e.$|=16,!(4&e.$))return D(e,e.j),we((()=>H(e,t)));e.$|=512},H=(e,t)=>{const n=e.C;let l;return t&&(e.$|=256,e.M&&(e.M.map((([e,t])=>z(n,e,t))),e.M=null),l=z(n,"componentWillLoad")),l=B(l,(()=>z(n,"componentWillRender"))),B(l,(()=>U(e,n,t)))},U=async(e,t,n)=>{const l=e.p,o=l["s-rc"];n&&(e=>{const t=e.O,n=e.p,l=t.$,o=((e,t)=>{let n=w(t);const l=ce.get(n);if(e=11===e.nodeType?e:fe,l)if("string"==typeof l){let t,o=b.get(e=e.head||e);o||b.set(e,o=new Set),o.has(n)||(t=fe.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"),2&l&&n.classList.add(o+"-s"))})(e);q(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>V(e);0===t.length?n():(Promise.all(t).then(n),e.$|=4,t.length=0)}},q=(i,c)=>{try{c=c.render(),i.$&=-17,i.$|=2,((i,c)=>{const r=i.p,d=i.O,$=i.R||a(null,null),y=(e=>e&&e.h===u)(c)?c:f(null,null,c);if(n=r.tagName,d.P&&(y.l=y.l||{},d.P.map((([e,t])=>y.l[t]=r[e]))),y.h=null,y.$|=4,i.R=y,y.m=$.m=r.shadowRoot||r,e=r["s-sc"],t=r["s-cr"],l=0!=(1&d.$),o=!1,x($,y),ae.$|=1,s){let e,t,n,l,o,s;N(y.m);let i=0;for(;i<L.length;i++)e=L[i],t=e.v,t["s-ol"]||(n=fe.createTextNode(""),n["s-nr"]=t,t.parentNode.insertBefore(t["s-ol"]=n,t));for(i=0;i<L.length;i++)if(e=L[i],t=e.v,e.g){for(l=e.g.parentNode,o=e.g.nextSibling,n=t["s-ol"];n=n.previousSibling;)if(s=n["s-nr"],s&&s["s-sn"]===t["s-sn"]&&l===s.parentNode&&(s=s.nextSibling,!s||!s["s-nr"])){o=s;break}(!o&&l!==t.parentNode||t.nextSibling!==o)&&t!==o&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),l.insertBefore(t,o))}else 1===t.nodeType&&(t.hidden=!0)}o&&E(y.m),ae.$&=-2,L.length=0})(i,c)}catch(e){oe(e,i.p)}return null},V=e=>{const t=e.p,n=e.C,l=e.j;z(n,"componentDidRender"),64&e.$||(e.$|=64,G(t),z(n,"componentDidLoad"),e.T(t),l||_()),e.L(t),e.S&&(e.S(),e.S=void 0),512&e.$&&be((()=>F(e,!1))),e.$&=-517},_=()=>{G(fe.documentElement),be((()=>p(re,"appload",{detail:{namespace:"sankhyablocks"}})))},z=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){oe(e)}},B=(e,t)=>e&&e.then?e.then(t):t(),G=e=>e.classList.add("hydrated"),I=(e,t,n)=>{if(t.N){e.watchers&&(t.W=e.watchers);const l=Object.entries(t.N),o=e.prototype;if(l.map((([e,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(o,e,{get(){return((e,t)=>ee(this).A.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=ee(e),s=o.p,i=o.A.get(t),c=o.$,f=o.C;if(n=((e,t)=>null==e||r(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.N[t][0]),(!(8&c)||void 0===i)&&n!==i&&(!Number.isNaN(i)||!Number.isNaN(n))&&(o.A.set(t,n),f)){if(l.W&&128&c){const e=l.W[t];e&&e.map((e=>{try{f[e](n,i,t)}catch(e){oe(e,s)}}))}2==(18&c)&&F(o,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(o,e,{value(...t){const n=ee(this);return n.D.then((()=>n.C[e](...t)))}})})),1&n){const n=new Map;o.attributeChangedCallback=function(e,t,l){ae.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(o.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const o=l[1]||e;return n.set(o,e),512&l[0]&&t.P.push([e,o]),o}))}}return e},J=e=>{z(e,"connectedCallback")},K=(e,t={})=>{const n=[],l=t.exclude||[],o=re.customElements,s=fe.head,i=s.querySelector("meta[charset]"),c=fe.createElement("style"),r=[];let f,a=!0;Object.assign(ae,t),ae.F=new URL(t.resourcesUrl||"./",fe.baseURI).href,e.map((e=>{e[1].map((t=>{const s={$:t[0],k:t[1],N:t[2],H:t[3]};s.N=t[2],s.H=t[3],s.P=[],s.W={};const i=s.k,c=class extends HTMLElement{constructor(e){super(e),ne(e=this,s),1&s.$&&e.attachShadow({mode:"open"})}connectedCallback(){f&&(clearTimeout(f),f=null),a?r.push(this):ae.jmp((()=>(e=>{if(0==(1&ae.$)){const t=ee(e),n=t.O,l=()=>{};if(1&t.$)Q(e,t,n.H),J(t.C);else{t.$|=1,12&n.$&&(e=>{const t=e["s-cr"]=fe.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)})(e);{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){D(t,t.j=n);break}}n.N&&Object.entries(n.N).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,o)=>{if(0==(32&t.$)){{if(t.$|=32,(o=ie(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(n.W=o.watchers,I(o,n,2),o.isProxied=!0);const e=()=>{};t.$|=8;try{new o(t)}catch(e){oe(e)}t.$&=-9,t.$|=128,e(),J(t.C)}if(o.style){let e=o.style;const t=w(n);if(!ce.has(t)){const l=()=>{};((e,t,n)=>{let l=ce.get(e);de&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,ce.set(e,l)})(t,e,!!(1&n.$)),l()}}}const s=t.j,i=()=>F(t,!0);s&&s["s-rc"]?s["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){ae.jmp((()=>(()=>{if(0==(1&ae.$)){const e=ee(this),t=e.C;e.U&&(e.U.map((e=>e())),e.U=void 0),z(t,"disconnectedCallback")}})()))}componentOnReady(){return ee(this).q}};s.V=e[0],l.includes(i)||o.get(i)||(n.push(i),o.define(i,I(c,s,1)))}))})),c.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",c.setAttribute("data-styles",""),s.insertBefore(c,i?i.nextSibling:s.firstChild),a=!1,r.length?r.map((e=>e.connectedCallback())):ae.jmp((()=>f=setTimeout(_,30)))},Q=(e,t,n)=>{n&&n.map((([n,l,o])=>{const s=e,i=X(t,o),c=Y(n);ae.ael(s,l,i,c),(t.U=t.U||[]).push((()=>ae.rel(s,l,i,c)))}))},X=(e,t)=>n=>{try{256&e.$?e.C[t](n):(e.M=e.M||[]).push([t,n])}catch(e){oe(e)}},Y=e=>0!=(2&e),Z=new WeakMap,ee=e=>Z.get(e),te=(e,t)=>Z.set(t.C=e,t),ne=(e,t)=>{const n={$:0,p:e,O:t,A:new Map};return n.D=new Promise((e=>n.L=e)),n.q=new Promise((e=>n.T=e)),e["s-p"]=[],e["s-rc"]=[],Q(e,n,t.H),Z.set(e,n)},le=(e,t)=>t in e,oe=(e,t)=>(0,console.error)(e,t),se=new Map,ie=e=>{const t=e.k.replace(/-/g,"_"),n=e.V,l=se.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(se.set(n,e),e[t])),oe)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},ce=new Map,re="undefined"!=typeof window?window:{},fe=re.document||{head:{}},ae={$:0,F:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},ue=e=>Promise.resolve(e),de=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),$e=[],ye=[],he=(e,t)=>n=>{e.push(n),i||(i=!0,t&&4&ae.$?be(pe):ae.raf(pe))},me=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){oe(e)}e.length=0},pe=()=>{me($e),me(ye),(i=$e.length>0)&&ae.raf(pe)},be=e=>ue().then(e),we=he(ye,!0);export{u as H,K as b,m as c,h as g,f as h,ue as p,te as r}
@@ -0,0 +1 @@
1
+ import{r as s,h as t}from"./p-fac2b6a9.js";import{F as e}from"./p-9dd2b8cb.js";const i=class{constructor(t){s(this,t)}ezChangeListener(s){this.value=s.detail.value}render(){if(this.config&&this.config.type===e.MULTI_SELECT)return t("ez-combo-box",{label:this.config.label,value:this.config.value,options:this.config.props.options})}};export{i as snk_filter_multi_select}