@forsakringskassan/devindex-menu 1.10.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/menu.js CHANGED
@@ -17,7 +17,7 @@ var __copyProps = (to, from, except, desc) => {
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
- // src/menu.js
20
+ // src/menu.ts
21
21
  var menu_exports = {};
22
22
  __export(menu_exports, {
23
23
  default: () => menu_default
@@ -25,7 +25,1126 @@ __export(menu_exports, {
25
25
  module.exports = __toCommonJS(menu_exports);
26
26
 
27
27
  // raw-loader:./client.js?raw
28
- var client_default = '/**\n * @param {string} cookieName\n * @param {string} cookieValue\n * @param {number} exdays\n * @returns {void}\n */\nfunction setCookie(cookieName, cookieValue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);\n var expires = "expires=".concat(d.toUTCString());\n document.cookie = "".concat(cookieName, "=").concat(cookieValue, ";").concat(expires, ";path=/");\n}\n\n/**\n * @param {string} cookieName\n * @returns {string | undefined}\n */\nfunction getCookie(cookieName) {\n var name = "".concat(cookieName, "=");\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(";");\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) === " ") {\n c = c.substring(1);\n }\n if (c.indexOf(name) === 0) {\n return c.substring(name.length, c.length);\n }\n }\n return undefined;\n}\n(function () {\n /** @type {NodeListOf<HTMLSelectElement>} */\n var selections = document.querySelectorAll(".secret-menu select");\n for (var i = 0; i < selections.length; i++) {\n var select = selections[i];\n select.value = getCookie(select.name) ? getCookie(select.name) : "default";\n if (select.getAttribute("data-sessionStorage") === "true") {\n var cookieValue = getCookie(select.name);\n if (cookieValue) {\n sessionStorage.setItem(select.name, atob(cookieValue));\n }\n }\n select.onchange = function (event) {\n var element = event.target;\n setCookie(element.name, element.value, 30);\n if (element.getAttribute("data-exec-on-change")) {\n window[element.getAttribute("data-exec-on-change")]();\n }\n if (element.getAttribute("data-reload") === "true") {\n location.reload(true);\n }\n if (element.getAttribute("data-sessionStorage") === "true") {\n var sessionKey = element.id;\n if (element.value) {\n var value = atob(element.value);\n console.log("Laddar sessionstorage ".concat(sessionKey, " med \\n ").concat(value));\n sessionStorage.setItem(sessionKey, value);\n } else {\n console.log("T\\xF6mmer sessionstorage");\n sessionStorage.removeItem(sessionKey);\n }\n location.reload(true);\n }\n };\n }\n var inputFields = document.querySelectorAll(".secret-menu input");\n for (var _i = 0; _i < inputFields.length; _i++) {\n var input = inputFields[_i];\n input.value = getCookie(input.name) ? getCookie(input.name) : "";\n input.oninput = function (event) {\n var element = event.target;\n setCookie(element.name, element.value, 30);\n };\n }\n\n /* Forcerar att sidan laddas om, \xE4ven n\xE4r l\xE4nken \xE4r av typen: /#/granska/8 */\n /** @type {NodeListOf<HTMLAnchorElement>} */\n var links = document.querySelectorAll(".secret-menu ul li a");\n for (var _i2 = 0; _i2 < links.length; _i2++) {\n var link = links[_i2];\n if (link.getAttribute("href").startsWith("/#")) {\n /**\n * @param {MouseEvent} event\n */\n link.onclick = function (event) {\n event.preventDefault();\n window.location.href = event.target.getAttribute("href");\n setTimeout(function () {\n console.log("Reload after click on hash-link.");\n location.reload();\n }, "500");\n };\n }\n }\n})();\nfunction toggleMenu() {\n var menu = document.querySelector(".secret-menu");\n menu.classList.toggle("open");\n}\nwindow.toggleMenu = toggleMenu;';
28
+ var client_default = '/**\n * @param {string} cookieName\n * @param {string} cookieValue\n * @param {number} exdays\n * @returns {void}\n */\nfunction setCookie(cookieName, cookieValue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);\n var expires = "expires=".concat(d.toUTCString());\n document.cookie = "".concat(cookieName, "=").concat(cookieValue, ";").concat(expires, ";path=/");\n}\n\n/**\n * @param {string} cookieName\n * @returns {string | undefined}\n */\nfunction getCookie(cookieName) {\n var name = "".concat(cookieName, "=");\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(";");\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) === " ") {\n c = c.substring(1);\n }\n if (c.indexOf(name) === 0) {\n return c.substring(name.length, c.length);\n }\n }\n return undefined;\n}\n(function () {\n /** @type {NodeListOf<HTMLSelectElement>} */\n var selections = document.querySelectorAll(".secret-menu select");\n for (var i = 0; i < selections.length; i++) {\n var select = selections[i];\n select.value = getCookie(select.name) ? getCookie(select.name) : "default";\n if (select.getAttribute("data-sessionStorage") === "true") {\n var cookieValue = getCookie(select.name);\n if (cookieValue) {\n sessionStorage.setItem(select.name, atob(cookieValue));\n }\n }\n select.onchange = function (event) {\n var element = event.target;\n setCookie(element.name, element.value, 30);\n if (element.getAttribute("data-exec-on-change")) {\n window[element.getAttribute("data-exec-on-change")]();\n }\n if (element.getAttribute("data-reload") === "true") {\n location.reload(true);\n }\n if (element.getAttribute("data-sessionStorage") === "true") {\n var sessionKey = element.id;\n if (element.value) {\n var value = atob(element.value);\n console.log("Laddar sessionstorage ".concat(sessionKey, " med \\n ").concat(value));\n sessionStorage.setItem(sessionKey, value);\n } else {\n console.log("T\\xF6mmer sessionstorage");\n sessionStorage.removeItem(sessionKey);\n }\n location.reload(true);\n }\n };\n }\n\n /* Forcerar att sidan laddas om, \xE4ven n\xE4r l\xE4nken \xE4r av typen: /#/granska/8 */\n /** @type {NodeListOf<HTMLAnchorElement>} */\n var links = document.querySelectorAll(".secret-menu ul li a");\n for (var _i = 0; _i < links.length; _i++) {\n var link = links[_i];\n if (link.getAttribute("href").startsWith("/#")) {\n /**\n * @param {MouseEvent} event\n */\n link.onclick = function (event) {\n event.preventDefault();\n window.location.href = event.target.getAttribute("href");\n setTimeout(function () {\n console.log("Reload after click on hash-link.");\n location.reload();\n }, "500");\n };\n }\n }\n})();\nfunction toggleMenu() {\n var menu = document.querySelector(".secret-menu");\n menu.classList.toggle("open");\n}\nwindow.toggleMenu = toggleMenu;';
29
+
30
+ // node_modules/@fkui/logic/lib/esm/index.js
31
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
32
+ var lodash_clonedeep = { exports: {} };
33
+ lodash_clonedeep.exports;
34
+ var hasRequiredLodash_clonedeep;
35
+ function requireLodash_clonedeep() {
36
+ if (hasRequiredLodash_clonedeep) return lodash_clonedeep.exports;
37
+ hasRequiredLodash_clonedeep = 1;
38
+ (function(module2, exports$1) {
39
+ var LARGE_ARRAY_SIZE = 200;
40
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
41
+ var MAX_SAFE_INTEGER = 9007199254740991;
42
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", promiseTag = "[object Promise]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
43
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
44
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
45
+ var reFlags = /\w*$/;
46
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
47
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
48
+ var cloneableTags = {};
49
+ cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
50
+ cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
51
+ var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
52
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
53
+ var root = freeGlobal || freeSelf || Function("return this")();
54
+ var freeExports = exports$1 && !exports$1.nodeType && exports$1;
55
+ var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
56
+ var moduleExports = freeModule && freeModule.exports === freeExports;
57
+ function addMapEntry(map, pair) {
58
+ map.set(pair[0], pair[1]);
59
+ return map;
60
+ }
61
+ function addSetEntry(set, value) {
62
+ set.add(value);
63
+ return set;
64
+ }
65
+ function arrayEach(array, iteratee) {
66
+ var index = -1, length = array ? array.length : 0;
67
+ while (++index < length) {
68
+ if (iteratee(array[index], index, array) === false) {
69
+ break;
70
+ }
71
+ }
72
+ return array;
73
+ }
74
+ function arrayPush(array, values) {
75
+ var index = -1, length = values.length, offset = array.length;
76
+ while (++index < length) {
77
+ array[offset + index] = values[index];
78
+ }
79
+ return array;
80
+ }
81
+ function arrayReduce(array, iteratee, accumulator, initAccum) {
82
+ var index = -1, length = array ? array.length : 0;
83
+ while (++index < length) {
84
+ accumulator = iteratee(accumulator, array[index], index, array);
85
+ }
86
+ return accumulator;
87
+ }
88
+ function baseTimes(n, iteratee) {
89
+ var index = -1, result = Array(n);
90
+ while (++index < n) {
91
+ result[index] = iteratee(index);
92
+ }
93
+ return result;
94
+ }
95
+ function getValue(object, key) {
96
+ return object == null ? void 0 : object[key];
97
+ }
98
+ function isHostObject(value) {
99
+ var result = false;
100
+ if (value != null && typeof value.toString != "function") {
101
+ try {
102
+ result = !!(value + "");
103
+ } catch (e) {
104
+ }
105
+ }
106
+ return result;
107
+ }
108
+ function mapToArray(map) {
109
+ var index = -1, result = Array(map.size);
110
+ map.forEach(function(value, key) {
111
+ result[++index] = [key, value];
112
+ });
113
+ return result;
114
+ }
115
+ function overArg(func, transform) {
116
+ return function(arg) {
117
+ return func(transform(arg));
118
+ };
119
+ }
120
+ function setToArray(set) {
121
+ var index = -1, result = Array(set.size);
122
+ set.forEach(function(value) {
123
+ result[++index] = value;
124
+ });
125
+ return result;
126
+ }
127
+ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
128
+ var coreJsData = root["__core-js_shared__"];
129
+ var maskSrcKey = (function() {
130
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
131
+ return uid ? "Symbol(src)_1." + uid : "";
132
+ })();
133
+ var funcToString = funcProto.toString;
134
+ var hasOwnProperty = objectProto.hasOwnProperty;
135
+ var objectToString = objectProto.toString;
136
+ var reIsNative = RegExp(
137
+ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
138
+ );
139
+ var Buffer2 = moduleExports ? root.Buffer : void 0, Symbol2 = root.Symbol, Uint8Array2 = root.Uint8Array, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice;
140
+ var nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0, nativeKeys = overArg(Object.keys, Object);
141
+ var DataView = getNative(root, "DataView"), Map2 = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set = getNative(root, "Set"), WeakMap = getNative(root, "WeakMap"), nativeCreate = getNative(Object, "create");
142
+ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
143
+ var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
144
+ function Hash(entries) {
145
+ var index = -1, length = entries ? entries.length : 0;
146
+ this.clear();
147
+ while (++index < length) {
148
+ var entry = entries[index];
149
+ this.set(entry[0], entry[1]);
150
+ }
151
+ }
152
+ function hashClear() {
153
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
154
+ }
155
+ function hashDelete(key) {
156
+ return this.has(key) && delete this.__data__[key];
157
+ }
158
+ function hashGet(key) {
159
+ var data = this.__data__;
160
+ if (nativeCreate) {
161
+ var result = data[key];
162
+ return result === HASH_UNDEFINED ? void 0 : result;
163
+ }
164
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
165
+ }
166
+ function hashHas(key) {
167
+ var data = this.__data__;
168
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
169
+ }
170
+ function hashSet(key, value) {
171
+ var data = this.__data__;
172
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
173
+ return this;
174
+ }
175
+ Hash.prototype.clear = hashClear;
176
+ Hash.prototype["delete"] = hashDelete;
177
+ Hash.prototype.get = hashGet;
178
+ Hash.prototype.has = hashHas;
179
+ Hash.prototype.set = hashSet;
180
+ function ListCache(entries) {
181
+ var index = -1, length = entries ? entries.length : 0;
182
+ this.clear();
183
+ while (++index < length) {
184
+ var entry = entries[index];
185
+ this.set(entry[0], entry[1]);
186
+ }
187
+ }
188
+ function listCacheClear() {
189
+ this.__data__ = [];
190
+ }
191
+ function listCacheDelete(key) {
192
+ var data = this.__data__, index = assocIndexOf(data, key);
193
+ if (index < 0) {
194
+ return false;
195
+ }
196
+ var lastIndex = data.length - 1;
197
+ if (index == lastIndex) {
198
+ data.pop();
199
+ } else {
200
+ splice.call(data, index, 1);
201
+ }
202
+ return true;
203
+ }
204
+ function listCacheGet(key) {
205
+ var data = this.__data__, index = assocIndexOf(data, key);
206
+ return index < 0 ? void 0 : data[index][1];
207
+ }
208
+ function listCacheHas(key) {
209
+ return assocIndexOf(this.__data__, key) > -1;
210
+ }
211
+ function listCacheSet(key, value) {
212
+ var data = this.__data__, index = assocIndexOf(data, key);
213
+ if (index < 0) {
214
+ data.push([key, value]);
215
+ } else {
216
+ data[index][1] = value;
217
+ }
218
+ return this;
219
+ }
220
+ ListCache.prototype.clear = listCacheClear;
221
+ ListCache.prototype["delete"] = listCacheDelete;
222
+ ListCache.prototype.get = listCacheGet;
223
+ ListCache.prototype.has = listCacheHas;
224
+ ListCache.prototype.set = listCacheSet;
225
+ function MapCache(entries) {
226
+ var index = -1, length = entries ? entries.length : 0;
227
+ this.clear();
228
+ while (++index < length) {
229
+ var entry = entries[index];
230
+ this.set(entry[0], entry[1]);
231
+ }
232
+ }
233
+ function mapCacheClear() {
234
+ this.__data__ = {
235
+ "hash": new Hash(),
236
+ "map": new (Map2 || ListCache)(),
237
+ "string": new Hash()
238
+ };
239
+ }
240
+ function mapCacheDelete(key) {
241
+ return getMapData(this, key)["delete"](key);
242
+ }
243
+ function mapCacheGet(key) {
244
+ return getMapData(this, key).get(key);
245
+ }
246
+ function mapCacheHas(key) {
247
+ return getMapData(this, key).has(key);
248
+ }
249
+ function mapCacheSet(key, value) {
250
+ getMapData(this, key).set(key, value);
251
+ return this;
252
+ }
253
+ MapCache.prototype.clear = mapCacheClear;
254
+ MapCache.prototype["delete"] = mapCacheDelete;
255
+ MapCache.prototype.get = mapCacheGet;
256
+ MapCache.prototype.has = mapCacheHas;
257
+ MapCache.prototype.set = mapCacheSet;
258
+ function Stack(entries) {
259
+ this.__data__ = new ListCache(entries);
260
+ }
261
+ function stackClear() {
262
+ this.__data__ = new ListCache();
263
+ }
264
+ function stackDelete(key) {
265
+ return this.__data__["delete"](key);
266
+ }
267
+ function stackGet(key) {
268
+ return this.__data__.get(key);
269
+ }
270
+ function stackHas(key) {
271
+ return this.__data__.has(key);
272
+ }
273
+ function stackSet(key, value) {
274
+ var cache = this.__data__;
275
+ if (cache instanceof ListCache) {
276
+ var pairs = cache.__data__;
277
+ if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
278
+ pairs.push([key, value]);
279
+ return this;
280
+ }
281
+ cache = this.__data__ = new MapCache(pairs);
282
+ }
283
+ cache.set(key, value);
284
+ return this;
285
+ }
286
+ Stack.prototype.clear = stackClear;
287
+ Stack.prototype["delete"] = stackDelete;
288
+ Stack.prototype.get = stackGet;
289
+ Stack.prototype.has = stackHas;
290
+ Stack.prototype.set = stackSet;
291
+ function arrayLikeKeys(value, inherited) {
292
+ var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
293
+ var length = result.length, skipIndexes = !!length;
294
+ for (var key in value) {
295
+ if (hasOwnProperty.call(value, key) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
296
+ result.push(key);
297
+ }
298
+ }
299
+ return result;
300
+ }
301
+ function assignValue(object, key, value) {
302
+ var objValue = object[key];
303
+ if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
304
+ object[key] = value;
305
+ }
306
+ }
307
+ function assocIndexOf(array, key) {
308
+ var length = array.length;
309
+ while (length--) {
310
+ if (eq(array[length][0], key)) {
311
+ return length;
312
+ }
313
+ }
314
+ return -1;
315
+ }
316
+ function baseAssign(object, source) {
317
+ return object && copyObject(source, keys(source), object);
318
+ }
319
+ function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
320
+ var result;
321
+ if (customizer) {
322
+ result = object ? customizer(value, key, object, stack) : customizer(value);
323
+ }
324
+ if (result !== void 0) {
325
+ return result;
326
+ }
327
+ if (!isObject(value)) {
328
+ return value;
329
+ }
330
+ var isArr = isArray(value);
331
+ if (isArr) {
332
+ result = initCloneArray(value);
333
+ if (!isDeep) {
334
+ return copyArray(value, result);
335
+ }
336
+ } else {
337
+ var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
338
+ if (isBuffer(value)) {
339
+ return cloneBuffer(value, isDeep);
340
+ }
341
+ if (tag == objectTag || tag == argsTag || isFunc && !object) {
342
+ if (isHostObject(value)) {
343
+ return object ? value : {};
344
+ }
345
+ result = initCloneObject(isFunc ? {} : value);
346
+ if (!isDeep) {
347
+ return copySymbols(value, baseAssign(result, value));
348
+ }
349
+ } else {
350
+ if (!cloneableTags[tag]) {
351
+ return object ? value : {};
352
+ }
353
+ result = initCloneByTag(value, tag, baseClone, isDeep);
354
+ }
355
+ }
356
+ stack || (stack = new Stack());
357
+ var stacked = stack.get(value);
358
+ if (stacked) {
359
+ return stacked;
360
+ }
361
+ stack.set(value, result);
362
+ if (!isArr) {
363
+ var props = isFull ? getAllKeys(value) : keys(value);
364
+ }
365
+ arrayEach(props || value, function(subValue, key2) {
366
+ if (props) {
367
+ key2 = subValue;
368
+ subValue = value[key2];
369
+ }
370
+ assignValue(result, key2, baseClone(subValue, isDeep, isFull, customizer, key2, value, stack));
371
+ });
372
+ return result;
373
+ }
374
+ function baseCreate(proto) {
375
+ return isObject(proto) ? objectCreate(proto) : {};
376
+ }
377
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
378
+ var result = keysFunc(object);
379
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
380
+ }
381
+ function baseGetTag(value) {
382
+ return objectToString.call(value);
383
+ }
384
+ function baseIsNative(value) {
385
+ if (!isObject(value) || isMasked(value)) {
386
+ return false;
387
+ }
388
+ var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
389
+ return pattern.test(toSource(value));
390
+ }
391
+ function baseKeys(object) {
392
+ if (!isPrototype(object)) {
393
+ return nativeKeys(object);
394
+ }
395
+ var result = [];
396
+ for (var key in Object(object)) {
397
+ if (hasOwnProperty.call(object, key) && key != "constructor") {
398
+ result.push(key);
399
+ }
400
+ }
401
+ return result;
402
+ }
403
+ function cloneBuffer(buffer, isDeep) {
404
+ if (isDeep) {
405
+ return buffer.slice();
406
+ }
407
+ var result = new buffer.constructor(buffer.length);
408
+ buffer.copy(result);
409
+ return result;
410
+ }
411
+ function cloneArrayBuffer(arrayBuffer) {
412
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
413
+ new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
414
+ return result;
415
+ }
416
+ function cloneDataView(dataView, isDeep) {
417
+ var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
418
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
419
+ }
420
+ function cloneMap(map, isDeep, cloneFunc) {
421
+ var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
422
+ return arrayReduce(array, addMapEntry, new map.constructor());
423
+ }
424
+ function cloneRegExp(regexp) {
425
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
426
+ result.lastIndex = regexp.lastIndex;
427
+ return result;
428
+ }
429
+ function cloneSet(set, isDeep, cloneFunc) {
430
+ var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
431
+ return arrayReduce(array, addSetEntry, new set.constructor());
432
+ }
433
+ function cloneSymbol(symbol) {
434
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
435
+ }
436
+ function cloneTypedArray(typedArray, isDeep) {
437
+ var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
438
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
439
+ }
440
+ function copyArray(source, array) {
441
+ var index = -1, length = source.length;
442
+ array || (array = Array(length));
443
+ while (++index < length) {
444
+ array[index] = source[index];
445
+ }
446
+ return array;
447
+ }
448
+ function copyObject(source, props, object, customizer) {
449
+ object || (object = {});
450
+ var index = -1, length = props.length;
451
+ while (++index < length) {
452
+ var key = props[index];
453
+ var newValue = void 0;
454
+ assignValue(object, key, newValue === void 0 ? source[key] : newValue);
455
+ }
456
+ return object;
457
+ }
458
+ function copySymbols(source, object) {
459
+ return copyObject(source, getSymbols(source), object);
460
+ }
461
+ function getAllKeys(object) {
462
+ return baseGetAllKeys(object, keys, getSymbols);
463
+ }
464
+ function getMapData(map, key) {
465
+ var data = map.__data__;
466
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
467
+ }
468
+ function getNative(object, key) {
469
+ var value = getValue(object, key);
470
+ return baseIsNative(value) ? value : void 0;
471
+ }
472
+ var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
473
+ var getTag = baseGetTag;
474
+ if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
475
+ getTag = function(value) {
476
+ var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
477
+ if (ctorString) {
478
+ switch (ctorString) {
479
+ case dataViewCtorString:
480
+ return dataViewTag;
481
+ case mapCtorString:
482
+ return mapTag;
483
+ case promiseCtorString:
484
+ return promiseTag;
485
+ case setCtorString:
486
+ return setTag;
487
+ case weakMapCtorString:
488
+ return weakMapTag;
489
+ }
490
+ }
491
+ return result;
492
+ };
493
+ }
494
+ function initCloneArray(array) {
495
+ var length = array.length, result = array.constructor(length);
496
+ if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
497
+ result.index = array.index;
498
+ result.input = array.input;
499
+ }
500
+ return result;
501
+ }
502
+ function initCloneObject(object) {
503
+ return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
504
+ }
505
+ function initCloneByTag(object, tag, cloneFunc, isDeep) {
506
+ var Ctor = object.constructor;
507
+ switch (tag) {
508
+ case arrayBufferTag:
509
+ return cloneArrayBuffer(object);
510
+ case boolTag:
511
+ case dateTag:
512
+ return new Ctor(+object);
513
+ case dataViewTag:
514
+ return cloneDataView(object, isDeep);
515
+ case float32Tag:
516
+ case float64Tag:
517
+ case int8Tag:
518
+ case int16Tag:
519
+ case int32Tag:
520
+ case uint8Tag:
521
+ case uint8ClampedTag:
522
+ case uint16Tag:
523
+ case uint32Tag:
524
+ return cloneTypedArray(object, isDeep);
525
+ case mapTag:
526
+ return cloneMap(object, isDeep, cloneFunc);
527
+ case numberTag:
528
+ case stringTag:
529
+ return new Ctor(object);
530
+ case regexpTag:
531
+ return cloneRegExp(object);
532
+ case setTag:
533
+ return cloneSet(object, isDeep, cloneFunc);
534
+ case symbolTag:
535
+ return cloneSymbol(object);
536
+ }
537
+ }
538
+ function isIndex(value, length) {
539
+ length = length == null ? MAX_SAFE_INTEGER : length;
540
+ return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
541
+ }
542
+ function isKeyable(value) {
543
+ var type = typeof value;
544
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
545
+ }
546
+ function isMasked(func) {
547
+ return !!maskSrcKey && maskSrcKey in func;
548
+ }
549
+ function isPrototype(value) {
550
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
551
+ return value === proto;
552
+ }
553
+ function toSource(func) {
554
+ if (func != null) {
555
+ try {
556
+ return funcToString.call(func);
557
+ } catch (e) {
558
+ }
559
+ try {
560
+ return func + "";
561
+ } catch (e) {
562
+ }
563
+ }
564
+ return "";
565
+ }
566
+ function cloneDeep(value) {
567
+ return baseClone(value, true, true);
568
+ }
569
+ function eq(value, other) {
570
+ return value === other || value !== value && other !== other;
571
+ }
572
+ function isArguments(value) {
573
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
574
+ }
575
+ var isArray = Array.isArray;
576
+ function isArrayLike(value) {
577
+ return value != null && isLength(value.length) && !isFunction(value);
578
+ }
579
+ function isArrayLikeObject(value) {
580
+ return isObjectLike(value) && isArrayLike(value);
581
+ }
582
+ var isBuffer = nativeIsBuffer || stubFalse;
583
+ function isFunction(value) {
584
+ var tag = isObject(value) ? objectToString.call(value) : "";
585
+ return tag == funcTag || tag == genTag;
586
+ }
587
+ function isLength(value) {
588
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
589
+ }
590
+ function isObject(value) {
591
+ var type = typeof value;
592
+ return !!value && (type == "object" || type == "function");
593
+ }
594
+ function isObjectLike(value) {
595
+ return !!value && typeof value == "object";
596
+ }
597
+ function keys(object) {
598
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
599
+ }
600
+ function stubArray() {
601
+ return [];
602
+ }
603
+ function stubFalse() {
604
+ return false;
605
+ }
606
+ module2.exports = cloneDeep;
607
+ })(lodash_clonedeep, lodash_clonedeep.exports);
608
+ return lodash_clonedeep.exports;
609
+ }
610
+ var lodash_clonedeepExports = requireLodash_clonedeep();
611
+ var TWELVE_HOURS = 12 * 60 * 60;
612
+ function setCookie(options) {
613
+ const { name, value, keepAnyExistingCookie, timeLimitSeconds } = options;
614
+ const shouldKeepTheExistingCookie = keepAnyExistingCookie && findCookie(name);
615
+ if (shouldKeepTheExistingCookie) {
616
+ return;
617
+ }
618
+ const timeout = timeLimitSeconds ?? TWELVE_HOURS;
619
+ const cookieString = `${name}=${encodeURIComponent(value)}; path=/; max-age=${String(timeout)};`;
620
+ document.cookie = cookieString;
621
+ }
622
+ function findCookie(name) {
623
+ if (!document?.cookie) {
624
+ return void 0;
625
+ }
626
+ const cookieKeyValueStrings = document.cookie.split(";");
627
+ for (const cookie of cookieKeyValueStrings) {
628
+ const [foundCookieName, foundCookieValue] = cookie.split("=", 2);
629
+ if (name === foundCookieName.trim()) {
630
+ return foundCookieValue ? decodeURIComponent(foundCookieValue) : void 0;
631
+ }
632
+ }
633
+ return void 0;
634
+ }
635
+ function getDefaultExportFromCjs(x) {
636
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
637
+ }
638
+ var dayjs_min$1 = { exports: {} };
639
+ var dayjs_min = dayjs_min$1.exports;
640
+ var hasRequiredDayjs_min;
641
+ function requireDayjs_min() {
642
+ if (hasRequiredDayjs_min) return dayjs_min$1.exports;
643
+ hasRequiredDayjs_min = 1;
644
+ (function(module2, exports$1) {
645
+ !(function(t, e) {
646
+ module2.exports = e();
647
+ })(dayjs_min, (function() {
648
+ var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
649
+ var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
650
+ return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
651
+ } }, m = function(t2, e2, n2) {
652
+ var r2 = String(t2);
653
+ return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
654
+ }, v = { s: m, z: function(t2) {
655
+ var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
656
+ return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
657
+ }, m: function t2(e2, n2) {
658
+ if (e2.date() < n2.date()) return -t2(n2, e2);
659
+ var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
660
+ return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
661
+ }, a: function(t2) {
662
+ return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
663
+ }, p: function(t2) {
664
+ return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
665
+ }, u: function(t2) {
666
+ return void 0 === t2;
667
+ } }, g = "en", D = {};
668
+ D[g] = M;
669
+ var p = "$isDayjsObject", S = function(t2) {
670
+ return t2 instanceof _ || !(!t2 || !t2[p]);
671
+ }, w = function t2(e2, n2, r2) {
672
+ var i2;
673
+ if (!e2) return g;
674
+ if ("string" == typeof e2) {
675
+ var s2 = e2.toLowerCase();
676
+ D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
677
+ var u2 = e2.split("-");
678
+ if (!i2 && u2.length > 1) return t2(u2[0]);
679
+ } else {
680
+ var a2 = e2.name;
681
+ D[a2] = e2, i2 = a2;
682
+ }
683
+ return !r2 && i2 && (g = i2), i2 || !r2 && g;
684
+ }, O = function(t2, e2) {
685
+ if (S(t2)) return t2.clone();
686
+ var n2 = "object" == typeof e2 ? e2 : {};
687
+ return n2.date = t2, n2.args = arguments, new _(n2);
688
+ }, b = v;
689
+ b.l = w, b.i = S, b.w = function(t2, e2) {
690
+ return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
691
+ };
692
+ var _ = (function() {
693
+ function M2(t2) {
694
+ this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
695
+ }
696
+ var m2 = M2.prototype;
697
+ return m2.parse = function(t2) {
698
+ this.$d = (function(t3) {
699
+ var e2 = t3.date, n2 = t3.utc;
700
+ if (null === e2) return /* @__PURE__ */ new Date(NaN);
701
+ if (b.u(e2)) return /* @__PURE__ */ new Date();
702
+ if (e2 instanceof Date) return new Date(e2);
703
+ if ("string" == typeof e2 && !/Z$/i.test(e2)) {
704
+ var r2 = e2.match($);
705
+ if (r2) {
706
+ var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
707
+ return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
708
+ }
709
+ }
710
+ return new Date(e2);
711
+ })(t2), this.init();
712
+ }, m2.init = function() {
713
+ var t2 = this.$d;
714
+ this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
715
+ }, m2.$utils = function() {
716
+ return b;
717
+ }, m2.isValid = function() {
718
+ return !(this.$d.toString() === l);
719
+ }, m2.isSame = function(t2, e2) {
720
+ var n2 = O(t2);
721
+ return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
722
+ }, m2.isAfter = function(t2, e2) {
723
+ return O(t2) < this.startOf(e2);
724
+ }, m2.isBefore = function(t2, e2) {
725
+ return this.endOf(e2) < O(t2);
726
+ }, m2.$g = function(t2, e2, n2) {
727
+ return b.u(t2) ? this[e2] : this.set(n2, t2);
728
+ }, m2.unix = function() {
729
+ return Math.floor(this.valueOf() / 1e3);
730
+ }, m2.valueOf = function() {
731
+ return this.$d.getTime();
732
+ }, m2.startOf = function(t2, e2) {
733
+ var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
734
+ var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
735
+ return r2 ? i2 : i2.endOf(a);
736
+ }, $2 = function(t3, e3) {
737
+ return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
738
+ }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
739
+ switch (f2) {
740
+ case h:
741
+ return r2 ? l2(1, 0) : l2(31, 11);
742
+ case c:
743
+ return r2 ? l2(1, M3) : l2(0, M3 + 1);
744
+ case o:
745
+ var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
746
+ return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
747
+ case a:
748
+ case d:
749
+ return $2(v2 + "Hours", 0);
750
+ case u:
751
+ return $2(v2 + "Minutes", 1);
752
+ case s:
753
+ return $2(v2 + "Seconds", 2);
754
+ case i:
755
+ return $2(v2 + "Milliseconds", 3);
756
+ default:
757
+ return this.clone();
758
+ }
759
+ }, m2.endOf = function(t2) {
760
+ return this.startOf(t2, false);
761
+ }, m2.$set = function(t2, e2) {
762
+ var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
763
+ if (o2 === c || o2 === h) {
764
+ var y2 = this.clone().set(d, 1);
765
+ y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
766
+ } else l2 && this.$d[l2]($2);
767
+ return this.init(), this;
768
+ }, m2.set = function(t2, e2) {
769
+ return this.clone().$set(t2, e2);
770
+ }, m2.get = function(t2) {
771
+ return this[b.p(t2)]();
772
+ }, m2.add = function(r2, f2) {
773
+ var d2, l2 = this;
774
+ r2 = Number(r2);
775
+ var $2 = b.p(f2), y2 = function(t2) {
776
+ var e2 = O(l2);
777
+ return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
778
+ };
779
+ if ($2 === c) return this.set(c, this.$M + r2);
780
+ if ($2 === h) return this.set(h, this.$y + r2);
781
+ if ($2 === a) return y2(1);
782
+ if ($2 === o) return y2(7);
783
+ var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
784
+ return b.w(m3, this);
785
+ }, m2.subtract = function(t2, e2) {
786
+ return this.add(-1 * t2, e2);
787
+ }, m2.format = function(t2) {
788
+ var e2 = this, n2 = this.$locale();
789
+ if (!this.isValid()) return n2.invalidDate || l;
790
+ var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
791
+ return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
792
+ }, d2 = function(t3) {
793
+ return b.s(s2 % 12 || 12, t3, "0");
794
+ }, $2 = f2 || function(t3, e3, n3) {
795
+ var r3 = t3 < 12 ? "AM" : "PM";
796
+ return n3 ? r3.toLowerCase() : r3;
797
+ };
798
+ return r2.replace(y, (function(t3, r3) {
799
+ return r3 || (function(t4) {
800
+ switch (t4) {
801
+ case "YY":
802
+ return String(e2.$y).slice(-2);
803
+ case "YYYY":
804
+ return b.s(e2.$y, 4, "0");
805
+ case "M":
806
+ return a2 + 1;
807
+ case "MM":
808
+ return b.s(a2 + 1, 2, "0");
809
+ case "MMM":
810
+ return h2(n2.monthsShort, a2, c2, 3);
811
+ case "MMMM":
812
+ return h2(c2, a2);
813
+ case "D":
814
+ return e2.$D;
815
+ case "DD":
816
+ return b.s(e2.$D, 2, "0");
817
+ case "d":
818
+ return String(e2.$W);
819
+ case "dd":
820
+ return h2(n2.weekdaysMin, e2.$W, o2, 2);
821
+ case "ddd":
822
+ return h2(n2.weekdaysShort, e2.$W, o2, 3);
823
+ case "dddd":
824
+ return o2[e2.$W];
825
+ case "H":
826
+ return String(s2);
827
+ case "HH":
828
+ return b.s(s2, 2, "0");
829
+ case "h":
830
+ return d2(1);
831
+ case "hh":
832
+ return d2(2);
833
+ case "a":
834
+ return $2(s2, u2, true);
835
+ case "A":
836
+ return $2(s2, u2, false);
837
+ case "m":
838
+ return String(u2);
839
+ case "mm":
840
+ return b.s(u2, 2, "0");
841
+ case "s":
842
+ return String(e2.$s);
843
+ case "ss":
844
+ return b.s(e2.$s, 2, "0");
845
+ case "SSS":
846
+ return b.s(e2.$ms, 3, "0");
847
+ case "Z":
848
+ return i2;
849
+ }
850
+ return null;
851
+ })(t3) || i2.replace(":", "");
852
+ }));
853
+ }, m2.utcOffset = function() {
854
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
855
+ }, m2.diff = function(r2, d2, l2) {
856
+ var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
857
+ return b.m(y2, m3);
858
+ };
859
+ switch (M3) {
860
+ case h:
861
+ $2 = D2() / 12;
862
+ break;
863
+ case c:
864
+ $2 = D2();
865
+ break;
866
+ case f:
867
+ $2 = D2() / 3;
868
+ break;
869
+ case o:
870
+ $2 = (g2 - v2) / 6048e5;
871
+ break;
872
+ case a:
873
+ $2 = (g2 - v2) / 864e5;
874
+ break;
875
+ case u:
876
+ $2 = g2 / n;
877
+ break;
878
+ case s:
879
+ $2 = g2 / e;
880
+ break;
881
+ case i:
882
+ $2 = g2 / t;
883
+ break;
884
+ default:
885
+ $2 = g2;
886
+ }
887
+ return l2 ? $2 : b.a($2);
888
+ }, m2.daysInMonth = function() {
889
+ return this.endOf(c).$D;
890
+ }, m2.$locale = function() {
891
+ return D[this.$L];
892
+ }, m2.locale = function(t2, e2) {
893
+ if (!t2) return this.$L;
894
+ var n2 = this.clone(), r2 = w(t2, e2, true);
895
+ return r2 && (n2.$L = r2), n2;
896
+ }, m2.clone = function() {
897
+ return b.w(this.$d, this);
898
+ }, m2.toDate = function() {
899
+ return new Date(this.valueOf());
900
+ }, m2.toJSON = function() {
901
+ return this.isValid() ? this.toISOString() : null;
902
+ }, m2.toISOString = function() {
903
+ return this.$d.toISOString();
904
+ }, m2.toString = function() {
905
+ return this.$d.toUTCString();
906
+ }, M2;
907
+ })(), k = _.prototype;
908
+ return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach((function(t2) {
909
+ k[t2[1]] = function(e2) {
910
+ return this.$g(e2, t2[0], t2[1]);
911
+ };
912
+ })), O.extend = function(t2, e2) {
913
+ return t2.$i || (t2(e2, _, O), t2.$i = true), O;
914
+ }, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
915
+ return O(1e3 * t2);
916
+ }, O.en = D[g], O.Ls = D, O.p = {}, O;
917
+ }));
918
+ })(dayjs_min$1);
919
+ return dayjs_min$1.exports;
920
+ }
921
+ var dayjs_minExports = requireDayjs_min();
922
+ var dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
923
+ var sv$1 = { exports: {} };
924
+ var sv = sv$1.exports;
925
+ var hasRequiredSv;
926
+ function requireSv() {
927
+ if (hasRequiredSv) return sv$1.exports;
928
+ hasRequiredSv = 1;
929
+ (function(module2, exports$1) {
930
+ !(function(e, t) {
931
+ module2.exports = t(requireDayjs_min());
932
+ })(sv, (function(e) {
933
+ function t(e2) {
934
+ return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
935
+ }
936
+ var a = t(e), d = { name: "sv", weekdays: "s\xF6ndag_m\xE5ndag_tisdag_onsdag_torsdag_fredag_l\xF6rdag".split("_"), weekdaysShort: "s\xF6n_m\xE5n_tis_ons_tor_fre_l\xF6r".split("_"), weekdaysMin: "s\xF6_m\xE5_ti_on_to_fr_l\xF6".split("_"), months: "januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"), monthsShort: "jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"), weekStart: 1, yearStart: 4, ordinal: function(e2) {
937
+ var t2 = e2 % 10;
938
+ return "[" + e2 + (1 === t2 || 2 === t2 ? "a" : "e") + "]";
939
+ }, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY-MM-DD", LL: "D MMMM YYYY", LLL: "D MMMM YYYY [kl.] HH:mm", LLLL: "dddd D MMMM YYYY [kl.] HH:mm", lll: "D MMM YYYY HH:mm", llll: "ddd D MMM YYYY HH:mm" }, relativeTime: { future: "om %s", past: "f\xF6r %s sedan", s: "n\xE5gra sekunder", m: "en minut", mm: "%d minuter", h: "en timme", hh: "%d timmar", d: "en dag", dd: "%d dagar", M: "en m\xE5nad", MM: "%d m\xE5nader", y: "ett \xE5r", yy: "%d \xE5r" } };
940
+ return a.default.locale(d, null, true), d;
941
+ }));
942
+ })(sv$1);
943
+ return sv$1.exports;
944
+ }
945
+ requireSv();
946
+ var weekOfYear$2 = { exports: {} };
947
+ var weekOfYear$1 = weekOfYear$2.exports;
948
+ var hasRequiredWeekOfYear;
949
+ function requireWeekOfYear() {
950
+ if (hasRequiredWeekOfYear) return weekOfYear$2.exports;
951
+ hasRequiredWeekOfYear = 1;
952
+ (function(module2, exports$1) {
953
+ !(function(e, t) {
954
+ module2.exports = t();
955
+ })(weekOfYear$1, (function() {
956
+ var e = "week", t = "year";
957
+ return function(i, n, r) {
958
+ var f = n.prototype;
959
+ f.week = function(i2) {
960
+ if (void 0 === i2 && (i2 = null), null !== i2) return this.add(7 * (i2 - this.week()), "day");
961
+ var n2 = this.$locale().yearStart || 1;
962
+ if (11 === this.month() && this.date() > 25) {
963
+ var f2 = r(this).startOf(t).add(1, t).date(n2), s = r(this).endOf(e);
964
+ if (f2.isBefore(s)) return 1;
965
+ }
966
+ var a = r(this).startOf(t).date(n2).startOf(e).subtract(1, "millisecond"), o = this.diff(a, e, true);
967
+ return o < 0 ? r(this).startOf("week").week() : Math.ceil(o);
968
+ }, f.weeks = function(e2) {
969
+ return void 0 === e2 && (e2 = null), this.week(e2);
970
+ };
971
+ };
972
+ }));
973
+ })(weekOfYear$2);
974
+ return weekOfYear$2.exports;
975
+ }
976
+ var weekOfYearExports = requireWeekOfYear();
977
+ var weekOfYear = /* @__PURE__ */ getDefaultExportFromCjs(weekOfYearExports);
978
+ dayjs.extend(weekOfYear);
979
+ var DateFormat;
980
+ (function(DateFormat2) {
981
+ DateFormat2["FULL"] = "full";
982
+ DateFormat2["LONG"] = "long";
983
+ DateFormat2["ISO8601"] = "iso-8601";
984
+ DateFormat2["YYYYMMDD"] = "YYYYMMDD";
985
+ })(DateFormat || (DateFormat = {}));
986
+ var Locale;
987
+ (function(Locale2) {
988
+ Locale2["SWEDISH"] = "sv";
989
+ Locale2["ENGLISH"] = "en";
990
+ })(Locale || (Locale = {}));
991
+ var Weekday;
992
+ (function(Weekday2) {
993
+ Weekday2[Weekday2["MONDAY"] = 1] = "MONDAY";
994
+ Weekday2[Weekday2["TUESDAY"] = 2] = "TUESDAY";
995
+ Weekday2[Weekday2["WEDNESDAY"] = 3] = "WEDNESDAY";
996
+ Weekday2[Weekday2["THURSDAY"] = 4] = "THURSDAY";
997
+ Weekday2[Weekday2["FRIDAY"] = 5] = "FRIDAY";
998
+ Weekday2[Weekday2["SATURDAY"] = 6] = "SATURDAY";
999
+ Weekday2[Weekday2["SUNDAY"] = 7] = "SUNDAY";
1000
+ })(Weekday || (Weekday = {}));
1001
+ ({
1002
+ [Locale.SWEDISH]: [
1003
+ {
1004
+ weekday: Weekday.MONDAY,
1005
+ name: "m\xE5ndag",
1006
+ shortName: "m\xE5n"
1007
+ },
1008
+ {
1009
+ weekday: Weekday.TUESDAY,
1010
+ name: "tisdag",
1011
+ shortName: "tis"
1012
+ },
1013
+ {
1014
+ weekday: Weekday.WEDNESDAY,
1015
+ name: "onsdag",
1016
+ shortName: "ons"
1017
+ },
1018
+ {
1019
+ weekday: Weekday.THURSDAY,
1020
+ name: "torsdag",
1021
+ shortName: "tor"
1022
+ },
1023
+ {
1024
+ weekday: Weekday.FRIDAY,
1025
+ name: "fredag",
1026
+ shortName: "fre"
1027
+ },
1028
+ {
1029
+ weekday: Weekday.SATURDAY,
1030
+ name: "l\xF6rdag",
1031
+ shortName: "l\xF6r"
1032
+ },
1033
+ {
1034
+ weekday: Weekday.SUNDAY,
1035
+ name: "s\xF6ndag",
1036
+ shortName: "s\xF6n"
1037
+ }
1038
+ ],
1039
+ [Locale.ENGLISH]: [
1040
+ {
1041
+ weekday: Weekday.MONDAY,
1042
+ name: "Monday",
1043
+ shortName: "Mon"
1044
+ },
1045
+ {
1046
+ weekday: Weekday.TUESDAY,
1047
+ name: "Tuesday",
1048
+ shortName: "Tue"
1049
+ },
1050
+ {
1051
+ weekday: Weekday.WEDNESDAY,
1052
+ name: "Wednesday",
1053
+ shortName: "Wed"
1054
+ },
1055
+ {
1056
+ weekday: Weekday.THURSDAY,
1057
+ name: "Thursday",
1058
+ shortName: "Thu"
1059
+ },
1060
+ {
1061
+ weekday: Weekday.FRIDAY,
1062
+ name: "Friday",
1063
+ shortName: "Fri"
1064
+ },
1065
+ {
1066
+ weekday: Weekday.SATURDAY,
1067
+ name: "Saturday",
1068
+ shortName: "Sat"
1069
+ },
1070
+ {
1071
+ weekday: Weekday.SUNDAY,
1072
+ name: "Sunday",
1073
+ shortName: "Sun"
1074
+ }
1075
+ ]
1076
+ });
1077
+ var ISO8601_YYYY_MM_DD = "YYYY-MM-DD";
1078
+ var formatter = {
1079
+ [Locale.SWEDISH]: {
1080
+ [DateFormat.FULL]: "dddd D MMMM YYYY",
1081
+ [DateFormat.LONG]: "D MMMM YYYY",
1082
+ [DateFormat.ISO8601]: ISO8601_YYYY_MM_DD,
1083
+ [DateFormat.YYYYMMDD]: "YYYYMMDD"
1084
+ },
1085
+ [Locale.ENGLISH]: {
1086
+ [DateFormat.FULL]: "dddd, D MMMM YYYY",
1087
+ [DateFormat.LONG]: "D MMMM YYYY",
1088
+ [DateFormat.ISO8601]: ISO8601_YYYY_MM_DD,
1089
+ [DateFormat.YYYYMMDD]: "YYYYMMDD"
1090
+ }
1091
+ };
1092
+ var wrapper;
1093
+ function createScreenReaderWrapper(options) {
1094
+ if (!getWrapper()) {
1095
+ wrapper = document.createElement("div");
1096
+ wrapper.id = "fkui-alert-screen-reader";
1097
+ wrapper.className = "sr-only";
1098
+ updateProperties(options);
1099
+ document.body.appendChild(wrapper);
1100
+ }
1101
+ }
1102
+ function updateProperties(options) {
1103
+ const wrapper2 = getWrapper();
1104
+ const ariaLive = options.assertive ? "assertive" : "polite";
1105
+ wrapper2.setAttribute("aria-live", ariaLive);
1106
+ }
1107
+ function getWrapper() {
1108
+ return wrapper;
1109
+ }
1110
+ if (typeof document !== "undefined") {
1111
+ createScreenReaderWrapper({ assertive: false });
1112
+ }
1113
+
1114
+ // src/settings/text.ts
1115
+ var template = `
1116
+ <template id="devindex-text">
1117
+ <span><!-- title --></span>
1118
+ <p><!-- description --></p>
1119
+ <br />
1120
+ <input type="text"></input>
1121
+ </template>
1122
+ `;
1123
+ var ONE_MONTH_IN_SECONDS = 2592e3;
1124
+ function createElement(setting) {
1125
+ const template2 = document.querySelector("#devindex-text");
1126
+ const clone = document.importNode(template2.content, true);
1127
+ const title = clone.querySelector("span");
1128
+ const description = clone.querySelector("p");
1129
+ const input = clone.querySelector("input");
1130
+ input.name = setting.key;
1131
+ input.value = findCookie(input.name) ?? "";
1132
+ input.addEventListener("input", () => {
1133
+ setCookie({
1134
+ name: input.name,
1135
+ value: input.value,
1136
+ timeLimitSeconds: ONE_MONTH_IN_SECONDS
1137
+ });
1138
+ });
1139
+ title.textContent = setting.title;
1140
+ if (setting.description) {
1141
+ description.textContent = setting.description;
1142
+ } else {
1143
+ description.remove();
1144
+ }
1145
+ return clone;
1146
+ }
1147
+ var text_default = { createElement, template };
29
1148
 
