@ppg_pl/pallete 0.0.3 → 0.0.5

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 (226) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +7 -0
  2. package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
  3. package/dist/cjs/css-shim-5d56550a.js +8 -0
  4. package/dist/cjs/css-shim-5d56550a.js.map +1 -0
  5. package/dist/cjs/dom-52c0133a.js +77 -0
  6. package/dist/cjs/dom-52c0133a.js.map +1 -0
  7. package/dist/cjs/gtmUtils-11a00b2b.js +9 -0
  8. package/dist/cjs/gtmUtils-11a00b2b.js.map +1 -0
  9. package/dist/cjs/index-a230bf6e.js +3434 -0
  10. package/dist/cjs/index-a230bf6e.js.map +1 -0
  11. package/dist/cjs/index.cjs.js +2 -0
  12. package/dist/cjs/index.cjs.js.map +1 -0
  13. package/dist/cjs/loader.cjs.js +24 -3
  14. package/dist/cjs/loader.cjs.js.map +1 -0
  15. package/dist/cjs/my-backdrop.cjs.entry.js +21 -0
  16. package/dist/cjs/my-backdrop.cjs.entry.js.map +1 -0
  17. package/dist/cjs/my-colorbox.cjs.entry.js +52 -0
  18. package/dist/cjs/my-colorbox.cjs.entry.js.map +1 -0
  19. package/dist/cjs/my-colorinfo.cjs.entry.js +46 -0
  20. package/dist/cjs/my-colorinfo.cjs.entry.js.map +1 -0
  21. package/dist/cjs/my-component.cjs.entry.js +171 -0
  22. package/dist/cjs/my-component.cjs.entry.js.map +1 -0
  23. package/dist/cjs/my-loader.cjs.entry.js +21 -0
  24. package/dist/cjs/my-loader.cjs.entry.js.map +1 -0
  25. package/dist/cjs/my-modal.cjs.entry.js +2479 -0
  26. package/dist/cjs/my-modal.cjs.entry.js.map +1 -0
  27. package/dist/cjs/my-search.cjs.entry.js +44 -0
  28. package/dist/cjs/my-search.cjs.entry.js.map +1 -0
  29. package/dist/cjs/my-slider.cjs.entry.js +11201 -0
  30. package/dist/cjs/my-slider.cjs.entry.js.map +1 -0
  31. package/dist/cjs/pallete.cjs.js +154 -5
  32. package/dist/cjs/pallete.cjs.js.map +1 -0
  33. package/dist/cjs/shadow-css-388a8a25.js +391 -0
  34. package/dist/cjs/shadow-css-388a8a25.js.map +1 -0
  35. package/dist/collection/collection-manifest.json +2 -2
  36. package/dist/collection/components/api/index.js +1 -0
  37. package/dist/collection/components/api/index.js.map +1 -0
  38. package/dist/collection/components/api/services.js +1 -0
  39. package/dist/collection/components/api/services.js.map +1 -0
  40. package/dist/collection/components/my-backdrop/my-backdrop.css +1 -1
  41. package/dist/collection/components/my-backdrop/my-backdrop.js +11 -7
  42. package/dist/collection/components/my-backdrop/my-backdrop.js.map +1 -0
  43. package/dist/collection/components/my-colorbox/my-colorbox.css +1 -1
  44. package/dist/collection/components/my-colorbox/my-colorbox.js +120 -108
  45. package/dist/collection/components/my-colorbox/my-colorbox.js.map +1 -0
  46. package/dist/collection/components/my-colorinfo/my-colorinfo.js +152 -162
  47. package/dist/collection/components/my-colorinfo/my-colorinfo.js.map +1 -0
  48. package/dist/collection/components/my-component/my-component.js +101 -75
  49. package/dist/collection/components/my-component/my-component.js.map +1 -0
  50. package/dist/collection/components/my-loader/my-loader.js +14 -13
  51. package/dist/collection/components/my-loader/my-loader.js.map +1 -0
  52. package/dist/collection/components/my-modal/my-modal.css +11 -1
  53. package/dist/collection/components/my-modal/my-modal.js +230 -212
  54. package/dist/collection/components/my-modal/my-modal.js.map +1 -0
  55. package/dist/collection/components/my-search/my-search.css +1 -1
  56. package/dist/collection/components/my-search/my-search.js +102 -90
  57. package/dist/collection/components/my-search/my-search.js.map +1 -0
  58. package/dist/collection/components/my-slider/index.js +95 -92
  59. package/dist/collection/components/my-slider/index.js.map +1 -0
  60. package/dist/collection/components/my-slider/my-slider.css +5 -5
  61. package/dist/collection/gtmUtils.js +1 -0
  62. package/dist/collection/gtmUtils.js.map +1 -0
  63. package/dist/collection/index.js +1 -0
  64. package/dist/collection/index.js.map +1 -0
  65. package/dist/collection/types.js +1 -0
  66. package/dist/collection/types.js.map +1 -0
  67. package/dist/components/gtmUtils.js +2 -0
  68. package/dist/components/gtmUtils.js.map +1 -0
  69. package/dist/components/index.d.ts +9 -11
  70. package/dist/components/index.js +7 -9
  71. package/dist/components/index.js.map +1 -0
  72. package/dist/components/index2.js +6393 -635
  73. package/dist/components/index2.js.map +1 -0
  74. package/dist/components/my-backdrop.js +2 -0
  75. package/dist/components/my-backdrop.js.map +1 -0
  76. package/dist/components/my-backdrop2.js +3 -1
  77. package/dist/components/my-backdrop2.js.map +1 -0
  78. package/dist/components/my-colorbox.js +2 -0
  79. package/dist/components/my-colorbox.js.map +1 -0
  80. package/dist/components/my-colorbox2.js +9 -1
  81. package/dist/components/my-colorbox2.js.map +1 -0
  82. package/dist/components/my-colorinfo.js +2 -0
  83. package/dist/components/my-colorinfo.js.map +1 -0
  84. package/dist/components/my-colorinfo2.js +9 -3
  85. package/dist/components/my-colorinfo2.js.map +1 -0
  86. package/dist/components/my-component.js +18 -2
  87. package/dist/components/my-component.js.map +1 -0
  88. package/dist/components/my-loader.js +2 -0
  89. package/dist/components/my-loader.js.map +1 -0
  90. package/dist/components/my-loader2.js +4 -2
  91. package/dist/components/my-loader2.js.map +1 -0
  92. package/dist/components/my-modal.js +2 -0
  93. package/dist/components/my-modal.js.map +1 -0
  94. package/dist/components/my-modal2.js +126 -37
  95. package/dist/components/my-modal2.js.map +1 -0
  96. package/dist/components/my-search.js +2 -0
  97. package/dist/components/my-search.js.map +1 -0
  98. package/dist/components/my-search2.js +7 -3
  99. package/dist/components/my-search2.js.map +1 -0
  100. package/dist/components/my-slider.js +2 -0
  101. package/dist/components/my-slider.js.map +1 -0
  102. package/dist/esm/app-globals-0f993ce5.js +5 -0
  103. package/dist/esm/app-globals-0f993ce5.js.map +1 -0
  104. package/dist/esm/css-shim-5eb36939.js +6 -0
  105. package/dist/esm/css-shim-5eb36939.js.map +1 -0
  106. package/dist/esm/dom-c0f8af80.js +75 -0
  107. package/dist/esm/dom-c0f8af80.js.map +1 -0
  108. package/dist/esm/gtmUtils-dcdac4ce.js +7 -0
  109. package/dist/esm/gtmUtils-dcdac4ce.js.map +1 -0
  110. package/dist/esm/index-c3dfdbab.js +3397 -0
  111. package/dist/esm/index-c3dfdbab.js.map +1 -0
  112. package/dist/esm/index.js +2 -0
  113. package/dist/esm/index.js.map +1 -0
  114. package/dist/esm/loader.js +24 -3
  115. package/dist/esm/loader.js.map +1 -0
  116. package/dist/esm/my-backdrop.entry.js +17 -0
  117. package/dist/esm/my-backdrop.entry.js.map +1 -0
  118. package/dist/esm/my-colorbox.entry.js +48 -0
  119. package/dist/esm/my-colorbox.entry.js.map +1 -0
  120. package/dist/esm/my-colorinfo.entry.js +42 -0
  121. package/dist/esm/my-colorinfo.entry.js.map +1 -0
  122. package/dist/esm/my-component.entry.js +167 -0
  123. package/dist/esm/my-component.entry.js.map +1 -0
  124. package/dist/esm/my-loader.entry.js +17 -0
  125. package/dist/esm/my-loader.entry.js.map +1 -0
  126. package/dist/esm/my-modal.entry.js +2475 -0
  127. package/dist/esm/my-modal.entry.js.map +1 -0
  128. package/dist/esm/my-search.entry.js +40 -0
  129. package/dist/esm/my-search.entry.js.map +1 -0
  130. package/dist/esm/my-slider.entry.js +11197 -0
  131. package/dist/esm/my-slider.entry.js.map +1 -0
  132. package/dist/esm/pallete.js +151 -5
  133. package/dist/esm/pallete.js.map +1 -0
  134. package/dist/esm/polyfills/css-shim.js +1 -1
  135. package/dist/esm/shadow-css-12b9a099.js +389 -0
  136. package/dist/esm/shadow-css-12b9a099.js.map +1 -0
  137. package/dist/pallete/app-globals-0f993ce5.js +5 -0
  138. package/dist/pallete/app-globals-0f993ce5.js.map +1 -0
  139. package/dist/pallete/css-shim-5eb36939.js +6 -0
  140. package/dist/pallete/css-shim-5eb36939.js.map +1 -0
  141. package/dist/pallete/dom-c0f8af80.js +75 -0
  142. package/dist/pallete/dom-c0f8af80.js.map +1 -0
  143. package/dist/pallete/gtmUtils-dcdac4ce.js +7 -0
  144. package/dist/pallete/gtmUtils-dcdac4ce.js.map +1 -0
  145. package/dist/pallete/index-591def6b.js +3397 -0
  146. package/dist/pallete/index-591def6b.js.map +1 -0
  147. package/dist/pallete/index-c3dfdbab.js +3397 -0
  148. package/dist/pallete/index-c3dfdbab.js.map +1 -0
  149. package/dist/pallete/index.esm.js +3 -0
  150. package/dist/pallete/index.esm.js.map +1 -0
  151. package/dist/pallete/my-backdrop.entry.js +17 -0
  152. package/dist/pallete/my-backdrop.entry.js.map +1 -0
  153. package/dist/pallete/my-colorbox.entry.js +48 -0
  154. package/dist/pallete/my-colorbox.entry.js.map +1 -0
  155. package/dist/pallete/my-colorinfo.entry.js +42 -0
  156. package/dist/pallete/my-colorinfo.entry.js.map +1 -0
  157. package/dist/pallete/my-component.entry.js +167 -0
  158. package/dist/pallete/my-component.entry.js.map +1 -0
  159. package/dist/pallete/my-loader.entry.js +17 -0
  160. package/dist/pallete/my-loader.entry.js.map +1 -0
  161. package/dist/pallete/my-modal.entry.js +2475 -0
  162. package/dist/pallete/my-modal.entry.js.map +1 -0
  163. package/dist/pallete/my-search.entry.js +40 -0
  164. package/dist/pallete/my-search.entry.js.map +1 -0
  165. package/dist/pallete/my-slider.entry.js +11197 -0
  166. package/dist/pallete/my-slider.entry.js.map +1 -0
  167. package/dist/pallete/pallete.css +3 -1
  168. package/dist/pallete/pallete.esm.js +163 -1
  169. package/dist/pallete/pallete.esm.js.map +1 -0
  170. package/dist/pallete/shadow-css-12b9a099.js +389 -0
  171. package/dist/pallete/shadow-css-12b9a099.js.map +1 -0
  172. package/dist/types/components/api/services.d.ts +1 -1
  173. package/dist/types/components/my-component/my-component.d.ts +2 -0
  174. package/dist/types/components/my-modal/my-modal.d.ts +3 -1
  175. package/dist/types/components.d.ts +2 -0
  176. package/dist/types/stencil-public-runtime.d.ts +91 -19
  177. package/dist/types/types.d.ts +8 -8
  178. package/loader/index.d.ts +9 -0
  179. package/loader/package.json +1 -0
  180. package/package.json +22 -6
  181. package/www/build/app-globals-0f993ce5.js +5 -0
  182. package/www/build/app-globals-0f993ce5.js.map +1 -0
  183. package/www/build/css-shim-5eb36939.js +6 -0
  184. package/www/build/css-shim-5eb36939.js.map +1 -0
  185. package/www/build/dom-c0f8af80.js +75 -0
  186. package/www/build/dom-c0f8af80.js.map +1 -0
  187. package/www/build/gtmUtils-dcdac4ce.js +7 -0
  188. package/www/build/gtmUtils-dcdac4ce.js.map +1 -0
  189. package/www/build/index-591def6b.js +3397 -0
  190. package/www/build/index-591def6b.js.map +1 -0
  191. package/www/build/index-c3dfdbab.js +3397 -0
  192. package/www/build/index-c3dfdbab.js.map +1 -0
  193. package/www/build/index.esm.js +3 -0
  194. package/www/build/index.esm.js.map +1 -0
  195. package/www/build/my-backdrop.entry.js +17 -0
  196. package/www/build/my-backdrop.entry.js.map +1 -0
  197. package/www/build/my-colorbox.entry.js +48 -0
  198. package/www/build/my-colorbox.entry.js.map +1 -0
  199. package/www/build/my-colorinfo.entry.js +42 -0
  200. package/www/build/my-colorinfo.entry.js.map +1 -0
  201. package/www/build/my-component.entry.js +167 -0
  202. package/www/build/my-component.entry.js.map +1 -0
  203. package/www/build/my-loader.entry.js +17 -0
  204. package/www/build/my-loader.entry.js.map +1 -0
  205. package/www/build/my-modal.entry.js +2475 -0
  206. package/www/build/my-modal.entry.js.map +1 -0
  207. package/www/build/my-search.entry.js +40 -0
  208. package/www/build/my-search.entry.js.map +1 -0
  209. package/www/build/my-slider.entry.js +11197 -0
  210. package/www/build/my-slider.entry.js.map +1 -0
  211. package/www/build/pallete.css +3 -1
  212. package/www/build/pallete.esm.js +163 -1
  213. package/www/build/pallete.esm.js.map +1 -0
  214. package/www/build/shadow-css-12b9a099.js +389 -0
  215. package/www/build/shadow-css-12b9a099.js.map +1 -0
  216. package/www/index.html +11 -2
  217. package/dist/cjs/index-029079e0.js +0 -1365
  218. package/dist/cjs/my-backdrop_8.cjs.entry.js +0 -8109
  219. package/dist/esm/index-faf4241e.js +0 -1337
  220. package/dist/esm/my-backdrop_8.entry.js +0 -8098
  221. package/dist/pallete/p-562ae52f.js +0 -2
  222. package/dist/pallete/p-faa6539f.entry.js +0 -1
  223. package/www/build/p-4e631238.css +0 -1
  224. package/www/build/p-562ae52f.js +0 -2
  225. package/www/build/p-5ec8080b.js +0 -1
  226. package/www/build/p-faa6539f.entry.js +0 -1
