@sankhyalabs/sankhyablocks 8.16.0-rc.3 → 8.16.0-rc.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. package/dist/cjs/{ConfigStorage-a343e418.js → ConfigStorage-e49214c6.js} +2 -2
  2. package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-77729a93.js} +7 -2
  3. package/dist/cjs/{IExporterProvider-597949f9.js → IExporterProvider-10b7fed5.js} +4 -4
  4. package/dist/cjs/{SnkFormConfigManager-166cbd1f.js → SnkFormConfigManager-beebf47a.js} +2 -2
  5. package/dist/cjs/{SnkMessageBuilder-897ffd08.js → SnkMessageBuilder-cceebbae.js} +1 -1
  6. package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-29bb791c.js} +1 -1
  7. package/dist/cjs/{dataunit-fetcher-688d3f05.js → dataunit-fetcher-d4873076.js} +1 -1
  8. package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-feb08214.js} +1 -1
  9. package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-a1d0353f.js} +1 -1
  10. package/dist/cjs/snk-actions-button_4.cjs.entry.js +5 -5
  11. package/dist/cjs/snk-application.cjs.entry.js +7 -7
  12. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  13. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  14. package/dist/cjs/snk-data-exporter.cjs.entry.js +8 -8
  15. package/dist/cjs/{snk-data-unit-8fa7917a.js → snk-data-unit-8af43aa3.js} +2 -2
  16. package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
  17. package/dist/cjs/snk-detail-view.cjs.entry.js +8 -8
  18. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  19. package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -3
  20. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  21. package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
  22. package/dist/cjs/snk-form.cjs.entry.js +4 -4
  23. package/dist/cjs/snk-grid.cjs.entry.js +6 -6
  24. package/dist/cjs/{snk-guides-viewer-bdc41281.js → snk-guides-viewer-69ec61af.js} +5 -5
  25. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  26. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  27. package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -7
  28. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
  29. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
  30. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +8 -3
  31. package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
  32. package/dist/components/DataFetcher.js +8 -3
  33. package/dist/components/SnkMessageBuilder.js +1 -1
  34. package/dist/components/snk-data-exporter2.js +2 -2
  35. package/dist/components/snk-exporter-email-sender2.js +1 -1
  36. package/dist/esm/{ConfigStorage-3806514e.js → ConfigStorage-e476378d.js} +2 -2
  37. package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-773a3e4b.js} +8 -3
  38. package/dist/esm/{IExporterProvider-63a188b6.js → IExporterProvider-d597f27d.js} +4 -4
  39. package/dist/esm/{SnkFormConfigManager-31b24066.js → SnkFormConfigManager-298cd647.js} +2 -2
  40. package/dist/esm/{SnkMessageBuilder-571462fb.js → SnkMessageBuilder-ae87b754.js} +1 -1
  41. package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-a411f73c.js} +1 -1
  42. package/dist/esm/{dataunit-fetcher-264191b2.js → dataunit-fetcher-3d2ec959.js} +1 -1
  43. package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-e0382e5a.js} +1 -1
  44. package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-a87445a0.js} +1 -1
  45. package/dist/esm/snk-actions-button_4.entry.js +5 -5
  46. package/dist/esm/snk-application.entry.js +7 -7
  47. package/dist/esm/snk-attach.entry.js +5 -5
  48. package/dist/esm/snk-crud.entry.js +5 -5
  49. package/dist/esm/snk-data-exporter.entry.js +8 -8
  50. package/dist/esm/{snk-data-unit-f5cbe64b.js → snk-data-unit-008cb9aa.js} +2 -2
  51. package/dist/esm/snk-data-unit.entry.js +4 -4
  52. package/dist/esm/snk-detail-view.entry.js +8 -8
  53. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  54. package/dist/esm/snk-filter-bar.entry.js +3 -3
  55. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  56. package/dist/esm/snk-form-config.entry.js +2 -2
  57. package/dist/esm/snk-form.entry.js +4 -4
  58. package/dist/esm/snk-grid.entry.js +6 -6
  59. package/dist/esm/{snk-guides-viewer-dda0fede.js → snk-guides-viewer-43f21b03.js} +5 -5
  60. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  61. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  62. package/dist/esm/snk-simple-crud.entry.js +7 -7
  63. package/dist/sankhyablocks/{p-fe79f83a.js → p-091ce761.js} +1 -1
  64. package/dist/sankhyablocks/{p-913a9979.js → p-0cd3c0a9.js} +1 -1
  65. package/dist/sankhyablocks/{p-7619bdb1.entry.js → p-162b9a59.entry.js} +2 -2
  66. package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
  67. package/dist/sankhyablocks/{p-df5451c7.js → p-181975f1.js} +1 -1
  68. package/dist/sankhyablocks/{p-fa4d8cb4.js → p-1f35c795.js} +1 -1
  69. package/dist/sankhyablocks/{p-af8efd95.js → p-25f1fc39.js} +1 -1
  70. package/dist/sankhyablocks/{p-62ba211a.entry.js → p-2e9c764c.entry.js} +1 -1
  71. package/dist/sankhyablocks/{p-52920496.js → p-3287a6cc.js} +1 -1
  72. package/dist/sankhyablocks/p-3c50e9d4.entry.js +1 -0
  73. package/dist/sankhyablocks/{p-4e5e1313.entry.js → p-421bec84.entry.js} +1 -1
  74. package/dist/sankhyablocks/{p-7505da04.entry.js → p-42f7b05d.entry.js} +1 -1
  75. package/dist/sankhyablocks/{p-871aa14e.entry.js → p-46bb200a.entry.js} +1 -1
  76. package/dist/sankhyablocks/{p-b05d8893.entry.js → p-53412c1d.entry.js} +1 -1
  77. package/dist/sankhyablocks/p-594bc21d.js +1 -0
  78. package/dist/sankhyablocks/{p-2a408684.js → p-5f016aed.js} +1 -1
  79. package/dist/sankhyablocks/{p-d6e26ea8.entry.js → p-62f34e6f.entry.js} +1 -1
  80. package/dist/sankhyablocks/{p-7a85fd49.entry.js → p-65f8c11c.entry.js} +1 -1
  81. package/dist/sankhyablocks/{p-80042dc6.entry.js → p-684a2590.entry.js} +1 -1
  82. package/dist/sankhyablocks/{p-3a212712.js → p-76a65660.js} +1 -1
  83. package/dist/sankhyablocks/p-7b8f7242.entry.js +1 -0
  84. package/dist/sankhyablocks/p-7c4aabe2.js +1 -0
  85. package/dist/sankhyablocks/{p-6bb2f3e9.entry.js → p-89451692.entry.js} +1 -1
  86. package/dist/sankhyablocks/{p-450c60e4.entry.js → p-939e15d3.entry.js} +1 -1
  87. package/dist/sankhyablocks/{p-47db7e88.entry.js → p-9dfda04a.entry.js} +1 -1
  88. package/dist/sankhyablocks/{p-2c68b3ae.entry.js → p-bd008859.entry.js} +1 -1
  89. package/dist/sankhyablocks/{p-17def7cd.js → p-cc935517.js} +1 -1
  90. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  91. package/package.json +2 -2
  92. package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
  93. package/dist/sankhyablocks/p-75e674ed.entry.js +0 -1
  94. package/dist/sankhyablocks/p-7ef9c55c.js +0 -1
  95. package/dist/sankhyablocks/p-8c59edd7.entry.js +0 -1
  96. package/dist/sankhyablocks/p-dc7c9047.js +0 -1
