@epigraph/epigraph-std-lib 5.0.0-alpha.11 → 5.0.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/Epigraph/epigraph.cjs +1 -1
  2. package/dist/Epigraph/epigraph.js +94 -126
  3. package/dist/Epigraph/epigraphBaseSolutions.cjs +1 -1
  4. package/dist/Epigraph/epigraphBaseSolutions.js +60 -68
  5. package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.cjs +1 -16
  6. package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js +2 -946
  7. package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.cjs +1 -1
  8. package/dist/EpigraphLibs/EpigraphLogger/epigraphLogger.js +74 -198
  9. package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs +1 -1
  10. package/dist/EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js +197 -425
  11. package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.cjs +1 -7
  12. package/dist/EpigraphLibs/EpigraphQrCodeGenerator/epigraphQrCodeGenerator.js +2 -78
  13. package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.cjs +1 -1
  14. package/dist/EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.js +24 -26
  15. package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.cjs +1 -1
  16. package/dist/EpigraphLibs/EpigraphUnitsConverter/epigraphUnitsConverter.js +2 -88
  17. package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs +1 -1
  18. package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js +44 -75
  19. package/dist/enums-BSSe4NAs.js +8 -0
  20. package/dist/enums-PfFMiIoe.cjs +1 -0
  21. package/dist/epigraph-std-lib.cjs +1 -1
  22. package/dist/epigraph-std-lib.d.ts +1 -0
  23. package/dist/epigraph-std-lib.js +11 -72
  24. package/dist/epigraphAnalytics-CF9Czp8C.js +722 -0
  25. package/dist/epigraphAnalytics-H3EZRDUh.cjs +1 -0
  26. package/dist/epigraphQrCodeGenerator-BXUNL2XK.js +54 -0
  27. package/dist/epigraphQrCodeGenerator-F2eLrPC_.cjs +7 -0
  28. package/dist/epigraphUnitsConverter-CwpmWl7p.cjs +1 -0
  29. package/dist/epigraphUnitsConverter-DsX4Rmsp.js +66 -0
  30. package/dist/lit--5TUYSGn.js +508 -0
  31. package/dist/lit-DZtv4Pds.cjs +2 -0
  32. package/package.json +6 -7
  33. package/dist/enums-1vqWxJ0i.cjs +0 -1
  34. package/dist/enums-CvOTKyNu.js +0 -5
  35. package/dist/lit-element-C3moVMGu.js +0 -524
  36. package/dist/lit-element-CYaaFRfk.cjs +0 -19
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var s=(l=>(l.Release="release",l.Staging="staging",l.Dev="dev",l))(s||{}),t=(l=>(l.Info="info",l.Warn="warn",l.Error="error",l))(t||{});class a{constructor(o){this.context="EPIGRAPH-LOGGER",this._allModes={release:{name:"release",allows:["error"]},staging:{name:"staging",allows:["warn","error"]},dev:{name:"dev",allows:["info","warn","error"]}},this._currentMode="release",o&&(this.context=o.toLocaleUpperCase())}get modes(){return this._allModes}setCurrentMode(o){if(!Object.keys(this._allModes).includes(o)){console.warn(`"${o}": is not a valid logger mode`);return}this._currentMode=o}_isLogTypeAllowedInCurrentMode(o){return this._allModes[this._currentMode].allows.includes(o)}info({title:o,details:r="",contextOverride:e=void 0}){if(!this._isLogTypeAllowedInCurrentMode("info"))return;const n=e||this.context;console.groupCollapsed(`[${n}]: ${o}`),console.log(r),console.groupCollapsed("Traceback..."),console.trace(),console.groupEnd(),console.groupEnd()}warn({title:o,details:r="",contextOverride:e=void 0}){if(!this._isLogTypeAllowedInCurrentMode("warn"))return;const n=e||this.context;console.groupCollapsed(`%c[${n}]: ${o}`,"color: orange;"),console.warn(r),console.groupCollapsed("Traceback..."),console.trace(),console.groupEnd(),console.groupEnd()}error({title:o,details:r="",contextOverride:e=void 0}){if(!this._isLogTypeAllowedInCurrentMode("error"))return;const n=e||this.context;console.groupCollapsed(`%c[${n}]: ${o}`,"color: red;"),console.error(r),console.groupCollapsed("Traceback..."),console.trace(),console.groupEnd(),console.groupEnd()}table({title:o,details:r={},contextOverride:e=void 0,logType:n="info"}){if(!this._isLogTypeAllowedInCurrentMode(n))return;const c=e||this.context;console.groupCollapsed(`[${c}]: ${o}`),console.table(r),console.groupCollapsed("Traceback..."),console.trace(),console.groupEnd(),console.groupEnd()}group({title:o,contextOverride:r=void 0,logType:e="info"}){if(!this._isLogTypeAllowedInCurrentMode(e))return;const n=r||this.context;console.group(`%c ${n} GROUP`,o)}groupCollapsed({title:o,contextOverride:r=void 0,logType:e="info"}){if(!this._isLogTypeAllowedInCurrentMode(e))return;const n=r||this.context;console.groupCollapsed(`%c ${n} GROUP`,o)}groupEnd(){this._isLogTypeAllowedInCurrentMode("info")&&(console.log("----------------------------------"),console.groupEnd())}}exports.EpigraphLogger=a;exports.LogTypes=t;exports.LoggerModeNames=s;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=function(e){return e.Release=`release`,e.Staging=`staging`,e.Dev=`dev`,e}({}),t=function(e){return e.Info=`info`,e.Warn=`warn`,e.Error=`error`,e}({}),n=class{constructor(e){this.context=`EPIGRAPH-LOGGER`,this._allModes={release:{name:`release`,allows:[`error`]},staging:{name:`staging`,allows:[`warn`,`error`]},dev:{name:`dev`,allows:[`info`,`warn`,`error`]}},this._currentMode=`release`,e&&(this.context=e.toLocaleUpperCase())}get modes(){return this._allModes}setCurrentMode(e){if(!Object.keys(this._allModes).includes(e)){console.warn(`"${e}": is not a valid logger mode`);return}this._currentMode=e}_isLogTypeAllowedInCurrentMode(e){return this._allModes[this._currentMode].allows.includes(e)}info({title:e,details:t=``,contextOverride:n=void 0}){if(!this._isLogTypeAllowedInCurrentMode(`info`))return;let r=n||this.context;console.groupCollapsed(`[${r}]: ${e}`),console.log(t),console.groupCollapsed(`Traceback...`),console.trace(),console.groupEnd(),console.groupEnd()}warn({title:e,details:t=``,contextOverride:n=void 0}){if(!this._isLogTypeAllowedInCurrentMode(`warn`))return;let r=n||this.context;console.groupCollapsed(`%c[${r}]: ${e}`,`color: orange;`),console.warn(t),console.groupCollapsed(`Traceback...`),console.trace(),console.groupEnd(),console.groupEnd()}error({title:e,details:t=``,contextOverride:n=void 0}){if(!this._isLogTypeAllowedInCurrentMode(`error`))return;let r=n||this.context;console.groupCollapsed(`%c[${r}]: ${e}`,`color: red;`),console.error(t),console.groupCollapsed(`Traceback...`),console.trace(),console.groupEnd(),console.groupEnd()}table({title:e,details:t={},contextOverride:n=void 0,logType:r=`info`}){if(!this._isLogTypeAllowedInCurrentMode(r))return;let i=n||this.context;console.groupCollapsed(`[${i}]: ${e}`),console.table(t),console.groupCollapsed(`Traceback...`),console.trace(),console.groupEnd(),console.groupEnd()}group({title:e,contextOverride:t=void 0,logType:n=`info`}){if(!this._isLogTypeAllowedInCurrentMode(n))return;let r=t||this.context;console.group(`%c ${r} GROUP`,e)}groupCollapsed({title:e,contextOverride:t=void 0,logType:n=`info`}){if(!this._isLogTypeAllowedInCurrentMode(n))return;let r=t||this.context;console.groupCollapsed(`%c ${r} GROUP`,e)}groupEnd(){this._isLogTypeAllowedInCurrentMode(`info`)&&(console.log(`----------------------------------`),console.groupEnd())}};exports.EpigraphLogger=n,exports.LogTypes=t,exports.LoggerModeNames=e;
@@ -1,199 +1,75 @@
1
- var t = /* @__PURE__ */ ((l) => (l.Release = "release", l.Staging = "staging", l.Dev = "dev", l))(t || {}), c = /* @__PURE__ */ ((l) => (l.Info = "info", l.Warn = "warn", l.Error = "error", l))(c || {});
2
- class a {
3
- /**
4
- * @param {string} [context="EPIGRAPH-LOGGER"] Used to categorise each message within
5
- * the console.
6
- * @example,CORE, UI
7
- */
8
- constructor(o) {
9
- this.context = "EPIGRAPH-LOGGER", this._allModes = {
10
- release: { name: "release", allows: [
11
- "error"
12
- /* Error */
13
- ] },
14
- staging: {
15
- name: "staging",
16
- allows: [
17
- "warn",
18
- "error"
19
- /* Error */
20
- ]
21
- },
22
- dev: {
23
- name: "dev",
24
- allows: [
25
- "info",
26
- "warn",
27
- "error"
28
- /* Error */
29
- ]
30
- }
31
- }, this._currentMode = "release", o && (this.context = o.toLocaleUpperCase());
32
- }
33
- get modes() {
34
- return this._allModes;
35
- }
36
- /**
37
- *
38
- * @param {LoggerModeNames} newValue Sets the logger mode of the current instance.
39
- */
40
- setCurrentMode(o) {
41
- if (!Object.keys(this._allModes).includes(o)) {
42
- console.warn(`"${o}": is not a valid logger mode`);
43
- return;
44
- }
45
- this._currentMode = o;
46
- }
47
- _isLogTypeAllowedInCurrentMode(o) {
48
- return this._allModes[this._currentMode].allows.includes(o);
49
- }
50
- /**
51
- * A log type that doesn't necessarily need to be looked at by the end user.
52
- * This can be any generic log that would be ignored in most logger modes except verbose.
53
- *
54
- * @param {string} title A short title for this log.
55
- * @param {any} details Any optional detail that would be shown if this log was expanded in the console.
56
- * @param {string | undefined} contextOverride Allows the user to specify where this log
57
- * was recorded from. For eg. Core and Ui can pass in different values for this
58
- * paramater to make it easy to debug. If not provided, the default context would be used
59
- * that was provided at the time of initialisation of this class.
60
- */
61
- info({ title: o, details: r = "", contextOverride: e = void 0 }) {
62
- if (!this._isLogTypeAllowedInCurrentMode(
63
- "info"
64
- /* Info */
65
- ))
66
- return;
67
- const n = e || this.context;
68
- console.groupCollapsed(`[${n}]: ${o}`), console.log(r), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
69
- }
70
- /**
71
- * A warning log type that let's the user know that some action that could be dangerous was just
72
- * performed and might need attention.
73
- *
74
- * @param {string} title A short title for this log.
75
- * @param {any} details Any optional detail that would be shown if this log was expanded in the console.
76
- * @param {string | undefined} contextOverride Allows the user to specify where this log
77
- * was recorded from. For eg. Core and Ui can pass in different values for this
78
- * paramater to make it easy to debug. If not provided, the default context would be used
79
- * that was provided at the time of initialisation of this class.
80
- */
81
- warn({ title: o, details: r = "", contextOverride: e = void 0 }) {
82
- if (!this._isLogTypeAllowedInCurrentMode(
83
- "warn"
84
- /* Warn */
85
- ))
86
- return;
87
- const n = e || this.context;
88
- console.groupCollapsed(`%c[${n}]: ${o}`, "color: orange;"), console.warn(r), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
89
- }
90
- /**
91
- * A critical error log type that let's the user know that some action that was unexpected and required immediate attention.
92
- *
93
- * @param {string} title A short title for this log.
94
- * @param {any} details Any optional detail that would be shown if this log was expanded in the console.
95
- * @param {string | undefined} contextOverride Allows the user to specify where this log
96
- * was recorded from. For eg. Core and Ui can pass in different values for this
97
- * paramater to make it easy to debug. If not provided, the default context would be used
98
- * that was provided at the time of initialisation of this class.
99
- */
100
- error({ title: o, details: r = "", contextOverride: e = void 0 }) {
101
- if (!this._isLogTypeAllowedInCurrentMode(
102
- "error"
103
- /* Error */
104
- ))
105
- return;
106
- const n = e || this.context;
107
- console.groupCollapsed(`%c[${n}]: ${o}`, "color: red;"), console.error(r), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
108
- }
109
- /**
110
- * A table log type that can show an object in an organised manner within the console.
111
- * This is primarily for the visual purposes and doesn't provide any additional functionality
112
- * that other log types cannot provide.
113
- *
114
- * @param {string} title A short title for this log.
115
- * @param {any} details Any optional detail that would be shown if this log was expanded in the console.
116
- * @param {string | undefined} contextOverride Allows the user to specify where this log
117
- * was recorded from. For eg. Core and Ui can pass in different values for this
118
- * paramater to make it easy to debug. If not provided, the default context would be used
119
- * that was provided at the time of initialisation of this class.
120
- * @param {LogTypes} logType A
121
- */
122
- table({
123
- title: o,
124
- details: r = {},
125
- contextOverride: e = void 0,
126
- logType: n = "info"
127
- /* Info */
128
- }) {
129
- if (!this._isLogTypeAllowedInCurrentMode(n))
130
- return;
131
- const s = e || this.context;
132
- console.groupCollapsed(`[${s}]: ${o}`), console.table(r), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
133
- }
134
- /**
135
- * Begins an expanded group with the browser's console window.
136
- * NOTE: Please remember to close this group once done using EpigraphLogger.groupEnd();
137
- *
138
- * @param {string} title A short title for this group.
139
- * @param {string | undefined} contextOverride Allows the user to specify where this log
140
- * was recorded from. For eg. Core and Ui can pass in different values for this
141
- * paramater to make it easy to debug. If not provided, the default context would be used
142
- * that was provided at the time of initialisation of this class.
143
- * @param {LogTypes} logType A group can implictly of any log type, by default it is of type
144
- * info but this parameter allows the user to override this.
145
- * @returns {void}
146
- */
147
- group({
148
- title: o,
149
- contextOverride: r = void 0,
150
- logType: e = "info"
151
- /* Info */
152
- }) {
153
- if (!this._isLogTypeAllowedInCurrentMode(e))
154
- return;
155
- const n = r || this.context;
156
- console.group(`%c ${n} GROUP`, o);
157
- }
158
- /**
159
- * Begins a collapsed group with the browser's console window.
160
- * NOTE: Please remember to close this group once done using EpigraphLogger.groupEnd();
161
- *
162
- * @param {string} title A short title for this group.
163
- * @param {string | undefined} contextOverride Allows the user to specify where this log
164
- * was recorded from. For eg. Core and Ui can pass in different values for this
165
- * paramater to make it easy to debug. If not provided, the default context would be used
166
- * that was provided at the time of initialisation of this class.
167
- * @param {LogTypes} logType A group can implictly of any log type, by default it is of type
168
- * info but this parameter allows the user to override this.
169
- * @returns {void}
170
- */
171
- groupCollapsed({
172
- title: o,
173
- contextOverride: r = void 0,
174
- logType: e = "info"
175
- /* Info */
176
- }) {
177
- if (!this._isLogTypeAllowedInCurrentMode(e))
178
- return;
179
- const n = r || this.context;
180
- console.groupCollapsed(`%c ${n} GROUP`, o);
181
- }
182
- /**
183
- * Similar to the console.groupEnd(). Useful for ending either a group or
184
- * groupCollapse that was initialised by this logger.
185
- *
186
- * @returns {void}
187
- */
188
- groupEnd() {
189
- this._isLogTypeAllowedInCurrentMode(
190
- "info"
191
- /* Info */
192
- ) && (console.log("----------------------------------"), console.groupEnd());
193
- }
194
- }
195
- export {
196
- a as EpigraphLogger,
197
- c as LogTypes,
198
- t as LoggerModeNames
1
+ //#region lib/EpigraphLibs/EpigraphLogger/epigraphLogger.ts
2
+ var e = /* @__PURE__ */ function(e) {
3
+ return e.Release = "release", e.Staging = "staging", e.Dev = "dev", e;
4
+ }({}), t = /* @__PURE__ */ function(e) {
5
+ return e.Info = "info", e.Warn = "warn", e.Error = "error", e;
6
+ }({}), n = class {
7
+ constructor(e) {
8
+ this.context = "EPIGRAPH-LOGGER", this._allModes = {
9
+ release: {
10
+ name: "release",
11
+ allows: ["error"]
12
+ },
13
+ staging: {
14
+ name: "staging",
15
+ allows: ["warn", "error"]
16
+ },
17
+ dev: {
18
+ name: "dev",
19
+ allows: [
20
+ "info",
21
+ "warn",
22
+ "error"
23
+ ]
24
+ }
25
+ }, this._currentMode = "release", e && (this.context = e.toLocaleUpperCase());
26
+ }
27
+ get modes() {
28
+ return this._allModes;
29
+ }
30
+ setCurrentMode(e) {
31
+ if (!Object.keys(this._allModes).includes(e)) {
32
+ console.warn(`"${e}": is not a valid logger mode`);
33
+ return;
34
+ }
35
+ this._currentMode = e;
36
+ }
37
+ _isLogTypeAllowedInCurrentMode(e) {
38
+ return this._allModes[this._currentMode].allows.includes(e);
39
+ }
40
+ info({ title: e, details: t = "", contextOverride: n = void 0 }) {
41
+ if (!this._isLogTypeAllowedInCurrentMode("info")) return;
42
+ let r = n || this.context;
43
+ console.groupCollapsed(`[${r}]: ${e}`), console.log(t), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
44
+ }
45
+ warn({ title: e, details: t = "", contextOverride: n = void 0 }) {
46
+ if (!this._isLogTypeAllowedInCurrentMode("warn")) return;
47
+ let r = n || this.context;
48
+ console.groupCollapsed(`%c[${r}]: ${e}`, "color: orange;"), console.warn(t), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
49
+ }
50
+ error({ title: e, details: t = "", contextOverride: n = void 0 }) {
51
+ if (!this._isLogTypeAllowedInCurrentMode("error")) return;
52
+ let r = n || this.context;
53
+ console.groupCollapsed(`%c[${r}]: ${e}`, "color: red;"), console.error(t), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
54
+ }
55
+ table({ title: e, details: t = {}, contextOverride: n = void 0, logType: r = "info" }) {
56
+ if (!this._isLogTypeAllowedInCurrentMode(r)) return;
57
+ let i = n || this.context;
58
+ console.groupCollapsed(`[${i}]: ${e}`), console.table(t), console.groupCollapsed("Traceback..."), console.trace(), console.groupEnd(), console.groupEnd();
59
+ }
60
+ group({ title: e, contextOverride: t = void 0, logType: n = "info" }) {
61
+ if (!this._isLogTypeAllowedInCurrentMode(n)) return;
62
+ let r = t || this.context;
63
+ console.group(`%c ${r} GROUP`, e);
64
+ }
65
+ groupCollapsed({ title: e, contextOverride: t = void 0, logType: n = "info" }) {
66
+ if (!this._isLogTypeAllowedInCurrentMode(n)) return;
67
+ let r = t || this.context;
68
+ console.groupCollapsed(`%c ${r} GROUP`, e);
69
+ }
70
+ groupEnd() {
71
+ this._isLogTypeAllowedInCurrentMode("info") && (console.log("----------------------------------"), console.groupEnd());
72
+ }
199
73
  };
74
+ //#endregion
75
+ export { n as EpigraphLogger, t as LogTypes, e as LoggerModeNames };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../../enums-1vqWxJ0i.cjs"),c=require("../EpigraphResultFactory/epigraphResultFactory.cjs");class ${constructor(i=h.NexusEndpoints.PRODUCTION,t,e,r="",s="",a="v1/"){this.epigraphXPath="",this.epigraphComponentVersion=r,this.epigraphSessionId=e,this.epigraphXPath=s,this.baseUrl=i+a,this.epgLocation=t}async getButtonBySku(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/button/sku/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getButtonByShopifyVariantId(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/button/shopify_variant_id/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getButtonByUpc(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/button/upc/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getButtonByAsin(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/button/asin/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getButtonByUuid(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/button/uuid/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getViewerBySku(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/viewer/sku/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getViewerByShopifyVariantId(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/viewer/shopify_variant_id/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getViewerByUpc(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/viewer/upc/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getViewerByAsin(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/viewer/asin/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getViewerByUuid(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/viewer/uuid/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getTourBySku(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/tour/sku/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getTourByShopifyVariantId(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/tour/shopify_variant_id/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getTourByUpc(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/tour/upc/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getTourByAsin(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/tour/asin/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getTourByUuid(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/tour/uuid/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getCustomizerBySku(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/customizer/sku/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getCustomizerByShopifyVariantId(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/customizer/shopify_variant_id/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getCustomizerByUpc(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/customizer/upc/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getCustomizerByAsin(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/customizer/asin/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getCustomizerByUuid(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/customizer/uuid/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getConfiguratorByExperienceId(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/configurator/experience_id/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getConfiguratorByClientAccessKey(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/configurator/client_access_key/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getConfiguratorLiteByExperienceId(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/configurator-lite/experience_id/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async getConfiguratorLiteByProjectId(i,t=""){const e={};t!==""&&(e.version_id=t);const r=`experience/configurator-lite/project_id/${i}`,s=this.buildNexusUrl(r,e);return await this.callNexusAPI(s,"GET")}async postExperienceSaveAndShare(i,t){const e=`experience/${i}/save`,r=this.buildNexusUrl(e),s={save_data:JSON.stringify(t)},a=new Headers;return a.set("Content-Type","application/json"),await this.callNexusAPI(r,"POST",JSON.stringify(s),a)}async getExperienceSaveAndShare(i,t){const e=`experience/${i}/save/${t}`,r=this.buildNexusUrl(e);return await this.callNexusAPI(r,"GET")}async callNexusAPI(i,t="GET",e,r=new Headers){r=this.addRequiredHeaders(r);const s={method:t,body:e,headers:r};try{const a=await fetch(i,s),u=await a.json();if(!a.ok){let o="Unable to retrieve configurator experience";return u.message&&(o=u.message),Promise.resolve(c.failureResult(u,a.status,o))}return Promise.resolve(c.successResult(u,a.status))}catch{return Promise.resolve(c.failureResult({},500,"Unknown error"))}}buildNexusUrl(i,t={}){let e=new URL(this.baseUrl);e.pathname+=i;for(const[r,s]of Object.entries(t))e.searchParams.set(r,s);return e}addRequiredHeaders(i){return i.has("accept")||i.set("accept","application/json"),i.has("EPG-Location")||i.set("EPG-location",this.epgLocation),i.has("EPG-Session-ID")||i.set("EPG-Session-ID",this.epigraphSessionId),i.has("EPG-XPATH")||i.set("EPG-XPATH",this.epigraphXPath),i.has("EPG-Version")||i.set("EPG-Version",this.epigraphComponentVersion),i}}var l=(n=>(n.CLIENT_ACCESS_KEY="client_access_key",n.EXPERIENCE_ID="experience_id",n.PROJECT_ID="project_id",n.SKU="sku",n.SHOPIFY_VARIANT_ID="shopify_variant_id",n.UPC="upc",n.ASIN="asin",n.UUID="uuid",n))(l||{}),p=(n=>(n.BUTTON="experience/button",n.VIEWER="experience/viewer",n.TOUR="experience/tour",n.CUSTOMIZER="experience/customizer",n.CONFIGURATOR="experience/configurator",n.CONFIGURATOR_LITE="experience/configurator-lite",n.EXPERIENCE="experience",n.SAVE="save",n))(p||{}),y=(n=>(n.V1="v1/",n))(y||{}),x=(n=>(n.GET="GET",n.POST="POST",n.PUT="PUT",n.DELETE="DELETE",n))(x||{});exports.EpigraphNexusAPI=$;exports.HTTPMethod=x;exports.NexusAPIResourceIdentifier=l;exports.NexusAPIRoutes=p;exports.NexusAPIVersions=y;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../enums-PfFMiIoe.cjs"),t=require("../EpigraphResultFactory/epigraphResultFactory.cjs");var n=class{constructor(t=e.n.PRODUCTION,n,r,i=``,a=``,o=`v1/`){this.epigraphXPath=``,this.epigraphComponentVersion=i,this.epigraphSessionId=r,this.epigraphXPath=a,this.baseUrl=t+o,this.epgLocation=n}async getButtonBySku(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/button/sku/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getButtonByShopifyVariantId(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/button/shopify_variant_id/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getButtonByUpc(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/button/upc/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getButtonByAsin(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/button/asin/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getButtonByUuid(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/button/uuid/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getViewerBySku(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/viewer/sku/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getViewerByShopifyVariantId(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/viewer/shopify_variant_id/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getViewerByUpc(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/viewer/upc/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getViewerByAsin(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/viewer/asin/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getViewerByUuid(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/viewer/uuid/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getTourBySku(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/tour/sku/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getTourByShopifyVariantId(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/tour/shopify_variant_id/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getTourByUpc(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/tour/upc/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getTourByAsin(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/tour/asin/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getTourByUuid(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/tour/uuid/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getCustomizerBySku(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/customizer/sku/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getCustomizerByShopifyVariantId(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/customizer/shopify_variant_id/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getCustomizerByUpc(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/customizer/upc/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getCustomizerByAsin(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/customizer/asin/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getCustomizerByUuid(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/customizer/uuid/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getConfiguratorByExperienceId(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/configurator/experience_id/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getConfiguratorByClientAccessKey(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/configurator/client_access_key/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getConfiguratorLiteByExperienceId(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/configurator-lite/experience_id/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async getConfiguratorLiteByProjectId(e,t=``){let n={};t!==``&&(n.version_id=t);let r=`experience/configurator-lite/project_id/${e}`,i=this.buildNexusUrl(r,n);return await this.callNexusAPI(i,`GET`)}async postExperienceSaveAndShare(e,t){let n=`experience/${e}/save`,r=this.buildNexusUrl(n),i={save_data:JSON.stringify(t)},a=new Headers;return a.set(`Content-Type`,`application/json`),await this.callNexusAPI(r,`POST`,JSON.stringify(i),a)}async getExperienceSaveAndShare(e,t){let n=`experience/${e}/save/${t}`,r=this.buildNexusUrl(n);return await this.callNexusAPI(r,`GET`)}async callNexusAPI(e,n=`GET`,r,i=new Headers){i=this.addRequiredHeaders(i);let a={method:n,body:r,headers:i};try{let n=await fetch(e,a),r=await n.json();if(!n.ok){let e=`Unable to retrieve configurator experience`;return r.message&&(e=r.message),Promise.resolve(t.failureResult(r,n.status,e))}return Promise.resolve(t.successResult(r,n.status))}catch{return Promise.resolve(t.failureResult({},500,`Unknown error`))}}buildNexusUrl(e,t={}){let n=new URL(this.baseUrl);n.pathname+=e;for(let[e,r]of Object.entries(t))n.searchParams.set(e,r);return n}addRequiredHeaders(e){return e.has(`accept`)||e.set(`accept`,`application/json`),e.has(`EPG-Location`)||e.set(`EPG-location`,this.epgLocation),e.has(`EPG-Session-ID`)||e.set(`EPG-Session-ID`,this.epigraphSessionId),e.has(`EPG-XPATH`)||e.set(`EPG-XPATH`,this.epigraphXPath),e.has(`EPG-Version`)||e.set(`EPG-Version`,this.epigraphComponentVersion),e}},r=function(e){return e.CLIENT_ACCESS_KEY=`client_access_key`,e.EXPERIENCE_ID=`experience_id`,e.PROJECT_ID=`project_id`,e.SKU=`sku`,e.SHOPIFY_VARIANT_ID=`shopify_variant_id`,e.UPC=`upc`,e.ASIN=`asin`,e.UUID=`uuid`,e}({}),i=function(e){return e.BUTTON=`experience/button`,e.VIEWER=`experience/viewer`,e.TOUR=`experience/tour`,e.CUSTOMIZER=`experience/customizer`,e.CONFIGURATOR=`experience/configurator`,e.CONFIGURATOR_LITE=`experience/configurator-lite`,e.EXPERIENCE=`experience`,e.SAVE=`save`,e}({}),a=function(e){return e.V1=`v1/`,e}({}),o=function(e){return e.GET=`GET`,e.POST=`POST`,e.PUT=`PUT`,e.DELETE=`DELETE`,e}({});exports.EpigraphNexusAPI=n,exports.HTTPMethod=o,exports.NexusAPIResourceIdentifier=r,exports.NexusAPIRoutes=i,exports.NexusAPIVersions=a;