@sankhyalabs/ezui 1.1.82 → 1.1.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-button_11.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box_7.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +20 -26
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/{index-d5d5a77c.js → index-2fc1b5fa.js} +31 -16
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +19 -25
- package/dist/custom-elements/index.js +50 -41
- package/dist/esm/ez-button_11.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-collapsible-box_7.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +20 -26
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/{index-2bb35caf.js → index-015d8d70.js} +31 -16
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-48eddf77.entry.js → p-058b8138.entry.js} +1 -1
- package/dist/ezui/{p-2bb74de5.entry.js → p-07d2c50f.entry.js} +1 -1
- package/dist/ezui/{p-e346a7ff.entry.js → p-62ee7026.entry.js} +1 -1
- package/dist/ezui/{p-ec261c08.entry.js → p-8592635e.entry.js} +1 -1
- package/dist/ezui/{p-513f2d2e.entry.js → p-93ce25bc.entry.js} +1 -1
- package/dist/ezui/p-96c336db.js +1 -0
- package/dist/ezui/{p-c151c043.entry.js → p-a06aa43a.entry.js} +1 -1
- package/dist/ezui/{p-da6ac011.entry.js → p-ca3dac07.entry.js} +1 -1
- package/package.json +1 -1
- package/react/{readme.md → .keepfolder} +0 -0
- package/dist/ezui/p-3749c696.js +0 -1
|
@@ -588,6 +588,7 @@ var Action;
|
|
|
588
588
|
Action["DATA_SAVED"] = "dataSaved";
|
|
589
589
|
Action["RECORDS_REMOVED"] = "recordsRemoved";
|
|
590
590
|
Action["RECORDS_ADDED"] = "recordsAdded";
|
|
591
|
+
Action["RECORDS_COPIED"] = "recordsCopied";
|
|
591
592
|
Action["DATA_CHANGED"] = "dataChanged";
|
|
592
593
|
Action["EDITION_CANCELED"] = "editionCanceled";
|
|
593
594
|
Action["CHANGE_UNDONE"] = "changeUndone";
|
|
@@ -626,7 +627,6 @@ class StateManager {
|
|
|
626
627
|
}
|
|
627
628
|
process(action) {
|
|
628
629
|
const oldPresent = this._present;
|
|
629
|
-
let hasChange = false;
|
|
630
630
|
let hasHistChange = false;
|
|
631
631
|
this._histClean = false;
|
|
632
632
|
this._reducers.forEach(reducer => {
|
|
@@ -636,7 +636,6 @@ class StateManager {
|
|
|
636
636
|
const newSlice = reducer.reduce(this, oldSlice, action);
|
|
637
637
|
if (newSlice !== oldSlice) {
|
|
638
638
|
this.updateSlice(sliceName, newSlice, isHistoric);
|
|
639
|
-
hasChange = true;
|
|
640
639
|
hasHistChange || (hasHistChange = isHistoric);
|
|
641
640
|
}
|
|
642
641
|
});
|
|
@@ -645,16 +644,6 @@ class StateManager {
|
|
|
645
644
|
this._future = [];
|
|
646
645
|
document.dispatchEvent(new CustomEvent("undoableAction", { detail: this }));
|
|
647
646
|
}
|
|
648
|
-
if (hasChange) {
|
|
649
|
-
console.log(JSON.stringify(this, (_key, value) => {
|
|
650
|
-
if (value instanceof Map) {
|
|
651
|
-
return { dataType: "Map", value: Array.from(value.entries()) };
|
|
652
|
-
}
|
|
653
|
-
else {
|
|
654
|
-
return value;
|
|
655
|
-
}
|
|
656
|
-
}, 3));
|
|
657
|
-
}
|
|
658
647
|
}
|
|
659
648
|
select(sliceName, selector) {
|
|
660
649
|
const isHistoric = this.isHistoric(sliceName);
|
|
@@ -817,6 +806,7 @@ class AddedRecordsReducerImpl {
|
|
|
817
806
|
reduce(_stateManager, currentState, action) {
|
|
818
807
|
switch (action.type) {
|
|
819
808
|
case Action.RECORDS_ADDED:
|
|
809
|
+
case Action.RECORDS_COPIED:
|
|
820
810
|
return (currentState || []).concat(action.payload);
|
|
821
811
|
case Action.DATA_SAVED:
|
|
822
812
|
case Action.EDITION_CANCELED:
|
|
@@ -949,6 +939,7 @@ class SelectionReducerImpl {
|
|
|
949
939
|
reduce(stateManager, currentState, action) {
|
|
950
940
|
switch (action.type) {
|
|
951
941
|
case Action.RECORDS_ADDED:
|
|
942
|
+
case Action.RECORDS_COPIED:
|
|
952
943
|
return action.payload.map((r) => r.__record__id__);
|
|
953
944
|
case Action.DATA_SAVED:
|
|
954
945
|
return updateSavedIds(stateManager, action.payload.records);
|
|
@@ -1076,6 +1067,7 @@ class DataUnit {
|
|
|
1076
1067
|
this._observers = [];
|
|
1077
1068
|
this._filterProviders = [];
|
|
1078
1069
|
this._sortingProvider = undefined;
|
|
1070
|
+
this._interceptors = [];
|
|
1079
1071
|
}
|
|
1080
1072
|
get name() {
|
|
1081
1073
|
return this._name;
|
|
@@ -1143,6 +1135,9 @@ class DataUnit {
|
|
|
1143
1135
|
});
|
|
1144
1136
|
}
|
|
1145
1137
|
// API
|
|
1138
|
+
addInterceptor(interceptor) {
|
|
1139
|
+
this._interceptors.push(interceptor);
|
|
1140
|
+
}
|
|
1146
1141
|
addFilterProvider(provider) {
|
|
1147
1142
|
this._filterProviders.push(provider);
|
|
1148
1143
|
}
|
|
@@ -1168,6 +1163,12 @@ class DataUnit {
|
|
|
1168
1163
|
addRecord() {
|
|
1169
1164
|
this.dispatchAction(Action.RECORDS_ADDED, prepareAddedRecordId(this._stateManager, [{}]));
|
|
1170
1165
|
}
|
|
1166
|
+
copySelected() {
|
|
1167
|
+
const selectedRecords = this.getSelectedRecords();
|
|
1168
|
+
if (selectedRecords) {
|
|
1169
|
+
this.dispatchAction(Action.RECORDS_COPIED, prepareAddedRecordId(this._stateManager, selectedRecords));
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1171
1172
|
removeSelectedRecords() {
|
|
1172
1173
|
const selection = getSelection(this._stateManager);
|
|
1173
1174
|
if (selection) {
|
|
@@ -1193,6 +1194,13 @@ class DataUnit {
|
|
|
1193
1194
|
setSelectionByIndex(selection) {
|
|
1194
1195
|
this.dispatchAction(Action.SELECTION_CHANGED, { type: "index", selection });
|
|
1195
1196
|
}
|
|
1197
|
+
getSelectedRecords() {
|
|
1198
|
+
const selection = this.getSelection();
|
|
1199
|
+
if (selection) {
|
|
1200
|
+
const currentRecords = this.records;
|
|
1201
|
+
return currentRecords === null || currentRecords === void 0 ? void 0 : currentRecords.filter(r => selection.includes(r.__record__id__));
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1196
1204
|
nextRecord() {
|
|
1197
1205
|
this.dispatchAction(Action.NEXT_SELECTED);
|
|
1198
1206
|
}
|
|
@@ -1225,10 +1233,17 @@ class DataUnit {
|
|
|
1225
1233
|
}
|
|
1226
1234
|
// Actions / State manager
|
|
1227
1235
|
dispatchAction(actionType, payload) {
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
this.
|
|
1231
|
-
|
|
1236
|
+
var _a;
|
|
1237
|
+
let action = new DataUnitAction(actionType, payload);
|
|
1238
|
+
(_a = this._interceptors) === null || _a === void 0 ? void 0 : _a.forEach(interceptor => {
|
|
1239
|
+
if (action) {
|
|
1240
|
+
action = interceptor.interceptAction(action);
|
|
1241
|
+
}
|
|
1242
|
+
});
|
|
1243
|
+
if (action) {
|
|
1244
|
+
this._stateManager.process(action);
|
|
1245
|
+
this._observers.forEach(f => f(action));
|
|
1246
|
+
}
|
|
1232
1247
|
}
|
|
1233
1248
|
subscribe(observer) {
|
|
1234
1249
|
this._observers.push(observer);
|
package/dist/ezui/ezui.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-7c101b34.js";(()=>{const a=import.meta.url,s={};return""!==a&&(s.resourcesUrl=new URL(".",a).href),e(s)})().then((e=>a([["p-
|
|
1
|
+
import{p as e,b as a}from"./p-7c101b34.js";(()=>{const a=import.meta.url,s={};return""!==a&&(s.resourcesUrl=new URL(".",a).href),e(s)})().then((e=>a([["p-93ce25bc",[[0,"ez-form",{dataUnit:[1040],config:[16],submit:[64],cancel:[64],validate:[64]}]]],["p-091b27f2",[[1,"ez-dialog",{confirm:[1028],critical:[1028],message:[1025],opened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],handleButtonClick:[64],show:[64]}]]],["p-8592635e",[[1,"ez-time-input",{label:[513],viewValue:[1537,"view-value"],value:[1026],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],setFocus:[64],setBlur:[64]}]]],["p-6206515e",[[1,"ez-action-chip",{label:[513],enabled:[516]}]]],["p-39218c31",[[0,"ez-application"]]],["p-19d8a928",[[1,"ez-label-chip",{label:[513],enabled:[516],removable:[516],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-07d2c50f",[[1,"ez-popover",{autoClose:[516,"auto-close"],top:[1537],left:[1537],bottom:[1537],right:[1537],boxWidth:[513,"box-width"],opened:[1540],updatePosition:[64],show:[64],hide:[64]}]]],["p-a52b3368",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[1540,"use-header"],ezTitle:[1,"ez-title"]}]]],["p-b678dc80",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],show:[64]}]]],["p-ca3dac07",[[1,"ez-calendar",{value:[1040],floating:[516],time:[516],showSeconds:[516,"show-seconds"],show:[64],fitVertical:[64],hide:[64]}]]],["p-058b8138",[[0,"test-du"],[2,"ez-grid",{multipleSelection:[4,"multiple-selection"],pageSize:[2,"page-size"],serverUrl:[1,"server-url"],dataUnit:[16],_navigationHasPrevious:[32],_navigationHasNext:[32],_navigationFirstRow:[32],_navigationLastRow:[32],_navigationTotalRows:[32],_popUpVisible:[32],setColumnsDef:[64],addColumnMenuItem:[64],setColumnsState:[64],setData:[64],getSelection:[64],getColumnsState:[64],getColumns:[64]}],[2,"grid-config",{selectedTab:[1025,"selected-tab"],columns:[1040]}],[1,"ez-modal",{modalSize:[1,"modal-size"],align:[1],opened:[1028],closeEsc:[4,"close-esc"],closeOutsideClick:[4,"close-outside-click"]}],[1,"ez-list",{dataSource:[1040],useGroups:[1540,"use-groups"],ezDraggable:[1028,"ez-draggable"],ezSelectable:[1028,"ez-selectable"],itemSlotBuilder:[1040],_listItems:[32],_listGroupItems:[32],setSelection:[64],getSelection:[64],getList:[64]}],[1,"select-box",{selectedOption:[1,"selected-option"]}],[1,"ez-button",{label:[513],enabled:[516],mode:[513],image:[513],size:[513]}],[1,"ez-check",{label:[513],value:[1540],enabled:[516],mode:[513],getMode:[64],setFocus:[64]}],[1,"ez-tabselector",{selectedIndex:[1537,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1]}],[1,"ez-icon",{size:[513],href:[513]}],[1,"ez-text-input",{label:[513],value:[1537],enabled:[516],loading:[516],errorMessage:[1537,"error-message"],mask:[1],restrict:[1],setFocus:[64],setBlur:[64]}]]],["p-62ee7026",[[1,"ez-combo-box",{value:[1537],label:[513],enabled:[516],options:[1040],errorMessage:[1537,"error-message"],searchMode:[4,"search-mode"],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"],optionLoader:[16],_preSelection:[32],_visibleOptions:[32]}]]],["p-a06aa43a",[[1,"ez-date-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"]}],[1,"ez-date-time-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"]}],[1,"ez-search",{value:[1537],label:[1537],enabled:[1540],errorMessage:[1537,"error-message"],optionLoader:[16],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"]}],[1,"ez-number-input",{label:[1],value:[1538],enabled:[4],errorMessage:[1537,"error-message"],precision:[2],prettyPrecision:[2,"pretty-precision"]}],[1,"ez-collapsible-box",{value:[1540],label:[513],headerSize:[513,"header-size"],iconPlacement:[513,"icon-placement"],showHide:[64]}],[1,"ez-text-area",{label:[513],value:[1537],enabled:[516],loading:[516],errorMessage:[1537,"error-message"],rows:[1538],setFocus:[64],setBlur:[64]}],[1,"ez-upload",{label:[1],enabled:[4],maxFileSize:[2,"max-file-size"],maxFiles:[2,"max-files"],requestHeaders:[8,"request-headers"],urlUpload:[1,"url-upload"],urlDelete:[1,"url-delete"],value:[1040],addFiles:[64]}]]]],e)));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as t,h as n,c as i,H as e,g as r}from"./p-7c101b34.js";import{c as o,a as s,A as u,M as c,D as a,b as h,U as f}from"./p-3749c696.js";import{g as l}from"./p-f87c7082.js";let d=class{constructor(n){t(this,n),this.enabled=!0,this.mode="regular",this.size="medium"}getIconSize(){return this.size}handleSlotChange(t){const n=t.target,i=n.assignedElements()[0];"link"==this.mode?(i.style.display="inline","leftIcon"==n.name?i.style.paddingRight="var(--ez-button__inline__icon--padding)":"rightIcon"==n.name&&(i.style.paddingLeft="var(--ez-button__inline__icon--padding)")):i.style.setProperty("--ez-icon--color","var(--ez-icon--color)")}render(){return"icon"==this.mode?n("button",{class:"icon "+this.size,type:"button",disabled:!this.enabled},n("ez-icon",{class:"icon",href:this.image,size:this.getIconSize(),onClick:t=>{this.enabled||t.stopPropagation()}})):"label-icon"==this.mode?n("div",{class:"label-icon"},n("button",{class:"icon",type:"button",disabled:!this.enabled},n("ez-icon",{class:"icon",href:this.image,size:"large",onClick:t=>{this.enabled||t.stopPropagation()}})),n("label",{title:this.label},this.label)):"link"==this.mode?n("a",null,n("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label,n("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}})):n("button",{type:"button",disabled:!this.enabled},n("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label,n("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}}))}};d.style=":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--text--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover--background-color:var(--background--strong, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--ez-button--border);--ez-button--focus--box-shadow:none;--ez-button--link-color:var(--title--primary, '#C0C0C0')}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:hover{background-color:var(--ez-button--hover--background-color)}button:focus{outline:none;border:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;cursor:no-drop}button.icon{padding:0px}button.small{width:32px;min-width:32px;height:32px}button.medium{width:42px;min-width:42px;height:42px}button.large{width:52px;min-width:52px;height:52px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight)}a{font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}";let v=class{constructor(n){t(this,n),this.ezChange=i(this,"ezChange",7),this.enabled=!0,this.mode="regular"}adjustMode(){"switch"===this.mode?(this._inputElem.classList.remove("regularMode"),this._inputElem.classList.add("switchMode")):(this._inputElem.classList.remove("switchMode"),this._inputElem.classList.add("regularMode"))}async getMode(){return this.mode}async setFocus(){this._inputElem.focus()}componentDidLoad(){this.adjustMode()}changeValue(){this.value=!this.value,this.ezChange.emit(this.value)}getLabelClasses(){let t="label";return this.enabled||(t+=" label--disabled"),t}render(){return n(e,null,n("input",{type:"checkbox",class:"regularMode",checked:!0===this.value,onChange:()=>{this.changeValue()},disabled:!this.enabled,ref:t=>this._inputElem=t}),this.label?n("label",{class:this.getLabelClasses(),onClick:()=>{this.changeValue()},title:this.label},this.label):void 0)}static get watchers(){return{mode:["adjustMode"]}}};v.style=':host{--ez-check--box--width:18px;--ez-check--box--height:18px;--ez-check--width:calc(var(--ez-check--box--width) + 14px);--ez-check--height:calc(var(--ez-check--box--width) + 14px);--ez-check--border-radius:var(--border--radius-small);--ez-check--checked--background-color:var(--color--primary-200);--ez-check--focus--background-color:var(--color--strokes, #FFFFFF);--ez-check--hover--background-color:var(--background--medium);--ez-check--checked--disabled--background-color:var(--color--disable-secondary);--ez-check--border:var(--border--medium) var(--title--primary);--ez-check--disabled--border:var(--border--medium) var(--color--strokes);--ez-check--checked--border:var(--border--medium) var(--color--primary);--ez-check--checked--hover--background-color:var(--color--primary-200);--ez-check--checked--focus--background-color:var(--color--primary-300, #FFFFFF);--ez-check--check--image:url(\'data:image/svg+xml;utf8,<svg width="8" height="7" viewBox="0 0 8 7" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M7.70002 0.398999L7.48502 0.207997C7.31524 0.0598858 7.09376 -0.0150438 6.86894 -0.000430025C6.64411 0.0141838 6.43419 0.117153 6.28502 0.285997L2.70002 4.332L1.61802 3.384C1.44837 3.23576 1.22697 3.16067 1.00214 3.17509C0.77732 3.18952 0.567332 3.2923 0.418019 3.461L0.229019 3.674C0.0752361 3.84797 -0.00437434 4.07521 0.00721192 4.30713C0.0187982 4.53904 0.120661 4.75722 0.291019 4.915L2.27402 6.762C2.35832 6.8432 2.45842 6.90618 2.56811 6.94702C2.67779 6.98787 2.79471 7.00571 2.91159 6.99942C3.02846 6.99314 3.14279 6.96287 3.24747 6.91049C3.35214 6.85812 3.44492 6.78477 3.52002 6.695L7.79102 1.638C7.94063 1.46048 8.01486 1.23149 7.99786 0.999963C7.98085 0.768436 7.87396 0.552749 7.70002 0.398999Z"/></svg>\');--ez-check--check--background-color:var(--color--primary);--ez-check--check--disabled--background-color:var(--color--strokes);--ez-switch--slider--width:34px;--ez-switch--slider--height:14px;--ez-switch--pin--width:20px;--ez-switch--pin--height:20px;--ez-switch--focus--width:32px;--ez-switch--focus--height:32px;--ez-switch--background-color:var(--color--strokes);--ez-switch--disabled--background-color:var(--color--disable-secondary);--ez-switch--checked--background-color:var(--color--primary-300);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-secondary);--ez-switch--pin--checked--background-color:var(--color--primary);--ez-switch--pin--checked--disabled--background-color:#E8F7F4;--ez-switch--pin--focus--background-color:var(--text--disable);--ez-switch--pin--checked--focus--background-color:var(--color--primary);--ez-check--label--font-size:var(--text--medium, 14px);--ez-check--label--font-family:var(--font-pattern, Arial);--ez-check--label--color:var(--title--primary, #000);--ez-check--label--disabled--color:var(--text--disable, #AFB6C0);display:flex;width:100%;align-items:center;margin:0}input.regularMode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative;width:var(--ez-check--width);height:var(--ez-check--height)}input.regularMode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regularMode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regularMode:disabled{cursor:auto;background:none}input.regularMode::before{box-sizing:border-box;content:"";display:block;width:var(--ez-check--box--width);height:var(--ez-check--box--height);border-radius:var(--ez-check--border-radius);border:var(--ez-check--border)}input.regularMode:disabled::before{border:var(--ez-check--disabled--border)}input.regularMode:checked:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regularMode:checked:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regularMode:checked::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regularMode:checked:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regularMode:checked::after{display:flex;position:absolute;content:"";background-color:var(--ez-check--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--ez-check--check--image);mask-image:var(--ez-check--check--image)}input.regularMode:checked:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switchMode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:none;transition:background-color var(--transition);width:var(--ez-switch--slider--width);height:var(--ez-switch--slider--height);background-color:var(--ez-switch--background-color)}input.switchMode:disabled{background-color:var(--ez-switch--disabled--background-color)}input.switchMode::after{content:"";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transform:translateY(-3px);border-radius:50%;width:var(--ez-switch--pin--width);height:var(--ez-switch--pin--height);background-color:var(--ez-switch--pin--background-color)}input.switchMode:disabled::after{background-color:var(--ez-switch--pin--disabled--background-color)}input.switchMode:checked{transition:background-color var(--transition);background-color:var(--ez-switch--checked--background-color)}input.switchMode::before{display:block;content:"";display:block;position:absolute;border-radius:50%;opacity:0;width:var(--ez-switch--focus--width);height:var(--ez-switch--focus--height);top:calc((var(--ez-switch--slider--height) - var(--ez-switch--focus--height)) / 2);left:calc((var(--ez-switch--pin--width) - var(--ez-switch--focus--width))/2);background-color:var(--ez-switch--pin--focus--background-color)}input.switchMode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switchMode:checked:focus::before{background-color:var(--ez-switch--pin--checked--focus--background-color);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width)))}input.switchMode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width))) translateY(-3px);box-shadow:var(--shadow);background-color:var(--ez-switch--pin--checked--background-color)}input.switchMode:checked:disabled::after{background-color:var(--ez-switch--pin--checked--disabled--background-color)}.label{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-check--label--color);text-shadow:var(--text-shadow);font-size:var(--ez-check--label--font-size);font-family:var(--ez-check--label--font-family);cursor:default;padding-left:var(--space--small)}.label--disabled{color:var(--ez-check--label--disabled--color)}';var p=o((function(t,n){
|
|
1
|
+
import{r as t,h as n,c as i,H as e,g as r}from"./p-7c101b34.js";import{c as o,a as s,A as u,M as c,D as a,b as h,U as f}from"./p-96c336db.js";import{g as l}from"./p-f87c7082.js";let d=class{constructor(n){t(this,n),this.enabled=!0,this.mode="regular",this.size="medium"}getIconSize(){return this.size}handleSlotChange(t){const n=t.target,i=n.assignedElements()[0];"link"==this.mode?(i.style.display="inline","leftIcon"==n.name?i.style.paddingRight="var(--ez-button__inline__icon--padding)":"rightIcon"==n.name&&(i.style.paddingLeft="var(--ez-button__inline__icon--padding)")):i.style.setProperty("--ez-icon--color","var(--ez-icon--color)")}render(){return"icon"==this.mode?n("button",{class:"icon "+this.size,type:"button",disabled:!this.enabled},n("ez-icon",{class:"icon",href:this.image,size:this.getIconSize(),onClick:t=>{this.enabled||t.stopPropagation()}})):"label-icon"==this.mode?n("div",{class:"label-icon"},n("button",{class:"icon",type:"button",disabled:!this.enabled},n("ez-icon",{class:"icon",href:this.image,size:"large",onClick:t=>{this.enabled||t.stopPropagation()}})),n("label",{title:this.label},this.label)):"link"==this.mode?n("a",null,n("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label,n("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}})):n("button",{type:"button",disabled:!this.enabled},n("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label,n("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}}))}};d.style=":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--text--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover--background-color:var(--background--strong, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--ez-button--border);--ez-button--focus--box-shadow:none;--ez-button--link-color:var(--title--primary, '#C0C0C0')}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:hover{background-color:var(--ez-button--hover--background-color)}button:focus{outline:none;border:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;cursor:no-drop}button.icon{padding:0px}button.small{width:32px;min-width:32px;height:32px}button.medium{width:42px;min-width:42px;height:42px}button.large{width:52px;min-width:52px;height:52px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight)}a{font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}";let v=class{constructor(n){t(this,n),this.ezChange=i(this,"ezChange",7),this.enabled=!0,this.mode="regular"}adjustMode(){"switch"===this.mode?(this._inputElem.classList.remove("regularMode"),this._inputElem.classList.add("switchMode")):(this._inputElem.classList.remove("switchMode"),this._inputElem.classList.add("regularMode"))}async getMode(){return this.mode}async setFocus(){this._inputElem.focus()}componentDidLoad(){this.adjustMode()}changeValue(){this.value=!this.value,this.ezChange.emit(this.value)}getLabelClasses(){let t="label";return this.enabled||(t+=" label--disabled"),t}render(){return n(e,null,n("input",{type:"checkbox",class:"regularMode",checked:!0===this.value,onChange:()=>{this.changeValue()},disabled:!this.enabled,ref:t=>this._inputElem=t}),this.label?n("label",{class:this.getLabelClasses(),onClick:()=>{this.changeValue()},title:this.label},this.label):void 0)}static get watchers(){return{mode:["adjustMode"]}}};v.style=':host{--ez-check--box--width:18px;--ez-check--box--height:18px;--ez-check--width:calc(var(--ez-check--box--width) + 14px);--ez-check--height:calc(var(--ez-check--box--width) + 14px);--ez-check--border-radius:var(--border--radius-small);--ez-check--checked--background-color:var(--color--primary-200);--ez-check--focus--background-color:var(--color--strokes, #FFFFFF);--ez-check--hover--background-color:var(--background--medium);--ez-check--checked--disabled--background-color:var(--color--disable-secondary);--ez-check--border:var(--border--medium) var(--title--primary);--ez-check--disabled--border:var(--border--medium) var(--color--strokes);--ez-check--checked--border:var(--border--medium) var(--color--primary);--ez-check--checked--hover--background-color:var(--color--primary-200);--ez-check--checked--focus--background-color:var(--color--primary-300, #FFFFFF);--ez-check--check--image:url(\'data:image/svg+xml;utf8,<svg width="8" height="7" viewBox="0 0 8 7" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M7.70002 0.398999L7.48502 0.207997C7.31524 0.0598858 7.09376 -0.0150438 6.86894 -0.000430025C6.64411 0.0141838 6.43419 0.117153 6.28502 0.285997L2.70002 4.332L1.61802 3.384C1.44837 3.23576 1.22697 3.16067 1.00214 3.17509C0.77732 3.18952 0.567332 3.2923 0.418019 3.461L0.229019 3.674C0.0752361 3.84797 -0.00437434 4.07521 0.00721192 4.30713C0.0187982 4.53904 0.120661 4.75722 0.291019 4.915L2.27402 6.762C2.35832 6.8432 2.45842 6.90618 2.56811 6.94702C2.67779 6.98787 2.79471 7.00571 2.91159 6.99942C3.02846 6.99314 3.14279 6.96287 3.24747 6.91049C3.35214 6.85812 3.44492 6.78477 3.52002 6.695L7.79102 1.638C7.94063 1.46048 8.01486 1.23149 7.99786 0.999963C7.98085 0.768436 7.87396 0.552749 7.70002 0.398999Z"/></svg>\');--ez-check--check--background-color:var(--color--primary);--ez-check--check--disabled--background-color:var(--color--strokes);--ez-switch--slider--width:34px;--ez-switch--slider--height:14px;--ez-switch--pin--width:20px;--ez-switch--pin--height:20px;--ez-switch--focus--width:32px;--ez-switch--focus--height:32px;--ez-switch--background-color:var(--color--strokes);--ez-switch--disabled--background-color:var(--color--disable-secondary);--ez-switch--checked--background-color:var(--color--primary-300);--ez-switch--pin--background-color:var(--background--xlight);--ez-switch--pin--disabled--background-color:var(--color--disable-secondary);--ez-switch--pin--checked--background-color:var(--color--primary);--ez-switch--pin--checked--disabled--background-color:#E8F7F4;--ez-switch--pin--focus--background-color:var(--text--disable);--ez-switch--pin--checked--focus--background-color:var(--color--primary);--ez-check--label--font-size:var(--text--medium, 14px);--ez-check--label--font-family:var(--font-pattern, Arial);--ez-check--label--color:var(--title--primary, #000);--ez-check--label--disabled--color:var(--text--disable, #AFB6C0);display:flex;width:100%;align-items:center;margin:0}input.regularMode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative;width:var(--ez-check--width);height:var(--ez-check--height)}input.regularMode:enabled:hover{background-color:var(--ez-check--hover--background-color)}input.regularMode:enabled:focus{outline:none;background-color:var(--ez-check--focus--background-color)}input.regularMode:disabled{cursor:auto;background:none}input.regularMode::before{box-sizing:border-box;content:"";display:block;width:var(--ez-check--box--width);height:var(--ez-check--box--height);border-radius:var(--ez-check--border-radius);border:var(--ez-check--border)}input.regularMode:disabled::before{border:var(--ez-check--disabled--border)}input.regularMode:checked:enabled:hover{background-color:var(--ez-check--checked--hover--background-color)}input.regularMode:checked:enabled:focus{background-color:var(--ez-check--checked--focus--background-color)}input.regularMode:checked::before{border:var(--ez-check--checked--border);background-color:var(--ez-check--checked--background-color)}input.regularMode:checked:disabled:before{border:var(--ez-check--disabled--border);background-color:var(--ez-check--checked--disabled--background-color)}input.regularMode:checked::after{display:flex;position:absolute;content:"";background-color:var(--ez-check--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--ez-check--check--image);mask-image:var(--ez-check--check--image)}input.regularMode:checked:disabled::after{background-color:var(--ez-check--check--disabled--background-color)}input.switchMode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:none;transition:background-color var(--transition);width:var(--ez-switch--slider--width);height:var(--ez-switch--slider--height);background-color:var(--ez-switch--background-color)}input.switchMode:disabled{background-color:var(--ez-switch--disabled--background-color)}input.switchMode::after{content:"";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transform:translateY(-3px);border-radius:50%;width:var(--ez-switch--pin--width);height:var(--ez-switch--pin--height);background-color:var(--ez-switch--pin--background-color)}input.switchMode:disabled::after{background-color:var(--ez-switch--pin--disabled--background-color)}input.switchMode:checked{transition:background-color var(--transition);background-color:var(--ez-switch--checked--background-color)}input.switchMode::before{display:block;content:"";display:block;position:absolute;border-radius:50%;opacity:0;width:var(--ez-switch--focus--width);height:var(--ez-switch--focus--height);top:calc((var(--ez-switch--slider--height) - var(--ez-switch--focus--height)) / 2);left:calc((var(--ez-switch--pin--width) - var(--ez-switch--focus--width))/2);background-color:var(--ez-switch--pin--focus--background-color)}input.switchMode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switchMode:checked:focus::before{background-color:var(--ez-switch--pin--checked--focus--background-color);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width)))}input.switchMode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transform:translateX(calc(var(--ez-switch--slider--width) - var(--ez-switch--pin--width))) translateY(-3px);box-shadow:var(--shadow);background-color:var(--ez-switch--pin--checked--background-color)}input.switchMode:checked:disabled::after{background-color:var(--ez-switch--pin--checked--disabled--background-color)}.label{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ez-check--label--color);text-shadow:var(--text-shadow);font-size:var(--ez-check--label--font-size);font-family:var(--ez-check--label--font-family);cursor:default;padding-left:var(--space--small)}.label--disabled{color:var(--ez-check--label--disabled--color)}';var p=o((function(t,n){
|
|
2
2
|
/**
|
|
3
3
|
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
|
|
4
4
|
* @version v26.2.1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as o,H as s,g as e}from"./p-7c101b34.js";import"./p-
|
|
1
|
+
import{r as t,c as i,h as o,H as s,g as e}from"./p-7c101b34.js";import"./p-96c336db.js";import{F as r}from"./p-ddd0ef12.js";let h=class{constructor(o){t(this,o),this.ezVisibilityChange=i(this,"ezVisibilityChange",7),this._firstRender=!0,this.autoClose=!0,this.top="0px",this.left="0px",this.bottom="0px",this.right="0px",this.boxWidth="fit-content"}dispatchVisibilityChange(t,i){t!=i&&this.ezVisibilityChange.emit(t)}async updatePosition(t=this.top,i=this.left,o=this.bottom,s=this.right){r.updateFloatPosition(this._box,this._container,{autoClose:this.autoClose,top:t,left:i,bottom:o,right:s,innerClickTest:(t,i)=>!!t.contains(i)||!(!t.shadowRoot||!t.shadowRoot.contains(i))||((t=this._host).lastElementChild.shadowRoot?t.lastElementChild.shadowRoot.contains(i):t.contains(i))})}async show(t=this.top,i=this.left,o=this.bottom,s=this.right){this._floatingID=r.float(this._box,this._container,{autoClose:this.autoClose,top:t,left:i,bottom:o,right:s,innerClickTest:(t,i)=>!!t.contains(i)||!(!t.shadowRoot||!t.shadowRoot.contains(i))||((t=this._host).lastElementChild.shadowRoot?t.lastElementChild.shadowRoot.contains(i):t.contains(i))}),this.opened=!0}async hide(){void 0!==this._floatingID&&(r.close(this._floatingID),this._floatingID=void 0,this.opened=!1)}componentDidRender(){this._firstRender&&(this._box.remove(),this._firstRender=!1)}render(){return o(s,null,o("section",{ref:t=>this._container=t},o("div",{class:"box "+("fit-content"===this.boxWidth?"box--fit-content":"box--full-width"),ref:t=>this._box=t},o("slot",null))))}get _host(){return e(this)}static get watchers(){return{opened:["dispatchVisibilityChange"]}}};h.style=":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--more-visible, 1);position:relative;display:flex;user-select:none;width:100%}.box{z-index:var(--ez-popover__box--z-index);display:flex;flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.box--fit-content{width:fit-content}.box--full-width{width:100%}";export{h as ez_popover}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,c as t,h as e,H as i,g as s}from"./p-7c101b34.js";import"./p-3749c696.js";import{F as r}from"./p-ddd0ef12.js";import{C as a}from"./p-8b099482.js";let n=class{constructor(e){o(this,e),this.ezChange=t(this,"ezChange",7),this.enabled=!0,this.showSelectedValue=!1,this.showOptionValue=!1}internalUpdate(){this._inputElement&&(this._inputElement.value=this.getText()),this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}getText(){let o="";const t=this.getSelectedOption();return t&&(o=this.showSelectedValue?`${t.value} - ${t.label}`:t.label),o}getSelectedOption(){return"string"==typeof this.value||this.value instanceof String?this._visibleOptions.find((o=>o.value===this.value)):this.value}updateVisibleOptions(){let o=this._source||[];if(!this.searchMode&&this._criteria){const t=this._criteria.toUpperCase();o=o.filter((o=>o.label.toLocaleUpperCase().indexOf(t)>-1))}this._visibleOptions=[{value:void 0,label:""}].concat(o)}buildItem(o,t){return e("li",{class:t===this._preSelection?"item preselected":"item",id:`item_${o.value}`,onMouseDown:()=>this.selectOption(o),onMouseOver:()=>this._preSelection=void 0},e("span",{class:"item--label",title:o.label},o.label),this.showOptionValue?e("span",{class:"item--value",title:o.value},o.value):void 0)}showOptions(){this.enabled&&(this._floatingID=r.float(this._optionsList,this._listContainer,{autoClose:!0,top:this.errorMessage?"0px":"-17px"}),window.requestAnimationFrame((()=>{this._optionsList.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})))}hideOptions(){void 0!==this._floatingID&&r.close(this._floatingID),this._floatingID=void 0}isOptionsVisible(){return void 0!==this._floatingID&&r.isFloating(this._floatingID)}nextOption(){this.searchMode&&!this.isOptionsVisible()||(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection],!0))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection],!1)}scrollToOption(o,t){window.requestAnimationFrame((()=>{const e=this._optionsList.querySelector(`li#item_${o.value}`);if(e){const o=e.parentElement,i=o.getBoundingClientRect(),s=e.getBoundingClientRect();t&&s.bottom>i.bottom?o.scrollTop=s.top:!t&&s.top<i.top&&(o.scrollTop=0)}}))}selectCurrentOption(){void 0!==this._preSelection&&(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0)}selectOption(o){if(this.getSelectedOption()!==o){const t=(null==o?void 0:o.value)?o:void 0;this.value=t,this.errorMessage="",this.ezChange.emit(t)}else this.internalUpdate()}updateSource(o){o instanceof Promise?(o.then((o=>this.updateSource(o))),this.updateVisibleOptions()):(this._source=o,this.updateVisibleOptions())}loadOptions(o,t=""){this._criteria=t,this.updateSource(this.optionLoader?this.optionLoader({mode:o,argument:t}):this.options)}cancelPreselection(){!this._inputElement.value&&this.value?this.selectOption(void 0):this.internalUpdate()}componentWillLoad(){if(void 0===this.options){this.options=[];const o=this.el.querySelectorAll("option");o&&o.forEach((o=>{let t=o.innerText,e=o.getAttribute("value");e||(e=t),this.options.push({label:t,value:e}),o.hidden=!0}))}this.searchMode?this.updateSource([]):this.loadOptions("PRELOAD")}componentDidRender(){void 0===this._floatingID&&this._optionsList.remove()}componentDidLoad(){a.applyVarsTextInput(this.el,this._inputElement)}onTextInputChangeHandler(o){this._criteria||(this._inputElement.value=o.data);const t=o.target.value;this._criteria=t,this._criteria&&(this.searchMode?(this._changeDeboucingTimeout&&window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions("PREDICTIVE",t)}),200)):this.updateVisibleOptions(),this.showOptions())}onTextInputClickHandler(){this.searchMode||this.showOptions()}keyDownHandler(o){switch(o.key){case"ArrowDown":this.nextOption();break;case"ArrowUp":this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection()}o.stopPropagation()}onTextInputFocusOutHandler(){this.cancelPreselection()}render(){return e(i,null,e("ez-text-input",{ref:o=>this._inputElement=o,enabled:this.enabled,onInput:o=>this.onTextInputChangeHandler(o),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onEzChange:o=>o.stopPropagation(),onKeyDown:o=>this.keyDownHandler(o),label:this.label,value:this.getText(),errorMessage:this.errorMessage},e("button",this.searchMode?{disabled:!this.enabled,tabindex:-1,class:"btn-open-search",onClick:()=>{this.loadOptions("ADVANCED")},slot:"leftIcon"}:{disabled:!this.enabled,tabindex:-1,class:"btn-open-options",slot:"rightIcon",onClick:()=>this.showOptions()})),e("section",{class:"list-container",ref:o=>this._listContainer=o},e("div",{class:"options-list",ref:o=>this._optionsList=o},this._visibleOptions.map(((o,t)=>this.buildItem(o,t))))))}get el(){return s(this)}static get watchers(){return{value:["internalUpdate"]}}};n.style=':host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn-search--background-color:var(--text--primary, #626e82);--ez-combo-box__btn-search-disabled--background-color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-search-hover--background-color:var(--color--primary, #4e4e4e);--ez-combo-box__btn-options--background-color:var(--text--primary, #626e82);--ez-combo-box__btn-options-disabled--background-color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-options-hover--background-color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #919191);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium));--ez-combo-box__drop-down-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="16px"><path d="M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z"/></svg>\');--ez-combo-box__search-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="22px" width="22px"><path d="m 9.4,2.3 c 4.1,0 7.4,3.2 7.4,7.2 0,1.8 -0.7,3.4 -1.8,4.7 l 0.3,0.3 h 0.9 l 5.7,5.6 -1.7,1.7 -5.7,-5.6 V 15.3 L 14.3,15 C 13,16.1 11.3,16.7 9.5,16.7 5.3,16.7 2,13.5 2,9.5 2,5.5 5.3,2.3 9.4,2.3 m 0,2.2 c -2.9,0 -5.1,2.2 -5.1,5 0,2.8 2.3,5 5.1,5 2.8,0 5.1,-2.2 5.1,-5 0,-2.8 -2.2,-5 -5.1,-5 z"/></svg>\');--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}.list-container{position:relative;width:100%}.options-list{box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--ez-combo-box--background-color--xlight);padding:var(--ez-combo-box--space--small);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);scroll-behavior:smooth;max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small));overflow:auto}.item{text-align:left;display:flex;justify-content:space-between;align-items:center;border-radius:var(--ez-combo-box--border-radius-small);padding:0 var(--ez-combo-box--space--small);list-style-type:none;min-height:var(--ez-combo-box__list-height)}.item--label{text-align:left;flex-basis:85%;flex-grow:1;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item--value{text-align:right;flex-basis:15%;flex-grow:0;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn-open-options{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-options:disabled{cursor:unset}.btn-open-options::after{content:\'\';display:flex;background-color:var(--ez-combo-box__btn-options--background-color);width:16px;height:16px;-webkit-mask-image:var(--ez-combo-box__drop-down-image);mask-image:var(--ez-combo-box__drop-down-image)}.btn-open-options:disabled:after{background-color:var(--ez-combo-box__btn-options-disabled--background-color)}.btn-open-options:enabled:hover::after{background-color:var(--ez-combo-box__btn-options-hover--background-color)}.btn-open-search{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-search:disabled{cursor:unset}.btn-open-search::after{content:\'\';display:flex;background-color:var(--ez-combo-box__btn-search--background-color);width:22px;height:22px;-webkit-mask-image:var(--ez-combo-box__search-image);mask-image:var(--ez-combo-box__search-image)}.btn-open-search:disabled:after{background-color:var(--ez-combo-box__btn-search-disabled--background-color)}.btn-open-search:enabled:hover::after{background-color:var(--ez-combo-box__btn-search-hover--background-color)}';export{n as ez_combo_box}
|
|
1
|
+
import{r as o,c as t,h as e,H as i,g as s}from"./p-7c101b34.js";import"./p-96c336db.js";import{F as r}from"./p-ddd0ef12.js";import{C as a}from"./p-8b099482.js";let n=class{constructor(e){o(this,e),this.ezChange=t(this,"ezChange",7),this.enabled=!0,this.showSelectedValue=!1,this.showOptionValue=!1}internalUpdate(){this._inputElement&&(this._inputElement.value=this.getText()),this.hideOptions(),this._criteria=void 0,this._preSelection=void 0,this.updateVisibleOptions()}getText(){let o="";const t=this.getSelectedOption();return t&&(o=this.showSelectedValue?`${t.value} - ${t.label}`:t.label),o}getSelectedOption(){return"string"==typeof this.value||this.value instanceof String?this._visibleOptions.find((o=>o.value===this.value)):this.value}updateVisibleOptions(){let o=this._source||[];if(!this.searchMode&&this._criteria){const t=this._criteria.toUpperCase();o=o.filter((o=>o.label.toLocaleUpperCase().indexOf(t)>-1))}this._visibleOptions=[{value:void 0,label:""}].concat(o)}buildItem(o,t){return e("li",{class:t===this._preSelection?"item preselected":"item",id:`item_${o.value}`,onMouseDown:()=>this.selectOption(o),onMouseOver:()=>this._preSelection=void 0},e("span",{class:"item--label",title:o.label},o.label),this.showOptionValue?e("span",{class:"item--value",title:o.value},o.value):void 0)}showOptions(){this.enabled&&(this._floatingID=r.float(this._optionsList,this._listContainer,{autoClose:!0,top:this.errorMessage?"0px":"-17px"}),window.requestAnimationFrame((()=>{this._optionsList.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})))}hideOptions(){void 0!==this._floatingID&&r.close(this._floatingID),this._floatingID=void 0}isOptionsVisible(){return void 0!==this._floatingID&&r.isFloating(this._floatingID)}nextOption(){this.searchMode&&!this.isOptionsVisible()||(this.showOptions(),this._preSelection=void 0===this._preSelection?0:Math.min(this._preSelection+1,this._visibleOptions.length-1),this.scrollToOption(this._visibleOptions[this._preSelection],!0))}previousOption(){this._preSelection=void 0===this._preSelection?0:Math.max(this._preSelection-1,0),this.scrollToOption(this._visibleOptions[this._preSelection],!1)}scrollToOption(o,t){window.requestAnimationFrame((()=>{const e=this._optionsList.querySelector(`li#item_${o.value}`);if(e){const o=e.parentElement,i=o.getBoundingClientRect(),s=e.getBoundingClientRect();t&&s.bottom>i.bottom?o.scrollTop=s.top:!t&&s.top<i.top&&(o.scrollTop=0)}}))}selectCurrentOption(){void 0!==this._preSelection&&(this.selectOption(this._visibleOptions[this._preSelection]),this._preSelection=void 0)}selectOption(o){if(this.getSelectedOption()!==o){const t=(null==o?void 0:o.value)?o:void 0;this.value=t,this.errorMessage="",this.ezChange.emit(t)}else this.internalUpdate()}updateSource(o){o instanceof Promise?(o.then((o=>this.updateSource(o))),this.updateVisibleOptions()):(this._source=o,this.updateVisibleOptions())}loadOptions(o,t=""){this._criteria=t,this.updateSource(this.optionLoader?this.optionLoader({mode:o,argument:t}):this.options)}cancelPreselection(){!this._inputElement.value&&this.value?this.selectOption(void 0):this.internalUpdate()}componentWillLoad(){if(void 0===this.options){this.options=[];const o=this.el.querySelectorAll("option");o&&o.forEach((o=>{let t=o.innerText,e=o.getAttribute("value");e||(e=t),this.options.push({label:t,value:e}),o.hidden=!0}))}this.searchMode?this.updateSource([]):this.loadOptions("PRELOAD")}componentDidRender(){void 0===this._floatingID&&this._optionsList.remove()}componentDidLoad(){a.applyVarsTextInput(this.el,this._inputElement)}onTextInputChangeHandler(o){this._criteria||(this._inputElement.value=o.data);const t=o.target.value;this._criteria=t,this._criteria&&(this.searchMode?(this._changeDeboucingTimeout&&window.clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=window.setTimeout((()=>{this.loadOptions("PREDICTIVE",t)}),200)):this.updateVisibleOptions(),this.showOptions())}onTextInputClickHandler(){this.searchMode||this.showOptions()}keyDownHandler(o){switch(o.key){case"ArrowDown":this.nextOption();break;case"ArrowUp":this.previousOption();break;case"Enter":this.selectCurrentOption();break;case"Escape":this.cancelPreselection()}o.stopPropagation()}onTextInputFocusOutHandler(){this.cancelPreselection()}render(){return e(i,null,e("ez-text-input",{ref:o=>this._inputElement=o,enabled:this.enabled,onInput:o=>this.onTextInputChangeHandler(o),onClick:()=>this.onTextInputClickHandler(),onFocusout:()=>this.onTextInputFocusOutHandler(),onEzChange:o=>o.stopPropagation(),onKeyDown:o=>this.keyDownHandler(o),label:this.label,value:this.getText(),errorMessage:this.errorMessage},e("button",this.searchMode?{disabled:!this.enabled,tabindex:-1,class:"btn-open-search",onClick:()=>{this.loadOptions("ADVANCED")},slot:"leftIcon"}:{disabled:!this.enabled,tabindex:-1,class:"btn-open-options",slot:"rightIcon",onClick:()=>this.showOptions()})),e("section",{class:"list-container",ref:o=>this._listContainer=o},e("div",{class:"options-list",ref:o=>this._optionsList=o},this._visibleOptions.map(((o,t)=>this.buildItem(o,t))))))}get el(){return s(this)}static get watchers(){return{value:["internalUpdate"]}}};n.style=':host{--ez-combo-box--height:42px;--ez-combo-box--width:100%;--ez-combo-box__icon--width:48px;--ez-combo-box--border-radius:var(--border--radius-medium, 12px);--ez-combo-box--border-radius-small:var(--border--radius-small, 6px);--ez-combo-box--font-size:var(--text--medium, 14px);--ez-combo-box--font-family:var(--font-pattern, Arial);--ez-combo-box--font-weight--large:var(--text-weight--large, 500);--ez-combo-box--font-weight--medium:var(--text-weight--medium, 400);--ez-combo-box--background-color--xlight:var(--background--xlight, #fff);--ez-combo-box--background-medium:var(--background--medium, #f0f3f7);--ez-combo-box__input--background-color:var(--background--medium, #e0e0e0);--ez-combo-box__input--border:var(--border--medium, 2px solid);--ez-combo-box__input--border-color:var(--ez-combo-box__input--background-color);--ez-combo-box__input--focus--border-color:var(--color--primary, #008561);--ez-combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--ez-combo-box__input--error--border-color:#CC2936;--ez-combo-box__btn-search--background-color:var(--text--primary, #626e82);--ez-combo-box__btn-search-disabled--background-color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-search-hover--background-color:var(--color--primary, #4e4e4e);--ez-combo-box__btn-options--background-color:var(--text--primary, #626e82);--ez-combo-box__btn-options-disabled--background-color:var(--text--disable, #AFB6C0);--ez-combo-box__btn-options-hover--background-color:var(--color--primary, #4e4e4e);--ez-combo-box__label--color:var(--title--primary, #919191);--ez-combo-box__list-text--primary:var(--text--primary, #626e82);--ez-combo-box__list-height:calc(var(--ez-combo-box--font-size) + var(--ez-combo-box--space--medium));--ez-combo-box__drop-down-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="16px"><path d="M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z"/></svg>\');--ez-combo-box__search-image:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="22px" width="22px"><path d="m 9.4,2.3 c 4.1,0 7.4,3.2 7.4,7.2 0,1.8 -0.7,3.4 -1.8,4.7 l 0.3,0.3 h 0.9 l 5.7,5.6 -1.7,1.7 -5.7,-5.6 V 15.3 L 14.3,15 C 13,16.1 11.3,16.7 9.5,16.7 5.3,16.7 2,13.5 2,9.5 2,5.5 5.3,2.3 9.4,2.3 m 0,2.2 c -2.9,0 -5.1,2.2 -5.1,5 0,2.8 2.3,5 5.1,5 2.8,0 5.1,-2.2 5.1,-5 0,-2.8 -2.2,-5 -5.1,-5 z"/></svg>\');--ez-combo-box--space--medium:var(--space--medium, 12px);--ez-combo-box--space--small:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--ez-combo-box--width)}.list-container{position:relative;width:100%}.options-list{box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--ez-combo-box--background-color--xlight);padding:var(--ez-combo-box--space--small);border-radius:var(--ez-combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);scroll-behavior:smooth;max-height:calc(4*var(--ez-combo-box__list-height) + 2*var(--ez-combo-box--space--small));overflow:auto}.item{text-align:left;display:flex;justify-content:space-between;align-items:center;border-radius:var(--ez-combo-box--border-radius-small);padding:0 var(--ez-combo-box--space--small);list-style-type:none;min-height:var(--ez-combo-box__list-height)}.item--label{text-align:left;flex-basis:85%;flex-grow:1;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item--value{text-align:right;flex-basis:15%;flex-grow:0;color:var(--ez-combo-box__list-text--primary);font-weight:var(--ez-combo-box--font-weight--large);font-family:var(--ez-combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}li:hover{background-color:var(--ez-combo-box--background-medium)}.preselected{background-color:var(--background--medium)}.btn-open-options{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-options:disabled{cursor:unset}.btn-open-options::after{content:\'\';display:flex;background-color:var(--ez-combo-box__btn-options--background-color);width:16px;height:16px;-webkit-mask-image:var(--ez-combo-box__drop-down-image);mask-image:var(--ez-combo-box__drop-down-image)}.btn-open-options:disabled:after{background-color:var(--ez-combo-box__btn-options-disabled--background-color)}.btn-open-options:enabled:hover::after{background-color:var(--ez-combo-box__btn-options-hover--background-color)}.btn-open-search{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-search:disabled{cursor:unset}.btn-open-search::after{content:\'\';display:flex;background-color:var(--ez-combo-box__btn-search--background-color);width:22px;height:22px;-webkit-mask-image:var(--ez-combo-box__search-image);mask-image:var(--ez-combo-box__search-image)}.btn-open-search:disabled:after{background-color:var(--ez-combo-box__btn-search-disabled--background-color)}.btn-open-search:enabled:hover::after{background-color:var(--ez-combo-box__btn-search-hover--background-color)}';export{n as ez_combo_box}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,h as t,H as i,g as e}from"./p-7c101b34.js";import{M as h,T as r,N as a}from"./p-
|
|
1
|
+
import{r as s,h as t,H as i,g as e}from"./p-7c101b34.js";import{M as h,T as r,N as a}from"./p-96c336db.js";import{C as o}from"./p-8b099482.js";import{g as n}from"./p-f87c7082.js";let l=class{constructor(t){s(this,t),this.enabled=!0,this.showSeconds=!1}prepareMask(){this.showSeconds?null==this._maskFormatter?this._maskFormatter=new h("##:##:##"):this._maskFormatter.mask="##:##:##":null==this._maskFormatter?this._maskFormatter=new h("##:##"):this._maskFormatter.mask="##:##"}onValueChanged(){NaN===this.value&&(this.value=void 0,this.handleFocusout())}async setFocus(){this._inputElem.focus()}async setBlur(){this._inputElem.blur()}handleFocusout(){this.errorMessage="",this.prepareValue(this.viewValue),r.validateTime(this.viewValue,this.showSeconds)||(this.clearField(),this.errorMessage="Favor inserir um horário válido.")}prepareValue(s){try{this.viewValue=r.prepareValue(s,this.showSeconds)}catch(s){this.clearField(),this.errorMessage=s.message}}clearField(){this.viewValue=this.value=void 0}handleChange(){this.viewValue=this._inputElem.value,this.value=a.stringToNumber(this.viewValue.replace(/\D/g,""))}componentDidLoad(){this.onValueChanged(),o.applyVarsTextInput(this._elem,this._inputElem)}componentWillLoad(){this.prepareMask(),this.value?this.prepareValue(this.value.toString()):this.viewValue&&this.prepareValue(this.viewValue)}render(){return t(i,null,t("ez-text-input",{ref:s=>this._inputElem=s,value:this.viewValue,enabled:this.enabled,label:this.label,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()},errorMessage:this.errorMessage},t("ez-icon",{slot:"leftIcon",href:n("timer-outline")})))}static get assetsDirs(){return["../assets"]}get _elem(){return e(this)}static get watchers(){return{showSeconds:["prepareMask"],value:["onValueChanged"]}}};l.style=":host{display:flex;flex-wrap:wrap;position:relative;width:100%}";export{l as ez_time_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,r as t,f as r,H as n,g as i}from"./p-7c101b34.js";import{U as o,D as s,A as a}from"./p-
|
|
1
|
+
import{h as e,r as t,f as r,H as n,g as i}from"./p-7c101b34.js";import{U as o,D as s,A as a}from"./p-96c336db.js";import{A as l}from"./p-7107d7ef.js";const c=({name:t,label:r})=>e("div",{class:"col col--sd-12 col--tb-3 padding--small"},e("ez-text-input",{label:r,"data-field-name":t,key:t}));function d(t,r,n=!1){return e("div",{class:"col col--sd-12 col--tb-3 padding--small align--middle padding-bottom--large"},e("ez-check",{label:r,mode:n?"switch":"regular","data-field-name":t,key:t}))}function u(t,r,n,i){return e("div",{class:"col col--sd-12 col--tb-3 padding--small"},e("ez-number-input",{label:r,precision:n,prettyPrecision:i,"data-field-name":t,key:t}))}const f=new Map;f.set(o.LONGTEXT,(({name:t,label:r})=>e("div",{class:"col col--sd-12 padding--small",key:t},e("ez-text-area",{label:r,"data-field-name":t})))),f.set(o.CHECKBOX,(e=>d(e.name,e.label,!1))),f.set(o.SWITCH,(e=>d(e.name,e.label,!0))),f.set(o.OPTIONSELECTOR,(({name:t,label:r},n)=>{const i=null==n?void 0:n.options;let o;if("string"==typeof i){const e=JSON.parse(i);o=Object.keys(e).map((t=>({value:t,label:e[t]})))}else o=i;return e("div",{class:"col col--sd-12 col--tb-3 padding--small"},e("ez-combo-box",{label:r,"data-field-name":t,key:t,options:o}))})),f.set(o.SEARCH,(({name:t,label:r})=>e("div",{class:"col col--sd-12 col--tb-3 padding--small"},e("ez-search",{label:r,optionLoader:()=>{},"data-field-name":t,key:t})))),f.set(o.FILE,(({name:t,label:r})=>e("div",{class:"col col--sd-12 padding--small"},e("ez-upload",{label:r,urlUpload:"",requestHeaders:"",maxFiles:10,"data-field-name":t,key:t})))),f.set(o.DATE,(({name:t,label:r})=>e("div",{class:"col col--sd-12 col--tb-3 padding--small"},e("ez-date-input",{label:r,"data-field-name":t,key:t})))),f.set(o.DATETIME,(({name:t,label:r})=>e("div",{class:"col col--sd-12 col--tb-3 padding--small"},e("ez-date-time-input",{label:r,"data-field-name":t,key:t})))),f.set(o.DECIMALNUMBER,(({name:e,label:t},r)=>{const n=Number((null==r?void 0:r.precision)||2);return u(e,t,n,Number((null==r?void 0:r.prettyPrecision)||n))})),f.set(o.INTEGERNUMBER,(({name:e,label:t})=>u(e,t,0,0)));const h=e=>{const t=e.descriptor,r=Object.assign({},e.config);let n,i;return t&&(n=f.get(t.userInterface),r.label||(r.label=t.label),r.name||(r.name=t.name),void 0===r.required&&(r.required=t.required),i=t.properties),r.required&&(r.label=`* ${r.label} (obrigatório)`),n||(n=c),n(r,i)},b=({source:t})=>"items"in t?e("ez-collapsible-box",{label:t.label},t.items.map((e=>h(e)))):h(t),m=({store:t,source:r})=>e("div",{class:"box__container"},r.items.map((r=>e(b,{store:t,source:r}))));class p{constructor(){this._sheets=new Map,this._requiredFields=[]}getSheet(e){return this._sheets.get(e)}getAllSheets(){return this._sheets}addSheet(e){this._sheets.set(e.name,e),this._requiredFields=this._requiredFields.concat(e.requiredFields)}getRequiredFields(){return this._requiredFields}}function v(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var y="function"==typeof Symbol&&Symbol.observable||"@@observable",w=function(){return Math.random().toString(36).substring(7).split("").join(".")},g={INIT:"@@redux/INIT"+w(),REPLACE:"@@redux/REPLACE"+w(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+w()}};function E(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function O(e,t,r){var n;if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(v(0));if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw new Error(v(1));return r(O)(e,t)}if("function"!=typeof e)throw new Error(v(2));var i=e,o=t,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function d(){if(l)throw new Error(v(3));return o}function u(e){if("function"!=typeof e)throw new Error(v(4));if(l)throw new Error(v(5));var t=!0;return c(),a.push(e),function(){if(t){if(l)throw new Error(v(6));t=!1,c();var r=a.indexOf(e);a.splice(r,1),s=null}}}function f(e){if(!E(e))throw new Error(v(7));if(void 0===e.type)throw new Error(v(8));if(l)throw new Error(v(9));try{l=!0,o=i(o,e)}finally{l=!1}for(var t=s=a,r=0;r<t.length;r++)(0,t[r])();return e}function h(e){if("function"!=typeof e)throw new Error(v(10));i=e,f({type:g.REPLACE})}function b(){var e,t=u;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(v(11));function r(){e.next&&e.next(d())}return r(),{unsubscribe:t(r)}}})[y]=function(){return this},e}return f({type:g.INIT}),(n={dispatch:f,subscribe:u,getState:d,replaceReducer:h})[y]=b,n}const A={};function z(e=A,t){switch(t.type){case x.METADATA_LOADED:return Object.assign(Object.assign({},e),{formMetadata:t.payload});case x.CHANGE_TAB:return Object.assign(Object.assign({},e),{currentSheet:t.payload});default:return e}}function j(e){return e.formMetadata}var x;!function(e){e.METADATA_LOADED="FORM/METADATA_LOADED",e.CHANGE_TAB="FORM/CHANGE_TAB"}(x||(x={}));class N{constructor(e){this._fields=new Map,this._dataUnit=e,this._dataUnit.subscribe((()=>{var e;null===(e=this._fields)||void 0===e||e.forEach((e=>{this.updateValue(e.fieldName,e.field)}))}))}bind(e){e.forEach((e=>{const t=e.dataset.fieldName;this.updateBind(t,e),this.updateValue(t,e)}))}updateValue(e,t){t.value=this._dataUnit.getFieldValue(e)}updateBind(e,t){const r=this._fields.get(e);r&&r.destroy(),this._fields.set(e,M.create(e,t,((e,t)=>this.setFieldValue(e,t))))}setFieldValue(e,t){0===this._dataUnit.records.length&&this._dataUnit.addRecord(),this._dataUnit.setFieldValue(e,t)}}class M{destroy(){this.field.removeEventListener(this.eventName,this.eventListener)}static create(e,t,r){const n=new M;return n.fieldName=e,n.field=t,n.eventListener=t=>{r(e,t.detail)},n.eventName="ezChange",n.field.addEventListener(n.eventName,n.eventListener),n}}let k=class{constructor(e){t(this,e)}submit(){return Promise.resolve()}cancel(){return Promise.resolve()}validate(){return new Promise(((e,t)=>{const r=j(this._store.getState()),n=this._staticFields.filter((e=>e.dataset.required)).map((e=>e.dataset.fieldName)).concat(r.getRequiredFields()),i=this.dataUnit.records;for(let e=0;e<i.length;e++)if(!this.validateRequired(n,i[e])){t();break}e()}))}validateRequired(e,t){const r=[];e.forEach((e=>{const n=t[e],i=this._element.querySelector(`[data-field-name=${e}]`);null==n||""===n?(r.push(e),i.errorMessage="Essa informação é obrigatória"):i.errorMessage=""}));const n=0===r.length;return n||l.info("Há pelo menos um campo obrigatório não preenchido."),n}getDynamicContent(){var t;const r=j(this._store.getState());if(!r)return null;const n=(i=null===(t=this._store)||void 0===t?void 0:t.getState()).currentSheet?i.formMetadata.getSheet(i.currentSheet):Array.from(i.formMetadata.getAllSheets().values())[0];var i;if(!n)return null;const o=Array.from(r.getAllSheets().values()),s=[];return o.length>1&&s.push(e("ez-tabselector",{onEzChange:e=>this._store.dispatch(function(e){return{type:x.CHANGE_TAB,payload:e}}(e.detail)),selectedTab:n.name},o.map((t=>e("ez-tab",{tabKey:t.name,label:t.label}))))),s.push(e(m,{store:this._store,source:n})),s}processMetadata(){if(!this.isStatic()){const e=this.config&&this.config.length>0?((e,t)=>{const r=new Map,n=[];e.forEach((e=>{if(!1!==e.visible){const i=e.tab||"Geral",o=t.getField(e.name);if(o){r.has(i)||r.set(i,new Map),(void 0===e.required?o.required:e.required)&&n.push(e.name);const t=r.get(i),s={config:e,descriptor:o},a=e.group;if(a){const e=`group::${a}`;t.has(e)?t.get(e).items.push(s):t.set(e,{label:a,items:[s]})}else t.set(e.name,s)}}}));const i=new p;return r.forEach(((e,t)=>{i.addSheet({label:t,name:t,items:Array.from(e.values()),requiredFields:n})})),i})(this.config,this.dataUnit):(()=>{var e;const t=this.dataUnit.metadata,r=new p;if(t){const n=null===(e=t.fields)||void 0===e?void 0:e.filter((e=>!1!==e.visible));r.addSheet({label:t.label,name:t.name,items:n.map((e=>({descriptor:e}))),requiredFields:n.filter((e=>e.required)).map((e=>e.name))})}return r})();this._store.dispatch({type:x.METADATA_LOADED,payload:e})}}isStatic(){var e;return(null===(e=this._staticFields)||void 0===e?void 0:e.length)>0}componentWillLoad(){void 0===this.dataUnit&&(this.dataUnit=new s("ez-form")),this.dataUnit.subscribe((e=>{e.type===a.METADATA_LOADED&&this.processMetadata()})),this._dataBinder=new N(this.dataUnit),this._store=O(z),this._store.subscribe((()=>r(this))),this._staticFields=Array.from(this._element.querySelectorAll("[data-field-name]")),this.processMetadata()}componentDidRender(){this._dataBinder.bind(Array.from(this._element.querySelectorAll("[data-field-name]")))}render(){return e(n,null,this.isStatic()?null:this.getDynamicContent())}get _element(){return i(this)}};k.style="ez-form{display:flex;flex-direction:column;width:100%}";export{k as ez_form}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e,n){return t(n={path:e,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}const n=/^([+-])?(\d+).?(\d*)[eE]([-+]?\d+)$/;class i{}i.stringToNumber=t=>{if(""===t||null==t)return NaN;if(t){var e="-"===(t=t.toString()).charAt(0);if(""===(t=n.test(t)?t.replace(/^-/g,""):t.replace(/[^\d.,]/g,"")))return Number(NaN);var i=t.indexOf(","),r=t.indexOf(".");r>i?t=t.replace(",",""):r<i&&(t=t.replace(/\./g,"@").replace(",",".").replace(/@/g,"")),e&&(t="-"+t)}return Number(t)},i.format=(t,e,n=NaN)=>{if(""===t||void 0===t||"NaN"===t)return NaN.toString();let r=i.stringToNumber(t);if(NaN===r)return NaN.toString();if(e<0||Math.abs(Math.round(1*e)/1)!==e)return i.changeFormat(r.toString());let s,o=0;o=NaN===n||Math.abs(Math.round(1*n)/1)!==n?e:n,s=(Math.round(r*Math.pow(10,e))/Math.pow(10,e)).toLocaleString("pt-br",{minimumFractionDigits:e});const u=e-o;if(u>0)for(let t=0;t<u;t++)"0"==s.substring(s.length-1)&&e>0&&(s=s.substring(0,s.length-1));return"."!=s.substring(s.length-1)&&","!=s.substring(s.length-1)||(s=s.substring(0,s.length-1)),s},i.keepOnlyDecimalSeparator=(t,e="pt-BR")=>(e=e.toUpperCase(),t.replace("EN-US"===e?/\,/g:/\./g,"")),i.changeFormat=t=>t.replace(/\./g,"_").replace(/\,/g,".").replace(/\_/g,",");class r{constructor(t){this._mask="",this._maskChars=new Array,this.placeholder=" ",this.mask=t}set mask(t){this._mask=t,this.updateInternalMask()}get mask(){return this._mask}format(t){let e="";const n=[0];let i=0;const r=this._maskChars.length;for(;i<r;)e=this._maskChars[i].append(e,t,n),i++;return e}updateInternalMask(){if(this._maskChars.length=0,null!=this.mask){let t=0;const e=this.mask.length;for(;t<e;){let n=this.mask.charAt(t);switch(n){case r.DIGIT_KEY:this._maskChars.push(new r.DigitMaskCharacter(this,n));break;case r.LITERAL_KEY:++t<e&&(n=this.mask.charAt(t),this._maskChars.push(new r.LiteralCharacter(this,n)));break;case r.UPPERCASE_KEY:this._maskChars.push(new r.UpperCaseCharacter(this,n));break;case r.LOWERCASE_KEY:this._maskChars.push(new r.LowerCaseCharacter(this,n));break;case r.ALPHA_NUMERIC_KEY:this._maskChars.push(new r.AlphaNumericCharacter(this,n));break;case r.CHARACTER_KEY:this._maskChars.push(new r.CharCharacter(this,n));break;case r.ANYTHING_KEY:this._maskChars.push(new r.MaskCharacter(this,n));break;default:this._maskChars.push(new r.LiteralCharacter(this,n))}t++}}}}r.DIGIT_KEY="#",r.LITERAL_KEY="'",r.UPPERCASE_KEY="U",r.LOWERCASE_KEY="L",r.ALPHA_NUMERIC_KEY="A",r.CHARACTER_KEY="?",r.ANYTHING_KEY="*",r.MaskCharacter=class{constructor(t,e){this.maskFormatter=t,this.type=e}isLiteral(){return!1}isValidCharacter(t){return this.isLiteral()?this.getChar(t)==t:(t=this.getChar(t),!0)}getChar(t){return t}append(t,e,n){const i=n[0]<e.length?e.charAt(n[0]):"";if(this.isLiteral()){const e=this.getChar(i);t+=e,e===i&&(n[0]=n[0]+1)}else if(n[0]>=e.length)t+=this.maskFormatter.placeholder,n[0]=n[0]+1;else{if(!this.isValidCharacter(i))throw new Error(`Valor inválido: "${i}". Na posição ${n[0]+1} espera-se ${this.getFormatMessage()}.`);t+=this.getChar(i),n[0]=n[0]+1}return t}getFormatMessage(){let t;switch(this.type){case r.UPPERCASE_KEY:case r.LOWERCASE_KEY:case r.CHARACTER_KEY:t="uma letra";break;case r.DIGIT_KEY:t="um número";break;case r.ALPHA_NUMERIC_KEY:t="uma letra ou um número";break;default:t=""}return t}},r.LiteralCharacter=class extends r.MaskCharacter{constructor(t,e){super(t,e),this._fixedChar=e}isLiteral(){return!0}getChar(t){return this._fixedChar}},r.DigitMaskCharacter=class extends r.MaskCharacter{isValidCharacter(t){return this.isDigit(t)&&super.isValidCharacter(t)}isDigit(t){return t>="0"&&t<="9"}},r.UpperCaseCharacter=class extends r.MaskCharacter{isValidCharacter(t){return/[a-z]/i.test(t)&&super.isValidCharacter(t)}getChar(t){return t.toUpperCase()}},r.LowerCaseCharacter=class extends r.MaskCharacter{isValidCharacter(t){return/[a-z]/i.test(t)&&super.isValidCharacter(t)}getChar(t){return t.toLocaleLowerCase()}},r.AlphaNumericCharacter=class extends r.MaskCharacter{isValidCharacter(t){return/[a-z0-9]/i.test(t)&&super.isValidCharacter(t)}},r.CharCharacter=class extends r.MaskCharacter{isValidCharacter(t){return/[a-z]/i.test(t)&&super.isValidCharacter(t)}};class s{static prepareValue(t,e){if(t&&t.length>0&&"NaN"!=t){let n=t.replace(/:/g,"");if(e){if(this._maskFormatter.mask="##:##:##",n.length<6)for(;n.length<6;)n="0".concat(n)}else if(this._maskFormatter.mask="##:##",n.length<4)for(;n.length<4;)n="0".concat(n);if(this._maskFormatter)try{return this._maskFormatter.format(n)}catch(t){throw new Error(t.message)}}return""}static validateTime(t,e){let n=!0;if(t){let i=t.replace(/:/g,"");e?(["1","2","0"].includes(i[0])||(n=!1),["0","1","2","3","4","5"].includes(i[2])||(n=!1),["0","1","2","3","4","5"].includes(i[4])||(n=!1),"2"!=i[0]||["0","1","2","3"].includes(i[1])||(n=!1)):(["1","2","0"].includes(i[0])||(n=!1),["0","1","2","3","4","5"].includes(i[2])||(n=!1),"2"!=i[0]||["0","1","2","3"].includes(i[1])||(n=!1))}else n=!1;return n}}var o,u,a;s._maskFormatter=new r("##:##"),function(t){t[t.GET=0]="GET",t[t.PUT=1]="PUT",t[t.POST=2]="POST",t[t.DELETE=3]="DELETE"}(o||(o={})),function(t){t.NUMBER="NUMBER",t.DATE="DATE",t.TEXT="TEXT",t.BOOLEAN="BOOLEAN",t.OBJECT="OBJECT"}(u||(u={}));class c{constructor(t,e){this._type=t,this._payload=e}get type(){return this._type}get payload(){return this._payload}}!function(t){t.LOADING_METADATA="loadingMetadata",t.METADATA_LOADED="metadataLoaded",t.LOADING_DATA="loadingData",t.DATA_LOADED="dataLoaded",t.SAVING_DATA="savingData",t.DATA_SAVED="dataSaved",t.RECORDS_REMOVED="recordsRemoved",t.RECORDS_ADDED="recordsAdded",t.RECORDS_COPIED="recordsCopied",t.DATA_CHANGED="dataChanged",t.EDITION_CANCELED="editionCanceled",t.CHANGE_UNDONE="changeUndone",t.CHANGE_REDONE="changeRedone",t.SELECTION_CHANGED="selectionChanged",t.NEXT_SELECTED="nextSelected",t.PREVIOUS_SELECTED="previousSelected",t.STATE_CHANGED="stateChanged"}(a||(a={}));class h{constructor(t){this._past=[],this._future=[],this._present={},this._nonHist={},this._histClean=!1,this._reducers=t}process(t){const e=this._present;let n=!1;this._histClean=!1,this._reducers.forEach((e=>{const i=e.sliceName,r=this.isHistoric(i),s=this.getSlice(i,r),o=e.reduce(this,s,t);o!==s&&(this.updateSlice(i,o,r),n||(n=r))})),n&&!this._histClean&&(this._past.push(e),this._future=[],document.dispatchEvent(new CustomEvent("undoableAction",{detail:this})))}select(t,e){const n=this.isHistoric(t);return e(this.getSlice(t,n))}isHistoric(t){return t.startsWith("hist::")}updateSlice(t,e,n){n?(this._present=Object.assign(Object.assign({},this._present),{[t]:e}),void 0===e&&delete this._present[t]):(this._nonHist=Object.assign(Object.assign({},this._nonHist),{[t]:e}),void 0===e&&delete this._nonHist[t])}getSlice(t,e){return e?this._present[t]:this._nonHist[t]}canUndo(){return this._past.length>0}canRedo(){return this._future.length>0}undo(){this.canUndo()&&(this._future.push(this._present),this._present=this._past.pop())}redo(){this.canRedo()&&(this._past.push(this._present),this._present=this._future.pop())}clearUndo(){this._histClean=!0,this._past=[],this._future=[]}persist(){}}const l=new class{constructor(){this.sliceName=""}reduce(t,e,n){switch(n.type){case a.DATA_SAVED:case a.EDITION_CANCELED:t.clearUndo();break;case a.CHANGE_UNDONE:t.undo();break;case a.CHANGE_REDONE:t.redo()}}},f=new class{constructor(){this.sliceName="unitMetadata"}reduce(t,e,n){return n.type===a.METADATA_LOADED?n.payload:e}},d=t=>t.select(f.sliceName,(t=>t)),v=new class{constructor(){this.sliceName="hist::removedRecords"}reduce(t,e,n){switch(n.type){case a.RECORDS_REMOVED:return(e||[]).concat(n.payload);case a.EDITION_CANCELED:case a.DATA_SAVED:return}return e}},p=t=>t.select(v.sliceName,(t=>t)),m=new class{constructor(){this.sliceName="records"}reduce(t,e,n){switch(n.type){case a.DATA_LOADED:return n.payload;case a.DATA_SAVED:const e=new Map,i=y(t);if(i){const n=p(t)||[];i.forEach((t=>{n.includes(t.__record__id__)||e.set(t.__record__id__,t)}))}return n.payload.records.forEach((t=>{const n=t.__old__id__||t.__record__id__,i=Object.assign({},t);delete i.__old__id__,e.set(n,i)})),Array.from(e.values())}return e}},y=t=>t.select(m.sliceName,(t=>t)),b=new class{constructor(){this.sliceName="hist::addedRecords"}reduce(t,e,n){switch(n.type){case a.RECORDS_ADDED:case a.RECORDS_COPIED:return(e||[]).concat(n.payload);case a.DATA_SAVED:case a.EDITION_CANCELED:return}return e}},w=t=>t.select(b.sliceName,(t=>t)),E=(t,e)=>{let n=(w(t)||[]).length;return e.map((t=>Object.assign(Object.assign({},t),{__record__id__:"NEW_"+n++})))},g=new class{constructor(){this.sliceName="hist::changes"}reduce(t,e,n){switch(n.type){case a.DATA_CHANGED:const i=n.payload.records||j(t);if(i){const t=new Map(e);return i.forEach((e=>{const i=Object.assign(Object.assign({},t.get(e)),n.payload);delete i.records,t.set(e,i)})),t}return e;case a.DATA_SAVED:case a.EDITION_CANCELED:return}return e}},O=t=>t.select(g.sliceName,(t=>t)),T=new class{constructor(){this.sliceName="currentRecords"}reduce(t,e,n){let i=y(t);const r=w(t);if(!i&&!r)return;r&&(i=(i||[]).concat(r));const s=p(t);s&&(i=i.filter((t=>!s.includes(t.__record__id__))));const o=O(t);return new Map(i.map((t=>{const e=t.__record__id__;return[e,Object.assign(Object.assign({},t),null==o?void 0:o.get(e))]})))}},D=t=>t.select(T.sliceName,(t=>t)),S=new class{constructor(){this.sliceName="hist::selection"}reduce(t,e,n){switch(n.type){case a.RECORDS_ADDED:case a.RECORDS_COPIED:return n.payload.map((t=>t.__record__id__));case a.DATA_SAVED:return function(t,e){const n=j(t);if(n){const t=[];return n.forEach((n=>{const i=e.find((t=>t.__old__id__===n));t.push(i?i.__record__id__:n)})),t}return n}(t,n.payload.records);case a.RECORDS_REMOVED:const i=n.payload;return e&&i?e.filter((t=>!i.includes(t))):e;case a.NEXT_SELECTED:case a.PREVIOUS_SELECTED:const r=D(t);if(r&&r.size>0){let t;if(t=e&&0!==e.length?N(e[0],r)+(n.type===a.PREVIOUS_SELECTED?-1:1):n.type===a.PREVIOUS_SELECTED?0:Math.min(1,r.size),t<r.size&&t>=0)return[Array.from(r.values())[t].__record__id__]}return;case a.SELECTION_CHANGED:const{type:s,selection:o}=n.payload;if(o&&"index"===s){const e=D(t);if(e){const t=Array.from(e.values()),n=[];return o.forEach((i=>{i>0&&i<e.size&&n.push(t[i].__record__id__)})),n}}return o}return e}},j=t=>{let e=t.select(S.sliceName,(t=>t));const n=Array.from((D(t)||new Map).keys());return e&&(e=e.filter((t=>n.includes(t)))),(!e||0===e.length)&&n&&n.length>0?[n[0]]:e};function N(t,e){return Array.from(e.keys()).indexOf(t)}var x,A,I,k,_,F,M=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{a(i.next(t))}catch(t){s(t)}}function u(t){try{a(i.throw(t))}catch(t){s(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,u)}a((i=i.apply(t,e||[])).next())}))};class U{constructor(t){this._name=t,this._stateManager=new h([l,f,m,v,b,S,g,T]),this._observers=[],this._filterProviders=[],this._sortingProvider=void 0,this._interceptors=[]}get name(){return this._name}validateAndTypeValue(t,e){const n=this.getField(t);return n?((t,e)=>{if(null==e)return e;switch(t){case u.NUMBER:return""===e||isNaN(e)?null:Number(e);case u.OBJECT:return"string"==typeof e?JSON.parse(e):e;case u.BOOLEAN:return Boolean(e);case u.DATE:return new Date(e.toString());default:return e}})(n.dataType,e):e}getFilters(){let t;return this._filterProviders.forEach((e=>{const n=e.getFilter(this.name);n&&(t=(t||[]).concat(n))})),t}getSort(){return this._sortingProvider?this._sortingProvider.getSort(this._name):void 0}loadMetadata(){return M(this,void 0,void 0,(function*(){return this.dispatchAction(a.LOADING_METADATA),new Promise(((t,e)=>{this.metadataLoader&&this.metadataLoader(this._name).then((e=>{this.metadata=e,t(this.metadata)})).catch((t=>e(t)))}))}))}loadData(){return M(this,void 0,void 0,(function*(){return this.dispatchAction(a.LOADING_DATA),new Promise(((t,e)=>{if(this.dataLoader){const n=this.getSort(),i=this.getFilters();this.dataLoader(this._name,n,i).then((e=>{this.records=e,t(this.records)})).catch((t=>e(t)))}}))}))}saveData(){return M(this,void 0,void 0,(function*(){const t=((t,e)=>{const n=[],i=O(e),r=y(e);null==r||r.forEach((e=>{if(i){const r=i.get(e.__record__id__);r&&n.push(new V(t,e,r,x.UPDATE))}}));const s=w(e);s&&s.forEach((e=>{n.push(new V(t,e,null==i?void 0:i.get(e.__record__id__),x.INSERT))}));const o=p(e),u={};return null==r||r.forEach((t=>u[t.__record__id__]=t)),o&&o.forEach((e=>{n.push(new V(t,u[e],void 0,x.DELETE))})),n})(this._name,this._stateManager);return t.length>0?(this.dispatchAction(a.SAVING_DATA),new Promise(((e,n)=>{this.saveLoader&&this.saveLoader(this._name,t).then((e=>this.dispatchAction(a.DATA_SAVED,{changes:t,records:e}))).catch((t=>n(t)))}))):Promise.resolve()}))}addInterceptor(t){this._interceptors.push(t)}addFilterProvider(t){this._filterProviders.push(t)}set sortingProvider(t){this._sortingProvider=t}set metadata(t){this.dispatchAction(a.METADATA_LOADED,t)}get metadata(){return d(this._stateManager)}set records(t){this.dispatchAction(a.DATA_LOADED,t)}get records(){const t=D(this._stateManager);return t?Array.from(t.values()):[]}getField(t){return((t,e)=>{const n=d(this._stateManager);return n?n.fields.find((t=>t.name===e)):void 0})(0,t)}addRecord(){this.dispatchAction(a.RECORDS_ADDED,E(this._stateManager,[{}]))}copySelected(){const t=this.getSelectedRecords();t&&this.dispatchAction(a.RECORDS_COPIED,E(this._stateManager,t))}removeSelectedRecords(){const t=j(this._stateManager);t&&this.dispatchAction(a.RECORDS_REMOVED,t)}getFieldValue(t){return((t,e)=>{const n=j(t);if(n&&n.length>0){const i=D(t);if(i){const t=i.get(n[0]);return t?t[e]:void 0}}})(this._stateManager,t)}setFieldValue(t,e,n){const i=this.validateAndTypeValue(t,e);this.getFieldValue(t)!==i&&this.dispatchAction(a.DATA_CHANGED,{[t]:i,records:n})}getSelection(){return j(this._stateManager)}setSelection(t){this.dispatchAction(a.SELECTION_CHANGED,{type:"id",selection:t})}setSelectionByIndex(t){this.dispatchAction(a.SELECTION_CHANGED,{type:"index",selection:t})}getSelectedRecords(){const t=this.getSelection();if(t){const e=this.records;return null==e?void 0:e.filter((e=>t.includes(e.__record__id__)))}}nextRecord(){this.dispatchAction(a.NEXT_SELECTED)}previousRecord(){this.dispatchAction(a.PREVIOUS_SELECTED)}cancelEdition(){this.dispatchAction(a.EDITION_CANCELED)}isDirty(){return void 0!==w(t=this._stateManager)||void 0!==p(t)||void 0!==O(t);var t}hasNext(){return(t=>{const e=D(t);if(e){const n=t.select(S.sliceName,(t=>t));return n&&0!==n.length?e.size>N(n[0],e)+1:e.size>0}return!1})(this._stateManager)}hasPrevious(){return(t=>{const e=D(t);if(e){const n=t.select(S.sliceName,(t=>t));return!(!n||0===n.length)&&N(n[0],e)>0}return!1})(this._stateManager)}canUndo(){return this._stateManager.canUndo()}canRedo(){return this._stateManager.canRedo()}undo(){this.dispatchAction(a.CHANGE_UNDONE)}redo(){this.dispatchAction(a.CHANGE_REDONE)}dispatchAction(t,e){var n;let i=new c(t,e);null===(n=this._interceptors)||void 0===n||n.forEach((t=>{i&&(i=t.interceptAction(i))})),i&&(this._stateManager.process(i),this._observers.forEach((t=>t(i))))}subscribe(t){this._observers.push(t)}unsubscribe(t){this._observers=this._observers.filter((e=>e!==t))}}!function(t){t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"}(x||(x={}));class V{constructor(t,e,n,i){this.dataUnit=t,this.record=e,this.updatingFields=n,this._operation=i}get operation(){return this._operation.toString()}isInsert(){return this._operation===x.INSERT}isDelete(){return this._operation===x.DELETE}isUpdate(){return this._operation===x.UPDATE}}!function(t){t.ASC="ASC",t.DESC="DESC"}(A||(A={})),function(t){t.SEARCHING="SEARCHING",t.REQUIREMENT="REQUIREMENT",t.VISIBILITY="REQUIREMENT"}(I||(I={})),function(t){t.FILE="FILE",t.IMAGE="IMAGE",t.DATE="DATE",t.DATETIME="DATETIME",t.ELAPSEDTIME="ELAPSEDTIME",t.CHECKBOX="CHECKBOX",t.SWITCH="SWITCH",t.OPTIONSELECTOR="OPTIONSELECTOR",t.DECIMALNUMBER="DECIMALNUMBER",t.INTEGERNUMBER="INTEGERNUMBER",t.SEARCH="SEARCH",t.SHORTTEXT="SHORTTEXT",t.PASSWORD="PASSWORD",t.MASKEDTEXT="MASKEDTEXT",t.LONGTEXT="LONGTEXT",t.HTML="HTML"}(k||(k={})),function(t){t.DOM_LOADED="DOM_LOADED",t.PRE_INITIALIZE="PRE_INITIALIZE",t.LOADED="LOADED"}(_||(_={})),function(t){t.APP_LOAD="APP_LOAD"}(F||(F={}));var C=e((function(e,n){var i="undefined"!=typeof self?self:t,r=function(){function t(){this.fetch=!1,this.DOMException=i.DOMException}return t.prototype=i,new t}();!function(t){!function(e){var n="URLSearchParams"in t,i="Symbol"in t&&"iterator"in Symbol,r="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),s="FormData"in t,o="ArrayBuffer"in t;if(o)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(t){return t&&u.indexOf(Object.prototype.toString.call(t))>-1};function c(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function l(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i&&(e[Symbol.iterator]=function(){return e}),e}function f(t){this.map={},t instanceof f?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function v(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function p(t){var e=new FileReader,n=v(e);return e.readAsArrayBuffer(t),n}function m(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:s&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&r&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=m(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||a(t))?this._bodyArrayBuffer=m(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var t,e,n,i=d(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,n=v(e=new FileReader),e.readAsText(t),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),i=0;i<e.length;i++)n[i]=String.fromCharCode(e[i]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(E)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(t,e){t=c(t),e=h(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},f.prototype.delete=function(t){delete this.map[c(t)]},f.prototype.get=function(t){return t=c(t),this.has(t)?this.map[t]:null},f.prototype.has=function(t){return this.map.hasOwnProperty(c(t))},f.prototype.set=function(t,e){this.map[c(t)]=h(e)},f.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},f.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),l(t)},f.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),l(t)},f.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),l(t)},i&&(f.prototype[Symbol.iterator]=f.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(t,e){var n,i,r=(e=e||{}).body;if(t instanceof w){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new f(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new f(e.headers)),this.method=(i=(n=e.method||this.method||"GET").toUpperCase(),b.indexOf(i)>-1?i:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function E(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(r))}})),e}function g(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new f(e.headers),this.url=e.url||"",this._initBody(t)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},y.call(w.prototype),y.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},g.error=function(){var t=new g(null,{status:0,statusText:""});return t.type="error",t};var O=[301,302,303,307,308];g.redirect=function(t,e){if(-1===O.indexOf(e))throw new RangeError("Invalid status code");return new g(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function T(t,n){return new Promise((function(i,s){var o=new w(t,n);if(o.signal&&o.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function a(){u.abort()}u.onload=function(){var t,e,n={status:u.status,statusText:u.statusText,headers:(t=u.getAllResponseHeaders()||"",e=new f,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var n=t.split(":"),i=n.shift().trim();if(i){var r=n.join(":").trim();e.append(i,r)}})),e)};n.url="responseURL"in u?u.responseURL:n.headers.get("X-Request-URL"),i(new g("response"in u?u.response:u.responseText,n))},u.onerror=function(){s(new TypeError("Network request failed"))},u.ontimeout=function(){s(new TypeError("Network request failed"))},u.onabort=function(){s(new e.DOMException("Aborted","AbortError"))},u.open(o.method,o.url,!0),"include"===o.credentials?u.withCredentials=!0:"omit"===o.credentials&&(u.withCredentials=!1),"responseType"in u&&r&&(u.responseType="blob"),o.headers.forEach((function(t,e){u.setRequestHeader(e,t)})),o.signal&&(o.signal.addEventListener("abort",a),u.onreadystatechange=function(){4===u.readyState&&o.signal.removeEventListener("abort",a)}),u.send(void 0===o._bodyInit?null:o._bodyInit)}))}T.polyfill=!0,t.fetch||(t.fetch=T,t.Headers=f,t.Request=w,t.Response=g),e.Headers=f,e.Request=w,e.Response=g,e.fetch=T,Object.defineProperty(e,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var s=r;(n=s.fetch).default=s.fetch,n.fetch=s.fetch,n.Headers=s.Headers,n.Request=s.Request,n.Response=s.Response,e.exports=n})),R=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isObjectLike=function(t){return"object"==typeof t&&null!==t}})),L=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.invariant=function(t,e){if(!Boolean(t))throw new Error(null!=e?e:"Unexpected invariant triggered.")}})),$=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getLocation=function(t,e){let i=0,r=1;for(const s of t.body.matchAll(n)){if("number"==typeof s.index||(0,L.invariant)(!1),s.index>=e)break;i=s.index+s[0].length,r+=1}return{line:r,column:e+1-i}};const n=/\r\n|[\n\r]/g})),P=e((function(t,e){function n(t,e){const n=t.locationOffset.column-1,r="".padStart(n)+t.body,s=e.line-1,o=e.line+(t.locationOffset.line-1),u=e.column+(1===e.line?n:0),a=`${t.name}:${o}:${u}\n`,c=r.split(/\r\n|[\n\r]/g),h=c[s];if(h.length>120){const t=Math.floor(u/80),e=u%80,n=[];for(let t=0;t<h.length;t+=80)n.push(h.slice(t,t+80));return a+i([[`${o} |`,n[0]],...n.slice(1,t+1).map((t=>["|",t])),["|","^".padStart(e)],["|",n[t+1]]])}return a+i([[o-1+" |",c[s-1]],[`${o} |`,h],["|","^".padStart(u)],[`${o+1} |`,c[s+1]]])}function i(t){const e=t.filter((([t,e])=>void 0!==e)),n=Math.max(...e.map((([t])=>t.length)));return e.map((([t,e])=>t.padStart(n)+(e?" "+e:""))).join("\n")}Object.defineProperty(e,"__esModule",{value:!0}),e.printLocation=function(t){return n(t.source,(0,$.getLocation)(t.source,t.start))},e.printSourceLocation=n})),q=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphQLError=void 0,e.formatError=function(t){return t.toJSON()},e.printError=function(t){return t.toString()};class n extends Error{constructor(t,...e){var r,s,o;const{nodes:u,source:a,positions:c,path:h,originalError:l,extensions:f}=function(t){const e=t[0];return null==e||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}(e);super(t),this.name="GraphQLError",this.path=null!=h?h:void 0,this.originalError=null!=l?l:void 0,this.nodes=i(Array.isArray(u)?u:u?[u]:void 0);const d=i(null===(r=this.nodes)||void 0===r?void 0:r.map((t=>t.loc)).filter((t=>null!=t)));this.source=null!=a?a:null==d||null===(s=d[0])||void 0===s?void 0:s.source,this.positions=null!=c?c:null==d?void 0:d.map((t=>t.start)),this.locations=c&&a?c.map((t=>(0,$.getLocation)(a,t))):null==d?void 0:d.map((t=>(0,$.getLocation)(t.source,t.start)));const v=(0,R.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 t=this.message;if(this.nodes)for(const e of this.nodes)e.loc&&(t+="\n\n"+(0,P.printLocation)(e.loc));else if(this.source&&this.locations)for(const e of this.locations)t+="\n\n"+(0,P.printSourceLocation)(this.source,e);return t}toJSON(){const t={message:this.message};return null!=this.locations&&(t.locations=this.locations),null!=this.path&&(t.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function i(t){return void 0===t||0===t.length?void 0:t}e.GraphQLError=n})),B=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.syntaxError=function(t,e,n){return new q.GraphQLError(`Syntax Error: ${n}`,void 0,t,[e])}})),H=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Token=e.QueryDocumentKeys=e.OperationTypeNode=e.Location=void 0,e.isNode=function(t){const e=null==t?void 0:t.kind;return"string"==typeof e&&s.has(e)};class n{constructor(t,e,n){this.start=t.start,this.end=e.end,this.startToken=t,this.endToken=e,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}e.Location=n;class i{constructor(t,e,n,i,r,s){this.kind=t,this.start=e,this.end=n,this.line=i,this.column=r,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}e.Token=i;const r={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};e.QueryDocumentKeys=r;const s=new Set(Object.keys(r));let o;e.OperationTypeNode=o,function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"}(o||(e.OperationTypeNode=o={}))})),G=e((function(t,e){let n;Object.defineProperty(e,"__esModule",{value:!0}),e.DirectiveLocation=void 0,e.DirectiveLocation=n,function(t){t.QUERY="QUERY",t.MUTATION="MUTATION",t.SUBSCRIPTION="SUBSCRIPTION",t.FIELD="FIELD",t.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",t.FRAGMENT_SPREAD="FRAGMENT_SPREAD",t.INLINE_FRAGMENT="INLINE_FRAGMENT",t.VARIABLE_DEFINITION="VARIABLE_DEFINITION",t.SCHEMA="SCHEMA",t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.FIELD_DEFINITION="FIELD_DEFINITION",t.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.ENUM_VALUE="ENUM_VALUE",t.INPUT_OBJECT="INPUT_OBJECT",t.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(n||(e.DirectiveLocation=n={}))})),z=e((function(t,e){let n;Object.defineProperty(e,"__esModule",{value:!0}),e.Kind=void 0,e.Kind=n,function(t){t.NAME="Name",t.DOCUMENT="Document",t.OPERATION_DEFINITION="OperationDefinition",t.VARIABLE_DEFINITION="VariableDefinition",t.SELECTION_SET="SelectionSet",t.FIELD="Field",t.ARGUMENT="Argument",t.FRAGMENT_SPREAD="FragmentSpread",t.INLINE_FRAGMENT="InlineFragment",t.FRAGMENT_DEFINITION="FragmentDefinition",t.VARIABLE="Variable",t.INT="IntValue",t.FLOAT="FloatValue",t.STRING="StringValue",t.BOOLEAN="BooleanValue",t.NULL="NullValue",t.ENUM="EnumValue",t.LIST="ListValue",t.OBJECT="ObjectValue",t.OBJECT_FIELD="ObjectField",t.DIRECTIVE="Directive",t.NAMED_TYPE="NamedType",t.LIST_TYPE="ListType",t.NON_NULL_TYPE="NonNullType",t.SCHEMA_DEFINITION="SchemaDefinition",t.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",t.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",t.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",t.FIELD_DEFINITION="FieldDefinition",t.INPUT_VALUE_DEFINITION="InputValueDefinition",t.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",t.UNION_TYPE_DEFINITION="UnionTypeDefinition",t.ENUM_TYPE_DEFINITION="EnumTypeDefinition",t.ENUM_VALUE_DEFINITION="EnumValueDefinition",t.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",t.DIRECTIVE_DEFINITION="DirectiveDefinition",t.SCHEMA_EXTENSION="SchemaExtension",t.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",t.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",t.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",t.UNION_TYPE_EXTENSION="UnionTypeExtension",t.ENUM_TYPE_EXTENSION="EnumTypeExtension",t.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(n||(e.Kind=n={}))})),J=e((function(t,e){function n(t){return t>=48&&t<=57}function i(t){return t>=97&&t<=122||t>=65&&t<=90}Object.defineProperty(e,"__esModule",{value:!0}),e.isDigit=n,e.isLetter=i,e.isNameContinue=function(t){return i(t)||n(t)||95===t},e.isNameStart=function(t){return i(t)||95===t},e.isWhiteSpace=function(t){return 9===t||32===t}})),Q=e((function(t,e){function n(t){let e=0;for(;e<t.length&&(0,J.isWhiteSpace)(t.charCodeAt(e));)++e;return e}Object.defineProperty(e,"__esModule",{value:!0}),e.dedentBlockStringLines=function(t){var e;let i=Number.MAX_SAFE_INTEGER,r=null,s=-1;for(let e=0;e<t.length;++e){var o;const u=t[e],a=n(u);a!==u.length&&(r=null!==(o=r)&&void 0!==o?o:e,s=e,0!==e&&a<i&&(i=a))}return t.map(((t,e)=>0===e?t:t.slice(i))).slice(null!==(e=r)&&void 0!==e?e:0,s+1)},e.isPrintableAsBlockString=function(t){if(""===t)return!0;let e=!0,n=!1,i=!0,r=!1;for(let s=0;s<t.length;++s)switch(t.codePointAt(s)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:case 13:return!1;case 10:if(e&&!r)return!1;r=!0,e=!0,n=!1;break;case 9:case 32:n||(n=e);break;default:i&&(i=n),e=!1}return!e&&(!i||!r)},e.printBlockString=function(t,e){const n=t.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=1===i.length,s=i.length>1&&i.slice(1).every((t=>0===t.length||(0,J.isWhiteSpace)(t.charCodeAt(0)))),o=n.endsWith('\\"""'),u=t.endsWith('"')&&!o,a=t.endsWith("\\"),c=u||a,h=!(null!=e&&e.minimize)&&(!r||t.length>70||c||s||o);let l="";const f=r&&(0,J.isWhiteSpace)(t.charCodeAt(0));return(h&&!f||s)&&(l+="\n"),l+=n,(h||c)&&(l+="\n"),'"""'+l+'"""'}})),X=e((function(t,e){let n;Object.defineProperty(e,"__esModule",{value:!0}),e.TokenKind=void 0,e.TokenKind=n,function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"}(n||(e.TokenKind=n={}))})),K=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Lexer=void 0,e.isPunctuatorTokenKind=function(t){return t===X.TokenKind.BANG||t===X.TokenKind.DOLLAR||t===X.TokenKind.AMP||t===X.TokenKind.PAREN_L||t===X.TokenKind.PAREN_R||t===X.TokenKind.SPREAD||t===X.TokenKind.COLON||t===X.TokenKind.EQUALS||t===X.TokenKind.AT||t===X.TokenKind.BRACKET_L||t===X.TokenKind.BRACKET_R||t===X.TokenKind.BRACE_L||t===X.TokenKind.PIPE||t===X.TokenKind.BRACE_R};class n{constructor(t){const e=new H.Token(X.TokenKind.SOF,0,0,0,0);this.source=t,this.lastToken=e,this.token=e,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==X.TokenKind.EOF)do{if(t.next)t=t.next;else{const e=c(this,t.end);t.next=e,e.prev=t,t=e}}while(t.kind===X.TokenKind.COMMENT);return t}}function i(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function r(t,e){return s(t.charCodeAt(e))&&o(t.charCodeAt(e+1))}function s(t){return t>=55296&&t<=56319}function o(t){return t>=56320&&t<=57343}function u(t,e){const n=t.source.body.codePointAt(e);if(void 0===n)return X.TokenKind.EOF;if(n>=32&&n<=126){const t=String.fromCodePoint(n);return'"'===t?"'\"'":`"${t}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function a(t,e,n,i,r){return new H.Token(e,n,i,t.line,1+n-t.lineStart,r)}function c(t,e){const n=t.source.body,s=n.length;let o=e;for(;o<s;){const e=n.charCodeAt(o);switch(e){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++t.line,t.lineStart=o;continue;case 13:10===n.charCodeAt(o+1)?o+=2:++o,++t.line,t.lineStart=o;continue;case 35:return h(t,o);case 33:return a(t,X.TokenKind.BANG,o,o+1);case 36:return a(t,X.TokenKind.DOLLAR,o,o+1);case 38:return a(t,X.TokenKind.AMP,o,o+1);case 40:return a(t,X.TokenKind.PAREN_L,o,o+1);case 41:return a(t,X.TokenKind.PAREN_R,o,o+1);case 46:if(46===n.charCodeAt(o+1)&&46===n.charCodeAt(o+2))return a(t,X.TokenKind.SPREAD,o,o+3);break;case 58:return a(t,X.TokenKind.COLON,o,o+1);case 61:return a(t,X.TokenKind.EQUALS,o,o+1);case 64:return a(t,X.TokenKind.AT,o,o+1);case 91:return a(t,X.TokenKind.BRACKET_L,o,o+1);case 93:return a(t,X.TokenKind.BRACKET_R,o,o+1);case 123:return a(t,X.TokenKind.BRACE_L,o,o+1);case 124:return a(t,X.TokenKind.PIPE,o,o+1);case 125:return a(t,X.TokenKind.BRACE_R,o,o+1);case 34:return 34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)?w(t,o):d(t,o)}if((0,J.isDigit)(e)||45===e)return l(t,o,e);if((0,J.isNameStart)(e))return E(t,o);throw(0,B.syntaxError)(t.source,o,39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":i(e)||r(n,o)?`Unexpected character: ${u(t,o)}.`:`Invalid character: ${u(t,o)}.`)}return a(t,X.TokenKind.EOF,s,s)}function h(t,e){const n=t.source.body,s=n.length;let o=e+1;for(;o<s;){const t=n.charCodeAt(o);if(10===t||13===t)break;if(i(t))++o;else{if(!r(n,o))break;o+=2}}return a(t,X.TokenKind.COMMENT,e,o,n.slice(e+1,o))}function l(t,e,n){const i=t.source.body;let r=e,s=n,o=!1;if(45===s&&(s=i.charCodeAt(++r)),48===s){if(s=i.charCodeAt(++r),(0,J.isDigit)(s))throw(0,B.syntaxError)(t.source,r,`Invalid number, unexpected digit after 0: ${u(t,r)}.`)}else r=f(t,r,s),s=i.charCodeAt(r);if(46===s&&(o=!0,s=i.charCodeAt(++r),r=f(t,r,s),s=i.charCodeAt(r)),69!==s&&101!==s||(o=!0,s=i.charCodeAt(++r),43!==s&&45!==s||(s=i.charCodeAt(++r)),r=f(t,r,s),s=i.charCodeAt(r)),46===s||(0,J.isNameStart)(s))throw(0,B.syntaxError)(t.source,r,`Invalid number, expected digit but got: ${u(t,r)}.`);return a(t,o?X.TokenKind.FLOAT:X.TokenKind.INT,e,r,i.slice(e,r))}function f(t,e,n){if(!(0,J.isDigit)(n))throw(0,B.syntaxError)(t.source,e,`Invalid number, expected digit but got: ${u(t,e)}.`);const i=t.source.body;let r=e+1;for(;(0,J.isDigit)(i.charCodeAt(r));)++r;return r}function d(t,e){const n=t.source.body,s=n.length;let o=e+1,c=o,h="";for(;o<s;){const s=n.charCodeAt(o);if(34===s)return h+=n.slice(c,o),a(t,X.TokenKind.STRING,e,o+1,h);if(92!==s){if(10===s||13===s)break;if(i(s))++o;else{if(!r(n,o))throw(0,B.syntaxError)(t.source,o,`Invalid character within String: ${u(t,o)}.`);o+=2}}else{h+=n.slice(c,o);const e=117===n.charCodeAt(o+1)?123===n.charCodeAt(o+2)?v(t,o):p(t,o):b(t,o);h+=e.value,o+=e.size,c=o}}throw(0,B.syntaxError)(t.source,o,"Unterminated string.")}function v(t,e){const n=t.source.body;let r=0,s=3;for(;s<12;){const t=n.charCodeAt(e+s++);if(125===t){if(s<5||!i(r))break;return{value:String.fromCodePoint(r),size:s}}if(r=r<<4|y(t),r<0)break}throw(0,B.syntaxError)(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+s)}".`)}function p(t,e){const n=t.source.body,r=m(n,e+2);if(i(r))return{value:String.fromCodePoint(r),size:6};if(s(r)&&92===n.charCodeAt(e+6)&&117===n.charCodeAt(e+7)){const t=m(n,e+8);if(o(t))return{value:String.fromCodePoint(r,t),size:12}}throw(0,B.syntaxError)(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+6)}".`)}function m(t,e){return y(t.charCodeAt(e))<<12|y(t.charCodeAt(e+1))<<8|y(t.charCodeAt(e+2))<<4|y(t.charCodeAt(e+3))}function y(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function b(t,e){const n=t.source.body;switch(n.charCodeAt(e+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw(0,B.syntaxError)(t.source,e,`Invalid character escape sequence: "${n.slice(e,e+2)}".`)}function w(t,e){const n=t.source.body,s=n.length;let o=t.lineStart,c=e+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=a(t,X.TokenKind.BLOCK_STRING,e,c+3,(0,Q.dedentBlockStringLines)(f).join("\n"));return t.line+=f.length-1,t.lineStart=o,i}if(92!==s||34!==n.charCodeAt(c+1)||34!==n.charCodeAt(c+2)||34!==n.charCodeAt(c+3))if(10!==s&&13!==s)if(i(s))++c;else{if(!r(n,c))throw(0,B.syntaxError)(t.source,c,`Invalid character within String: ${u(t,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,B.syntaxError)(t.source,c,"Unterminated string.")}function E(t,e){const n=t.source.body,i=n.length;let r=e+1;for(;r<i;){const t=n.charCodeAt(r);if(!(0,J.isNameContinue)(t))break;++r}return a(t,X.TokenKind.NAME,e,r,n.slice(e,r))}e.Lexer=n})),W=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.devAssert=function(t,e){if(!Boolean(t))throw new Error(e)}})),Y=e((function(t,e){function n(t,e){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return function(t,e){if(null===t)return"null";if(e.includes(t))return"[Circular]";const i=[...e,t];if(function(t){return"function"==typeof t.toJSON}(t)){const e=t.toJSON();if(e!==t)return"string"==typeof e?e:n(e,i)}else if(Array.isArray(t))return function(t,e){if(0===t.length)return"[]";if(e.length>2)return"[Array]";const i=Math.min(10,t.length),r=t.length-i,s=[];for(let r=0;r<i;++r)s.push(n(t[r],e));return 1===r?s.push("... 1 more item"):r>1&&s.push(`... ${r} more items`),"["+s.join(", ")+"]"}(t,i);return function(t,e){const i=Object.entries(t);return 0===i.length?"{}":e.length>2?"["+function(t){const e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if("Object"===e&&"function"==typeof t.constructor){const e=t.constructor.name;if("string"==typeof e&&""!==e)return e}return e}(t)+"]":"{ "+i.map((([t,i])=>t+": "+n(i,e))).join(", ")+" }"}(t,i)}(t,e);default:return String(t)}}Object.defineProperty(e,"__esModule",{value:!0}),e.inspect=function(t){return n(t,[])}})),Z=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.instanceOf=void 0,e.instanceOf=function(t,e){return t instanceof e}})),tt=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Source=void 0,e.isSource=function(t){return(0,Z.instanceOf)(t,n)};class n{constructor(t,e="GraphQL request",n={line:1,column:1}){"string"==typeof t||(0,W.devAssert)(!1,`Body must be a string. Received: ${(0,Y.inspect)(t)}.`),this.body=t,this.name=e,this.locationOffset=n,this.locationOffset.line>0||(0,W.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,W.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}e.Source=n})),et=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Parser=void 0,e.parse=function(t,e){return new n(t,e).parseDocument()},e.parseConstValue=function(t,e){const i=new n(t,e);i.expectToken(X.TokenKind.SOF);const r=i.parseConstValueLiteral();return i.expectToken(X.TokenKind.EOF),r},e.parseType=function(t,e){const i=new n(t,e);i.expectToken(X.TokenKind.SOF);const r=i.parseTypeReference();return i.expectToken(X.TokenKind.EOF),r},e.parseValue=function(t,e){const i=new n(t,e);i.expectToken(X.TokenKind.SOF);const r=i.parseValueLiteral(!1);return i.expectToken(X.TokenKind.EOF),r};class n{constructor(t,e){const n=(0,tt.isSource)(t)?t:new tt.Source(t);this._lexer=new K.Lexer(n),this._options=e}parseName(){const t=this.expectToken(X.TokenKind.NAME);return this.node(t,{kind:z.Kind.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:z.Kind.DOCUMENT,definitions:this.many(X.TokenKind.SOF,this.parseDefinition,X.TokenKind.EOF)})}parseDefinition(){if(this.peek(X.TokenKind.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),e=t?this._lexer.lookahead():this._lexer.token;if(e.kind===X.TokenKind.NAME){switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw(0,B.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(e.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(e)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(X.TokenKind.BRACE_L))return this.node(t,{kind:z.Kind.OPERATION_DEFINITION,operation:H.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const e=this.parseOperationType();let n;return this.peek(X.TokenKind.NAME)&&(n=this.parseName()),this.node(t,{kind:z.Kind.OPERATION_DEFINITION,operation:e,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(X.TokenKind.NAME);switch(t.value){case"query":return H.OperationTypeNode.QUERY;case"mutation":return H.OperationTypeNode.MUTATION;case"subscription":return H.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(X.TokenKind.PAREN_L,this.parseVariableDefinition,X.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:z.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(X.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(X.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(X.TokenKind.DOLLAR),this.node(t,{kind:z.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:z.Kind.SELECTION_SET,selections:this.many(X.TokenKind.BRACE_L,this.parseSelection,X.TokenKind.BRACE_R)})}parseSelection(){return this.peek(X.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,e=this.parseName();let n,i;return this.expectOptionalToken(X.TokenKind.COLON)?(n=e,i=this.parseName()):i=e,this.node(t,{kind:z.Kind.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(X.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){return this.optionalMany(X.TokenKind.PAREN_L,t?this.parseConstArgument:this.parseArgument,X.TokenKind.PAREN_R)}parseArgument(t=!1){const e=this._lexer.token,n=this.parseName();return this.expectToken(X.TokenKind.COLON),this.node(e,{kind:z.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(X.TokenKind.SPREAD);const e=this.expectOptionalKeyword("on");return!e&&this.peek(X.TokenKind.NAME)?this.node(t,{kind:z.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:z.Kind.INLINE_FRAGMENT,typeCondition:e?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){var t;const e=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(t=this._options)||void 0===t?void 0:t.allowLegacyFragmentVariables)?this.node(e,{kind:z.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:z.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(t){const e=this._lexer.token;switch(e.kind){case X.TokenKind.BRACKET_L:return this.parseList(t);case X.TokenKind.BRACE_L:return this.parseObject(t);case X.TokenKind.INT:return this._lexer.advance(),this.node(e,{kind:z.Kind.INT,value:e.value});case X.TokenKind.FLOAT:return this._lexer.advance(),this.node(e,{kind:z.Kind.FLOAT,value:e.value});case X.TokenKind.STRING:case X.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case X.TokenKind.NAME:switch(this._lexer.advance(),e.value){case"true":return this.node(e,{kind:z.Kind.BOOLEAN,value:!0});case"false":return this.node(e,{kind:z.Kind.BOOLEAN,value:!1});case"null":return this.node(e,{kind:z.Kind.NULL});default:return this.node(e,{kind:z.Kind.ENUM,value:e.value})}case X.TokenKind.DOLLAR:if(t){if(this.expectToken(X.TokenKind.DOLLAR),this._lexer.token.kind===X.TokenKind.NAME)throw(0,B.syntaxError)(this._lexer.source,e.start,`Unexpected variable "$${this._lexer.token.value}" in constant value.`);throw this.unexpected(e)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this._lexer.advance(),this.node(t,{kind:z.Kind.STRING,value:t.value,block:t.kind===X.TokenKind.BLOCK_STRING})}parseList(t){return this.node(this._lexer.token,{kind:z.Kind.LIST,values:this.any(X.TokenKind.BRACKET_L,(()=>this.parseValueLiteral(t)),X.TokenKind.BRACKET_R)})}parseObject(t){return this.node(this._lexer.token,{kind:z.Kind.OBJECT,fields:this.any(X.TokenKind.BRACE_L,(()=>this.parseObjectField(t)),X.TokenKind.BRACE_R)})}parseObjectField(t){const e=this._lexer.token,n=this.parseName();return this.expectToken(X.TokenKind.COLON),this.node(e,{kind:z.Kind.OBJECT_FIELD,name:n,value:this.parseValueLiteral(t)})}parseDirectives(t){const e=[];for(;this.peek(X.TokenKind.AT);)e.push(this.parseDirective(t));return e}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const e=this._lexer.token;return this.expectToken(X.TokenKind.AT),this.node(e,{kind:z.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let e;if(this.expectOptionalToken(X.TokenKind.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(X.TokenKind.BRACKET_R),e=this.node(t,{kind:z.Kind.LIST_TYPE,type:n})}else e=this.parseNamedType();return this.expectOptionalToken(X.TokenKind.BANG)?this.node(t,{kind:z.Kind.NON_NULL_TYPE,type:e}):e}parseNamedType(){return this.node(this._lexer.token,{kind:z.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(X.TokenKind.STRING)||this.peek(X.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,e=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(X.TokenKind.BRACE_L,this.parseOperationTypeDefinition,X.TokenKind.BRACE_R);return this.node(t,{kind:z.Kind.SCHEMA_DEFINITION,description:e,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const t=this._lexer.token,e=this.parseOperationType();this.expectToken(X.TokenKind.COLON);const n=this.parseNamedType();return this.node(t,{kind:z.Kind.OPERATION_TYPE_DEFINITION,operation:e,type:n})}parseScalarTypeDefinition(){const t=this._lexer.token,e=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:z.Kind.SCALAR_TYPE_DEFINITION,description:e,name:n,directives:i})}parseObjectTypeDefinition(){const t=this._lexer.token,e=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:z.Kind.OBJECT_TYPE_DEFINITION,description:e,name:n,interfaces:i,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(X.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(X.TokenKind.BRACE_L,this.parseFieldDefinition,X.TokenKind.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,e=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(X.TokenKind.COLON);const r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(t,{kind:z.Kind.FIELD_DEFINITION,description:e,name:n,arguments:i,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(X.TokenKind.PAREN_L,this.parseInputValueDef,X.TokenKind.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,e=this.parseDescription(),n=this.parseName();this.expectToken(X.TokenKind.COLON);const i=this.parseTypeReference();let r;this.expectOptionalToken(X.TokenKind.EQUALS)&&(r=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(t,{kind:z.Kind.INPUT_VALUE_DEFINITION,description:e,name:n,type:i,defaultValue:r,directives:s})}parseInterfaceTypeDefinition(){const t=this._lexer.token,e=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:z.Kind.INTERFACE_TYPE_DEFINITION,description:e,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeDefinition(){const t=this._lexer.token,e=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(t,{kind:z.Kind.UNION_TYPE_DEFINITION,description:e,name:n,directives:i,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(X.TokenKind.EQUALS)?this.delimitedMany(X.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,e=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(t,{kind:z.Kind.ENUM_TYPE_DEFINITION,description:e,name:n,directives:i,values:r})}parseEnumValuesDefinition(){return this.optionalMany(X.TokenKind.BRACE_L,this.parseEnumValueDefinition,X.TokenKind.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,e=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:z.Kind.ENUM_VALUE_DEFINITION,description:e,name:n,directives:i})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw(0,B.syntaxError)(this._lexer.source,this._lexer.token.start,`${i(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,e=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(t,{kind:z.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:e,name:n,directives:i,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(X.TokenKind.BRACE_L,this.parseInputValueDef,X.TokenKind.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===X.TokenKind.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const e=this.parseConstDirectives(),n=this.optionalMany(X.TokenKind.BRACE_L,this.parseOperationTypeDefinition,X.TokenKind.BRACE_R);if(0===e.length&&0===n.length)throw this.unexpected();return this.node(t,{kind:z.Kind.SCHEMA_EXTENSION,directives:e,operationTypes:n})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const e=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(t,{kind:z.Kind.SCALAR_TYPE_EXTENSION,name:e,directives:n})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const e=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(t,{kind:z.Kind.OBJECT_TYPE_EXTENSION,name:e,interfaces:n,directives:i,fields:r})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const e=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===n.length&&0===i.length&&0===r.length)throw this.unexpected();return this.node(t,{kind:z.Kind.INTERFACE_TYPE_EXTENSION,name:e,interfaces:n,directives:i,fields:r})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const e=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(t,{kind:z.Kind.UNION_TYPE_EXTENSION,name:e,directives:n,types:i})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const e=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(t,{kind:z.Kind.ENUM_TYPE_EXTENSION,name:e,directives:n,values:i})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const e=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(0===n.length&&0===i.length)throw this.unexpected();return this.node(t,{kind:z.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:e,directives:n,fields:i})}parseDirectiveDefinition(){const t=this._lexer.token,e=this.parseDescription();this.expectKeyword("directive"),this.expectToken(X.TokenKind.AT);const n=this.parseName(),i=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const s=this.parseDirectiveLocations();return this.node(t,{kind:z.Kind.DIRECTIVE_DEFINITION,description:e,name:n,arguments:i,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(X.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,e=this.parseName();if(Object.prototype.hasOwnProperty.call(G.DirectiveLocation,e.value))return e;throw this.unexpected(t)}node(t,e){var n;return!0!==(null===(n=this._options)||void 0===n?void 0:n.noLocation)&&(e.loc=new H.Location(t,this._lexer.lastToken,this._lexer.source)),e}peek(t){return this._lexer.token.kind===t}expectToken(t){const e=this._lexer.token;if(e.kind===t)return this._lexer.advance(),e;throw(0,B.syntaxError)(this._lexer.source,e.start,`Expected ${r(t)}, found ${i(e)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t&&(this._lexer.advance(),!0)}expectKeyword(t){const e=this._lexer.token;if(e.kind!==X.TokenKind.NAME||e.value!==t)throw(0,B.syntaxError)(this._lexer.source,e.start,`Expected "${t}", found ${i(e)}.`);this._lexer.advance()}expectOptionalKeyword(t){const e=this._lexer.token;return e.kind===X.TokenKind.NAME&&e.value===t&&(this._lexer.advance(),!0)}unexpected(t){const e=null!=t?t:this._lexer.token;return(0,B.syntaxError)(this._lexer.source,e.start,`Unexpected ${i(e)}.`)}any(t,e,n){this.expectToken(t);const i=[];for(;!this.expectOptionalToken(n);)i.push(e.call(this));return i}optionalMany(t,e,n){if(this.expectOptionalToken(t)){const t=[];do{t.push(e.call(this))}while(!this.expectOptionalToken(n));return t}return[]}many(t,e,n){this.expectToken(t);const i=[];do{i.push(e.call(this))}while(!this.expectOptionalToken(n));return i}delimitedMany(t,e){this.expectOptionalToken(t);const n=[];do{n.push(e.call(this))}while(this.expectOptionalToken(t));return n}}function i(t){const e=t.value;return r(t.kind)+(null!=e?` "${e}"`:"")}function r(t){return(0,K.isPunctuatorTokenKind)(t)?`"${t}"`:t}e.Parser=n})),nt=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.printString=function(t){return`"${t.replace(n,i)}"`};const n=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function i(t){return r[t.charCodeAt(0)]}const r=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]})),it=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BREAK=void 0,e.getEnterLeaveForKind=i,e.getVisitFn=function(t,e,n){const{enter:r,leave:s}=i(t,e);return n?s:r},e.visit=function(t,e,r=H.QueryDocumentKeys){const s=new Map;for(const t of Object.values(z.Kind))s.set(t,i(e,t));let o,u,a,c=Array.isArray(t),h=[t],l=-1,f=[],d=t;const v=[],p=[];do{l++;const t=l===h.length,i=t&&0!==f.length;if(t){if(u=0===p.length?void 0:v[v.length-1],d=a,a=p.pop(),i)if(c){d=d.slice();let t=0;for(const[e,n]of f){const i=e-t;null===n?(d.splice(i,1),t++):d[i]=n}}else{d=Object.defineProperties({},Object.getOwnPropertyDescriptors(d));for(const[t,e]of f)d[t]=e}l=o.index,h=o.keys,f=o.edits,c=o.inArray,o=o.prev}else if(a){if(u=c?l:h[l],d=a[u],null==d)continue;v.push(u)}let w;if(!Array.isArray(d)){var m,y;(0,H.isNode)(d)||(0,W.devAssert)(!1,`Invalid AST Node: ${(0,Y.inspect)(d)}.`);const i=t?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(e,d,u,a,v,p),w===n)break;if(!1===w){if(!t){v.pop();continue}}else if(void 0!==w&&(f.push([u,w]),!t)){if(!(0,H.isNode)(w)){v.pop();continue}d=w}}var b;void 0===w&&i&&f.push([u,d]),t?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=[],a&&p.push(a),a=d)}while(void 0!==o);return 0!==f.length?f[f.length-1][1]:t},e.visitInParallel=function(t){const e=new Array(t.length).fill(null),r=Object.create(null);for(const s of Object.values(z.Kind)){let o=!1;const u=new Array(t.length).fill(void 0),a=new Array(t.length).fill(void 0);for(let e=0;e<t.length;++e){const{enter:n,leave:r}=i(t[e],s);o||(o=null!=n||null!=r),u[e]=n,a[e]=r}o&&(r[s]={enter(...i){const r=i[0];for(let o=0;o<t.length;o++)if(null===e[o]){var s;const a=null===(s=u[o])||void 0===s?void 0:s.apply(t[o],i);if(!1===a)e[o]=r;else if(a===n)e[o]=n;else if(void 0!==a)return a}},leave(...i){const r=i[0];for(let o=0;o<t.length;o++)if(null===e[o]){var s;const r=null===(s=a[o])||void 0===s?void 0:s.apply(t[o],i);if(r===n)e[o]=n;else if(void 0!==r&&!1!==r)return r}else e[o]===r&&(e[o]=null)}})}return r};const n=Object.freeze({});function i(t,e){const n=t[e];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:t.enter,leave:t.leave}}e.BREAK=n})),rt=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.print=function(t){return(0,it.visit)(t,n)};const n={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>i(t.definitions,"\n\n")},OperationDefinition:{leave(t){const e=s("(",i(t.variableDefinitions,", "),")"),n=i([t.operation,i([t.name,e]),i(t.directives," ")]," ");return("query"===n?"":n+" ")+t.selectionSet}},VariableDefinition:{leave:({variable:t,type:e,defaultValue:n,directives:r})=>t+": "+e+s(" = ",n)+s(" ",i(r," "))},SelectionSet:{leave:({selections:t})=>r(t)},Field:{leave({alias:t,name:e,arguments:n,directives:r,selectionSet:u}){const a=s("",t,": ")+e;let c=a+s("(",i(n,", "),")");return c.length>80&&(c=a+s("(\n",o(i(n,"\n")),"\n)")),i([c,i(r," "),u]," ")}},Argument:{leave:({name:t,value:e})=>t+": "+e},FragmentSpread:{leave:({name:t,directives:e})=>"..."+t+s(" ",i(e," "))},InlineFragment:{leave:({typeCondition:t,directives:e,selectionSet:n})=>i(["...",s("on ",t),i(e," "),n]," ")},FragmentDefinition:{leave:({name:t,typeCondition:e,variableDefinitions:n,directives:r,selectionSet:o})=>`fragment ${t}${s("(",i(n,", "),")")} on ${e} ${s("",i(r," ")," ")}`+o},IntValue:{leave:({value:t})=>t},FloatValue:{leave:({value:t})=>t},StringValue:{leave:({value:t,block:e})=>e?(0,Q.printBlockString)(t):(0,nt.printString)(t)},BooleanValue:{leave:({value:t})=>t?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:t})=>t},ListValue:{leave:({values:t})=>"["+i(t,", ")+"]"},ObjectValue:{leave:({fields:t})=>"{"+i(t,", ")+"}"},ObjectField:{leave:({name:t,value:e})=>t+": "+e},Directive:{leave:({name:t,arguments:e})=>"@"+t+s("(",i(e,", "),")")},NamedType:{leave:({name:t})=>t},ListType:{leave:({type:t})=>"["+t+"]"},NonNullType:{leave:({type:t})=>t+"!"},SchemaDefinition:{leave:({description:t,directives:e,operationTypes:n})=>s("",t,"\n")+i(["schema",i(e," "),r(n)]," ")},OperationTypeDefinition:{leave:({operation:t,type:e})=>t+": "+e},ScalarTypeDefinition:{leave:({description:t,name:e,directives:n})=>s("",t,"\n")+i(["scalar",e,i(n," ")]," ")},ObjectTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:o,fields:u})=>s("",t,"\n")+i(["type",e,s("implements ",i(n," & ")),i(o," "),r(u)]," ")},FieldDefinition:{leave:({description:t,name:e,arguments:n,type:r,directives:a})=>s("",t,"\n")+e+(u(n)?s("(\n",o(i(n,"\n")),"\n)"):s("(",i(n,", "),")"))+": "+r+s(" ",i(a," "))},InputValueDefinition:{leave:({description:t,name:e,type:n,defaultValue:r,directives:o})=>s("",t,"\n")+i([e+": "+n,s("= ",r),i(o," ")]," ")},InterfaceTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:o,fields:u})=>s("",t,"\n")+i(["interface",e,s("implements ",i(n," & ")),i(o," "),r(u)]," ")},UnionTypeDefinition:{leave:({description:t,name:e,directives:n,types:r})=>s("",t,"\n")+i(["union",e,i(n," "),s("= ",i(r," | "))]," ")},EnumTypeDefinition:{leave:({description:t,name:e,directives:n,values:o})=>s("",t,"\n")+i(["enum",e,i(n," "),r(o)]," ")},EnumValueDefinition:{leave:({description:t,name:e,directives:n})=>s("",t,"\n")+i([e,i(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:t,name:e,directives:n,fields:o})=>s("",t,"\n")+i(["input",e,i(n," "),r(o)]," ")},DirectiveDefinition:{leave:({description:t,name:e,arguments:n,repeatable:r,locations:a})=>s("",t,"\n")+"directive @"+e+(u(n)?s("(\n",o(i(n,"\n")),"\n)"):s("(",i(n,", "),")"))+(r?" repeatable":"")+" on "+i(a," | ")},SchemaExtension:{leave:({directives:t,operationTypes:e})=>i(["extend schema",i(t," "),r(e)]," ")},ScalarTypeExtension:{leave:({name:t,directives:e})=>i(["extend scalar",t,i(e," ")]," ")},ObjectTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:o})=>i(["extend type",t,s("implements ",i(e," & ")),i(n," "),r(o)]," ")},InterfaceTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:o})=>i(["extend interface",t,s("implements ",i(e," & ")),i(n," "),r(o)]," ")},UnionTypeExtension:{leave:({name:t,directives:e,types:n})=>i(["extend union",t,i(e," "),s("= ",i(n," | "))]," ")},EnumTypeExtension:{leave:({name:t,directives:e,values:n})=>i(["extend enum",t,i(e," "),r(n)]," ")},InputObjectTypeExtension:{leave:({name:t,directives:e,fields:n})=>i(["extend input",t,i(e," "),r(n)]," ")}};function i(t,e=""){var n;return null!==(n=null==t?void 0:t.filter((t=>t)).join(e))&&void 0!==n?n:""}function r(t){return s("{\n",o(i(t,"\n")),"\n}")}function s(t,e,n=""){return null!=e&&""!==e?t+e+n:""}function o(t){return s(" ",t.replace(/\n/g,"\n "))}function u(t){var e;return null!==(e=null==t?void 0:t.some((t=>t.includes("\n"))))&&void 0!==e&&e}})),st=function(t){var e=t.name,n=t.type;this.uri=t.uri,this.name=e,this.type=n},ot=function(t){return"undefined"!=typeof File&&t instanceof File||"undefined"!=typeof Blob&&t instanceof Blob||t instanceof st},ut=function t(e,n,i){var r;void 0===n&&(n=""),void 0===i&&(i=ot);var s=new Map;function o(t,e){var n=s.get(e);n?n.push.apply(n,t):s.set(e,t)}if(i(e))r=null,o([n],e);else{var u=n?n+".":"";if("undefined"!=typeof FileList&&e instanceof FileList)r=Array.prototype.map.call(e,(function(t,e){return o([""+u+e],t),null}));else if(Array.isArray(e))r=e.map((function(e,n){var r=t(e,""+u+n,i);return r.files.forEach(o),r.clone}));else if(e&&e.constructor===Object)for(var a in r={},e){var c=t(e[a],""+u+a,i);c.files.forEach(o),r[a]=c.clone}else r=e}return{clone:r,files:s}},at=ot,ct="object"==typeof self?self.FormData:window.FormData,ht=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.defaultJsonSerializer=void 0,e.defaultJsonSerializer={parse:JSON.parse,stringify:JSON.stringify}})),lt=e((function(e,n){var i=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0});var r=i(ct),s=function(t){return at(t)||null!==t&&"object"==typeof t&&"function"==typeof t.pipe};n.default=function(t,e,n,i){void 0===i&&(i=ht.defaultJsonSerializer);var o=ut({query:t,variables:e,operationName:n},"",s),u=o.clone,a=o.files;if(0===a.size){if(!Array.isArray(t))return i.stringify(u);if(void 0!==e&&!Array.isArray(e))throw new Error("Cannot create request body with given variable type, array expected");var c=t.reduce((function(t,n,i){return t.push({query:n,variables:e?e[i]:void 0}),t}),[]);return i.stringify(c)}var h=new("undefined"==typeof FormData?r.default:FormData);h.append("operations",i.stringify(u));var l={},f=0;return a.forEach((function(t){l[++f]=t})),h.append("map",i.stringify(l)),f=0,a.forEach((function(t,e){h.append(""+ ++f,e)})),h}})),ft=e((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseBatchRequestsExtendedArgs=e.parseRawRequestExtendedArgs=e.parseRequestExtendedArgs=e.parseBatchRequestArgs=e.parseRawRequestArgs=e.parseRequestArgs=void 0,e.parseRequestArgs=function(t,e,n){return t.document?t:{document:t,variables:e,requestHeaders:n,signal:void 0}},e.parseRawRequestArgs=function(t,e,n){return t.query?t:{query:t,variables:e,requestHeaders:n,signal:void 0}},e.parseBatchRequestArgs=function(t,e){return t.documents?t:{documents:t,requestHeaders:e,signal:void 0}},e.parseRequestExtendedArgs=function(t,e,n,i){return t.document?t:{url:t,document:e,variables:n,requestHeaders:i,signal:void 0}},e.parseRawRequestExtendedArgs=function(t,e,n,i){return t.query?t:{url:t,query:e,variables:n,requestHeaders:i,signal:void 0}},e.parseBatchRequestsExtendedArgs=function(t,e,n){return t.documents?t:{url:t,documents:e,requestHeaders:n,signal:void 0}}})),dt=e((function(e,n){var i,r=t&&t.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0}),n.ClientError=void 0;var s=function(t){function e(n,i){var r=this,s=e.extractMessage(n)+": "+JSON.stringify({response:n,request:i});return r=t.call(this,s)||this,Object.setPrototypeOf(r,e.prototype),r.response=n,r.request=i,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,e),r}return r(e,t),e.extractMessage=function(t){try{return t.errors[0].message}catch(e){return"GraphQL Error (Code: "+t.status+")"}},e}(Error);n.ClientError=s}));e((function(e,n){var i=t&&t.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=t&&t.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),s=t&&t.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=t&&t.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return s(e,t),e},u=t&&t.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{a(i.next(t))}catch(t){s(t)}}function u(t){try{a(i.throw(t))}catch(t){s(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,u)}a((i=i.apply(t,e||[])).next())}))},a=t&&t.__generator||function(t,e){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},c=t&&t.__rest||function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n},h=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0}),n.gql=n.batchRequests=n.request=n.rawRequest=n.GraphQLClient=n.ClientError=void 0;var l=o(C),f=l,d=h(lt);Object.defineProperty(n,"ClientError",{enumerable:!0,get:function(){return dt.ClientError}});var v=function(t){var e={};return t&&("undefined"!=typeof Headers&&t instanceof Headers||t instanceof f.Headers?e=function(t){var e={};return t.forEach((function(t,n){e[n]=t})),e}(t):Array.isArray(t)?t.forEach((function(t){e[t[0]]=t[1]})):e=t),e},p=function(t){return t.replace(/([\s,]|#[^\n\r]+)+/g," ").trim()},m=function(t){var e=t.url,n=t.query,r=t.variables,s=t.operationName,o=t.headers,c=t.fetch,h=t.fetchOptions;return u(void 0,void 0,void 0,(function(){var t;return a(this,(function(u){switch(u.label){case 0:return t=d.default(n,r,s,h.jsonSerializer),[4,c(e,i({method:"POST",headers:i(i({},"string"==typeof t?{"Content-Type":"application/json"}:{}),o),body:t},h))];case 1:return[2,u.sent()]}}))}))},y=function(t){var e=t.url,n=t.query,r=t.variables,s=t.operationName,o=t.headers,c=t.fetch,h=t.fetchOptions;return u(void 0,void 0,void 0,(function(){var t;return a(this,(function(u){switch(u.label){case 0:return t=function(t){var e=t.query,n=t.variables,i=t.operationName,r=t.jsonSerializer;if(!Array.isArray(e)){var s=["query="+encodeURIComponent(p(e))];return n&&s.push("variables="+encodeURIComponent(r.stringify(n))),i&&s.push("operationName="+encodeURIComponent(i)),s.join("&")}if(void 0!==n&&!Array.isArray(n))throw new Error("Cannot create query with given variable type, array expected");var o=e.reduce((function(t,e,i){return t.push({query:p(e),variables:n?r.stringify(n[i]):void 0}),t}),[]);return"query="+encodeURIComponent(r.stringify(o))}({query:n,variables:r,operationName:s,jsonSerializer:h.jsonSerializer}),[4,c(e+"?"+t,i({method:"GET",headers:o},h))];case 1:return[2,u.sent()]}}))}))},b=function(){function t(t,e){this.url=t,this.options=e||{}}return t.prototype.rawRequest=function(t,e,n){return u(this,void 0,void 0,(function(){var r,s,o,u,h,f,d,p,m,y;return a(this,(function(){return r=ft.parseRawRequestArgs(t,e,n),o=(s=this.options).headers,h=void 0===(u=s.fetch)?l.default:u,d=void 0===(f=s.method)?"POST":f,p=c(s,["headers","fetch","method"]),m=this.url,void 0!==r.signal&&(p.signal=r.signal),y=T(r.query).operationName,[2,w({url:m,query:r.query,variables:r.variables,headers:i(i({},v(o)),v(r.requestHeaders)),operationName:y,fetch:h,method:d,fetchOptions:p})]}))}))},t.prototype.request=function(t,e,n){return u(this,void 0,void 0,(function(){var r,s,o,u,h,f,d,p,m,y,b;return a(this,(function(a){switch(a.label){case 0:return r=ft.parseRequestArgs(t,e,n),o=(s=this.options).headers,h=void 0===(u=s.fetch)?l.default:u,d=void 0===(f=s.method)?"POST":f,p=c(s,["headers","fetch","method"]),m=this.url,void 0!==r.signal&&(p.signal=r.signal),y=T(r.document),b=y.operationName,[4,w({url:m,query:y.query,variables:r.variables,headers:i(i({},v(o)),v(r.requestHeaders)),operationName:b,fetch:h,method:d,fetchOptions:p})];case 1:return[2,a.sent().data]}}))}))},t.prototype.batchRequests=function(t,e){return u(this,void 0,void 0,(function(){var n,r,s,o,u,h,f,d,p,m,y;return a(this,(function(a){switch(a.label){case 0:return n=ft.parseBatchRequestArgs(t,e),s=(r=this.options).headers,u=void 0===(o=r.fetch)?l.default:o,f=void 0===(h=r.method)?"POST":h,d=c(r,["headers","fetch","method"]),p=this.url,void 0!==n.signal&&(d.signal=n.signal),m=n.documents.map((function(t){return T(t.document).query})),y=n.documents.map((function(t){return t.variables})),[4,w({url:p,query:m,variables:y,headers:i(i({},v(s)),v(n.requestHeaders)),operationName:void 0,fetch:u,method:f,fetchOptions:d})];case 1:return[2,a.sent().data]}}))}))},t.prototype.setHeaders=function(t){return this.options.headers=t,this},t.prototype.setHeader=function(t,e){var n,i=this.options.headers;return i?i[t]=e:this.options.headers=((n={})[t]=e,n),this},t.prototype.setEndpoint=function(t){return this.url=t,this},t}();function w(t){var e=t.url,n=t.query,r=t.variables,s=t.headers,o=t.operationName,c=t.fetch,h=t.method,l=void 0===h?"POST":h,f=t.fetchOptions;return u(this,void 0,void 0,(function(){var t,u,h,d,v,p,b;return a(this,(function(a){switch(a.label){case 0:return t="POST"===l.toUpperCase()?m:y,u=Array.isArray(n),[4,t({url:e,query:n,variables:r,operationName:o,headers:s,fetch:c,fetchOptions:f})];case 1:return[4,g(h=a.sent(),f.jsonSerializer)];case 2:if(d=a.sent(),v=u&&Array.isArray(d)?!d.some((function(t){return!t.data})):!!d.data,h.ok&&!d.errors&&v)return p=h.headers,b=h.status,[2,i(i({},u?{data:d}:d),{headers:p,status:b})];throw new dt.ClientError(i(i({},"string"==typeof d?{error:d}:d),{status:h.status,headers:h.headers}),{query:n,variables:r})}}))}))}function E(t,e,n,r){return u(this,void 0,void 0,(function(){var s;return a(this,(function(){return s=ft.parseRequestExtendedArgs(t,e,n,r),[2,new b(s.url).request(i({},s))]}))}))}function g(t,e){return void 0===e&&(e=ht.defaultJsonSerializer),u(this,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return t.headers.forEach((function(t,e){"content-type"===e.toLowerCase()&&(n=t)})),n&&n.toLowerCase().startsWith("application/json")?(r=(i=e).parse,[4,t.text()]):[3,2];case 1:return[2,r.apply(i,[s.sent()])];case 2:return[2,t.text()]}}))}))}function O(t){var e,n=void 0,i=t.definitions.filter((function(t){return"OperationDefinition"===t.kind}));return 1===i.length&&(n=null===(e=i[0].name)||void 0===e?void 0:e.value),n}function T(t){if("string"==typeof t){var e=void 0;try{e=O(et.parse(t))}catch(t){}return{query:t,operationName:e}}var n=O(t);return{query:rt.print(t),operationName:n}}n.GraphQLClient=b,n.rawRequest=function(t,e,n,r){return u(this,void 0,void 0,(function(){var s;return a(this,(function(){return s=ft.parseRawRequestExtendedArgs(t,e,n,r),[2,new b(s.url).rawRequest(i({},s))]}))}))},n.request=E,n.batchRequests=function(t,e,n){return u(this,void 0,void 0,(function(){var r;return a(this,(function(){return r=ft.parseBatchRequestsExtendedArgs(t,e,n),[2,new b(r.url).batchRequests(i({},r))]}))}))},n.default=E,n.gql=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.reduce((function(t,n,i){return""+t+n+(i in e?e[i]:"")}),"")}}));export{a as A,U as D,r as M,i as N,s as T,k as U,t as a,u as b,e as c}
|