@@ -1 +1 @@
1
- import{r as t,c as i,h as s,g as e,H as a}from"./p-d2d301a6.js";import{Action as n,ObjectUtils as h,DataUnitAction as r,StringUtils as o,ApplicationContext as d}from"@sankhyalabs/core";import{ApplicationUtils as l,DialogType as c}from"@sankhyalabs/ezui/dist/collection/utils";import{O as u,S as v}from"./p-7ef9c55c.js";import{g as f,a as m}from"./p-fe79f83a.js";import{g as b}from"./p-9863d682.js";import{convertType as p}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";const D=class{constructor(s){t(this,s),this.dataStateChange=i(this,"dataStateChange",3),this.dataUnitReady=i(this,"dataUnitReady",3),this.messagesBuilderUpdated=i(this,"messagesBuilderUpdated",3),this.dataUnitFieldsHidded=i(this,"dataUnitFieldsHidded",7),this.insertionMode=i(this,"insertionMode",3),this.cancelEdition=i(this,"cancelEdition",3),this._onDataUnitResolve=[],this._openedAlert=!1,this._fieldsWithRmp=[],this._fieldsWithRmPrecision=[],this._metadataByRow=new Map,this._rowMetadataCache=new Map,this.REGEX_DATAUNIT_NAME=/dd:\/\/(.+?)\//,this._dataUnitObserver=async t=>{const i=this.buildDataState(t.type);switch(this.dataState=i,this.messagesBuilder.currentOperation=this.getMessageOperation(),t.type){case n.DATA_SAVED:await this.handleDataSaved(t);break;case n.RECORDS_ADDED:case n.RECORDS_COPIED:this.insertionMode.emit();break;case n.EDITION_CANCELED:this.cancelEdition.emit();break;case n.RECORDS_REMOVED:this.handleRecordsRemoved(t);break;case n.METADATA_LOADED:this.fillFieldsWithRmp(this.dataUnit.metadata),this.fillFieldsWithRmPrecision(this.dataUnit.metadata)}},this.fieldsToLink=[],this.dataState=void 0,this.messagesBuilder=void 0,this.dataUnitName=void 0,this.entityName=void 0,this.pageSize=150,this.dataUnit=void 0,this.beforeSave=void 0,this.afterSave=void 0,this.useCancelConfirm=!0,this.ignoreSaveMessage=void 0,this.configName=void 0,this.resourceID=void 0,this.domainMessagesBuilder=void 0}observePageSize(){this.dataUnit&&(this.dataUnit.pageSize=this.pageSize)}observeDataUnitName(t,i){i!=t&&(this.dataUnit?this._application.updateDataunitCache(i,this.dataUnitName,this.dataUnit):this.loadDataUnit())}observeEntityName(t,i){i!=t&&(this.dataUnit=void 0,this.entityName=t,this.loadDataUnit())}observeDataState(t,i){h.objectToString(i)!=h.objectToString(t)&&this.dataStateChange.emit(t)}observeDataUnit(){this.handlerLinkFields(),this.dataUnitReady.emit(this.dataUnit)}observeMessagesBuilder(t){t&&this.messagesBuilderUpdated.emit(t)}async getDataUnit(){return new Promise((t=>{this.dataUnit?t(this.dataUnit):this._onDataUnitResolve.push(t)}))}async getSelectedRecordsIDsInfo(){return Promise.resolve(b(this.dataUnit))}async getFieldsWithRmp(){return this._fieldsWithRmp}async getFieldsWithRmPrecision(){return this._fieldsWithRmPrecision}async getRowMetadata(t){return this.doGetRowMetadata(t)}doGetRowMetadata(t){const i=this.dataUnit.getSelectedRecord();if(!t&&!i)return;const s=t||i,e=this._metadataByRow.get("string"==typeof s?s:s.__record__id__);return e?(e.getProp=this.buildGetPropRowMetadata(e),Object.assign({},e)):void 0}buildGetPropRowMetadata(t){return(i,s)=>("rm_precision"===i&&(i=this.resolvePrecisionFromMetadata(s)),h.getProp(t,i))}resolvePrecisionFromMetadata(t){var i,s;if(!t)return void l.error(this.getMessage("snkDataUnit.fieldNameRequired"));const e=null===(s=null===(i=this.dataUnit.getField(t))||void 0===i?void 0:i.properties)||void 0===s?void 0:s.rm_precision;return e?e.split(".").filter(((t,i)=>1!==i)).join("."):""}getCleanOnCopyFields(){var t;return null===(t=this.dataUnit.metadata)||void 0===t?void 0:t.fields.filter((t=>{var i;return null===(i=t.properties)||void 0===i?void 0:i.cleanOnCopy})).map((t=>t.name))}fillFieldsWithRmp(t){t.fields.forEach((t=>{var i;(null===(i=t.properties)||void 0===i?void 0:i.rmp)&&!this._fieldsWithRmp.includes(t.name)&&this._fieldsWithRmp.push(t.name)}))}fillFieldsWithRmPrecision(t){t.fields.forEach((t=>{var i;(null===(i=t.properties)||void 0===i?void 0:i.rm_precision)&&!this._fieldsWithRmPrecision.includes(t.name)&&this._fieldsWithRmPrecision.push(t.name)}))}getCacheName(t,i,s){return[t,i,s].join("_")}updateDataStateRmp(t){const i=Object.assign({},t);this.dataState.rowMetadata=i}saveCacheRmd(t){const i=t.__record__metadata__,s=Object.keys(i);s.shift(),s.forEach((s=>{const e=f(t,s),a=this.getCacheName(s,i.provider,e);this._rowMetadataCache.set(a,Object.assign({},i))}))}getMetadataByRow(t){var i;if(!(null===(i=t.records)||void 0===i?void 0:i.length))return t;if(!this._fieldsWithRmp.length){const i=t.records.map((t=>(delete t.__record__metadata__,t)));return Object.assign(Object.assign({},t),{records:i})}const s=t.records.map((t=>{if(!t.__record__metadata__)return t;this.saveCacheRmd(t);const i=Object.assign({},t.__record__metadata__);return i.getProp=this.buildGetPropRowMetadata(i),this._metadataByRow.set(t.__record__id__,i),delete t.__record__metadata__,t}));return Object.assign(Object.assign({},t),{records:s})}interceptRecordsAdded(t){if(this.isAllowed("INSERT"))return new r(n.RECORDS_ADDED,this.handleLinksWithParent(t.payload));l.info(this.getMessage("snkDataUnit.forbiddenInsert"))}interceptRecordsCopied(t){if(this.isAllowed("CLONE"))return new r(n.RECORDS_COPIED,this.handleRecordsCopied(t.payload));l.info(this.getMessage("snkDataUnit.forbiddenClone"))}async interceptDataChange(t){if(this.isAllowed("UPDATE"))return t;this._openedAlert?await this.dataUnit.cancelEdition():(this._openedAlert=!0,await this.dataUnit.cancelEdition(),await l.alert(this.getMessage("snkDataUnit.forbidden"),this.getMessage("snkDataUnit.forbiddenUpdate")),this._openedAlert=!1)}async interceptSavingData(t){if(!this.beforeSave)return t;const i=this.beforeSave(this.dataUnit);return i instanceof Promise?await i?t:void 0:i?t:void 0}interceptDataSaved(t){if(!this.afterSave)return t;this.afterSave(this.dataUnit)}async interceptEditionCanceled(t){var i,s;if(!this.useCancelConfirm||!this.dataState.hasDirtyRecords||(null===(i=t.payload)||void 0===i?void 0:i.fromParent)||(null===(s=t.payload)||void 0===s?void 0:s.silent))return t;const e=this.getMessage("snkDataUnit.cancelConfirmation");if(null==e)return this.showSuccessMessage(this.getMessage("snkDataUnit.cancelInfo")),t;const a=this.getMessage("snkDataUnit.cancelConfirmationTitle"),n=await l.confirm(a,e);return n&&this.showSuccessMessage(this.getMessage("snkDataUnit.cancelInfo")),n?t:void 0}async interceptRemovingRecords(t){var i,s,e;if(!this.isAllowed("REMOVE"))return void l.info(this.getMessage("snkDataUnit.forbiddenRemove"));let a=!1,n=!(null===(i=t.payload)||void 0===i?void 0:i.silent)&&this.getMessage("snkDataUnit.removeConfirmation");const h=null===(s=this.dataUnit)||void 0===s?void 0:s.getSelectionInfo();if(!(null===(e=t.payload)||void 0===e?void 0:e.silent)&&(null==h?void 0:h.length)>1&&(n=this.getMessage("snkDataUnit.removeAllConfirmation",{size:h.length}),a=!0),!n)return t;const r={canClose:!1,labelCancel:this.getMessage("snkDataUnit.confirm."+(a?"no":"cancel")),labelConfirm:this.getMessage("snkDataUnit.confirm."+(a?"yes":"delete")),btnConfirmDanger:!1},o=this.getMessage("snkDataUnit.removeConfirmationTitle");return await l.confirm(o,n,null,c.WARN,r)?t:void 0}interceptDataLoaded(t){const i=this.getMetadataByRow(t.payload);return new r(n.DATA_LOADED,i)}interceptMetadataLoaded(t){return this.fillFieldsWithRmp(t.payload),this.fillFieldsWithRmPrecision(t.payload),new r(n.METADATA_LOADED,this.handleDULinksOnMetadataLoaded(t.payload))}async interceptAction(t){switch(t.type){case n.RECORDS_ADDED:return this.interceptRecordsAdded(t);case n.RECORDS_COPIED:return this.interceptRecordsCopied(t);case n.DATA_CHANGED:return await this.handleLoadRowMetadata(t),await this.interceptDataChange(t);case n.CHANGING_DATA:return await this.interceptDataChange(t);case n.SAVING_DATA:return await this.interceptSavingData(t);case n.DATA_SAVED:return this.interceptDataSaved(t);case n.EDITION_CANCELED:return await this.interceptEditionCanceled(t);case n.REMOVING_RECORDS:return await this.interceptRemovingRecords(t);case n.DATA_LOADED:return this.interceptDataLoaded(t);case n.METADATA_LOADED:return this.interceptMetadataLoaded(t);default:return t}}async handleLoadRowMetadata(t){const i=t.type===n.DATA_CHANGED?t.payload:t.payload.changes[0].record,s=Object.keys(i).find((t=>this._fieldsWithRmp.includes(t)));if(s){const t=this.dataUnit.getField(s).properties.rmp,e=f(i,s);return await this.updateRowMetadata({fieldName:s,fieldValue:e,metadataName:t,updatedFields:i})}}async updateRowMetadata({fieldName:t,fieldValue:i,metadataName:s,updatedFields:e}){const a=this.getCacheName(t,s,i),n=this._rowMetadataCache.get(a);if(n)return this.updateDataStateRmp(n),n;{const i=new m,n=await i.loadRowMetadata(this,t,s,e);return this.updateDataStateRmp(n._rmd),this._rowMetadataCache.set(a,Object.assign({},n._rmd)),Object.assign({},n._rmd)}}handleDULinksOnMetadataLoaded(t){const i=Object.assign({},t);return this.processLinks(i),i}handleRecordsCopied(t){let i=[...t];return i=this.handleCleanOnCopy(i),this.handleLinksWithParent(i)}handleLinksWithParent(t){var i,s;const e=null!==(i=this._parentDataUnit)&&void 0!==i?i:null===(s=this.dataUnit)||void 0===s?void 0:s.getParentDataUnit();if(!e)return t;const a=e.getSelectedRecord(),n=null==e?void 0:e.getChildInfo(this.getCleanDataUnitName()),{links:h}=n;return h&&0!==h.length?t.map((t=>this.buildRecordWithLinkedFields(t,h,a))):t}buildRecordWithLinkedFields(t,i,s){const e=Object.assign({},t);return i.forEach((t=>{const i=p(this.dataUnit.getField(t.target).dataType,s[t.source]);e[t.target]=i})),e}handleCleanOnCopy(t){const i=this.getCleanOnCopyFields();return i.length>0&&(t=t.map((t=>this.buildCopyWithCleanedFields(t,i)))),t}buildCopyWithCleanedFields(t,i){const s=Object.assign({},t);return i.forEach((t=>delete s[t])),s}showSuccessMessage(t){l.info(t,{iconName:"check"})}isAllowed(t){return!!this._permissions&&(this._permissions.isSup||this._permissions[t])}buildDataState(t){var i;const s=this.dataUnit.getSelectionInfo(),e=(this.dataUnit.hasDirtyRecords()||this.dataUnit.hasWaitingChanges())&&(null==s?void 0:s.isEmpty()),a=this.dataUnit.getSelectedRecord();let h=null===(i=this.dataState)||void 0===i?void 0:i.rowMetadata;return!a||h&&![n.SELECTION_CHANGED,n.EDITION_CANCELED,n.NEXT_SELECTED,n.PREVIOUS_SELECTED].includes(t)?h&&(h.getProp=this.buildGetPropRowMetadata(h)):h=this.doGetRowMetadata(a),new w({insertionMode:this.dataUnit.hasNewRecord(),isStartingInsertionMode:e,hasNext:this.dataUnit.hasNext(),hasPrevious:this.dataUnit.hasPrevious(),copyMode:this.dataUnit.hasCopiedRecord(),isDirty:this.dataUnit.isDirty(),hasDirtyRecords:this.dataUnit.hasDirtyRecords(),selectedRecords:void 0,selectionInfo:s,selectedRecord:a,recordsIsEmpty:0===this.dataUnit.records.length,metadataByRow:this._metadataByRow,rowMetadata:h})}async handleDataSaved(t){const i=await this.handleLoadRowMetadata(t);if(i&&(i.getProp=this.buildGetPropRowMetadata(i)),this._metadataByRow.set(t.payload.records[0].__record__id__,i),this.dataState=this.buildDataState(),this.ignoreSaveMessage)return;const s=t.payload.changes[0]._operation.toLowerCase(),e=this.getMessage("snkDataUnit.saveInfo",t.payload.records[0],s);null!=e&&this.showSuccessMessage(e)}handleRecordsRemoved(t){var i,s;const e=t.payload.cachedRecords;let a;a=(null==e?void 0:e.length)>1?this.getMessage("snkDataUnit.removeAllInfo",{size:e.length}):this.getMessage("snkDataUnit.removeInfo",t.payload.cachedRecords[0]),null!=a&&this.showSuccessMessage(a);const n=null!==(s=null===(i=this.dataUnit.records)||void 0===i?void 0:i.length)&&void 0!==s?s:0,h=this.dataUnit.getPaginationInfo();h&&this.dataUnit.gotoPage(n>0||h.hasMore?h.currentPage:0)}getMessage(t,i,s){return i||(i=this.getMessageParams()),s&&(this.messagesBuilder.currentOperation=s),this.messagesBuilder.getMessage(t,i)}getMessageParams(){return this.dataState.selectedRecord}getMessageOperation(){return this.dataState.copyMode?u.CLONE:this.dataState.insertionMode||this.dataState.isStartingInsertionMode?u.INSERT:this.dataState.isDirty?u.UPDATE:u.CLEAN}async getDataUnitParentOrChild(){var t;const i=this.dataUnitName?this.dataUnitName:this.entityName;return this._parentSnkDataUnit?(this._parentDataUnit=await(null===(t=this._parentSnkDataUnit)||void 0===t?void 0:t.getDataUnit()),await this._application.getDataUnit(this.entityName,i,this._parentDataUnit,this.configName,this.resourceID)):await this._application.getDataUnit(this.entityName,i,null,this.configName,this.resourceID)}async loadDataUnit(){var t;if(null==this.dataUnit&&this._application&&this.entityName&&(this.dataUnit=await this.getDataUnitParentOrChild()),this.dataUnit){let i;for(this.dataUnit.pageSize=this.pageSize,this.dataUnit.unsubscribe(this._dataUnitObserver),this.dataUnit.addInterceptor(this),this.dataUnit.subscribe(this._dataUnitObserver),await this.dataUnit.loadMetadata(),(null===(t=this.dataUnit.records)||void 0===t?void 0:t.length)&&this.getMetadataByRow(this.dataUnit),this.dataState=this.buildDataState();i=this._onDataUnitResolve.pop();)i(this.dataUnit)}}getParentSnkDataUnit(){let t=this.element;for(;t.parentNode;){if("SNK-DATA-UNIT"===t.parentNode.nodeName)return t.parentNode;t=t.parentNode}}handlerLinkFields(){var t,i,s,e;const a=null!==(t=this._parentDataUnit)&&void 0!==t?t:null===(i=this.dataUnit)||void 0===i?void 0:i.getParentDataUnit();if(!a)return;const n=null!==(s=this.entityName)&&void 0!==s?s:this.getCleanDataUnitName(),h=a.getChildInfo(n);if(!h)return;const r=null===(e=null==h?void 0:h.links)||void 0===e?void 0:e.map((t=>t.target));this.handleDUWithLinks(r)}handleDUWithLinks(t){this.fieldsToLink=t;const i=Object.assign({},this.dataUnit.metadata);this.processLinks(i),this.dataUnit.metadata=i,this.dataUnitFieldsHidded.emit()}processLinks(t){var i;null===(i=null==t?void 0:t.fields)||void 0===i||i.forEach((t=>{var i;(null===(i=this.fieldsToLink)||void 0===i?void 0:i.includes(t.name))&&(t.visible=!1)}))}getCleanDataUnitName(){var t;const i=this.dataUnit.name;if(o.isEmpty(i))return i;const s=this.REGEX_DATAUNIT_NAME.exec(i);return null!==(t=null==s?void 0:s[1])&&void 0!==t?t:i}static getNearestInstance(t){let i=t.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase())return i;i=i.parentElement}}instanceMessagesBuilder(){var t;this.messagesBuilder||(this.messagesBuilder=new v(null!==(t=this.domainMessagesBuilder)&&void 0!==t?t:this.entityName))}componentWillLoad(){this._application=d.getContextValue("__SNK__APPLICATION__"),this._application.getAllAccess(this.resourceID).then((t=>this._permissions=t)),this._parentSnkDataUnit=this.getParentSnkDataUnit(),this.instanceMessagesBuilder()}disconnectedCallback(){this.dataUnit&&this.dataUnit.releaseCallbacks()}async componentDidLoad(){await this.loadDataUnit(),this.handlerLinkFields()}render(){return s(a,null)}get element(){return e(this)}static get watchers(){return{pageSize:["observePageSize"],dataUnitName:["observeDataUnitName"],entityName:["observeEntityName"],dataState:["observeDataState"],dataUnit:["observeDataUnit"],messagesBuilder:["observeMessagesBuilder"]}}};class w{constructor(t){this.copyMode=t.copyMode,this.insertionMode=t.insertionMode,this.isStartingInsertionMode=t.isStartingInsertionMode,this.isDirty=t.isDirty,this.hasDirtyRecords=t.hasDirtyRecords,this.hasNext=t.hasNext,this.hasPrevious=t.hasPrevious,this.selectionInfo=t.selectionInfo,this.selectedRecord=t.selectedRecord,this.recordsIsEmpty=t.recordsIsEmpty,this.metadataByRow=t.metadataByRow,this.rowMetadata=t.rowMetadata}get selectedRecords(){var t;if(console.warn("SnkDataUnit: O método `selectedRecords` foi descontinuado. Use o método `selectionInfo`."),null===(t=this.selectionInfo)||void 0===t?void 0:t.isAllRecords())throw new Error("Erro interno: Impossível obter os registros selecionados. A seleção atual é virtual. Use o atributo `selectionInfo`.");return this.selectionInfo.records}}export{D as S}
1
+ import{r as t,c as i,h as s,g as e,H as a}from"./p-d2d301a6.js";import{Action as n,ObjectUtils as h,DataUnitAction as r,StringUtils as o,ApplicationContext as d}from"@sankhyalabs/core";import{ApplicationUtils as l,DialogType as c}from"@sankhyalabs/ezui/dist/collection/utils";import{O as u,S as v}from"./p-7c4aabe2.js";import{g as m,a as f}from"./p-091ce761.js";import{g as b}from"./p-9863d682.js";import{convertType as p}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";const D=class{constructor(s){t(this,s),this.dataStateChange=i(this,"dataStateChange",3),this.dataUnitReady=i(this,"dataUnitReady",3),this.messagesBuilderUpdated=i(this,"messagesBuilderUpdated",3),this.dataUnitFieldsHidded=i(this,"dataUnitFieldsHidded",7),this.insertionMode=i(this,"insertionMode",3),this.cancelEdition=i(this,"cancelEdition",3),this._onDataUnitResolve=[],this._openedAlert=!1,this._fieldsWithRmp=[],this._fieldsWithRmPrecision=[],this._metadataByRow=new Map,this._rowMetadataCache=new Map,this.REGEX_DATAUNIT_NAME=/dd:\/\/(.+?)\//,this._dataUnitObserver=async t=>{const i=this.buildDataState(t.type);switch(this.dataState=i,this.messagesBuilder.currentOperation=this.getMessageOperation(),t.type){case n.DATA_SAVED:await this.handleDataSaved(t);break;case n.RECORDS_ADDED:case n.RECORDS_COPIED:this.insertionMode.emit();break;case n.EDITION_CANCELED:this.cancelEdition.emit();break;case n.RECORDS_REMOVED:this.handleRecordsRemoved(t);break;case n.METADATA_LOADED:this.fillFieldsWithRmp(this.dataUnit.metadata),this.fillFieldsWithRmPrecision(this.dataUnit.metadata)}},this.fieldsToLink=[],this.dataState=void 0,this.messagesBuilder=void 0,this.dataUnitName=void 0,this.entityName=void 0,this.pageSize=150,this.dataUnit=void 0,this.beforeSave=void 0,this.afterSave=void 0,this.useCancelConfirm=!0,this.ignoreSaveMessage=void 0,this.configName=void 0,this.resourceID=void 0,this.domainMessagesBuilder=void 0}observePageSize(){this.dataUnit&&(this.dataUnit.pageSize=this.pageSize)}observeDataUnitName(t,i){i!=t&&(this.dataUnit?this._application.updateDataunitCache(i,this.dataUnitName,this.dataUnit):this.loadDataUnit())}observeEntityName(t,i){i!=t&&(this.dataUnit=void 0,this.entityName=t,this.loadDataUnit())}observeDataState(t,i){h.objectToString(i)!=h.objectToString(t)&&this.dataStateChange.emit(t)}observeDataUnit(){this.handlerLinkFields(),this.dataUnitReady.emit(this.dataUnit)}observeMessagesBuilder(t){t&&this.messagesBuilderUpdated.emit(t)}async getDataUnit(){return new Promise((t=>{this.dataUnit?t(this.dataUnit):this._onDataUnitResolve.push(t)}))}async getSelectedRecordsIDsInfo(){return Promise.resolve(b(this.dataUnit))}async getFieldsWithRmp(){return this._fieldsWithRmp}async getFieldsWithRmPrecision(){return this._fieldsWithRmPrecision}async getRowMetadata(t){return this.doGetRowMetadata(t)}doGetRowMetadata(t){const i=this.dataUnit.getSelectedRecord();if(!t&&!i)return;const s=t||i,e=this._metadataByRow.get("string"==typeof s?s:s.__record__id__);return e?(e.getProp=this.buildGetPropRowMetadata(e),Object.assign({},e)):void 0}buildGetPropRowMetadata(t){return(i,s)=>("rm_precision"===i&&(i=this.resolvePrecisionFromMetadata(s)),h.getProp(t,i))}resolvePrecisionFromMetadata(t){var i,s;if(!t)return void l.error(this.getMessage("snkDataUnit.fieldNameRequired"));const e=null===(s=null===(i=this.dataUnit.getField(t))||void 0===i?void 0:i.properties)||void 0===s?void 0:s.rm_precision;return e?e.split(".").filter(((t,i)=>1!==i)).join("."):""}getCleanOnCopyFields(){var t;return null===(t=this.dataUnit.metadata)||void 0===t?void 0:t.fields.filter((t=>{var i;return null===(i=t.properties)||void 0===i?void 0:i.cleanOnCopy})).map((t=>t.name))}fillFieldsWithRmp(t){t.fields.forEach((t=>{var i;(null===(i=t.properties)||void 0===i?void 0:i.rmp)&&!this._fieldsWithRmp.includes(t.name)&&this._fieldsWithRmp.push(t.name)}))}fillFieldsWithRmPrecision(t){t.fields.forEach((t=>{var i;(null===(i=t.properties)||void 0===i?void 0:i.rm_precision)&&!this._fieldsWithRmPrecision.includes(t.name)&&this._fieldsWithRmPrecision.push(t.name)}))}getCacheName(t,i,s){return[t,i,s].join("_")}updateDataStateRmp(t){const i=Object.assign({},t);this.dataState.rowMetadata=i}saveCacheRmd(t){const i=t.__record__metadata__,s=Object.keys(i);s.shift(),s.forEach((s=>{const e=m(t,s),a=this.getCacheName(s,i.provider,e);this._rowMetadataCache.set(a,Object.assign({},i))}))}getMetadataByRow(t){var i;if(!(null===(i=t.records)||void 0===i?void 0:i.length))return t;if(!this._fieldsWithRmp.length){const i=t.records.map((t=>(delete t.__record__metadata__,t)));return Object.assign(Object.assign({},t),{records:i})}const s=t.records.map((t=>{if(!t.__record__metadata__)return t;this.saveCacheRmd(t);const i=Object.assign({},t.__record__metadata__);return i.getProp=this.buildGetPropRowMetadata(i),this._metadataByRow.set(t.__record__id__,i),delete t.__record__metadata__,t}));return Object.assign(Object.assign({},t),{records:s})}interceptRecordsAdded(t){if(this.isAllowed("INSERT"))return new r(n.RECORDS_ADDED,this.handleLinksWithParent(t.payload));l.info(this.getMessage("snkDataUnit.forbiddenInsert"))}interceptRecordsCopied(t){if(this.isAllowed("CLONE"))return new r(n.RECORDS_COPIED,this.handleRecordsCopied(t.payload));l.info(this.getMessage("snkDataUnit.forbiddenClone"))}async interceptDataChange(t){if(this.isAllowed("UPDATE"))return t;this._openedAlert?await this.dataUnit.cancelEdition():(this._openedAlert=!0,await this.dataUnit.cancelEdition(),await l.alert(this.getMessage("snkDataUnit.forbidden"),this.getMessage("snkDataUnit.forbiddenUpdate")),this._openedAlert=!1)}async interceptSavingData(t){if(!this.beforeSave)return t;const i=this.beforeSave(this.dataUnit);return i instanceof Promise?await i?t:void 0:i?t:void 0}interceptDataSaved(t){if(!this.afterSave)return t;this.afterSave(this.dataUnit)}async interceptEditionCanceled(t){var i,s;if(!this.useCancelConfirm||!this.dataState.hasDirtyRecords||(null===(i=t.payload)||void 0===i?void 0:i.fromParent)||(null===(s=t.payload)||void 0===s?void 0:s.silent))return t;const e=this.getMessage("snkDataUnit.cancelConfirmation");if(null==e)return this.showSuccessMessage(this.getMessage("snkDataUnit.cancelInfo")),t;const a=this.getMessage("snkDataUnit.cancelConfirmationTitle"),n=await l.confirm(a,e);return n&&this.showSuccessMessage(this.getMessage("snkDataUnit.cancelInfo")),n?t:void 0}async interceptRemovingRecords(t){var i,s,e;if(!this.isAllowed("REMOVE"))return void l.info(this.getMessage("snkDataUnit.forbiddenRemove"));let a=!1,n=!(null===(i=t.payload)||void 0===i?void 0:i.silent)&&this.getMessage("snkDataUnit.removeConfirmation");const h=null===(s=this.dataUnit)||void 0===s?void 0:s.getSelectionInfo();if(!(null===(e=t.payload)||void 0===e?void 0:e.silent)&&(null==h?void 0:h.length)>1&&(n=this.getMessage("snkDataUnit.removeAllConfirmation",{size:h.length}),a=!0),!n)return t;const r={canClose:!1,labelCancel:this.getMessage("snkDataUnit.confirm."+(a?"no":"cancel")),labelConfirm:this.getMessage("snkDataUnit.confirm."+(a?"yes":"delete")),btnConfirmDanger:!1},o=this.getMessage("snkDataUnit.removeConfirmationTitle");return await l.confirm(o,n,null,c.WARN,r)?t:void 0}interceptDataLoaded(t){const i=this.getMetadataByRow(t.payload);return new r(n.DATA_LOADED,i)}interceptMetadataLoaded(t){return this.fillFieldsWithRmp(t.payload),this.fillFieldsWithRmPrecision(t.payload),new r(n.METADATA_LOADED,this.handleDULinksOnMetadataLoaded(t.payload))}async interceptAction(t){switch(t.type){case n.RECORDS_ADDED:return this.interceptRecordsAdded(t);case n.RECORDS_COPIED:return this.interceptRecordsCopied(t);case n.DATA_CHANGED:return await this.handleLoadRowMetadata(t),await this.interceptDataChange(t);case n.CHANGING_DATA:return await this.interceptDataChange(t);case n.SAVING_DATA:return await this.interceptSavingData(t);case n.DATA_SAVED:return this.interceptDataSaved(t);case n.EDITION_CANCELED:return await this.interceptEditionCanceled(t);case n.REMOVING_RECORDS:return await this.interceptRemovingRecords(t);case n.DATA_LOADED:return this.interceptDataLoaded(t);case n.METADATA_LOADED:return this.interceptMetadataLoaded(t);default:return t}}async handleLoadRowMetadata(t){const i=t.type===n.DATA_CHANGED?t.payload:t.payload.changes[0].record,s=Object.keys(i).find((t=>this._fieldsWithRmp.includes(t)));if(s){const t=this.dataUnit.getField(s).properties.rmp,e=m(i,s);return await this.updateRowMetadata({fieldName:s,fieldValue:e,metadataName:t,updatedFields:i})}}async updateRowMetadata({fieldName:t,fieldValue:i,metadataName:s,updatedFields:e}){const a=this.getCacheName(t,s,i),n=this._rowMetadataCache.get(a);if(n)return this.updateDataStateRmp(n),n;{const i=new f,n=await i.loadRowMetadata(this,t,s,e);return this.updateDataStateRmp(n._rmd),this._rowMetadataCache.set(a,Object.assign({},n._rmd)),Object.assign({},n._rmd)}}handleDULinksOnMetadataLoaded(t){const i=Object.assign({},t);return this.processLinks(i),i}handleRecordsCopied(t){let i=[...t];return i=this.handleCleanOnCopy(i),this.handleLinksWithParent(i)}handleLinksWithParent(t){var i,s;const e=null!==(i=this._parentDataUnit)&&void 0!==i?i:null===(s=this.dataUnit)||void 0===s?void 0:s.getParentDataUnit();if(!e)return t;const a=e.getSelectedRecord(),n=null==e?void 0:e.getChildInfo(this.getCleanDataUnitName()),{links:h}=n;return h&&0!==h.length?t.map((t=>this.buildRecordWithLinkedFields(t,h,a))):t}buildRecordWithLinkedFields(t,i,s){const e=Object.assign({},t);return i.forEach((t=>{const i=p(this.dataUnit.getField(t.target).dataType,s[t.source]);e[t.target]=i})),e}handleCleanOnCopy(t){const i=this.getCleanOnCopyFields();return i.length>0&&(t=t.map((t=>this.buildCopyWithCleanedFields(t,i)))),t}buildCopyWithCleanedFields(t,i){const s=Object.assign({},t);return i.forEach((t=>delete s[t])),s}showSuccessMessage(t){l.info(t,{iconName:"check"})}isAllowed(t){return!!this._permissions&&(this._permissions.isSup||this._permissions[t])}buildDataState(t){var i;const s=this.dataUnit.getSelectionInfo(),e=(this.dataUnit.hasDirtyRecords()||this.dataUnit.hasWaitingChanges())&&(null==s?void 0:s.isEmpty()),a=this.dataUnit.getSelectedRecord();let h=null===(i=this.dataState)||void 0===i?void 0:i.rowMetadata;return!a||h&&![n.SELECTION_CHANGED,n.EDITION_CANCELED,n.NEXT_SELECTED,n.PREVIOUS_SELECTED].includes(t)?h&&(h.getProp=this.buildGetPropRowMetadata(h)):h=this.doGetRowMetadata(a),new w({insertionMode:this.dataUnit.hasNewRecord(),isStartingInsertionMode:e,hasNext:this.dataUnit.hasNext(),hasPrevious:this.dataUnit.hasPrevious(),copyMode:this.dataUnit.hasCopiedRecord(),isDirty:this.dataUnit.isDirty(),hasDirtyRecords:this.dataUnit.hasDirtyRecords(),selectedRecords:void 0,selectionInfo:s,selectedRecord:a,recordsIsEmpty:0===this.dataUnit.records.length,metadataByRow:this._metadataByRow,rowMetadata:h})}async handleDataSaved(t){const i=await this.handleLoadRowMetadata(t);if(i&&(i.getProp=this.buildGetPropRowMetadata(i)),this._metadataByRow.set(t.payload.records[0].__record__id__,i),this.dataState=this.buildDataState(),this.ignoreSaveMessage)return;const s=t.payload.changes[0]._operation.toLowerCase(),e=this.getMessage("snkDataUnit.saveInfo",t.payload.records[0],s);null!=e&&this.showSuccessMessage(e)}handleRecordsRemoved(t){var i,s;const e=t.payload.cachedRecords;let a;a=(null==e?void 0:e.length)>1?this.getMessage("snkDataUnit.removeAllInfo",{size:e.length}):this.getMessage("snkDataUnit.removeInfo",t.payload.cachedRecords[0]),null!=a&&this.showSuccessMessage(a);const n=null!==(s=null===(i=this.dataUnit.records)||void 0===i?void 0:i.length)&&void 0!==s?s:0,h=this.dataUnit.getPaginationInfo();h&&this.dataUnit.gotoPage(n>0||h.hasMore?h.currentPage:0)}getMessage(t,i,s){return i||(i=this.getMessageParams()),s&&(this.messagesBuilder.currentOperation=s),this.messagesBuilder.getMessage(t,i)}getMessageParams(){return this.dataState.selectedRecord}getMessageOperation(){return this.dataState.copyMode?u.CLONE:this.dataState.insertionMode||this.dataState.isStartingInsertionMode?u.INSERT:this.dataState.isDirty?u.UPDATE:u.CLEAN}async getDataUnitParentOrChild(){var t;const i=this.dataUnitName?this.dataUnitName:this.entityName;return this._parentSnkDataUnit?(this._parentDataUnit=await(null===(t=this._parentSnkDataUnit)||void 0===t?void 0:t.getDataUnit()),await this._application.getDataUnit(this.entityName,i,this._parentDataUnit,this.configName,this.resourceID)):await this._application.getDataUnit(this.entityName,i,null,this.configName,this.resourceID)}async loadDataUnit(){var t;if(null==this.dataUnit&&this._application&&this.entityName&&(this.dataUnit=await this.getDataUnitParentOrChild()),this.dataUnit){let i;for(this.dataUnit.pageSize=this.pageSize,this.dataUnit.unsubscribe(this._dataUnitObserver),this.dataUnit.addInterceptor(this),this.dataUnit.subscribe(this._dataUnitObserver),await this.dataUnit.loadMetadata(),(null===(t=this.dataUnit.records)||void 0===t?void 0:t.length)&&this.getMetadataByRow(this.dataUnit),this.dataState=this.buildDataState();i=this._onDataUnitResolve.pop();)i(this.dataUnit)}}getParentSnkDataUnit(){let t=this.element;for(;t.parentNode;){if("SNK-DATA-UNIT"===t.parentNode.nodeName)return t.parentNode;t=t.parentNode}}handlerLinkFields(){var t,i,s,e;const a=null!==(t=this._parentDataUnit)&&void 0!==t?t:null===(i=this.dataUnit)||void 0===i?void 0:i.getParentDataUnit();if(!a)return;const n=null!==(s=this.entityName)&&void 0!==s?s:this.getCleanDataUnitName(),h=a.getChildInfo(n);if(!h)return;const r=null===(e=null==h?void 0:h.links)||void 0===e?void 0:e.map((t=>t.target));this.handleDUWithLinks(r)}handleDUWithLinks(t){this.fieldsToLink=t;const i=Object.assign({},this.dataUnit.metadata);this.processLinks(i),this.dataUnit.metadata=i,this.dataUnitFieldsHidded.emit()}processLinks(t){var i;null===(i=null==t?void 0:t.fields)||void 0===i||i.forEach((t=>{var i;(null===(i=this.fieldsToLink)||void 0===i?void 0:i.includes(t.name))&&(t.visible=!1)}))}getCleanDataUnitName(){var t;const i=this.dataUnit.name;if(o.isEmpty(i))return i;const s=this.REGEX_DATAUNIT_NAME.exec(i);return null!==(t=null==s?void 0:s[1])&&void 0!==t?t:i}static getNearestInstance(t){let i=t.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase())return i;i=i.parentElement}}instanceMessagesBuilder(){var t;this.messagesBuilder||(this.messagesBuilder=new v(null!==(t=this.domainMessagesBuilder)&&void 0!==t?t:this.entityName))}componentWillLoad(){this._application=d.getContextValue("__SNK__APPLICATION__"),this._application.getAllAccess(this.resourceID).then((t=>this._permissions=t)),this._parentSnkDataUnit=this.getParentSnkDataUnit(),this.instanceMessagesBuilder()}disconnectedCallback(){this.dataUnit&&this.dataUnit.releaseCallbacks()}async componentDidLoad(){await this.loadDataUnit(),this.handlerLinkFields()}render(){return s(a,null)}get element(){return e(this)}static get watchers(){return{pageSize:["observePageSize"],dataUnitName:["observeDataUnitName"],entityName:["observeEntityName"],dataState:["observeDataState"],dataUnit:["observeDataUnit"],messagesBuilder:["observeMessagesBuilder"]}}};class w{constructor(t){this.copyMode=t.copyMode,this.insertionMode=t.insertionMode,this.isStartingInsertionMode=t.isStartingInsertionMode,this.isDirty=t.isDirty,this.hasDirtyRecords=t.hasDirtyRecords,this.hasNext=t.hasNext,this.hasPrevious=t.hasPrevious,this.selectionInfo=t.selectionInfo,this.selectedRecord=t.selectedRecord,this.recordsIsEmpty=t.recordsIsEmpty,this.metadataByRow=t.metadataByRow,this.rowMetadata=t.rowMetadata}get selectedRecords(){var t;if(console.warn("SnkDataUnit: O método `selectedRecords` foi descontinuado. Use o método `selectionInfo`."),null===(t=this.selectionInfo)||void 0===t?void 0:t.isAllRecords())throw new Error("Erro interno: Impossível obter os registros selecionados. A seleção atual é virtual. Use o atributo `selectionInfo`.");return this.selectionInfo.records}}export{D as S}
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-d2d301a6.js";export{s as setNonce}from"./p-d2d301a6.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t(JSON.parse('[["p-118e769b",[[1,"teste-pesquisa"]]],["p-70a4af56",[[0,"snk-filter-modal",{"getMessage":[16],"configName":[1025,"config-name"],"filters":[1040],"applyFilters":[16],"closeModal":[16],"addPersonalizedFilter":[16],"editPersonalizedFilter":[16],"deletePersonalizedFilter":[16],"filtersToDelete":[16],"disablePersonalizedFilter":[4,"disable-personalized-filter"]},[[0,"deleteFilter","deletePersonalizedFilterListener"]]]]],["p-ac8d1cd6",[[2,"snk-actions-form",{"action":[16],"applyParameters":[16],"dataUnit":[32],"openPopup":[64]}]]],["p-9531fd46",[[2,"snk-client-confirm",{"titleMessage":[1,"title-message"],"message":[1],"accept":[16],"cancel":[16],"openPopup":[64]}]]],["p-21a81901",[[6,"snk-custom-slot-elements",{"slotName":[1,"slot-name"]}]]],["p-33718dfc",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"_searchValue":[32],"_ezListSource":[32],"reloadList":[64]}]]],["p-41f8bfa3",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"],"resetValues":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-aaa3ee68",[[0,"snk-filter-checkbox-list",{"config":[1040],"optionsList":[32]}]]],["p-d3f53df2",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]]]],["p-bf2acf72",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-01ba23cd",[[0,"snk-filter-number",{"config":[16],"getMessage":[16],"value":[2],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-7e2ded86",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[8],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-c8622597",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-96a89d58",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["p-b11aa1e0",[[2,"snk-personalized-filter-editor",{"messagesBuilder":[1040],"presentationMode":[2,"presentation-mode"],"config":[16],"value":[1040],"items":[32],"show":[64]}]]],["p-72fc257b",[[2,"snk-print-selector",{"_printServerActive":[32],"_selectedPrinter":[32],"_remotePrintersDataSource":[32],"_localPrintersDataSource":[32],"_printJobData":[32],"openPrintSelector":[64]}]]],["p-47db7e88",[[0,"snk-filter-modal-item",{"filterItem":[1040],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-d1791da2",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["p-80042dc6",[[6,"snk-simple-crud",{"dataState":[16],"dataUnit":[16],"entityName":[1,"entity-name"],"mode":[2],"gridConfig":[1040],"formConfig":[1040],"multipleSelection":[4,"multiple-selection"],"useCancelConfirm":[4,"use-cancel-confirm"],"pageSize":[2,"page-size"],"resourceID":[1,"resource-i-d"],"taskbarManager":[16],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"actionsList":[16],"configName":[1025,"config-name"],"showConfiguratorButtons":[4,"show-configurator-buttons"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"autoFocus":[4,"auto-focus"],"domainMessagesBuilder":[1,"domain-messages-builder"],"autoLoad":[4,"auto-load"],"_showPopUpGridConfig":[32],"_showFormConfig":[32],"_currentViewMode":[32],"_config":[32],"_fieldToGetFocus":[32],"_customContainerId":[32],"_formFields":[32],"_fieldsProps":[32],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64],"openConfigurator":[64],"closeConfigurator":[64],"updateConfig":[64]},[[0,"actionClick","actionClickListener"]]]]],["p-7505da04",[[2,"snk-attach",{"fetcherType":[1,"fetcher-type"],"fetcher":[16],"dataUnit":[16],"dataUnitBuilder":[16],"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"_currentFetcher":[32],"_currentDataUnit":[32],"crudConfig":[32]}]]],["p-26b0ce3e",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["p-1db45d26",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"customEditors":[16],"fieldsProps":[16],"showUp":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]],["p-8002dcd0",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"searchEmpty":[32],"groupEmpty":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["p-9d3a025a",[[2,"snk-expression-group",{"parentTop":[1026,"parent-top"],"group":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityURI":[1025,"entity-u-r-i"],"_conditionOperator":[32],"_group":[32],"_selfTop":[32],"canAddExpression":[32],"_showDashes":[32],"getExpressionGroup":[64]},[[8,"ezExpressionLayoutChanged","todoCompletedHandler"]]],[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"entityURI":[1025,"entity-u-r-i"],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["p-2c68b3ae",[[2,"snk-personalized-filter",{"messagesBuilder":[1040],"entityUri":[1025,"entity-uri"],"filterId":[1025,"filter-id"],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"],"_filterAssistentMode":[32],"_filterAssistent":[32],"createPersonalizedFilter":[64]}]]],["p-e8763234",[[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"showChips":[4,"show-chips"],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["p-d6e26ea8",[[2,"snk-filter-bar",{"dataUnit":[1040],"title":[1],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"mode":[1],"filterConfig":[1040],"messagesBuilder":[1040],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"allowDefault":[32],"scrollerLocked":[32],"showPersonalizedFilter":[32],"personalizedFilterId":[32],"reload":[64],"getFilterItem":[64],"updateFilterItem":[64],"addFilterItem":[64],"removeFilterItem":[64],"showFilterModal":[64]},[[0,"filterChange","filterChangeListener"]]]]],["p-7a85fd49",[[6,"snk-grid",{"columnFilterDataSource":[1040],"configName":[1,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"resourceID":[1,"resource-i-d"],"selectionToastConfig":[16],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"gridHeaderCustomSlotId":[1,"grid-header-custom-slot-id"],"topTaskbarCustomSlotId":[1,"top-taskbar-custom-slot-id"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"_showSnkFilterBar":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64],"reloadFilterBar":[64],"getFilterBar":[64],"findColumn":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFocus":[64]}]]],["p-7663f597",[[2,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"viewMode":[2,"view-mode"],"customContainerId":[1,"custom-container-id"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["p-6bb2f3e9",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"ignoreSaveMessage":[4,"ignore-save-message"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"domainMessagesBuilder":[1,"domain-messages-builder"],"fieldsToLink":[32],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64],"getFieldsWithRmp":[64],"getFieldsWithRmPrecision":[64],"getRowMetadata":[64]}]]],["p-f2809746",[[6,"snk-taskbar",{"alignRigth":[4,"align-rigth"],"customSlotId":[1,"custom-slot-id"],"customContainerId":[1,"custom-container-id"],"overflowStrategy":[1,"overflow-strategy"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"_permissions":[32],"_overFlowedElements":[32],"_customElements":[32],"_customElementsId":[32],"_slotContainer":[32],"_hiddenActionsList":[32],"_lastWidth":[32],"_hasToUpdateOverFlow":[32],"_isWaitingForSave":[32]},[[8,"snkCustomSlotElementsLoaded","handleCustomSlotElementsLoaded"]]]]],["p-54a5d52a",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"showHardFixed":[4,"show-hard-fixed"],"show":[64]}]]],["p-3b60db06",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"messagesBuilder":[1040],"_defaultType":[32]}]]],["p-95df461f",[[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16],"messagesBuilder":[1040]}]]],["p-88aa931b",[[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]],["p-8eb67fa4",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"tabItems":[16],"messagesBuilder":[1040],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["p-450c60e4",[[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"messagesBuilder":[1040],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["p-219f888d",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["p-b05d8893",[[6,"snk-crud",{"configName":[1025,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"selectionToastConfig":[16],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"domainMessagesBuilder":[1,"domain-messages-builder"],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"_canEdit":[32],"_resourceID":[32],"customContainerId":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64],"reloadFilterBar":[64],"getFilterBar":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64]}]]],["p-62ba211a",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"formLegacyConfigName":[1,"form-legacy-config-name"],"resourceID":[1,"resource-i-d"],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]],["p-8c59edd7",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32]}]]],["p-75e674ed",[[6,"snk-guides-viewer",{"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[16],"taskbarManager":[16],"messagesBuilder":[1040],"canEdit":[4,"can-edit"],"presentationMode":[1,"presentation-mode"],"resourceID":[1,"resource-i-d"],"detailTaskbarCustomContainerId":[1,"detail-taskbar-custom-container-id"],"formLegacyConfigName":[1,"form-legacy-config-name"],"_hasToCreateFieldSearch":[32],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"_fieldToGetFocus":[32],"_customEditors":[32],"_customRenders":[32],"_fieldsProps":[32],"showFormConfig":[64],"findField":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"setFieldProp":[64],"setFocus":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-7619bdb1",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"loadByPK":[16],"getKeyboardManager":[64],"isUserSup":[64],"addPendingAction":[64],"callServiceBroker":[64],"initOnboarding":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"showAlerts":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadTotals":[64],"isLoadedByPk":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64],"importScript":[64],"getApplicationPath":[64],"executeSelectDistinct":[64],"getDataFetcher":[64],"whenApplicationReady":[64],"setSearchFilterContext":[64]}]]],["p-3ab6df3d",[[2,"snk-filter-assistent-mode",{"filterAssistent":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityUri":[1025,"entity-uri"],"application":[1040]}],[2,"snk-filter-advanced-mode",{"filterAssistent":[1040],"application":[1040]}]]],["p-4e5e1313",[[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"columns":[1040],"config":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"]}],[2,"snk-actions-button",{"_items":[32],"_showDropdown":[32],"_actions":[32],"_isOrderActions":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}],[2,"taskbar-actions-button",{"title":[1],"enabled":[4],"actions":[16],"_showDropdown":[32],"showActions":[64],"hideActions":[64],"isOpened":[64]},[[8,"keydown","handleKeyDown"],[8,"ezOpenModal","handleClose"]]]]],["p-871aa14e",[[6,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"resourceID":[1,"resource-i-d"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[1040],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"customEditors":[16],"customRenders":[16],"_disabledButtons":[32],"_currentView":[32],"attachmentRegisterKey":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64],"addCustomEditor":[64],"addGridCustomRender":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]]]'),e)));
1
+ import{p as e,b as t}from"./p-d2d301a6.js";export{s as setNonce}from"./p-d2d301a6.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t(JSON.parse('[["p-118e769b",[[1,"teste-pesquisa"]]],["p-70a4af56",[[0,"snk-filter-modal",{"getMessage":[16],"configName":[1025,"config-name"],"filters":[1040],"applyFilters":[16],"closeModal":[16],"addPersonalizedFilter":[16],"editPersonalizedFilter":[16],"deletePersonalizedFilter":[16],"filtersToDelete":[16],"disablePersonalizedFilter":[4,"disable-personalized-filter"]},[[0,"deleteFilter","deletePersonalizedFilterListener"]]]]],["p-ac8d1cd6",[[2,"snk-actions-form",{"action":[16],"applyParameters":[16],"dataUnit":[32],"openPopup":[64]}]]],["p-9531fd46",[[2,"snk-client-confirm",{"titleMessage":[1,"title-message"],"message":[1],"accept":[16],"cancel":[16],"openPopup":[64]}]]],["p-21a81901",[[6,"snk-custom-slot-elements",{"slotName":[1,"slot-name"]}]]],["p-33718dfc",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"_searchValue":[32],"_ezListSource":[32],"reloadList":[64]}]]],["p-41f8bfa3",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"],"resetValues":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-aaa3ee68",[[0,"snk-filter-checkbox-list",{"config":[1040],"optionsList":[32]}]]],["p-d3f53df2",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]]]],["p-bf2acf72",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-01ba23cd",[[0,"snk-filter-number",{"config":[16],"getMessage":[16],"value":[2],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-7e2ded86",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[8],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-c8622597",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-96a89d58",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["p-b11aa1e0",[[2,"snk-personalized-filter-editor",{"messagesBuilder":[1040],"presentationMode":[2,"presentation-mode"],"config":[16],"value":[1040],"items":[32],"show":[64]}]]],["p-72fc257b",[[2,"snk-print-selector",{"_printServerActive":[32],"_selectedPrinter":[32],"_remotePrintersDataSource":[32],"_localPrintersDataSource":[32],"_printJobData":[32],"openPrintSelector":[64]}]]],["p-9dfda04a",[[0,"snk-filter-modal-item",{"filterItem":[1040],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-d1791da2",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["p-684a2590",[[6,"snk-simple-crud",{"dataState":[16],"dataUnit":[16],"entityName":[1,"entity-name"],"mode":[2],"gridConfig":[1040],"formConfig":[1040],"multipleSelection":[4,"multiple-selection"],"useCancelConfirm":[4,"use-cancel-confirm"],"pageSize":[2,"page-size"],"resourceID":[1,"resource-i-d"],"taskbarManager":[16],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"actionsList":[16],"configName":[1025,"config-name"],"showConfiguratorButtons":[4,"show-configurator-buttons"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"autoFocus":[4,"auto-focus"],"domainMessagesBuilder":[1,"domain-messages-builder"],"autoLoad":[4,"auto-load"],"_showPopUpGridConfig":[32],"_showFormConfig":[32],"_currentViewMode":[32],"_config":[32],"_fieldToGetFocus":[32],"_customContainerId":[32],"_formFields":[32],"_fieldsProps":[32],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64],"openConfigurator":[64],"closeConfigurator":[64],"updateConfig":[64]},[[0,"actionClick","actionClickListener"]]]]],["p-42f7b05d",[[2,"snk-attach",{"fetcherType":[1,"fetcher-type"],"fetcher":[16],"dataUnit":[16],"dataUnitBuilder":[16],"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"_currentFetcher":[32],"_currentDataUnit":[32],"crudConfig":[32]}]]],["p-26b0ce3e",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["p-1db45d26",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"customEditors":[16],"fieldsProps":[16],"showUp":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]],["p-8002dcd0",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"searchEmpty":[32],"groupEmpty":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["p-9d3a025a",[[2,"snk-expression-group",{"parentTop":[1026,"parent-top"],"group":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityURI":[1025,"entity-u-r-i"],"_conditionOperator":[32],"_group":[32],"_selfTop":[32],"canAddExpression":[32],"_showDashes":[32],"getExpressionGroup":[64]},[[8,"ezExpressionLayoutChanged","todoCompletedHandler"]]],[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"entityURI":[1025,"entity-u-r-i"],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["p-bd008859",[[2,"snk-personalized-filter",{"messagesBuilder":[1040],"entityUri":[1025,"entity-uri"],"filterId":[1025,"filter-id"],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"],"_filterAssistentMode":[32],"_filterAssistent":[32],"createPersonalizedFilter":[64]}]]],["p-e8763234",[[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"showChips":[4,"show-chips"],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["p-62f34e6f",[[2,"snk-filter-bar",{"dataUnit":[1040],"title":[1],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"mode":[1],"filterConfig":[1040],"messagesBuilder":[1040],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"allowDefault":[32],"scrollerLocked":[32],"showPersonalizedFilter":[32],"personalizedFilterId":[32],"reload":[64],"getFilterItem":[64],"updateFilterItem":[64],"addFilterItem":[64],"removeFilterItem":[64],"showFilterModal":[64]},[[0,"filterChange","filterChangeListener"]]]]],["p-65f8c11c",[[6,"snk-grid",{"columnFilterDataSource":[1040],"configName":[1,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"resourceID":[1,"resource-i-d"],"selectionToastConfig":[16],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"gridHeaderCustomSlotId":[1,"grid-header-custom-slot-id"],"topTaskbarCustomSlotId":[1,"top-taskbar-custom-slot-id"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"_showSnkFilterBar":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64],"reloadFilterBar":[64],"getFilterBar":[64],"findColumn":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFocus":[64]}]]],["p-7663f597",[[2,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"viewMode":[2,"view-mode"],"customContainerId":[1,"custom-container-id"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["p-89451692",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"ignoreSaveMessage":[4,"ignore-save-message"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"domainMessagesBuilder":[1,"domain-messages-builder"],"fieldsToLink":[32],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64],"getFieldsWithRmp":[64],"getFieldsWithRmPrecision":[64],"getRowMetadata":[64]}]]],["p-f2809746",[[6,"snk-taskbar",{"alignRigth":[4,"align-rigth"],"customSlotId":[1,"custom-slot-id"],"customContainerId":[1,"custom-container-id"],"overflowStrategy":[1,"overflow-strategy"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"_permissions":[32],"_overFlowedElements":[32],"_customElements":[32],"_customElementsId":[32],"_slotContainer":[32],"_hiddenActionsList":[32],"_lastWidth":[32],"_hasToUpdateOverFlow":[32],"_isWaitingForSave":[32]},[[8,"snkCustomSlotElementsLoaded","handleCustomSlotElementsLoaded"]]]]],["p-54a5d52a",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"showHardFixed":[4,"show-hard-fixed"],"show":[64]}]]],["p-3b60db06",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"messagesBuilder":[1040],"_defaultType":[32]}]]],["p-95df461f",[[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16],"messagesBuilder":[1040]}]]],["p-88aa931b",[[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]],["p-8eb67fa4",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"tabItems":[16],"messagesBuilder":[1040],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["p-939e15d3",[[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"messagesBuilder":[1040],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["p-16a1dd18",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["p-53412c1d",[[6,"snk-crud",{"configName":[1025,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"selectionToastConfig":[16],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"domainMessagesBuilder":[1,"domain-messages-builder"],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"_canEdit":[32],"_resourceID":[32],"customContainerId":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64],"reloadFilterBar":[64],"getFilterBar":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64]}]]],["p-2e9c764c",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"formLegacyConfigName":[1,"form-legacy-config-name"],"resourceID":[1,"resource-i-d"],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]],["p-3c50e9d4",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32]}]]],["p-7b8f7242",[[6,"snk-guides-viewer",{"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[16],"taskbarManager":[16],"messagesBuilder":[1040],"canEdit":[4,"can-edit"],"presentationMode":[1,"presentation-mode"],"resourceID":[1,"resource-i-d"],"detailTaskbarCustomContainerId":[1,"detail-taskbar-custom-container-id"],"formLegacyConfigName":[1,"form-legacy-config-name"],"_hasToCreateFieldSearch":[32],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"_fieldToGetFocus":[32],"_customEditors":[32],"_customRenders":[32],"_fieldsProps":[32],"showFormConfig":[64],"findField":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"setFieldProp":[64],"setFocus":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-162b9a59",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"loadByPK":[16],"getKeyboardManager":[64],"isUserSup":[64],"addPendingAction":[64],"callServiceBroker":[64],"initOnboarding":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"showAlerts":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadTotals":[64],"isLoadedByPk":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64],"importScript":[64],"getApplicationPath":[64],"executeSelectDistinct":[64],"getDataFetcher":[64],"whenApplicationReady":[64],"setSearchFilterContext":[64]}]]],["p-3ab6df3d",[[2,"snk-filter-assistent-mode",{"filterAssistent":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityUri":[1025,"entity-uri"],"application":[1040]}],[2,"snk-filter-advanced-mode",{"filterAssistent":[1040],"application":[1040]}]]],["p-421bec84",[[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"columns":[1040],"config":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"]}],[2,"snk-actions-button",{"_items":[32],"_showDropdown":[32],"_actions":[32],"_isOrderActions":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}],[2,"taskbar-actions-button",{"title":[1],"enabled":[4],"actions":[16],"_showDropdown":[32],"showActions":[64],"hideActions":[64],"isOpened":[64]},[[8,"keydown","handleKeyDown"],[8,"ezOpenModal","handleClose"]]]]],["p-46bb200a",[[6,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"resourceID":[1,"resource-i-d"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[1040],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"customEditors":[16],"customRenders":[16],"_disabledButtons":[32],"_currentView":[32],"attachmentRegisterKey":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64],"addCustomEditor":[64],"addGridCustomRender":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]]]'),e)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/sankhyablocks",
3
- "version": "8.16.0-rc.3",
3
+ "version": "8.16.0-rc.5",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -25,7 +25,7 @@
25
25
  "build.prod": "npm run prebuild && stencil build --docs --prod",
26
26
  "build.with.peerdeps": "stencil build --docs --prod --force-peer-deps",
27
27
  "start": "stencil build --dev --watch --serve --force-peer-deps",
28
- "test": "stencil test --spec --e2e --coverage --silent --testResultsProcessor jest-sonar-reporter",
28
+ "test": "stencil test --spec --e2e --coverage --silent --testResultsProcessor jest-sonar-reporter --runInBand",
29
29
  "test.watch": "stencil test --spec --e2e --watchAll",
30
30
  "generate": "stencil generate",
31
31
  "build.css.docs": "node docscsstask.js",
@@ -1 +0,0 @@
1
- import{h as e,r as t,g as n}from"./p-d2d301a6.js";import{ElementIDUtils as o}from"@sankhyalabs/core";import{ModalAction as i}from"@sankhyalabs/ezui/dist/collection/components/ez-modal-container";const s=({getMessage:t,changeInfo:n,data:i})=>{const{format:s,email:l}=i||{};return e("div",null,e("ez-text-input",Object.assign({label:`${t("snkExporter.emailSenderInfoStep_sendTo")} (obrigatório) *`,value:null==l?void 0:l.to,onEzChange:e=>{var t;return n("to",null===(t=e.detail)||void 0===t?void 0:t.trim())}},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${o.getInternalIDInfo("sendTo")}`})),e("ez-text-input",Object.assign({label:`${t("snkExporter.emailSenderInfoStep_subject")} (obrigatório) *`,value:null==l?void 0:l.subject,onEzChange:e=>{var t;return n("subject",null===(t=e.detail)||void 0===t?void 0:t.trim())}},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${o.getInternalIDInfo("subject")}`})),e("ez-text-area",Object.assign({label:t("snkExporter.emailSenderInfoStep_message"),value:null==l?void 0:l.message,onEzChange:e=>n("message",e.detail)},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${o.getInternalIDInfo("message")}`})),((null==l?void 0:l.attachments)||[]).map(((t,n)=>e("ez-file-item",Object.assign({class:"ez-padding-bottom--large",fileName:`${t.name}.${s}`,fileSize:t.size,canRemove:!1},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${o.getInternalIDInfo("fileItem_")+(n+1)}`})))))},l=({getMessage:t,changeInfo:n,data:i})=>{const s=(null==i?void 0:i.selectedRows)||0,l=[{label:t("snkExporter.emailSenderOptStep_formatPDF"),value:"pdf"},{label:t("snkExporter.emailSenderOptStep_formatXLSX"),value:"xlsx"}],a=[{label:t("snkExporter.emailSenderOptStep_allData"),value:"all"},{label:t("snkExporter.emailSenderOptStep_currentPage"),value:"page"}];if(s>0){const e=t(s>1?"snkExporter.emailSenderOptStep_someRecords":"snkExporter.emailSenderOptStep_oneRecord",{SELECTION_COUNT:s});a.push({label:e,value:"selection"})}return e("div",null,e("ez-radio-button",Object.assign({class:"ez-margin-bottom--large"},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${o.getInternalIDInfo("formato")}`},{label:t("snkExporter.emailSenderOptStep_lblFormat"),direction:"horizontal",value:null==i?void 0:i.format,onEzChange:e=>n("format",e.detail),options:l})),e("ez-radio-button",Object.assign({class:"ez-margin-bottom--large"},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${o.getInternalIDInfo("type")}`},{label:t("snkExporter.emailSenderOptStep_export"),value:(null==i?void 0:i.type)||"all",onEzChange:e=>n("type",e.detail),options:a})))},a=class{constructor(e){t(this,e),this._stepInfo=[{subTitle:"snkExporter.emailSenderOptStep_subtitle",firstButton:"snkExporter.emailSenderCancelButton",secondButton:"snkExporter.emailSenderNextButton",firstButtonAction:()=>this.close(),secondButtonAction:()=>this.changeStep(1)},{subTitle:"snkExporter.emailSenderInfoStep_subtitle",firstButton:"snkExporter.emailSenderBackButton",secondButton:"snkExporter.emailSenderSendButton",firstButtonAction:()=>this.changeStep(0),secondButtonAction:()=>this.send(),secondButtonEnabledTester:()=>this.isFilled(),secondButtonClass:"ez-button--primary"}],this._config=void 0,this._opened=!1,this._currentStep=0,this.getMessage=void 0}open(e){var t;return this._config=Object.assign(Object.assign({},e),{format:null!==(t=null==e?void 0:e.format)&&void 0!==t?t:"pdf"}),this._opened=!0,this.changeStep(0),new Promise((e=>{this._promiseResolver=e}))}close(){return this._opened=!1,new Promise((e=>{this._promiseResolver=e}))}getStepMessage(e){return this.getMessage((this._stepInfo[this._currentStep]||{})[e])}executeButtonAction(e){(this._stepInfo[this._currentStep]||{})[e?"firstButtonAction":"secondButtonAction"]()}checkButtonEnabled(e){const t=(this._stepInfo[this._currentStep]||{})[e?"firstButtonEnabledTester":"secondButtonEnabledTester"];return!t||t()}changeStep(e){this._currentStep=e,this._viewStack&&this._viewStack.show(this._currentStep)}send(){const{format:e,type:t,email:n,resolver:o}=this._config;o({format:e,type:t,email:n,report:void 0})}isFilled(){var e,t;return!(!(null===(e=this._config.email)||void 0===e?void 0:e.to)||!(null===(t=this._config.email)||void 0===t?void 0:t.subject))}updateEmailInfo(e,t){this._config=Object.assign(Object.assign({},this._config),{email:Object.assign(Object.assign({},this._config.email),{[e]:t})})}updateConfigInfo(e,t){this._config=Object.assign(Object.assign({},this._config),{[e]:t})}getSecondButtonClass(){return(this._stepInfo[this._currentStep]||{}).secondButtonClass||"ez-button--secondary"}render(){return o.addIDInfoIfNotExists(this._element,"snkExporterEmailSender"),e("ez-popup",{useHeader:!1,size:"x-small",heightMode:"auto",opened:this._opened},e("ez-modal-container",{onEzModalAction:e=>{e.detail===i.CLOSE&&this.close()},modalTitle:this.getMessage("snkExporter.emailSenderTitle"),modalSubTitle:this.getStepMessage("subTitle")},e("ez-view-stack",{ref:e=>this._viewStack=e},e("stack-item",null,e(l,{getMessage:this.getMessage,data:this._config,changeInfo:(e,t)=>this.updateConfigInfo(e,t)})),e("stack-item",null,e(s,{getMessage:this.getMessage,data:this._config,changeInfo:(e,t)=>this.updateEmailInfo(e,t)}))),e("div",{class:"ez-col ez-col--sd-12 ez-flex--justify-end ez-margin-vertical--small"},e("ez-button",Object.assign({class:"ez-button--tertiary ez-padding-right--medium",label:this.getStepMessage("firstButton"),onClick:()=>this.executeButtonAction(!0),enabled:this.checkButtonEnabled(!0)},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${o.getInternalIDInfo("firstButton")}`})),e("ez-button",Object.assign({class:this.getSecondButtonClass(),label:this.getStepMessage("secondButton"),onClick:()=>this.executeButtonAction(!1),enabled:this.checkButtonEnabled(!1)},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${o.getInternalIDInfo("secondButton")}`})))))}get _element(){return n(this)}};export{a as snk_exporter_email_sender}
@@ -1 +0,0 @@
1
- export{S as snk_guides_viewer}from"./p-fa4d8cb4.js";import"./p-d2d301a6.js";import"@sankhyalabs/core";import"./p-2a408684.js";import"./p-52920496.js";import"./p-df5451c7.js";import"./p-dc7c9047.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"@sankhyalabs/ezui/dist/collection/utils/form";import"./p-c2495304.js";import"./p-7e7a7473.js";import"./p-30cf616e.js";import"./p-6dc031de.js";import"./p-b0ef4383.js";import"./p-af8efd95.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"./p-fe79f83a.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"@sankhyalabs/core/dist/dataunit/DataUnit";
@@ -1 +0,0 @@
1
- import{ApplicationContext as e}from"@sankhyalabs/core";const a={saveInfo:{clone:"Duplicação realizada!",insert:"Inclusão realizada!",update:"Alteração realizada!"},cancelInfo:{clone:"Duplicação descartada!",insert:"A inclusão foi descartada!",update:"A edição foi descartada!"},confirm:{cancel:"Cancelar",delete:"Excluir",yes:"Sim",no:"Não"},removeInfo:"Registro removido com sucesso!",cancelConfirmationTitle:"Aviso",cancelConfirmation:"As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?",removeConfirmationTitle:"Aviso",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.",removeAllConfirmation:"Os <strong>{{size}} registros selecionados</strong> serão excluídos.<br/><br/><strong>Você realmente gostaria de continuar?</strong>",removeAllInfo:"Os {{size}} registros foram removidos com sucesso!",fieldNameRequired:"É necessário informar o nome da coluna."},o={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",modalInfoTextCreateFilter:"Criar filtro personalizado",modalInfoTextNoFilterRegister:"Você não possui filtros cadastrados.",modalOkButtonLabel:"Aplicar",modalCancelButtonLabel:"Limpar",binarySelectTooltip:"Exibindo registros",multiListToltip:"selecionado(a)s",onlyStartToltip:"A partir de",onlyEndToltip:"Até",fullPeriodTooltip:"Data de {{LABEL}}: {{START_LABEL}} até {{END_LABEL}}",labelStart:"Inicial",labelEnd:"Final",fullIntervalTooltip:"{{LABEL}}: {{START_LABEL}} até {{END_LABEL}}",filters:"Filtros",personalizedCount:"{{activeCount}} selecionado(s)",filterModal:{title:"Filtros",okButtonLabel:"Aplicar",cancelButtonLabel:"Limpar tudo",customFilters:"Filtros personalizados",quickFilters:"Filtros rápidos",validations:{notFullFilled:{title:"Filtro parcialmente preenchido",message:"Favor completar todas as informações do filtro."},notSaved:{title:"Atenção",message:"As alterações realizadas não serão aplicadas.<br/><br/><b>Deseja mesmo continuar?</b>"}}}},r={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",titleConfigurator:"Configurações",titleAttach:"Anexar",forbidden:"Permissão não liberada"},i={errorArray:"CrudUtils.find deve receber um array de fields, ou uma lista separada por virgula."},s={emailSenderTitle:"Enviar por email",emailSenderBackButton:"Voltar",emailSenderNextButton:"Avançar",emailSenderCancelButton:"Cancelar",emailSenderSendButton:"Enviar",emailSenderOptStep_subtitle:"Primeiro, escolha o formato do arquivo",emailSenderOptStep_lblFormat:"Formato:",emailSenderOptStep_formatPDF:"PDF (.pdf)",emailSenderOptStep_formatXLSX:"Planilha (.xlsx)",emailSenderOptStep_export:"Exportar:",emailSenderOptStep_allData:"Toda a grade",emailSenderOptStep_currentPage:"Somente a página atual",emailSenderOptStep_someRecords:"{{SELECTION_COUNT}} linhas selecionadas",emailSenderOptStep_oneRecord:"Somente a linha selecionada",emailSenderInfoStep_subtitle:"Informações de email",emailSenderInfoStep_sendTo:"Enviar para",emailSenderInfoStep_subject:"Assunto",emailSenderInfoStep_message:"Mensagem"},t={title:{clone:"Duplicar registro",insert:"Cadastrar registro",update:"Alterar registro",clean:"{{ENTITY_NAME}}"},findColumn:"Buscar campos",goBackTitle:"Voltar"},l={findColumn:"Busca de colunas",formConfigUnavaliable:{title:"Aviso",message:'A opção "Configurar formulário" será disponibilizada em breve. Enquanto isso, acesse a configuração do fomulário através dos layouts anteriores, HTML5 ou Flex.'}},n={error:{title:"Erro na Exportação",message:"O usuário não possui permissão para exportar o arquivo."},message:{exportSuccess:"Exportado com sucesso!"}},d={newVersionPopup:{title:"Boas vindas à nova interface da tela {{screenName}}",info:"Com uma jornada mais moderna, simples e intuitiva, a performance aprimorada da nova interface impulsionará a sua produtividade.",okButton:"Quero experimentar!",cancelButton:"Voltar à interface anterior"}},c={label:{nameField:"Nome do Campo *",typeValueDefault:"Tipo de valor padrão *",valueDefault:"Valor Padrão",clearDuplicate:"Limpar ao Duplicar",requiredField:"Campo Obrigatório",protectedField:"Campo Protegido"},options:{valueFixed:"Valor Fixo",variable:"Variável"}},m={title:"Configuração do formulário",goBackTitle:"Voltar",applyConfig:"Aplicar configuração",availableFields:{title:"Campos disponíveis",labelNoFields:"Nenhum campo disponível",labelOneField:"1 campo disponível",labelAvailableFields:"Campos disponíveis",labelSearchField:"Procurar campo"},form:{subTitleInfo:"Inclua estes campos nos grupos ou deixe-os separados no topo do formulário!",labelDropField:"Arraste e solte um campo aqui",labelNewGroup:"Adicionar novo grupo",mainArea:"Área principal",tabGeneral:"Geral"},confirm:{title:"Aviso",deleteTab:"Você realmente deseja excluir a aba",cancel:"As alterações realizadas serão descartadas.<br/><br/><b>Gostaria de continuar?</b>",exit:"Ao sair as alterações serão descartadas.<br/><br/><b>Você realmente gostaria de sair?</b>",apply:"A <b>{0}</b> irá substituir a sua configuração {1}!<br/><br/><b>Deseja continuar?</b>",group:"Não é possível salvar as configurações com um grupo vazio!",labelCancel:"Cancelar",labelDelete:"Excluir"},alert:{titleGroupExists:"Já existe um grupo com título",infoValidTitle:"Por favor, digite um título válido.",inTab:"na aba"},info:{successfullyConfigSaved:"As configurações foram salvas com sucesso!"}},u={titleRemove:"Remover",titleConfigurations:"Configurações",titleAdd:"Adicionar"},p={labelRename:"Renomear",labelHide:"Ocultar",labelShow:"Exibir",labelDelete:"Excluir"},f={titleConfigurations:"Configurações",subTitleModeConfig:"Modo de visualização",labelConfigGrid:"Configurar grade",labelConfigForm:"Configurar formulário",labelGrid:"Grade",labelForm:"Formulário"},b={findColumn:"Busca de colunas"},v={gridConfiguration:"Configuração da Grade",columnVisibilityOrder:"Defina visibilidade e ordem das colunas.",sortingSequence:"Sequência da ordenação",findColumn:"Localizar coluna",cancel:"Cancelar",complete:"Concluir",tab:{columns:"Colunas",lineOrdering:"Ordenação das linhas"},info:{successfullyConfigSaved:"As configurações foram salvas com sucesso!"},confirm:{cancel:"Descartar",save:"Salvar",alert:"Aviso",msgCancel:"As alterações realizadas serão descartadas. Gostaria de salvar antes de sair?"},group:{visible:"Visíveis",hidden:"Ocultas"}},g={group:{export:{default:"Exportar para",multiSelected:"Exportar {0} linhas selecionadas",selectedLine:"Exportar somente 1 linha selecionada",title:"Exportar"},custom:"Personalizado"},label:{currentPage:"Somente a página atual",allRecords:"Todos os registros",spreadsheet:"Planilha",cube:"Cubo",sendByEmail:"Enviar por email"},message:{emailSuccess:"E-mail enviado com sucesso",exportError:"Falha ao exportar dados",unknownFailure:"O motivo da falha não pode ser identificado.",exportPermission:"O usuário não possui permissão para exportar o arquivo."},title:{error:"Erro",permission:"Falha detectada"},limitExceeded:{title:"Atenção",description:"Apenas os {{limit}} primeiros registros serão exportados. Deseja continuar?",subdescription:"Caso seja necessária uma quantidade maior de registros exportados, utilize o Extrator de Dados através de um Relatório Personalizado.",cancel:"Cancelar",continue:"Continuar"}},A={modalTitle:"Configuração de valor variável",labelSystemConfig:"Usar definições do sistema",labelUserConfig:"Usar definições personalizadas",labelInstance:"Categoria",labelField:"Campo",labelDescription:"Descrição (obrigatório) *",labelType:"Tipo (obrigatório) *",labelTypeValues:{date:"Data",text:"Texto",integer:"Número Inteiro",decimal:"Número com Decimal"},labelExpression:"Expressão",labelCancel:"Cancelar",labelSave:"Salvar"},C={searchLabel:"Buscar campo",fieldLabel:"Campos de {{link}}",linkLabel:"Categorias de {{link}}",groupEmpty:"Não há categorias para seleção",searchEmpty:"Nenhum resultado encontrado"},F={backTitle:"Voltar"},x={title:"Anexar arquivos",description:"Faça o upload dos arquivos ou informe links que deseja anexar ao título",attachHint:"Fazer download do arquivo",breadcrumbTitle:"Anexar",finishedMessage:"O anexo foi finalizado com sucesso",finish:"Finalizar",cancelConfirmation:{title:"Atenção",message:"As alterações realizadas não serão aplicadas.<br/><br/><b>Deseja mesmo continuar?</b>"},alertValidation:{fileAndLinkAtTheSameTime:{title:"Atenção",message:"Não é permitido inserir o arquivo e o link ao mesmo tempo."},anyLinkOrFileFilled:{title:"Atenção",message:'É necessário preencher o campo "Link" ou anexar um arquivo.'},descriptionCannotBeChanged:{title:"Atenção",message:"O campo 'Descrição' não pode ser alterado."}},taskbar:{titleDownload:"Fazer download",titleLink:"Abrir link"},attachMetadata:{lblCode:"Código",lblDescription:"Descrição",lblFileOrLink:"Arquivo / Link",lblUser:"Usuário",lblDate:"Data de alteração",lblFile:"Arquivo",lblSubTitle:"Clique para selecionar um arquivo"}},S={info:{titleEdit:"Editar filtro personalizado",titleAdd:"Criar filtro personalizado",titleCollapsible:"Expressão a ser aplicada (gerada pelo assistente)",labelSearchField:"Buscar campo",labelOperator:"Operador",labelValueVarible:"Valor variável",titleTooltip:"Ao ativar um valor variável, é possível inserir um valor diferente sempre que o filtro for aplicado",labelAddNewExpression:"Adicionar nova linha de expressão",labelDeleteExpression:"Remover expressão",labelDeleteItem:"Remover item",labelDisabledAddGroupButton:"Filtros Personalizados possuem um limite de {{LIMIT_GROUP_LEVEL}} Grupos de Condições e Valores",labelDisabledAddExpressionButton:"Preencha campos obrigatórios ou indique valores variáveis nas expressões do grupo antes de adicionar mais itens",labelCancel:"Cancelar",labelSave:"Salvar",labelNameFilter:"Nome do filtro",labelExpression:"Expressão",badgeVariable:"variável",noDataFound:"Nenhum filtro encontrado",condition:"Condição",addGroup:"Adicionar grupo",addField:"Adicionar campo",applyExpression:"Expressão a ser aplicada:",tooltipDisabledAssistentMode:"Expressão não suportada pelo assistente.",activeModeAdvanced:"Ativar modo avançado",activeModeAssistent:"Ativar modo assistente"},confirmExpression:{title:"Aviso",description:"As informações da condição serão descartadas.</br></br><b>Gostaria de continuar?</b>"},confirmGroup:{title:"Aviso",description:"As informações do Grupo e suas Condições serão descartadas.</br></br><b>Gostaria de continuar?</b>"},confirmCancel:{title:"Aviso",description:"As alterações realizadas serão descartadas.</br></br><b>Gostaria de continuar?</b>"},confirmChangeModeAssistent:{title:"Aviso",description:"Ao modificar a expressão, o modo assistente será desabilitado.</br></br><b>Gostaria de continuar?</b>"},confirmChangeModeAdvanced:{title:"Aviso",description:"Ao retornar ao modo assistente suas alterações serão perdidas.</br></br><b>Gostaria de continuar?</b>"},confirmSaveModeAdvanced:{title:"Aviso",description:"Ao modificar a expressão, o modo assistente será desabilitado.</br></br><b>Gostaria de continuar?</b>"},operador:{firstLevel:"A seleção será habilitada a partir da adição da segunda linha de regras.",and:"Será verdadeiro se todas as condições forem obedecidas.",or:"Será verdadeiro se qualquer uma das condições for obedecida."},error:{title:"Atenção",description:"Há pelo menos um campo obrigatório não preenchido."},errorValidation:{title:"Erro na expressão"},confirmSave:{title:"Filtro criado com sucesso!"},confirmEdit:{title:"Filtro atualizado com sucesso!"},deleteConfirm:{title:"Aviso",message:"Deseja realmente excluir o filtro '{{filterName}}'?"},listActions:{edit:"Editar",delete:"Excluir"},footerActions:{clear:"Limpar",create:"Criar filtro"}},h={selected:"Selecionados:"},E={title:{actions:"Ações",error:"Erro",warning:"Aviso"},action:{incorrectAction:'A ação "{{description}}" não pode ser executada porque ela não foi salva corretamente.',emptyParamName:"<b>Regra Personalizada:</b><br/><br/>É necessário informar o atributo 'paramName'",nonExistentType:"Tipo de ação não implementada: {{this.actionType}}"},launchScreen:{emptyField:'A ação "{{description}}" não pôde ser executada porque o campo "{{localFieldLabel}}" está vazio.'},form:{fillParams:"Informe os parâmetros"},clientEvent:{cancelMessage:"Caso queira cancelar, feche esta mensagem."},buttons:{apply:"Aplicar",cancel:"Cancelar",yes:"Sim",no:"Não"}},T={title:{warning:"Aviso",printerSelection:"Seleção de impressora",remotePrintersTab:"Impressoras remotas",localPrintersTab:"Impressoras locais"},subtitle:{document:"Documento:",jobs:"Trabalhos:"},message:{canceledPrint:"A impressão será cancelada. Deseja mesmo continuar?",noPrinters:"Não há impressoras para seleção",savePrinter:"Usar sempre esta seleção"},button:{print:"Imprimir",cancel:"Cancelar",yes:"Sim",no:"Não"}};class D{constructor(D){this._defaults={snkApplication:d,snkDataUnit:a,snkFormConfig:m,snkConfigOptions:c,snkTaskbar:r,snkFieldConfig:u,snkFilterBar:o,snkConfigurator:f,snkTabConfig:p,crudUtils:i,snkGrid:b,snkGridConfig:v,snkExporter:s,snkDataExporter:g,snkCrud:t,snkSimpleCrud:l,fileViewer:n,snkFilterParamConfig:A,snkFilterFieldSearch:C,snkSimpleBar:F,snkAttach:x,snkPersonalizedFilter:S,snkEntityList:h,snkActionsButton:E,snkPrintSelector:T},this._currentOperation=L.CLEAN,this._domainName=D,this._application=e.getContextValue("__SNK__APPLICATION__"),this.loadAppMessages().then((e=>{this._appMessages=e}),(e=>{console.info("O arquivo de mensagens personalizadas não foi encontrado no caminho /messages/appmessages",e)}))}set currentOperation(e){this._currentOperation=e}getMessage(e,a){if(null==e)return;var o=e.split(".");let r=this.resolveMessage(o,this.getDomainMessages());if(null==r&&(r=this.resolveMessage(o,this._defaults)),this.customMessageBuilder){const o=this.customMessageBuilder(e,r,a);r=o.message,a=o.params}return this.postProcess(r,a)}getDomainMessages(){if(this._appMessages)return this._domainName?this._appMessages[this._domainName]:this._appMessages.Global||this._appMessages}resolveMessage(e,a){if(null==a)return;const o=a[e[0]];return o?this.isOperationSensitive(o)?o[this._currentOperation]:1===e.length||null==o||"string"==typeof o?o:this.resolveMessage(e.slice(1),o):void 0}isOperationSensitive(e){return null!=e[L.CLONE]||null!=e[L.INSERT]||null!=e[L.UPDATE]||null!=e[L.CLEAN]}postProcess(e,a){if(e){const o=/(.*?)\{\{(.+?)\}\}/g;let r,i="",s=e;for(;null!==(r=o.exec(e));){const[o,t,l]=r,n=r.index+o.length;s=n<e.length?e.substring(n):"";let d=a?a[l]:void 0;null==d&&(d=""),i+=t+d}return i+s}return e}async loadAppMessages(){const e=await this._application.getApplicationPath();return(await import(`${e}/messages/appmessages.js`)).default}}var L;!function(e){e.CLONE="clone",e.INSERT="insert",e.UPDATE="update",e.CLEAN="clean"}(L||(L={}));export{L as O,D as S}
@@ -1 +0,0 @@
1
- import{r as t,h as e,H as i,g as s}from"./p-d2d301a6.js";import{ApplicationContext as o,ObjectUtils as r,UserInterface as n,DataType as l,ElementIDUtils as a}from"@sankhyalabs/core";import{ApplicationUtils as d,DialogType as h}from"@sankhyalabs/ezui/dist/collection/utils";import{D as c,a as p,b as u}from"./p-30cf616e.js";import{R as m}from"./p-b0ef4383.js";import{D as v}from"./p-dc7c9047.js";import{S as x}from"./p-17def7cd.js";import"./p-af8efd95.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-fe79f83a.js";import"./p-ff1990ad.js";import"./p-df5451c7.js";import"./p-8d884fab.js";import"./p-7ef9c55c.js";import"./p-9863d682.js";import"@sankhyalabs/core/dist/dataunit/metadata/DataType";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";class f{constructor(t,e){this._selectedNumber=0,this._getMessage=t,this._selectedNumber=e}setExportOption(t,e){const i=this.getExportGroupName();t===c.EXPORT_TO_PDF&&e.push(this.getExportToPDF(i)),t===c.EXPORT_TO_XLS&&e.push(this.getExportToXLS(i)),this.setExportCurrentPage(t,e),this._selectedNumber>0&&this.setExportAllRecords(t,e),this.setExportByEmail(t,e)}setExportCurrentPage(t,e){var i;const s=[c.EXPORT_PAGE_TO_PDF,c.EXPORT_PAGE_TO_XLS];if(t===c.EXPORT_CURRENT_PAGE&&e.push(this.getCurrentPage()),s.includes(t)){let s=e.find((t=>t.id===c.EXPORT_CURRENT_PAGE));null==s&&(e.push(this.getCurrentPage()),s=e.find((t=>t.id===c.EXPORT_CURRENT_PAGE))),(null===(i=null==s?void 0:s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===c.EXPORT_PAGE_TO_PDF&&s.children.push(this.getExportPageToPDF()),t===c.EXPORT_PAGE_TO_XLS&&s.children.push(this.getExportPageToXLS())}}setExportAllRecords(t,e){var i;const s=[c.EXPORT_ALL_RECORDS_TO_PDF,c.EXPORT_ALL_RECORDS_TO_XLS];if(t===c.EXPORT_ALL_RECORDS&&e.push(this.getAllRecords()),s.includes(t)){let s=e.find((t=>t.id===c.EXPORT_ALL_RECORDS));null==s&&(e.push(this.getAllRecords()),s=e.find((t=>t.id===c.EXPORT_ALL_RECORDS))),(null===(i=s.children)||void 0===i?void 0:i.length)||(s.children=[]),t===c.EXPORT_ALL_RECORDS_TO_PDF&&s.children.push(this.getExportAllRecordsToPDF()),t===c.EXPORT_ALL_RECORDS_TO_XLS&&s.children.push(this.getExportAllRecordsToXLS())}}setExportByEmail(t,e){t===c.EXPORT_BY_EMAIL&&e.push(this.getExportByEmail())}getExportToPDF(t){return{id:c.EXPORT_TO_PDF,label:"PDF (.pdf)",group:t}}getExportToXLS(t){return{id:c.EXPORT_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`,group:t}}getCurrentPage(){return{id:c.EXPORT_CURRENT_PAGE,label:this._getMessage("snkDataExporter.label.currentPage"),group:this._getMessage("snkDataExporter.group.custom")}}getAllRecords(){return{id:c.EXPORT_ALL_RECORDS,label:this._getMessage("snkDataExporter.label.allRecords"),group:this._getMessage("snkDataExporter.group.custom")}}getExportPageToPDF(){return{id:c.EXPORT_PAGE_TO_PDF,label:"PDF (.pdf)"}}getExportPageToXLS(){return{id:c.EXPORT_PAGE_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`}}getExportAllRecordsToPDF(){return{id:c.EXPORT_ALL_RECORDS_TO_PDF,label:"PDF (.pdf)"}}getExportAllRecordsToXLS(){return{id:c.EXPORT_ALL_RECORDS_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`}}getExportByEmail(){return{id:c.EXPORT_BY_EMAIL,label:`${this._getMessage("snkDataExporter.label.sendByEmail")}...`}}getExportGroupName(){return 1===this._selectedNumber?this._getMessage("snkDataExporter.group.export.selectedLine"):this._selectedNumber>1?this._getMessage("snkDataExporter.group.export.multiSelected").replace("{0}",this._selectedNumber.toString()):this._getMessage("snkDataExporter.group.export.default")}}function g(t){const e=[];let i=0;for(const s of t){if(i+=s.width,i>=800)break;e.push(s)}return e}function E(t){return Object.keys(c).find((e=>c[e]===t))}class b{constructor(t){this._provider=t}async getParsedColumns(){return g(await this._provider.getColumnsMetadata())}async getParams(t){var e,i,s,o,r,n;const l=null===(i=(e=this._provider).getFilters)||void 0===i?void 0:i.call(e),a=[p.EXPORT_TO_PDF,p.EXPORT_PAGE_TO_PDF,p.EXPORT_PDF_TO_EMAIL,p.EXPORT_ALL_RECORDS_TO_PDF].includes(E(null==t?void 0:t.exportOption))?await this.getParsedColumns():await this._provider.getColumnsMetadata(),d=null===(o=(s=this._provider).getOrders)||void 0===o?void 0:o.call(s),h=null===(n=(r=this._provider).getResourceURI)||void 0===n?void 0:n.call(r),u=this._provider.getSelectedIDs(),m=t.exportOption,v=[c.EXPORT_PAGE_TO_PDF,c.EXPORT_PAGE_TO_XLS];delete t.exportOption;let x=Object.assign({filters:l,columns:a,sort:d,resourceURI:h,selectedIDs:u.slice(0,this._provider.getExportLimit())},t);if(v.includes(m)||"page"==t.type){const t=this._provider.getOffset(),e=this._provider.getPageSize();x=Object.assign(Object.assign({},x),{offset:t,limit:e,selectedIDs:[]})}else"all"==t.type&&(x=Object.assign(Object.assign({},x),{offset:0,limit:this._provider.getExportLimit(),selectedIDs:[]}));return Promise.resolve(x)}async executeExport(t){const e=await this.getParams(t),{methodName:i}=e,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(i[s[o]]=t[s[o]])}return i}(e,["methodName"]),n=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.${i}`,l={serviceName:n,requestBody:s};return new Promise(((t,e)=>{v.get().callServiceBroker(n,r.objectToString(l)).then((e=>t(this.getFormatResponse(e)))).catch((t=>e(t)))}))}getFormatResponse(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}}class w{constructor(t){this._provider=t}async getParsedColumns(){return g(await this._provider.getColumnsMetadata())}async executeExport(t){const{methodName:e,titleGrid:i}=t,s=await this._provider.getRecords(),o=[p.EXPORT_TO_PDF,p.EXPORT_PAGE_TO_PDF,p.EXPORT_PDF_TO_EMAIL,p.EXPORT_ALL_RECORDS_TO_PDF].includes(E(null==t?void 0:t.exportOption))?await this.getParsedColumns():await this._provider.getColumnsMetadata(),[r,n]=this.getExecutor(e),l={serviceName:r,requestBody:{grid:{titleGrid:i,columns:this.buildColumnsObject(o),rows:this.buildRowsObject(o,s),customOptions:{xlsxExtension:!1}}}};return new Promise(((t,e)=>{v.get().callServiceBroker(r,l).then((e=>t(n(e)))).catch((t=>e(t)))}))}getExecutor(t){return"exportToPDF"===t?["GridPDFBuilderSP.buildPDFFromJson",t=>({fileSessionKey:t.chavePDF.valor,canPrint:"S"===t.permiteImprimir.valor,canExport:"S"===t.permiteExportar.valor,canSendEmail:"S"===t.canSendEmail.valor,useAppPrint:!0})]:["GridXLSBuilderSP.buildXLSFromJson",t=>({fileSessionKey:t.chaveXLS.valor,canPrint:!1,canExport:!1,useAppPrint:!1,canSendEmail:!1})]}buildColumnsObject(t){return{column:t.map(((t,e)=>{const{label:i,id:s,width:o,userInterface:r}=t;return Object.assign({index:e+1,id:s,label:i,width:o,presentationType:"P"},k[r]||{type:"S",align:"left"})}))}}buildRowsObject(t,e){return{row:e.map((e=>{const i={};return t.forEach(((t,s)=>i["c"+(s+1)]={$:this.formatValue(e,t)})),i}))}}formatValue(t,e){return null!=this._provider.formatValue?this._provider.formatValue(t,e):t[e.id]||""}}const k={[n.DATE]:{type:"D",align:"center"},[n.DATETIME]:{type:"H",align:"center"},[n.TIME]:{type:"I",align:"right"},[n.ELAPSEDTIME]:{type:"I",align:"right"},[n.DECIMALNUMBER]:{type:"F",align:"right"},[n.INTEGERNUMBER]:{type:"I",align:"right"},[n.SEARCH]:{type:"S",align:"right"}},D=class{constructor(e){t(this,e),this._selectedNumber=0,this._customPrefix="$custom$",this._releasedToExport=[c.EXPORT_TO_PDF,c.EXPORT_TO_XLS,c.EXPORT_BY_EMAIL,c.EXPORT_PDF_TO_EMAIL,c.EXPORT_XLS_TO_EMAIL,c.EXPORT_PAGE_TO_PDF,c.EXPORT_PAGE_TO_XLS,c.EXPORT_ALL_RECORDS_TO_PDF,c.EXPORT_ALL_RECORDS_TO_XLS],this._items=[],this._showDropdown=!1,this.provider=null,this.messagesBuilder=void 0}async exportByEmail(){const t=this._selectedNumber;this._snkEmailSender.open({type:t>0?"selection":"all",selectedRows:t,email:{attachments:[{name:this._appLabel}]},resolver:({type:t,format:e,email:{to:i,subject:s,message:o}})=>{var r;const n=null!==(r=u[null==e?void 0:e.toUpperCase()])&&void 0!==r?r:u.PDF;this.resolveExporter({type:t,methodName:n,to:i,subject:s,message:o,fileName:this._appLabel,titleGrid:this._appLabel},(()=>{this._snkEmailSender.close(),d.info(this.getMessage("snkDataExporter.message.emailSuccess"),{iconName:"check"})}))}})}getMessage(t,e){if(null==this.messagesBuilder){const t=x.getNearestInstance(this._element);t&&(this.messagesBuilder=t.messagesBuilder)}return this.messagesBuilder.getMessage(t,e)}positionDropdown(){var t;const e=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();null!=e&&null!=this._dropdownParent&&(this._dropdownParent.style.top=e.y+e.height+5+"px",this._dropdownParent.style.left=e.x+"px")}closeDropdown(t){const e=null==t?void 0:t.target;null!=e&&(e.closest(".snk-data-exporter")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}controlDropdown(){this._showDropdown=!this._showDropdown}async resolveExporter(t,e){null!=this.provider&&null!=t&&null!=e&&this.getExporterStrategy().executeExport(t).then((t=>e(t))).catch((t=>{console.error(t);let{title:e,message:i,statusMessage:s}=t||{};d.error(e||this.getMessage("snkDataExporter.message.exportError"),s||i||this.getMessage("snkDataExporter.message.unknownFailure"))}))}getExporterStrategy(){return null==this.provider.getRecords?new b(this.provider):new w(this.provider)}getOptionKey(t){return Object.keys(c).find((e=>c[e]===t))}getExportType(t){return t===c.EXPORT_ALL_RECORDS_TO_PDF||t===c.EXPORT_ALL_RECORDS_TO_XLS?"all":t===c.EXPORT_PAGE_TO_PDF||t===c.EXPORT_PAGE_TO_XLS?"page":"selection"}async dispatchExporter(t){var e,i,s;const r=this.getOptionKey(t),n=null!==(e=p[r])&&void 0!==e?e:p.EXPORT_TO_PDF,l=p[r]===p.EXPORT_TO_XLS,a={methodName:c[`EXPORT_TO_${n}`],fileName:this._appLabel,titleGrid:this._appLabel,exportOption:t,limit:null===(s=null===(i=this.provider)||void 0===i?void 0:i.getExportLimit)||void 0===s?void 0:s.call(i),type:this.getExportType(t)};await this.resolveExporter(a,(t=>{t.canExport||n===p.EXPORT_TO_PDF?function({fileSessionKey:t,isDownload:e}){const i=o.getContextValue("__SNK__APPLICATION__");window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${t}${e?"&download=S":""}`),d.info(function(t){var e;return null===(e=null==t?void 0:t.messagesBuilder)||void 0===e?void 0:e.getMessage("fileViewer.message.exportSuccess",void 0)}(i),{iconName:"check"})}(Object.assign(Object.assign({},t),{fileType:n,isDownload:l})):d.error(this.getMessage("snkDataExporter.title.permission"),this.getMessage("snkDataExporter.message.exportPermission"))}))}async processExporter(t){var e,i,s,o,r,n,l;const a=null==t?void 0:t.detail,p=[c.EXPORT_PAGE_TO_PDF,c.EXPORT_PAGE_TO_XLS],u=null===(e=null==a?void 0:a.id)||void 0===e?void 0:e.includes(this._customPrefix);if((null==a?void 0:a.id)===c.EXPORT_CURRENT_PAGE)return;const m=null===(i=this.provider)||void 0===i?void 0:i.getSelectedIDs(),v=null===(s=this.provider)||void 0===s?void 0:s.getTotalRecords(),x=null===(r=null===(o=this.provider)||void 0===o?void 0:o.getPageSize)||void 0===r?void 0:r.call(o),f=null===(l=null===(n=this.provider)||void 0===n?void 0:n.getExportLimit)||void 0===l?void 0:l.call(n);let g=!1;if(p.includes(null==a?void 0:a.id)&&x<=f||u?g=!1:(null==m?void 0:m.length)?g=m.length>f:v>f&&(g=!0),g){const t=f.toLocaleString("pt-BR",{minimumFractionDigits:0}),e={title:this.getMessage("snkDataExporter.limitExceeded.title"),description:`\n ${this.getMessage("snkDataExporter.limitExceeded.description",{limit:t})}\n <br/><br/>\n <b>\n ${this.getMessage("snkDataExporter.limitExceeded.subdescription")}\n </b>\n `,cancel:this.getMessage("snkDataExporter.limitExceeded.cancel"),confirm:this.getMessage("snkDataExporter.limitExceeded.continue")};if(!await d.confirm(e.title,e.description,null,h.WARN,{labelCancel:e.cancel,labelConfirm:e.confirm}))return}if(u)return this.openPersonalizedReports(a.id),void(this._showDropdown=!1);this.getFilteredReleasedToExport().includes(null==a?void 0:a.id)&&(a.id===c.EXPORT_BY_EMAIL?this.exportByEmail():this.dispatchExporter(a.id),this._showDropdown=!1)}getFilteredReleasedToExport(){var t,e;if(null==this.provider)return this._releasedToExport;const i=null===(e=(t=this.provider).getHiddenOptions)||void 0===e?void 0:e.call(t);return null==i?this._releasedToExport:this._releasedToExport.filter((t=>!i.includes(t)))}loadItems(){const t=[];this.getFilteredReleasedToExport().forEach((e=>{var i;null===(i=this._itemBuilder)||void 0===i||i.setExportOption(e,t)})),this.loadPersonalizedItems(t)}async loadPersonalizedItems(t){var e,i;const s=null===(i=null===(e=this.provider)||void 0===e?void 0:e.getRecordID)||void 0===i?void 0:i.call(e);if(null==s)return void(this._items=t);const n=await function(t){const e=`${o.getContextValue("__SNK__APPLICATION__").getModuleName()}@DataExporterSPBean.getPersonalizedReports`,i={serviceName:e,requestBody:t};return new Promise(((t,s)=>v.get().callServiceBroker(e,r.objectToString(i)).then((e=>t(function(t){var e;const i=null===(e=null==t?void 0:t.json)||void 0===e?void 0:e.$;if(null!=i)return r.stringToObject(i)}(e)))).catch((t=>s(t)))))}({recordID:s});null==n||n.forEach((e=>{t.push({id:`${this._customPrefix}_${e.ID}`,label:e.label,group:this.getMessage("snkDataExporter.group.custom")})})),this._items=t}openPersonalizedReports(t){var e,i;const s=[],o=(null==t?void 0:t.replace(this._customPrefix,""))||"";null===(i=null===(e=this.provider)||void 0===e?void 0:e.getSelectedIDs)||void 0===i||i.call(e).forEach((({name:t,type:e,value:i},o)=>{const r={fields:[]};0===o&&(s[`PK_${t}`]={type:this.parseDataType(e),value:i},s.pks=[]);const n={nome:`PK_${t}`,tipo:this.parseDataType(e),valor:i};r.fields.push(n),s.pks.push(r)})),this._application.openApp(`${m}${o}`,s)}parseDataType(t){switch(t){case l.NUMBER:return"I";case l.DATE:return"D";default:return"S"}}loadDropdown(){var t;this._selectedNumber=(null===(t=this.provider)||void 0===t?void 0:t.getSelectedNumber())||0,this._itemBuilder=new f(this.getMessage.bind(this),this._selectedNumber),this.loadItems()}getElementID(t){return{[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:a.getInternalIDInfo(t)}}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}componentWillLoad(){var t;this._application=o.getContextValue("__SNK__APPLICATION__"),null===(t=this._application)||void 0===t||t.getAppLabel().then((t=>this._appLabel=t)),this.setEvents()}componentDidLoad(){null!=this._element&&(a.addIDInfo(this._element),this.positionDropdown())}componentWillUpdate(){var t;this._showDropdown&&!(null===(t=this._items)||void 0===t?void 0:t.length)&&this.loadDropdown()}componentDidUpdate(){var t;this._showDropdown?this.positionDropdown():(null===(t=this._items)||void 0===t?void 0:t.length)>0&&(this._items=[])}render(){return e(i,null,e("div",{class:`snk-data-exporter\n ${this.canShowDropdown()?" ez-elevation--16":""}\n `},e("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"file-download",size:"small",mode:"icon",title:this.getMessage("snkDataExporter.group.export.title"),onClick:()=>this.controlDropdown()},this.getElementID("button"))),e("div",Object.assign({ref:t=>this._dropdownParent=t,class:`snk-data-exporter__dropdown\n ${this.canShowDropdown()?"snk-data-exporter__dropdown--show":""}\n `},this.getElementID("dropdown")),this.canShowDropdown()&&e("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.processExporter(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&e("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))),e("snk-exporter-email-sender",Object.assign({ref:t=>this._snkEmailSender=t,getMessage:(t,e)=>this.getMessage(t,e)},this.getElementID("snkExporterEmailSender"))))}get _element(){return s(this)}};D.style=".sc-snk-data-exporter-h{display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content}.snk-data-exporter__dropdown.sc-snk-data-exporter{display:none}.snk-data-exporter__dropdown--show.sc-snk-data-exporter{display:flex;flex-direction:column;position:fixed}.snk-data-exporter__dropdown.sc-snk-data-exporter>ez-dropdown.sc-snk-data-exporter{position:relative}";export{D as snk_data_exporter}
@@ -1 +0,0 @@
1
- import{DataType as t,ApplicationContext as e,StringUtils as n,ErrorException as i,WarningException as r,ObjectUtils as s}from"@sankhyalabs/core";import{P as o}from"./p-8d884fab.js";import{DataUnitTransient as u}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(t,e,n){return t(n={path:e,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var l=c((function(t,e){var n="undefined"!=typeof self?self:a,i=function(){function t(){this.fetch=!1,this.DOMException=n.DOMException}return t.prototype=n,new t}();!function(t){!function(e){var n="URLSearchParams"in t,i="Symbol"in t&&"iterator"in Symbol,r="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),s="FormData"in t,o="ArrayBuffer"in t;if(o)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(t){return t&&u.indexOf(Object.prototype.toString.call(t))>-1};function c(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i&&(e[Symbol.iterator]=function(){return e}),e}function f(t){this.map={},t instanceof f?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function v(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function p(t){var e=new FileReader,n=v(e);return e.readAsArrayBuffer(t),n}function m(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:s&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&r&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=m(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||a(t))?this._bodyArrayBuffer=m(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?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(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var t=d(this);if(t)return t;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 t,e,n,i=d(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,n=v(e=new FileReader),e.readAsText(t),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),i=0;i<e.length;i++)n[i]=String.fromCharCode(e[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(t,e){t=c(t),e=l(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},f.prototype.delete=function(t){delete this.map[c(t)]},f.prototype.get=function(t){return t=c(t),this.has(t)?this.map[t]:null},f.prototype.has=function(t){return this.map.hasOwnProperty(c(t))},f.prototype.set=function(t,e){this.map[c(t)]=l(e)},f.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},f.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),h(t)},f.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),h(t)},f.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),h(t)},i&&(f.prototype[Symbol.iterator]=f.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(t,e){var n,i,r=(e=e||{}).body;if(t instanceof w){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new f(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new f(e.headers)),this.method=(i=(n=e.method||this.method||"GET").toUpperCase(),b.indexOf(i)>-1?i:n),this.mode=e.mode||this.mode||null,this.signal=e.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(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(r))}})),e}function O(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new f(e.headers),this.url=e.url||"",this._initBody(t)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},y.call(w.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 t=new O(null,{status:0,statusText:""});return t.type="error",t};var E=[301,302,303,307,308];O.redirect=function(t,e){if(-1===E.indexOf(e))throw new RangeError("Invalid status code");return new O(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function T(t,n){return new Promise((function(i,s){var o=new w(t,n);if(o.signal&&o.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function a(){u.abort()}u.onload=function(){var t,e,n={status:u.status,statusText:u.statusText,headers:(t=u.getAllResponseHeaders()||"",e=new f,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var n=t.split(":"),i=n.shift().trim();if(i){var r=n.join(":").trim();e.append(i,r)}})),e)};n.url="responseURL"in u?u.responseURL:n.headers.get("X-Request-URL"),i(new O("response"in u?u.response:u.responseText,n))},u.onerror=function(){s(new TypeError("Network request failed"))},u.ontimeout=function(){s(new TypeError("Network request failed"))},u.onabort=function(){s(new e.DOMException("Aborted","AbortError"))},u.open(o.method,o.url,!0),"include"===o.credentials?u.withCredentials=!0:"omit"===o.credentials&&(u.withCredentials=!1),"responseType"in u&&r&&(u.responseType="blob"),o.headers.forEach((function(t,e){u.setRequestHeader(e,t)})),o.signal&&(o.signal.addEventListener("abort",a),u.onreadystatechange=function(){4===u.readyState&&o.signal.removeEventListener("abort",a)}),u.send(void 0===o._bodyInit?null:o._bodyInit)}))}T.polyfill=!0,t.fetch||(t.fetch=T,t.Headers=f,t.Request=w,t.Response=O),e.Headers=f,e.Request=w,e.Response=O,e.fetch=T,Object.defineProperty(e,"__esModule",{value:!0})}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=i;(e=r.fetch).default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,t.exports=e})),h=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isObjectLike=function(t){return"object"==typeof t&&null!==t}})),f=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.invariant=function(t,e){if(!Boolean(t))throw new Error(null!=e?e:"Unexpected invariant triggered.")}})),d=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getLocation=function(t,e){let i=0,r=1;for(const s of t.body.matchAll(n)){if("number"==typeof s.index||(0,f.invariant)(!1),s.index>=e)break;i=s.index+s[0].length,r+=1}return{line:r,column:e+1-i}};const n=/\r\n|[\n\r]/g})),v=c((function(t,e){function n(t,e){const n=t.locationOffset.column-1,r="".padStart(n)+t.body,s=e.line-1,o=e.line+(t.locationOffset.line-1),u=e.column+(1===e.line?n:0),a=`${t.name}:${o}:${u}\n`,c=r.split(/\r\n|[\n\r]/g),l=c[s];if(l.length>120){const t=Math.floor(u/80),e=u%80,n=[];for(let t=0;t<l.length;t+=80)n.push(l.slice(t,t+80));return a+i([[`${o} |`,n[0]],...n.slice(1,t+1).map((t=>["|",t])),["|","^".padStart(e)],["|",n[t+1]]])}return a+i([[o-1+" |",c[s-1]],[`${o} |`,l],["|","^".padStart(u)],[`${o+1} |`,c[s+1]]])}function i(t){const e=t.filter((([t,e])=>void 0!==e)),n=Math.max(...e.map((([t])=>t.length)));return e.map((([t,e])=>t.padStart(n)+(e?" "+e:""))).join("\n")}Object.defineProperty(e,"__esModule",{value:!0}),e.printLocation=function(t){return n(t.source,(0,d.getLocation)(t.source,t.start))},e.printSourceLocation=n})),p=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphQLError=void 0,e.formatError=function(t){return t.toJSON()},e.printError=function(t){return t.toString()};class n extends Error{constructor(t,...e){var r,s,o;const{nodes:u,source:a,positions:c,path:l,originalError:f,extensions:v}=function(t){const e=t[0];return null==e||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}(e);super(t),this.name="GraphQLError",this.path=null!=l?l:void 0,this.originalError=null!=f?f:void 0,this.nodes=i(Array.isArray(u)?u:u?[u]:void 0);const p=i(null===(r=this.nodes)||void 0===r?void 0:r.map((t=>t.loc)).filter((t=>null!=t)));this.source=null!=a?a:null==p||null===(s=p[0])||void 0===s?void 0:s.source,this.positions=null!=c?c:null==p?void 0:p.map((t=>t.start)),this.locations=c&&a?c.map((t=>(0,d.getLocation)(a,t))):null==p?void 0:p.map((t=>(0,d.getLocation)(t.source,t.start)));const m=(0,h.isObjectLike)(null==f?void 0:f.extensions)?null==f?void 0:f.extensions:void 0;this.extensions=null!==(o=null!=v?v:m)&&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!=f&&f.stack?Object.defineProperty(this,"stack",{value:f.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 t=this.message;if(this.nodes)for(const e of this.nodes)e.loc&&(t+="\n\n"+(0,v.printLocation)(e.loc));else if(this.source&&this.locations)for(const e of this.locations)t+="\n\n"+(0,v.printSourceLocation)(this.source,e);return t}toJSON(){const t={message:this.message};return null!=this.locations&&(t.locations=this.locations),null!=this.path&&(t.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function i(t){return void 0===t||0===t.length?void 0:t}e.GraphQLError=n})),m=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.syntaxError=function(t,e,n){return new p.GraphQLError(`Syntax Error: ${n}`,{source:t,positions:[e]})}})),y=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Token=e.QueryDocumentKeys=e.OperationTypeNode=e.Location=void 0,e.isNode=function(t){const e=null==t?void 0:t.kind;return"string"==typeof e&&s.has(e)};class n{constructor(t,e,n){this.start=t.start,this.end=e.end,this.startToken=t,this.endToken=e,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}e.Location=n;class i{constructor(t,e,n,i,r,s){this.kind=t,this.start=e,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}}}e.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"]};e.QueryDocumentKeys=r;const s=new Set(Object.keys(r));var o;e.OperationTypeNode=o,function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"}(o||(e.OperationTypeNode=o={}))})),b=c((function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DirectiveLocation=void 0,e.DirectiveLocation=n,function(t){t.QUERY="QUERY",t.MUTATION="MUTATION",t.SUBSCRIPTION="SUBSCRIPTION",t.FIELD="FIELD",t.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",t.FRAGMENT_SPREAD="FRAGMENT_SPREAD",t.INLINE_FRAGMENT="INLINE_FRAGMENT",t.VARIABLE_DEFINITION="VARIABLE_DEFINITION",t.SCHEMA="SCHEMA",t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.FIELD_DEFINITION="FIELD_DEFINITION",t.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.ENUM_VALUE="ENUM_VALUE",t.INPUT_OBJECT="INPUT_OBJECT",t.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(n||(e.DirectiveLocation=n={}))})),w=c((function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.Kind=void 0,e.Kind=n,function(t){t.NAME="Name",t.DOCUMENT="Document",t.OPERATION_DEFINITION="OperationDefinition",t.VARIABLE_DEFINITION="VariableDefinition",t.SELECTION_SET="SelectionSet",t.FIELD="Field",t.ARGUMENT="Argument",t.FRAGMENT_SPREAD="FragmentSpread",t.INLINE_FRAGMENT="InlineFragment",t.FRAGMENT_DEFINITION="FragmentDefinition",t.VARIABLE="Variable",t.INT="IntValue",t.FLOAT="FloatValue",t.STRING="StringValue",t.BOOLEAN="BooleanValue",t.NULL="NullValue",t.ENUM="EnumValue",t.LIST="ListValue",t.OBJECT="ObjectValue",t.OBJECT_FIELD="ObjectField",t.DIRECTIVE="Directive",t.NAMED_TYPE="NamedType",t.LIST_TYPE="ListType",t.NON_NULL_TYPE="NonNullType",t.SCHEMA_DEFINITION="SchemaDefinition",t.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",t.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",t.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",t.FIELD_DEFINITION="FieldDefinition",t.INPUT_VALUE_DEFINITION="InputValueDefinition",t.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",t.UNION_TYPE_DEFINITION="UnionTypeDefinition",t.ENUM_TYPE_DEFINITION="EnumTypeDefinition",t.ENUM_VALUE_DEFINITION="EnumValueDefinition",t.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",t.DIRECTIVE_DEFINITION="DirectiveDefinition",t.SCHEMA_EXTENSION="SchemaExtension",t.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",t.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",t.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",t.UNION_TYPE_EXTENSION="UnionTypeExtension",t.ENUM_TYPE_EXTENSION="EnumTypeExtension",t.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(n||(e.Kind=n={}))})),g=c((function(t,e){function n(t){return t>=48&&t<=57}function i(t){return t>=97&&t<=122||t>=65&&t<=90}Object.defineProperty(e,"__esModule",{value:!0}),e.isDigit=n,e.isLetter=i,e.isNameContinue=function(t){return i(t)||n(t)||95===t},e.isNameStart=function(t){return i(t)||95===t},e.isWhiteSpace=function(t){return 9===t||32===t}})),O=c((function(t,e){function n(t){let e=0;for(;e<t.length&&(0,g.isWhiteSpace)(t.charCodeAt(e));)++e;return e}Object.defineProperty(e,"__esModule",{value:!0}),e.dedentBlockStringLines=function(t){var e;let i=Number.MAX_SAFE_INTEGER,r=null,s=-1;for(let e=0;e<t.length;++e){var o;const u=t[e],a=n(u);a!==u.length&&(r=null!==(o=r)&&void 0!==o?o:e,s=e,0!==e&&a<i&&(i=a))}return t.map(((t,e)=>0===e?t:t.slice(i))).slice(null!==(e=r)&&void 0!==e?e:0,s+1)},e.isPrintableAsBlockString=function(t){if(""===t)return!0;let e=!0,n=!1,i=!0,r=!1;for(let s=0;s<t.length;++s)switch(t.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(e&&!r)return!1;r=!0,e=!0,n=!1;break;case 9:case 32:n||(n=e);break;default:i&&(i=n),e=!1}return!e&&(!i||!r)},e.printBlockString=function(t,e){const n=t.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=1===i.length,s=i.length>1&&i.slice(1).every((t=>0===t.length||(0,g.isWhiteSpace)(t.charCodeAt(0)))),o=n.endsWith('\\"""'),u=t.endsWith('"')&&!o,a=t.endsWith("\\"),c=u||a,l=!(null!=e&&e.minimize)&&(!r||t.length>70||c||s||o);let h="";const f=r&&(0,g.isWhiteSpace)(t.charCodeAt(0));return(l&&!f||s)&&(h+="\n"),h+=n,(l||c)&&(h+="\n"),'"""'+h+'"""'}})),E=c((function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.TokenKind=void 0,e.TokenKind=n,function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"}(n||(e.TokenKind=n={}))})),T=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Lexer=void 0,e.isPunctuatorTokenKind=function(t){return t===E.TokenKind.BANG||t===E.TokenKind.DOLLAR||t===E.TokenKind.AMP||t===E.TokenKind.PAREN_L||t===E.TokenKind.PAREN_R||t===E.TokenKind.SPREAD||t===E.TokenKind.COLON||t===E.TokenKind.EQUALS||t===E.TokenKind.AT||t===E.TokenKind.BRACKET_L||t===E.TokenKind.BRACKET_R||t===E.TokenKind.BRACE_L||t===E.TokenKind.PIPE||t===E.TokenKind.BRACE_R};class n{constructor(t){const e=new y.Token(E.TokenKind.SOF,0,0,0,0);this.source=t,this.lastToken=e,this.token=e,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==E.TokenKind.EOF)do{if(t.next)t=t.next;else{const e=c(this,t.end);t.next=e,e.prev=t,t=e}}while(t.kind===E.TokenKind.COMMENT);return t}}function i(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function r(t,e){return s(t.charCodeAt(e))&&o(t.charCodeAt(e+1))}function s(t){return t>=55296&&t<=56319}function o(t){return t>=56320&&t<=57343}function u(t,e){const n=t.source.body.codePointAt(e);if(void 0===n)return E.TokenKind.EOF;if(n>=32&&n<=126){const t=String.fromCodePoint(n);return'"'===t?"'\"'":`"${t}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function a(t,e,n,i,r){return new y.Token(e,n,i,t.line,1+n-t.lineStart,r)}function c(t,e){const n=t.source.body,s=n.length;let o=e;for(;o<s;){const e=n.charCodeAt(o);switch(e){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++t.line,t.lineStart=o;continue;case 13:10===n.charCodeAt(o+1)?o+=2:++o,++t.line,t.lineStart=o;continue;case 35:return l(t,o);case 33:return a(t,E.TokenKind.BANG,o,o+1);case 36:return a(t,E.TokenKind.DOLLAR,o,o+1);case 38:return a(t,E.TokenKind.AMP,o,o+1);case 40:return a(t,E.TokenKind.PAREN_L,o,o+1);case 41:return a(t,E.TokenKind.PAREN_R,o,o+1);case 46:if(46===n.charCodeAt(o+1)&&46===n.charCodeAt(o+2))return a(t,E.TokenKind.SPREAD,o,o+3);break;case 58:return a(t,E.TokenKind.COLON,o,o+1);case 61:return a(t,E.TokenKind.EQUALS,o,o+1);case 64:return a(t,E.TokenKind.AT,o,o+1);case 91:return a(t,E.TokenKind.BRACKET_L,o,o+1);case 93:return a(t,E.TokenKind.BRACKET_R,o,o+1);case 123:return a(t,E.TokenKind.BRACE_L,o,o+1);case 124:return a(t,E.TokenKind.PIPE,o,o+1);case 125:return a(t,E.TokenKind.BRACE_R,o,o+1);case 34:return 34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)?S(t,o):d(t,o)}if((0,g.isDigit)(e)||45===e)return h(t,o,e);if((0,g.isNameStart)(e))return j(t,o);throw(0,m.syntaxError)(t.source,o,39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":i(e)||r(n,o)?`Unexpected character: ${u(t,o)}.`:`Invalid character: ${u(t,o)}.`)}return a(t,E.TokenKind.EOF,s,s)}function l(t,e){const n=t.source.body,s=n.length;let o=e+1;for(;o<s;){const t=n.charCodeAt(o);if(10===t||13===t)break;if(i(t))++o;else{if(!r(n,o))break;o+=2}}return a(t,E.TokenKind.COMMENT,e,o,n.slice(e+1,o))}function h(t,e,n){const i=t.source.body;let r=e,s=n,o=!1;if(45===s&&(s=i.charCodeAt(++r)),48===s){if(s=i.charCodeAt(++r),(0,g.isDigit)(s))throw(0,m.syntaxError)(t.source,r,`Invalid number, unexpected digit after 0: ${u(t,r)}.`)}else r=f(t,r,s),s=i.charCodeAt(r);if(46===s&&(o=!0,s=i.charCodeAt(++r),r=f(t,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(t,r,s),s=i.charCodeAt(r)),46===s||(0,g.isNameStart)(s))throw(0,m.syntaxError)(t.source,r,`Invalid number, expected digit but got: ${u(t,r)}.`);return a(t,o?E.TokenKind.FLOAT:E.TokenKind.INT,e,r,i.slice(e,r))}function f(t,e,n){if(!(0,g.isDigit)(n))throw(0,m.syntaxError)(t.source,e,`Invalid number, expected digit but got: ${u(t,e)}.`);const i=t.source.body;let r=e+1;for(;(0,g.isDigit)(i.charCodeAt(r));)++r;return r}function d(t,e){const n=t.source.body,s=n.length;let o=e+1,c=o,l="";for(;o<s;){const s=n.charCodeAt(o);if(34===s)return l+=n.slice(c,o),a(t,E.TokenKind.STRING,e,o+1,l);if(92!==s){if(10===s||13===s)break;if(i(s))++o;else{if(!r(n,o))throw(0,m.syntaxError)(t.source,o,`Invalid character within String: ${u(t,o)}.`);o+=2}}else{l+=n.slice(c,o);const e=117===n.charCodeAt(o+1)?123===n.charCodeAt(o+2)?v(t,o):p(t,o):T(t,o);l+=e.value,o+=e.size,c=o}}throw(0,m.syntaxError)(t.source,o,"Unterminated string.")}function v(t,e){const n=t.source.body;let r=0,s=3;for(;s<12;){const t=n.charCodeAt(e+s++);if(125===t){if(s<5||!i(r))break;return{value:String.fromCodePoint(r),size:s}}if(r=r<<4|w(t),r<0)break}throw(0,m.syntaxError)(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+s)}".`)}function p(t,e){const n=t.source.body,r=b(n,e+2);if(i(r))return{value:String.fromCodePoint(r),size:6};if(s(r)&&92===n.charCodeAt(e+6)&&117===n.charCodeAt(e+7)){const t=b(n,e+8);if(o(t))return{value:String.fromCodePoint(r,t),size:12}}throw(0,m.syntaxError)(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+6)}".`)}function b(t,e){return w(t.charCodeAt(e))<<12|w(t.charCodeAt(e+1))<<8|w(t.charCodeAt(e+2))<<4|w(t.charCodeAt(e+3))}function w(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function T(t,e){const n=t.source.body;switch(n.charCodeAt(e+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,m.syntaxError)(t.source,e,`Invalid character escape sequence: "${n.slice(e,e+2)}".`)}function S(t,e){const n=t.source.body,s=n.length;let o=t.lineStart,c=e+3,l=c,h="";const f=[];for(;c<s;){const s=n.charCodeAt(c);if(34===s&&34===n.charCodeAt(c+1)&&34===n.charCodeAt(c+2)){h+=n.slice(l,c),f.push(h);const i=a(t,E.TokenKind.BLOCK_STRING,e,c+3,(0,O.dedentBlockStringLines)(f).join("\n"));return t.line+=f.length-1,t.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,m.syntaxError)(t.source,c,`Invalid character within String: ${u(t,c)}.`);c+=2}else h+=n.slice(l,c),f.push(h),13===s&&10===n.charCodeAt(c+1)?c+=2:++c,h="",l=c,o=c;else h+=n.slice(l,c),l=c+1,c+=4}throw(0,m.syntaxError)(t.source,c,"Unterminated string.")}function j(t,e){const n=t.source.body,i=n.length;let r=e+1;for(;r<i;){const t=n.charCodeAt(r);if(!(0,g.isNameContinue)(t))break;++r}return a(t,E.TokenKind.NAME,e,r,n.slice(e,r))}e.Lexer=n})),S=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.devAssert=function(t,e){if(!Boolean(t))throw new Error(e)}})),j=c((function(t,e){function n(t,e){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return function(t,e){if(null===t)return"null";if(e.includes(t))return"[Circular]";const i=[...e,t];if(function(t){return"function"==typeof t.toJSON}(t)){const e=t.toJSON();if(e!==t)return"string"==typeof e?e:n(e,i)}else if(Array.isArray(t))return function(t,e){if(0===t.length)return"[]";if(e.length>2)return"[Array]";const i=Math.min(10,t.length),r=t.length-i,s=[];for(let r=0;r<i;++r)s.push(n(t[r],e));return 1===r?s.push("... 1 more item"):r>1&&s.push(`... ${r} more items`),"["+s.join(", ")+"]"}(t,i);return function(t,e){const i=Object.entries(t);if(0===i.length)return"{}";if(e.length>2)return"["+function(t){const e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if("Object"===e&&"function"==typeof t.constructor){const e=t.constructor.name;if("string"==typeof e&&""!==e)return e}return e}(t)+"]";const r=i.map((([t,i])=>t+": "+n(i,e)));return"{ "+r.join(", ")+" }"}(t,i)}(t,e);default:return String(t)}}Object.defineProperty(e,"__esModule",{value:!0}),e.inspect=function(t){return n(t,[])}})),D=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.instanceOf=void 0,e.instanceOf=function(t,e){return t instanceof e}})),x=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Source=void 0,e.isSource=function(t){return(0,D.instanceOf)(t,n)};class n{constructor(t,e="GraphQL request",n={line:1,column:1}){"string"==typeof t||(0,S.devAssert)(!1,`Body must be a string. Received: ${(0,j.inspect)(t)}.`),this.body=t,this.name=e,this.locationOffset=n,this.locationOffset.line>0||(0,S.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,S.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}e.Source=n})),I=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Parser=void 0,e.parse=function(t,e){return new n(t,e).parseDocument()},e.parseConstValue=function(t,e){const i=new n(t,e);i.expectToken(E.TokenKind.SOF);const r=i.parseConstValueLiteral();return i.expectToken(E.TokenKind.EOF),r},e.parseType=function(t,e){const i=new n(t,e);i.expectToken(E.TokenKind.SOF);const r=i.parseTypeReference();return i.expectToken(E.TokenKind.EOF),r},e.parseValue=function(t,e){const i=new n(t,e);i.expectToken(E.TokenKind.SOF);const r=i.parseValueLiteral(!1);return i.expectToken(E.TokenKind.EOF),r};class n{constructor(t,e={}){const n=(0,x.isSource)(t)?t:new x.Source(t);this._lexer=new T.Lexer(n),this._options=e,this._tokenCounter=0}parseName(){const t=this.expectToken(E.TokenKind.NAME);return this.node(t,{kind:w.Kind.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:w.Kind.DOCUMENT,definitions:this.many(E.TokenKind.SOF,this.parseDefinition,E.TokenKind.EOF)})}parseDefinition(){if(this.peek(E.TokenKind.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),e=t?this._lexer.lookahead():this._lexer.token;if(e.kind===E.TokenKind.NAME){switch(e.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(t)throw(0,m.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(e.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(e)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(E.TokenKind.BRACE_L))return this.node(t,{kind:w.Kind.OPERATION_DEFINITION,operation:y.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const e=this.parseOperationType();let n;return this.peek(E.TokenKind.NAME)&&(n=this.parseName()),this.node(t,{kind:w.Kind.OPERATION_DEFINITION,operation:e,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(E.TokenKind.NAME);switch(t.value){case"query":return y.OperationTypeNode.QUERY;case"mutation":return y.OperationTypeNode.MUTATION;case"subscription":return y.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(E.TokenKind.PAREN_L,this.parseVariableDefinition,E.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:w.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(E.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(E.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(E.TokenKind.DOLLAR),this.node(t,{kind:w.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:w.Kind.SELECTION_SET,selections:this.many(E.TokenKind.BRACE_L,this.parseSelection,E.TokenKind.BRACE_R)})}parseSelection(){return this.peek(E.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,e=this.parseName();let n,i;return this.expectOptionalToken(E.TokenKind.COLON)?(n=e,i=this.parseName()):i=e,this.node(t,{kind:w.Kind.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(E.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){return this.optionalMany(E.TokenKind.PAREN_L,t?this.parseConstArgument:this.parseArgument,E.TokenKind.PAREN_R)}parseArgument(t=!1){const e=this._lexer.token,n=this.parseName();return this.expectToken(E.TokenKind.COLON),this.node(e,{kind:w.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(E.TokenKind.SPREAD);const e=this.expectOptionalKeyword("on");return!e&&this.peek(E.TokenKind.NAME)?this.node(t,{kind:w.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:w.Kind.INLINE_FRAGMENT,typeCondition:e?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this.node(t,!0===this._options.allowLegacyFragmentVariables?{kind:w.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}:{kind:w.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(t){const e=this._lexer.token;switch(e.kind){case E.TokenKind.BRACKET_L:return this.parseList(t);case E.TokenKind.BRACE_L:return this.parseObject(t);case E.TokenKind.INT:return this.advanceLexer(),this.node(e,{kind:w.Kind.INT,value:e.value});case E.TokenKind.FLOAT:return this.advanceLexer(),this.node(e,{kind:w.Kind.FLOAT,value:e.value});case E.TokenKind.STRING:case E.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case E.TokenKind.NAME:switch(this.advanceLexer(),e.value){case"true":return this.node(e,{kind:w.Kind.BOOLEAN,value:!0});case"false":return this.node(e,{kind:w.Kind.BOOLEAN,value:!1});case"null":return this.node(e,{kind:w.Kind.NULL});default:return this.node(e,{kind:w.Kind.ENUM,value:e.value})}case E.TokenKind.DOLLAR:if(t){if(this.expectToken(E.TokenKind.DOLLAR),this._lexer.token.kind===E.TokenKind.NAME)throw(0,m.syntaxError)(this._lexer.source,e.start,`Unexpected variable "$${this._lexer.token.value}" in constant value.`);throw this.unexpected(e)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:w.Kind.STRING,value:t.value,block:t.kind===E.TokenKind.BLOCK_STRING})}parseList(t){return this.node(this._lexer.token,{kind:w.Kind.LIST,values:this.any(E.TokenKind.BRACKET_L,(()=>this.parseValueLiteral(t)),E.TokenKind.BRACKET_R)})}parseObject(t){return this.node(this._lexer.token,{kind:w.Kind.OBJECT,fields:this.any(E.TokenKind.BRACE_L,(()=>this.parseObjectField(t)),E.TokenKind.BRACE_R)})}parseObjectField(t){const e=this._lexer.token,n=this.parseName();return this.expectToken(E.TokenKind.COLON),this.node(e,{kind:w.Kind.OBJECT_FIELD,name:n,value:this.parseValueLiteral(t)})}parseDirectives(t){const e=[];for(;this.peek(E.TokenKind.AT);)e.push(this.parseDirective(t));return e}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const e=this._lexer.token;return this.expectToken(E.TokenKind.AT),this.node(e,{kind:w.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let e;if(this.expectOptionalToken(E.TokenKind.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(E.TokenKind.BRACKET_R),e=this.node(t,{kind:w.Kind.LIST_TYPE,type:n})}else e=this.parseNamedType();return this.expectOptionalToken(E.TokenKind.BANG)?this.node(t,{kind:w.Kind.NON_NULL_TYPE,type:e}):e}parseNamedType(){return this.node(this._lexer.token,{kind:w.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(E.TokenKind.STRING)||this.peek(E.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,e=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(E.TokenKind.BRACE_L,this.parseOperationTypeDefinition,E.TokenKind.BRACE_R);return this.node(t,{kind:w.Kind.SCHEMA_DEFINITION,description:e,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const t=this._lexer.token,e=this.parseOperationType();this.expectToken(E.TokenKind.COLON);const n=this.parseNamedType();return this.node(t,{kind:w.Kind.OPERATION_TYPE_DEFINITION,operation:e,type:n})}parseScalarTypeDefinition(){const t=this._lexer.token,e=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:w.Kind.SCALAR_TYPE_DEFINITION,description:e,name:n,directives:i})}parseObjectTypeDefinition(){const t=this._lexer.token,e=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:w.Kind.OBJECT_TYPE_DEFINITION,description:e,name:n,interfaces:i,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(E.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(E.TokenKind.BRACE_L,this.parseFieldDefinition,E.TokenKind.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,e=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(E.TokenKind.COLON);const r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(t,{kind:w.Kind.FIELD_DEFINITION,description:e,name:n,arguments:i,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(E.TokenKind.PAREN_L,this.parseInputValueDef,E.TokenKind.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,e=this.parseDescription(),n=this.parseName();this.expectToken(E.TokenKind.COLON);const i=this.parseTypeReference();let r;this.expectOptionalToken(E.TokenKind.EQUALS)&&(r=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(t,{kind:w.Kind.INPUT_VALUE_DEFINITION,description:e,name:n,type:i,defaultValue:r,directives:s})}parseInterfaceTypeDefinition(){const t=this._lexer.token,e=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:w.Kind.INTERFACE_TYPE_DEFINITION,description:e,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeDefinition(){const t=this._lexer.token,e=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(t,{kind:w.Kind.UNION_TYPE_DEFINITION,description:e,name:n,directives:i,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(E.TokenKind.EQUALS)?this.delimitedMany(E.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,e=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(t,{kind:w.Kind.ENUM_TYPE_DEFINITION,description:e,name:n,directives:i,values:r})}parseEnumValuesDefinition(){return this.optionalMany(E.TokenKind.BRACE_L,this.parseEnumValueDefinition,E.TokenKind.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,e=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:w.Kind.ENUM_VALUE_DEFINITION,description:e,name:n,directives:i})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw(0,m.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 t=this._lexer.token,e=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(t,{kind:w.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:e,name:n,directives:i,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(E.TokenKind.BRACE_L,this.parseInputValueDef,E.TokenKind.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===E.TokenKind.NAME)switch(t.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(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const e=this.parseConstDirectives(),n=this.optionalMany(E.TokenKind.BRACE_L,this.parseOperationTypeDefinition,E.TokenKind.BRACE_R);if(0===e.length&&0===n.length)throw this.unexpected();return this.node(t,{kind:w.Kind.SCHEMA_EXTENSION,directives:e,operationTypes:n})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const e=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(t,{kind:w.Kind.SCALAR_TYPE_EXTENSION,name:e,directives:n})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const e=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(t,{kind:w.Kind.OBJECT_TYPE_EXTENSION,name:e,interfaces:n,directives:i,fields:r})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const e=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(t,{kind:w.Kind.INTERFACE_TYPE_EXTENSION,name:e,interfaces:n,directives:i,fields:r})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const e=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(t,{kind:w.Kind.UNION_TYPE_EXTENSION,name:e,directives:n,types:i})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const e=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(t,{kind:w.Kind.ENUM_TYPE_EXTENSION,name:e,directives:n,values:i})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const e=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(t,{kind:w.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:e,directives:n,fields:i})}parseDirectiveDefinition(){const t=this._lexer.token,e=this.parseDescription();this.expectKeyword("directive"),this.expectToken(E.TokenKind.AT);const n=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const s=this.parseDirectiveLocations();return this.node(t,{kind:w.Kind.DIRECTIVE_DEFINITION,description:e,name:n,arguments:i,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(E.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,e=this.parseName();if(Object.prototype.hasOwnProperty.call(b.DirectiveLocation,e.value))return e;throw this.unexpected(t)}node(t,e){return!0!==this._options.noLocation&&(e.loc=new y.Location(t,this._lexer.lastToken,this._lexer.source)),e}peek(t){return this._lexer.token.kind===t}expectToken(t){const e=this._lexer.token;if(e.kind===t)return this.advanceLexer(),e;throw(0,m.syntaxError)(this._lexer.source,e.start,`Expected ${r(t)}, found ${i(e)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t&&(this.advanceLexer(),!0)}expectKeyword(t){const e=this._lexer.token;if(e.kind!==E.TokenKind.NAME||e.value!==t)throw(0,m.syntaxError)(this._lexer.source,e.start,`Expected "${t}", found ${i(e)}.`);this.advanceLexer()}expectOptionalKeyword(t){const e=this._lexer.token;return e.kind===E.TokenKind.NAME&&e.value===t&&(this.advanceLexer(),!0)}unexpected(t){const e=null!=t?t:this._lexer.token;return(0,m.syntaxError)(this._lexer.source,e.start,`Unexpected ${i(e)}.`)}any(t,e,n){this.expectToken(t);const i=[];for(;!this.expectOptionalToken(n);)i.push(e.call(this));return i}optionalMany(t,e,n){if(this.expectOptionalToken(t)){const t=[];do{t.push(e.call(this))}while(!this.expectOptionalToken(n));return t}return[]}many(t,e,n){this.expectToken(t);const i=[];do{i.push(e.call(this))}while(!this.expectOptionalToken(n));return i}delimitedMany(t,e){this.expectOptionalToken(t);const n=[];do{n.push(e.call(this))}while(this.expectOptionalToken(t));return n}advanceLexer(){const{maxTokens:t}=this._options,e=this._lexer.advance();if(void 0!==t&&e.kind!==E.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw(0,m.syntaxError)(this._lexer.source,e.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function i(t){const e=t.value;return r(t.kind)+(null!=e?` "${e}"`:"")}function r(t){return(0,T.isPunctuatorTokenKind)(t)?`"${t}"`:t}e.Parser=n})),k=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.printString=function(t){return`"${t.replace(n,i)}"`};const n=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function i(t){return r[t.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"]})),N=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BREAK=void 0,e.getEnterLeaveForKind=i,e.getVisitFn=function(t,e,n){const{enter:r,leave:s}=i(t,e);return n?s:r},e.visit=function(t,e,r=y.QueryDocumentKeys){const s=new Map;for(const t of Object.values(w.Kind))s.set(t,i(e,t));let o,u,a,c=Array.isArray(t),l=[t],h=-1,f=[],d=t;const v=[],p=[];do{h++;const t=h===l.length,i=t&&0!==f.length;if(t){if(u=0===p.length?void 0:v[v.length-1],d=a,a=p.pop(),i)if(c){d=d.slice();let t=0;for(const[e,n]of f){const i=e-t;null===n?(d.splice(i,1),t++):d[i]=n}}else{d=Object.defineProperties({},Object.getOwnPropertyDescriptors(d));for(const[t,e]of f)d[t]=e}h=o.index,l=o.keys,f=o.edits,c=o.inArray,o=o.prev}else if(a){if(u=c?h:l[h],d=a[u],null==d)continue;v.push(u)}let w;if(!Array.isArray(d)){var m,b;(0,y.isNode)(d)||(0,S.devAssert)(!1,`Invalid AST Node: ${(0,j.inspect)(d)}.`);const i=t?null===(m=s.get(d.kind))||void 0===m?void 0:m.leave:null===(b=s.get(d.kind))||void 0===b?void 0:b.enter;if(w=null==i?void 0:i.call(e,d,u,a,v,p),w===n)break;if(!1===w){if(!t){v.pop();continue}}else if(void 0!==w&&(f.push([u,w]),!t)){if(!(0,y.isNode)(w)){v.pop();continue}d=w}}var g;void 0===w&&i&&f.push([u,d]),t?v.pop():(o={inArray:c,index:h,keys:l,edits:f,prev:o},c=Array.isArray(d),l=c?d:null!==(g=r[d.kind])&&void 0!==g?g:[],h=-1,f=[],a&&p.push(a),a=d)}while(void 0!==o);return 0!==f.length?f[f.length-1][1]:t},e.visitInParallel=function(t){const e=new Array(t.length).fill(null),r=Object.create(null);for(const s of Object.values(w.Kind)){let o=!1;const u=new Array(t.length).fill(void 0),a=new Array(t.length).fill(void 0);for(let e=0;e<t.length;++e){const{enter:n,leave:r}=i(t[e],s);o||(o=null!=n||null!=r),u[e]=n,a[e]=r}o&&(r[s]={enter(...i){const r=i[0];for(let o=0;o<t.length;o++)if(null===e[o]){var s;const a=null===(s=u[o])||void 0===s?void 0:s.apply(t[o],i);if(!1===a)e[o]=r;else if(a===n)e[o]=n;else if(void 0!==a)return a}},leave(...i){const r=i[0];for(let o=0;o<t.length;o++)if(null===e[o]){var s;const r=null===(s=a[o])||void 0===s?void 0:s.apply(t[o],i);if(r===n)e[o]=n;else if(void 0!==r&&!1!==r)return r}else e[o]===r&&(e[o]=null)}})}return r};const n=Object.freeze({});function i(t,e){const n=t[e];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:t.enter,leave:t.leave}}e.BREAK=n})),_=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.print=function(t){return(0,N.visit)(t,n)};const n={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>i(t.definitions,"\n\n")},OperationDefinition:{leave(t){const e=s("(",i(t.variableDefinitions,", "),")"),n=i([t.operation,i([t.name,e]),i(t.directives," ")]," ");return("query"===n?"":n+" ")+t.selectionSet}},VariableDefinition:{leave:({variable:t,type:e,defaultValue:n,directives:r})=>t+": "+e+s(" = ",n)+s(" ",i(r," "))},SelectionSet:{leave:({selections:t})=>r(t)},Field:{leave({alias:t,name:e,arguments:n,directives:r,selectionSet:u}){const a=s("",t,": ")+e;let c=a+s("(",i(n,", "),")");return c.length>80&&(c=a+s("(\n",o(i(n,"\n")),"\n)")),i([c,i(r," "),u]," ")}},Argument:{leave:({name:t,value:e})=>t+": "+e},FragmentSpread:{leave:({name:t,directives:e})=>"..."+t+s(" ",i(e," "))},InlineFragment:{leave:({typeCondition:t,directives:e,selectionSet:n})=>i(["...",s("on ",t),i(e," "),n]," ")},FragmentDefinition:{leave:({name:t,typeCondition:e,variableDefinitions:n,directives:r,selectionSet:o})=>`fragment ${t}${s("(",i(n,", "),")")} on ${e} ${s("",i(r," ")," ")}`+o},IntValue:{leave:({value:t})=>t},FloatValue:{leave:({value:t})=>t},StringValue:{leave:({value:t,block:e})=>e?(0,O.printBlockString)(t):(0,k.printString)(t)},BooleanValue:{leave:({value:t})=>t?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:t})=>t},ListValue:{leave:({values:t})=>"["+i(t,", ")+"]"},ObjectValue:{leave:({fields:t})=>"{"+i(t,", ")+"}"},ObjectField:{leave:({name:t,value:e})=>t+": "+e},Directive:{leave:({name:t,arguments:e})=>"@"+t+s("(",i(e,", "),")")},NamedType:{leave:({name:t})=>t},ListType:{leave:({type:t})=>"["+t+"]"},NonNullType:{leave:({type:t})=>t+"!"},SchemaDefinition:{leave:({description:t,directives:e,operationTypes:n})=>s("",t,"\n")+i(["schema",i(e," "),r(n)]," ")},OperationTypeDefinition:{leave:({operation:t,type:e})=>t+": "+e},ScalarTypeDefinition:{leave:({description:t,name:e,directives:n})=>s("",t,"\n")+i(["scalar",e,i(n," ")]," ")},ObjectTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:o,fields:u})=>s("",t,"\n")+i(["type",e,s("implements ",i(n," & ")),i(o," "),r(u)]," ")},FieldDefinition:{leave:({description:t,name:e,arguments:n,type:r,directives:a})=>s("",t,"\n")+e+(u(n)?s("(\n",o(i(n,"\n")),"\n)"):s("(",i(n,", "),")"))+": "+r+s(" ",i(a," "))},InputValueDefinition:{leave:({description:t,name:e,type:n,defaultValue:r,directives:o})=>s("",t,"\n")+i([e+": "+n,s("= ",r),i(o," ")]," ")},InterfaceTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:o,fields:u})=>s("",t,"\n")+i(["interface",e,s("implements ",i(n," & ")),i(o," "),r(u)]," ")},UnionTypeDefinition:{leave:({description:t,name:e,directives:n,types:r})=>s("",t,"\n")+i(["union",e,i(n," "),s("= ",i(r," | "))]," ")},EnumTypeDefinition:{leave:({description:t,name:e,directives:n,values:o})=>s("",t,"\n")+i(["enum",e,i(n," "),r(o)]," ")},EnumValueDefinition:{leave:({description:t,name:e,directives:n})=>s("",t,"\n")+i([e,i(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:t,name:e,directives:n,fields:o})=>s("",t,"\n")+i(["input",e,i(n," "),r(o)]," ")},DirectiveDefinition:{leave:({description:t,name:e,arguments:n,repeatable:r,locations:a})=>s("",t,"\n")+"directive @"+e+(u(n)?s("(\n",o(i(n,"\n")),"\n)"):s("(",i(n,", "),")"))+(r?" repeatable":"")+" on "+i(a," | ")},SchemaExtension:{leave:({directives:t,operationTypes:e})=>i(["extend schema",i(t," "),r(e)]," ")},ScalarTypeExtension:{leave:({name:t,directives:e})=>i(["extend scalar",t,i(e," ")]," ")},ObjectTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:o})=>i(["extend type",t,s("implements ",i(e," & ")),i(n," "),r(o)]," ")},InterfaceTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:o})=>i(["extend interface",t,s("implements ",i(e," & ")),i(n," "),r(o)]," ")},UnionTypeExtension:{leave:({name:t,directives:e,types:n})=>i(["extend union",t,i(e," "),s("= ",i(n," | "))]," ")},EnumTypeExtension:{leave:({name:t,directives:e,values:n})=>i(["extend enum",t,i(e," "),r(n)]," ")},InputObjectTypeExtension:{leave:({name:t,directives:e,fields:n})=>i(["extend input",t,i(e," "),r(n)]," ")}};function i(t,e=""){var n;return null!==(n=null==t?void 0:t.filter((t=>t)).join(e))&&void 0!==n?n:""}function r(t){return s("{\n",o(i(t,"\n")),"\n}")}function s(t,e,n=""){return null!=e&&""!==e?t+e+n:""}function o(t){return s(" ",t.replace(/\n/g,"\n "))}function u(t){var e;return null!==(e=null==t?void 0:t.some((t=>t.includes("\n"))))&&void 0!==e&&e}})),A=function(t){var e=t.name,n=t.type;this.uri=t.uri,this.name=e,this.type=n},F=function(t){return"undefined"!=typeof File&&t instanceof File||"undefined"!=typeof Blob&&t instanceof Blob||t instanceof A},$=function t(e,n,i){var r;void 0===n&&(n=""),void 0===i&&(i=F);var s=new Map;function o(t,e){var n=s.get(e);n?n.push.apply(n,t):s.set(e,t)}if(i(e))r=null,o([n],e);else{var u=n?n+".":"";if("undefined"!=typeof FileList&&e instanceof FileList)r=Array.prototype.map.call(e,(function(t,e){return o([""+u+e],t),null}));else if(Array.isArray(e))r=e.map((function(e,n){var r=t(e,""+u+n,i);return r.files.forEach(o),r.clone}));else if(e&&e.constructor===Object)for(var a in r={},e){var c=t(e[a],""+u+a,i);c.files.forEach(o),r[a]=c.clone}else r=e}return{clone:r,files:s}},q=F,U="object"==typeof self?self.FormData:window.FormData,V=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.defaultJsonSerializer=void 0,e.defaultJsonSerializer={parse:JSON.parse,stringify:JSON.stringify}})),C=c((function(t,e){var n=a&&a.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(U),r=function(t){return q(t)||null!==t&&"object"==typeof t&&"function"==typeof t.pipe};e.default=function(t,e,n,s){void 0===s&&(s=V.defaultJsonSerializer);var o=$({query:t,variables:e,operationName:n},"",r),u=o.clone,a=o.files;if(0===a.size){if(!Array.isArray(t))return s.stringify(u);if(void 0!==e&&!Array.isArray(e))throw new Error("Cannot create request body with given variable type, array expected");var c=t.reduce((function(t,n,i){return t.push({query:n,variables:e?e[i]:void 0}),t}),[]);return s.stringify(c)}var l=new("undefined"==typeof FormData?i.default:FormData);l.append("operations",s.stringify(u));var h={},f=0;return a.forEach((function(t){h[++f]=t})),l.append("map",s.stringify(h)),f=0,a.forEach((function(t,e){l.append(""+ ++f,e)})),l}})),M=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseBatchRequestsExtendedArgs=e.parseRawRequestExtendedArgs=e.parseRequestExtendedArgs=e.parseBatchRequestArgs=e.parseRawRequestArgs=e.parseRequestArgs=void 0,e.parseRequestArgs=function(t,e,n){return t.document?t:{document:t,variables:e,requestHeaders:n,signal:void 0}},e.parseRawRequestArgs=function(t,e,n){return t.query?t:{query:t,variables:e,requestHeaders:n,signal:void 0}},e.parseBatchRequestArgs=function(t,e){return t.documents?t:{documents:t,requestHeaders:e,signal:void 0}},e.parseRequestExtendedArgs=function(t,e,n,i){return t.document?t:{url:t,document:e,variables:n,requestHeaders:i,signal:void 0}},e.parseRawRequestExtendedArgs=function(t,e,n,i){return t.query?t:{url:t,query:e,variables:n,requestHeaders:i,signal:void 0}},e.parseBatchRequestsExtendedArgs=function(t,e,n){return t.documents?t:{url:t,documents:e,requestHeaders:n,signal:void 0}}})),P=c((function(t,e){var n,i=a&&a.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0}),e.ClientError=void 0;var r=function(t){function e(n,i){var r=this,s=e.extractMessage(n)+": "+JSON.stringify({response:n,request:i});return r=t.call(this,s)||this,Object.setPrototypeOf(r,e.prototype),r.response=n,r.request=i,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,e),r}return i(e,t),e.extractMessage=function(t){try{return t.errors[0].message}catch(e){return"GraphQL Error (Code: "+t.status+")"}},e}(Error);e.ClientError=r})),L=c((function(t,e){var n=a&&a.__assign||function(){return n=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)},i=a&&a.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{a(i.next(t))}catch(t){s(t)}}function u(t){try{a(i.throw(t))}catch(t){s(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,u)}a((i=i.apply(t,e||[])).next())}))},r=a&&a.__generator||function(t,e){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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(s){return function(u){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=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.GraphQLWebSocketClient=void 0;var s="ping",o="pong",u="complete",c=function(){function t(t,e,n){this._type=t,this._payload=e,this._id=n}return Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"payload",{get:function(){return this._payload},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var t={type:this.type};return null!=this.id&&null!=this.id&&(t.id=this.id),null!=this.payload&&null!=this.payload&&(t.payload=this.payload),JSON.stringify(t)},enumerable:!1,configurable:!0}),t.parse=function(e,n){var i=JSON.parse(e),r=i.id;return new t(i.type,n(i.payload),r)},t}(),l=function(){function t(t,e){var a=this,l=e.onInit,d=e.onAcknowledged,v=e.onPing,p=e.onPong;this.socketState={acknowledged:!1,lastRequestId:0,subscriptions:{}},this.socket=t,t.onopen=function(){return i(a,void 0,void 0,(function(){var e,n,i,s;return r(this,(function(r){switch(r.label){case 0:return this.socketState.acknowledged=!1,this.socketState.subscriptions={},n=(e=t).send,i=h,l?[4,l()]:[3,2];case 1:return s=r.sent(),[3,3];case 2:s=null,r.label=3;case 3:return n.apply(e,[i.apply(void 0,[s]).text]),[2]}}))}))},t.onclose=function(){a.socketState.acknowledged=!1,a.socketState.subscriptions={}},t.onerror=function(t){console.error(t)},t.onmessage=function(e){try{var i=(void 0===y&&(y=function(t){return t}),c.parse(e.data,y));switch(i.type){case"connection_ack":return void(a.socketState.acknowledged?console.warn("Duplicate CONNECTION_ACK message ignored"):(a.socketState.acknowledged=!0,d&&d(i.payload)));case s:return void(v?v(i.payload).then((function(e){return t.send(f(e).text)})):t.send(f(null).text));case o:return void(p&&p(i.payload))}if(!a.socketState.acknowledged)return;if(null==i.id||!a.socketState.subscriptions[i.id])return;var r=a.socketState.subscriptions[i.id],l=r.query,h=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 P.ClientError(n(n({},i.payload),{status:200}),{query:l,variables:h})));case"error":return void(m.error&&m.error(new P.ClientError({errors:i.payload,status:200},{query:l,variables:h})));case u:return m.complete&&m.complete(),void delete a.socketState.subscriptions[i.id]}}catch(e){console.error(e),t.close(1006)}var y;t.close(4400,"Unknown graphql-ws message.")}}return t.prototype.makeSubscribe=function(t,e,n,i){var r,s,o=this,a=(this.socketState.lastRequestId++).toString();return this.socketState.subscriptions[a]={query:t,variables:n,subscriber:i},this.socket.send((r=a,s={query:t,operationName:e,variables:n},new c("subscribe",s,r)).text),function(){o.socket.send(function(t){return new c(u,void 0,t)}(a).text),delete o.socketState.subscriptions[a]}},t.prototype.rawRequest=function(t,e){var n=this;return new Promise((function(i,r){var s;n.rawSubscribe(t,{next:function(t,e){return s={data:t,extensions:e}},error:r,complete:function(){return i(s)}},e)}))},t.prototype.request=function(t,e){var n=this;return new Promise((function(i,r){var s;n.subscribe(t,{next:function(t){return s=t},error:r,complete:function(){return i(s)}},e)}))},t.prototype.subscribe=function(t,e,n){var i=R.resolveRequestDocument(t);return this.makeSubscribe(i.query,i.operationName,n,e)},t.prototype.rawSubscribe=function(t,e,n){return this.makeSubscribe(t,void 0,n,e)},t.prototype.ping=function(t){this.socket.send(function(t){return new c(s,t,void 0)}(t).text)},t.prototype.close=function(){this.socket.close(1e3)},t.PROTOCOL="graphql-transport-ws",t}();function h(t){return new c("connection_init",t)}function f(t){return new c(o,t,void 0)}e.GraphQLWebSocketClient=l})),R=c((function(t,e){var n=a&&a.__assign||function(){return n=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)},i=a&&a.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=a&&a.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=a&&a.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return r(e,t),e},o=a&&a.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{a(i.next(t))}catch(t){s(t)}}function u(t){try{a(i.throw(t))}catch(t){s(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,u)}a((i=i.apply(t,e||[])).next())}))},u=a&&a.__generator||function(t,e){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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(s){return function(u){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=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},c=a&&a.__rest||function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n},h=a&&a.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GraphQLWebSocketClient=e.gql=e.resolveRequestDocument=e.batchRequests=e.request=e.rawRequest=e.GraphQLClient=e.ClientError=void 0;var f=s(l),d=f,v=h(C);Object.defineProperty(e,"ClientError",{enumerable:!0,get:function(){return P.ClientError}});var p=function(t){var e={};return t&&("undefined"!=typeof Headers&&t instanceof Headers||t instanceof d.Headers?e=function(t){var e={};return t.forEach((function(t,n){e[n]=t})),e}(t):Array.isArray(t)?t.forEach((function(t){e[t[0]]=t[1]})):e=t),e},m=function(t){return t.replace(/([\s,]|#[^\n\r]+)+/g," ").trim()},y=function(t){var e=t.url,i=t.query,r=t.variables,s=t.operationName,a=t.headers,c=t.fetch,l=t.fetchOptions;return o(void 0,void 0,void 0,(function(){var t;return u(this,(function(o){switch(o.label){case 0:return t=v.default(i,r,s,l.jsonSerializer),[4,c(e,n({method:"POST",headers:n(n({},"string"==typeof t?{"Content-Type":"application/json"}:{}),a),body:t},l))];case 1:return[2,o.sent()]}}))}))},b=function(t){var e=t.url,i=t.query,r=t.variables,s=t.operationName,a=t.headers,c=t.fetch,l=t.fetchOptions;return o(void 0,void 0,void 0,(function(){var t;return u(this,(function(o){switch(o.label){case 0:return t=function(t){var e=t.query,n=t.variables,i=t.operationName,r=t.jsonSerializer;if(!Array.isArray(e)){var s=["query="+encodeURIComponent(m(e))];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=e.reduce((function(t,e,i){return t.push({query:m(e),variables:n?r.stringify(n[i]):void 0}),t}),[]);return"query="+encodeURIComponent(r.stringify(o))}({query:i,variables:r,operationName:s,jsonSerializer:l.jsonSerializer}),[4,c(e+"?"+t,n({method:"GET",headers:a},l))];case 1:return[2,o.sent()]}}))}))},w=function(){function t(t,e){this.url=t,this.options=e||{}}return t.prototype.rawRequest=function(t,e,i){return o(this,void 0,void 0,(function(){var r,s,o,a,l,h,d,v,m,y;return u(this,(function(){return r=M.parseRawRequestArgs(t,e,i),o=(s=this.options).headers,l=void 0===(a=s.fetch)?f.default:a,d=void 0===(h=s.method)?"POST":h,v=c(s,["headers","fetch","method"]),m=this.url,void 0!==r.signal&&(v.signal=r.signal),y=S(r.query).operationName,[2,g({url:m,query:r.query,variables:r.variables,headers:n(n({},p(j(o))),p(r.requestHeaders)),operationName:y,fetch:l,method:d,fetchOptions:v})]}))}))},t.prototype.request=function(t,e,i){return o(this,void 0,void 0,(function(){var r,s,o,a,l,h,d,v,m,y,b;return u(this,(function(u){switch(u.label){case 0:return r=M.parseRequestArgs(t,e,i),o=(s=this.options).headers,l=void 0===(a=s.fetch)?f.default:a,d=void 0===(h=s.method)?"POST":h,v=c(s,["headers","fetch","method"]),m=this.url,void 0!==r.signal&&(v.signal=r.signal),y=S(r.document),b=y.operationName,[4,g({url:m,query:y.query,variables:r.variables,headers:n(n({},p(j(o))),p(r.requestHeaders)),operationName:b,fetch:l,method:d,fetchOptions:v})];case 1:return[2,u.sent().data]}}))}))},t.prototype.batchRequests=function(t,e){return o(this,void 0,void 0,(function(){var i,r,s,o,a,l,h,d,v,m,y;return u(this,(function(u){switch(u.label){case 0:return i=M.parseBatchRequestArgs(t,e),s=(r=this.options).headers,a=void 0===(o=r.fetch)?f.default:o,h=void 0===(l=r.method)?"POST":l,d=c(r,["headers","fetch","method"]),v=this.url,void 0!==i.signal&&(d.signal=i.signal),m=i.documents.map((function(t){return S(t.document).query})),y=i.documents.map((function(t){return t.variables})),[4,g({url:v,query:m,variables:y,headers:n(n({},p(j(s))),p(i.requestHeaders)),operationName:void 0,fetch:a,method:h,fetchOptions:d})];case 1:return[2,u.sent().data]}}))}))},t.prototype.setHeaders=function(t){return this.options.headers=t,this},t.prototype.setHeader=function(t,e){var n,i=this.options.headers;return i?i[t]=e:this.options.headers=((n={})[t]=e,n),this},t.prototype.setEndpoint=function(t){return this.url=t,this},t}();function g(t){var e=t.url,i=t.query,r=t.variables,s=t.headers,a=t.operationName,l=t.fetch,h=t.method,f=void 0===h?"POST":h,d=t.fetchOptions;return o(this,void 0,void 0,(function(){var t,o,h,v,p,m,w,g,O,T;return u(this,(function(u){switch(u.label){case 0:return t="POST"===f.toUpperCase()?y:b,o=Array.isArray(i),[4,t({url:e,query:i,variables:r,operationName:a,headers:s,fetch:l,fetchOptions:d})];case 1:return[4,E(h=u.sent(),d.jsonSerializer)];case 2:if(v=u.sent(),p=o&&Array.isArray(v)?!v.some((function(t){return!t.data})):!!v.data,m=!v.errors||"all"===d.errorPolicy||"ignore"===d.errorPolicy,h.ok&&m&&p)return w=h.headers,g=h.status,O=c(v,["errors"]),T="ignore"===d.errorPolicy?O:v,[2,n(n({},o?{data:T}:T),{headers:w,status:g})];throw new P.ClientError(n(n({},"string"==typeof v?{error:v}:v),{status:h.status,headers:h.headers}),{query:i,variables:r})}}))}))}function O(t,e,i,r){return o(this,void 0,void 0,(function(){var s;return u(this,(function(){return s=M.parseRequestExtendedArgs(t,e,i,r),[2,new w(s.url).request(n({},s))]}))}))}function E(t,e){return void 0===e&&(e=V.defaultJsonSerializer),o(this,void 0,void 0,(function(){var n,i,r;return u(this,(function(s){switch(s.label){case 0:return t.headers.forEach((function(t,e){"content-type"===e.toLowerCase()&&(n=t)})),n&&n.toLowerCase().startsWith("application/json")?(r=(i=e).parse,[4,t.text()]):[3,2];case 1:return[2,r.apply(i,[s.sent()])];case 2:return[2,t.text()]}}))}))}function T(t){var e,n=void 0,i=t.definitions.filter((function(t){return"OperationDefinition"===t.kind}));return 1===i.length&&(n=null===(e=i[0].name)||void 0===e?void 0:e.value),n}function S(t){if("string"==typeof t){var e=void 0;try{e=T(I.parse(t))}catch(t){}return{query:t,operationName:e}}var n=T(t);return{query:_.print(t),operationName:n}}function j(t){return"function"==typeof t?t():t}e.GraphQLClient=w,e.rawRequest=function(t,e,i,r){return o(this,void 0,void 0,(function(){var s;return u(this,(function(){return s=M.parseRawRequestExtendedArgs(t,e,i,r),[2,new w(s.url).rawRequest(n({},s))]}))}))},e.request=O,e.batchRequests=function(t,e,i){return o(this,void 0,void 0,(function(){var r;return u(this,(function(){return r=M.parseBatchRequestsExtendedArgs(t,e,i),[2,new w(r.url).batchRequests(n({},r))]}))}))},e.default=O,e.resolveRequestDocument=S,e.gql=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.reduce((function(t,n,i){return""+t+n+(i in e?e[i]:"")}),"")},Object.defineProperty(e,"GraphQLWebSocketClient",{enumerable:!0,get:function(){return L.GraphQLWebSocketClient}})}));class B{static getQueryParams(t){const e=new Map,n=/[?&]?([^=]+)=([^&]*)/g;let i;for(t=(t=window.unescape(t)).split("+").join(" ");i=n.exec(t);)e.set(window.decodeURIComponent(i[1]),i[2]);return e.set("urlBase",this.getUrlBase()),window.moduleID&&window.URIServiceBroker&&(e.set("moduleID",window.moduleID),e.set("URIServiceBroker",window.URIServiceBroker)),e}static getUrlBase(){return window.mock_url?window.mock_url:`${location.protocol}//${location.hostname}${location.port?":"+location.port:""}`}static getResourceIdFromUrlToken(t){try{const e=t.split("/");return e[1]?atob(e[1]):null}catch(t){throw new Error("Erro ao obter resourceId:"+t)}}static getPkObjectFromUrlToken(t){try{let e=t.split("/")[2];return e?e.indexOf("&")>-1?JSON.parse(atob(e.split("&")[0])):JSON.parse(atob(e)):null}catch(t){throw new Error("Erro ao obter a PK do objeto:"+t)}}}class G{constructor(t,e,n){this.req=t,this.resolve=e,this.reject=n}putVariable(t,e){this.req.values[t]=e}reCall(){return z.get().callGraphQL(this.req).then(this.resolve,this.reject)}putTXPro(e,n){this.req&&this.req.values&&(this.req.values.changes||[]).length&&this.req.values.changes[0].fields.push({dataType:t.TEXT,fieldName:`${u.DATA_UNIT_TRANSIENT_PREFIX_NAME}${e}`,value:n})}}class J{constructor(t,e,n,i){this.serviceName=t,this.requestBody=e,this.successCallback=n,this.errorCallback=i}reCall(t){return t&&(this.requestBody=t),z.get().callServiceBroker(this.serviceName,this.requestBody).then(this.successCallback,this.errorCallback)}}var H=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(n){e[n]=t[n]&&function(e){return new Promise((function(i,r){!function(t,e,n,i){Promise.resolve(i).then((function(e){t({value:e,done:n})}),e)}(i,r,(e=t[n](e)).done,e.value)}))}}};class z{constructor(){this.ready=!0,this.watingRequestsById=new Map}static get(){if(!z.instance){z.instance=new z;const t=document.querySelector(this.appTagName);null===t?z.instance.resume():(!0===e.getContextValue("__SNK__APPLICATION__LOADING__")&&z.instance.pause(),t.addEventListener("applicationLoading",(()=>z.instance.pause())),t.addEventListener("applicationLoaded",(()=>z.instance.resume())))}return this.instance.application=e.getContextValue("__SNK__APPLICATION__"),this.instance}static getGraphQLPath(){return n.isEmpty(this.instance.graphqlPath)&&null!=this.instance.application&&(this.instance.graphqlPath=`/${this.instance.application.getModuleName()}/graphql`),this.instance.graphqlPath}static addRequestListener(t){z.requestListener.indexOf(t)<0&&z.requestListener.push(t)}static removeRequestListener(t){const e=z.requestListener.indexOf(t);e>-1&&z.requestListener.splice(e,1)}processGraphQlErrorInfo(t){var e,n;const s="Falha detectada",o=t[0];if(o.length>0){const t=o[0],u=(null==t?void 0:t.message)?null==t?void 0:t.message:"Não há mensagem de erro",a=(null===(e=null==t?void 0:t.extensions)||void 0===e?void 0:e.level)?t.extensions.level:"ERROR",c=(null===(n=null==t?void 0:t.extensions)||void 0===n?void 0:n.code)?t.extensions.code:"";return"WARNING"===a?new r(s,u,c):new i(s,u,c)}return new i(s,"Não há informações sobre o erro")}processServiceBrokerErrorInfo(t){const e="Falha detectada";let n,s,{statusMessage:o,tsError:u}=t||{};return o||(o="Não há informações sobre o erro"),u&&(n=u.tsErrorCode,s=u.tsErrorLevel),"WARNING"===s?new r(e,o,n):new i(e,o,n)}async callGraphQL(t,e=!1){var n;this.ready&&(this.pause(),window.requestAnimationFrame((()=>this.resume())));const i=this.getReqKey(t);if(t.queryID=i,t.values.queryID=i,z.clientEventsByID){t.values.registeredEventListeners=[];for(let[e]of z.clientEventsByID)t.values.registeredEventListeners.push(e)}return this.ready?new Promise((async(n,r)=>{let s=this.getQueryTemplate(t);const o=await this.fecthGraphQL([{document:s,variables:t.values}],e);o.errors.length>0?await this.proccesGraphQLClientEvents(null==o?void 0:o.extensions,t,n,r)||r(this.processGraphQlErrorInfo(o.errors)):(n(o.data[0][i]),await this.proccesGraphQLClientEvents(null==o?void 0:o.extensions,t,n,r))})):(this.watingRequestsById.has(i)||this.watingRequestsById.set(i,new Q(t,e)),null===(n=this.watingRequestsById.get(i))||void 0===n?void 0:n.promise)}resolveURL(){return B.getUrlBase()}async proccesGraphQLClientEvents(t,e,n,i){if(null==t)return!1;for(const s in t){const{clientEvents:o}=t[s];if(!o)return!1;for(const t in o){if(!z.hasClientEvent(t))throw console.warn(`Client event ${t} not registered`),new r("ClientEvent não registrado",`Ocorreu o client event ${t} porém não há client event registrado na aplicação.`);z.clientEventsByID.get(t).forEach((async r=>{await r({id:t,content:JSON.parse(o[t])},new G(e,n,i))}))}return Object.keys(o).length>0}return!1}async processServiceBrokerClientEvents(t){var e,n,i,r,s,o,u,a;const{clientEvents:c,serviceName:l,payloadJson:h,accept:f,reject:d}=t;if(!(null==c?void 0:c.length))return;const v=new J(l,h,f,d);try{for(var p,m=!0,y=H(c);!(e=(p=await y.next()).done);){r=p.value,m=!1;try{const t=r;if(z.hasClientEvent(t.id)){const e=z.clientEventsByID.get(t.id),n={id:t.id,content:t};try{for(var b,w=!0,g=(o=void 0,H(e));!(s=(b=await g.next()).done);){a=b.value,w=!1;try{const t=a;await t(n,v)}finally{w=!0}}}catch(t){o={error:t}}finally{try{w||s||!(u=g.return)||await u.call(g)}finally{if(o)throw o.error}}}}finally{m=!0}}}catch(t){n={error:t}}finally{try{m||e||!(i=y.return)||await i.call(y)}finally{if(n)throw n.error}}}async processPrinting(t){"true"===(null==t?void 0:t.pendingPrinting)&&await o.getInstance().processPendingPrinting(null==t?void 0:t.transactionId),"localPrintings"in t&&o.getInstance().processLocalPrinting(null==t?void 0:t.localPrintings)}getContext(t){var e;const i=B.getQueryParams(location.search);return{baseUrl:`${this.resolveURL()}/${t}/service.sbr`,appName:window.APPLICATION_NAME||"SankhyaBlocks",mgeSession:`${window.mgeSession||i.get("mgeSession")}`,globalID:window.GLOBALID||n.generateUUID(),resourceID:window.resourceID||(null===(e=window.workspace)||void 0===e?void 0:e.resourceID)}}async callServiceBroker(t,e,n){return new Promise((async(r,o)=>{const u=t.split("@"),[a,c]=2===u.length?u:["mge",t],l=this.getContext(a);let h=`${l.baseUrl}?serviceName=${c}&counter=21&application=${l.appName}&outputType=json&preventTransform=false&mgeSession=${l.mgeSession}&resourceID=${l.resourceID}&globalID=${l.globalID}&allowConcurrentCalls=true`;h=await this.addUrlParams(n,h),document.cookie=`JSESSIONID=${l.mgeSession};`;const f=new XMLHttpRequest;var d={};"string"==typeof e&&(e=s.stringToObject(e)),e.hasOwnProperty("requestBody")?d=e:d.requestBody=e;for(let[t]of z.clientEventsByID)d.requestBody.hasOwnProperty("clientEventList")||(d.requestBody.clientEventList={clientEvent:[]}),d.requestBody.clientEventList.clientEvent.push({$:t});z.requestListener.forEach((t=>t.onRequestStart({url:h,requestBody:e}))),f.open("POST",h,!0),f.withCredentials=!0,f.send(s.objectToString(d)),f.onreadystatechange=async()=>{var n;if(4==f.readyState&&200==f.status)try{const e=JSON.parse(f.responseText);await this.processPrinting(e),this.isServiceBrokerError(e)?o(this.processServiceBrokerErrorInfo(e)):e.status==z.SERVICE_BROKER_STATUS.SERVICE_CANCELED?e.statusMessage&&console.debug(`[DataFetcher] ${e.statusMessage}`):(r(e.responseBody),e.status==z.SERVICE_BROKER_STATUS.INFO&&(null===(n=this.application)||void 0===n||n.info(e.statusMessage))),this.processServiceBrokerClientEvents({clientEvents:null==e?void 0:e.clientEvents,serviceName:t,payloadJson:d,accept:r,reject:o})}catch(t){console.warn(`Erro ao executar serviço: ${t}`),o(new i("Erro ao executar serviço",t))}else 4==f.readyState&&200!=f.status&&o(new i(`Erro ao executar serviço: ${t}`,f.responseText));z.requestListener.forEach((t=>t.onRequestEnd({url:h,requestBody:e})))}}))}async addUrlParams(t,e){var i;const r=(null==t?void 0:t.urlParams)||{},s=await(null===(i=this.application)||void 0===i?void 0:i.getAttributeFromHTMLWrapper("VSS"));if(n.isEmpty(s)||(r.vss=s),0===Object.keys(r).length)return e;-1===e.indexOf("?")&&(e+="?");for(const t in r)e+=`&${t}=${r[t]}`;return e}isServiceBrokerError(t){return!t.hasOwnProperty("status")||t.status==z.SERVICE_BROKER_STATUS.ERROR||t.status==z.SERVICE_BROKER_STATUS.TIMEOUT}getReqKey(t){return window.btoa(n.hashCode(`${t.query}${JSON.stringify(t.values||"")}`)).replace(/=/g,"")}getQueryTemplate(t){return(t.query||"").replaceAll("$queryAlias$",t.queryID)}pause(){this.ready=!1}async resume(){if(this.ready=!0,this.watingRequestsById.size>0){const t=this.watingRequestsById;this.watingRequestsById=new Map,this.executePendingRequest(t)}}async executePendingRequest(t){const e=[];let n=!0;t.forEach((t=>{const i=this.getQueryTemplate(t.request);e.push({document:i,variables:Object.assign({},t.request.values)}),n=n&&t.quietMode}));const r=await this.fecthGraphQL(e,n),{data:s,errors:o,extensions:u}=r;o.forEach((e=>{Object.entries(e).forEach((async([e,n])=>{const r=t.get(n.request.variables[n.index].queryID),s=await this.proccesGraphQLClientEvents(u,r.request,r.resolve,r.reject);Promise.race([r.promise,new Promise((t=>{t(!1)}))]).then((e=>{var r;s&&!1!==e||((null===(r=t.get(n.request.variables[n.index].queryID))||void 0===r?void 0:r.reject)||Promise.reject)(new i("Falha detectada",n.message))}))}))})),s.forEach((e=>{Object.entries(e).forEach((async([e,n])=>{const i=t.get(e);await this.proccesGraphQLClientEvents(u,i.request,i.resolve,i.reject),((null==i?void 0:i.resolve)||Promise.resolve)(n)}))}))}buildGraphQlURL(t){const e=B.getQueryParams(location.search),n=`${window.mgeSession||e.get("mgeSession")}`;let i=`${this.resolveURL()+z.getGraphQLPath()}`;return n&&(i+=`?mgeSession=${n}`),t&&(i+=(i.indexOf("?")>-1?"&":"?")+"quietMode=true"),i}async fecthGraphQL(t,e){const n=[],r=[],s=[],o=this.buildGraphQlURL(e);z.requestListener.forEach((e=>e.onRequestStart({url:o,requestBody:t})));try{(await R.batchRequests(o,t,{"Content-Type":`application/json; charset=${window.SERVER_ENCODING||"UTF-8"}`})).forEach(((e,i)=>{var o;(null===(o=null==e?void 0:e.errors)||void 0===o?void 0:o.length)>0?r.push(e.errors.map((e=>this.normalizeErrorResponse(e,t,i)))):n.push(e.data),e.extensions&&s.push(e.extensions)}))}catch(e){if(this.isHttpError(e))throw z.requestListener.forEach((e=>e.onRequestEnd({url:o,requestBody:t}))),new i("Falha de comunicação",e.message);{const t=e.request;Object.entries(e.response).forEach((([e,i])=>{i.errors?r.push(i.errors.map((n=>(n.request=t,n.index=Number(e),n)))):i.data&&n.push(i.data)}))}}return z.requestListener.forEach((e=>e.onRequestEnd({url:o,requestBody:t}))),{data:n,errors:r,extensions:s}}isHttpError(t){var e;return!t.response&&!t.request||(null===(e=null==t?void 0:t.response)||void 0===e?void 0:e.status)>=300}normalizeErrorResponse(t,e,n){const i=Object.assign({},e[n]),{variables:r}=i;return i.variables=[],i.variables[n]=r,t.request=i,t.index=Number(n),t}static addClientEvent(t,e){let n=z.clientEventsByID.get(t);if(null!=n){if(n.some((t=>t.toString()===e.toString())))return;n.push(e)}else z.clientEventsByID.set(t,[e])}static hasClientEvent(t){return z.clientEventsByID.has(t)}static removeClientEvent(t){return z.clientEventsByID.delete(t)}}z.appTagName="snk-application",z.requestListener=[],z.SERVICE_BROKER_STATUS={ERROR:0,INFO:2,OK:1,TIMEOUT:3,SERVICE_CANCELED:4},z.clientEventsByID=new Map;class Q{constructor(t,e){this._resolve=()=>{},this._reject=()=>{},this._request=void 0,this._request=t,this._promisse=new Promise(((t,e)=>{this._resolve=t,this._reject=e})),this._quietMode=e}get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promisse}get request(){return this._request}get quietMode(){return this._quietMode}}export{z as D,B as U,R as d}