@@ -0,0 +1,2475 @@
1
+ import { r as registerInstance, e as createEvent, h, f as getAssetPath, g as getElement } from './index-c3dfdbab.js';
2
+ import { s as setDataLayer } from './gtmUtils-dcdac4ce.js';
3
+
4
+ const APIURL = 'https://pallete-colors-backend.herokuapp.com';
5
+ class API {
6
+ async getData(ep) {
7
+ try {
8
+ const request = await fetch(`${APIURL}/api/${ep}`, {
9
+ method: 'GET',
10
+ headers: {
11
+ 'Content-Type': 'application/json',
12
+ },
13
+ });
14
+ const response = await request.json();
15
+ return response;
16
+ }
17
+ catch (error) {
18
+ console.error(error);
19
+ }
20
+ }
21
+ }
22
+ const ApiService = new API();
23
+
24
+ 'use strict';
25
+
26
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
27
+ var shams = function hasSymbols() {
28
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
29
+ if (typeof Symbol.iterator === 'symbol') { return true; }
30
+
31
+ var obj = {};
32
+ var sym = Symbol('test');
33
+ var symObj = Object(sym);
34
+ if (typeof sym === 'string') { return false; }
35
+
36
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
37
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
38
+
39
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
40
+ // if (sym instanceof Symbol) { return false; }
41
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
42
+ // if (!(symObj instanceof Symbol)) { return false; }
43
+
44
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
45
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
46
+
47
+ var symVal = 42;
48
+ obj[sym] = symVal;
49
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
50
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
51
+
52
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
53
+
54
+ var syms = Object.getOwnPropertySymbols(obj);
55
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
56
+
57
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
58
+
59
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
60
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
61
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
62
+ }
63
+
64
+ return true;
65
+ };
66
+
67
+ 'use strict';
68
+
69
+ var origSymbol = typeof Symbol !== 'undefined' && Symbol;
70
+
71
+
72
+ var hasSymbols$1 = function hasNativeSymbols() {
73
+ if (typeof origSymbol !== 'function') { return false; }
74
+ if (typeof Symbol !== 'function') { return false; }
75
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
76
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
77
+
78
+ return shams();
79
+ };
80
+
81
+ 'use strict';
82
+
83
+ /* eslint no-invalid-this: 1 */
84
+
85
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
86
+ var slice = Array.prototype.slice;
87
+ var toStr$1 = Object.prototype.toString;
88
+ var funcType = '[object Function]';
89
+
90
+ var implementation = function bind(that) {
91
+ var target = this;
92
+ if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
93
+ throw new TypeError(ERROR_MESSAGE + target);
94
+ }
95
+ var args = slice.call(arguments, 1);
96
+
97
+ var bound;
98
+ var binder = function () {
99
+ if (this instanceof bound) {
100
+ var result = target.apply(
101
+ this,
102
+ args.concat(slice.call(arguments))
103
+ );
104
+ if (Object(result) === result) {
105
+ return result;
106
+ }
107
+ return this;
108
+ } else {
109
+ return target.apply(
110
+ that,
111
+ args.concat(slice.call(arguments))
112
+ );
113
+ }
114
+ };
115
+
116
+ var boundLength = Math.max(0, target.length - args.length);
117
+ var boundArgs = [];
118
+ for (var i = 0; i < boundLength; i++) {
119
+ boundArgs.push('$' + i);
120
+ }
121
+
122
+ bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
123
+
124
+ if (target.prototype) {
125
+ var Empty = function Empty() {};
126
+ Empty.prototype = target.prototype;
127
+ bound.prototype = new Empty();
128
+ Empty.prototype = null;
129
+ }
130
+
131
+ return bound;
132
+ };
133
+
134
+ 'use strict';
135
+
136
+
137
+
138
+ var functionBind = Function.prototype.bind || implementation;
139
+
140
+ 'use strict';
141
+
142
+
143
+
144
+ var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
145
+
146
+ 'use strict';
147
+
148
+ var undefined$1;
149
+
150
+ var $SyntaxError = SyntaxError;
151
+ var $Function = Function;
152
+ var $TypeError$1 = TypeError;
153
+
154
+ // eslint-disable-next-line consistent-return
155
+ var getEvalledConstructor = function (expressionSyntax) {
156
+ try {
157
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
158
+ } catch (e) {}
159
+ };
160
+
161
+ var $gOPD = Object.getOwnPropertyDescriptor;
162
+ if ($gOPD) {
163
+ try {
164
+ $gOPD({}, '');
165
+ } catch (e) {
166
+ $gOPD = null; // this is IE 8, which has a broken gOPD
167
+ }
168
+ }
169
+
170
+ var throwTypeError = function () {
171
+ throw new $TypeError$1();
172
+ };
173
+ var ThrowTypeError = $gOPD
174
+ ? (function () {
175
+ try {
176
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
177
+ arguments.callee; // IE 8 does not throw here
178
+ return throwTypeError;
179
+ } catch (calleeThrows) {
180
+ try {
181
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
182
+ return $gOPD(arguments, 'callee').get;
183
+ } catch (gOPDthrows) {
184
+ return throwTypeError;
185
+ }
186
+ }
187
+ }())
188
+ : throwTypeError;
189
+
190
+ var hasSymbols = hasSymbols$1();
191
+
192
+ var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
193
+
194
+ var needsEval = {};
195
+
196
+ var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
197
+
198
+ var INTRINSICS = {
199
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
200
+ '%Array%': Array,
201
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
202
+ '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined$1,
203
+ '%AsyncFromSyncIteratorPrototype%': undefined$1,
204
+ '%AsyncFunction%': needsEval,
205
+ '%AsyncGenerator%': needsEval,
206
+ '%AsyncGeneratorFunction%': needsEval,
207
+ '%AsyncIteratorPrototype%': needsEval,
208
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
209
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
210
+ '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
211
+ '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
212
+ '%Boolean%': Boolean,
213
+ '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
214
+ '%Date%': Date,
215
+ '%decodeURI%': decodeURI,
216
+ '%decodeURIComponent%': decodeURIComponent,
217
+ '%encodeURI%': encodeURI,
218
+ '%encodeURIComponent%': encodeURIComponent,
219
+ '%Error%': Error,
220
+ '%eval%': eval, // eslint-disable-line no-eval
221
+ '%EvalError%': EvalError,
222
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
223
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
224
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
225
+ '%Function%': $Function,
226
+ '%GeneratorFunction%': needsEval,
227
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
228
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
229
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
230
+ '%isFinite%': isFinite,
231
+ '%isNaN%': isNaN,
232
+ '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
233
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
234
+ '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
235
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
236
+ '%Math%': Math,
237
+ '%Number%': Number,
238
+ '%Object%': Object,
239
+ '%parseFloat%': parseFloat,
240
+ '%parseInt%': parseInt,
241
+ '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
242
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
243
+ '%RangeError%': RangeError,
244
+ '%ReferenceError%': ReferenceError,
245
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
246
+ '%RegExp%': RegExp,
247
+ '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
248
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
249
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
250
+ '%String%': String,
251
+ '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined$1,
252
+ '%Symbol%': hasSymbols ? Symbol : undefined$1,
253
+ '%SyntaxError%': $SyntaxError,
254
+ '%ThrowTypeError%': ThrowTypeError,
255
+ '%TypedArray%': TypedArray,
256
+ '%TypeError%': $TypeError$1,
257
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
258
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
259
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
260
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
261
+ '%URIError%': URIError,
262
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
263
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
264
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
265
+ };
266
+
267
+ try {
268
+ null.error; // eslint-disable-line no-unused-expressions
269
+ } catch (e) {
270
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
271
+ var errorProto = getProto(getProto(e));
272
+ INTRINSICS['%Error.prototype%'] = errorProto;
273
+ }
274
+
275
+ var doEval = function doEval(name) {
276
+ var value;
277
+ if (name === '%AsyncFunction%') {
278
+ value = getEvalledConstructor('async function () {}');
279
+ } else if (name === '%GeneratorFunction%') {
280
+ value = getEvalledConstructor('function* () {}');
281
+ } else if (name === '%AsyncGeneratorFunction%') {
282
+ value = getEvalledConstructor('async function* () {}');
283
+ } else if (name === '%AsyncGenerator%') {
284
+ var fn = doEval('%AsyncGeneratorFunction%');
285
+ if (fn) {
286
+ value = fn.prototype;
287
+ }
288
+ } else if (name === '%AsyncIteratorPrototype%') {
289
+ var gen = doEval('%AsyncGenerator%');
290
+ if (gen) {
291
+ value = getProto(gen.prototype);
292
+ }
293
+ }
294
+
295
+ INTRINSICS[name] = value;
296
+
297
+ return value;
298
+ };
299
+
300
+ var LEGACY_ALIASES = {
301
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
302
+ '%ArrayPrototype%': ['Array', 'prototype'],
303
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
304
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
305
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
306
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
307
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
308
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
309
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
310
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
311
+ '%DataViewPrototype%': ['DataView', 'prototype'],
312
+ '%DatePrototype%': ['Date', 'prototype'],
313
+ '%ErrorPrototype%': ['Error', 'prototype'],
314
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
315
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
316
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
317
+ '%FunctionPrototype%': ['Function', 'prototype'],
318
+ '%Generator%': ['GeneratorFunction', 'prototype'],
319
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
320
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
321
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
322
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
323
+ '%JSONParse%': ['JSON', 'parse'],
324
+ '%JSONStringify%': ['JSON', 'stringify'],
325
+ '%MapPrototype%': ['Map', 'prototype'],
326
+ '%NumberPrototype%': ['Number', 'prototype'],
327
+ '%ObjectPrototype%': ['Object', 'prototype'],
328
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
329
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
330
+ '%PromisePrototype%': ['Promise', 'prototype'],
331
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
332
+ '%Promise_all%': ['Promise', 'all'],
333
+ '%Promise_reject%': ['Promise', 'reject'],
334
+ '%Promise_resolve%': ['Promise', 'resolve'],
335
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
336
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
337
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
338
+ '%SetPrototype%': ['Set', 'prototype'],
339
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
340
+ '%StringPrototype%': ['String', 'prototype'],
341
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
342
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
343
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
344
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
345
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
346
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
347
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
348
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
349
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
350
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
351
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
352
+ };
353
+
354
+
355
+
356
+ var $concat$1 = functionBind.call(Function.call, Array.prototype.concat);
357
+ var $spliceApply = functionBind.call(Function.apply, Array.prototype.splice);
358
+ var $replace$1 = functionBind.call(Function.call, String.prototype.replace);
359
+ var $strSlice = functionBind.call(Function.call, String.prototype.slice);
360
+ var $exec = functionBind.call(Function.call, RegExp.prototype.exec);
361
+
362
+ /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
363
+ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
364
+ var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
365
+ var stringToPath = function stringToPath(string) {
366
+ var first = $strSlice(string, 0, 1);
367
+ var last = $strSlice(string, -1);
368
+ if (first === '%' && last !== '%') {
369
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
370
+ } else if (last === '%' && first !== '%') {
371
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
372
+ }
373
+ var result = [];
374
+ $replace$1(string, rePropName, function (match, number, quote, subString) {
375
+ result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
376
+ });
377
+ return result;
378
+ };
379
+ /* end adaptation */
380
+
381
+ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
382
+ var intrinsicName = name;
383
+ var alias;
384
+ if (src(LEGACY_ALIASES, intrinsicName)) {
385
+ alias = LEGACY_ALIASES[intrinsicName];
386
+ intrinsicName = '%' + alias[0] + '%';
387
+ }
388
+
389
+ if (src(INTRINSICS, intrinsicName)) {
390
+ var value = INTRINSICS[intrinsicName];
391
+ if (value === needsEval) {
392
+ value = doEval(intrinsicName);
393
+ }
394
+ if (typeof value === 'undefined' && !allowMissing) {
395
+ throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
396
+ }
397
+
398
+ return {
399
+ alias: alias,
400
+ name: intrinsicName,
401
+ value: value
402
+ };
403
+ }
404
+
405
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
406
+ };
407
+
408
+ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
409
+ if (typeof name !== 'string' || name.length === 0) {
410
+ throw new $TypeError$1('intrinsic name must be a non-empty string');
411
+ }
412
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
413
+ throw new $TypeError$1('"allowMissing" argument must be a boolean');
414
+ }
415
+
416
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
417
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
418
+ }
419
+ var parts = stringToPath(name);
420
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
421
+
422
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
423
+ var intrinsicRealName = intrinsic.name;
424
+ var value = intrinsic.value;
425
+ var skipFurtherCaching = false;
426
+
427
+ var alias = intrinsic.alias;
428
+ if (alias) {
429
+ intrinsicBaseName = alias[0];
430
+ $spliceApply(parts, $concat$1([0, 1], alias));
431
+ }
432
+
433
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
434
+ var part = parts[i];
435
+ var first = $strSlice(part, 0, 1);
436
+ var last = $strSlice(part, -1);
437
+ if (
438
+ (
439
+ (first === '"' || first === "'" || first === '`')
440
+ || (last === '"' || last === "'" || last === '`')
441
+ )
442
+ && first !== last
443
+ ) {
444
+ throw new $SyntaxError('property names with quotes must have matching quotes');
445
+ }
446
+ if (part === 'constructor' || !isOwn) {
447
+ skipFurtherCaching = true;
448
+ }
449
+
450
+ intrinsicBaseName += '.' + part;
451
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
452
+
453
+ if (src(INTRINSICS, intrinsicRealName)) {
454
+ value = INTRINSICS[intrinsicRealName];
455
+ } else if (value != null) {
456
+ if (!(part in value)) {
457
+ if (!allowMissing) {
458
+ throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
459
+ }
460
+ return void undefined$1;
461
+ }
462
+ if ($gOPD && (i + 1) >= parts.length) {
463
+ var desc = $gOPD(value, part);
464
+ isOwn = !!desc;
465
+
466
+ // By convention, when a data property is converted to an accessor
467
+ // property to emulate a data property that does not suffer from
468
+ // the override mistake, that accessor's getter is marked with
469
+ // an `originalValue` property. Here, when we detect this, we
470
+ // uphold the illusion by pretending to see that original data
471
+ // property, i.e., returning the value rather than the getter
472
+ // itself.
473
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
474
+ value = desc.get;
475
+ } else {
476
+ value = value[part];
477
+ }
478
+ } else {
479
+ isOwn = src(value, part);
480
+ value = value[part];
481
+ }
482
+
483
+ if (isOwn && !skipFurtherCaching) {
484
+ INTRINSICS[intrinsicRealName] = value;
485
+ }
486
+ }
487
+ }
488
+ return value;
489
+ };
490
+
491
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
492
+
493
+ function getDefaultExportFromCjs (x) {
494
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
495
+ }
496
+
497
+ function createCommonjsModule(fn, basedir, module) {
498
+ return module = {
499
+ path: basedir,
500
+ exports: {},
501
+ require: function (path, base) {
502
+ return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
503
+ }
504
+ }, fn(module, module.exports), module.exports;
505
+ }
506
+
507
+ function getDefaultExportFromNamespaceIfPresent (n) {
508
+ return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
509
+ }
510
+
511
+ function getDefaultExportFromNamespaceIfNotNamed (n) {
512
+ return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
513
+ }
514
+
515
+ function getAugmentedNamespace(n) {
516
+ if (n.__esModule) return n;
517
+ var a = Object.defineProperty({}, '__esModule', {value: true});
518
+ Object.keys(n).forEach(function (k) {
519
+ var d = Object.getOwnPropertyDescriptor(n, k);
520
+ Object.defineProperty(a, k, d.get ? d : {
521
+ enumerable: true,
522
+ get: function () {
523
+ return n[k];
524
+ }
525
+ });
526
+ });
527
+ return a;
528
+ }
529
+
530
+ function commonjsRequire () {
531
+ throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
532
+ }
533
+
534
+ var callBind = createCommonjsModule(function (module) {
535
+ 'use strict';
536
+
537
+
538
+
539
+
540
+ var $apply = getIntrinsic('%Function.prototype.apply%');
541
+ var $call = getIntrinsic('%Function.prototype.call%');
542
+ var $reflectApply = getIntrinsic('%Reflect.apply%', true) || functionBind.call($call, $apply);
543
+
544
+ var $gOPD = getIntrinsic('%Object.getOwnPropertyDescriptor%', true);
545
+ var $defineProperty = getIntrinsic('%Object.defineProperty%', true);
546
+ var $max = getIntrinsic('%Math.max%');
547
+
548
+ if ($defineProperty) {
549
+ try {
550
+ $defineProperty({}, 'a', { value: 1 });
551
+ } catch (e) {
552
+ // IE 8 has a broken defineProperty
553
+ $defineProperty = null;
554
+ }
555
+ }
556
+
557
+ module.exports = function callBind(originalFunction) {
558
+ var func = $reflectApply(functionBind, $call, arguments);
559
+ if ($gOPD && $defineProperty) {
560
+ var desc = $gOPD(func, 'length');
561
+ if (desc.configurable) {
562
+ // original length, plus the receiver, minus any additional arguments (after the receiver)
563
+ $defineProperty(
564
+ func,
565
+ 'length',
566
+ { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
567
+ );
568
+ }
569
+ }
570
+ return func;
571
+ };
572
+
573
+ var applyBind = function applyBind() {
574
+ return $reflectApply(functionBind, $apply, arguments);
575
+ };
576
+
577
+ if ($defineProperty) {
578
+ $defineProperty(module.exports, 'apply', { value: applyBind });
579
+ } else {
580
+ module.exports.apply = applyBind;
581
+ }
582
+ });
583
+
584
+ 'use strict';
585
+
586
+
587
+
588
+
589
+
590
+ var $indexOf = callBind(getIntrinsic('String.prototype.indexOf'));
591
+
592
+ var callBound = function callBoundIntrinsic(name, allowMissing) {
593
+ var intrinsic = getIntrinsic(name, !!allowMissing);
594
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
595
+ return callBind(intrinsic);
596
+ }
597
+ return intrinsic;
598
+ };
599
+
600
+ const _nodeResolve_empty = {};
601
+
602
+ const _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({
603
+ __proto__: null,
604
+ 'default': _nodeResolve_empty
605
+ });
606
+
607
+ const utilInspect = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1);
608
+
609
+ var hasMap = typeof Map === 'function' && Map.prototype;
610
+ var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
611
+ var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
612
+ var mapForEach = hasMap && Map.prototype.forEach;
613
+ var hasSet = typeof Set === 'function' && Set.prototype;
614
+ var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
615
+ var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
616
+ var setForEach = hasSet && Set.prototype.forEach;
617
+ var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
618
+ var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
619
+ var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
620
+ var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
621
+ var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
622
+ var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
623
+ var booleanValueOf = Boolean.prototype.valueOf;
624
+ var objectToString = Object.prototype.toString;
625
+ var functionToString = Function.prototype.toString;
626
+ var $match = String.prototype.match;
627
+ var $slice = String.prototype.slice;
628
+ var $replace = String.prototype.replace;
629
+ var $toUpperCase = String.prototype.toUpperCase;
630
+ var $toLowerCase = String.prototype.toLowerCase;
631
+ var $test = RegExp.prototype.test;
632
+ var $concat = Array.prototype.concat;
633
+ var $join = Array.prototype.join;
634
+ var $arrSlice = Array.prototype.slice;
635
+ var $floor = Math.floor;
636
+ var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
637
+ var gOPS = Object.getOwnPropertySymbols;
638
+ var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
639
+ var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
640
+ // ie, `has-tostringtag/shams
641
+ var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
642
+ ? Symbol.toStringTag
643
+ : null;
644
+ var isEnumerable = Object.prototype.propertyIsEnumerable;
645
+
646
+ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
647
+ [].__proto__ === Array.prototype // eslint-disable-line no-proto
648
+ ? function (O) {
649
+ return O.__proto__; // eslint-disable-line no-proto
650
+ }
651
+ : null
652
+ );
653
+
654
+ function addNumericSeparator(num, str) {
655
+ if (
656
+ num === Infinity
657
+ || num === -Infinity
658
+ || num !== num
659
+ || (num && num > -1000 && num < 1000)
660
+ || $test.call(/e/, str)
661
+ ) {
662
+ return str;
663
+ }
664
+ var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
665
+ if (typeof num === 'number') {
666
+ var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
667
+ if (int !== num) {
668
+ var intStr = String(int);
669
+ var dec = $slice.call(str, intStr.length + 1);
670
+ return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
671
+ }
672
+ }
673
+ return $replace.call(str, sepRegex, '$&_');
674
+ }
675
+
676
+
677
+ var inspectCustom = utilInspect.custom;
678
+ var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
679
+
680
+ var objectInspect = function inspect_(obj, options, depth, seen) {
681
+ var opts = options || {};
682
+
683
+ if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
684
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
685
+ }
686
+ if (
687
+ has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
688
+ ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
689
+ : opts.maxStringLength !== null
690
+ )
691
+ ) {
692
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
693
+ }
694
+ var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
695
+ if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
696
+ throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
697
+ }
698
+
699
+ if (
700
+ has$3(opts, 'indent')
701
+ && opts.indent !== null
702
+ && opts.indent !== '\t'
703
+ && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
704
+ ) {
705
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
706
+ }
707
+ if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
708
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
709
+ }
710
+ var numericSeparator = opts.numericSeparator;
711
+
712
+ if (typeof obj === 'undefined') {
713
+ return 'undefined';
714
+ }
715
+ if (obj === null) {
716
+ return 'null';
717
+ }
718
+ if (typeof obj === 'boolean') {
719
+ return obj ? 'true' : 'false';
720
+ }
721
+
722
+ if (typeof obj === 'string') {
723
+ return inspectString(obj, opts);
724
+ }
725
+ if (typeof obj === 'number') {
726
+ if (obj === 0) {
727
+ return Infinity / obj > 0 ? '0' : '-0';
728
+ }
729
+ var str = String(obj);
730
+ return numericSeparator ? addNumericSeparator(obj, str) : str;
731
+ }
732
+ if (typeof obj === 'bigint') {
733
+ var bigIntStr = String(obj) + 'n';
734
+ return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
735
+ }
736
+
737
+ var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
738
+ if (typeof depth === 'undefined') { depth = 0; }
739
+ if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
740
+ return isArray$3(obj) ? '[Array]' : '[Object]';
741
+ }
742
+
743
+ var indent = getIndent(opts, depth);
744
+
745
+ if (typeof seen === 'undefined') {
746
+ seen = [];
747
+ } else if (indexOf(seen, obj) >= 0) {
748
+ return '[Circular]';
749
+ }
750
+
751
+ function inspect(value, from, noIndent) {
752
+ if (from) {
753
+ seen = $arrSlice.call(seen);
754
+ seen.push(from);
755
+ }
756
+ if (noIndent) {
757
+ var newOpts = {
758
+ depth: opts.depth
759
+ };
760
+ if (has$3(opts, 'quoteStyle')) {
761
+ newOpts.quoteStyle = opts.quoteStyle;
762
+ }
763
+ return inspect_(value, newOpts, depth + 1, seen);
764
+ }
765
+ return inspect_(value, opts, depth + 1, seen);
766
+ }
767
+
768
+ if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
769
+ var name = nameOf(obj);
770
+ var keys = arrObjKeys(obj, inspect);
771
+ return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
772
+ }
773
+ if (isSymbol(obj)) {
774
+ var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
775
+ return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
776
+ }
777
+ if (isElement(obj)) {
778
+ var s = '<' + $toLowerCase.call(String(obj.nodeName));
779
+ var attrs = obj.attributes || [];
780
+ for (var i = 0; i < attrs.length; i++) {
781
+ s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
782
+ }
783
+ s += '>';
784
+ if (obj.childNodes && obj.childNodes.length) { s += '...'; }
785
+ s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
786
+ return s;
787
+ }
788
+ if (isArray$3(obj)) {
789
+ if (obj.length === 0) { return '[]'; }
790
+ var xs = arrObjKeys(obj, inspect);
791
+ if (indent && !singleLineValues(xs)) {
792
+ return '[' + indentedJoin(xs, indent) + ']';
793
+ }
794
+ return '[ ' + $join.call(xs, ', ') + ' ]';
795
+ }
796
+ if (isError(obj)) {
797
+ var parts = arrObjKeys(obj, inspect);
798
+ if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
799
+ return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
800
+ }
801
+ if (parts.length === 0) { return '[' + String(obj) + ']'; }
802
+ return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
803
+ }
804
+ if (typeof obj === 'object' && customInspect) {
805
+ if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
806
+ return utilInspect(obj, { depth: maxDepth - depth });
807
+ } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
808
+ return obj.inspect();
809
+ }
810
+ }
811
+ if (isMap(obj)) {
812
+ var mapParts = [];
813
+ if (mapForEach) {
814
+ mapForEach.call(obj, function (value, key) {
815
+ mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
816
+ });
817
+ }
818
+ return collectionOf('Map', mapSize.call(obj), mapParts, indent);
819
+ }
820
+ if (isSet(obj)) {
821
+ var setParts = [];
822
+ if (setForEach) {
823
+ setForEach.call(obj, function (value) {
824
+ setParts.push(inspect(value, obj));
825
+ });
826
+ }
827
+ return collectionOf('Set', setSize.call(obj), setParts, indent);
828
+ }
829
+ if (isWeakMap(obj)) {
830
+ return weakCollectionOf('WeakMap');
831
+ }
832
+ if (isWeakSet(obj)) {
833
+ return weakCollectionOf('WeakSet');
834
+ }
835
+ if (isWeakRef(obj)) {
836
+ return weakCollectionOf('WeakRef');
837
+ }
838
+ if (isNumber(obj)) {
839
+ return markBoxed(inspect(Number(obj)));
840
+ }
841
+ if (isBigInt(obj)) {
842
+ return markBoxed(inspect(bigIntValueOf.call(obj)));
843
+ }
844
+ if (isBoolean(obj)) {
845
+ return markBoxed(booleanValueOf.call(obj));
846
+ }
847
+ if (isString(obj)) {
848
+ return markBoxed(inspect(String(obj)));
849
+ }
850
+ if (!isDate(obj) && !isRegExp$1(obj)) {
851
+ var ys = arrObjKeys(obj, inspect);
852
+ var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
853
+ var protoTag = obj instanceof Object ? '' : 'null prototype';
854
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
855
+ var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
856
+ var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
857
+ if (ys.length === 0) { return tag + '{}'; }
858
+ if (indent) {
859
+ return tag + '{' + indentedJoin(ys, indent) + '}';
860
+ }
861
+ return tag + '{ ' + $join.call(ys, ', ') + ' }';
862
+ }
863
+ return String(obj);
864
+ };
865
+
866
+ function wrapQuotes(s, defaultStyle, opts) {
867
+ var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
868
+ return quoteChar + s + quoteChar;
869
+ }
870
+
871
+ function quote(s) {
872
+ return $replace.call(String(s), /"/g, '&quot;');
873
+ }
874
+
875
+ function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
876
+ function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
877
+ function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
878
+ function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
879
+ function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
880
+ function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
881
+ function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
882
+
883
+ // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
884
+ function isSymbol(obj) {
885
+ if (hasShammedSymbols) {
886
+ return obj && typeof obj === 'object' && obj instanceof Symbol;
887
+ }
888
+ if (typeof obj === 'symbol') {
889
+ return true;
890
+ }
891
+ if (!obj || typeof obj !== 'object' || !symToString) {
892
+ return false;
893
+ }
894
+ try {
895
+ symToString.call(obj);
896
+ return true;
897
+ } catch (e) {}
898
+ return false;
899
+ }
900
+
901
+ function isBigInt(obj) {
902
+ if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
903
+ return false;
904
+ }
905
+ try {
906
+ bigIntValueOf.call(obj);
907
+ return true;
908
+ } catch (e) {}
909
+ return false;
910
+ }
911
+
912
+ var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
913
+ function has$3(obj, key) {
914
+ return hasOwn.call(obj, key);
915
+ }
916
+
917
+ function toStr(obj) {
918
+ return objectToString.call(obj);
919
+ }
920
+
921
+ function nameOf(f) {
922
+ if (f.name) { return f.name; }
923
+ var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
924
+ if (m) { return m[1]; }
925
+ return null;
926
+ }
927
+
928
+ function indexOf(xs, x) {
929
+ if (xs.indexOf) { return xs.indexOf(x); }
930
+ for (var i = 0, l = xs.length; i < l; i++) {
931
+ if (xs[i] === x) { return i; }
932
+ }
933
+ return -1;
934
+ }
935
+
936
+ function isMap(x) {
937
+ if (!mapSize || !x || typeof x !== 'object') {
938
+ return false;
939
+ }
940
+ try {
941
+ mapSize.call(x);
942
+ try {
943
+ setSize.call(x);
944
+ } catch (s) {
945
+ return true;
946
+ }
947
+ return x instanceof Map; // core-js workaround, pre-v2.5.0
948
+ } catch (e) {}
949
+ return false;
950
+ }
951
+
952
+ function isWeakMap(x) {
953
+ if (!weakMapHas || !x || typeof x !== 'object') {
954
+ return false;
955
+ }
956
+ try {
957
+ weakMapHas.call(x, weakMapHas);
958
+ try {
959
+ weakSetHas.call(x, weakSetHas);
960
+ } catch (s) {
961
+ return true;
962
+ }
963
+ return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
964
+ } catch (e) {}
965
+ return false;
966
+ }
967
+
968
+ function isWeakRef(x) {
969
+ if (!weakRefDeref || !x || typeof x !== 'object') {
970
+ return false;
971
+ }
972
+ try {
973
+ weakRefDeref.call(x);
974
+ return true;
975
+ } catch (e) {}
976
+ return false;
977
+ }
978
+
979
+ function isSet(x) {
980
+ if (!setSize || !x || typeof x !== 'object') {
981
+ return false;
982
+ }
983
+ try {
984
+ setSize.call(x);
985
+ try {
986
+ mapSize.call(x);
987
+ } catch (m) {
988
+ return true;
989
+ }
990
+ return x instanceof Set; // core-js workaround, pre-v2.5.0
991
+ } catch (e) {}
992
+ return false;
993
+ }
994
+
995
+ function isWeakSet(x) {
996
+ if (!weakSetHas || !x || typeof x !== 'object') {
997
+ return false;
998
+ }
999
+ try {
1000
+ weakSetHas.call(x, weakSetHas);
1001
+ try {
1002
+ weakMapHas.call(x, weakMapHas);
1003
+ } catch (s) {
1004
+ return true;
1005
+ }
1006
+ return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
1007
+ } catch (e) {}
1008
+ return false;
1009
+ }
1010
+
1011
+ function isElement(x) {
1012
+ if (!x || typeof x !== 'object') { return false; }
1013
+ if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
1014
+ return true;
1015
+ }
1016
+ return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
1017
+ }
1018
+
1019
+ function inspectString(str, opts) {
1020
+ if (str.length > opts.maxStringLength) {
1021
+ var remaining = str.length - opts.maxStringLength;
1022
+ var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
1023
+ return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
1024
+ }
1025
+ // eslint-disable-next-line no-control-regex
1026
+ var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
1027
+ return wrapQuotes(s, 'single', opts);
1028
+ }
1029
+
1030
+ function lowbyte(c) {
1031
+ var n = c.charCodeAt(0);
1032
+ var x = {
1033
+ 8: 'b',
1034
+ 9: 't',
1035
+ 10: 'n',
1036
+ 12: 'f',
1037
+ 13: 'r'
1038
+ }[n];
1039
+ if (x) { return '\\' + x; }
1040
+ return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
1041
+ }
1042
+
1043
+ function markBoxed(str) {
1044
+ return 'Object(' + str + ')';
1045
+ }
1046
+
1047
+ function weakCollectionOf(type) {
1048
+ return type + ' { ? }';
1049
+ }
1050
+
1051
+ function collectionOf(type, size, entries, indent) {
1052
+ var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
1053
+ return type + ' (' + size + ') {' + joinedEntries + '}';
1054
+ }
1055
+
1056
+ function singleLineValues(xs) {
1057
+ for (var i = 0; i < xs.length; i++) {
1058
+ if (indexOf(xs[i], '\n') >= 0) {
1059
+ return false;
1060
+ }
1061
+ }
1062
+ return true;
1063
+ }
1064
+
1065
+ function getIndent(opts, depth) {
1066
+ var baseIndent;
1067
+ if (opts.indent === '\t') {
1068
+ baseIndent = '\t';
1069
+ } else if (typeof opts.indent === 'number' && opts.indent > 0) {
1070
+ baseIndent = $join.call(Array(opts.indent + 1), ' ');
1071
+ } else {
1072
+ return null;
1073
+ }
1074
+ return {
1075
+ base: baseIndent,
1076
+ prev: $join.call(Array(depth + 1), baseIndent)
1077
+ };
1078
+ }
1079
+
1080
+ function indentedJoin(xs, indent) {
1081
+ if (xs.length === 0) { return ''; }
1082
+ var lineJoiner = '\n' + indent.prev + indent.base;
1083
+ return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
1084
+ }
1085
+
1086
+ function arrObjKeys(obj, inspect) {
1087
+ var isArr = isArray$3(obj);
1088
+ var xs = [];
1089
+ if (isArr) {
1090
+ xs.length = obj.length;
1091
+ for (var i = 0; i < obj.length; i++) {
1092
+ xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
1093
+ }
1094
+ }
1095
+ var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
1096
+ var symMap;
1097
+ if (hasShammedSymbols) {
1098
+ symMap = {};
1099
+ for (var k = 0; k < syms.length; k++) {
1100
+ symMap['$' + syms[k]] = syms[k];
1101
+ }
1102
+ }
1103
+
1104
+ for (var key in obj) { // eslint-disable-line no-restricted-syntax
1105
+ if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
1106
+ if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
1107
+ if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
1108
+ // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
1109
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
1110
+ } else if ($test.call(/[^\w$]/, key)) {
1111
+ xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
1112
+ } else {
1113
+ xs.push(key + ': ' + inspect(obj[key], obj));
1114
+ }
1115
+ }
1116
+ if (typeof gOPS === 'function') {
1117
+ for (var j = 0; j < syms.length; j++) {
1118
+ if (isEnumerable.call(obj, syms[j])) {
1119
+ xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
1120
+ }
1121
+ }
1122
+ }
1123
+ return xs;
1124
+ }
1125
+
1126
+ 'use strict';
1127
+
1128
+
1129
+
1130
+
1131
+
1132
+ var $TypeError = getIntrinsic('%TypeError%');
1133
+ var $WeakMap = getIntrinsic('%WeakMap%', true);
1134
+ var $Map = getIntrinsic('%Map%', true);
1135
+
1136
+ var $weakMapGet = callBound('WeakMap.prototype.get', true);
1137
+ var $weakMapSet = callBound('WeakMap.prototype.set', true);
1138
+ var $weakMapHas = callBound('WeakMap.prototype.has', true);
1139
+ var $mapGet = callBound('Map.prototype.get', true);
1140
+ var $mapSet = callBound('Map.prototype.set', true);
1141
+ var $mapHas = callBound('Map.prototype.has', true);
1142
+
1143
+ /*
1144
+ * This function traverses the list returning the node corresponding to the
1145
+ * given key.
1146
+ *
1147
+ * That node is also moved to the head of the list, so that if it's accessed
1148
+ * again we don't need to traverse the whole list. By doing so, all the recently
1149
+ * used nodes can be accessed relatively quickly.
1150
+ */
1151
+ var listGetNode = function (list, key) { // eslint-disable-line consistent-return
1152
+ for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
1153
+ if (curr.key === key) {
1154
+ prev.next = curr.next;
1155
+ curr.next = list.next;
1156
+ list.next = curr; // eslint-disable-line no-param-reassign
1157
+ return curr;
1158
+ }
1159
+ }
1160
+ };
1161
+
1162
+ var listGet = function (objects, key) {
1163
+ var node = listGetNode(objects, key);
1164
+ return node && node.value;
1165
+ };
1166
+ var listSet = function (objects, key, value) {
1167
+ var node = listGetNode(objects, key);
1168
+ if (node) {
1169
+ node.value = value;
1170
+ } else {
1171
+ // Prepend the new node to the beginning of the list
1172
+ objects.next = { // eslint-disable-line no-param-reassign
1173
+ key: key,
1174
+ next: objects.next,
1175
+ value: value
1176
+ };
1177
+ }
1178
+ };
1179
+ var listHas = function (objects, key) {
1180
+ return !!listGetNode(objects, key);
1181
+ };
1182
+
1183
+ var sideChannel = function getSideChannel() {
1184
+ var $wm;
1185
+ var $m;
1186
+ var $o;
1187
+ var channel = {
1188
+ assert: function (key) {
1189
+ if (!channel.has(key)) {
1190
+ throw new $TypeError('Side channel does not contain ' + objectInspect(key));
1191
+ }
1192
+ },
1193
+ get: function (key) { // eslint-disable-line consistent-return
1194
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1195
+ if ($wm) {
1196
+ return $weakMapGet($wm, key);
1197
+ }
1198
+ } else if ($Map) {
1199
+ if ($m) {
1200
+ return $mapGet($m, key);
1201
+ }
1202
+ } else {
1203
+ if ($o) { // eslint-disable-line no-lonely-if
1204
+ return listGet($o, key);
1205
+ }
1206
+ }
1207
+ },
1208
+ has: function (key) {
1209
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1210
+ if ($wm) {
1211
+ return $weakMapHas($wm, key);
1212
+ }
1213
+ } else if ($Map) {
1214
+ if ($m) {
1215
+ return $mapHas($m, key);
1216
+ }
1217
+ } else {
1218
+ if ($o) { // eslint-disable-line no-lonely-if
1219
+ return listHas($o, key);
1220
+ }
1221
+ }
1222
+ return false;
1223
+ },
1224
+ set: function (key, value) {
1225
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1226
+ if (!$wm) {
1227
+ $wm = new $WeakMap();
1228
+ }
1229
+ $weakMapSet($wm, key, value);
1230
+ } else if ($Map) {
1231
+ if (!$m) {
1232
+ $m = new $Map();
1233
+ }
1234
+ $mapSet($m, key, value);
1235
+ } else {
1236
+ if (!$o) {
1237
+ /*
1238
+ * Initialize the linked list as an empty node, so that we don't have
1239
+ * to special-case handling of the first node: we can always refer to
1240
+ * it as (previous node).next, instead of something like (list).head
1241
+ */
1242
+ $o = { key: {}, next: null };
1243
+ }
1244
+ listSet($o, key, value);
1245
+ }
1246
+ }
1247
+ };
1248
+ return channel;
1249
+ };
1250
+
1251
+ 'use strict';
1252
+
1253
+ var replace = String.prototype.replace;
1254
+ var percentTwenties = /%20/g;
1255
+
1256
+ var Format = {
1257
+ RFC1738: 'RFC1738',
1258
+ RFC3986: 'RFC3986'
1259
+ };
1260
+
1261
+ var formats = {
1262
+ 'default': Format.RFC3986,
1263
+ formatters: {
1264
+ RFC1738: function (value) {
1265
+ return replace.call(value, percentTwenties, '+');
1266
+ },
1267
+ RFC3986: function (value) {
1268
+ return String(value);
1269
+ }
1270
+ },
1271
+ RFC1738: Format.RFC1738,
1272
+ RFC3986: Format.RFC3986
1273
+ };
1274
+
1275
+ 'use strict';
1276
+
1277
+
1278
+
1279
+ var has$2 = Object.prototype.hasOwnProperty;
1280
+ var isArray$2 = Array.isArray;
1281
+
1282
+ var hexTable = (function () {
1283
+ var array = [];
1284
+ for (var i = 0; i < 256; ++i) {
1285
+ array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
1286
+ }
1287
+
1288
+ return array;
1289
+ }());
1290
+
1291
+ var compactQueue = function compactQueue(queue) {
1292
+ while (queue.length > 1) {
1293
+ var item = queue.pop();
1294
+ var obj = item.obj[item.prop];
1295
+
1296
+ if (isArray$2(obj)) {
1297
+ var compacted = [];
1298
+
1299
+ for (var j = 0; j < obj.length; ++j) {
1300
+ if (typeof obj[j] !== 'undefined') {
1301
+ compacted.push(obj[j]);
1302
+ }
1303
+ }
1304
+
1305
+ item.obj[item.prop] = compacted;
1306
+ }
1307
+ }
1308
+ };
1309
+
1310
+ var arrayToObject = function arrayToObject(source, options) {
1311
+ var obj = options && options.plainObjects ? Object.create(null) : {};
1312
+ for (var i = 0; i < source.length; ++i) {
1313
+ if (typeof source[i] !== 'undefined') {
1314
+ obj[i] = source[i];
1315
+ }
1316
+ }
1317
+
1318
+ return obj;
1319
+ };
1320
+
1321
+ var merge = function merge(target, source, options) {
1322
+ /* eslint no-param-reassign: 0 */
1323
+ if (!source) {
1324
+ return target;
1325
+ }
1326
+
1327
+ if (typeof source !== 'object') {
1328
+ if (isArray$2(target)) {
1329
+ target.push(source);
1330
+ } else if (target && typeof target === 'object') {
1331
+ if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
1332
+ target[source] = true;
1333
+ }
1334
+ } else {
1335
+ return [target, source];
1336
+ }
1337
+
1338
+ return target;
1339
+ }
1340
+
1341
+ if (!target || typeof target !== 'object') {
1342
+ return [target].concat(source);
1343
+ }
1344
+
1345
+ var mergeTarget = target;
1346
+ if (isArray$2(target) && !isArray$2(source)) {
1347
+ mergeTarget = arrayToObject(target, options);
1348
+ }
1349
+
1350
+ if (isArray$2(target) && isArray$2(source)) {
1351
+ source.forEach(function (item, i) {
1352
+ if (has$2.call(target, i)) {
1353
+ var targetItem = target[i];
1354
+ if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
1355
+ target[i] = merge(targetItem, item, options);
1356
+ } else {
1357
+ target.push(item);
1358
+ }
1359
+ } else {
1360
+ target[i] = item;
1361
+ }
1362
+ });
1363
+ return target;
1364
+ }
1365
+
1366
+ return Object.keys(source).reduce(function (acc, key) {
1367
+ var value = source[key];
1368
+
1369
+ if (has$2.call(acc, key)) {
1370
+ acc[key] = merge(acc[key], value, options);
1371
+ } else {
1372
+ acc[key] = value;
1373
+ }
1374
+ return acc;
1375
+ }, mergeTarget);
1376
+ };
1377
+
1378
+ var assign = function assignSingleSource(target, source) {
1379
+ return Object.keys(source).reduce(function (acc, key) {
1380
+ acc[key] = source[key];
1381
+ return acc;
1382
+ }, target);
1383
+ };
1384
+
1385
+ var decode = function (str, decoder, charset) {
1386
+ var strWithoutPlus = str.replace(/\+/g, ' ');
1387
+ if (charset === 'iso-8859-1') {
1388
+ // unescape never throws, no try...catch needed:
1389
+ return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
1390
+ }
1391
+ // utf-8
1392
+ try {
1393
+ return decodeURIComponent(strWithoutPlus);
1394
+ } catch (e) {
1395
+ return strWithoutPlus;
1396
+ }
1397
+ };
1398
+
1399
+ var encode = function encode(str, defaultEncoder, charset, kind, format) {
1400
+ // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
1401
+ // It has been adapted here for stricter adherence to RFC 3986
1402
+ if (str.length === 0) {
1403
+ return str;
1404
+ }
1405
+
1406
+ var string = str;
1407
+ if (typeof str === 'symbol') {
1408
+ string = Symbol.prototype.toString.call(str);
1409
+ } else if (typeof str !== 'string') {
1410
+ string = String(str);
1411
+ }
1412
+
1413
+ if (charset === 'iso-8859-1') {
1414
+ return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
1415
+ return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
1416
+ });
1417
+ }
1418
+
1419
+ var out = '';
1420
+ for (var i = 0; i < string.length; ++i) {
1421
+ var c = string.charCodeAt(i);
1422
+
1423
+ if (
1424
+ c === 0x2D // -
1425
+ || c === 0x2E // .
1426
+ || c === 0x5F // _
1427
+ || c === 0x7E // ~
1428
+ || (c >= 0x30 && c <= 0x39) // 0-9
1429
+ || (c >= 0x41 && c <= 0x5A) // a-z
1430
+ || (c >= 0x61 && c <= 0x7A) // A-Z
1431
+ || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
1432
+ ) {
1433
+ out += string.charAt(i);
1434
+ continue;
1435
+ }
1436
+
1437
+ if (c < 0x80) {
1438
+ out = out + hexTable[c];
1439
+ continue;
1440
+ }
1441
+
1442
+ if (c < 0x800) {
1443
+ out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
1444
+ continue;
1445
+ }
1446
+
1447
+ if (c < 0xD800 || c >= 0xE000) {
1448
+ out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
1449
+ continue;
1450
+ }
1451
+
1452
+ i += 1;
1453
+ c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
1454
+ /* eslint operator-linebreak: [2, "before"] */
1455
+ out += hexTable[0xF0 | (c >> 18)]
1456
+ + hexTable[0x80 | ((c >> 12) & 0x3F)]
1457
+ + hexTable[0x80 | ((c >> 6) & 0x3F)]
1458
+ + hexTable[0x80 | (c & 0x3F)];
1459
+ }
1460
+
1461
+ return out;
1462
+ };
1463
+
1464
+ var compact = function compact(value) {
1465
+ var queue = [{ obj: { o: value }, prop: 'o' }];
1466
+ var refs = [];
1467
+
1468
+ for (var i = 0; i < queue.length; ++i) {
1469
+ var item = queue[i];
1470
+ var obj = item.obj[item.prop];
1471
+
1472
+ var keys = Object.keys(obj);
1473
+ for (var j = 0; j < keys.length; ++j) {
1474
+ var key = keys[j];
1475
+ var val = obj[key];
1476
+ if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
1477
+ queue.push({ obj: obj, prop: key });
1478
+ refs.push(val);
1479
+ }
1480
+ }
1481
+ }
1482
+
1483
+ compactQueue(queue);
1484
+
1485
+ return value;
1486
+ };
1487
+
1488
+ var isRegExp = function isRegExp(obj) {
1489
+ return Object.prototype.toString.call(obj) === '[object RegExp]';
1490
+ };
1491
+
1492
+ var isBuffer = function isBuffer(obj) {
1493
+ if (!obj || typeof obj !== 'object') {
1494
+ return false;
1495
+ }
1496
+
1497
+ return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
1498
+ };
1499
+
1500
+ var combine = function combine(a, b) {
1501
+ return [].concat(a, b);
1502
+ };
1503
+
1504
+ var maybeMap = function maybeMap(val, fn) {
1505
+ if (isArray$2(val)) {
1506
+ var mapped = [];
1507
+ for (var i = 0; i < val.length; i += 1) {
1508
+ mapped.push(fn(val[i]));
1509
+ }
1510
+ return mapped;
1511
+ }
1512
+ return fn(val);
1513
+ };
1514
+
1515
+ var utils = {
1516
+ arrayToObject: arrayToObject,
1517
+ assign: assign,
1518
+ combine: combine,
1519
+ compact: compact,
1520
+ decode: decode,
1521
+ encode: encode,
1522
+ isBuffer: isBuffer,
1523
+ isRegExp: isRegExp,
1524
+ maybeMap: maybeMap,
1525
+ merge: merge
1526
+ };
1527
+
1528
+ 'use strict';
1529
+
1530
+
1531
+
1532
+
1533
+ var has$1 = Object.prototype.hasOwnProperty;
1534
+
1535
+ var arrayPrefixGenerators = {
1536
+ brackets: function brackets(prefix) {
1537
+ return prefix + '[]';
1538
+ },
1539
+ comma: 'comma',
1540
+ indices: function indices(prefix, key) {
1541
+ return prefix + '[' + key + ']';
1542
+ },
1543
+ repeat: function repeat(prefix) {
1544
+ return prefix;
1545
+ }
1546
+ };
1547
+
1548
+ var isArray$1 = Array.isArray;
1549
+ var push = Array.prototype.push;
1550
+ var pushToArray = function (arr, valueOrArray) {
1551
+ push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
1552
+ };
1553
+
1554
+ var toISO = Date.prototype.toISOString;
1555
+
1556
+ var defaultFormat = formats['default'];
1557
+ var defaults$1 = {
1558
+ addQueryPrefix: false,
1559
+ allowDots: false,
1560
+ charset: 'utf-8',
1561
+ charsetSentinel: false,
1562
+ delimiter: '&',
1563
+ encode: true,
1564
+ encoder: utils.encode,
1565
+ encodeValuesOnly: false,
1566
+ format: defaultFormat,
1567
+ formatter: formats.formatters[defaultFormat],
1568
+ // deprecated
1569
+ indices: false,
1570
+ serializeDate: function serializeDate(date) {
1571
+ return toISO.call(date);
1572
+ },
1573
+ skipNulls: false,
1574
+ strictNullHandling: false
1575
+ };
1576
+
1577
+ var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
1578
+ return typeof v === 'string'
1579
+ || typeof v === 'number'
1580
+ || typeof v === 'boolean'
1581
+ || typeof v === 'symbol'
1582
+ || typeof v === 'bigint';
1583
+ };
1584
+
1585
+ var sentinel = {};
1586
+
1587
+ var stringify = function stringify(
1588
+ object,
1589
+ prefix,
1590
+ generateArrayPrefix,
1591
+ commaRoundTrip,
1592
+ strictNullHandling,
1593
+ skipNulls,
1594
+ encoder,
1595
+ filter,
1596
+ sort,
1597
+ allowDots,
1598
+ serializeDate,
1599
+ format,
1600
+ formatter,
1601
+ encodeValuesOnly,
1602
+ charset,
1603
+ sideChannel$1
1604
+ ) {
1605
+ var obj = object;
1606
+
1607
+ var tmpSc = sideChannel$1;
1608
+ var step = 0;
1609
+ var findFlag = false;
1610
+ while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
1611
+ // Where object last appeared in the ref tree
1612
+ var pos = tmpSc.get(object);
1613
+ step += 1;
1614
+ if (typeof pos !== 'undefined') {
1615
+ if (pos === step) {
1616
+ throw new RangeError('Cyclic object value');
1617
+ } else {
1618
+ findFlag = true; // Break while
1619
+ }
1620
+ }
1621
+ if (typeof tmpSc.get(sentinel) === 'undefined') {
1622
+ step = 0;
1623
+ }
1624
+ }
1625
+
1626
+ if (typeof filter === 'function') {
1627
+ obj = filter(prefix, obj);
1628
+ } else if (obj instanceof Date) {
1629
+ obj = serializeDate(obj);
1630
+ } else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
1631
+ obj = utils.maybeMap(obj, function (value) {
1632
+ if (value instanceof Date) {
1633
+ return serializeDate(value);
1634
+ }
1635
+ return value;
1636
+ });
1637
+ }
1638
+
1639
+ if (obj === null) {
1640
+ if (strictNullHandling) {
1641
+ return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
1642
+ }
1643
+
1644
+ obj = '';
1645
+ }
1646
+
1647
+ if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
1648
+ if (encoder) {
1649
+ var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
1650
+ return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
1651
+ }
1652
+ return [formatter(prefix) + '=' + formatter(String(obj))];
1653
+ }
1654
+
1655
+ var values = [];
1656
+
1657
+ if (typeof obj === 'undefined') {
1658
+ return values;
1659
+ }
1660
+
1661
+ var objKeys;
1662
+ if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
1663
+ // we need to join elements in
1664
+ if (encodeValuesOnly && encoder) {
1665
+ obj = utils.maybeMap(obj, encoder);
1666
+ }
1667
+ objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
1668
+ } else if (isArray$1(filter)) {
1669
+ objKeys = filter;
1670
+ } else {
1671
+ var keys = Object.keys(obj);
1672
+ objKeys = sort ? keys.sort(sort) : keys;
1673
+ }
1674
+
1675
+ var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
1676
+
1677
+ for (var j = 0; j < objKeys.length; ++j) {
1678
+ var key = objKeys[j];
1679
+ var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
1680
+
1681
+ if (skipNulls && value === null) {
1682
+ continue;
1683
+ }
1684
+
1685
+ var keyPrefix = isArray$1(obj)
1686
+ ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
1687
+ : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
1688
+
1689
+ sideChannel$1.set(object, step);
1690
+ var valueSideChannel = sideChannel();
1691
+ valueSideChannel.set(sentinel, sideChannel$1);
1692
+ pushToArray(values, stringify(
1693
+ value,
1694
+ keyPrefix,
1695
+ generateArrayPrefix,
1696
+ commaRoundTrip,
1697
+ strictNullHandling,
1698
+ skipNulls,
1699
+ generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$1(obj) ? null : encoder,
1700
+ filter,
1701
+ sort,
1702
+ allowDots,
1703
+ serializeDate,
1704
+ format,
1705
+ formatter,
1706
+ encodeValuesOnly,
1707
+ charset,
1708
+ valueSideChannel
1709
+ ));
1710
+ }
1711
+
1712
+ return values;
1713
+ };
1714
+
1715
+ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
1716
+ if (!opts) {
1717
+ return defaults$1;
1718
+ }
1719
+
1720
+ if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
1721
+ throw new TypeError('Encoder has to be a function.');
1722
+ }
1723
+
1724
+ var charset = opts.charset || defaults$1.charset;
1725
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
1726
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
1727
+ }
1728
+
1729
+ var format = formats['default'];
1730
+ if (typeof opts.format !== 'undefined') {
1731
+ if (!has$1.call(formats.formatters, opts.format)) {
1732
+ throw new TypeError('Unknown format option provided.');
1733
+ }
1734
+ format = opts.format;
1735
+ }
1736
+ var formatter = formats.formatters[format];
1737
+
1738
+ var filter = defaults$1.filter;
1739
+ if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
1740
+ filter = opts.filter;
1741
+ }
1742
+
1743
+ return {
1744
+ addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
1745
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
1746
+ charset: charset,
1747
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
1748
+ delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
1749
+ encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
1750
+ encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
1751
+ encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
1752
+ filter: filter,
1753
+ format: format,
1754
+ formatter: formatter,
1755
+ serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
1756
+ skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
1757
+ sort: typeof opts.sort === 'function' ? opts.sort : null,
1758
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
1759
+ };
1760
+ };
1761
+
1762
+ var stringify_1 = function (object, opts) {
1763
+ var obj = object;
1764
+ var options = normalizeStringifyOptions(opts);
1765
+
1766
+ var objKeys;
1767
+ var filter;
1768
+
1769
+ if (typeof options.filter === 'function') {
1770
+ filter = options.filter;
1771
+ obj = filter('', obj);
1772
+ } else if (isArray$1(options.filter)) {
1773
+ filter = options.filter;
1774
+ objKeys = filter;
1775
+ }
1776
+
1777
+ var keys = [];
1778
+
1779
+ if (typeof obj !== 'object' || obj === null) {
1780
+ return '';
1781
+ }
1782
+
1783
+ var arrayFormat;
1784
+ if (opts && opts.arrayFormat in arrayPrefixGenerators) {
1785
+ arrayFormat = opts.arrayFormat;
1786
+ } else if (opts && 'indices' in opts) {
1787
+ arrayFormat = opts.indices ? 'indices' : 'repeat';
1788
+ } else {
1789
+ arrayFormat = 'indices';
1790
+ }
1791
+
1792
+ var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
1793
+ if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
1794
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
1795
+ }
1796
+ var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
1797
+
1798
+ if (!objKeys) {
1799
+ objKeys = Object.keys(obj);
1800
+ }
1801
+
1802
+ if (options.sort) {
1803
+ objKeys.sort(options.sort);
1804
+ }
1805
+
1806
+ var sideChannel$1 = sideChannel();
1807
+ for (var i = 0; i < objKeys.length; ++i) {
1808
+ var key = objKeys[i];
1809
+
1810
+ if (options.skipNulls && obj[key] === null) {
1811
+ continue;
1812
+ }
1813
+ pushToArray(keys, stringify(
1814
+ obj[key],
1815
+ key,
1816
+ generateArrayPrefix,
1817
+ commaRoundTrip,
1818
+ options.strictNullHandling,
1819
+ options.skipNulls,
1820
+ options.encode ? options.encoder : null,
1821
+ options.filter,
1822
+ options.sort,
1823
+ options.allowDots,
1824
+ options.serializeDate,
1825
+ options.format,
1826
+ options.formatter,
1827
+ options.encodeValuesOnly,
1828
+ options.charset,
1829
+ sideChannel$1
1830
+ ));
1831
+ }
1832
+
1833
+ var joined = keys.join(options.delimiter);
1834
+ var prefix = options.addQueryPrefix === true ? '?' : '';
1835
+
1836
+ if (options.charsetSentinel) {
1837
+ if (options.charset === 'iso-8859-1') {
1838
+ // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
1839
+ prefix += 'utf8=%26%2310003%3B&';
1840
+ } else {
1841
+ // encodeURIComponent('✓')
1842
+ prefix += 'utf8=%E2%9C%93&';
1843
+ }
1844
+ }
1845
+
1846
+ return joined.length > 0 ? prefix + joined : '';
1847
+ };
1848
+
1849
+ 'use strict';
1850
+
1851
+
1852
+
1853
+ var has = Object.prototype.hasOwnProperty;
1854
+ var isArray = Array.isArray;
1855
+
1856
+ var defaults = {
1857
+ allowDots: false,
1858
+ allowPrototypes: false,
1859
+ allowSparse: false,
1860
+ arrayLimit: 20,
1861
+ charset: 'utf-8',
1862
+ charsetSentinel: false,
1863
+ comma: false,
1864
+ decoder: utils.decode,
1865
+ delimiter: '&',
1866
+ depth: 5,
1867
+ ignoreQueryPrefix: false,
1868
+ interpretNumericEntities: false,
1869
+ parameterLimit: 1000,
1870
+ parseArrays: true,
1871
+ plainObjects: false,
1872
+ strictNullHandling: false
1873
+ };
1874
+
1875
+ var interpretNumericEntities = function (str) {
1876
+ return str.replace(/&#(\d+);/g, function ($0, numberStr) {
1877
+ return String.fromCharCode(parseInt(numberStr, 10));
1878
+ });
1879
+ };
1880
+
1881
+ var parseArrayValue = function (val, options) {
1882
+ if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
1883
+ return val.split(',');
1884
+ }
1885
+
1886
+ return val;
1887
+ };
1888
+
1889
+ // This is what browsers will submit when the ✓ character occurs in an
1890
+ // application/x-www-form-urlencoded body and the encoding of the page containing
1891
+ // the form is iso-8859-1, or when the submitted form has an accept-charset
1892
+ // attribute of iso-8859-1. Presumably also with other charsets that do not contain
1893
+ // the ✓ character, such as us-ascii.
1894
+ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
1895
+
1896
+ // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
1897
+ var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
1898
+
1899
+ var parseValues = function parseQueryStringValues(str, options) {
1900
+ var obj = {};
1901
+ var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
1902
+ var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
1903
+ var parts = cleanStr.split(options.delimiter, limit);
1904
+ var skipIndex = -1; // Keep track of where the utf8 sentinel was found
1905
+ var i;
1906
+
1907
+ var charset = options.charset;
1908
+ if (options.charsetSentinel) {
1909
+ for (i = 0; i < parts.length; ++i) {
1910
+ if (parts[i].indexOf('utf8=') === 0) {
1911
+ if (parts[i] === charsetSentinel) {
1912
+ charset = 'utf-8';
1913
+ } else if (parts[i] === isoSentinel) {
1914
+ charset = 'iso-8859-1';
1915
+ }
1916
+ skipIndex = i;
1917
+ i = parts.length; // The eslint settings do not allow break;
1918
+ }
1919
+ }
1920
+ }
1921
+
1922
+ for (i = 0; i < parts.length; ++i) {
1923
+ if (i === skipIndex) {
1924
+ continue;
1925
+ }
1926
+ var part = parts[i];
1927
+
1928
+ var bracketEqualsPos = part.indexOf(']=');
1929
+ var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
1930
+
1931
+ var key, val;
1932
+ if (pos === -1) {
1933
+ key = options.decoder(part, defaults.decoder, charset, 'key');
1934
+ val = options.strictNullHandling ? null : '';
1935
+ } else {
1936
+ key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
1937
+ val = utils.maybeMap(
1938
+ parseArrayValue(part.slice(pos + 1), options),
1939
+ function (encodedVal) {
1940
+ return options.decoder(encodedVal, defaults.decoder, charset, 'value');
1941
+ }
1942
+ );
1943
+ }
1944
+
1945
+ if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
1946
+ val = interpretNumericEntities(val);
1947
+ }
1948
+
1949
+ if (part.indexOf('[]=') > -1) {
1950
+ val = isArray(val) ? [val] : val;
1951
+ }
1952
+
1953
+ if (has.call(obj, key)) {
1954
+ obj[key] = utils.combine(obj[key], val);
1955
+ } else {
1956
+ obj[key] = val;
1957
+ }
1958
+ }
1959
+
1960
+ return obj;
1961
+ };
1962
+
1963
+ var parseObject = function (chain, val, options, valuesParsed) {
1964
+ var leaf = valuesParsed ? val : parseArrayValue(val, options);
1965
+
1966
+ for (var i = chain.length - 1; i >= 0; --i) {
1967
+ var obj;
1968
+ var root = chain[i];
1969
+
1970
+ if (root === '[]' && options.parseArrays) {
1971
+ obj = [].concat(leaf);
1972
+ } else {
1973
+ obj = options.plainObjects ? Object.create(null) : {};
1974
+ var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
1975
+ var index = parseInt(cleanRoot, 10);
1976
+ if (!options.parseArrays && cleanRoot === '') {
1977
+ obj = { 0: leaf };
1978
+ } else if (
1979
+ !isNaN(index)
1980
+ && root !== cleanRoot
1981
+ && String(index) === cleanRoot
1982
+ && index >= 0
1983
+ && (options.parseArrays && index <= options.arrayLimit)
1984
+ ) {
1985
+ obj = [];
1986
+ obj[index] = leaf;
1987
+ } else if (cleanRoot !== '__proto__') {
1988
+ obj[cleanRoot] = leaf;
1989
+ }
1990
+ }
1991
+
1992
+ leaf = obj;
1993
+ }
1994
+
1995
+ return leaf;
1996
+ };
1997
+
1998
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
1999
+ if (!givenKey) {
2000
+ return;
2001
+ }
2002
+
2003
+ // Transform dot notation to bracket notation
2004
+ var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
2005
+
2006
+ // The regex chunks
2007
+
2008
+ var brackets = /(\[[^[\]]*])/;
2009
+ var child = /(\[[^[\]]*])/g;
2010
+
2011
+ // Get the parent
2012
+
2013
+ var segment = options.depth > 0 && brackets.exec(key);
2014
+ var parent = segment ? key.slice(0, segment.index) : key;
2015
+
2016
+ // Stash the parent if it exists
2017
+
2018
+ var keys = [];
2019
+ if (parent) {
2020
+ // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
2021
+ if (!options.plainObjects && has.call(Object.prototype, parent)) {
2022
+ if (!options.allowPrototypes) {
2023
+ return;
2024
+ }
2025
+ }
2026
+
2027
+ keys.push(parent);
2028
+ }
2029
+
2030
+ // Loop through children appending to the array until we hit depth
2031
+
2032
+ var i = 0;
2033
+ while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
2034
+ i += 1;
2035
+ if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
2036
+ if (!options.allowPrototypes) {
2037
+ return;
2038
+ }
2039
+ }
2040
+ keys.push(segment[1]);
2041
+ }
2042
+
2043
+ // If there's a remainder, just add whatever is left
2044
+
2045
+ if (segment) {
2046
+ keys.push('[' + key.slice(segment.index) + ']');
2047
+ }
2048
+
2049
+ return parseObject(keys, val, options, valuesParsed);
2050
+ };
2051
+
2052
+ var normalizeParseOptions = function normalizeParseOptions(opts) {
2053
+ if (!opts) {
2054
+ return defaults;
2055
+ }
2056
+
2057
+ if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
2058
+ throw new TypeError('Decoder has to be a function.');
2059
+ }
2060
+
2061
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2062
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
2063
+ }
2064
+ var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
2065
+
2066
+ return {
2067
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
2068
+ allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
2069
+ allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
2070
+ arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
2071
+ charset: charset,
2072
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
2073
+ comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
2074
+ decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
2075
+ delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
2076
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
2077
+ depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
2078
+ ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
2079
+ interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
2080
+ parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
2081
+ parseArrays: opts.parseArrays !== false,
2082
+ plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
2083
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
2084
+ };
2085
+ };
2086
+
2087
+ var parse = function (str, opts) {
2088
+ var options = normalizeParseOptions(opts);
2089
+
2090
+ if (str === '' || str === null || typeof str === 'undefined') {
2091
+ return options.plainObjects ? Object.create(null) : {};
2092
+ }
2093
+
2094
+ var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
2095
+ var obj = options.plainObjects ? Object.create(null) : {};
2096
+
2097
+ // Iterate over the keys and setup the new object
2098
+
2099
+ var keys = Object.keys(tempObj);
2100
+ for (var i = 0; i < keys.length; ++i) {
2101
+ var key = keys[i];
2102
+ var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
2103
+ obj = utils.merge(obj, newObj, options);
2104
+ }
2105
+
2106
+ if (options.allowSparse === true) {
2107
+ return obj;
2108
+ }
2109
+
2110
+ return utils.compact(obj);
2111
+ };
2112
+
2113
+ 'use strict';
2114
+
2115
+
2116
+
2117
+
2118
+
2119
+ var lib = {
2120
+ formats: formats,
2121
+ parse: parse,
2122
+ stringify: stringify_1
2123
+ };
2124
+
2125
+ const fetchProductColorsQuery = (id, page) => lib.stringify({
2126
+ filters: {
2127
+ products: {
2128
+ id: {
2129
+ $eq: id,
2130
+ },
2131
+ },
2132
+ },
2133
+ sort: ['position:asc'],
2134
+ populate: ['image', 'category', 'links', 'links.shop'],
2135
+ pagination: {
2136
+ page: page || 1,
2137
+ pageSize: 100,
2138
+ },
2139
+ }, {
2140
+ encodeValuesOnly: true, // prettify url
2141
+ });
2142
+ const fetchCategoryColorsQuery = (color) => lib.stringify({
2143
+ filters: {
2144
+ category: {
2145
+ id: {
2146
+ $eq: color.id,
2147
+ },
2148
+ },
2149
+ },
2150
+ sort: ['position:asc'],
2151
+ populate: ['image', 'category', 'links', 'links.shop'],
2152
+ pagination: {
2153
+ page: 1,
2154
+ pageSize: 100,
2155
+ },
2156
+ }, {
2157
+ encodeValuesOnly: true, // prettify url
2158
+ });
2159
+ const fetchColorByNumber = (productId, colorNumber) => lib.stringify({
2160
+ filters: {
2161
+ $or: [
2162
+ {
2163
+ $and: [
2164
+ {
2165
+ number: {
2166
+ $contains: colorNumber,
2167
+ },
2168
+ },
2169
+ {
2170
+ products: {
2171
+ id: {
2172
+ $eq: productId,
2173
+ },
2174
+ },
2175
+ },
2176
+ ],
2177
+ },
2178
+ {
2179
+ $and: [
2180
+ {
2181
+ name: {
2182
+ $contains: colorNumber,
2183
+ },
2184
+ },
2185
+ {
2186
+ products: {
2187
+ id: {
2188
+ $eq: productId,
2189
+ },
2190
+ },
2191
+ },
2192
+ ],
2193
+ },
2194
+ ],
2195
+ },
2196
+ sort: ['position:asc'],
2197
+ populate: ['image', 'category', 'product', 'links', 'links.shop'],
2198
+ pagination: {
2199
+ page: 1,
2200
+ pageSize: 100,
2201
+ },
2202
+ }, {
2203
+ encodeValuesOnly: true, // prettify url
2204
+ });
2205
+
2206
+ const myModalCss = ".pallete-wrapper *{font-family:\"Galatea\", sans-serif}.my-modal{box-shadow:1px 1px 1px #ccc;background-color:#fff;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);max-width:1555px;width:90%;z-index:1000;text-align:center;padding:35px 40px;max-height:calc(100vh - 100px);overflow-y:auto}@media (max-width: 1024px){.my-modal{padding:80px 20px 20px}}.my-modal::-webkit-scrollbar{display:none}.my-modal .loader{display:flex;flex-direction:column;align-items:center;justify-content:center;height:300px}.my-modal>img{width:300px;object-fit:cover}@media (max-width: 768px){.my-modal>img{width:200px}}.my-modal__close{position:absolute;right:20px;top:20px;background:transparent;border:none}.my-modal__close>img{width:45px;height:45px;object-fit:cover;cursor:pointer}@media (max-width: 1024px){.my-modal__close{top:65px}}.my-modal__see-more{font-size:22px;margin-bottom:27px;display:flex;justify-content:center;align-items:center}@media (max-width: 1024px){.my-modal__see-more{font-size:18px}}.my-modal__see-more img{width:45px;height:45px}@media (max-width: 1024px){.my-modal__see-more img{display:none}}.my-modal__wrapper{display:flex;flex-direction:column;position:relative}.my-modal__wrapper .boxes{display:flex;flex-direction:column;flex-wrap:wrap}.my-modal__wrapper .boxes__list{display:flex;flex-wrap:wrap;gap:5px 5px}.my-modal__wrapper .boxes__box-content{width:100%;margin-bottom:5px;height:500px;text-align:left;display:flex;flex-direction:row;justify-content:space-between;position:relative}.my-modal__wrapper .boxes__box-content .closebtn{position:absolute;right:10px;top:10px;width:53px;height:53px;cursor:pointer;object-fit:cover;z-index:9999}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content{flex-direction:column-reverse;height:350px}}.my-modal__wrapper .boxes__box-content__info{width:40%;padding:50px 40px;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info{width:100%;padding:15px;min-height:100px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info{min-height:auto}}.my-modal__wrapper .boxes__box-content__info h2{font-size:35px;font-weight:normal;text-transform:capitalize;margin-bottom:7px;color:#232323}.my-modal__wrapper .boxes__box-content__info h4{margin-top:0px;margin-bottom:15px;font-size:16px;color:#4c4c4c}.my-modal__wrapper .boxes__box-content__info .divider{border:1px solid #4c4c4c;opacity:0.2;margin-bottom:20px}.my-modal__wrapper .boxes__box-content__info__value{display:flex;flex-direction:row;justify-content:flex-start}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value{justify-content:flex-start}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value{flex-direction:column}}.my-modal__wrapper .boxes__box-content__info__value-image img{width:114px;object-fit:cover}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-image img{width:75px}}.my-modal__wrapper .boxes__box-content__info__value-product{color:#232323;margin-left:10px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:26px;margin:0;margin-right:10px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:16px}}.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:20px;margin-top:0px;margin-bottom:0px}.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:20px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:0}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:10px}}.my-modal__wrapper .boxes__box-content__info__value-product a{background-color:#fff;font-size:16px;box-shadow:0 10px 20px 0 rgba(0, 0, 0, 0.1);border-radius:22.5px;padding:15px 30px;color:#232323;text-decoration:none;display:block;text-align:center;transition:all 0.7s ease-in-out}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product a{max-width:150px;font-size:13px;padding:12px 25px}}.my-modal__wrapper .boxes__box-content__info__value-product a:hover{color:#fff;background-color:#232323}.my-modal__wrapper .boxes__box-content__info__value-product a.inverse{background-color:#232323;color:#fff}.my-modal__wrapper .boxes__box-content__info__value-product a.inverse:hover{color:#232323;background-color:#fff}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product>div{display:flex;justify-content:flex-start;align-items:center}}.my-modal__wrapper .boxes__box-content__slider{width:60%;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__slider{width:100%;display:block}}.my-modal__wrapper .boxes__box-content__white *{color:#fff}.my-modal__wrapper .boxes__box-content__white h2{color:#fff}.my-modal__wrapper .pagination{margin:10px 0px;font-size:16px;display:flex;flex-direction:row;align-items:center;justify-content:center}.my-modal__wrapper .pagination>span{margin:0 3px;cursor:pointer;min-width:20px;padding:5px;box-shadow:1px 1px 1px #ccc}.my-modal__wrapper .pagination .current{background-color:wheat}.my-modal .categories{padding-bottom:20px;margin-bottom:20px;border-bottom:1px solid #dfdfdf;display:flex;flex-direction:column;align-items:flex-start}.my-modal .categories__container{display:flex;flex-wrap:nowrap;gap:5px 5px;overflow-x:auto;width:100%}@media (max-width: 1024px){.my-modal .categories__container{padding-bottom:5px}}.my-modal .categories__slide-information{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.my-modal .categories__slide-information span{color:#4c4c4c;font-size:16px;font-weight:normal}.my-modal .categories__slide-information span:first-of-type{margin-left:7px}.my-modal .categories__slide-information span:last-of-type{margin-right:7px}";
2207
+
2208
+ const MyModal = class {
2209
+ constructor(hostRef) {
2210
+ registerInstance(this, hostRef);
2211
+ this.close = createEvent(this, "close", 7);
2212
+ this.readyToCLose = createEvent(this, "readyToCLose", 7);
2213
+ this.boxDesktopWidth = 130;
2214
+ this.boxMobileWidth = 85;
2215
+ this.desktopPadding = 75;
2216
+ this.mobilePadding = 35;
2217
+ this.mediumBreakpoint = 1024;
2218
+ this.clearInterval = () => {
2219
+ this.colorTimerInterval && clearInterval(this.colorTimerInterval);
2220
+ this.colorTimerInterval = undefined;
2221
+ };
2222
+ this.colorTimer = () => {
2223
+ if (this.currentColor && this.currentColor.id) {
2224
+ this.colorTimerInterval = setInterval(() => {
2225
+ var _a, _b;
2226
+ ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.name) &&
2227
+ setDataLayer({
2228
+ event: 'ColorTimer',
2229
+ shop: this.shop,
2230
+ product: this.product,
2231
+ color: (_b = this.currentColor) === null || _b === void 0 ? void 0 : _b.name,
2232
+ timer: '10',
2233
+ });
2234
+ }, 10000);
2235
+ }
2236
+ else {
2237
+ this.clearInterval();
2238
+ }
2239
+ };
2240
+ this.chunks = (xs, y = []) => {
2241
+ return xs.length === 0 ? y : this.chunks(xs.slice(this.chunksNum), y.concat([xs.slice(0, this.chunksNum)]));
2242
+ };
2243
+ this.calculateBoxCount = () => {
2244
+ var _a;
2245
+ const modalWidth = this.modalEl.children && this.modalEl.children[0] && ((_a = this.modalEl.children[0]) === null || _a === void 0 ? void 0 : _a.clientWidth) - this.padding;
2246
+ const boxWidth = this.boxWidth;
2247
+ const calc = Math.floor(modalWidth / boxWidth);
2248
+ const boxesCount = calc;
2249
+ if (!this.preloader)
2250
+ this.chunksNum = boxesCount;
2251
+ };
2252
+ this.displayForMobile = () => {
2253
+ if (window.innerWidth < this.mediumBreakpoint) {
2254
+ this.boxWidth = this.boxMobileWidth;
2255
+ this.padding = this.mobilePadding;
2256
+ this.isMobile = true;
2257
+ }
2258
+ else {
2259
+ this.isMobile = false;
2260
+ this.boxWidth = this.boxDesktopWidth;
2261
+ this.padding = this.desktopPadding;
2262
+ }
2263
+ };
2264
+ this.fetchProductData = async () => {
2265
+ try {
2266
+ const response = await ApiService.getData(`products?populate[0]=modalLogo&populate[1]=images&populate[2]=shops&populate[3]=categories&filters[name][$contains]=${this.product}`);
2267
+ if (response) {
2268
+ if (response.data[0].attributes.shops.data.find((shop) => shop.attributes.name === this.shop).id) {
2269
+ this.data = Object.assign(Object.assign({}, response.data[0].attributes), { id: response.data[0].id });
2270
+ }
2271
+ }
2272
+ }
2273
+ catch (error) {
2274
+ console.error(error);
2275
+ }
2276
+ finally {
2277
+ this.preloader = false;
2278
+ }
2279
+ };
2280
+ // TODO:
2281
+ this.fetchProductColors = async (id, page) => {
2282
+ this.loading = true;
2283
+ try {
2284
+ const response = await ApiService.getData(`colors?${fetchProductColorsQuery(id, page)}`);
2285
+ if (response) {
2286
+ this.colors = {
2287
+ list: response &&
2288
+ response.data &&
2289
+ response.data.map((item) => (Object.assign({ id: item.id }, item.attributes))),
2290
+ pagination: response.meta.pagination,
2291
+ };
2292
+ }
2293
+ }
2294
+ catch (error) {
2295
+ console.error(error);
2296
+ }
2297
+ finally {
2298
+ this.loading = false;
2299
+ }
2300
+ };
2301
+ this.fetchCategoryColors = async (color) => {
2302
+ this.loading = true;
2303
+ try {
2304
+ const response = await ApiService.getData(`colors?${fetchCategoryColorsQuery(color)}`);
2305
+ if (response) {
2306
+ this.colors = {
2307
+ list: response &&
2308
+ response.data &&
2309
+ response.data.map((item) => (Object.assign({ id: item.id }, item.attributes))),
2310
+ pagination: response.meta.pagination,
2311
+ };
2312
+ }
2313
+ }
2314
+ catch (error) {
2315
+ console.error(error);
2316
+ }
2317
+ finally {
2318
+ this.loading = false;
2319
+ }
2320
+ };
2321
+ // private onIntersection = async (entries: any) => {
2322
+ // console.log(entries[0]);
2323
+ // if (entries[0].intersectionRatio === 0) {
2324
+ // console.log('d');
2325
+ // }
2326
+ // };
2327
+ // private handleObserve = () => {
2328
+ // console.log(this.modalEl.shadowRoot);
2329
+ // const boxesList: any = (this.modalEl as any).querySelector('.my-modal__wrapper');
2330
+ // console.log(boxesList);
2331
+ // if (boxesList) {
2332
+ // this.observer = new IntersectionObserver(this.onIntersection);
2333
+ // this.observer.observe(boxesList);
2334
+ // }
2335
+ // };
2336
+ this.onPage = (page) => {
2337
+ this.data && this.fetchProductColors(String(this.data.id), page);
2338
+ this.page = page;
2339
+ this.currentColor = null;
2340
+ this.currentIndex = null;
2341
+ };
2342
+ this.handleCategoryClick = (color) => {
2343
+ if (this.selectedCategory && color && this.selectedCategory.id === color.id && !this.showRange) {
2344
+ this.data && this.fetchProductColors(String(this.data.id));
2345
+ this.selectedCategory = null;
2346
+ }
2347
+ else {
2348
+ color && this.fetchCategoryColors(color);
2349
+ this.selectedCategory = color;
2350
+ }
2351
+ this.currentColor = null;
2352
+ };
2353
+ this.shop = undefined;
2354
+ this.product = undefined;
2355
+ this.closeImage = 'close.png';
2356
+ this.arrowDown = 'arrow_down.png';
2357
+ this.chunksNum = 12;
2358
+ this.data = null;
2359
+ this.preloader = false;
2360
+ this.loading = false;
2361
+ this.colors = null;
2362
+ this.currentColor = null;
2363
+ this.currentIndex = null;
2364
+ this.infoBoxWidth = null;
2365
+ this.boxWidth = this.boxDesktopWidth;
2366
+ this.padding = this.desktopPadding;
2367
+ this.isMobile = false;
2368
+ this.showRange = false;
2369
+ this.colorCategories = null;
2370
+ this.selectedCategory = null;
2371
+ this.page = 1;
2372
+ }
2373
+ setInfoBoxWidth(newValue) {
2374
+ this.infoBoxWidth = newValue * this.boxWidth;
2375
+ }
2376
+ watchPropHandler(newValue) {
2377
+ if (newValue.categories.data.length > 0) {
2378
+ this.showRange = true;
2379
+ this.handleCategoryClick(newValue.categories.data[0]);
2380
+ }
2381
+ else {
2382
+ this.fetchProductColors(String(newValue.id));
2383
+ }
2384
+ }
2385
+ async open() {
2386
+ this.modalEl.style.display = 'block';
2387
+ }
2388
+ closeModalHandler() {
2389
+ this.close.emit();
2390
+ }
2391
+ handleReadyToClose(value) {
2392
+ this.readyToCLose.emit({ observable: value });
2393
+ }
2394
+ closeInfoBoxHandler() {
2395
+ this.currentColor = null;
2396
+ this.currentIndex = null;
2397
+ }
2398
+ handleResize() {
2399
+ this.calculateBoxCount();
2400
+ this.displayForMobile();
2401
+ }
2402
+ async searchColorsHandler(event) {
2403
+ var _a;
2404
+ // if search is empty set to first category to not showing whole product colors
2405
+ if (event.detail === '') {
2406
+ this.handleCategoryClick((_a = this.data) === null || _a === void 0 ? void 0 : _a.categories.data[0]);
2407
+ }
2408
+ try {
2409
+ if (this.data && this.data.id && event.detail !== '') {
2410
+ this.selectedCategory = null;
2411
+ const response = await ApiService.getData(`colors?${fetchColorByNumber(Number(this.data.id), event.detail)}`);
2412
+ if (response) {
2413
+ this.colors = {
2414
+ list: response &&
2415
+ response.data &&
2416
+ response.data.map((item) => (Object.assign({ id: item.id }, item.attributes))),
2417
+ pagination: response.meta.pagination,
2418
+ };
2419
+ }
2420
+ }
2421
+ }
2422
+ catch (error) {
2423
+ console.error(error);
2424
+ }
2425
+ }
2426
+ componentWillLoad() {
2427
+ this.preloader = true;
2428
+ this.fetchProductData();
2429
+ }
2430
+ componentWillRender() {
2431
+ this.displayForMobile();
2432
+ this.calculateBoxCount();
2433
+ this.colorTimer();
2434
+ }
2435
+ render() {
2436
+ var _a, _b, _c, _d, _e, _f, _g;
2437
+ return (h("div", { class: `my-modal`, onMouseEnter: () => this.handleReadyToClose(false), onMouseLeave: () => this.handleReadyToClose(true) }, this.preloader && (h("div", { class: 'loader' }, h("my-loader", null))), !this.preloader && (h("button", { class: "my-modal__close", onClick: () => this.closeModalHandler() }, h("img", { src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }))), !this.preloader && this.data && this.data.modalLogo && h("img", { src: `${(_d = (_c = (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.modalLogo) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.attributes) === null || _d === void 0 ? void 0 : _d.url}`, alt: "modal-logo" }), !this.preloader && (h("p", { class: "my-modal__see-more" }, (_e = this.data) === null || _e === void 0 ? void 0 : _e.modalDescription)), this.showRange && (h("div", { class: 'categories' }, this.data && h("my-search", { productId: Number((_f = this.data) === null || _f === void 0 ? void 0 : _f.id), isMobile: this.isMobile }), h("div", { class: 'categories__container', style: { maxWidth: `${this.infoBoxWidth}px` } }, (_g = this.data) === null || _g === void 0 ? void 0 : _g.categories.data.map((c) => {
2438
+ var _a;
2439
+ return (h("my-colorbox", { key: c.id, onClick: () => this.handleCategoryClick(c), color: c.attributes.hex, name: c.attributes.name, shop: this.shop, product: this.product, isCategoryActive: ((_a = this.selectedCategory) === null || _a === void 0 ? void 0 : _a.id) === c.id }));
2440
+ })), this.isMobile && (h("div", { class: 'categories__slide-information', style: { width: `${this.infoBoxWidth}px` } }, h("span", null, "Przewi\u0144 w lewo"), h("span", null, "Przewi\u0144 w prawo"))))), h("div", { class: 'my-modal__wrapper' }, this.loading && h("my-loader", null), !this.loading && this.colors && (h("div", { class: 'container_boxes' }, this.colors.list.length > 0 ? (this.chunks(this.colors.list).map((color, index) => {
2441
+ var _a;
2442
+ return (h("div", { key: index, class: "boxes" }, h("div", { class: "boxes__list" }, color.map((c) => {
2443
+ var _a;
2444
+ return (h("my-colorbox", { key: c.id, onClick: () => {
2445
+ var _a, _b, _c;
2446
+ return [
2447
+ ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) ? (((_b = this.currentColor) === null || _b === void 0 ? void 0 : _b.id) === c.id ? (this.currentColor = null) : (this.currentColor = c)) : (this.currentColor = c),
2448
+ (this.currentIndex = index),
2449
+ setDataLayer({
2450
+ event: 'ColorClick',
2451
+ shop: this.shop,
2452
+ product: this.product,
2453
+ color: c.name,
2454
+ }),
2455
+ ((_c = this.currentColor) === null || _c === void 0 ? void 0 : _c.id) && this.clearInterval(),
2456
+ ];
2457
+ }, color: c.hex, name: c.name, isActive: ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) === c.id, shop: this.shop, product: this.product }));
2458
+ })), ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) && index === this.currentIndex && (h("my-colorinfo", { currentColor: this.currentColor, shop: this.shop, product: this.product, data: this.data, isMobile: this.isMobile, infoBoxWidth: this.infoBoxWidth }))));
2459
+ })) : (h("p", null, "Brak wynik\u00F3w")), this.colors.pagination.pageCount > 1 && (h("div", { class: 'pagination' }, Array.from({ length: this.colors.pagination.pageCount }).map((page, i) => (h("span", { class: i + 1 === this.page ? 'current' : '', onClick: e => {
2460
+ e.preventDefault();
2461
+ this.onPage(i + 1);
2462
+ }, key: `#${i + 1 + page}` }, i + 1))))))))));
2463
+ }
2464
+ static get assetsDirs() { return ["assets"]; }
2465
+ get modalEl() { return getElement(this); }
2466
+ static get watchers() { return {
2467
+ "chunksNum": ["setInfoBoxWidth"],
2468
+ "data": ["watchPropHandler"]
2469
+ }; }
2470
+ };
2471
+ MyModal.style = myModalCss;
2472
+
2473
+ export { MyModal as my_modal };
2474
+
2475
+ //# sourceMappingURL=my-modal.entry.js.map