30
1149
  // src/style.scss
31
1150
  var style_default = `.secret-menu {
@@ -112,9 +1231,18 @@ var style_default = `.secret-menu {
112
1231
  width: 100%;
113
1232
  }`;
114
1233
 
115
- // src/menu.js
1234
+ // src/menu.ts
1235
+ var settingsNodes = [];
1236
+ function evaluateMock(mock) {
1237
+ if (typeof mock === "function") {
1238
+ const req = {};
1239
+ return mock(req);
1240
+ } else {
1241
+ return mock;
1242
+ }
1243
+ }
116
1244
  function generateOptionMarkupForSelect(setting) {
117
- const reload = setting.reloadOnChange !== void 0 ? setting.reloadOnChange : true;
1245
+ const reload = setting.reloadOnChange ?? true;
118
1246
  const description = setting.description ? `<p>${setting.description}</p>` : "";
119
1247
  const execOnChange = setting.execOnChange ? ` data-exec-on-change="${setting.execOnChange}"` : "";
120
1248
  let markup = `<label for="${setting.key}" class="label">${setting.title}</label>${description}<select id="${setting.key}" data-sessionStorage="${setting.sessionStorage}" data-reload="${reload}" ${execOnChange} name="${setting.key}" tabindex="-1">`;
@@ -135,10 +1263,6 @@ function generateOptionMarkupForLink(setting) {
135
1263
  markup = `${markup}</ul>`;
136
1264
  return markup;
137
1265
  }
138
- function generateOptionMarkupForTextInput(setting) {
139
- const description = setting.description ? `<p>${setting.description}</p>` : "";
140
- return `${setting.title} ${description} <br /> <input name="${setting.key}" type="text"></input>`;
141
- }
142
1266
  function generateOptionMarkup(setting) {
143
1267
  switch (setting.type) {
144
1268
  case "select":
@@ -146,7 +1270,7 @@ function generateOptionMarkup(setting) {
146
1270
  case "links":
147
1271
  return generateOptionMarkupForLink(setting);
148
1272
  case "text":
149
- return generateOptionMarkupForTextInput(setting);
1273
+ settingsNodes.push(text_default.createElement(setting));
150
1274
  }
151
1275
  return "";
152
1276
  }
@@ -154,15 +1278,20 @@ function isMock(userSettingsOrMock) {
154
1278
  return "responses" in userSettingsOrMock || "defaultResponse" in userSettingsOrMock;
155
1279
  }
156
1280
  function getFirstCookie(matcher) {
157
- const entries = Object.entries(matcher.request.cookies);
1281
+ const entries = Object.entries(matcher.request.cookies ?? {});
158
1282
  const [key, value] = entries[0];
159
1283
  return { key, value };
160
1284
  }
161
1285
  function entryFromMock(mock) {
1286
+ if (!mock.responses || mock.responses.length === 0) {
1287
+ throw new Error(
1288
+ "Mock must have at least one response to generate entry from."
1289
+ );
1290
+ }
162
1291
  const { key } = getFirstCookie(mock.responses[0]);
163
- const title = mock.meta.title ?? key;
1292
+ const title = mock.meta?.title ?? key;
164
1293
  const defaultEntry = {
165
- title: mock.defaultResponse?.label ?? "Default",
1294
+ title: evaluateMock(mock.defaultResponse).label ?? "Default",
166
1295
  value: "default"
167
1296
  };
168
1297
  return {
@@ -174,7 +1303,7 @@ function entryFromMock(mock) {
174
1303
  ...mock.responses.map((entry) => {
175
1304
  const { value } = getFirstCookie(entry);
176
1305
  return {
177
- title: entry.response.label ?? value,
1306
+ title: evaluateMock(entry.response).label ?? value,
178
1307
  value
179
1308
  };
180
1309
  })
@@ -185,6 +1314,13 @@ var defaultSetting = {
185
1314
  type: "select"
186
1315
  };
187
1316
  var menu_default = (userSettingsAndMocks) => {
1317
+ document.head.insertAdjacentHTML("beforeend", `<style>${style_default}</style>`);
1318
+ document.body.insertAdjacentHTML(
1319
+ "beforeend",
1320
+ `
1321
+ ${text_default.template}
1322
+ `
1323
+ );
188
1324
  let settingsMarkup = "";
189
1325
  userSettingsAndMocks.map(
190
1326
  (userSettingOrMock) => isMock(userSettingOrMock) ? entryFromMock(userSettingOrMock) : userSettingOrMock
@@ -192,7 +1328,6 @@ var menu_default = (userSettingsAndMocks) => {
192
1328
  const setting = { ...defaultSetting, ...userSetting };
193
1329
  settingsMarkup = settingsMarkup + generateOptionMarkup(setting);
194
1330
  });
195
- document.head.insertAdjacentHTML("beforeend", `<style>${style_default}</style>`);
196
1331
  document.body.insertAdjacentHTML(
197
1332
  "beforeend",
198
1333
  `
@@ -208,6 +1343,12 @@ var menu_default = (userSettingsAndMocks) => {
208
1343
  </div>
209
1344
  </div>`
210
1345
  );
1346
+ const menu = document.querySelector(".menu");
1347
+ if (menu) {
1348
+ for (const node of settingsNodes) {
1349
+ menu.append(node);
1350
+ }
1351
+ }
211
1352
  const script = document.createElement("script");
212
1353
  script.innerText = client_default;
213
1354
  document.body.appendChild(script);