@sankhyalabs/sankhyablocks 1.3.31-beta.13 → 1.3.31-beta.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["snk-crud.cjs",[[6,"snk-crud",{"configName":[1,"config-name"],"actionsList":[16],"recordsValidator":[16],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-application.cjs",[[2,"snk-application",{"messagesBuilder":[1040],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-form_2.cjs",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32]}],[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_gridConfig":[32]}]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-taskbar.cjs",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
17
+ return index.bootstrapLazy([["snk-crud.cjs",[[6,"snk-crud",{"configName":[1,"config-name"],"actionsList":[16],"recordsValidator":[16],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-application.cjs",[[2,"snk-application",{"messagesBuilder":[1040],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-form_2.cjs",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32]}],[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_gridConfig":[32]}]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-taskbar.cjs",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["snk-crud.cjs",[[6,"snk-crud",{"configName":[1,"config-name"],"actionsList":[16],"recordsValidator":[16],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-application.cjs",[[2,"snk-application",{"messagesBuilder":[1040],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-form_2.cjs",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32]}],[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_gridConfig":[32]}]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-taskbar.cjs",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
18
+ return index.bootstrapLazy([["snk-crud.cjs",[[6,"snk-crud",{"configName":[1,"config-name"],"actionsList":[16],"recordsValidator":[16],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa.cjs",[[1,"teste-pesquisa"]]],["snk-data-unit.cjs",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-application.cjs",[[2,"snk-application",{"messagesBuilder":[1040],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-form_2.cjs",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32]}],[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_gridConfig":[32]}]]],["snk-pesquisa.cjs",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-taskbar.cjs",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
19
19
  });
@@ -7282,6 +7282,52 @@ class SnkErrorHandler {
7282
7282
 
7283
7283
  function _0x53e1(){const _0x340df8=['2909523kXwted','CompanyName=Sankhya\x20Jiva\x20Tecnologia\x20e\x20Inovao\x20Ltda,LicensedApplication=Sankhya\x20Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869','1131048CARoeW','502909mLEPmu','447255iQEXuN','428UHbJwW','270AFTxAV','194369jhGqTI','1540nWuTrj','2044062GicUQI','30CkXPWg'];_0x53e1=function(){return _0x340df8;};return _0x53e1();}const _0xc7632f=_0x15c2;function _0x15c2(_0x353a9c,_0x3e4a5a){const _0x53e110=_0x53e1();return _0x15c2=function(_0x15c2aa,_0x219858){_0x15c2aa=_0x15c2aa-0x188;let _0x307231=_0x53e110[_0x15c2aa];return _0x307231;},_0x15c2(_0x353a9c,_0x3e4a5a);}(function(_0x42617e,_0x57debe){const _0x31061a=_0x15c2,_0x128d7d=_0x42617e();while(!![]){try{const _0x1c9bb1=-parseInt(_0x31061a(0x18e))/0x1+-parseInt(_0x31061a(0x189))/0x2+parseInt(_0x31061a(0x18b))/0x3+-parseInt(_0x31061a(0x190))/0x4*(parseInt(_0x31061a(0x188))/0x5)+-parseInt(_0x31061a(0x191))/0x6*(-parseInt(_0x31061a(0x192))/0x7)+parseInt(_0x31061a(0x18d))/0x8+-parseInt(_0x31061a(0x18f))/0x9*(-parseInt(_0x31061a(0x18a))/0xa);if(_0x1c9bb1===_0x57debe)break;else _0x128d7d['push'](_0x128d7d['shift']());}catch(_0x1bd816){_0x128d7d['push'](_0x128d7d['shift']());}}}(_0x53e1,0xe8676));const agGridLicense=_0xc7632f(0x18c);
7284
7284
 
7285
+ class TotalsFetcher {
7286
+ constructor() {
7287
+ this.templateByQuery = new Map();
7288
+ this.buldTemplates();
7289
+ }
7290
+ buldTemplates() {
7291
+ this.templateByQuery.set("fetchTotals", dist.gql `query($filters: [InputFilter!] $name: String!) {
7292
+ $queryAlias$: fetchTotals(name: $name, filters: $filters ){
7293
+ name
7294
+ value
7295
+ }
7296
+ }`);
7297
+ }
7298
+ async getTotals(name, resourceID, filters) {
7299
+ const path = `totals://${name}/${resourceID}`;
7300
+ let variables = {
7301
+ name: path,
7302
+ filters: filters
7303
+ };
7304
+ return DataFetcher.get().callGraphQL({
7305
+ values: variables,
7306
+ query: this.templateByQuery.get("fetchTotals"),
7307
+ });
7308
+ }
7309
+ fetchTotals(name, resourceID, filters = []) {
7310
+ return new Promise((accept, reject) => {
7311
+ this.getTotals(name, resourceID, filters)
7312
+ .then((result) => {
7313
+ if (result.length > 0) {
7314
+ const totalsData = new Map();
7315
+ result.forEach(total => {
7316
+ totalsData.set(total.name, parseFloat(total.value));
7317
+ });
7318
+ accept(totalsData);
7319
+ }
7320
+ else {
7321
+ reject(`Não foi possível recuperar os totalizadores`);
7322
+ }
7323
+ })
7324
+ .catch((error) => {
7325
+ reject(error);
7326
+ });
7327
+ });
7328
+ }
7329
+ }
7330
+
7285
7331
  const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
7286
7332
 
7287
7333
  const SnkApplication = class {
@@ -7599,6 +7645,12 @@ const SnkApplication = class {
7599
7645
  async loadGridConfig(name) {
7600
7646
  return this.gridConfigFetcher.getConfig(name, this.resourceID);
7601
7647
  }
7648
+ /**
7649
+ * Busca os totalizadores da grade.
7650
+ */
7651
+ async loadTotals(name, resourceID, filters) {
7652
+ return this.totalsFetcher.fetchTotals(name, resourceID, filters);
7653
+ }
7602
7654
  /**
7603
7655
  * Salva a configuração de grade.
7604
7656
  */
@@ -7632,6 +7684,12 @@ const SnkApplication = class {
7632
7684
  }
7633
7685
  return this._gridConfigFetcher;
7634
7686
  }
7687
+ get totalsFetcher() {
7688
+ if (!this._totalsFetcher) {
7689
+ this._totalsFetcher = new TotalsFetcher();
7690
+ }
7691
+ return this._totalsFetcher;
7692
+ }
7635
7693
  get pesquisaFetcher() {
7636
7694
  if (!this._pesquisaFetcher) {
7637
7695
  this._pesquisaFetcher = new PesquisaFetcher();
@@ -15,6 +15,7 @@ import AuthFetcher, { AutorizationType } from "../../lib/http/data-fetcher/fetch
15
15
  import MGEAuthorization from '../../lib/auth/mgeauthorization.module';
16
16
  import { SnkErrorHandler } from "./errorhandler/snk-error-handler";
17
17
  import { agGridLicense } from '../../lib/licenses/sankhyalicense.module';
18
+ import { TotalsFetcher } from "../../lib/http/data-fetcher/fetchers/totals-fetcher";
18
19
  import { SnkMessageBuilder } from "../../lib/message/SnkMessageBuilder";
19
20
  /**
20
21
  * É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
@@ -333,6 +334,12 @@ export class SnkApplication {
333
334
  async loadGridConfig(name) {
334
335
  return this.gridConfigFetcher.getConfig(name, this.resourceID);
335
336
  }
337
+ /**
338
+ * Busca os totalizadores da grade.
339
+ */
340
+ async loadTotals(name, resourceID, filters) {
341
+ return this.totalsFetcher.fetchTotals(name, resourceID, filters);
342
+ }
336
343
  /**
337
344
  * Salva a configuração de grade.
338
345
  */
@@ -366,6 +373,12 @@ export class SnkApplication {
366
373
  }
367
374
  return this._gridConfigFetcher;
368
375
  }
376
+ get totalsFetcher() {
377
+ if (!this._totalsFetcher) {
378
+ this._totalsFetcher = new TotalsFetcher();
379
+ }
380
+ return this._totalsFetcher;
381
+ }
369
382
  get pesquisaFetcher() {
370
383
  if (!this._pesquisaFetcher) {
371
384
  this._pesquisaFetcher = new PesquisaFetcher();
@@ -1117,6 +1130,41 @@ export class SnkApplication {
1117
1130
  "tags": []
1118
1131
  }
1119
1132
  },
1133
+ "loadTotals": {
1134
+ "complexType": {
1135
+ "signature": "(name: string, resourceID: string, filters: Array<Filter>) => Promise<Map<string, number>>",
1136
+ "parameters": [{
1137
+ "tags": [],
1138
+ "text": ""
1139
+ }, {
1140
+ "tags": [],
1141
+ "text": ""
1142
+ }, {
1143
+ "tags": [],
1144
+ "text": ""
1145
+ }],
1146
+ "references": {
1147
+ "Promise": {
1148
+ "location": "global"
1149
+ },
1150
+ "Map": {
1151
+ "location": "global"
1152
+ },
1153
+ "Array": {
1154
+ "location": "global"
1155
+ },
1156
+ "Filter": {
1157
+ "location": "import",
1158
+ "path": "@sankhyalabs/core"
1159
+ }
1160
+ },
1161
+ "return": "Promise<Map<string, number>>"
1162
+ },
1163
+ "docs": {
1164
+ "text": "Busca os totalizadores da grade.",
1165
+ "tags": []
1166
+ }
1167
+ },
1120
1168
  "saveGridConfig": {
1121
1169
  "complexType": {
1122
1170
  "signature": "(config: IGridConfig) => Promise<boolean>",
@@ -0,0 +1,47 @@
1
+ import { gql } from "graphql-request";
2
+ import { DataFetcher } from "../DataFetcher";
3
+ export class TotalsFetcher {
4
+ constructor() {
5
+ this.templateByQuery = new Map();
6
+ this.buldTemplates();
7
+ }
8
+ buldTemplates() {
9
+ this.templateByQuery.set("fetchTotals", gql `query($filters: [InputFilter!] $name: String!) {
10
+ $queryAlias$: fetchTotals(name: $name, filters: $filters ){
11
+ name
12
+ value
13
+ }
14
+ }`);
15
+ }
16
+ async getTotals(name, resourceID, filters) {
17
+ const path = `totals://${name}/${resourceID}`;
18
+ let variables = {
19
+ name: path,
20
+ filters: filters
21
+ };
22
+ return DataFetcher.get().callGraphQL({
23
+ values: variables,
24
+ query: this.templateByQuery.get("fetchTotals"),
25
+ });
26
+ }
27
+ fetchTotals(name, resourceID, filters = []) {
28
+ return new Promise((accept, reject) => {
29
+ this.getTotals(name, resourceID, filters)
30
+ .then((result) => {
31
+ if (result.length > 0) {
32
+ const totalsData = new Map();
33
+ result.forEach(total => {
34
+ totalsData.set(total.name, parseFloat(total.value));
35
+ });
36
+ accept(totalsData);
37
+ }
38
+ else {
39
+ reject(`Não foi possível recuperar os totalizadores`);
40
+ }
41
+ })
42
+ .catch((error) => {
43
+ reject(error);
44
+ });
45
+ });
46
+ }
47
+ }
@@ -7279,6 +7279,52 @@ class SnkErrorHandler {
7279
7279
 
7280
7280
  function _0x53e1(){const _0x340df8=['2909523kXwted','CompanyName=Sankhya\x20Jiva\x20Tecnologia\x20e\x20Inovao\x20Ltda,LicensedApplication=Sankhya\x20Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869','1131048CARoeW','502909mLEPmu','447255iQEXuN','428UHbJwW','270AFTxAV','194369jhGqTI','1540nWuTrj','2044062GicUQI','30CkXPWg'];_0x53e1=function(){return _0x340df8;};return _0x53e1();}const _0xc7632f=_0x15c2;function _0x15c2(_0x353a9c,_0x3e4a5a){const _0x53e110=_0x53e1();return _0x15c2=function(_0x15c2aa,_0x219858){_0x15c2aa=_0x15c2aa-0x188;let _0x307231=_0x53e110[_0x15c2aa];return _0x307231;},_0x15c2(_0x353a9c,_0x3e4a5a);}(function(_0x42617e,_0x57debe){const _0x31061a=_0x15c2,_0x128d7d=_0x42617e();while(!![]){try{const _0x1c9bb1=-parseInt(_0x31061a(0x18e))/0x1+-parseInt(_0x31061a(0x189))/0x2+parseInt(_0x31061a(0x18b))/0x3+-parseInt(_0x31061a(0x190))/0x4*(parseInt(_0x31061a(0x188))/0x5)+-parseInt(_0x31061a(0x191))/0x6*(-parseInt(_0x31061a(0x192))/0x7)+parseInt(_0x31061a(0x18d))/0x8+-parseInt(_0x31061a(0x18f))/0x9*(-parseInt(_0x31061a(0x18a))/0xa);if(_0x1c9bb1===_0x57debe)break;else _0x128d7d['push'](_0x128d7d['shift']());}catch(_0x1bd816){_0x128d7d['push'](_0x128d7d['shift']());}}}(_0x53e1,0xe8676));const agGridLicense=_0xc7632f(0x18c);
7281
7281
 
7282
+ class TotalsFetcher {
7283
+ constructor() {
7284
+ this.templateByQuery = new Map();
7285
+ this.buldTemplates();
7286
+ }
7287
+ buldTemplates() {
7288
+ this.templateByQuery.set("fetchTotals", dist.gql `query($filters: [InputFilter!] $name: String!) {
7289
+ $queryAlias$: fetchTotals(name: $name, filters: $filters ){
7290
+ name
7291
+ value
7292
+ }
7293
+ }`);
7294
+ }
7295
+ async getTotals(name, resourceID, filters) {
7296
+ const path = `totals://${name}/${resourceID}`;
7297
+ let variables = {
7298
+ name: path,
7299
+ filters: filters
7300
+ };
7301
+ return DataFetcher.get().callGraphQL({
7302
+ values: variables,
7303
+ query: this.templateByQuery.get("fetchTotals"),
7304
+ });
7305
+ }
7306
+ fetchTotals(name, resourceID, filters = []) {
7307
+ return new Promise((accept, reject) => {
7308
+ this.getTotals(name, resourceID, filters)
7309
+ .then((result) => {
7310
+ if (result.length > 0) {
7311
+ const totalsData = new Map();
7312
+ result.forEach(total => {
7313
+ totalsData.set(total.name, parseFloat(total.value));
7314
+ });
7315
+ accept(totalsData);
7316
+ }
7317
+ else {
7318
+ reject(`Não foi possível recuperar os totalizadores`);
7319
+ }
7320
+ })
7321
+ .catch((error) => {
7322
+ reject(error);
7323
+ });
7324
+ });
7325
+ }
7326
+ }
7327
+
7282
7328
  const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
7283
7329
 
7284
7330
  const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
@@ -7597,6 +7643,12 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7597
7643
  async loadGridConfig(name) {
7598
7644
  return this.gridConfigFetcher.getConfig(name, this.resourceID);
7599
7645
  }
7646
+ /**
7647
+ * Busca os totalizadores da grade.
7648
+ */
7649
+ async loadTotals(name, resourceID, filters) {
7650
+ return this.totalsFetcher.fetchTotals(name, resourceID, filters);
7651
+ }
7600
7652
  /**
7601
7653
  * Salva a configuração de grade.
7602
7654
  */
@@ -7630,6 +7682,12 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7630
7682
  }
7631
7683
  return this._gridConfigFetcher;
7632
7684
  }
7685
+ get totalsFetcher() {
7686
+ if (!this._totalsFetcher) {
7687
+ this._totalsFetcher = new TotalsFetcher();
7688
+ }
7689
+ return this._totalsFetcher;
7690
+ }
7633
7691
  get pesquisaFetcher() {
7634
7692
  if (!this._pesquisaFetcher) {
7635
7693
  this._pesquisaFetcher = new PesquisaFetcher();
@@ -7767,6 +7825,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
7767
7825
  "info": [64],
7768
7826
  "loadFormConfig": [64],
7769
7827
  "loadGridConfig": [64],
7828
+ "loadTotals": [64],
7770
7829
  "saveGridConfig": [64],
7771
7830
  "executeSearch": [64],
7772
7831
  "isDebugMode": [64]
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["snk-crud",[[6,"snk-crud",{"configName":[1,"config-name"],"actionsList":[16],"recordsValidator":[16],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-application",[[2,"snk-application",{"messagesBuilder":[1040],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-form_2",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32]}],[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_gridConfig":[32]}]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-taskbar",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
13
+ return bootstrapLazy([["snk-crud",[[6,"snk-crud",{"configName":[1,"config-name"],"actionsList":[16],"recordsValidator":[16],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-application",[[2,"snk-application",{"messagesBuilder":[1040],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-form_2",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32]}],[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_gridConfig":[32]}]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-taskbar",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["snk-crud",[[6,"snk-crud",{"configName":[1,"config-name"],"actionsList":[16],"recordsValidator":[16],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-application",[[2,"snk-application",{"messagesBuilder":[1040],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-form_2",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32]}],[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_gridConfig":[32]}]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-taskbar",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
16
+ return bootstrapLazy([["snk-crud",[[6,"snk-crud",{"configName":[1,"config-name"],"actionsList":[16],"recordsValidator":[16],"_dataUnit":[32],"_dataState":[32]}]]],["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"autoLoad":[4,"auto-load"],"getDataUnit":[64]}]]],["snk-application",[[2,"snk-application",{"messagesBuilder":[1040],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"alert":[64],"error":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"executeSearch":[64],"isDebugMode":[64]}]]],["snk-form_2",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32]}],[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"_dataUnit":[32],"_configLoaded":[32],"_dataState":[32],"_gridConfig":[32]}]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-taskbar",[[6,"snk-taskbar",{"buttons":[1],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"_permissions":[32]}]]]], options);
17
17
  });
@@ -7278,6 +7278,52 @@ class SnkErrorHandler {
7278
7278
 
7279
7279
  function _0x53e1(){const _0x340df8=['2909523kXwted','CompanyName=Sankhya\x20Jiva\x20Tecnologia\x20e\x20Inovao\x20Ltda,LicensedApplication=Sankhya\x20Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869','1131048CARoeW','502909mLEPmu','447255iQEXuN','428UHbJwW','270AFTxAV','194369jhGqTI','1540nWuTrj','2044062GicUQI','30CkXPWg'];_0x53e1=function(){return _0x340df8;};return _0x53e1();}const _0xc7632f=_0x15c2;function _0x15c2(_0x353a9c,_0x3e4a5a){const _0x53e110=_0x53e1();return _0x15c2=function(_0x15c2aa,_0x219858){_0x15c2aa=_0x15c2aa-0x188;let _0x307231=_0x53e110[_0x15c2aa];return _0x307231;},_0x15c2(_0x353a9c,_0x3e4a5a);}(function(_0x42617e,_0x57debe){const _0x31061a=_0x15c2,_0x128d7d=_0x42617e();while(!![]){try{const _0x1c9bb1=-parseInt(_0x31061a(0x18e))/0x1+-parseInt(_0x31061a(0x189))/0x2+parseInt(_0x31061a(0x18b))/0x3+-parseInt(_0x31061a(0x190))/0x4*(parseInt(_0x31061a(0x188))/0x5)+-parseInt(_0x31061a(0x191))/0x6*(-parseInt(_0x31061a(0x192))/0x7)+parseInt(_0x31061a(0x18d))/0x8+-parseInt(_0x31061a(0x18f))/0x9*(-parseInt(_0x31061a(0x18a))/0xa);if(_0x1c9bb1===_0x57debe)break;else _0x128d7d['push'](_0x128d7d['shift']());}catch(_0x1bd816){_0x128d7d['push'](_0x128d7d['shift']());}}}(_0x53e1,0xe8676));const agGridLicense=_0xc7632f(0x18c);
7280
7280
 
7281
+ class TotalsFetcher {
7282
+ constructor() {
7283
+ this.templateByQuery = new Map();
7284
+ this.buldTemplates();
7285
+ }
7286
+ buldTemplates() {
7287
+ this.templateByQuery.set("fetchTotals", dist.gql `query($filters: [InputFilter!] $name: String!) {
7288
+ $queryAlias$: fetchTotals(name: $name, filters: $filters ){
7289
+ name
7290
+ value
7291
+ }
7292
+ }`);
7293
+ }
7294
+ async getTotals(name, resourceID, filters) {
7295
+ const path = `totals://${name}/${resourceID}`;
7296
+ let variables = {
7297
+ name: path,
7298
+ filters: filters
7299
+ };
7300
+ return DataFetcher.get().callGraphQL({
7301
+ values: variables,
7302
+ query: this.templateByQuery.get("fetchTotals"),
7303
+ });
7304
+ }
7305
+ fetchTotals(name, resourceID, filters = []) {
7306
+ return new Promise((accept, reject) => {
7307
+ this.getTotals(name, resourceID, filters)
7308
+ .then((result) => {
7309
+ if (result.length > 0) {
7310
+ const totalsData = new Map();
7311
+ result.forEach(total => {
7312
+ totalsData.set(total.name, parseFloat(total.value));
7313
+ });
7314
+ accept(totalsData);
7315
+ }
7316
+ else {
7317
+ reject(`Não foi possível recuperar os totalizadores`);
7318
+ }
7319
+ })
7320
+ .catch((error) => {
7321
+ reject(error);
7322
+ });
7323
+ });
7324
+ }
7325
+ }
7326
+
7281
7327
  const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
7282
7328
 
7283
7329
  const SnkApplication = class {
@@ -7595,6 +7641,12 @@ const SnkApplication = class {
7595
7641
  async loadGridConfig(name) {
7596
7642
  return this.gridConfigFetcher.getConfig(name, this.resourceID);
7597
7643
  }
7644
+ /**
7645
+ * Busca os totalizadores da grade.
7646
+ */
7647
+ async loadTotals(name, resourceID, filters) {
7648
+ return this.totalsFetcher.fetchTotals(name, resourceID, filters);
7649
+ }
7598
7650
  /**
7599
7651
  * Salva a configuração de grade.
7600
7652
  */
@@ -7628,6 +7680,12 @@ const SnkApplication = class {
7628
7680
  }
7629
7681
  return this._gridConfigFetcher;
7630
7682
  }
7683
+ get totalsFetcher() {
7684
+ if (!this._totalsFetcher) {
7685
+ this._totalsFetcher = new TotalsFetcher();
7686
+ }
7687
+ return this._totalsFetcher;
7688
+ }
7631
7689
  get pesquisaFetcher() {
7632
7690
  if (!this._pesquisaFetcher) {
7633
7691
  this._pesquisaFetcher = new PesquisaFetcher();
@@ -1,4 +1,4 @@
1
- import{r as e,c as t,h as n}from"./p-cd1dc099.js";import{ErrorException as i,StringUtils as r,DataUnit as s,DataType as o,ChangeOperation as a,DateUtils as u,ObjectUtils as c,WaitingChangeException as h,WarningException as l,DependencyType as f,ApplicationContext as d,ErrorTracking as v}from"@sankhyalabs/core";import{ApplicationUtils as p}from"@sankhyalabs/ezui/dist/collection/utils";import{S as m}from"./p-ab694dbc.js";var y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function b(e,t,n){return e(n={path:t,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var w,g,O=b((function(e,t){var n="undefined"!=typeof self?self:y,i=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,i="Symbol"in e&&"iterator"in Symbol,r="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in e,o="ArrayBuffer"in e;if(o)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function l(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function v(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function p(e){var t=new FileReader,n=v(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&r&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var e,t,n,i=d(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,n=v(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),i=0;i<t.length;i++)n[i]=String.fromCharCode(t[i]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=c(e),t=h(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},f.prototype.delete=function(e){delete this.map[c(e)]},f.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},f.prototype.set=function(e,t){this.map[c(e)]=h(t)},f.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),l(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),l(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),l(e)},i&&(f.prototype[Symbol.iterator]=f.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(e,t){var n,i,r=(t=t||{}).body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(i=(n=t.method||this.method||"GET").toUpperCase(),b.indexOf(i)>-1?i:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function g(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(r))}})),t}function O(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}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 e=new O(null,{status:0,statusText:""});return e.type="error",e};var S=[301,302,303,307,308];O.redirect=function(e,t){if(-1===S.indexOf(t))throw new RangeError("Invalid status code");return new O(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function T(e,n){return new Promise((function(i,s){var o=new w(e,n);if(o.signal&&o.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var e,t,n={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),i=n.shift().trim();if(i){var r=n.join(":").trim();t.append(i,r)}})),t)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL"),i(new O("response"in a?a.response:a.responseText,n))},a.onerror=function(){s(new TypeError("Network request failed"))},a.ontimeout=function(){s(new TypeError("Network request failed"))},a.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&r&&(a.responseType="blob"),o.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",u)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}T.polyfill=!0,e.fetch||(e.fetch=T,e.Headers=f,e.Request=w,e.Response=O),t.Headers=f,t.Request=w,t.Response=O,t.fetch=T,Object.defineProperty(t,"__esModule",{value:!0})}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=i;(t=r.fetch).default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t})),S=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isObjectLike=function(e){return"object"==typeof e&&null!==e}})),T=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.invariant=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}})),D=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getLocation=function(e,t){let i=0,r=1;for(const s of e.body.matchAll(n)){if("number"==typeof s.index||(0,T.invariant)(!1),s.index>=t)break;i=s.index+s[0].length,r+=1}return{line:r,column:t+1-i}};const n=/\r\n|[\n\r]/g})),E=b((function(e,t){function n(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,s=t.line-1,o=t.line+(e.locationOffset.line-1),a=t.column+(1===t.line?n:0),u=`${e.name}:${o}:${a}\n`,c=r.split(/\r\n|[\n\r]/g),h=c[s];if(h.length>120){const e=Math.floor(a/80),t=a%80,n=[];for(let e=0;e<h.length;e+=80)n.push(h.slice(e,e+80));return u+i([[`${o} |`,n[0]],...n.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return u+i([[o-1+" |",c[s-1]],[`${o} |`,h],["|","^".padStart(a)],[`${o+1} |`,c[s+1]]])}function i(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}Object.defineProperty(t,"__esModule",{value:!0}),t.printLocation=function(e){return n(e.source,(0,D.getLocation)(e.source,e.start))},t.printSourceLocation=n})),I=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLError=void 0,t.formatError=function(e){return e.toJSON()},t.printError=function(e){return e.toString()};class n extends Error{constructor(e,...t){var r,s,o;const{nodes:a,source:u,positions:c,path:h,originalError:l,extensions:f}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=h?h:void 0,this.originalError=null!=l?l:void 0,this.nodes=i(Array.isArray(a)?a:a?[a]:void 0);const d=i(null===(r=this.nodes)||void 0===r?void 0:r.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=u?u:null==d||null===(s=d[0])||void 0===s?void 0:s.source,this.positions=null!=c?c:null==d?void 0:d.map((e=>e.start)),this.locations=c&&u?c.map((e=>(0,D.getLocation)(u,e))):null==d?void 0:d.map((e=>(0,D.getLocation)(e.source,e.start)));const v=(0,S.isObjectLike)(null==l?void 0:l.extensions)?null==l?void 0:l.extensions:void 0;this.extensions=null!==(o=null!=f?f:v)&&void 0!==o?o:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=l&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,n):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+(0,E.printLocation)(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+(0,E.printSourceLocation)(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function i(e){return void 0===e||0===e.length?void 0:e}t.GraphQLError=n})),j=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.syntaxError=function(e,t,n){return new I.GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}})),_=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Token=t.QueryDocumentKeys=t.OperationTypeNode=t.Location=void 0,t.isNode=function(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&s.has(t)};class n{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}t.Location=n;class i{constructor(e,t,n,i,r,s){this.kind=e,this.start=t,this.end=n,this.line=i,this.column=r,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}t.Token=i;const r={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};t.QueryDocumentKeys=r;const s=new Set(Object.keys(r));var o;t.OperationTypeNode=o,function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(o||(t.OperationTypeNode=o={}))})),$=b((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveLocation=void 0,t.DirectiveLocation=n,function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(n||(t.DirectiveLocation=n={}))})),N=b((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Kind=void 0,t.Kind=n,function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(n||(t.Kind=n={}))})),A=b((function(e,t){function n(e){return e>=48&&e<=57}function i(e){return e>=97&&e<=122||e>=65&&e<=90}Object.defineProperty(t,"__esModule",{value:!0}),t.isDigit=n,t.isLetter=i,t.isNameContinue=function(e){return i(e)||n(e)||95===e},t.isNameStart=function(e){return i(e)||95===e},t.isWhiteSpace=function(e){return 9===e||32===e}})),x=b((function(e,t){function n(e){let t=0;for(;t<e.length&&(0,A.isWhiteSpace)(e.charCodeAt(t));)++t;return t}Object.defineProperty(t,"__esModule",{value:!0}),t.dedentBlockStringLines=function(e){var t;let i=Number.MAX_SAFE_INTEGER,r=null,s=-1;for(let t=0;t<e.length;++t){var o;const a=e[t],u=n(a);u!==a.length&&(r=null!==(o=r)&&void 0!==o?o:t,s=t,0!==t&&u<i&&(i=u))}return e.map(((e,t)=>0===t?e:e.slice(i))).slice(null!==(t=r)&&void 0!==t?t:0,s+1)},t.isPrintableAsBlockString=function(e){if(""===e)return!0;let t=!0,n=!1,i=!0,r=!1;for(let s=0;s<e.length;++s)switch(e.codePointAt(s)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:case 13:return!1;case 10:if(t&&!r)return!1;r=!0,t=!0,n=!1;break;case 9:case 32:n||(n=t);break;default:i&&(i=n),t=!1}return!t&&(!i||!r)},t.printBlockString=function(e,t){const n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=1===i.length,s=i.length>1&&i.slice(1).every((e=>0===e.length||(0,A.isWhiteSpace)(e.charCodeAt(0)))),o=n.endsWith('\\"""'),a=e.endsWith('"')&&!o,u=e.endsWith("\\"),c=a||u,h=!(null!=t&&t.minimize)&&(!r||e.length>70||c||s||o);let l="";const f=r&&(0,A.isWhiteSpace)(e.charCodeAt(0));return(h&&!f||s)&&(l+="\n"),l+=n,(h||c)&&(l+="\n"),'"""'+l+'"""'}})),k=b((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenKind=void 0,t.TokenKind=n,function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(n||(t.TokenKind=n={}))})),P=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Lexer=void 0,t.isPunctuatorTokenKind=function(e){return e===k.TokenKind.BANG||e===k.TokenKind.DOLLAR||e===k.TokenKind.AMP||e===k.TokenKind.PAREN_L||e===k.TokenKind.PAREN_R||e===k.TokenKind.SPREAD||e===k.TokenKind.COLON||e===k.TokenKind.EQUALS||e===k.TokenKind.AT||e===k.TokenKind.BRACKET_L||e===k.TokenKind.BRACKET_R||e===k.TokenKind.BRACE_L||e===k.TokenKind.PIPE||e===k.TokenKind.BRACE_R};class n{constructor(e){const t=new _.Token(k.TokenKind.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==k.TokenKind.EOF)do{if(e.next)e=e.next;else{const t=c(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===k.TokenKind.COMMENT);return e}}function i(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function r(e,t){return s(e.charCodeAt(t))&&o(e.charCodeAt(t+1))}function s(e){return e>=55296&&e<=56319}function o(e){return e>=56320&&e<=57343}function a(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return k.TokenKind.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function u(e,t,n,i,r){return new _.Token(t,n,i,e.line,1+n-e.lineStart,r)}function c(e,t){const n=e.source.body,s=n.length;let o=t;for(;o<s;){const t=n.charCodeAt(o);switch(t){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:10===n.charCodeAt(o+1)?o+=2:++o,++e.line,e.lineStart=o;continue;case 35:return h(e,o);case 33:return u(e,k.TokenKind.BANG,o,o+1);case 36:return u(e,k.TokenKind.DOLLAR,o,o+1);case 38:return u(e,k.TokenKind.AMP,o,o+1);case 40:return u(e,k.TokenKind.PAREN_L,o,o+1);case 41:return u(e,k.TokenKind.PAREN_R,o,o+1);case 46:if(46===n.charCodeAt(o+1)&&46===n.charCodeAt(o+2))return u(e,k.TokenKind.SPREAD,o,o+3);break;case 58:return u(e,k.TokenKind.COLON,o,o+1);case 61:return u(e,k.TokenKind.EQUALS,o,o+1);case 64:return u(e,k.TokenKind.AT,o,o+1);case 91:return u(e,k.TokenKind.BRACKET_L,o,o+1);case 93:return u(e,k.TokenKind.BRACKET_R,o,o+1);case 123:return u(e,k.TokenKind.BRACE_L,o,o+1);case 124:return u(e,k.TokenKind.PIPE,o,o+1);case 125:return u(e,k.TokenKind.BRACE_R,o,o+1);case 34:return 34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)?w(e,o):d(e,o)}if((0,A.isDigit)(t)||45===t)return l(e,o,t);if((0,A.isNameStart)(t))return g(e,o);throw(0,j.syntaxError)(e.source,o,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":i(t)||r(n,o)?`Unexpected character: ${a(e,o)}.`:`Invalid character: ${a(e,o)}.`)}return u(e,k.TokenKind.EOF,s,s)}function h(e,t){const n=e.source.body,s=n.length;let o=t+1;for(;o<s;){const e=n.charCodeAt(o);if(10===e||13===e)break;if(i(e))++o;else{if(!r(n,o))break;o+=2}}return u(e,k.TokenKind.COMMENT,t,o,n.slice(t+1,o))}function l(e,t,n){const i=e.source.body;let r=t,s=n,o=!1;if(45===s&&(s=i.charCodeAt(++r)),48===s){if(s=i.charCodeAt(++r),(0,A.isDigit)(s))throw(0,j.syntaxError)(e.source,r,`Invalid number, unexpected digit after 0: ${a(e,r)}.`)}else r=f(e,r,s),s=i.charCodeAt(r);if(46===s&&(o=!0,s=i.charCodeAt(++r),r=f(e,r,s),s=i.charCodeAt(r)),69!==s&&101!==s||(o=!0,s=i.charCodeAt(++r),43!==s&&45!==s||(s=i.charCodeAt(++r)),r=f(e,r,s),s=i.charCodeAt(r)),46===s||(0,A.isNameStart)(s))throw(0,j.syntaxError)(e.source,r,`Invalid number, expected digit but got: ${a(e,r)}.`);return u(e,o?k.TokenKind.FLOAT:k.TokenKind.INT,t,r,i.slice(t,r))}function f(e,t,n){if(!(0,A.isDigit)(n))throw(0,j.syntaxError)(e.source,t,`Invalid number, expected digit but got: ${a(e,t)}.`);const i=e.source.body;let r=t+1;for(;(0,A.isDigit)(i.charCodeAt(r));)++r;return r}function d(e,t){const n=e.source.body,s=n.length;let o=t+1,c=o,h="";for(;o<s;){const s=n.charCodeAt(o);if(34===s)return h+=n.slice(c,o),u(e,k.TokenKind.STRING,t,o+1,h);if(92!==s){if(10===s||13===s)break;if(i(s))++o;else{if(!r(n,o))throw(0,j.syntaxError)(e.source,o,`Invalid character within String: ${a(e,o)}.`);o+=2}}else{h+=n.slice(c,o);const t=117===n.charCodeAt(o+1)?123===n.charCodeAt(o+2)?v(e,o):p(e,o):b(e,o);h+=t.value,o+=t.size,c=o}}throw(0,j.syntaxError)(e.source,o,"Unterminated string.")}function v(e,t){const n=e.source.body;let r=0,s=3;for(;s<12;){const e=n.charCodeAt(t+s++);if(125===e){if(s<5||!i(r))break;return{value:String.fromCodePoint(r),size:s}}if(r=r<<4|y(e),r<0)break}throw(0,j.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+s)}".`)}function p(e,t){const n=e.source.body,r=m(n,t+2);if(i(r))return{value:String.fromCodePoint(r),size:6};if(s(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=m(n,t+8);if(o(e))return{value:String.fromCodePoint(r,e),size:12}}throw(0,j.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function m(e,t){return y(e.charCodeAt(t))<<12|y(e.charCodeAt(t+1))<<8|y(e.charCodeAt(t+2))<<4|y(e.charCodeAt(t+3))}function y(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function b(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw(0,j.syntaxError)(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function w(e,t){const n=e.source.body,s=n.length;let o=e.lineStart,c=t+3,h=c,l="";const f=[];for(;c<s;){const s=n.charCodeAt(c);if(34===s&&34===n.charCodeAt(c+1)&&34===n.charCodeAt(c+2)){l+=n.slice(h,c),f.push(l);const i=u(e,k.TokenKind.BLOCK_STRING,t,c+3,(0,x.dedentBlockStringLines)(f).join("\n"));return e.line+=f.length-1,e.lineStart=o,i}if(92!==s||34!==n.charCodeAt(c+1)||34!==n.charCodeAt(c+2)||34!==n.charCodeAt(c+3))if(10!==s&&13!==s)if(i(s))++c;else{if(!r(n,c))throw(0,j.syntaxError)(e.source,c,`Invalid character within String: ${a(e,c)}.`);c+=2}else l+=n.slice(h,c),f.push(l),13===s&&10===n.charCodeAt(c+1)?c+=2:++c,l="",h=c,o=c;else l+=n.slice(h,c),h=c+1,c+=4}throw(0,j.syntaxError)(e.source,c,"Unterminated string.")}function g(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const e=n.charCodeAt(r);if(!(0,A.isNameContinue)(e))break;++r}return u(e,k.TokenKind.NAME,t,r,n.slice(t,r))}t.Lexer=n})),F=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.devAssert=function(e,t){if(!Boolean(e))throw new Error(t)}})),q=b((function(e,t){function n(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const i=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:n(t,i)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const i=Math.min(10,e.length),r=e.length-i,s=[];for(let r=0;r<i;++r)s.push(n(e[r],t));return 1===r?s.push("... 1 more item"):r>1&&s.push(`... ${r} more items`),"["+s.join(", ")+"]"}(e,i);return function(e,t){const i=Object.entries(e);return 0===i.length?"{}":t.length>2?"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]":"{ "+i.map((([e,i])=>e+": "+n(i,t))).join(", ")+" }"}(e,i)}(e,t);default:return String(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.inspect=function(e){return n(e,[])}})),U=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.instanceOf=void 0,t.instanceOf=function(e,t){return e instanceof t}})),C=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Source=void 0,t.isSource=function(e){return(0,U.instanceOf)(e,n)};class n{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||(0,F.devAssert)(!1,`Body must be a string. Received: ${(0,q.inspect)(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||(0,F.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,F.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}t.Source=n})),R=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=void 0,t.parse=function(e,t){return new n(e,t).parseDocument()},t.parseConstValue=function(e,t){const i=new n(e,t);i.expectToken(k.TokenKind.SOF);const r=i.parseConstValueLiteral();return i.expectToken(k.TokenKind.EOF),r},t.parseType=function(e,t){const i=new n(e,t);i.expectToken(k.TokenKind.SOF);const r=i.parseTypeReference();return i.expectToken(k.TokenKind.EOF),r},t.parseValue=function(e,t){const i=new n(e,t);i.expectToken(k.TokenKind.SOF);const r=i.parseValueLiteral(!1);return i.expectToken(k.TokenKind.EOF),r};class n{constructor(e,t={}){const n=(0,C.isSource)(e)?e:new C.Source(e);this._lexer=new P.Lexer(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(k.TokenKind.NAME);return this.node(e,{kind:N.Kind.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:N.Kind.DOCUMENT,definitions:this.many(k.TokenKind.SOF,this.parseDefinition,k.TokenKind.EOF)})}parseDefinition(){if(this.peek(k.TokenKind.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===k.TokenKind.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw(0,j.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(k.TokenKind.BRACE_L))return this.node(e,{kind:N.Kind.OPERATION_DEFINITION,operation:_.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(k.TokenKind.NAME)&&(n=this.parseName()),this.node(e,{kind:N.Kind.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(k.TokenKind.NAME);switch(e.value){case"query":return _.OperationTypeNode.QUERY;case"mutation":return _.OperationTypeNode.MUTATION;case"subscription":return _.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(k.TokenKind.PAREN_L,this.parseVariableDefinition,k.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:N.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(k.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(k.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(k.TokenKind.DOLLAR),this.node(e,{kind:N.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:N.Kind.SELECTION_SET,selections:this.many(k.TokenKind.BRACE_L,this.parseSelection,k.TokenKind.BRACE_R)})}parseSelection(){return this.peek(k.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,i;return this.expectOptionalToken(k.TokenKind.COLON)?(n=t,i=this.parseName()):i=t,this.node(e,{kind:N.Kind.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(k.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){return this.optionalMany(k.TokenKind.PAREN_L,e?this.parseConstArgument:this.parseArgument,k.TokenKind.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(k.TokenKind.COLON),this.node(t,{kind:N.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(k.TokenKind.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(k.TokenKind.NAME)?this.node(e,{kind:N.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:N.Kind.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this.node(e,!0===this._options.allowLegacyFragmentVariables?{kind:N.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}:{kind:N.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case k.TokenKind.BRACKET_L:return this.parseList(e);case k.TokenKind.BRACE_L:return this.parseObject(e);case k.TokenKind.INT:return this.advanceLexer(),this.node(t,{kind:N.Kind.INT,value:t.value});case k.TokenKind.FLOAT:return this.advanceLexer(),this.node(t,{kind:N.Kind.FLOAT,value:t.value});case k.TokenKind.STRING:case k.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case k.TokenKind.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:N.Kind.BOOLEAN,value:!0});case"false":return this.node(t,{kind:N.Kind.BOOLEAN,value:!1});case"null":return this.node(t,{kind:N.Kind.NULL});default:return this.node(t,{kind:N.Kind.ENUM,value:t.value})}case k.TokenKind.DOLLAR:if(e){if(this.expectToken(k.TokenKind.DOLLAR),this._lexer.token.kind===k.TokenKind.NAME)throw(0,j.syntaxError)(this._lexer.source,t.start,`Unexpected variable "$${this._lexer.token.value}" in constant value.`);throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:N.Kind.STRING,value:e.value,block:e.kind===k.TokenKind.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:N.Kind.LIST,values:this.any(k.TokenKind.BRACKET_L,(()=>this.parseValueLiteral(e)),k.TokenKind.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:N.Kind.OBJECT,fields:this.any(k.TokenKind.BRACE_L,(()=>this.parseObjectField(e)),k.TokenKind.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(k.TokenKind.COLON),this.node(t,{kind:N.Kind.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(k.TokenKind.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(k.TokenKind.AT),this.node(t,{kind:N.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(k.TokenKind.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(k.TokenKind.BRACKET_R),t=this.node(e,{kind:N.Kind.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(k.TokenKind.BANG)?this.node(e,{kind:N.Kind.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:N.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(k.TokenKind.STRING)||this.peek(k.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(k.TokenKind.BRACE_L,this.parseOperationTypeDefinition,k.TokenKind.BRACE_R);return this.node(e,{kind:N.Kind.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(k.TokenKind.COLON);const n=this.parseNamedType();return this.node(e,{kind:N.Kind.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:N.Kind.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:N.Kind.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(k.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(k.TokenKind.BRACE_L,this.parseFieldDefinition,k.TokenKind.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(k.TokenKind.COLON);const r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:N.Kind.FIELD_DEFINITION,description:t,name:n,arguments:i,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(k.TokenKind.PAREN_L,this.parseInputValueDef,k.TokenKind.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(k.TokenKind.COLON);const i=this.parseTypeReference();let r;this.expectOptionalToken(k.TokenKind.EQUALS)&&(r=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(e,{kind:N.Kind.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:r,directives:s})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:N.Kind.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:N.Kind.UNION_TYPE_DEFINITION,description:t,name:n,directives:i,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(k.TokenKind.EQUALS)?this.delimitedMany(k.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:N.Kind.ENUM_TYPE_DEFINITION,description:t,name:n,directives:i,values:r})}parseEnumValuesDefinition(){return this.optionalMany(k.TokenKind.BRACE_L,this.parseEnumValueDefinition,k.TokenKind.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:N.Kind.ENUM_VALUE_DEFINITION,description:t,name:n,directives:i})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw(0,j.syntaxError)(this._lexer.source,this._lexer.token.start,`${i(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:N.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:i,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(k.TokenKind.BRACE_L,this.parseInputValueDef,k.TokenKind.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===k.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(k.TokenKind.BRACE_L,this.parseOperationTypeDefinition,k.TokenKind.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:N.Kind.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:N.Kind.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:N.Kind.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:N.Kind.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:N.Kind.UNION_TYPE_EXTENSION,name:t,directives:n,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:N.Kind.ENUM_TYPE_EXTENSION,name:t,directives:n,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:N.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(k.TokenKind.AT);const n=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const s=this.parseDirectiveLocations();return this.node(e,{kind:N.Kind.DIRECTIVE_DEFINITION,description:t,name:n,arguments:i,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(k.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call($.DirectiveLocation,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new _.Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw(0,j.syntaxError)(this._lexer.source,t.start,`Expected ${r(e)}, found ${i(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==k.TokenKind.NAME||t.value!==e)throw(0,j.syntaxError)(this._lexer.source,t.start,`Expected "${e}", found ${i(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===k.TokenKind.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return(0,j.syntaxError)(this._lexer.source,t.start,`Unexpected ${i(t)}.`)}any(e,t,n){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(n);)i.push(t.call(this));return i}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const i=[];do{i.push(t.call(this))}while(!this.expectOptionalToken(n));return i}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==k.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw(0,j.syntaxError)(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function i(e){const t=e.value;return r(e.kind)+(null!=t?` "${t}"`:"")}function r(e){return(0,P.isPunctuatorTokenKind)(e)?`"${e}"`:e}t.Parser=n})),M=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.printString=function(e){return`"${e.replace(n,i)}"`};const n=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function i(e){return r[e.charCodeAt(0)]}const r=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]})),L=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BREAK=void 0,t.getEnterLeaveForKind=i,t.getVisitFn=function(e,t,n){const{enter:r,leave:s}=i(e,t);return n?s:r},t.visit=function(e,t,r=_.QueryDocumentKeys){const s=new Map;for(const e of Object.values(N.Kind))s.set(e,i(t,e));let o,a,u,c=Array.isArray(e),h=[e],l=-1,f=[],d=e;const v=[],p=[];do{l++;const e=l===h.length,i=e&&0!==f.length;if(e){if(a=0===p.length?void 0:v[v.length-1],d=u,u=p.pop(),i)if(c){d=d.slice();let e=0;for(const[t,n]of f){const i=t-e;null===n?(d.splice(i,1),e++):d[i]=n}}else{d=Object.defineProperties({},Object.getOwnPropertyDescriptors(d));for(const[e,t]of f)d[e]=t}l=o.index,h=o.keys,f=o.edits,c=o.inArray,o=o.prev}else if(u){if(a=c?l:h[l],d=u[a],null==d)continue;v.push(a)}let w;if(!Array.isArray(d)){var m,y;(0,_.isNode)(d)||(0,F.devAssert)(!1,`Invalid AST Node: ${(0,q.inspect)(d)}.`);const i=e?null===(m=s.get(d.kind))||void 0===m?void 0:m.leave:null===(y=s.get(d.kind))||void 0===y?void 0:y.enter;if(w=null==i?void 0:i.call(t,d,a,u,v,p),w===n)break;if(!1===w){if(!e){v.pop();continue}}else if(void 0!==w&&(f.push([a,w]),!e)){if(!(0,_.isNode)(w)){v.pop();continue}d=w}}var b;void 0===w&&i&&f.push([a,d]),e?v.pop():(o={inArray:c,index:l,keys:h,edits:f,prev:o},c=Array.isArray(d),h=c?d:null!==(b=r[d.kind])&&void 0!==b?b:[],l=-1,f=[],u&&p.push(u),u=d)}while(void 0!==o);return 0!==f.length?f[f.length-1][1]:e},t.visitInParallel=function(e){const t=new Array(e.length).fill(null),r=Object.create(null);for(const s of Object.values(N.Kind)){let o=!1;const a=new Array(e.length).fill(void 0),u=new Array(e.length).fill(void 0);for(let t=0;t<e.length;++t){const{enter:n,leave:r}=i(e[t],s);o||(o=null!=n||null!=r),a[t]=n,u[t]=r}o&&(r[s]={enter(...i){const r=i[0];for(let o=0;o<e.length;o++)if(null===t[o]){var s;const u=null===(s=a[o])||void 0===s?void 0:s.apply(e[o],i);if(!1===u)t[o]=r;else if(u===n)t[o]=n;else if(void 0!==u)return u}},leave(...i){const r=i[0];for(let o=0;o<e.length;o++)if(null===t[o]){var s;const r=null===(s=u[o])||void 0===s?void 0:s.apply(e[o],i);if(r===n)t[o]=n;else if(void 0!==r&&!1!==r)return r}else t[o]===r&&(t[o]=null)}})}return r};const n=Object.freeze({});function i(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}t.BREAK=n})),V=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.print=function(e){return(0,L.visit)(e,n)};const n={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>i(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=s("(",i(e.variableDefinitions,", "),")"),n=i([e.operation,i([e.name,t]),i(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+s(" = ",n)+s(" ",i(r," "))},SelectionSet:{leave:({selections:e})=>r(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:a}){const u=s("",e,": ")+t;let c=u+s("(",i(n,", "),")");return c.length>80&&(c=u+s("(\n",o(i(n,"\n")),"\n)")),i([c,i(r," "),a]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+s(" ",i(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>i(["...",s("on ",e),i(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:o})=>`fragment ${e}${s("(",i(n,", "),")")} on ${t} ${s("",i(r," ")," ")}`+o},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,x.printBlockString)(e):(0,M.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+i(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+i(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+s("(",i(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>s("",e,"\n")+i(["schema",i(t," "),r(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>s("",e,"\n")+i(["scalar",t,i(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:o,fields:a})=>s("",e,"\n")+i(["type",t,s("implements ",i(n," & ")),i(o," "),r(a)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:u})=>s("",e,"\n")+t+(a(n)?s("(\n",o(i(n,"\n")),"\n)"):s("(",i(n,", "),")"))+": "+r+s(" ",i(u," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:o})=>s("",e,"\n")+i([t+": "+n,s("= ",r),i(o," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:o,fields:a})=>s("",e,"\n")+i(["interface",t,s("implements ",i(n," & ")),i(o," "),r(a)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>s("",e,"\n")+i(["union",t,i(n," "),s("= ",i(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:o})=>s("",e,"\n")+i(["enum",t,i(n," "),r(o)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>s("",e,"\n")+i([t,i(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:o})=>s("",e,"\n")+i(["input",t,i(n," "),r(o)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:u})=>s("",e,"\n")+"directive @"+t+(a(n)?s("(\n",o(i(n,"\n")),"\n)"):s("(",i(n,", "),")"))+(r?" repeatable":"")+" on "+i(u," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>i(["extend schema",i(e," "),r(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>i(["extend scalar",e,i(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:o})=>i(["extend type",e,s("implements ",i(t," & ")),i(n," "),r(o)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:o})=>i(["extend interface",e,s("implements ",i(t," & ")),i(n," "),r(o)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>i(["extend union",e,i(t," "),s("= ",i(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>i(["extend enum",e,i(t," "),r(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>i(["extend input",e,i(t," "),r(n)]," ")}};function i(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function r(e){return s("{\n",o(i(e,"\n")),"\n}")}function s(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function o(e){return s(" ",e.replace(/\n/g,"\n "))}function a(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}})),B=function(e){var t=e.name,n=e.type;this.uri=e.uri,this.name=t,this.type=n},G=function(e){return"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||e instanceof B},J=function e(t,n,i){var r;void 0===n&&(n=""),void 0===i&&(i=G);var s=new Map;function o(e,t){var n=s.get(t);n?n.push.apply(n,e):s.set(t,e)}if(i(t))r=null,o([n],t);else{var a=n?n+".":"";if("undefined"!=typeof FileList&&t instanceof FileList)r=Array.prototype.map.call(t,(function(e,t){return o([""+a+t],e),null}));else if(Array.isArray(t))r=t.map((function(t,n){var r=e(t,""+a+n,i);return r.files.forEach(o),r.clone}));else if(t&&t.constructor===Object)for(var u in r={},t){var c=e(t[u],""+a+u,i);c.files.forEach(o),r[u]=c.clone}else r=t}return{clone:r,files:s}},z=G,H="object"==typeof self?self.FormData:window.FormData,Q=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.defaultJsonSerializer=void 0,t.defaultJsonSerializer={parse:JSON.parse,stringify:JSON.stringify}})),W=b((function(e,t){var n=y&&y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(H),r=function(e){return z(e)||null!==e&&"object"==typeof e&&"function"==typeof e.pipe};t.default=function(e,t,n,s){void 0===s&&(s=Q.defaultJsonSerializer);var o=J({query:e,variables:t,operationName:n},"",r),a=o.clone,u=o.files;if(0===u.size){if(!Array.isArray(e))return s.stringify(a);if(void 0!==t&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");var c=e.reduce((function(e,n,i){return e.push({query:n,variables:t?t[i]:void 0}),e}),[]);return s.stringify(c)}var h=new("undefined"==typeof FormData?i.default:FormData);h.append("operations",s.stringify(a));var l={},f=0;return u.forEach((function(e){l[++f]=e})),h.append("map",s.stringify(l)),f=0,u.forEach((function(e,t){h.append(""+ ++f,t)})),h}})),K=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseBatchRequestsExtendedArgs=t.parseRawRequestExtendedArgs=t.parseRequestExtendedArgs=t.parseBatchRequestArgs=t.parseRawRequestArgs=t.parseRequestArgs=void 0,t.parseRequestArgs=function(e,t,n){return e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0}},t.parseRawRequestArgs=function(e,t,n){return e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0}},t.parseBatchRequestArgs=function(e,t){return e.documents?e:{documents:e,requestHeaders:t,signal:void 0}},t.parseRequestExtendedArgs=function(e,t,n,i){return e.document?e:{url:e,document:t,variables:n,requestHeaders:i,signal:void 0}},t.parseRawRequestExtendedArgs=function(e,t,n,i){return e.query?e:{url:e,query:t,variables:n,requestHeaders:i,signal:void 0}},t.parseBatchRequestsExtendedArgs=function(e,t,n){return e.documents?e:{url:e,documents:t,requestHeaders:n,signal:void 0}}})),X=b((function(e,t){var n,i=y&&y.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.ClientError=void 0;var r=function(e){function t(n,i){var r=this,s=t.extractMessage(n)+": "+JSON.stringify({response:n,request:i});return r=e.call(this,s)||this,Object.setPrototypeOf(r,t.prototype),r.response=n,r.request=i,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,t),r}return i(t,e),t.extractMessage=function(e){try{return e.errors[0].message}catch(t){return"GraphQL Error (Code: "+e.status+")"}},t}(Error);t.ClientError=r})),Y=b((function(e,t){var n=y&&y.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},i=y&&y.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}u((i=i.apply(e,t||[])).next())}))},r=y&&y.__generator||function(e,t){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLWebSocketClient=void 0;var s="ping",o="pong",a="complete",u=function(){function e(e,t,n){this._type=e,this._payload=t,this._id=n}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return this._payload},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){var e={type:this.type};return null!=this.id&&null!=this.id&&(e.id=this.id),null!=this.payload&&null!=this.payload&&(e.payload=this.payload),JSON.stringify(e)},enumerable:!1,configurable:!0}),e.parse=function(t,n){var i=JSON.parse(t),r=i.id;return new e(i.type,n(i.payload),r)},e}(),c=function(){function e(e,t){var c=this,f=t.onInit,d=t.onAcknowledged,v=t.onPing,p=t.onPong;this.socketState={acknowledged:!1,lastRequestId:0,subscriptions:{}},this.socket=e,e.onopen=function(){return i(c,void 0,void 0,(function(){var t,n,i,s;return r(this,(function(r){switch(r.label){case 0:return this.socketState.acknowledged=!1,this.socketState.subscriptions={},n=(t=e).send,i=h,f?[4,f()]:[3,2];case 1:return s=r.sent(),[3,3];case 2:s=null,r.label=3;case 3:return n.apply(t,[i.apply(void 0,[s]).text]),[2]}}))}))},e.onclose=function(){c.socketState.acknowledged=!1,c.socketState.subscriptions={}},e.onerror=function(e){console.error(e)},e.onmessage=function(t){try{var i=(void 0===y&&(y=function(e){return e}),u.parse(t.data,y));switch(i.type){case"connection_ack":return void(c.socketState.acknowledged?console.warn("Duplicate CONNECTION_ACK message ignored"):(c.socketState.acknowledged=!0,d&&d(i.payload)));case s:return void(v?v(i.payload).then((function(t){return e.send(l(t).text)})):e.send(l(null).text));case o:return void(p&&p(i.payload))}if(!c.socketState.acknowledged)return;if(null==i.id||!c.socketState.subscriptions[i.id])return;var r=c.socketState.subscriptions[i.id],h=r.query,f=r.variables,m=r.subscriber;switch(i.type){case"next":return!i.payload.errors&&i.payload.data&&m.next&&m.next(i.payload.data),void(i.payload.errors&&m.error&&m.error(new X.ClientError(n(n({},i.payload),{status:200}),{query:h,variables:f})));case"error":return void(m.error&&m.error(new X.ClientError({errors:i.payload,status:200},{query:h,variables:f})));case a:return m.complete&&m.complete(),void delete c.socketState.subscriptions[i.id]}}catch(t){console.error(t),e.close(1006)}var y;e.close(4400,"Unknown graphql-ws message.")}}return e.prototype.makeSubscribe=function(e,t,n,i){var r,s,o=this,c=(this.socketState.lastRequestId++).toString();return this.socketState.subscriptions[c]={query:e,variables:n,subscriber:i},this.socket.send((r=c,s={query:e,operationName:t,variables:n},new u("subscribe",s,r)).text),function(){o.socket.send(function(e){return new u(a,void 0,e)}(c).text),delete o.socketState.subscriptions[c]}},e.prototype.rawRequest=function(e,t){var n=this;return new Promise((function(i,r){var s;n.rawSubscribe(e,{next:function(e,t){return s={data:e,extensions:t}},error:r,complete:function(){return i(s)}},t)}))},e.prototype.request=function(e,t){var n=this;return new Promise((function(i,r){var s;n.subscribe(e,{next:function(e){return s=e},error:r,complete:function(){return i(s)}},t)}))},e.prototype.subscribe=function(e,t,n){var i=Z.resolveRequestDocument(e);return this.makeSubscribe(i.query,i.operationName,n,t)},e.prototype.rawSubscribe=function(e,t,n){return this.makeSubscribe(e,void 0,n,t)},e.prototype.ping=function(e){this.socket.send(function(e){return new u(s,e,void 0)}(e).text)},e.prototype.close=function(){this.socket.close(1e3)},e.PROTOCOL="graphql-transport-ws",e}();function h(e){return new u("connection_init",e)}function l(e){return new u(o,e,void 0)}t.GraphQLWebSocketClient=c})),Z=b((function(e,t){var n=y&&y.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},i=y&&y.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=y&&y.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=y&&y.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t},o=y&&y.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}u((i=i.apply(e,t||[])).next())}))},a=y&&y.__generator||function(e,t){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},u=y&&y.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n},c=y&&y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLWebSocketClient=t.gql=t.resolveRequestDocument=t.batchRequests=t.request=t.rawRequest=t.GraphQLClient=t.ClientError=void 0;var h=s(O),l=h,f=c(W);Object.defineProperty(t,"ClientError",{enumerable:!0,get:function(){return X.ClientError}});var d=function(e){var t={};return e&&("undefined"!=typeof Headers&&e instanceof Headers||e instanceof l.Headers?t=function(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}(e):Array.isArray(e)?e.forEach((function(e){t[e[0]]=e[1]})):t=e),t},v=function(e){return e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim()},p=function(e){var t=e.url,i=e.query,r=e.variables,s=e.operationName,u=e.headers,c=e.fetch,h=e.fetchOptions;return o(void 0,void 0,void 0,(function(){var e;return a(this,(function(o){switch(o.label){case 0:return e=f.default(i,r,s,h.jsonSerializer),[4,c(t,n({method:"POST",headers:n(n({},"string"==typeof e?{"Content-Type":"application/json"}:{}),u),body:e},h))];case 1:return[2,o.sent()]}}))}))},m=function(e){var t=e.url,i=e.query,r=e.variables,s=e.operationName,u=e.headers,c=e.fetch,h=e.fetchOptions;return o(void 0,void 0,void 0,(function(){var e;return a(this,(function(o){switch(o.label){case 0:return e=function(e){var t=e.query,n=e.variables,i=e.operationName,r=e.jsonSerializer;if(!Array.isArray(t)){var s=["query="+encodeURIComponent(v(t))];return n&&s.push("variables="+encodeURIComponent(r.stringify(n))),i&&s.push("operationName="+encodeURIComponent(i)),s.join("&")}if(void 0!==n&&!Array.isArray(n))throw new Error("Cannot create query with given variable type, array expected");var o=t.reduce((function(e,t,i){return e.push({query:v(t),variables:n?r.stringify(n[i]):void 0}),e}),[]);return"query="+encodeURIComponent(r.stringify(o))}({query:i,variables:r,operationName:s,jsonSerializer:h.jsonSerializer}),[4,c(t+"?"+e,n({method:"GET",headers:u},h))];case 1:return[2,o.sent()]}}))}))},b=function(){function e(e,t){this.url=e,this.options=t||{}}return e.prototype.rawRequest=function(e,t,i){return o(this,void 0,void 0,(function(){var r,s,o,c,l,f,v,p,m,y;return a(this,(function(){return r=K.parseRawRequestArgs(e,t,i),o=(s=this.options).headers,l=void 0===(c=s.fetch)?h.default:c,v=void 0===(f=s.method)?"POST":f,p=u(s,["headers","fetch","method"]),m=this.url,void 0!==r.signal&&(p.signal=r.signal),y=D(r.query).operationName,[2,w({url:m,query:r.query,variables:r.variables,headers:n(n({},d(E(o))),d(r.requestHeaders)),operationName:y,fetch:l,method:v,fetchOptions:p})]}))}))},e.prototype.request=function(e,t,i){return o(this,void 0,void 0,(function(){var r,s,o,c,l,f,v,p,m,y,b;return a(this,(function(a){switch(a.label){case 0:return r=K.parseRequestArgs(e,t,i),o=(s=this.options).headers,l=void 0===(c=s.fetch)?h.default:c,v=void 0===(f=s.method)?"POST":f,p=u(s,["headers","fetch","method"]),m=this.url,void 0!==r.signal&&(p.signal=r.signal),y=D(r.document),b=y.operationName,[4,w({url:m,query:y.query,variables:r.variables,headers:n(n({},d(E(o))),d(r.requestHeaders)),operationName:b,fetch:l,method:v,fetchOptions:p})];case 1:return[2,a.sent().data]}}))}))},e.prototype.batchRequests=function(e,t){return o(this,void 0,void 0,(function(){var i,r,s,o,c,l,f,v,p,m,y;return a(this,(function(a){switch(a.label){case 0:return i=K.parseBatchRequestArgs(e,t),s=(r=this.options).headers,c=void 0===(o=r.fetch)?h.default:o,f=void 0===(l=r.method)?"POST":l,v=u(r,["headers","fetch","method"]),p=this.url,void 0!==i.signal&&(v.signal=i.signal),m=i.documents.map((function(e){return D(e.document).query})),y=i.documents.map((function(e){return e.variables})),[4,w({url:p,query:m,variables:y,headers:n(n({},d(E(s))),d(i.requestHeaders)),operationName:void 0,fetch:c,method:f,fetchOptions:v})];case 1:return[2,a.sent().data]}}))}))},e.prototype.setHeaders=function(e){return this.options.headers=e,this},e.prototype.setHeader=function(e,t){var n,i=this.options.headers;return i?i[e]=t:this.options.headers=((n={})[e]=t,n),this},e.prototype.setEndpoint=function(e){return this.url=e,this},e}();function w(e){var t=e.url,i=e.query,r=e.variables,s=e.headers,c=e.operationName,h=e.fetch,l=e.method,f=void 0===l?"POST":l,d=e.fetchOptions;return o(this,void 0,void 0,(function(){var e,o,l,v,y,b,w,g,O,T;return a(this,(function(a){switch(a.label){case 0:return e="POST"===f.toUpperCase()?p:m,o=Array.isArray(i),[4,e({url:t,query:i,variables:r,operationName:c,headers:s,fetch:h,fetchOptions:d})];case 1:return[4,S(l=a.sent(),d.jsonSerializer)];case 2:if(v=a.sent(),y=o&&Array.isArray(v)?!v.some((function(e){return!e.data})):!!v.data,b=!v.errors||"all"===d.errorPolicy||"ignore"===d.errorPolicy,l.ok&&b&&y)return w=l.headers,g=l.status,O=u(v,["errors"]),T="ignore"===d.errorPolicy?O:v,[2,n(n({},o?{data:T}:T),{headers:w,status:g})];throw new X.ClientError(n(n({},"string"==typeof v?{error:v}:v),{status:l.status,headers:l.headers}),{query:i,variables:r})}}))}))}function g(e,t,i,r){return o(this,void 0,void 0,(function(){var s;return a(this,(function(){return s=K.parseRequestExtendedArgs(e,t,i,r),[2,new b(s.url).request(n({},s))]}))}))}function S(e,t){return void 0===t&&(t=Q.defaultJsonSerializer),o(this,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return e.headers.forEach((function(e,t){"content-type"===t.toLowerCase()&&(n=e)})),n&&n.toLowerCase().startsWith("application/json")?(r=(i=t).parse,[4,e.text()]):[3,2];case 1:return[2,r.apply(i,[s.sent()])];case 2:return[2,e.text()]}}))}))}function T(e){var t,n=void 0,i=e.definitions.filter((function(e){return"OperationDefinition"===e.kind}));return 1===i.length&&(n=null===(t=i[0].name)||void 0===t?void 0:t.value),n}function D(e){if("string"==typeof e){var t=void 0;try{t=T(R.parse(e))}catch(e){}return{query:e,operationName:t}}var n=T(e);return{query:V.print(e),operationName:n}}function E(e){return"function"==typeof e?e():e}t.GraphQLClient=b,t.rawRequest=function(e,t,i,r){return o(this,void 0,void 0,(function(){var s;return a(this,(function(){return s=K.parseRawRequestExtendedArgs(e,t,i,r),[2,new b(s.url).rawRequest(n({},s))]}))}))},t.request=g,t.batchRequests=function(e,t,i){return o(this,void 0,void 0,(function(){var r;return a(this,(function(){return r=K.parseBatchRequestsExtendedArgs(e,t,i),[2,new b(r.url).batchRequests(n({},r))]}))}))},t.default=g,t.resolveRequestDocument=D,t.gql=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e.reduce((function(e,n,i){return""+e+n+(i in t?t[i]:"")}),"")},Object.defineProperty(t,"GraphQLWebSocketClient",{enumerable:!0,get:function(){return Y.GraphQLWebSocketClient}})}));class ee{static getQueryParams(e){const t=new Map,n=/[?&]?([^=]+)=([^&]*)/g;let i;for(e=(e=window.unescape(e)).split("+").join(" ");i=n.exec(e);)t.set(window.decodeURIComponent(i[1]),i[2]);return t.set("urlBase",this.getUrlBase()),window.moduleID&&window.URIServiceBroker&&(t.set("moduleID",window.moduleID),t.set("URIServiceBroker",window.URIServiceBroker)),t}static getUrlBase(){return window.mock_url?window.mock_url:`${location.protocol}//${location.hostname}${location.port?":"+location.port:""}`}}class te{constructor(){this.GRAPHQL_PATH="/mge/graphql",this.watingRequestsById=new Map}static get(){if(!te.instance){te.instance=new te;const e=document.querySelector(this.appTagName);null===e?te.instance.resume():(e.addEventListener("applicationLoading",(()=>te.instance.pause())),e.addEventListener("applicationLoaded",(()=>te.instance.resume())))}return this.instance}static addRequestListener(e){te.requestListener.indexOf(e)<0&&te.requestListener.push(e)}static removeRequestListener(e){const t=te.requestListener.indexOf(e);t>-1&&te.requestListener.splice(t,1)}async callGraphQL(e){var t;const n=this.getReqKey(e);return e.queryID=n,e.values.queryID=n,this.ready?new Promise((async(t,r)=>{let s=this.getQueryTemplate(e);const o=await this.fecthGrapql([{document:s,variables:e.values}]);o.errors.length>0?r(new i("Falha detectada",o.errors[0][0].message)):t(o.data[0][n])})):(this.watingRequestsById.has(n)||this.watingRequestsById.set(n,new ne(e)),null===(t=this.getWatingRequest(n))||void 0===t?void 0:t.promise)}resolveURL(){return ee.getUrlBase()}getContext(e){const t=ee.getQueryParams(location.search);return{baseUrl:`${this.resolveURL()}/${e}/service.sbr`,appName:"SankhyaBlocks",mgeSession:`${window.skw_session||t.mgeSession}`,globalID:"85C0093DFA240EAB699B4E47A10215BD",resourceID:"br.com.sankhya.mov.bancaria"}}async callServiceBroker(e,t){return new Promise(((n,i)=>{const r=e.split("@"),[s,o]=2===r.length?r:["mge",e],a=this.getContext(s),u=`${a.baseUrl}?serviceName=${o}&counter=21&application=${a.appName}&outputType=json&preventTransform=false&mgeSession=${a.mgeSession}&resourceID=${a.resourceID}&globalID=${a.globalID}&allowConcurrentCalls=true`;document.cookie=`JSESSIONID=${a.mgeSession};`;const c=new XMLHttpRequest;te.requestListener.forEach((e=>e.onRequestStart({url:u}))),c.open("POST",u,!0),c.withCredentials=!0,c.send(t),c.onreadystatechange=function(){if(4==this.readyState&&200==this.status){try{const e=JSON.parse(this.responseText);1==e.status?n(e.responseBody):i(e)}catch(e){console.warn(`callServiceBroker error to parser response to JSON ${e}`),i(this.responseText)}te.requestListener.forEach((e=>e.onRequestEnd({url:u})))}else 4==this.readyState&&200!=this.status&&(i(this.responseText),te.requestListener.forEach((e=>e.onRequestEnd({url:u}))))}}))}getReqKey(e){return window.btoa(r.hashCode(`${e.query}${JSON.stringify(e.values||"")}`)).replace(/=/g,"")}getQueryTemplate(e){return(e.query||"").replaceAll("$queryAlias$",e.queryID)}getWatingRequest(e){return this.watingRequestsById.get(e)}pause(){this.ready=!1}async resume(){if(this.ready=!0,this.watingRequestsById.size>0){const e=[];let t;this.watingRequestsById.forEach((async t=>{let n=this.getQueryTemplate(t.request);e.push({document:n,variables:Object.assign({},t.request.values)})}));let n=[],r=[];t=await this.fecthGrapql(e),n=t.data,r=t.errors,r.forEach((e=>{Object.entries(e).forEach((([e,t])=>{var n;((null===(n=this.getWatingRequest(t.request.variables[t.index].queryID))||void 0===n?void 0:n.reject)||Promise.reject)(new i("Falha detectada",t.message))}))})),n.forEach((e=>{Object.entries(e).forEach((([e,t])=>{var n;((null===(n=this.getWatingRequest(e))||void 0===n?void 0:n.resolve)||Promise.resolve)(t)}))})),this.watingRequestsById.clear()}}async fecthGrapql(e){let t,n=[],r=[],s=`${this.resolveURL()+this.GRAPHQL_PATH}`;window.skw_session&&(s+=`?mgeSession=${window.skw_session}`),te.requestListener.forEach((e=>e.onRequestStart({url:s})));try{t=await Z.batchRequests(s,e,{"Content-Type":`application/json; charset=${window.SERVER_ENCODING||"UTF-8"}`}),t.forEach(((t,i)=>{var s;(null===(s=null==t?void 0:t.errors)||void 0===s?void 0:s.length)>0?r.push(t.errors.map((t=>this.normalizeErrorResponse(t,e,i)))):n.push(t.data)}))}catch(e){if(this.isHttpError(e))throw te.requestListener.forEach((e=>e.onRequestEnd({url:s}))),new i("Falha de comunicação",e.message);{t=e.response;const i=e.request;Object.entries(t).forEach((([e,t])=>{t.errors?r.push(t.errors.map((t=>(t.request=i,t.index=Number(e),t)))):t.data&&n.push(t.data)}))}}return te.requestListener.forEach((e=>e.onRequestEnd({url:s}))),{data:n,errors:r}}isHttpError(e){var t;return!e.response&&!e.request||(null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.status)>=300}normalizeErrorResponse(e,t,n){const i=Object.assign({},t[n]),{variables:r}=i;return i.variables=[],i.variables[n]=r,e.request=i,e.index=Number(n),e}}te.appTagName="snk-application",te.requestListener=[];class ne{constructor(e){this._resolve=()=>{},this._reject=()=>{},this._request=void 0,this._request=e,this._promisse=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promisse}get request(){return this._request}}class ie{constructor(){this.templateByQuery=new Map,this._loadDataTimeout={},this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchDataUnit",Z.gql`query($name: String!) {
1
+ import{r as e,c as t,h as n}from"./p-cd1dc099.js";import{ErrorException as i,StringUtils as r,DataUnit as s,DataType as o,ChangeOperation as a,DateUtils as u,ObjectUtils as c,WaitingChangeException as h,WarningException as l,DependencyType as f,ApplicationContext as d,ErrorTracking as v}from"@sankhyalabs/core";import{ApplicationUtils as p}from"@sankhyalabs/ezui/dist/collection/utils";import{S as m}from"./p-ab694dbc.js";var y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function b(e,t,n){return e(n={path:t,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var w,g,O=b((function(e,t){var n="undefined"!=typeof self?self:y,i=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,i="Symbol"in e&&"iterator"in Symbol,r="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in e,o="ArrayBuffer"in e;if(o)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function l(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function v(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function p(e){var t=new FileReader,n=v(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&r&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var e,t,n,i=d(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,n=v(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),i=0;i<t.length;i++)n[i]=String.fromCharCode(t[i]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=c(e),t=h(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},f.prototype.delete=function(e){delete this.map[c(e)]},f.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},f.prototype.set=function(e,t){this.map[c(e)]=h(t)},f.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),l(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),l(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),l(e)},i&&(f.prototype[Symbol.iterator]=f.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(e,t){var n,i,r=(t=t||{}).body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(i=(n=t.method||this.method||"GET").toUpperCase(),b.indexOf(i)>-1?i:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function g(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(r))}})),t}function O(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}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 e=new O(null,{status:0,statusText:""});return e.type="error",e};var T=[301,302,303,307,308];O.redirect=function(e,t){if(-1===T.indexOf(t))throw new RangeError("Invalid status code");return new O(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,n){return new Promise((function(i,s){var o=new w(e,n);if(o.signal&&o.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var e,t,n={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),i=n.shift().trim();if(i){var r=n.join(":").trim();t.append(i,r)}})),t)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL"),i(new O("response"in a?a.response:a.responseText,n))},a.onerror=function(){s(new TypeError("Network request failed"))},a.ontimeout=function(){s(new TypeError("Network request failed"))},a.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&r&&(a.responseType="blob"),o.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",u)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=f,e.Request=w,e.Response=O),t.Headers=f,t.Request=w,t.Response=O,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=i;(t=r.fetch).default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t})),T=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isObjectLike=function(e){return"object"==typeof e&&null!==e}})),S=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.invariant=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}})),D=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getLocation=function(e,t){let i=0,r=1;for(const s of e.body.matchAll(n)){if("number"==typeof s.index||(0,S.invariant)(!1),s.index>=t)break;i=s.index+s[0].length,r+=1}return{line:r,column:t+1-i}};const n=/\r\n|[\n\r]/g})),E=b((function(e,t){function n(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,s=t.line-1,o=t.line+(e.locationOffset.line-1),a=t.column+(1===t.line?n:0),u=`${e.name}:${o}:${a}\n`,c=r.split(/\r\n|[\n\r]/g),h=c[s];if(h.length>120){const e=Math.floor(a/80),t=a%80,n=[];for(let e=0;e<h.length;e+=80)n.push(h.slice(e,e+80));return u+i([[`${o} |`,n[0]],...n.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return u+i([[o-1+" |",c[s-1]],[`${o} |`,h],["|","^".padStart(a)],[`${o+1} |`,c[s+1]]])}function i(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}Object.defineProperty(t,"__esModule",{value:!0}),t.printLocation=function(e){return n(e.source,(0,D.getLocation)(e.source,e.start))},t.printSourceLocation=n})),I=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLError=void 0,t.formatError=function(e){return e.toJSON()},t.printError=function(e){return e.toString()};class n extends Error{constructor(e,...t){var r,s,o;const{nodes:a,source:u,positions:c,path:h,originalError:l,extensions:f}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=h?h:void 0,this.originalError=null!=l?l:void 0,this.nodes=i(Array.isArray(a)?a:a?[a]:void 0);const d=i(null===(r=this.nodes)||void 0===r?void 0:r.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=u?u:null==d||null===(s=d[0])||void 0===s?void 0:s.source,this.positions=null!=c?c:null==d?void 0:d.map((e=>e.start)),this.locations=c&&u?c.map((e=>(0,D.getLocation)(u,e))):null==d?void 0:d.map((e=>(0,D.getLocation)(e.source,e.start)));const v=(0,T.isObjectLike)(null==l?void 0:l.extensions)?null==l?void 0:l.extensions:void 0;this.extensions=null!==(o=null!=f?f:v)&&void 0!==o?o:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=l&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,n):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+(0,E.printLocation)(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+(0,E.printSourceLocation)(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function i(e){return void 0===e||0===e.length?void 0:e}t.GraphQLError=n})),j=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.syntaxError=function(e,t,n){return new I.GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})}})),_=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Token=t.QueryDocumentKeys=t.OperationTypeNode=t.Location=void 0,t.isNode=function(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&s.has(t)};class n{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}t.Location=n;class i{constructor(e,t,n,i,r,s){this.kind=e,this.start=t,this.end=n,this.line=i,this.column=r,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}t.Token=i;const r={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};t.QueryDocumentKeys=r;const s=new Set(Object.keys(r));var o;t.OperationTypeNode=o,function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(o||(t.OperationTypeNode=o={}))})),$=b((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveLocation=void 0,t.DirectiveLocation=n,function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(n||(t.DirectiveLocation=n={}))})),N=b((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Kind=void 0,t.Kind=n,function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(n||(t.Kind=n={}))})),A=b((function(e,t){function n(e){return e>=48&&e<=57}function i(e){return e>=97&&e<=122||e>=65&&e<=90}Object.defineProperty(t,"__esModule",{value:!0}),t.isDigit=n,t.isLetter=i,t.isNameContinue=function(e){return i(e)||n(e)||95===e},t.isNameStart=function(e){return i(e)||95===e},t.isWhiteSpace=function(e){return 9===e||32===e}})),x=b((function(e,t){function n(e){let t=0;for(;t<e.length&&(0,A.isWhiteSpace)(e.charCodeAt(t));)++t;return t}Object.defineProperty(t,"__esModule",{value:!0}),t.dedentBlockStringLines=function(e){var t;let i=Number.MAX_SAFE_INTEGER,r=null,s=-1;for(let t=0;t<e.length;++t){var o;const a=e[t],u=n(a);u!==a.length&&(r=null!==(o=r)&&void 0!==o?o:t,s=t,0!==t&&u<i&&(i=u))}return e.map(((e,t)=>0===t?e:e.slice(i))).slice(null!==(t=r)&&void 0!==t?t:0,s+1)},t.isPrintableAsBlockString=function(e){if(""===e)return!0;let t=!0,n=!1,i=!0,r=!1;for(let s=0;s<e.length;++s)switch(e.codePointAt(s)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:case 13:return!1;case 10:if(t&&!r)return!1;r=!0,t=!0,n=!1;break;case 9:case 32:n||(n=t);break;default:i&&(i=n),t=!1}return!t&&(!i||!r)},t.printBlockString=function(e,t){const n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=1===i.length,s=i.length>1&&i.slice(1).every((e=>0===e.length||(0,A.isWhiteSpace)(e.charCodeAt(0)))),o=n.endsWith('\\"""'),a=e.endsWith('"')&&!o,u=e.endsWith("\\"),c=a||u,h=!(null!=t&&t.minimize)&&(!r||e.length>70||c||s||o);let l="";const f=r&&(0,A.isWhiteSpace)(e.charCodeAt(0));return(h&&!f||s)&&(l+="\n"),l+=n,(h||c)&&(l+="\n"),'"""'+l+'"""'}})),k=b((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenKind=void 0,t.TokenKind=n,function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(n||(t.TokenKind=n={}))})),P=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Lexer=void 0,t.isPunctuatorTokenKind=function(e){return e===k.TokenKind.BANG||e===k.TokenKind.DOLLAR||e===k.TokenKind.AMP||e===k.TokenKind.PAREN_L||e===k.TokenKind.PAREN_R||e===k.TokenKind.SPREAD||e===k.TokenKind.COLON||e===k.TokenKind.EQUALS||e===k.TokenKind.AT||e===k.TokenKind.BRACKET_L||e===k.TokenKind.BRACKET_R||e===k.TokenKind.BRACE_L||e===k.TokenKind.PIPE||e===k.TokenKind.BRACE_R};class n{constructor(e){const t=new _.Token(k.TokenKind.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==k.TokenKind.EOF)do{if(e.next)e=e.next;else{const t=c(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===k.TokenKind.COMMENT);return e}}function i(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function r(e,t){return s(e.charCodeAt(t))&&o(e.charCodeAt(t+1))}function s(e){return e>=55296&&e<=56319}function o(e){return e>=56320&&e<=57343}function a(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return k.TokenKind.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function u(e,t,n,i,r){return new _.Token(t,n,i,e.line,1+n-e.lineStart,r)}function c(e,t){const n=e.source.body,s=n.length;let o=t;for(;o<s;){const t=n.charCodeAt(o);switch(t){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:10===n.charCodeAt(o+1)?o+=2:++o,++e.line,e.lineStart=o;continue;case 35:return h(e,o);case 33:return u(e,k.TokenKind.BANG,o,o+1);case 36:return u(e,k.TokenKind.DOLLAR,o,o+1);case 38:return u(e,k.TokenKind.AMP,o,o+1);case 40:return u(e,k.TokenKind.PAREN_L,o,o+1);case 41:return u(e,k.TokenKind.PAREN_R,o,o+1);case 46:if(46===n.charCodeAt(o+1)&&46===n.charCodeAt(o+2))return u(e,k.TokenKind.SPREAD,o,o+3);break;case 58:return u(e,k.TokenKind.COLON,o,o+1);case 61:return u(e,k.TokenKind.EQUALS,o,o+1);case 64:return u(e,k.TokenKind.AT,o,o+1);case 91:return u(e,k.TokenKind.BRACKET_L,o,o+1);case 93:return u(e,k.TokenKind.BRACKET_R,o,o+1);case 123:return u(e,k.TokenKind.BRACE_L,o,o+1);case 124:return u(e,k.TokenKind.PIPE,o,o+1);case 125:return u(e,k.TokenKind.BRACE_R,o,o+1);case 34:return 34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)?w(e,o):d(e,o)}if((0,A.isDigit)(t)||45===t)return l(e,o,t);if((0,A.isNameStart)(t))return g(e,o);throw(0,j.syntaxError)(e.source,o,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":i(t)||r(n,o)?`Unexpected character: ${a(e,o)}.`:`Invalid character: ${a(e,o)}.`)}return u(e,k.TokenKind.EOF,s,s)}function h(e,t){const n=e.source.body,s=n.length;let o=t+1;for(;o<s;){const e=n.charCodeAt(o);if(10===e||13===e)break;if(i(e))++o;else{if(!r(n,o))break;o+=2}}return u(e,k.TokenKind.COMMENT,t,o,n.slice(t+1,o))}function l(e,t,n){const i=e.source.body;let r=t,s=n,o=!1;if(45===s&&(s=i.charCodeAt(++r)),48===s){if(s=i.charCodeAt(++r),(0,A.isDigit)(s))throw(0,j.syntaxError)(e.source,r,`Invalid number, unexpected digit after 0: ${a(e,r)}.`)}else r=f(e,r,s),s=i.charCodeAt(r);if(46===s&&(o=!0,s=i.charCodeAt(++r),r=f(e,r,s),s=i.charCodeAt(r)),69!==s&&101!==s||(o=!0,s=i.charCodeAt(++r),43!==s&&45!==s||(s=i.charCodeAt(++r)),r=f(e,r,s),s=i.charCodeAt(r)),46===s||(0,A.isNameStart)(s))throw(0,j.syntaxError)(e.source,r,`Invalid number, expected digit but got: ${a(e,r)}.`);return u(e,o?k.TokenKind.FLOAT:k.TokenKind.INT,t,r,i.slice(t,r))}function f(e,t,n){if(!(0,A.isDigit)(n))throw(0,j.syntaxError)(e.source,t,`Invalid number, expected digit but got: ${a(e,t)}.`);const i=e.source.body;let r=t+1;for(;(0,A.isDigit)(i.charCodeAt(r));)++r;return r}function d(e,t){const n=e.source.body,s=n.length;let o=t+1,c=o,h="";for(;o<s;){const s=n.charCodeAt(o);if(34===s)return h+=n.slice(c,o),u(e,k.TokenKind.STRING,t,o+1,h);if(92!==s){if(10===s||13===s)break;if(i(s))++o;else{if(!r(n,o))throw(0,j.syntaxError)(e.source,o,`Invalid character within String: ${a(e,o)}.`);o+=2}}else{h+=n.slice(c,o);const t=117===n.charCodeAt(o+1)?123===n.charCodeAt(o+2)?v(e,o):p(e,o):b(e,o);h+=t.value,o+=t.size,c=o}}throw(0,j.syntaxError)(e.source,o,"Unterminated string.")}function v(e,t){const n=e.source.body;let r=0,s=3;for(;s<12;){const e=n.charCodeAt(t+s++);if(125===e){if(s<5||!i(r))break;return{value:String.fromCodePoint(r),size:s}}if(r=r<<4|y(e),r<0)break}throw(0,j.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+s)}".`)}function p(e,t){const n=e.source.body,r=m(n,t+2);if(i(r))return{value:String.fromCodePoint(r),size:6};if(s(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=m(n,t+8);if(o(e))return{value:String.fromCodePoint(r,e),size:12}}throw(0,j.syntaxError)(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function m(e,t){return y(e.charCodeAt(t))<<12|y(e.charCodeAt(t+1))<<8|y(e.charCodeAt(t+2))<<4|y(e.charCodeAt(t+3))}function y(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function b(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw(0,j.syntaxError)(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function w(e,t){const n=e.source.body,s=n.length;let o=e.lineStart,c=t+3,h=c,l="";const f=[];for(;c<s;){const s=n.charCodeAt(c);if(34===s&&34===n.charCodeAt(c+1)&&34===n.charCodeAt(c+2)){l+=n.slice(h,c),f.push(l);const i=u(e,k.TokenKind.BLOCK_STRING,t,c+3,(0,x.dedentBlockStringLines)(f).join("\n"));return e.line+=f.length-1,e.lineStart=o,i}if(92!==s||34!==n.charCodeAt(c+1)||34!==n.charCodeAt(c+2)||34!==n.charCodeAt(c+3))if(10!==s&&13!==s)if(i(s))++c;else{if(!r(n,c))throw(0,j.syntaxError)(e.source,c,`Invalid character within String: ${a(e,c)}.`);c+=2}else l+=n.slice(h,c),f.push(l),13===s&&10===n.charCodeAt(c+1)?c+=2:++c,l="",h=c,o=c;else l+=n.slice(h,c),h=c+1,c+=4}throw(0,j.syntaxError)(e.source,c,"Unterminated string.")}function g(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const e=n.charCodeAt(r);if(!(0,A.isNameContinue)(e))break;++r}return u(e,k.TokenKind.NAME,t,r,n.slice(t,r))}t.Lexer=n})),F=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.devAssert=function(e,t){if(!Boolean(e))throw new Error(t)}})),q=b((function(e,t){function n(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const i=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:n(t,i)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const i=Math.min(10,e.length),r=e.length-i,s=[];for(let r=0;r<i;++r)s.push(n(e[r],t));return 1===r?s.push("... 1 more item"):r>1&&s.push(`... ${r} more items`),"["+s.join(", ")+"]"}(e,i);return function(e,t){const i=Object.entries(e);return 0===i.length?"{}":t.length>2?"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]":"{ "+i.map((([e,i])=>e+": "+n(i,t))).join(", ")+" }"}(e,i)}(e,t);default:return String(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.inspect=function(e){return n(e,[])}})),U=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.instanceOf=void 0,t.instanceOf=function(e,t){return e instanceof t}})),C=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Source=void 0,t.isSource=function(e){return(0,U.instanceOf)(e,n)};class n{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||(0,F.devAssert)(!1,`Body must be a string. Received: ${(0,q.inspect)(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||(0,F.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,F.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}t.Source=n})),M=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=void 0,t.parse=function(e,t){return new n(e,t).parseDocument()},t.parseConstValue=function(e,t){const i=new n(e,t);i.expectToken(k.TokenKind.SOF);const r=i.parseConstValueLiteral();return i.expectToken(k.TokenKind.EOF),r},t.parseType=function(e,t){const i=new n(e,t);i.expectToken(k.TokenKind.SOF);const r=i.parseTypeReference();return i.expectToken(k.TokenKind.EOF),r},t.parseValue=function(e,t){const i=new n(e,t);i.expectToken(k.TokenKind.SOF);const r=i.parseValueLiteral(!1);return i.expectToken(k.TokenKind.EOF),r};class n{constructor(e,t={}){const n=(0,C.isSource)(e)?e:new C.Source(e);this._lexer=new P.Lexer(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(k.TokenKind.NAME);return this.node(e,{kind:N.Kind.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:N.Kind.DOCUMENT,definitions:this.many(k.TokenKind.SOF,this.parseDefinition,k.TokenKind.EOF)})}parseDefinition(){if(this.peek(k.TokenKind.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===k.TokenKind.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw(0,j.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(k.TokenKind.BRACE_L))return this.node(e,{kind:N.Kind.OPERATION_DEFINITION,operation:_.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(k.TokenKind.NAME)&&(n=this.parseName()),this.node(e,{kind:N.Kind.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(k.TokenKind.NAME);switch(e.value){case"query":return _.OperationTypeNode.QUERY;case"mutation":return _.OperationTypeNode.MUTATION;case"subscription":return _.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(k.TokenKind.PAREN_L,this.parseVariableDefinition,k.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:N.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(k.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(k.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(k.TokenKind.DOLLAR),this.node(e,{kind:N.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:N.Kind.SELECTION_SET,selections:this.many(k.TokenKind.BRACE_L,this.parseSelection,k.TokenKind.BRACE_R)})}parseSelection(){return this.peek(k.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,i;return this.expectOptionalToken(k.TokenKind.COLON)?(n=t,i=this.parseName()):i=t,this.node(e,{kind:N.Kind.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(k.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){return this.optionalMany(k.TokenKind.PAREN_L,e?this.parseConstArgument:this.parseArgument,k.TokenKind.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(k.TokenKind.COLON),this.node(t,{kind:N.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(k.TokenKind.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(k.TokenKind.NAME)?this.node(e,{kind:N.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:N.Kind.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this.node(e,!0===this._options.allowLegacyFragmentVariables?{kind:N.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}:{kind:N.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case k.TokenKind.BRACKET_L:return this.parseList(e);case k.TokenKind.BRACE_L:return this.parseObject(e);case k.TokenKind.INT:return this.advanceLexer(),this.node(t,{kind:N.Kind.INT,value:t.value});case k.TokenKind.FLOAT:return this.advanceLexer(),this.node(t,{kind:N.Kind.FLOAT,value:t.value});case k.TokenKind.STRING:case k.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case k.TokenKind.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:N.Kind.BOOLEAN,value:!0});case"false":return this.node(t,{kind:N.Kind.BOOLEAN,value:!1});case"null":return this.node(t,{kind:N.Kind.NULL});default:return this.node(t,{kind:N.Kind.ENUM,value:t.value})}case k.TokenKind.DOLLAR:if(e){if(this.expectToken(k.TokenKind.DOLLAR),this._lexer.token.kind===k.TokenKind.NAME)throw(0,j.syntaxError)(this._lexer.source,t.start,`Unexpected variable "$${this._lexer.token.value}" in constant value.`);throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:N.Kind.STRING,value:e.value,block:e.kind===k.TokenKind.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:N.Kind.LIST,values:this.any(k.TokenKind.BRACKET_L,(()=>this.parseValueLiteral(e)),k.TokenKind.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:N.Kind.OBJECT,fields:this.any(k.TokenKind.BRACE_L,(()=>this.parseObjectField(e)),k.TokenKind.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(k.TokenKind.COLON),this.node(t,{kind:N.Kind.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(k.TokenKind.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(k.TokenKind.AT),this.node(t,{kind:N.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(k.TokenKind.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(k.TokenKind.BRACKET_R),t=this.node(e,{kind:N.Kind.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(k.TokenKind.BANG)?this.node(e,{kind:N.Kind.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:N.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(k.TokenKind.STRING)||this.peek(k.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(k.TokenKind.BRACE_L,this.parseOperationTypeDefinition,k.TokenKind.BRACE_R);return this.node(e,{kind:N.Kind.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(k.TokenKind.COLON);const n=this.parseNamedType();return this.node(e,{kind:N.Kind.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:N.Kind.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:N.Kind.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(k.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(k.TokenKind.BRACE_L,this.parseFieldDefinition,k.TokenKind.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(k.TokenKind.COLON);const r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:N.Kind.FIELD_DEFINITION,description:t,name:n,arguments:i,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(k.TokenKind.PAREN_L,this.parseInputValueDef,k.TokenKind.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(k.TokenKind.COLON);const i=this.parseTypeReference();let r;this.expectOptionalToken(k.TokenKind.EQUALS)&&(r=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(e,{kind:N.Kind.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:r,directives:s})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:N.Kind.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:N.Kind.UNION_TYPE_DEFINITION,description:t,name:n,directives:i,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(k.TokenKind.EQUALS)?this.delimitedMany(k.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:N.Kind.ENUM_TYPE_DEFINITION,description:t,name:n,directives:i,values:r})}parseEnumValuesDefinition(){return this.optionalMany(k.TokenKind.BRACE_L,this.parseEnumValueDefinition,k.TokenKind.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:N.Kind.ENUM_VALUE_DEFINITION,description:t,name:n,directives:i})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw(0,j.syntaxError)(this._lexer.source,this._lexer.token.start,`${i(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:N.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:i,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(k.TokenKind.BRACE_L,this.parseInputValueDef,k.TokenKind.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===k.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(k.TokenKind.BRACE_L,this.parseOperationTypeDefinition,k.TokenKind.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:N.Kind.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:N.Kind.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:N.Kind.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:N.Kind.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:i,fields:r})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:N.Kind.UNION_TYPE_EXTENSION,name:t,directives:n,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:N.Kind.ENUM_TYPE_EXTENSION,name:t,directives:n,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:N.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(k.TokenKind.AT);const n=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const s=this.parseDirectiveLocations();return this.node(e,{kind:N.Kind.DIRECTIVE_DEFINITION,description:t,name:n,arguments:i,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(k.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call($.DirectiveLocation,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new _.Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw(0,j.syntaxError)(this._lexer.source,t.start,`Expected ${r(e)}, found ${i(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==k.TokenKind.NAME||t.value!==e)throw(0,j.syntaxError)(this._lexer.source,t.start,`Expected "${e}", found ${i(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===k.TokenKind.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return(0,j.syntaxError)(this._lexer.source,t.start,`Unexpected ${i(t)}.`)}any(e,t,n){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(n);)i.push(t.call(this));return i}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const i=[];do{i.push(t.call(this))}while(!this.expectOptionalToken(n));return i}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==k.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw(0,j.syntaxError)(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function i(e){const t=e.value;return r(e.kind)+(null!=t?` "${t}"`:"")}function r(e){return(0,P.isPunctuatorTokenKind)(e)?`"${e}"`:e}t.Parser=n})),R=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.printString=function(e){return`"${e.replace(n,i)}"`};const n=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function i(e){return r[e.charCodeAt(0)]}const r=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]})),L=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BREAK=void 0,t.getEnterLeaveForKind=i,t.getVisitFn=function(e,t,n){const{enter:r,leave:s}=i(e,t);return n?s:r},t.visit=function(e,t,r=_.QueryDocumentKeys){const s=new Map;for(const e of Object.values(N.Kind))s.set(e,i(t,e));let o,a,u,c=Array.isArray(e),h=[e],l=-1,f=[],d=e;const v=[],p=[];do{l++;const e=l===h.length,i=e&&0!==f.length;if(e){if(a=0===p.length?void 0:v[v.length-1],d=u,u=p.pop(),i)if(c){d=d.slice();let e=0;for(const[t,n]of f){const i=t-e;null===n?(d.splice(i,1),e++):d[i]=n}}else{d=Object.defineProperties({},Object.getOwnPropertyDescriptors(d));for(const[e,t]of f)d[e]=t}l=o.index,h=o.keys,f=o.edits,c=o.inArray,o=o.prev}else if(u){if(a=c?l:h[l],d=u[a],null==d)continue;v.push(a)}let w;if(!Array.isArray(d)){var m,y;(0,_.isNode)(d)||(0,F.devAssert)(!1,`Invalid AST Node: ${(0,q.inspect)(d)}.`);const i=e?null===(m=s.get(d.kind))||void 0===m?void 0:m.leave:null===(y=s.get(d.kind))||void 0===y?void 0:y.enter;if(w=null==i?void 0:i.call(t,d,a,u,v,p),w===n)break;if(!1===w){if(!e){v.pop();continue}}else if(void 0!==w&&(f.push([a,w]),!e)){if(!(0,_.isNode)(w)){v.pop();continue}d=w}}var b;void 0===w&&i&&f.push([a,d]),e?v.pop():(o={inArray:c,index:l,keys:h,edits:f,prev:o},c=Array.isArray(d),h=c?d:null!==(b=r[d.kind])&&void 0!==b?b:[],l=-1,f=[],u&&p.push(u),u=d)}while(void 0!==o);return 0!==f.length?f[f.length-1][1]:e},t.visitInParallel=function(e){const t=new Array(e.length).fill(null),r=Object.create(null);for(const s of Object.values(N.Kind)){let o=!1;const a=new Array(e.length).fill(void 0),u=new Array(e.length).fill(void 0);for(let t=0;t<e.length;++t){const{enter:n,leave:r}=i(e[t],s);o||(o=null!=n||null!=r),a[t]=n,u[t]=r}o&&(r[s]={enter(...i){const r=i[0];for(let o=0;o<e.length;o++)if(null===t[o]){var s;const u=null===(s=a[o])||void 0===s?void 0:s.apply(e[o],i);if(!1===u)t[o]=r;else if(u===n)t[o]=n;else if(void 0!==u)return u}},leave(...i){const r=i[0];for(let o=0;o<e.length;o++)if(null===t[o]){var s;const r=null===(s=u[o])||void 0===s?void 0:s.apply(e[o],i);if(r===n)t[o]=n;else if(void 0!==r&&!1!==r)return r}else t[o]===r&&(t[o]=null)}})}return r};const n=Object.freeze({});function i(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}t.BREAK=n})),V=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.print=function(e){return(0,L.visit)(e,n)};const n={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>i(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=s("(",i(e.variableDefinitions,", "),")"),n=i([e.operation,i([e.name,t]),i(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+s(" = ",n)+s(" ",i(r," "))},SelectionSet:{leave:({selections:e})=>r(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:a}){const u=s("",e,": ")+t;let c=u+s("(",i(n,", "),")");return c.length>80&&(c=u+s("(\n",o(i(n,"\n")),"\n)")),i([c,i(r," "),a]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+s(" ",i(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>i(["...",s("on ",e),i(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:o})=>`fragment ${e}${s("(",i(n,", "),")")} on ${t} ${s("",i(r," ")," ")}`+o},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,x.printBlockString)(e):(0,R.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+i(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+i(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+s("(",i(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>s("",e,"\n")+i(["schema",i(t," "),r(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>s("",e,"\n")+i(["scalar",t,i(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:o,fields:a})=>s("",e,"\n")+i(["type",t,s("implements ",i(n," & ")),i(o," "),r(a)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:u})=>s("",e,"\n")+t+(a(n)?s("(\n",o(i(n,"\n")),"\n)"):s("(",i(n,", "),")"))+": "+r+s(" ",i(u," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:o})=>s("",e,"\n")+i([t+": "+n,s("= ",r),i(o," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:o,fields:a})=>s("",e,"\n")+i(["interface",t,s("implements ",i(n," & ")),i(o," "),r(a)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>s("",e,"\n")+i(["union",t,i(n," "),s("= ",i(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:o})=>s("",e,"\n")+i(["enum",t,i(n," "),r(o)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>s("",e,"\n")+i([t,i(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:o})=>s("",e,"\n")+i(["input",t,i(n," "),r(o)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:u})=>s("",e,"\n")+"directive @"+t+(a(n)?s("(\n",o(i(n,"\n")),"\n)"):s("(",i(n,", "),")"))+(r?" repeatable":"")+" on "+i(u," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>i(["extend schema",i(e," "),r(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>i(["extend scalar",e,i(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:o})=>i(["extend type",e,s("implements ",i(t," & ")),i(n," "),r(o)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:o})=>i(["extend interface",e,s("implements ",i(t," & ")),i(n," "),r(o)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>i(["extend union",e,i(t," "),s("= ",i(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>i(["extend enum",e,i(t," "),r(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>i(["extend input",e,i(t," "),r(n)]," ")}};function i(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function r(e){return s("{\n",o(i(e,"\n")),"\n}")}function s(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function o(e){return s(" ",e.replace(/\n/g,"\n "))}function a(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}})),B=function(e){var t=e.name,n=e.type;this.uri=e.uri,this.name=t,this.type=n},G=function(e){return"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||e instanceof B},J=function e(t,n,i){var r;void 0===n&&(n=""),void 0===i&&(i=G);var s=new Map;function o(e,t){var n=s.get(t);n?n.push.apply(n,e):s.set(t,e)}if(i(t))r=null,o([n],t);else{var a=n?n+".":"";if("undefined"!=typeof FileList&&t instanceof FileList)r=Array.prototype.map.call(t,(function(e,t){return o([""+a+t],e),null}));else if(Array.isArray(t))r=t.map((function(t,n){var r=e(t,""+a+n,i);return r.files.forEach(o),r.clone}));else if(t&&t.constructor===Object)for(var u in r={},t){var c=e(t[u],""+a+u,i);c.files.forEach(o),r[u]=c.clone}else r=t}return{clone:r,files:s}},z=G,H="object"==typeof self?self.FormData:window.FormData,Q=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.defaultJsonSerializer=void 0,t.defaultJsonSerializer={parse:JSON.parse,stringify:JSON.stringify}})),W=b((function(e,t){var n=y&&y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(H),r=function(e){return z(e)||null!==e&&"object"==typeof e&&"function"==typeof e.pipe};t.default=function(e,t,n,s){void 0===s&&(s=Q.defaultJsonSerializer);var o=J({query:e,variables:t,operationName:n},"",r),a=o.clone,u=o.files;if(0===u.size){if(!Array.isArray(e))return s.stringify(a);if(void 0!==t&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");var c=e.reduce((function(e,n,i){return e.push({query:n,variables:t?t[i]:void 0}),e}),[]);return s.stringify(c)}var h=new("undefined"==typeof FormData?i.default:FormData);h.append("operations",s.stringify(a));var l={},f=0;return u.forEach((function(e){l[++f]=e})),h.append("map",s.stringify(l)),f=0,u.forEach((function(e,t){h.append(""+ ++f,t)})),h}})),K=b((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseBatchRequestsExtendedArgs=t.parseRawRequestExtendedArgs=t.parseRequestExtendedArgs=t.parseBatchRequestArgs=t.parseRawRequestArgs=t.parseRequestArgs=void 0,t.parseRequestArgs=function(e,t,n){return e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0}},t.parseRawRequestArgs=function(e,t,n){return e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0}},t.parseBatchRequestArgs=function(e,t){return e.documents?e:{documents:e,requestHeaders:t,signal:void 0}},t.parseRequestExtendedArgs=function(e,t,n,i){return e.document?e:{url:e,document:t,variables:n,requestHeaders:i,signal:void 0}},t.parseRawRequestExtendedArgs=function(e,t,n,i){return e.query?e:{url:e,query:t,variables:n,requestHeaders:i,signal:void 0}},t.parseBatchRequestsExtendedArgs=function(e,t,n){return e.documents?e:{url:e,documents:t,requestHeaders:n,signal:void 0}}})),X=b((function(e,t){var n,i=y&&y.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.ClientError=void 0;var r=function(e){function t(n,i){var r=this,s=t.extractMessage(n)+": "+JSON.stringify({response:n,request:i});return r=e.call(this,s)||this,Object.setPrototypeOf(r,t.prototype),r.response=n,r.request=i,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,t),r}return i(t,e),t.extractMessage=function(e){try{return e.errors[0].message}catch(t){return"GraphQL Error (Code: "+e.status+")"}},t}(Error);t.ClientError=r})),Y=b((function(e,t){var n=y&&y.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},i=y&&y.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}u((i=i.apply(e,t||[])).next())}))},r=y&&y.__generator||function(e,t){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLWebSocketClient=void 0;var s="ping",o="pong",a="complete",u=function(){function e(e,t,n){this._type=e,this._payload=t,this._id=n}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return this._payload},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){var e={type:this.type};return null!=this.id&&null!=this.id&&(e.id=this.id),null!=this.payload&&null!=this.payload&&(e.payload=this.payload),JSON.stringify(e)},enumerable:!1,configurable:!0}),e.parse=function(t,n){var i=JSON.parse(t),r=i.id;return new e(i.type,n(i.payload),r)},e}(),c=function(){function e(e,t){var c=this,f=t.onInit,d=t.onAcknowledged,v=t.onPing,p=t.onPong;this.socketState={acknowledged:!1,lastRequestId:0,subscriptions:{}},this.socket=e,e.onopen=function(){return i(c,void 0,void 0,(function(){var t,n,i,s;return r(this,(function(r){switch(r.label){case 0:return this.socketState.acknowledged=!1,this.socketState.subscriptions={},n=(t=e).send,i=h,f?[4,f()]:[3,2];case 1:return s=r.sent(),[3,3];case 2:s=null,r.label=3;case 3:return n.apply(t,[i.apply(void 0,[s]).text]),[2]}}))}))},e.onclose=function(){c.socketState.acknowledged=!1,c.socketState.subscriptions={}},e.onerror=function(e){console.error(e)},e.onmessage=function(t){try{var i=(void 0===y&&(y=function(e){return e}),u.parse(t.data,y));switch(i.type){case"connection_ack":return void(c.socketState.acknowledged?console.warn("Duplicate CONNECTION_ACK message ignored"):(c.socketState.acknowledged=!0,d&&d(i.payload)));case s:return void(v?v(i.payload).then((function(t){return e.send(l(t).text)})):e.send(l(null).text));case o:return void(p&&p(i.payload))}if(!c.socketState.acknowledged)return;if(null==i.id||!c.socketState.subscriptions[i.id])return;var r=c.socketState.subscriptions[i.id],h=r.query,f=r.variables,m=r.subscriber;switch(i.type){case"next":return!i.payload.errors&&i.payload.data&&m.next&&m.next(i.payload.data),void(i.payload.errors&&m.error&&m.error(new X.ClientError(n(n({},i.payload),{status:200}),{query:h,variables:f})));case"error":return void(m.error&&m.error(new X.ClientError({errors:i.payload,status:200},{query:h,variables:f})));case a:return m.complete&&m.complete(),void delete c.socketState.subscriptions[i.id]}}catch(t){console.error(t),e.close(1006)}var y;e.close(4400,"Unknown graphql-ws message.")}}return e.prototype.makeSubscribe=function(e,t,n,i){var r,s,o=this,c=(this.socketState.lastRequestId++).toString();return this.socketState.subscriptions[c]={query:e,variables:n,subscriber:i},this.socket.send((r=c,s={query:e,operationName:t,variables:n},new u("subscribe",s,r)).text),function(){o.socket.send(function(e){return new u(a,void 0,e)}(c).text),delete o.socketState.subscriptions[c]}},e.prototype.rawRequest=function(e,t){var n=this;return new Promise((function(i,r){var s;n.rawSubscribe(e,{next:function(e,t){return s={data:e,extensions:t}},error:r,complete:function(){return i(s)}},t)}))},e.prototype.request=function(e,t){var n=this;return new Promise((function(i,r){var s;n.subscribe(e,{next:function(e){return s=e},error:r,complete:function(){return i(s)}},t)}))},e.prototype.subscribe=function(e,t,n){var i=Z.resolveRequestDocument(e);return this.makeSubscribe(i.query,i.operationName,n,t)},e.prototype.rawSubscribe=function(e,t,n){return this.makeSubscribe(e,void 0,n,t)},e.prototype.ping=function(e){this.socket.send(function(e){return new u(s,e,void 0)}(e).text)},e.prototype.close=function(){this.socket.close(1e3)},e.PROTOCOL="graphql-transport-ws",e}();function h(e){return new u("connection_init",e)}function l(e){return new u(o,e,void 0)}t.GraphQLWebSocketClient=c})),Z=b((function(e,t){var n=y&&y.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},i=y&&y.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=y&&y.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=y&&y.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t},o=y&&y.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}u((i=i.apply(e,t||[])).next())}))},a=y&&y.__generator||function(e,t){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},u=y&&y.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n},c=y&&y.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLWebSocketClient=t.gql=t.resolveRequestDocument=t.batchRequests=t.request=t.rawRequest=t.GraphQLClient=t.ClientError=void 0;var h=s(O),l=h,f=c(W);Object.defineProperty(t,"ClientError",{enumerable:!0,get:function(){return X.ClientError}});var d=function(e){var t={};return e&&("undefined"!=typeof Headers&&e instanceof Headers||e instanceof l.Headers?t=function(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}(e):Array.isArray(e)?e.forEach((function(e){t[e[0]]=e[1]})):t=e),t},v=function(e){return e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim()},p=function(e){var t=e.url,i=e.query,r=e.variables,s=e.operationName,u=e.headers,c=e.fetch,h=e.fetchOptions;return o(void 0,void 0,void 0,(function(){var e;return a(this,(function(o){switch(o.label){case 0:return e=f.default(i,r,s,h.jsonSerializer),[4,c(t,n({method:"POST",headers:n(n({},"string"==typeof e?{"Content-Type":"application/json"}:{}),u),body:e},h))];case 1:return[2,o.sent()]}}))}))},m=function(e){var t=e.url,i=e.query,r=e.variables,s=e.operationName,u=e.headers,c=e.fetch,h=e.fetchOptions;return o(void 0,void 0,void 0,(function(){var e;return a(this,(function(o){switch(o.label){case 0:return e=function(e){var t=e.query,n=e.variables,i=e.operationName,r=e.jsonSerializer;if(!Array.isArray(t)){var s=["query="+encodeURIComponent(v(t))];return n&&s.push("variables="+encodeURIComponent(r.stringify(n))),i&&s.push("operationName="+encodeURIComponent(i)),s.join("&")}if(void 0!==n&&!Array.isArray(n))throw new Error("Cannot create query with given variable type, array expected");var o=t.reduce((function(e,t,i){return e.push({query:v(t),variables:n?r.stringify(n[i]):void 0}),e}),[]);return"query="+encodeURIComponent(r.stringify(o))}({query:i,variables:r,operationName:s,jsonSerializer:h.jsonSerializer}),[4,c(t+"?"+e,n({method:"GET",headers:u},h))];case 1:return[2,o.sent()]}}))}))},b=function(){function e(e,t){this.url=e,this.options=t||{}}return e.prototype.rawRequest=function(e,t,i){return o(this,void 0,void 0,(function(){var r,s,o,c,l,f,v,p,m,y;return a(this,(function(){return r=K.parseRawRequestArgs(e,t,i),o=(s=this.options).headers,l=void 0===(c=s.fetch)?h.default:c,v=void 0===(f=s.method)?"POST":f,p=u(s,["headers","fetch","method"]),m=this.url,void 0!==r.signal&&(p.signal=r.signal),y=D(r.query).operationName,[2,w({url:m,query:r.query,variables:r.variables,headers:n(n({},d(E(o))),d(r.requestHeaders)),operationName:y,fetch:l,method:v,fetchOptions:p})]}))}))},e.prototype.request=function(e,t,i){return o(this,void 0,void 0,(function(){var r,s,o,c,l,f,v,p,m,y,b;return a(this,(function(a){switch(a.label){case 0:return r=K.parseRequestArgs(e,t,i),o=(s=this.options).headers,l=void 0===(c=s.fetch)?h.default:c,v=void 0===(f=s.method)?"POST":f,p=u(s,["headers","fetch","method"]),m=this.url,void 0!==r.signal&&(p.signal=r.signal),y=D(r.document),b=y.operationName,[4,w({url:m,query:y.query,variables:r.variables,headers:n(n({},d(E(o))),d(r.requestHeaders)),operationName:b,fetch:l,method:v,fetchOptions:p})];case 1:return[2,a.sent().data]}}))}))},e.prototype.batchRequests=function(e,t){return o(this,void 0,void 0,(function(){var i,r,s,o,c,l,f,v,p,m,y;return a(this,(function(a){switch(a.label){case 0:return i=K.parseBatchRequestArgs(e,t),s=(r=this.options).headers,c=void 0===(o=r.fetch)?h.default:o,f=void 0===(l=r.method)?"POST":l,v=u(r,["headers","fetch","method"]),p=this.url,void 0!==i.signal&&(v.signal=i.signal),m=i.documents.map((function(e){return D(e.document).query})),y=i.documents.map((function(e){return e.variables})),[4,w({url:p,query:m,variables:y,headers:n(n({},d(E(s))),d(i.requestHeaders)),operationName:void 0,fetch:c,method:f,fetchOptions:v})];case 1:return[2,a.sent().data]}}))}))},e.prototype.setHeaders=function(e){return this.options.headers=e,this},e.prototype.setHeader=function(e,t){var n,i=this.options.headers;return i?i[e]=t:this.options.headers=((n={})[e]=t,n),this},e.prototype.setEndpoint=function(e){return this.url=e,this},e}();function w(e){var t=e.url,i=e.query,r=e.variables,s=e.headers,c=e.operationName,h=e.fetch,l=e.method,f=void 0===l?"POST":l,d=e.fetchOptions;return o(this,void 0,void 0,(function(){var e,o,l,v,y,b,w,g,O,S;return a(this,(function(a){switch(a.label){case 0:return e="POST"===f.toUpperCase()?p:m,o=Array.isArray(i),[4,e({url:t,query:i,variables:r,operationName:c,headers:s,fetch:h,fetchOptions:d})];case 1:return[4,T(l=a.sent(),d.jsonSerializer)];case 2:if(v=a.sent(),y=o&&Array.isArray(v)?!v.some((function(e){return!e.data})):!!v.data,b=!v.errors||"all"===d.errorPolicy||"ignore"===d.errorPolicy,l.ok&&b&&y)return w=l.headers,g=l.status,O=u(v,["errors"]),S="ignore"===d.errorPolicy?O:v,[2,n(n({},o?{data:S}:S),{headers:w,status:g})];throw new X.ClientError(n(n({},"string"==typeof v?{error:v}:v),{status:l.status,headers:l.headers}),{query:i,variables:r})}}))}))}function g(e,t,i,r){return o(this,void 0,void 0,(function(){var s;return a(this,(function(){return s=K.parseRequestExtendedArgs(e,t,i,r),[2,new b(s.url).request(n({},s))]}))}))}function T(e,t){return void 0===t&&(t=Q.defaultJsonSerializer),o(this,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return e.headers.forEach((function(e,t){"content-type"===t.toLowerCase()&&(n=e)})),n&&n.toLowerCase().startsWith("application/json")?(r=(i=t).parse,[4,e.text()]):[3,2];case 1:return[2,r.apply(i,[s.sent()])];case 2:return[2,e.text()]}}))}))}function S(e){var t,n=void 0,i=e.definitions.filter((function(e){return"OperationDefinition"===e.kind}));return 1===i.length&&(n=null===(t=i[0].name)||void 0===t?void 0:t.value),n}function D(e){if("string"==typeof e){var t=void 0;try{t=S(M.parse(e))}catch(e){}return{query:e,operationName:t}}var n=S(e);return{query:V.print(e),operationName:n}}function E(e){return"function"==typeof e?e():e}t.GraphQLClient=b,t.rawRequest=function(e,t,i,r){return o(this,void 0,void 0,(function(){var s;return a(this,(function(){return s=K.parseRawRequestExtendedArgs(e,t,i,r),[2,new b(s.url).rawRequest(n({},s))]}))}))},t.request=g,t.batchRequests=function(e,t,i){return o(this,void 0,void 0,(function(){var r;return a(this,(function(){return r=K.parseBatchRequestsExtendedArgs(e,t,i),[2,new b(r.url).batchRequests(n({},r))]}))}))},t.default=g,t.resolveRequestDocument=D,t.gql=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e.reduce((function(e,n,i){return""+e+n+(i in t?t[i]:"")}),"")},Object.defineProperty(t,"GraphQLWebSocketClient",{enumerable:!0,get:function(){return Y.GraphQLWebSocketClient}})}));class ee{static getQueryParams(e){const t=new Map,n=/[?&]?([^=]+)=([^&]*)/g;let i;for(e=(e=window.unescape(e)).split("+").join(" ");i=n.exec(e);)t.set(window.decodeURIComponent(i[1]),i[2]);return t.set("urlBase",this.getUrlBase()),window.moduleID&&window.URIServiceBroker&&(t.set("moduleID",window.moduleID),t.set("URIServiceBroker",window.URIServiceBroker)),t}static getUrlBase(){return window.mock_url?window.mock_url:`${location.protocol}//${location.hostname}${location.port?":"+location.port:""}`}}class te{constructor(){this.GRAPHQL_PATH="/mge/graphql",this.watingRequestsById=new Map}static get(){if(!te.instance){te.instance=new te;const e=document.querySelector(this.appTagName);null===e?te.instance.resume():(e.addEventListener("applicationLoading",(()=>te.instance.pause())),e.addEventListener("applicationLoaded",(()=>te.instance.resume())))}return this.instance}static addRequestListener(e){te.requestListener.indexOf(e)<0&&te.requestListener.push(e)}static removeRequestListener(e){const t=te.requestListener.indexOf(e);t>-1&&te.requestListener.splice(t,1)}async callGraphQL(e){var t;const n=this.getReqKey(e);return e.queryID=n,e.values.queryID=n,this.ready?new Promise((async(t,r)=>{let s=this.getQueryTemplate(e);const o=await this.fecthGrapql([{document:s,variables:e.values}]);o.errors.length>0?r(new i("Falha detectada",o.errors[0][0].message)):t(o.data[0][n])})):(this.watingRequestsById.has(n)||this.watingRequestsById.set(n,new ne(e)),null===(t=this.getWatingRequest(n))||void 0===t?void 0:t.promise)}resolveURL(){return ee.getUrlBase()}getContext(e){const t=ee.getQueryParams(location.search);return{baseUrl:`${this.resolveURL()}/${e}/service.sbr`,appName:"SankhyaBlocks",mgeSession:`${window.skw_session||t.mgeSession}`,globalID:"85C0093DFA240EAB699B4E47A10215BD",resourceID:"br.com.sankhya.mov.bancaria"}}async callServiceBroker(e,t){return new Promise(((n,i)=>{const r=e.split("@"),[s,o]=2===r.length?r:["mge",e],a=this.getContext(s),u=`${a.baseUrl}?serviceName=${o}&counter=21&application=${a.appName}&outputType=json&preventTransform=false&mgeSession=${a.mgeSession}&resourceID=${a.resourceID}&globalID=${a.globalID}&allowConcurrentCalls=true`;document.cookie=`JSESSIONID=${a.mgeSession};`;const c=new XMLHttpRequest;te.requestListener.forEach((e=>e.onRequestStart({url:u}))),c.open("POST",u,!0),c.withCredentials=!0,c.send(t),c.onreadystatechange=function(){if(4==this.readyState&&200==this.status){try{const e=JSON.parse(this.responseText);1==e.status?n(e.responseBody):i(e)}catch(e){console.warn(`callServiceBroker error to parser response to JSON ${e}`),i(this.responseText)}te.requestListener.forEach((e=>e.onRequestEnd({url:u})))}else 4==this.readyState&&200!=this.status&&(i(this.responseText),te.requestListener.forEach((e=>e.onRequestEnd({url:u}))))}}))}getReqKey(e){return window.btoa(r.hashCode(`${e.query}${JSON.stringify(e.values||"")}`)).replace(/=/g,"")}getQueryTemplate(e){return(e.query||"").replaceAll("$queryAlias$",e.queryID)}getWatingRequest(e){return this.watingRequestsById.get(e)}pause(){this.ready=!1}async resume(){if(this.ready=!0,this.watingRequestsById.size>0){const e=[];let t;this.watingRequestsById.forEach((async t=>{let n=this.getQueryTemplate(t.request);e.push({document:n,variables:Object.assign({},t.request.values)})}));let n=[],r=[];t=await this.fecthGrapql(e),n=t.data,r=t.errors,r.forEach((e=>{Object.entries(e).forEach((([e,t])=>{var n;((null===(n=this.getWatingRequest(t.request.variables[t.index].queryID))||void 0===n?void 0:n.reject)||Promise.reject)(new i("Falha detectada",t.message))}))})),n.forEach((e=>{Object.entries(e).forEach((([e,t])=>{var n;((null===(n=this.getWatingRequest(e))||void 0===n?void 0:n.resolve)||Promise.resolve)(t)}))})),this.watingRequestsById.clear()}}async fecthGrapql(e){let t,n=[],r=[],s=`${this.resolveURL()+this.GRAPHQL_PATH}`;window.skw_session&&(s+=`?mgeSession=${window.skw_session}`),te.requestListener.forEach((e=>e.onRequestStart({url:s})));try{t=await Z.batchRequests(s,e,{"Content-Type":`application/json; charset=${window.SERVER_ENCODING||"UTF-8"}`}),t.forEach(((t,i)=>{var s;(null===(s=null==t?void 0:t.errors)||void 0===s?void 0:s.length)>0?r.push(t.errors.map((t=>this.normalizeErrorResponse(t,e,i)))):n.push(t.data)}))}catch(e){if(this.isHttpError(e))throw te.requestListener.forEach((e=>e.onRequestEnd({url:s}))),new i("Falha de comunicação",e.message);{t=e.response;const i=e.request;Object.entries(t).forEach((([e,t])=>{t.errors?r.push(t.errors.map((t=>(t.request=i,t.index=Number(e),t)))):t.data&&n.push(t.data)}))}}return te.requestListener.forEach((e=>e.onRequestEnd({url:s}))),{data:n,errors:r}}isHttpError(e){var t;return!e.response&&!e.request||(null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.status)>=300}normalizeErrorResponse(e,t,n){const i=Object.assign({},t[n]),{variables:r}=i;return i.variables=[],i.variables[n]=r,e.request=i,e.index=Number(n),e}}te.appTagName="snk-application",te.requestListener=[];class ne{constructor(e){this._resolve=()=>{},this._reject=()=>{},this._request=void 0,this._request=e,this._promisse=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promisse}get request(){return this._request}}class ie{constructor(){this.templateByQuery=new Map,this._loadDataTimeout={},this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchDataUnit",Z.gql`query($name: String!) {
2
2
  $queryAlias$: fetchDataUnit(name: $name){
3
3
  name
4
4
  fields{
@@ -66,4 +66,9 @@ import{r as e,c as t,h as n}from"./p-cd1dc099.js";import{ErrorException as i,Str
66
66
  value
67
67
  label
68
68
  }
69
- }`)}loadSearchOptions(e,t,n,i){const r=(null==t?void 0:t.trim())||void 0;return t=isNaN(Number(r))&&r?`%${r}`:r,new Promise(((r,s)=>{te.get().callGraphQL({values:{argument:t,entityName:e,criteria:n,options:i},query:this._templateByQuery.get("search")}).then((e=>{r(e)})).catch((e=>{s(e)}))}))}loadAdvancedSearch(e,t,n,i){const r={query:{$:null==n?void 0:n.expression}};(null==n?void 0:n.params.length)>0&&(r.params={param:n.params.map((e=>({$:e.value,type:he(e.dataType)})))});const s={serviceName:"PesquisaSP.getSuggestion",requestBody:{criteria:{entityName:e,compacted:!1,ignoreEntityCriteria:!1,limit:this._defaultPageSize,query:{$:t},orderByDesc:!1,externalCriteria:r,localEntityName:null==i?void 0:i.rootEntity},clientEventList:{clientEvent:[]}}};return new Promise(((e,t)=>{te.get().callServiceBroker("PesquisaSP.getSuggestion",JSON.stringify(s)).then((t=>e(t))).catch((e=>t(e)))}))}}function he(e){switch(e){case o.NUMBER:return"I";case o.DATE:return"D";default:return"S"}}class le extends oe{getData(e){const t=`cfg://auth/${e}`;return new Promise(((e,n)=>{this.loadResource(t).then((t=>{let n=c.stringToObject(t);n&&"object"==typeof n&&e(n)})).catch((e=>{n(e)}))}))}}!function(e){e.INSERT="I",e.UPDATE="A",e.REMOVE="E",e.SHOW="C",e.CONFIG="F",e.CONFIG_NUMBER="N",e.CLONE="D",e.CONFIG_GRID="G"}(g||(g={}));const fe=de;function de(e,t){const n=ve();return(de=function(e){return n[e-=378]})(e,t)}function ve(){const e=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return(ve=function(){return e})()}!function(){const e=de,t=ve();for(;;)try{if(281287==parseInt(e(399))/1*(-parseInt(e(387))/2)+-parseInt(e(401))/3+parseInt(e(381))/4*(-parseInt(e(389))/5)+parseInt(e(388))/6*(-parseInt(e(386))/7)+parseInt(e(379))/8+parseInt(e(396))/9+parseInt(e(383))/10)break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class pe{[fe(397)](e){const t=fe;if(typeof(e=utxt(e[t(390)]))==t(392)&&(e=JSON[t(400)](e)),null==e)throw Error(t(395));const n=new me("S"===e[t(402)]||!0===e[t(402)]);return Array[t(394)](e[t(391)])&&e[t(391)][t(385)]((e=>n.putAccess(e[t(382)],String(e.status)==t(398)))),n}}class me{constructor(e){const t=fe;this.isSup=e,this[t(384)]={}}[fe(378)](e,t){this[fe(384)][e]=t}[fe(393)](e){const t=fe;if(this[t(402)])return!0;let n=!0;return this[t(384)][t(380)](e)&&(n=this.actions[e]),n}isUserSup(){return this.isSup}}class ye{constructor(e){this._app=e,window.addEventListener("error",(e=>this.errorHandler(e))),window.addEventListener("unhandledrejection",(e=>this.rejectionHandler(e)))}rejectionHandler(e){const t=e.reason;t instanceof h||(t?this.processException(t):this._app.isDebugMode().then((e=>{e&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(e){this.processException(e.error)}processException(e){e instanceof h||e instanceof l?this._app.alert(e.title,e.message):e instanceof i?this._app.error(e.title,e.message):this._app.isDebugMode().then((t=>{if(t)if(e instanceof Error)this._app.error(e.name,e.message);else{const t=(null==e?void 0:e.title)||"Erro detectado",n="string"==typeof e?e:e.message||`Erro interno "${c.objectToString(e)}"`;this._app.error(t,n)}}))}}function be(){const e=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(be=function(){return e})()}const we=ge;function ge(e,t){const n=be();return(ge=function(e){return n[e-=392]})(e,t)}!function(){const e=ge,t=be();for(;;)try{if(951926==-parseInt(e(398))/1+-parseInt(e(393))/2+parseInt(e(395))/3+-parseInt(e(400))/4*(parseInt(e(392))/5)+-parseInt(e(401))/6*(-parseInt(e(402))/7)+parseInt(e(397))/8+-parseInt(e(399))/9*(-parseInt(e(394))/10))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();const Oe=we(396),Se=class{constructor(n){e(this,n),this.applicationLoaded=t(this,"applicationLoaded",7),this.applicationLoading=t(this,"applicationLoading",7),this._authPromises=[],this._duCache=new Map,this._duPromises=new Map,this._requestListener=new Te}get parameters(){return this._parameters||(this._parameters=new se),this._parameters}get resourceID(){return this._resourceID||(this._resourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||re.resourceID||"unknown.resource.id"),this._resourceID}get auth(){return this._auth?Promise.resolve(this._auth):new Promise(((e,t)=>{const n=this._authPromises.length>0;this._authPromises.push(new De(e,t)),n||this.authFetcher.getData(this.resourceID).then((e=>{for(this._auth=e;this._authPromises.length>0;)this._authPromises.pop().resolve(this._auth)})).catch((e=>{for(;this._authPromises.length>0;)this._authPromises.pop().reject(e)}))}))}async isUserSup(){return new Promise(((e,t)=>{this.auth.then((n=>{this.getAuthList(n).then((t=>{e(t.isSup)})).catch((e=>t(e)))}))}))}async hasAccess(e){return new Promise(((t,n)=>{this.auth.then((i=>{this.getAuthList(i).then((n=>{t(n.isSup||n.actions[e])})).catch((e=>n(e)))}))}))}async getAllAccess(){return new Promise(((e,t)=>{this.auth.then((n=>{this.getAuthList(n).then((t=>{const n={};n.isSup=t.isSup,Object.entries(g).forEach((e=>{n[e[0]]=t.actions[e[1]]||!1})),e(n)})).catch((e=>t(e)))}))}))}async getStringParam(e){return this.parameters.asString(e,this.resourceID)}async getIntParam(e){return this.parameters.asInteger(e,this.resourceID)}async getFloatParam(e){return this.parameters.asFloat(e,this.resourceID)}async getBooleanParam(e){return this.parameters.asBoolean(e,this.resourceID)}async getDateParam(e){return this.parameters.asDate(e,this.resourceID)}async showPopUp(e){this.clearPopUpContent(),this._popUp.appendChild(e),this._popUp.opened=!0}async closePopUp(){this.clearPopUpContent(),this._popUp.opened=!1}async temOpcional(e){const t=e.split(",");return new Promise(((e,n)=>{this.getAttributeFromHTMLWrapper("opc0009").then((i=>{"1"===i?e(!0):Promise.all(t.map((e=>this.getAttributeFromHTMLWrapper("opc"+e)))).then((t=>{e(t.includes("1"))})).catch((e=>{n(e)}))})).catch((e=>{n(e)}))}))}async getConfig(e){let t={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:e,tipo:"T"}}};return new Promise(((e,n)=>{te.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(t)).then((t=>{var n;return e(null===(n=t.config)||void 0===n?void 0:n.data)})).catch((e=>n(e)))}))}async saveConfig(e,t){let n={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:e,tipo:"T",data:t}}};return new Promise(((e,t)=>{te.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(n)).then((t=>e(t))).catch((e=>t(e)))}))}async getAttributeFromHTMLWrapper(e){return Promise.resolve(window[e])}async openApp(e,t){re.openAppActivity(e,t)}getDuPromissesStack(e){let t;return e&&(t=this._duPromises.get(e),t||(t=[],this._duPromises.set(e,t))),t||[]}async createDataunit(e,t){return new Promise(((n,i)=>{const r=this.getDuPromissesStack(t),s=r.length>0;if(r.push(new De(n,i)),!s){const n=this.dataUnitFetcher.getDataUnit(e,this.resourceID);n.loadMetadata().then((()=>{for(t&&this._duCache.set(t,n);r.length>0;)r.pop().resolve(n)})).catch((e=>{for(;r.length>0;)r.pop().reject(e)}))}}))}async getDataUnit(e,t){return new Promise(((n,i)=>{const r=this._duCache.get(t);r?n(r):this.createDataunit(e,t).then((e=>{n(e)})).catch((e=>i(e)))}))}async getResourceID(){return Promise.resolve(this.resourceID)}async alert(e,t,n,i){return p.alert(e,t,n,i)}async error(e,t,n,i){return p.error(e,t,n,i)}async message(e,t,n,i){return p.message(e,t,n,i)}async confirm(e,t,n,i,r){return p.confirm(e,t,n,i,r)}async info(e,t){return p.info(e,t)}async loadFormConfig(e){return this.formConfigFetcher.loadFormConfig(e,this.resourceID)}async loadGridConfig(e){return this.gridConfigFetcher.getConfig(e,this.resourceID)}async saveGridConfig(e){return this.gridConfigFetcher.saveConfig(e,this.resourceID)}async getAuthList(e){return await(new pe).parseFromJSON(e)}get urlParams(){return this._urlParams||(this._urlParams=ee.getQueryParams(location.search)),this._urlParams}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new ie),this._dataUnitFetcher}get formConfigFetcher(){return this._formConfigFetcher||(this._formConfigFetcher=new ae),this._formConfigFetcher}get gridConfigFetcher(){return this._gridConfigFetcher||(this._gridConfigFetcher=new ue),this._gridConfigFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new ce),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new le),this._authFetcher}async executeSearch(e,t,n){const i=null==n?void 0:n.getField(t);if(i){const{mode:t,argument:r}=e,{ENTITYNAME:s,CODEFIELD:a,DESCRIPTIONFIELD:u,ROOTENTITY:c,DESCRIPTIONENTITY:h}=i.properties,l=i.dependencies;let d;const v={rootEntity:c,descriptionFieldName:u,codeFieldName:a,showInactives:!1};return null==l||l.filter((e=>{var t;return null===(t=e.masterFields)||void 0===t?void 0:t.every((e=>{var t;return null===(t=n.getField(e))||void 0===t?void 0:t.visible}))})).forEach((e=>{var t;e.type===f.SEARCHING&&(null===(t=e.masterFields)||void 0===t?void 0:t.length)>0&&(d={expression:e.expression,params:e.masterFields.map((e=>{const t=n.getField(e),i=(null==t?void 0:t.dataType)||o.TEXT,r=n.getFieldValue(e);if(null==r)throw this.alert("Erro ao pesquisar",`É necessario informar o campo ${t.label} para executar a pesquisa.`),new Error(`É necessario informar o campo ${t.label} para executar a pesquisa.`);return{name:e,value:r,dataType:i}}))})})),"ADVANCED"===t?new Promise((e=>{const t=document.createElement("snk-pesquisa");t.argument=r,t.searchLoader=e=>this.pesquisaFetcher.loadAdvancedSearch(s,e,d,v),t.selectItem=t=>{e(t),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(h),this.showPopUp(t)})):this.pesquisaFetcher.loadSearchOptions(s,r,d,v)}}async isDebugMode(){return new Promise((e=>{e(window.isDebugMode)}))}clearPopUpContent(){this._popUp&&Array.from(this._popUp.children).forEach((e=>{this._popUp.removeChild(e)}))}clearPopUpTitle(){this._popUp.ezTitle=""}setPopUpTitle(e){this._popUp.ezTitle=e}componentWillLoad(){this._errorHandler=new ye(this),this.messagesBuilder=new m,d.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${ee.getUrlBase()}/mge/upload/file`),d.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((e,t,n)=>this.executeSearch(e,t,n))),d.setContextValue("__EZUI__GRID_LICENSE__",Oe),v.init()}connectedCallback(){d.setContextValue("__SNK__APPLICATION__",this),te.addRequestListener(this._requestListener)}disconnectedCallback(){te.removeRequestListener(this._requestListener)}componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{this.applicationLoaded.emit(!0)}))}render(){return n("div",null,n("ez-loading-bar",{ref:e=>this._requestListener.loadingBar=e}),n("ez-popup",{opened:!1,ref:e=>this._popUp=e,onEzClosePopup:()=>this.closePopUp()}))}};class Te{constructor(){this._debounceTime=1e3,this._countRequest=0}onRequestStart(){this.loadingBar.show(),this._countRequest++,this._timerLoading&&clearTimeout(this._timerLoading)}onRequestEnd(){this._countRequest--,this._timerLoading=setTimeout((()=>{this._countRequest<=0&&this.loadingBar.hide()}),this._debounceTime)}}class De{constructor(e,t){this.resolve=e,this.reject=t}}Se.style=".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";export{Se as snk_application}
69
+ }`)}loadSearchOptions(e,t,n,i){const r=(null==t?void 0:t.trim())||void 0;return t=isNaN(Number(r))&&r?`%${r}`:r,new Promise(((r,s)=>{te.get().callGraphQL({values:{argument:t,entityName:e,criteria:n,options:i},query:this._templateByQuery.get("search")}).then((e=>{r(e)})).catch((e=>{s(e)}))}))}loadAdvancedSearch(e,t,n,i){const r={query:{$:null==n?void 0:n.expression}};(null==n?void 0:n.params.length)>0&&(r.params={param:n.params.map((e=>({$:e.value,type:he(e.dataType)})))});const s={serviceName:"PesquisaSP.getSuggestion",requestBody:{criteria:{entityName:e,compacted:!1,ignoreEntityCriteria:!1,limit:this._defaultPageSize,query:{$:t},orderByDesc:!1,externalCriteria:r,localEntityName:null==i?void 0:i.rootEntity},clientEventList:{clientEvent:[]}}};return new Promise(((e,t)=>{te.get().callServiceBroker("PesquisaSP.getSuggestion",JSON.stringify(s)).then((t=>e(t))).catch((e=>t(e)))}))}}function he(e){switch(e){case o.NUMBER:return"I";case o.DATE:return"D";default:return"S"}}class le extends oe{getData(e){const t=`cfg://auth/${e}`;return new Promise(((e,n)=>{this.loadResource(t).then((t=>{let n=c.stringToObject(t);n&&"object"==typeof n&&e(n)})).catch((e=>{n(e)}))}))}}!function(e){e.INSERT="I",e.UPDATE="A",e.REMOVE="E",e.SHOW="C",e.CONFIG="F",e.CONFIG_NUMBER="N",e.CLONE="D",e.CONFIG_GRID="G"}(g||(g={}));const fe=de;function de(e,t){const n=ve();return(de=function(e){return n[e-=378]})(e,t)}function ve(){const e=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return(ve=function(){return e})()}!function(){const e=de,t=ve();for(;;)try{if(281287==parseInt(e(399))/1*(-parseInt(e(387))/2)+-parseInt(e(401))/3+parseInt(e(381))/4*(-parseInt(e(389))/5)+parseInt(e(388))/6*(-parseInt(e(386))/7)+parseInt(e(379))/8+parseInt(e(396))/9+parseInt(e(383))/10)break;t.push(t.shift())}catch(e){t.push(t.shift())}}();class pe{[fe(397)](e){const t=fe;if(typeof(e=utxt(e[t(390)]))==t(392)&&(e=JSON[t(400)](e)),null==e)throw Error(t(395));const n=new me("S"===e[t(402)]||!0===e[t(402)]);return Array[t(394)](e[t(391)])&&e[t(391)][t(385)]((e=>n.putAccess(e[t(382)],String(e.status)==t(398)))),n}}class me{constructor(e){const t=fe;this.isSup=e,this[t(384)]={}}[fe(378)](e,t){this[fe(384)][e]=t}[fe(393)](e){const t=fe;if(this[t(402)])return!0;let n=!0;return this[t(384)][t(380)](e)&&(n=this.actions[e]),n}isUserSup(){return this.isSup}}class ye{constructor(e){this._app=e,window.addEventListener("error",(e=>this.errorHandler(e))),window.addEventListener("unhandledrejection",(e=>this.rejectionHandler(e)))}rejectionHandler(e){const t=e.reason;t instanceof h||(t?this.processException(t):this._app.isDebugMode().then((e=>{e&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(e){this.processException(e.error)}processException(e){e instanceof h||e instanceof l?this._app.alert(e.title,e.message):e instanceof i?this._app.error(e.title,e.message):this._app.isDebugMode().then((t=>{if(t)if(e instanceof Error)this._app.error(e.name,e.message);else{const t=(null==e?void 0:e.title)||"Erro detectado",n="string"==typeof e?e:e.message||`Erro interno "${c.objectToString(e)}"`;this._app.error(t,n)}}))}}function be(){const e=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(be=function(){return e})()}const we=ge;function ge(e,t){const n=be();return(ge=function(e){return n[e-=392]})(e,t)}!function(){const e=ge,t=be();for(;;)try{if(951926==-parseInt(e(398))/1+-parseInt(e(393))/2+parseInt(e(395))/3+-parseInt(e(400))/4*(parseInt(e(392))/5)+-parseInt(e(401))/6*(-parseInt(e(402))/7)+parseInt(e(397))/8+-parseInt(e(399))/9*(-parseInt(e(394))/10))break;t.push(t.shift())}catch(e){t.push(t.shift())}}();const Oe=we(396);class Te{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchTotals",Z.gql`query($filters: [InputFilter!] $name: String!) {
70
+ $queryAlias$: fetchTotals(name: $name, filters: $filters ){
71
+ name
72
+ value
73
+ }
74
+ }`)}async getTotals(e,t,n){let i={name:`totals://${e}/${t}`,filters:n};return te.get().callGraphQL({values:i,query:this.templateByQuery.get("fetchTotals")})}fetchTotals(e,t,n=[]){return new Promise(((i,r)=>{this.getTotals(e,t,n).then((e=>{if(e.length>0){const t=new Map;e.forEach((e=>{t.set(e.name,parseFloat(e.value))})),i(t)}else r("Não foi possível recuperar os totalizadores")})).catch((e=>{r(e)}))}))}}const Se=class{constructor(n){e(this,n),this.applicationLoaded=t(this,"applicationLoaded",7),this.applicationLoading=t(this,"applicationLoading",7),this._authPromises=[],this._duCache=new Map,this._duPromises=new Map,this._requestListener=new De}get parameters(){return this._parameters||(this._parameters=new se),this._parameters}get resourceID(){return this._resourceID||(this._resourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||re.resourceID||"unknown.resource.id"),this._resourceID}get auth(){return this._auth?Promise.resolve(this._auth):new Promise(((e,t)=>{const n=this._authPromises.length>0;this._authPromises.push(new Ee(e,t)),n||this.authFetcher.getData(this.resourceID).then((e=>{for(this._auth=e;this._authPromises.length>0;)this._authPromises.pop().resolve(this._auth)})).catch((e=>{for(;this._authPromises.length>0;)this._authPromises.pop().reject(e)}))}))}async isUserSup(){return new Promise(((e,t)=>{this.auth.then((n=>{this.getAuthList(n).then((t=>{e(t.isSup)})).catch((e=>t(e)))}))}))}async hasAccess(e){return new Promise(((t,n)=>{this.auth.then((i=>{this.getAuthList(i).then((n=>{t(n.isSup||n.actions[e])})).catch((e=>n(e)))}))}))}async getAllAccess(){return new Promise(((e,t)=>{this.auth.then((n=>{this.getAuthList(n).then((t=>{const n={};n.isSup=t.isSup,Object.entries(g).forEach((e=>{n[e[0]]=t.actions[e[1]]||!1})),e(n)})).catch((e=>t(e)))}))}))}async getStringParam(e){return this.parameters.asString(e,this.resourceID)}async getIntParam(e){return this.parameters.asInteger(e,this.resourceID)}async getFloatParam(e){return this.parameters.asFloat(e,this.resourceID)}async getBooleanParam(e){return this.parameters.asBoolean(e,this.resourceID)}async getDateParam(e){return this.parameters.asDate(e,this.resourceID)}async showPopUp(e){this.clearPopUpContent(),this._popUp.appendChild(e),this._popUp.opened=!0}async closePopUp(){this.clearPopUpContent(),this._popUp.opened=!1}async temOpcional(e){const t=e.split(",");return new Promise(((e,n)=>{this.getAttributeFromHTMLWrapper("opc0009").then((i=>{"1"===i?e(!0):Promise.all(t.map((e=>this.getAttributeFromHTMLWrapper("opc"+e)))).then((t=>{e(t.includes("1"))})).catch((e=>{n(e)}))})).catch((e=>{n(e)}))}))}async getConfig(e){let t={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:e,tipo:"T"}}};return new Promise(((e,n)=>{te.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(t)).then((t=>{var n;return e(null===(n=t.config)||void 0===n?void 0:n.data)})).catch((e=>n(e)))}))}async saveConfig(e,t){let n={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:e,tipo:"T",data:t}}};return new Promise(((e,t)=>{te.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(n)).then((t=>e(t))).catch((e=>t(e)))}))}async getAttributeFromHTMLWrapper(e){return Promise.resolve(window[e])}async openApp(e,t){re.openAppActivity(e,t)}getDuPromissesStack(e){let t;return e&&(t=this._duPromises.get(e),t||(t=[],this._duPromises.set(e,t))),t||[]}async createDataunit(e,t){return new Promise(((n,i)=>{const r=this.getDuPromissesStack(t),s=r.length>0;if(r.push(new Ee(n,i)),!s){const n=this.dataUnitFetcher.getDataUnit(e,this.resourceID);n.loadMetadata().then((()=>{for(t&&this._duCache.set(t,n);r.length>0;)r.pop().resolve(n)})).catch((e=>{for(;r.length>0;)r.pop().reject(e)}))}}))}async getDataUnit(e,t){return new Promise(((n,i)=>{const r=this._duCache.get(t);r?n(r):this.createDataunit(e,t).then((e=>{n(e)})).catch((e=>i(e)))}))}async getResourceID(){return Promise.resolve(this.resourceID)}async alert(e,t,n,i){return p.alert(e,t,n,i)}async error(e,t,n,i){return p.error(e,t,n,i)}async message(e,t,n,i){return p.message(e,t,n,i)}async confirm(e,t,n,i,r){return p.confirm(e,t,n,i,r)}async info(e,t){return p.info(e,t)}async loadFormConfig(e){return this.formConfigFetcher.loadFormConfig(e,this.resourceID)}async loadGridConfig(e){return this.gridConfigFetcher.getConfig(e,this.resourceID)}async loadTotals(e,t,n){return this.totalsFetcher.fetchTotals(e,t,n)}async saveGridConfig(e){return this.gridConfigFetcher.saveConfig(e,this.resourceID)}async getAuthList(e){return await(new pe).parseFromJSON(e)}get urlParams(){return this._urlParams||(this._urlParams=ee.getQueryParams(location.search)),this._urlParams}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new ie),this._dataUnitFetcher}get formConfigFetcher(){return this._formConfigFetcher||(this._formConfigFetcher=new ae),this._formConfigFetcher}get gridConfigFetcher(){return this._gridConfigFetcher||(this._gridConfigFetcher=new ue),this._gridConfigFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new Te),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new ce),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new le),this._authFetcher}async executeSearch(e,t,n){const i=null==n?void 0:n.getField(t);if(i){const{mode:t,argument:r}=e,{ENTITYNAME:s,CODEFIELD:a,DESCRIPTIONFIELD:u,ROOTENTITY:c,DESCRIPTIONENTITY:h}=i.properties,l=i.dependencies;let d;const v={rootEntity:c,descriptionFieldName:u,codeFieldName:a,showInactives:!1};return null==l||l.filter((e=>{var t;return null===(t=e.masterFields)||void 0===t?void 0:t.every((e=>{var t;return null===(t=n.getField(e))||void 0===t?void 0:t.visible}))})).forEach((e=>{var t;e.type===f.SEARCHING&&(null===(t=e.masterFields)||void 0===t?void 0:t.length)>0&&(d={expression:e.expression,params:e.masterFields.map((e=>{const t=n.getField(e),i=(null==t?void 0:t.dataType)||o.TEXT,r=n.getFieldValue(e);if(null==r)throw this.alert("Erro ao pesquisar",`É necessario informar o campo ${t.label} para executar a pesquisa.`),new Error(`É necessario informar o campo ${t.label} para executar a pesquisa.`);return{name:e,value:r,dataType:i}}))})})),"ADVANCED"===t?new Promise((e=>{const t=document.createElement("snk-pesquisa");t.argument=r,t.searchLoader=e=>this.pesquisaFetcher.loadAdvancedSearch(s,e,d,v),t.selectItem=t=>{e(t),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(h),this.showPopUp(t)})):this.pesquisaFetcher.loadSearchOptions(s,r,d,v)}}async isDebugMode(){return new Promise((e=>{e(window.isDebugMode)}))}clearPopUpContent(){this._popUp&&Array.from(this._popUp.children).forEach((e=>{this._popUp.removeChild(e)}))}clearPopUpTitle(){this._popUp.ezTitle=""}setPopUpTitle(e){this._popUp.ezTitle=e}componentWillLoad(){this._errorHandler=new ye(this),this.messagesBuilder=new m,d.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${ee.getUrlBase()}/mge/upload/file`),d.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((e,t,n)=>this.executeSearch(e,t,n))),d.setContextValue("__EZUI__GRID_LICENSE__",Oe),v.init()}connectedCallback(){d.setContextValue("__SNK__APPLICATION__",this),te.addRequestListener(this._requestListener)}disconnectedCallback(){te.removeRequestListener(this._requestListener)}componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{this.applicationLoaded.emit(!0)}))}render(){return n("div",null,n("ez-loading-bar",{ref:e=>this._requestListener.loadingBar=e}),n("ez-popup",{opened:!1,ref:e=>this._popUp=e,onEzClosePopup:()=>this.closePopUp()}))}};class De{constructor(){this._debounceTime=1e3,this._countRequest=0}onRequestStart(){this.loadingBar.show(),this._countRequest++,this._timerLoading&&clearTimeout(this._timerLoading)}onRequestEnd(){this._countRequest--,this._timerLoading=setTimeout((()=>{this._countRequest<=0&&this.loadingBar.hide()}),this._debounceTime)}}class Ee{constructor(e,t){this.resolve=e,this.reject=t}}Se.style=".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";export{Se as snk_application}
@@ -1 +1 @@
1
- import{p as a,b as t}from"./p-cd1dc099.js";(()=>{const t=import.meta.url,e={};return""!==t&&(e.resourcesUrl=new URL(".",t).href),a(e)})().then((a=>t([["p-56a32417",[[6,"snk-crud",{configName:[1,"config-name"],actionsList:[16],recordsValidator:[16],_dataUnit:[32],_dataState:[32]}]]],["p-d25637c9",[[1,"teste-pesquisa"]]],["p-edf81d2c",[[2,"snk-data-unit",{dataState:[1040],dataUnitName:[1,"data-unit-name"],entityName:[1,"entity-name"],pageSize:[2,"page-size"],dataUnit:[1040],beforeSave:[16],afterSave:[16],autoLoad:[4,"auto-load"],getDataUnit:[64]}]]],["p-b7e029cd",[[2,"snk-application",{messagesBuilder:[1040],isUserSup:[64],hasAccess:[64],getAllAccess:[64],getStringParam:[64],getIntParam:[64],getFloatParam:[64],getBooleanParam:[64],getDateParam:[64],showPopUp:[64],closePopUp:[64],temOpcional:[64],getConfig:[64],saveConfig:[64],getAttributeFromHTMLWrapper:[64],openApp:[64],createDataunit:[64],getDataUnit:[64],getResourceID:[64],alert:[64],error:[64],message:[64],confirm:[64],info:[64],loadFormConfig:[64],loadGridConfig:[64],saveGridConfig:[64],executeSearch:[64],isDebugMode:[64]}]]],["p-ce2d1214",[[2,"snk-form",{configName:[1,"config-name"],recordsValidator:[16],actionsList:[16],_dataUnit:[32],_configLoaded:[32],_dataState:[32],_editionFormConfig:[32],_insertionFormConfig:[32]}],[6,"snk-grid",{configName:[1,"config-name"],actionsList:[16],_dataUnit:[32],_configLoaded:[32],_dataState:[32],_gridConfig:[32]}]]],["p-4c7b32d6",[[2,"snk-pesquisa",{searchLoader:[16],selectItem:[16],argument:[1025],_itemList:[32],_startLoading:[32]}]]],["p-d25803a1",[[6,"snk-taskbar",{buttons:[1],actionsList:[16],primaryButton:[1,"primary-button"],disabledButtons:[16],dataUnit:[16],_permissions:[32]}]]]],a)));
1
+ import{p as a,b as t}from"./p-cd1dc099.js";(()=>{const t=import.meta.url,e={};return""!==t&&(e.resourcesUrl=new URL(".",t).href),a(e)})().then((a=>t([["p-56a32417",[[6,"snk-crud",{configName:[1,"config-name"],actionsList:[16],recordsValidator:[16],_dataUnit:[32],_dataState:[32]}]]],["p-d25637c9",[[1,"teste-pesquisa"]]],["p-edf81d2c",[[2,"snk-data-unit",{dataState:[1040],dataUnitName:[1,"data-unit-name"],entityName:[1,"entity-name"],pageSize:[2,"page-size"],dataUnit:[1040],beforeSave:[16],afterSave:[16],autoLoad:[4,"auto-load"],getDataUnit:[64]}]]],["p-825d2c38",[[2,"snk-application",{messagesBuilder:[1040],isUserSup:[64],hasAccess:[64],getAllAccess:[64],getStringParam:[64],getIntParam:[64],getFloatParam:[64],getBooleanParam:[64],getDateParam:[64],showPopUp:[64],closePopUp:[64],temOpcional:[64],getConfig:[64],saveConfig:[64],getAttributeFromHTMLWrapper:[64],openApp:[64],createDataunit:[64],getDataUnit:[64],getResourceID:[64],alert:[64],error:[64],message:[64],confirm:[64],info:[64],loadFormConfig:[64],loadGridConfig:[64],loadTotals:[64],saveGridConfig:[64],executeSearch:[64],isDebugMode:[64]}]]],["p-ce2d1214",[[2,"snk-form",{configName:[1,"config-name"],recordsValidator:[16],actionsList:[16],_dataUnit:[32],_configLoaded:[32],_dataState:[32],_editionFormConfig:[32],_insertionFormConfig:[32]}],[6,"snk-grid",{configName:[1,"config-name"],actionsList:[16],_dataUnit:[32],_configLoaded:[32],_dataState:[32],_gridConfig:[32]}]]],["p-4c7b32d6",[[2,"snk-pesquisa",{searchLoader:[16],selectItem:[16],argument:[1025],_itemList:[32],_startLoading:[32]}]]],["p-d25803a1",[[6,"snk-taskbar",{buttons:[1],actionsList:[16],primaryButton:[1,"primary-button"],disabledButtons:[16],dataUnit:[16],_permissions:[32]}]]]],a)));
@@ -12,13 +12,16 @@ import { PesquisaFetcher } from "../../lib/http/data-fetcher/fetchers/pesquisa-f
12
12
  import { Option } from "@sankhyalabs/ezui/dist/types/components/ez-combo-box/ez-combo-box";
13
13
  import AuthFetcher, { AutorizationType } from "../../lib/http/data-fetcher/fetchers/auth-fetcher";
14
14
  import { SnkErrorHandler } from "./errorhandler/snk-error-handler";
15
+ import { TotalsFetcher } from "../../lib/http/data-fetcher/fetchers/totals-fetcher";
15
16
  import { SnkMessageBuilder } from "../../lib/message/SnkMessageBuilder";
17
+ import { Filter } from "@sankhyalabs/core";
16
18
  export declare class SnkApplication {
17
19
  _parameters: ParametersFetcher;
18
20
  _urlParams: Map<string, any>;
19
21
  _dataUnitFetcher: DataUnitFetcher;
20
22
  _formConfigFetcher: FormConfigFetcher;
21
23
  _gridConfigFetcher: GridConfigFetcher;
24
+ _totalsFetcher: TotalsFetcher;
22
25
  _pesquisaFetcher: PesquisaFetcher;
23
26
  _authFetcher: AuthFetcher;
24
27
  _resourceID: string;
@@ -140,6 +143,10 @@ export declare class SnkApplication {
140
143
  * Busca a configuração de grade.
141
144
  */
142
145
  loadGridConfig(name: string): Promise<IGridConfig>;
146
+ /**
147
+ * Busca os totalizadores da grade.
148
+ */
149
+ loadTotals(name: string, resourceID: string, filters: Array<Filter>): Promise<Map<string, number>>;
143
150
  /**
144
151
  * Salva a configuração de grade.
145
152
  */
@@ -157,6 +164,7 @@ export declare class SnkApplication {
157
164
  private get dataUnitFetcher();
158
165
  private get formConfigFetcher();
159
166
  private get gridConfigFetcher();
167
+ private get totalsFetcher();
160
168
  private get pesquisaFetcher();
161
169
  private get authFetcher();
162
170
  executeSearch(searchArgument: any, fieldName: string, dataUnit: DataUnit): Promise<Array<Option> | Option>;
@@ -7,7 +7,7 @@
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  import { SnkMessageBuilder } from "./lib/message/SnkMessageBuilder";
9
9
  import { AutorizationType } from "./lib/http/data-fetcher/fetchers/auth-fetcher";
10
- import { DataUnit } from "@sankhyalabs/core";
10
+ import { DataUnit, Filter } from "@sankhyalabs/core";
11
11
  import { DialogType, MessageOptions } from "@sankhyalabs/ezui/dist/collection/utils";
12
12
  import { FieldConfig, RecordValidator } from "@sankhyalabs/ezui/dist/types/components/ez-form/ez-form";
13
13
  import { IGridConfig } from "@sankhyalabs/ezui/dist/types/components/ez-grid/controller/EzGridController";
@@ -100,6 +100,10 @@ export namespace Components {
100
100
  * Busca a configuração de grade.
101
101
  */
102
102
  "loadGridConfig": (name: string) => Promise<IGridConfig>;
103
+ /**
104
+ * Busca os totalizadores da grade.
105
+ */
106
+ "loadTotals": (name: string, resourceID: string, filters: Array<Filter>) => Promise<Map<string, number>>;
103
107
  /**
104
108
  * Exibe um diálogo de mensagem comum
105
109
  */
@@ -0,0 +1,8 @@
1
+ import { Filter } from "@sankhyalabs/core";
2
+ export declare class TotalsFetcher {
3
+ private templateByQuery;
4
+ constructor();
5
+ private buldTemplates;
6
+ private getTotals;
7
+ fetchTotals(name: string, resourceID: string, filters?: Array<Filter>): Promise<Map<string, number>>;
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/sankhyablocks",
3
- "version": "1.3.31-beta.13",
3
+ "version": "1.3.31-beta.14",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",