@knapsack/core 4.70.0--canary.4821.ef34743.0 → 4.70.0--canary.4821.82d27e9.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -1,1936 +1,58 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
- var __esm = (fn, res) => function __init() {
9
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
- };
11
- var __commonJS = (cb, mod) => function __require() {
12
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
- };
14
- var __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27
- // If the importer is in node compatibility mode or this is not an ESM
28
- // file that has been converted to a CommonJS file using a Babel-
29
- // compatible transform (i.e. "__esModule" has not been set), then set
30
- // "default" to the CommonJS "module.exports" for node compatibility.
31
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
32
- mod
33
- ));
34
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
-
36
- // ../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.43.8_@types+node@20.16.6__@swc+core@1.3.57_@swc+helpers_iqa4vqpgdlzwuubzthdmdz7nfe/node_modules/tsup/assets/cjs_shims.js
37
- var init_cjs_shims = __esm({
38
- "../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.43.8_@types+node@20.16.6__@swc+core@1.3.57_@swc+helpers_iqa4vqpgdlzwuubzthdmdz7nfe/node_modules/tsup/assets/cjs_shims.js"() {
39
- }
40
- });
41
-
42
- // ../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js
43
- var require_color_name = __commonJS({
44
- "../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"(exports2, module2) {
45
- "use strict";
46
- init_cjs_shims();
47
- module2.exports = {
48
- "aliceblue": [240, 248, 255],
49
- "antiquewhite": [250, 235, 215],
50
- "aqua": [0, 255, 255],
51
- "aquamarine": [127, 255, 212],
52
- "azure": [240, 255, 255],
53
- "beige": [245, 245, 220],
54
- "bisque": [255, 228, 196],
55
- "black": [0, 0, 0],
56
- "blanchedalmond": [255, 235, 205],
57
- "blue": [0, 0, 255],
58
- "blueviolet": [138, 43, 226],
59
- "brown": [165, 42, 42],
60
- "burlywood": [222, 184, 135],
61
- "cadetblue": [95, 158, 160],
62
- "chartreuse": [127, 255, 0],
63
- "chocolate": [210, 105, 30],
64
- "coral": [255, 127, 80],
65
- "cornflowerblue": [100, 149, 237],
66
- "cornsilk": [255, 248, 220],
67
- "crimson": [220, 20, 60],
68
- "cyan": [0, 255, 255],
69
- "darkblue": [0, 0, 139],
70
- "darkcyan": [0, 139, 139],
71
- "darkgoldenrod": [184, 134, 11],
72
- "darkgray": [169, 169, 169],
73
- "darkgreen": [0, 100, 0],
74
- "darkgrey": [169, 169, 169],
75
- "darkkhaki": [189, 183, 107],
76
- "darkmagenta": [139, 0, 139],
77
- "darkolivegreen": [85, 107, 47],
78
- "darkorange": [255, 140, 0],
79
- "darkorchid": [153, 50, 204],
80
- "darkred": [139, 0, 0],
81
- "darksalmon": [233, 150, 122],
82
- "darkseagreen": [143, 188, 143],
83
- "darkslateblue": [72, 61, 139],
84
- "darkslategray": [47, 79, 79],
85
- "darkslategrey": [47, 79, 79],
86
- "darkturquoise": [0, 206, 209],
87
- "darkviolet": [148, 0, 211],
88
- "deeppink": [255, 20, 147],
89
- "deepskyblue": [0, 191, 255],
90
- "dimgray": [105, 105, 105],
91
- "dimgrey": [105, 105, 105],
92
- "dodgerblue": [30, 144, 255],
93
- "firebrick": [178, 34, 34],
94
- "floralwhite": [255, 250, 240],
95
- "forestgreen": [34, 139, 34],
96
- "fuchsia": [255, 0, 255],
97
- "gainsboro": [220, 220, 220],
98
- "ghostwhite": [248, 248, 255],
99
- "gold": [255, 215, 0],
100
- "goldenrod": [218, 165, 32],
101
- "gray": [128, 128, 128],
102
- "green": [0, 128, 0],
103
- "greenyellow": [173, 255, 47],
104
- "grey": [128, 128, 128],
105
- "honeydew": [240, 255, 240],
106
- "hotpink": [255, 105, 180],
107
- "indianred": [205, 92, 92],
108
- "indigo": [75, 0, 130],
109
- "ivory": [255, 255, 240],
110
- "khaki": [240, 230, 140],
111
- "lavender": [230, 230, 250],
112
- "lavenderblush": [255, 240, 245],
113
- "lawngreen": [124, 252, 0],
114
- "lemonchiffon": [255, 250, 205],
115
- "lightblue": [173, 216, 230],
116
- "lightcoral": [240, 128, 128],
117
- "lightcyan": [224, 255, 255],
118
- "lightgoldenrodyellow": [250, 250, 210],
119
- "lightgray": [211, 211, 211],
120
- "lightgreen": [144, 238, 144],
121
- "lightgrey": [211, 211, 211],
122
- "lightpink": [255, 182, 193],
123
- "lightsalmon": [255, 160, 122],
124
- "lightseagreen": [32, 178, 170],
125
- "lightskyblue": [135, 206, 250],
126
- "lightslategray": [119, 136, 153],
127
- "lightslategrey": [119, 136, 153],
128
- "lightsteelblue": [176, 196, 222],
129
- "lightyellow": [255, 255, 224],
130
- "lime": [0, 255, 0],
131
- "limegreen": [50, 205, 50],
132
- "linen": [250, 240, 230],
133
- "magenta": [255, 0, 255],
134
- "maroon": [128, 0, 0],
135
- "mediumaquamarine": [102, 205, 170],
136
- "mediumblue": [0, 0, 205],
137
- "mediumorchid": [186, 85, 211],
138
- "mediumpurple": [147, 112, 219],
139
- "mediumseagreen": [60, 179, 113],
140
- "mediumslateblue": [123, 104, 238],
141
- "mediumspringgreen": [0, 250, 154],
142
- "mediumturquoise": [72, 209, 204],
143
- "mediumvioletred": [199, 21, 133],
144
- "midnightblue": [25, 25, 112],
145
- "mintcream": [245, 255, 250],
146
- "mistyrose": [255, 228, 225],
147
- "moccasin": [255, 228, 181],
148
- "navajowhite": [255, 222, 173],
149
- "navy": [0, 0, 128],
150
- "oldlace": [253, 245, 230],
151
- "olive": [128, 128, 0],
152
- "olivedrab": [107, 142, 35],
153
- "orange": [255, 165, 0],
154
- "orangered": [255, 69, 0],
155
- "orchid": [218, 112, 214],
156
- "palegoldenrod": [238, 232, 170],
157
- "palegreen": [152, 251, 152],
158
- "paleturquoise": [175, 238, 238],
159
- "palevioletred": [219, 112, 147],
160
- "papayawhip": [255, 239, 213],
161
- "peachpuff": [255, 218, 185],
162
- "peru": [205, 133, 63],
163
- "pink": [255, 192, 203],
164
- "plum": [221, 160, 221],
165
- "powderblue": [176, 224, 230],
166
- "purple": [128, 0, 128],
167
- "rebeccapurple": [102, 51, 153],
168
- "red": [255, 0, 0],
169
- "rosybrown": [188, 143, 143],
170
- "royalblue": [65, 105, 225],
171
- "saddlebrown": [139, 69, 19],
172
- "salmon": [250, 128, 114],
173
- "sandybrown": [244, 164, 96],
174
- "seagreen": [46, 139, 87],
175
- "seashell": [255, 245, 238],
176
- "sienna": [160, 82, 45],
177
- "silver": [192, 192, 192],
178
- "skyblue": [135, 206, 235],
179
- "slateblue": [106, 90, 205],
180
- "slategray": [112, 128, 144],
181
- "slategrey": [112, 128, 144],
182
- "snow": [255, 250, 250],
183
- "springgreen": [0, 255, 127],
184
- "steelblue": [70, 130, 180],
185
- "tan": [210, 180, 140],
186
- "teal": [0, 128, 128],
187
- "thistle": [216, 191, 216],
188
- "tomato": [255, 99, 71],
189
- "turquoise": [64, 224, 208],
190
- "violet": [238, 130, 238],
191
- "wheat": [245, 222, 179],
192
- "white": [255, 255, 255],
193
- "whitesmoke": [245, 245, 245],
194
- "yellow": [255, 255, 0],
195
- "yellowgreen": [154, 205, 50]
196
- };
197
- }
198
- });
199
-
200
- // ../../node_modules/.pnpm/is-arrayish@0.3.2/node_modules/is-arrayish/index.js
201
- var require_is_arrayish = __commonJS({
202
- "../../node_modules/.pnpm/is-arrayish@0.3.2/node_modules/is-arrayish/index.js"(exports2, module2) {
203
- init_cjs_shims();
204
- module2.exports = /* @__PURE__ */ __name(function isArrayish(obj) {
205
- if (!obj || typeof obj === "string") {
206
- return false;
207
- }
208
- return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && (obj.splice instanceof Function || Object.getOwnPropertyDescriptor(obj, obj.length - 1) && obj.constructor.name !== "String");
209
- }, "isArrayish");
210
- }
211
- });
212
-
213
- // ../../node_modules/.pnpm/simple-swizzle@0.2.2/node_modules/simple-swizzle/index.js
214
- var require_simple_swizzle = __commonJS({
215
- "../../node_modules/.pnpm/simple-swizzle@0.2.2/node_modules/simple-swizzle/index.js"(exports2, module2) {
216
- "use strict";
217
- init_cjs_shims();
218
- var isArrayish = require_is_arrayish();
219
- var concat = Array.prototype.concat;
220
- var slice = Array.prototype.slice;
221
- var swizzle = module2.exports = /* @__PURE__ */ __name(function swizzle2(args) {
222
- var results = [];
223
- for (var i = 0, len = args.length; i < len; i++) {
224
- var arg = args[i];
225
- if (isArrayish(arg)) {
226
- results = concat.call(results, slice.call(arg));
227
- } else {
228
- results.push(arg);
229
- }
230
- }
231
- return results;
232
- }, "swizzle");
233
- swizzle.wrap = function(fn) {
234
- return function() {
235
- return fn(swizzle(arguments));
236
- };
237
- };
238
- }
239
- });
240
-
241
- // ../../node_modules/.pnpm/color-string@1.9.1/node_modules/color-string/index.js
242
- var require_color_string = __commonJS({
243
- "../../node_modules/.pnpm/color-string@1.9.1/node_modules/color-string/index.js"(exports2, module2) {
244
- init_cjs_shims();
245
- var colorNames = require_color_name();
246
- var swizzle = require_simple_swizzle();
247
- var hasOwnProperty = Object.hasOwnProperty;
248
- var reverseNames = /* @__PURE__ */ Object.create(null);
249
- for (name in colorNames) {
250
- if (hasOwnProperty.call(colorNames, name)) {
251
- reverseNames[colorNames[name]] = name;
252
- }
253
- }
254
- var name;
255
- var cs = module2.exports = {
256
- to: {},
257
- get: {}
258
- };
259
- cs.get = function(string8) {
260
- var prefix = string8.substring(0, 3).toLowerCase();
261
- var val;
262
- var model;
263
- switch (prefix) {
264
- case "hsl":
265
- val = cs.get.hsl(string8);
266
- model = "hsl";
267
- break;
268
- case "hwb":
269
- val = cs.get.hwb(string8);
270
- model = "hwb";
271
- break;
272
- default:
273
- val = cs.get.rgb(string8);
274
- model = "rgb";
275
- break;
276
- }
277
- if (!val) {
278
- return null;
279
- }
280
- return { model, value: val };
281
- };
282
- cs.get.rgb = function(string8) {
283
- if (!string8) {
284
- return null;
285
- }
286
- var abbr = /^#([a-f0-9]{3,4})$/i;
287
- var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
288
- var rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
289
- var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
290
- var keyword = /^(\w+)$/;
291
- var rgb = [0, 0, 0, 1];
292
- var match;
293
- var i;
294
- var hexAlpha;
295
- if (match = string8.match(hex)) {
296
- hexAlpha = match[2];
297
- match = match[1];
298
- for (i = 0; i < 3; i++) {
299
- var i2 = i * 2;
300
- rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
301
- }
302
- if (hexAlpha) {
303
- rgb[3] = parseInt(hexAlpha, 16) / 255;
304
- }
305
- } else if (match = string8.match(abbr)) {
306
- match = match[1];
307
- hexAlpha = match[3];
308
- for (i = 0; i < 3; i++) {
309
- rgb[i] = parseInt(match[i] + match[i], 16);
310
- }
311
- if (hexAlpha) {
312
- rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
313
- }
314
- } else if (match = string8.match(rgba)) {
315
- for (i = 0; i < 3; i++) {
316
- rgb[i] = parseInt(match[i + 1], 0);
317
- }
318
- if (match[4]) {
319
- if (match[5]) {
320
- rgb[3] = parseFloat(match[4]) * 0.01;
321
- } else {
322
- rgb[3] = parseFloat(match[4]);
323
- }
324
- }
325
- } else if (match = string8.match(per)) {
326
- for (i = 0; i < 3; i++) {
327
- rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
328
- }
329
- if (match[4]) {
330
- if (match[5]) {
331
- rgb[3] = parseFloat(match[4]) * 0.01;
332
- } else {
333
- rgb[3] = parseFloat(match[4]);
334
- }
335
- }
336
- } else if (match = string8.match(keyword)) {
337
- if (match[1] === "transparent") {
338
- return [0, 0, 0, 0];
339
- }
340
- if (!hasOwnProperty.call(colorNames, match[1])) {
341
- return null;
342
- }
343
- rgb = colorNames[match[1]];
344
- rgb[3] = 1;
345
- return rgb;
346
- } else {
347
- return null;
348
- }
349
- for (i = 0; i < 3; i++) {
350
- rgb[i] = clamp(rgb[i], 0, 255);
351
- }
352
- rgb[3] = clamp(rgb[3], 0, 1);
353
- return rgb;
354
- };
355
- cs.get.hsl = function(string8) {
356
- if (!string8) {
357
- return null;
358
- }
359
- var hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
360
- var match = string8.match(hsl);
361
- if (match) {
362
- var alpha = parseFloat(match[4]);
363
- var h = (parseFloat(match[1]) % 360 + 360) % 360;
364
- var s4 = clamp(parseFloat(match[2]), 0, 100);
365
- var l = clamp(parseFloat(match[3]), 0, 100);
366
- var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
367
- return [h, s4, l, a];
368
- }
369
- return null;
370
- };
371
- cs.get.hwb = function(string8) {
372
- if (!string8) {
373
- return null;
374
- }
375
- var hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
376
- var match = string8.match(hwb);
377
- if (match) {
378
- var alpha = parseFloat(match[4]);
379
- var h = (parseFloat(match[1]) % 360 + 360) % 360;
380
- var w = clamp(parseFloat(match[2]), 0, 100);
381
- var b = clamp(parseFloat(match[3]), 0, 100);
382
- var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
383
- return [h, w, b, a];
384
- }
385
- return null;
386
- };
387
- cs.to.hex = function() {
388
- var rgba = swizzle(arguments);
389
- return "#" + hexDouble(rgba[0]) + hexDouble(rgba[1]) + hexDouble(rgba[2]) + (rgba[3] < 1 ? hexDouble(Math.round(rgba[3] * 255)) : "");
390
- };
391
- cs.to.rgb = function() {
392
- var rgba = swizzle(arguments);
393
- return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ")" : "rgba(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ", " + rgba[3] + ")";
394
- };
395
- cs.to.rgb.percent = function() {
396
- var rgba = swizzle(arguments);
397
- var r = Math.round(rgba[0] / 255 * 100);
398
- var g = Math.round(rgba[1] / 255 * 100);
399
- var b = Math.round(rgba[2] / 255 * 100);
400
- return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + r + "%, " + g + "%, " + b + "%)" : "rgba(" + r + "%, " + g + "%, " + b + "%, " + rgba[3] + ")";
401
- };
402
- cs.to.hsl = function() {
403
- var hsla = swizzle(arguments);
404
- return hsla.length < 4 || hsla[3] === 1 ? "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)" : "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, " + hsla[3] + ")";
405
- };
406
- cs.to.hwb = function() {
407
- var hwba = swizzle(arguments);
408
- var a = "";
409
- if (hwba.length >= 4 && hwba[3] !== 1) {
410
- a = ", " + hwba[3];
411
- }
412
- return "hwb(" + hwba[0] + ", " + hwba[1] + "%, " + hwba[2] + "%" + a + ")";
413
- };
414
- cs.to.keyword = function(rgb) {
415
- return reverseNames[rgb.slice(0, 3)];
416
- };
417
- function clamp(num, min, max) {
418
- return Math.min(Math.max(min, num), max);
419
- }
420
- __name(clamp, "clamp");
421
- function hexDouble(num) {
422
- var str = Math.round(num).toString(16).toUpperCase();
423
- return str.length < 2 ? "0" + str : str;
424
- }
425
- __name(hexDouble, "hexDouble");
426
- }
427
- });
428
-
429
- // src/index.ts
430
- var src_exports = {};
431
- __export(src_exports, {
432
- HASURA_CLAIMS_NAMESPACE: () => HASURA_CLAIMS_NAMESPACE,
433
- HasuraClaimsStruct: () => HasuraClaimsStruct,
434
- HasuraRoles: () => HasuraRoles,
435
- JwtBaseStruct: () => JwtBaseStruct,
436
- JwtCustomClaimsStruct: () => JwtCustomClaimsStruct,
437
- JwtWithCustomClaimsStruct: () => JwtWithCustomClaimsStruct,
438
- KNAPSACK_CLAIMS_NAMESPACE: () => KNAPSACK_CLAIMS_NAMESPACE,
439
- KsClaimsStruct: () => KsClaimsStruct,
440
- RolesEnums: () => RolesEnums,
441
- RolesEnumsStruct: () => RolesEnumsStruct,
442
- canRoleAdmin: () => canRoleAdmin,
443
- canRoleDelete: () => canRoleDelete,
444
- canRoleEdit: () => canRoleEdit,
445
- canRoleManageUsers: () => canRoleManageUsers,
446
- canRolePublish: () => canRolePublish,
447
- canRoleView: () => canRoleView,
448
- defaultAnonymousKsClaims: () => defaultAnonymousKsClaims,
449
- expandSitesByRole: () => expandSitesByRole,
450
- getKsClaims: () => getKsClaims,
451
- gitHubOauthInternalEndpoint: () => gitHubOauthInternalEndpoint,
452
- isRoleValid: () => isRoleValid,
453
- ksHttpHeaders: () => ksHttpHeaders,
454
- ksUrls: () => ksUrls,
455
- rolesThatCanDelete: () => rolesThatCanDelete,
456
- rolesThatCanEdit: () => rolesThatCanEdit,
457
- rolesThatCanManageUsers: () => rolesThatCanManageUsers,
458
- rolesThatCanPublish: () => rolesThatCanPublish,
459
- rolesThatCanView: () => rolesThatCanView,
460
- siteDeployedWebhookEndpoint: () => siteDeployedWebhookEndpoint
461
- });
462
- module.exports = __toCommonJS(src_exports);
463
- init_cjs_shims();
464
-
465
- // src/users.ts
466
- init_cjs_shims();
467
- var import_superstruct7 = require("superstruct");
468
-
469
- // ../types/dist/index.mjs
470
- init_cjs_shims();
471
- var import_superstruct = require("superstruct");
472
- var import_color_string = __toESM(require_color_string(), 1);
473
- var import_superstruct2 = require("superstruct");
474
- var import_superstruct3 = require("superstruct");
475
- var import_superstruct4 = require("superstruct");
476
- var import_superstruct5 = require("superstruct");
477
- var import_utils = require("@knapsack/utils");
478
- var import_utils2 = require("@knapsack/utils");
479
- var s2 = __toESM(require("superstruct"), 1);
480
- var s = __toESM(require("superstruct"), 1);
481
- var import_utils3 = require("@knapsack/utils");
482
- var import_utils4 = require("@knapsack/utils");
483
- var import_utils5 = require("@knapsack/utils");
484
- var import_superstruct6 = require("superstruct");
485
- var s3 = __toESM(require("superstruct"), 1);
486
- var __defProp2 = Object.defineProperty;
487
- var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name", { value, configurable: true }), "__name");
488
- var __export2 = /* @__PURE__ */ __name((target, all) => {
489
- for (var name in all)
490
- __defProp2(target, name, { get: all[name], enumerable: true });
491
- }, "__export");
492
- function isColor(color) {
493
- if (typeof color !== "string") return false;
494
- try {
495
- return !!import_color_string.default.get(color);
496
- } catch (e) {
497
- return false;
498
- }
499
- }
500
- __name(isColor, "isColor");
501
- __name2(isColor, "isColor");
502
- var ColorStringStruct = (0, import_superstruct2.define)(
503
- "ColorStringStruct",
504
- (value) => typeof value === "string" && isColor(value)
505
- );
506
- var ColorConfigStruct = (0, import_superstruct2.union)([
507
- (0, import_superstruct2.type)({
508
- type: (0, import_superstruct2.literal)("value"),
509
- colorValue: ColorStringStruct
510
- }),
511
- (0, import_superstruct2.type)({
512
- type: (0, import_superstruct2.literal)("design-token"),
513
- tokenName: (0, import_superstruct2.string)()
514
- })
515
- ]);
516
- var ColorTokenConfigStruct = (0, import_superstruct2.type)({
517
- type: (0, import_superstruct2.literal)("design-token"),
518
- tokenName: (0, import_superstruct2.string)()
519
- });
520
- var FontSizeConfigValStruct = (0, import_superstruct3.object)({
521
- unit: (0, import_superstruct3.enums)(["rem", "px"]),
522
- value: (0, import_superstruct3.number)()
523
- });
524
- var FontFaceWeightStruct = (0, import_superstruct3.union)([
525
- (0, import_superstruct3.string)(),
526
- (0, import_superstruct3.number)()
527
- ]);
528
- var FontFaceFormatsEnumStruct = (0, import_superstruct3.enums)(["woff2", "woff"]);
529
- var FontFaceSourceStruct = (0, import_superstruct3.type)({
530
- format: FontFaceFormatsEnumStruct,
531
- type: (0, import_superstruct3.literal)("url"),
532
- path: (0, import_superstruct3.string)()
533
- });
534
- var FontFaceConfigStruct = (0, import_superstruct3.type)({
535
- family: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
536
- weight: (0, import_superstruct3.optional)(
537
- (0, import_superstruct3.union)([FontFaceWeightStruct, (0, import_superstruct3.size)((0, import_superstruct3.array)(FontFaceWeightStruct), 2)])
538
- ),
539
- src: (0, import_superstruct3.optional)((0, import_superstruct3.array)(FontFaceSourceStruct)),
540
- style: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
541
- display: (0, import_superstruct3.optional)((0, import_superstruct3.enums)(["auto", "block", "swap", "fallback", "optional"])),
542
- variationSettings: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
543
- unicodeRange: (0, import_superstruct3.optional)((0, import_superstruct3.string)())
544
- });
545
- var TypographyLinkConfigStruct = (0, import_superstruct3.type)({
546
- fontWeight: (0, import_superstruct3.optional)((0, import_superstruct3.union)([(0, import_superstruct3.string)(), (0, import_superstruct3.number)()])),
547
- textColor: (0, import_superstruct3.optional)(ColorConfigStruct),
548
- hoverColor: (0, import_superstruct3.optional)(ColorConfigStruct),
549
- underline: (0, import_superstruct3.optional)((0, import_superstruct3.boolean)()),
550
- textTransform: (0, import_superstruct3.optional)(
551
- (0, import_superstruct3.enums)(["inherit", "capitalize", "lowercase", "uppercase"])
552
- ),
553
- fontStretch: (0, import_superstruct3.optional)(
554
- (0, import_superstruct3.enums)([
555
- "ultra-condensed",
556
- "extra-condensed",
557
- "condensed",
558
- "semi-condensed",
559
- "normal",
560
- "semi-expanded",
561
- "expanded",
562
- "extra-expanded",
563
- "ultra-expanded"
564
- ])
565
- )
566
- });
567
- var FontSizeConfigStruct = (0, import_superstruct3.type)({
568
- min: FontSizeConfigValStruct,
569
- max: (0, import_superstruct3.optional)(FontSizeConfigValStruct)
570
- });
571
- var TypographyConfigStruct = (0, import_superstruct3.type)({
572
- fontSize: (0, import_superstruct3.optional)(FontSizeConfigStruct),
573
- lineHeight: (0, import_superstruct3.optional)((0, import_superstruct3.union)([(0, import_superstruct3.string)(), (0, import_superstruct3.number)()])),
574
- fontWeight: (0, import_superstruct3.optional)((0, import_superstruct3.union)([(0, import_superstruct3.string)(), (0, import_superstruct3.number)()])),
575
- letterSpacing: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
576
- fontFamily: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
577
- textColor: (0, import_superstruct3.optional)(ColorConfigStruct),
578
- textTransform: (0, import_superstruct3.optional)(
579
- (0, import_superstruct3.enums)(["inherit", "capitalize", "lowercase", "uppercase"])
580
- ),
581
- fontStretch: (0, import_superstruct3.optional)(
582
- (0, import_superstruct3.enums)([
583
- "ultra-condensed",
584
- "extra-condensed",
585
- "condensed",
586
- "semi-condensed",
587
- "normal",
588
- "semi-expanded",
589
- "expanded",
590
- "extra-expanded",
591
- "ultra-expanded"
592
- ])
593
- )
594
- });
595
- var NavCustomizationConfigStruct = (0, import_superstruct4.union)([
596
- TypographyConfigStruct,
597
- (0, import_superstruct4.type)({
598
- accentColor: (0, import_superstruct4.optional)(ColorConfigStruct)
599
- })
600
- ]);
601
- var PrimaryNavCustomizationConfigStruct = (0, import_superstruct4.union)([
602
- NavCustomizationConfigStruct,
603
- (0, import_superstruct4.type)({
604
- hoverColor: (0, import_superstruct4.optional)(ColorConfigStruct),
605
- backgroundColor: (0, import_superstruct4.optional)(ColorConfigStruct)
606
- })
607
- ]);
608
- var SecondaryNavCustomizationConfigStruct = (0, import_superstruct4.union)([
609
- NavCustomizationConfigStruct,
610
- (0, import_superstruct4.type)({
611
- backgroundColor: (0, import_superstruct4.optional)(ColorConfigStruct)
612
- })
613
- ]);
614
- var UiConfigV1Struct = (0, import_superstruct.object)({
615
- version: (0, import_superstruct.literal)(1),
616
- oldSillySidebarBgColor: ColorStringStruct
617
- });
618
- var UiConfigV2Struct = (0, import_superstruct.object)({
619
- version: (0, import_superstruct.literal)(2),
620
- anotherSillySidebarBgColor: ColorStringStruct
621
- });
622
- var UiConfigV3Struct = (0, import_superstruct.object)({
623
- version: (0, import_superstruct.literal)(3),
624
- sidebarBgColor: ColorStringStruct
625
- });
626
- var UiConfigV4Struct = (0, import_superstruct.object)({
627
- version: (0, import_superstruct.literal)(4),
628
- primaryColor: ColorConfigStruct,
629
- darkColor: ColorConfigStruct,
630
- lightColor: ColorConfigStruct,
631
- enableSidebarIcons: (0, import_superstruct.optional)((0, import_superstruct.defaulted)((0, import_superstruct.boolean)(), true))
632
- });
633
- var UiConfigV5Struct = (0, import_superstruct.object)({
634
- version: (0, import_superstruct.literal)(5),
635
- primaryColor: ColorConfigStruct,
636
- darkColor: ColorConfigStruct,
637
- lightColor: ColorConfigStruct,
638
- linkColor: ColorConfigStruct,
639
- enableSidebarIcons: (0, import_superstruct.optional)((0, import_superstruct.defaulted)((0, import_superstruct.boolean)(), true))
640
- });
641
- var UiConfigV6Struct = (0, import_superstruct.object)({
642
- version: (0, import_superstruct.literal)(6),
643
- primaryColor: ColorConfigStruct,
644
- darkColor: ColorConfigStruct,
645
- lightColor: ColorConfigStruct,
646
- linkColor: ColorConfigStruct,
647
- enableSidebarIcons: (0, import_superstruct.optional)((0, import_superstruct.defaulted)((0, import_superstruct.boolean)(), true)),
648
- appearance: (0, import_superstruct.type)({
649
- customFonts: (0, import_superstruct.optional)((0, import_superstruct.array)(FontFaceConfigStruct)),
650
- pageElements: (0, import_superstruct.type)({
651
- pageTitle: (0, import_superstruct.optional)(TypographyConfigStruct),
652
- pageDescription: (0, import_superstruct.optional)(TypographyConfigStruct),
653
- headingLarge: (0, import_superstruct.optional)(TypographyConfigStruct),
654
- headingMedium: (0, import_superstruct.optional)(TypographyConfigStruct),
655
- headingSmall: (0, import_superstruct.optional)(TypographyConfigStruct),
656
- bodyText: (0, import_superstruct.optional)(TypographyConfigStruct),
657
- link: (0, import_superstruct.optional)(TypographyLinkConfigStruct)
658
- })
659
- })
660
- });
661
- var UiConfigV7Struct = (0, import_superstruct.object)({
662
- version: (0, import_superstruct.literal)(7),
663
- primaryColor: ColorConfigStruct,
664
- darkColor: ColorConfigStruct,
665
- lightColor: ColorConfigStruct,
666
- linkColor: ColorConfigStruct,
667
- enableSidebarIcons: (0, import_superstruct.optional)((0, import_superstruct.defaulted)((0, import_superstruct.boolean)(), true)),
668
- appearance: (0, import_superstruct.type)({
669
- customFonts: (0, import_superstruct.optional)((0, import_superstruct.array)(FontFaceConfigStruct)),
670
- navigation: (0, import_superstruct.optional)(
671
- (0, import_superstruct.type)({
672
- primaryNav: (0, import_superstruct.optional)(PrimaryNavCustomizationConfigStruct),
673
- secondaryNav: (0, import_superstruct.optional)(SecondaryNavCustomizationConfigStruct),
674
- tabs: (0, import_superstruct.optional)(NavCustomizationConfigStruct)
675
- })
676
- ),
677
- pageElements: (0, import_superstruct.type)({
678
- pageTitle: (0, import_superstruct.optional)(TypographyConfigStruct),
679
- pageDescription: (0, import_superstruct.optional)(TypographyConfigStruct),
680
- headingLarge: (0, import_superstruct.optional)(TypographyConfigStruct),
681
- headingMedium: (0, import_superstruct.optional)(TypographyConfigStruct),
682
- headingSmall: (0, import_superstruct.optional)(TypographyConfigStruct),
683
- bodyText: (0, import_superstruct.optional)(TypographyConfigStruct),
684
- link: (0, import_superstruct.optional)(TypographyLinkConfigStruct)
685
- })
686
- })
687
- });
688
- var UiConfigV8Struct = (0, import_superstruct.object)({
689
- version: (0, import_superstruct.literal)(8),
690
- primaryColor: ColorConfigStruct,
691
- darkColor: ColorConfigStruct,
692
- lightColor: ColorConfigStruct,
693
- linkColor: ColorConfigStruct,
694
- appearance: (0, import_superstruct.type)({
695
- customFonts: (0, import_superstruct.optional)((0, import_superstruct.array)(FontFaceConfigStruct)),
696
- navigation: (0, import_superstruct.optional)(
697
- (0, import_superstruct.type)({
698
- primaryNav: (0, import_superstruct.optional)(PrimaryNavCustomizationConfigStruct),
699
- secondaryNav: (0, import_superstruct.optional)(SecondaryNavCustomizationConfigStruct),
700
- tabs: (0, import_superstruct.optional)(NavCustomizationConfigStruct)
701
- })
702
- ),
703
- pageElements: (0, import_superstruct.type)({
704
- pageTitle: (0, import_superstruct.optional)(TypographyConfigStruct),
705
- pageDescription: (0, import_superstruct.optional)(TypographyConfigStruct),
706
- headingLarge: (0, import_superstruct.optional)(TypographyConfigStruct),
707
- headingMedium: (0, import_superstruct.optional)(TypographyConfigStruct),
708
- headingSmall: (0, import_superstruct.optional)(TypographyConfigStruct),
709
- bodyText: (0, import_superstruct.optional)(TypographyConfigStruct),
710
- link: (0, import_superstruct.optional)(TypographyLinkConfigStruct)
711
- })
712
- })
713
- });
714
- var UiConfigV9Struct = (0, import_superstruct.object)({
715
- version: (0, import_superstruct.literal)(9),
716
- appearance: (0, import_superstruct.type)({
717
- customFonts: (0, import_superstruct.optional)((0, import_superstruct.array)(FontFaceConfigStruct)),
718
- navigation: (0, import_superstruct.optional)(
719
- (0, import_superstruct.type)({
720
- primaryNav: (0, import_superstruct.optional)(PrimaryNavCustomizationConfigStruct),
721
- secondaryNav: (0, import_superstruct.optional)(SecondaryNavCustomizationConfigStruct),
722
- tabs: (0, import_superstruct.optional)(NavCustomizationConfigStruct)
723
- })
724
- ),
725
- pageElements: (0, import_superstruct.type)({
726
- pageTitle: (0, import_superstruct.optional)(TypographyConfigStruct),
727
- pageDescription: (0, import_superstruct.optional)(TypographyConfigStruct),
728
- headingLarge: (0, import_superstruct.optional)(TypographyConfigStruct),
729
- headingMedium: (0, import_superstruct.optional)(TypographyConfigStruct),
730
- headingSmall: (0, import_superstruct.optional)(TypographyConfigStruct),
731
- bodyText: (0, import_superstruct.optional)(TypographyConfigStruct),
732
- link: (0, import_superstruct.optional)(TypographyLinkConfigStruct)
733
- })
734
- })
735
- });
736
- var UiConfigV10Struct = (0, import_superstruct.object)({
737
- version: (0, import_superstruct.literal)(10),
738
- appearance: (0, import_superstruct.type)({
739
- customFonts: (0, import_superstruct.optional)((0, import_superstruct.array)(FontFaceConfigStruct)),
740
- navigation: (0, import_superstruct.optional)(
741
- (0, import_superstruct.type)({
742
- primaryNav: (0, import_superstruct.optional)(PrimaryNavCustomizationConfigStruct),
743
- secondaryNav: (0, import_superstruct.optional)(SecondaryNavCustomizationConfigStruct),
744
- tabs: (0, import_superstruct.optional)(NavCustomizationConfigStruct)
745
- })
746
- ),
747
- pageElements: (0, import_superstruct.type)({
748
- pageTitle: (0, import_superstruct.optional)(TypographyConfigStruct),
749
- pageDescription: (0, import_superstruct.optional)(TypographyConfigStruct),
750
- headingXLarge: (0, import_superstruct.optional)(TypographyConfigStruct),
751
- headingLarge: (0, import_superstruct.optional)(TypographyConfigStruct),
752
- headingMedium: (0, import_superstruct.optional)(TypographyConfigStruct),
753
- headingSmall: (0, import_superstruct.optional)(TypographyConfigStruct),
754
- headingXSmall: (0, import_superstruct.optional)(TypographyConfigStruct),
755
- bodyText: (0, import_superstruct.optional)(TypographyConfigStruct),
756
- link: (0, import_superstruct.optional)(TypographyLinkConfigStruct)
757
- })
758
- })
759
- });
760
- function isTokenReference(val) {
761
- if (typeof val !== "string") return false;
762
- const totalOpenBrackets = val.split("{").length - 1;
763
- return totalOpenBrackets === 1 && val.startsWith("{") && val.endsWith("}");
764
- }
765
- __name(isTokenReference, "isTokenReference");
766
- __name2(isTokenReference, "isTokenReference");
767
- function hasTokenReferences(val) {
768
- return typeof val === "string" && val.includes("{");
769
- }
770
- __name(hasTokenReferences, "hasTokenReferences");
771
- __name2(hasTokenReferences, "hasTokenReferences");
772
- function isNotTokenReference(value) {
773
- return !isTokenReference(value);
774
- }
775
- __name(isNotTokenReference, "isNotTokenReference");
776
- __name2(isNotTokenReference, "isNotTokenReference");
777
- var TokenReferenceStruct = s.define(
778
- "Token Reference",
779
- (value) => {
780
- if (typeof value !== "string") return false;
781
- if (isNotTokenReference(value)) {
782
- return "Must start and end with curly braces";
783
- }
784
- return true;
785
- }
786
- );
787
- var compositeTypesRecord = {
788
- border: "border",
789
- shadow: "shadow",
790
- transition: "transition"
791
- };
792
- var tokenTypeComposites = Object.values(compositeTypesRecord);
793
- var singularTypesRecord = {
794
- string: "string",
795
- number: "number",
796
- boolean: "boolean",
797
- color: "color",
798
- dimension: "dimension",
799
- duration: "duration",
800
- // fontFamily: 'fontFamily',
801
- fontWeight: "fontWeight",
802
- strokeStyle: "strokeStyle",
803
- cubicBezier: "cubicBezier"
804
- };
805
- var tokenTypeSingulars = Object.values(singularTypesRecord);
806
- function isTokenTypeComposite(type92) {
807
- return tokenTypeComposites.includes(type92);
808
- }
809
- __name(isTokenTypeComposite, "isTokenTypeComposite");
810
- __name2(isTokenTypeComposite, "isTokenTypeComposite");
811
- function isTokenTypeSingular(type92) {
812
- return tokenTypeSingulars.includes(type92);
813
- }
814
- __name(isTokenTypeSingular, "isTokenTypeSingular");
815
- __name2(isTokenTypeSingular, "isTokenTypeSingular");
816
- (0, import_utils2.expectType)([
817
- {
818
- inset: false,
819
- color: "#000",
820
- offsetX: "0px",
821
- offsetY: "0px",
822
- spread: "0px",
823
- blur: "0px"
824
- },
825
- {
826
- color: "#000",
827
- offsetX: "0px",
828
- offsetY: "0px",
829
- spread: "0px",
830
- blur: "0px",
831
- inset: true
832
- }
833
- ]);
834
- var TokenDataBaseStruct = s2.type({
835
- id: s2.string(),
836
- description: s2.optional(s2.string()),
837
- references: s2.optional(s2.array(s2.array(s2.string()))),
838
- tokenConfig: s2.optional(
839
- s2.type({
840
- purpose: s2.optional(s2.string())
841
- })
842
- )
843
- });
844
- (0, import_utils2.expectType)([
845
- {
846
- type: "duration",
847
- value: "1ms",
848
- originalValue: "1ms",
849
- id: "1",
850
- kind: "static"
851
- },
852
- {
853
- type: "duration",
854
- value: "1ms",
855
- kind: "ref",
856
- id: "1",
857
- originalValue: "{a.b}",
858
- referencedTokenId: "1"
859
- },
860
- // @ts-expect-error - kind is wrong
861
- {
862
- type: "duration",
863
- value: "1ms",
864
- originalValue: "1ms",
865
- id: "1",
866
- kind: "ref"
867
- },
868
- // @ts-expect-error - kind is wrong
869
- {
870
- type: "duration",
871
- value: "1ms",
872
- kind: "static",
873
- id: "1",
874
- originalValue: "{a.b}",
875
- referencedTokenId: "1"
876
- },
877
- {
878
- type: "color",
879
- value: "#000",
880
- kind: "static",
881
- id: "1",
882
- originalValue: "#000"
883
- },
884
- {
885
- type: "color",
886
- value: "#000",
887
- kind: "ref",
888
- id: "1",
889
- originalValue: "{c.b}",
890
- referencedTokenId: "c.b"
891
- },
892
- {
893
- type: "cubicBezier",
894
- kind: "static",
895
- value: [0, 0, 0, 1],
896
- originalValue: [0, 0, 0, 1],
897
- id: "1"
898
- }
899
- ]);
900
- function isTokenDataComposite(tokenData) {
901
- return isTokenTypeComposite(tokenData.type);
902
- }
903
- __name(isTokenDataComposite, "isTokenDataComposite");
904
- __name2(isTokenDataComposite, "isTokenDataComposite");
905
- (0, import_utils2.expectType)([
906
- {
907
- type: "border",
908
- kind: "static",
909
- id: "1",
910
- value: {
911
- color: "#000",
912
- style: "solid",
913
- width: "1px"
914
- },
915
- originalValue: {
916
- color: "#000",
917
- style: "solid",
918
- width: "1px"
919
- }
920
- },
921
- {
922
- type: "border",
923
- kind: "ref",
924
- referencedTokenId: "a.b",
925
- id: "1",
926
- value: {
927
- color: "red",
928
- style: "dashed",
929
- width: "2px"
930
- },
931
- originalValue: "{a.b}"
932
- },
933
- {
934
- type: "shadow",
935
- value: {
936
- color: "#000",
937
- offsetX: "1px",
938
- offsetY: "1px",
939
- blur: "1px",
940
- spread: "1px",
941
- inset: false
942
- },
943
- originalValue: {
944
- color: "#000",
945
- offsetX: "{a.a}",
946
- offsetY: "1px",
947
- blur: "1px",
948
- spread: "1px",
949
- inset: false
950
- },
951
- id: "1",
952
- kind: "static"
953
- },
954
- {
955
- type: "shadow",
956
- kind: "ref",
957
- referencedTokenId: "a.b",
958
- value: {
959
- inset: true,
960
- color: "red",
961
- offsetX: "1px",
962
- blur: "2px",
963
- offsetY: "3px",
964
- spread: "4px"
965
- },
966
- originalValue: "{a.b}",
967
- id: "1"
968
- },
969
- {
970
- type: "transition",
971
- value: {
972
- duration: "100ms",
973
- delay: "200ms",
974
- timingFunction: [0, 0, 0, 0]
975
- },
976
- originalValue: "{a.b}",
977
- kind: "ref",
978
- referencedTokenId: "a.b",
979
- id: "1"
980
- },
981
- {
982
- type: "transition",
983
- kind: "static",
984
- value: {
985
- duration: "100ms",
986
- delay: "200ms",
987
- timingFunction: [0, 0, 0, 0]
988
- },
989
- originalValue: {
990
- duration: "100ms",
991
- delay: "{a.c}",
992
- timingFunction: "{a.c}"
993
- },
994
- id: "1"
995
- },
996
- {
997
- type: "transition",
998
- kind: "static",
999
- value: {
1000
- duration: "100ms",
1001
- delay: "200ms",
1002
- timingFunction: [0, 0, 0, 0]
1003
- },
1004
- originalValue: {
1005
- duration: "100ms",
1006
- delay: "200ms",
1007
- timingFunction: [0, 0, 0, 0]
1008
- },
1009
- id: "1"
1010
- }
1011
- ]);
1012
- function isTokenValueColor(value) {
1013
- return typeof value === "string" && !hasTokenReferences(value);
1014
- }
1015
- __name(isTokenValueColor, "isTokenValueColor");
1016
- __name2(isTokenValueColor, "isTokenValueColor");
1017
- var TokenValueColorStruct = s2.define(
1018
- "Color Value",
1019
- (value) => {
1020
- if (typeof value !== "string") {
1021
- return "Value must be a string";
1022
- }
1023
- if (value === "") {
1024
- return "Value must not be empty";
1025
- }
1026
- if (hasTokenReferences(value)) {
1027
- return "Value must not contain {} (token references)";
1028
- }
1029
- return true;
1030
- }
1031
- );
1032
- var TokenDataColorNonRefStruct = s2.assign(
1033
- s2.type({
1034
- type: s2.literal("color"),
1035
- value: TokenValueColorStruct,
1036
- kind: s2.literal("static"),
1037
- originalValue: TokenValueColorStruct
1038
- }),
1039
- TokenDataBaseStruct
1040
- );
1041
- var TokenDataColorRefStruct = s2.assign(
1042
- s2.type({
1043
- type: s2.literal("color"),
1044
- value: TokenValueColorStruct,
1045
- kind: s2.literal("ref"),
1046
- originalValue: TokenReferenceStruct,
1047
- referencedTokenId: s2.string()
1048
- }),
1049
- TokenDataBaseStruct
1050
- );
1051
- function isTokenValueDimension(value) {
1052
- return typeof value === "string" && (value.endsWith("px") || value.endsWith("rem")) && !hasTokenReferences(value);
1053
- }
1054
- __name(isTokenValueDimension, "isTokenValueDimension");
1055
- __name2(isTokenValueDimension, "isTokenValueDimension");
1056
- var TokenValueDimensionStruct = s2.define("Dimension Value", (value) => {
1057
- if (typeof value !== "string") {
1058
- return "Value must be a string";
1059
- }
1060
- if (hasTokenReferences(value)) {
1061
- return "Value must not contain {} (token references)";
1062
- }
1063
- if (!value.endsWith("px") && !value.endsWith("rem") && !value.endsWith("em") && !value.endsWith("%")) {
1064
- return "Value must end with px, rem, em or %";
1065
- }
1066
- return true;
1067
- });
1068
- var TokenDataDimensionNonRefStruct = s2.assign(
1069
- s2.type({
1070
- type: s2.literal("dimension"),
1071
- value: TokenValueDimensionStruct,
1072
- kind: s2.literal("static"),
1073
- originalValue: TokenValueDimensionStruct
1074
- }),
1075
- TokenDataBaseStruct
1076
- );
1077
- var TokenDataDimensionRefStruct = s2.assign(
1078
- s2.type({
1079
- type: s2.literal("dimension"),
1080
- value: TokenValueDimensionStruct,
1081
- kind: s2.literal("ref"),
1082
- originalValue: TokenReferenceStruct,
1083
- referencedTokenId: s2.string()
1084
- }),
1085
- TokenDataBaseStruct
1086
- );
1087
- function isTokenValueDuration(value) {
1088
- return typeof value === "string" && value.endsWith("ms") && !hasTokenReferences(value);
1089
- }
1090
- __name(isTokenValueDuration, "isTokenValueDuration");
1091
- __name2(isTokenValueDuration, "isTokenValueDuration");
1092
- var TokenValueDurationStruct = s2.define("Duration Value", (value) => {
1093
- if (typeof value !== "string") {
1094
- return "Value must be a string";
1095
- }
1096
- if (hasTokenReferences(value)) {
1097
- return "Value must not contain {} (token references)";
1098
- }
1099
- const durationRegex = /^\d+ms$/;
1100
- if (!durationRegex.test(value)) {
1101
- return 'Value must be a number followed by "ms" (e.g., "100ms")';
1102
- }
1103
- return true;
1104
- });
1105
- var TokenDataDurationNonRefStruct = s2.assign(
1106
- s2.type({
1107
- type: s2.literal("duration"),
1108
- value: TokenValueDurationStruct,
1109
- kind: s2.literal("static"),
1110
- originalValue: TokenValueDurationStruct
1111
- }),
1112
- TokenDataBaseStruct
1113
- );
1114
- var TokenDataDurationRefStruct = s2.assign(
1115
- s2.type({
1116
- type: s2.literal("duration"),
1117
- value: TokenValueDurationStruct,
1118
- kind: s2.literal("ref"),
1119
- originalValue: TokenReferenceStruct,
1120
- referencedTokenId: s2.string()
1121
- }),
1122
- TokenDataBaseStruct
1123
- );
1124
- function isTokenValueFontWeight(value) {
1125
- return (typeof value === "string" || typeof value === "number") && !hasTokenReferences(value);
1126
- }
1127
- __name(isTokenValueFontWeight, "isTokenValueFontWeight");
1128
- __name2(isTokenValueFontWeight, "isTokenValueFontWeight");
1129
- var TokenValueFontWeightStruct = s2.define("Font Weight Value", (value) => {
1130
- if (typeof value !== "string" && typeof value !== "number") {
1131
- return "Value must be a string or number";
1132
- }
1133
- if (hasTokenReferences(value)) {
1134
- return "Value must not contain {} (token references)";
1135
- }
1136
- return true;
1137
- });
1138
- var TokenDataFontWeightNonRefStruct = s2.assign(
1139
- s2.type({
1140
- type: s2.literal("fontWeight"),
1141
- value: TokenValueFontWeightStruct,
1142
- kind: s2.literal("static"),
1143
- originalValue: TokenValueFontWeightStruct
1144
- }),
1145
- TokenDataBaseStruct
1146
- );
1147
- var TokenDataFontWeightRefStruct = s2.assign(
1148
- s2.type({
1149
- type: s2.literal("fontWeight"),
1150
- value: TokenValueFontWeightStruct,
1151
- kind: s2.literal("ref"),
1152
- originalValue: TokenReferenceStruct,
1153
- referencedTokenId: s2.string()
1154
- }),
1155
- TokenDataBaseStruct
1156
- );
1157
- var TokenValueCubicBezierStruct = s2.define("Cubic Bezier Value", (value) => {
1158
- if (!Array.isArray(value)) {
1159
- return "Value must be an array";
1160
- }
1161
- if (value.length !== 4) {
1162
- return "Value must be an array of 4 numbers";
1163
- }
1164
- if (!value.every((v) => typeof v === "number")) {
1165
- return "Value must be an array of 4 numbers";
1166
- }
1167
- if (value[0] < 0 || value[0] > 1 || value[2] < 0 || value[2] > 1) {
1168
- return "The first and third cubicBezier values must be between 0 and 1";
1169
- }
1170
- return true;
1171
- });
1172
- var TokenDataCubicBezierNonRefStruct = s2.assign(
1173
- s2.type({
1174
- type: s2.literal("cubicBezier"),
1175
- value: TokenValueCubicBezierStruct,
1176
- kind: s2.literal("static"),
1177
- originalValue: TokenValueCubicBezierStruct
1178
- }),
1179
- TokenDataBaseStruct
1180
- );
1181
- var TokenDataCubicBezierRefStruct = s2.assign(
1182
- s2.type({
1183
- type: s2.literal("cubicBezier"),
1184
- value: TokenValueCubicBezierStruct,
1185
- kind: s2.literal("ref"),
1186
- originalValue: TokenReferenceStruct,
1187
- referencedTokenId: s2.string()
1188
- }),
1189
- TokenDataBaseStruct
1190
- );
1191
- function isTokenValueShadow(value) {
1192
- return (0, import_utils2.isObject)(value) && isTokenValueColor(value.color) && isTokenValueDimension(value.offsetX) && isTokenValueDimension(value.offsetY) && isTokenValueDimension(value.blur) && isTokenValueDimension(value.spread);
1193
- }
1194
- __name(isTokenValueShadow, "isTokenValueShadow");
1195
- __name2(isTokenValueShadow, "isTokenValueShadow");
1196
- var TokenValueShadowStruct = s2.define(
1197
- "Shadow Value",
1198
- (value) => {
1199
- if (isTokenValueShadow(value)) return true;
1200
- return `Expected a shadow value, got ${JSON.stringify(value)}`;
1201
- }
1202
- );
1203
- var TokenDataShadowNonRefStruct = s2.assign(
1204
- s2.type({
1205
- type: s2.literal("shadow"),
1206
- value: TokenValueShadowStruct,
1207
- kind: s2.literal("static"),
1208
- originalValue: s2.type({
1209
- color: s2.union([TokenValueColorStruct, TokenReferenceStruct]),
1210
- offsetX: s2.union([TokenValueDimensionStruct, TokenReferenceStruct]),
1211
- offsetY: s2.union([TokenValueDimensionStruct, TokenReferenceStruct]),
1212
- blur: s2.union([TokenValueDimensionStruct, TokenReferenceStruct]),
1213
- spread: s2.union([TokenValueDimensionStruct, TokenReferenceStruct]),
1214
- inset: s2.union([
1215
- // marking this as optional b/c it could be `undefined` instead of `false`
1216
- s2.optional(s2.boolean()),
1217
- TokenReferenceStruct
1218
- ])
1219
- })
1220
- }),
1221
- TokenDataBaseStruct
1222
- );
1223
- var TokenDataShadowRefStruct = s2.assign(
1224
- s2.type({
1225
- type: s2.literal("shadow"),
1226
- value: TokenValueShadowStruct,
1227
- kind: s2.literal("ref"),
1228
- originalValue: TokenReferenceStruct,
1229
- referencedTokenId: s2.string()
1230
- }),
1231
- TokenDataBaseStruct
1232
- );
1233
- var TokenValueStrokeStyleStruct = s2.union([
1234
- s2.literal("solid"),
1235
- s2.literal("dashed"),
1236
- s2.literal("dotted"),
1237
- s2.literal("double"),
1238
- s2.literal("groove"),
1239
- s2.literal("ridge"),
1240
- s2.literal("outset"),
1241
- s2.literal("inset")
1242
- ]);
1243
- function isTokenValueBorder(value) {
1244
- return (0, import_utils2.isObject)(value) && TokenValueColorStruct.is(value.color) && TokenValueStrokeStyleStruct.is(value.style) && TokenValueDimensionStruct.is(value.width);
1245
- }
1246
- __name(isTokenValueBorder, "isTokenValueBorder");
1247
- __name2(isTokenValueBorder, "isTokenValueBorder");
1248
- var TokenValueBorderStruct = s2.define(
1249
- "Border Value",
1250
- isTokenValueBorder
1251
- );
1252
- var TokenDataBorderNonRefStruct = s2.assign(
1253
- s2.type({
1254
- type: s2.literal("border"),
1255
- value: TokenValueBorderStruct,
1256
- kind: s2.literal("static"),
1257
- originalValue: s2.type({
1258
- color: s2.union([TokenValueColorStruct, TokenReferenceStruct]),
1259
- style: s2.union([TokenValueStrokeStyleStruct, TokenReferenceStruct]),
1260
- width: s2.union([TokenValueDimensionStruct, TokenReferenceStruct])
1261
- })
1262
- }),
1263
- TokenDataBaseStruct
1264
- );
1265
- var TokenDataBorderRefStruct = s2.assign(
1266
- s2.type({
1267
- type: s2.literal("border"),
1268
- value: TokenValueBorderStruct,
1269
- kind: s2.literal("ref"),
1270
- originalValue: TokenReferenceStruct,
1271
- referencedTokenId: s2.string()
1272
- }),
1273
- TokenDataBaseStruct
1274
- );
1275
- function isTokenValueTransition(value) {
1276
- return (0, import_utils2.isObject)(value) && TokenValueCubicBezierStruct.is(value.timingFunction) && TokenValueDurationStruct.is(value.duration) && TokenValueDurationStruct.is(value.delay);
1277
- }
1278
- __name(isTokenValueTransition, "isTokenValueTransition");
1279
- __name2(isTokenValueTransition, "isTokenValueTransition");
1280
- var TokenValueTransitionStruct = s2.define(
1281
- "Transition Value",
1282
- isTokenValueTransition
1283
- );
1284
- var TokenDataTransitionNonRefStruct = s2.assign(
1285
- s2.type({
1286
- type: s2.literal("transition"),
1287
- value: TokenValueTransitionStruct,
1288
- kind: s2.literal("static"),
1289
- originalValue: s2.type({
1290
- timingFunction: s2.union([
1291
- TokenValueCubicBezierStruct,
1292
- TokenReferenceStruct
1293
- ]),
1294
- duration: s2.union([TokenValueDurationStruct, TokenReferenceStruct]),
1295
- delay: s2.union([TokenValueDurationStruct, TokenReferenceStruct])
1296
- })
1297
- }),
1298
- TokenDataBaseStruct
1299
- );
1300
- var TokenDataTransitionRefStruct = s2.assign(
1301
- s2.type({
1302
- type: s2.literal("transition"),
1303
- value: TokenValueTransitionStruct,
1304
- kind: s2.literal("ref"),
1305
- originalValue: TokenReferenceStruct,
1306
- referencedTokenId: s2.string()
1307
- }),
1308
- TokenDataBaseStruct
1309
- );
1310
- var TokenDataStringNonRefStruct = s2.assign(
1311
- s2.type({
1312
- type: s2.literal("string"),
1313
- value: s2.string(),
1314
- kind: s2.literal("static"),
1315
- originalValue: s2.string()
1316
- }),
1317
- TokenDataBaseStruct
1318
- );
1319
- var TokenDataStringRefStruct = s2.assign(
1320
- s2.type({
1321
- type: s2.literal("string"),
1322
- value: s2.string(),
1323
- kind: s2.literal("ref"),
1324
- originalValue: TokenReferenceStruct,
1325
- referencedTokenId: s2.string()
1326
- }),
1327
- TokenDataBaseStruct
1328
- );
1329
- var TokenDataStrokeStyleNonRefStruct = s2.assign(
1330
- s2.type({
1331
- type: s2.literal("strokeStyle"),
1332
- value: TokenValueStrokeStyleStruct,
1333
- kind: s2.literal("static"),
1334
- originalValue: TokenValueStrokeStyleStruct
1335
- }),
1336
- TokenDataBaseStruct
1337
- );
1338
- var TokenDataStrokeStyleRefStruct = s2.assign(
1339
- s2.type({
1340
- type: s2.literal("strokeStyle"),
1341
- value: TokenValueStrokeStyleStruct,
1342
- kind: s2.literal("ref"),
1343
- originalValue: TokenReferenceStruct,
1344
- referencedTokenId: TokenValueStrokeStyleStruct
1345
- }),
1346
- TokenDataBaseStruct
1347
- );
1348
- var TokenDataNumberNonRefStruct = s2.assign(
1349
- s2.type({
1350
- type: s2.literal("number"),
1351
- value: s2.number(),
1352
- kind: s2.literal("static"),
1353
- originalValue: s2.number()
1354
- }),
1355
- TokenDataBaseStruct
1356
- );
1357
- var TokenDataNumberRefStruct = s2.assign(
1358
- s2.type({
1359
- type: s2.literal("number"),
1360
- value: s2.number(),
1361
- kind: s2.literal("ref"),
1362
- originalValue: TokenReferenceStruct,
1363
- referencedTokenId: s2.string()
1364
- }),
1365
- TokenDataBaseStruct
1366
- );
1367
- var TokenDataBooleanNonRefStruct = s2.assign(
1368
- s2.type({
1369
- type: s2.literal("boolean"),
1370
- value: s2.boolean(),
1371
- kind: s2.literal("static"),
1372
- originalValue: s2.boolean()
1373
- }),
1374
- TokenDataBaseStruct
1375
- );
1376
- var TokenDataBooleanRefStruct = s2.assign(
1377
- s2.type({
1378
- type: s2.literal("boolean"),
1379
- value: s2.boolean(),
1380
- kind: s2.literal("ref"),
1381
- originalValue: TokenReferenceStruct,
1382
- referencedTokenId: s2.string()
1383
- }),
1384
- TokenDataBaseStruct
1385
- );
1386
- (0, import_utils3.expectType)([
1387
- {
1388
- type: "dimension",
1389
- kind: "static",
1390
- value: "1px"
1391
- },
1392
- {
1393
- type: "dimension",
1394
- kind: "ref",
1395
- referencedTokenId: "a.b"
1396
- }
1397
- ]);
1398
- (0, import_utils3.expectType)([
1399
- {
1400
- type: "border",
1401
- kind: "ref",
1402
- referencedTokenId: "a.b"
1403
- },
1404
- {
1405
- type: "border",
1406
- kind: "static",
1407
- value: {
1408
- color: {
1409
- kind: "static",
1410
- type: "color",
1411
- value: "red"
1412
- },
1413
- style: {
1414
- kind: "ref",
1415
- type: "strokeStyle",
1416
- referencedTokenId: ""
1417
- // FIX
1418
- },
1419
- width: {
1420
- kind: "static",
1421
- type: "dimension",
1422
- value: "2px"
1423
- }
1424
- }
1425
- }
1426
- ]);
1427
- (0, import_utils3.expectType)([
1428
- {
1429
- type: "transition",
1430
- kind: "ref",
1431
- referencedTokenId: "a.b"
1432
- },
1433
- {
1434
- type: "transition",
1435
- kind: "static",
1436
- value: {
1437
- delay: {
1438
- kind: "static",
1439
- type: "duration",
1440
- value: "1ms"
1441
- },
1442
- duration: {
1443
- kind: "ref",
1444
- type: "duration",
1445
- referencedTokenId: "animation.slow"
1446
- },
1447
- timingFunction: {
1448
- kind: "static",
1449
- type: "cubicBezier",
1450
- value: [0.4, 0, 0.2, 1]
1451
- }
1452
- }
1453
- }
1454
- ]);
1455
- function isTokenSrcValueInfoSingular(tokenSrcValueInfo) {
1456
- return isTokenTypeSingular(tokenSrcValueInfo?.type);
1457
- }
1458
- __name(isTokenSrcValueInfoSingular, "isTokenSrcValueInfoSingular");
1459
- __name2(isTokenSrcValueInfoSingular, "isTokenSrcValueInfoSingular");
1460
- function isTokenSrcValueInfoComposite(tokenSrcValueInfo) {
1461
- return isTokenTypeComposite(tokenSrcValueInfo?.type);
1462
- }
1463
- __name(isTokenSrcValueInfoComposite, "isTokenSrcValueInfoComposite");
1464
- __name2(isTokenSrcValueInfoComposite, "isTokenSrcValueInfoComposite");
1465
- (0, import_utils3.expectType)([
1466
- {
1467
- type: "dimension",
1468
- kind: "static",
1469
- value: "1px"
1470
- },
1471
- {
1472
- type: "transition",
1473
- kind: "ref",
1474
- referencedTokenId: "a.b"
1475
- },
1476
- {
1477
- type: "transition",
1478
- kind: "ref",
1479
- // @ts-expect-error - with `kind: 'ref'`, `value` is not allowed
1480
- value: "1px"
1481
- },
1482
- {
1483
- kind: "ref",
1484
- type: "duration",
1485
- referencedTokenId: "animation.slow"
1486
- },
1487
- {
1488
- kind: "static",
1489
- type: "cubicBezier",
1490
- value: [0.4, 0, 0.2, 1]
1491
- },
1492
- {
1493
- type: "transition",
1494
- kind: "static",
1495
- value: {
1496
- delay: {
1497
- kind: "static",
1498
- type: "duration",
1499
- value: "1ms"
1500
- },
1501
- duration: {
1502
- kind: "ref",
1503
- type: "duration",
1504
- referencedTokenId: "animation.slow"
1505
- },
1506
- timingFunction: {
1507
- kind: "static",
1508
- type: "cubicBezier",
1509
- value: [0.4, 0, 0.2, 1]
1510
- }
1511
- }
1512
- }
1513
- ]);
1514
- function isTokenSrcExtensions(extensionsObj) {
1515
- return (0, import_utils4.isObject)(extensionsObj) && (0, import_utils4.isObjKey)("cloud.knapsack", extensionsObj);
1516
- }
1517
- __name(isTokenSrcExtensions, "isTokenSrcExtensions");
1518
- __name2(isTokenSrcExtensions, "isTokenSrcExtensions");
1519
- (0, import_utils4.expectType)([
1520
- "#ddd",
1521
- true,
1522
- [83, 1, 1, 1],
1523
- {
1524
- color: "#000",
1525
- style: "solid",
1526
- width: "1px"
1527
- },
1528
- {
1529
- inset: true,
1530
- color: "#000",
1531
- offsetX: "0px",
1532
- offsetY: "{spacing.medium}",
1533
- spread: "0px",
1534
- blur: "0px"
1535
- },
1536
- {
1537
- timingFunction: "{timing.ease}",
1538
- duration: "{timing.duration.medium}",
1539
- delay: "7ms",
1540
- color: "#000"
1541
- }
1542
- ]);
1543
- function isTokenSrc(tokenObject) {
1544
- if ((0, import_utils4.isObject)(tokenObject) && (0, import_utils4.isObjKey)("$value", tokenObject)) return true;
1545
- return false;
1546
- }
1547
- __name(isTokenSrc, "isTokenSrc");
1548
- __name2(isTokenSrc, "isTokenSrc");
1549
- function isTokenGroup(tokenObject) {
1550
- return (0, import_utils4.isObject)(tokenObject) && !isTokenSrcExtensions(tokenObject) && !(0, import_utils4.isObjKey)("$value", tokenObject) && // ensuring we are not in `$extensions` object
1551
- !(0, import_utils4.isObjKey)("cloud.knapsack", tokenObject);
1552
- }
1553
- __name(isTokenGroup, "isTokenGroup");
1554
- __name2(isTokenGroup, "isTokenGroup");
1555
- function isTokenTypeVarRef(tokenObject) {
1556
- if (isTokenGroup(tokenObject)) {
1557
- const varRefCollectionInfo = tokenObject.$extensions["cloud.knapsack"].group.collectionInfo;
1558
- if ((0, import_utils4.isObjKey)("type", varRefCollectionInfo) && (0, import_utils4.isObjKey)("referenceId", varRefCollectionInfo)) {
1559
- return true;
1560
- }
1561
- }
1562
- return false;
1563
- }
1564
- __name(isTokenTypeVarRef, "isTokenTypeVarRef");
1565
- __name2(isTokenTypeVarRef, "isTokenTypeVarRef");
1566
- function getPrimitiveValue(tokenValue) {
1567
- const type92 = typeof tokenValue;
1568
- if (type92 === "string" || type92 === "number" || type92 === "boolean") {
1569
- return type92;
1570
- }
1571
- throw new Error(
1572
- `Invalid token value type: ${JSON.stringify(
1573
- type92
1574
- )}. Token value is: ${JSON.stringify(tokenValue)}`
1575
- );
1576
- }
1577
- __name(getPrimitiveValue, "getPrimitiveValue");
1578
- __name2(getPrimitiveValue, "getPrimitiveValue");
1579
- function parseTokenDimensionValue(valueToParse) {
1580
- const { value, unit } = (0, import_utils5.parseNumberWithUnit)(valueToParse);
1581
- if (!unit) {
1582
- return { value };
1583
- }
1584
- if (unit !== "px" && unit !== "rem" && unit !== "em" && unit !== "%") {
1585
- throw new Error(`Invalid unit "${unit}" for value: ${value}`);
1586
- }
1587
- return { value, unit };
1588
- }
1589
- __name(parseTokenDimensionValue, "parseTokenDimensionValue");
1590
- __name2(parseTokenDimensionValue, "parseTokenDimensionValue");
1591
- function isSlottedTemplateDemo(slottedData) {
1592
- return (0, import_utils.isObject)(slottedData) && slottedData.type === "template-demo";
1593
- }
1594
- __name(isSlottedTemplateDemo, "isSlottedTemplateDemo");
1595
- __name2(isSlottedTemplateDemo, "isSlottedTemplateDemo");
1596
- function isSlottedTemplateReference(slottedData) {
1597
- return (0, import_utils.isObject)(slottedData) && slottedData.type === "template-reference";
1598
- }
1599
- __name(isSlottedTemplateReference, "isSlottedTemplateReference");
1600
- __name2(isSlottedTemplateReference, "isSlottedTemplateReference");
1601
- function isDataDemo(demo) {
1602
- return demo?.type === "data";
1603
- }
1604
- __name(isDataDemo, "isDataDemo");
1605
- __name2(isDataDemo, "isDataDemo");
1606
- function isTemplateDemo(demo) {
1607
- return demo?.type === "template";
1608
- }
1609
- __name(isTemplateDemo, "isTemplateDemo");
1610
- __name2(isTemplateDemo, "isTemplateDemo");
1611
- function isKsAppClientDataNoMeta(data) {
1612
- if (!(0, import_utils.isObject)(data)) return false;
1613
- const requiredKeys = [
1614
- "assetSetsState",
1615
- "customPagesState",
1616
- "navsState",
1617
- "patternsState",
1618
- "tokensSrc",
1619
- "db"
1620
- ];
1621
- if (!requiredKeys.every((key) => (0, import_utils.isObjKey)(key, data))) return false;
1622
- if (!(0, import_utils.isObjKey)("metaState", data)) return true;
1623
- return false;
1624
- }
1625
- __name(isKsAppClientDataNoMeta, "isKsAppClientDataNoMeta");
1626
- __name2(isKsAppClientDataNoMeta, "isKsAppClientDataNoMeta");
1627
- var KsAppClientDataNoMetaStruct = (0, import_superstruct5.define)(
1628
- "KsAppClientDataNoMeta",
1629
- isKsAppClientDataNoMeta
1630
- );
1631
- function isKsAppClientDataAndMeta(data) {
1632
- if (!(0, import_utils.isObject)(data)) return false;
1633
- const requiredKeys = [
1634
- "assetSetsState",
1635
- "customPagesState",
1636
- "navsState",
1637
- "patternsState",
1638
- "tokensSrc",
1639
- "metaState",
1640
- "db"
1641
- ];
1642
- return requiredKeys.every((key) => (0, import_utils.isObjKey)(key, data));
1643
- }
1644
- __name(isKsAppClientDataAndMeta, "isKsAppClientDataAndMeta");
1645
- __name2(isKsAppClientDataAndMeta, "isKsAppClientDataAndMeta");
1646
- var KsAppClientDataAndMetaStruct = (0, import_superstruct5.define)(
1647
- "KsAppClientDataAndMeta",
1648
- isKsAppClientDataAndMeta
1649
- );
1650
- var KsMetaStateStruct = (0, import_superstruct5.type)({
1651
- isLocalDev: (0, import_superstruct5.boolean)(),
1652
- plugins: (0, import_superstruct5.array)(
1653
- (0, import_superstruct5.type)({
1654
- id: (0, import_superstruct5.string)(),
1655
- hasContent: (0, import_superstruct5.boolean)(),
1656
- clientPluginPath: (0, import_superstruct5.optional)((0, import_superstruct5.string)()),
1657
- cssPath: (0, import_superstruct5.optional)((0, import_superstruct5.string)())
1658
- })
1659
- ),
1660
- meta: (0, import_superstruct5.optional)(
1661
- (0, import_superstruct5.type)({
1662
- version: (0, import_superstruct5.optional)((0, import_superstruct5.string)()),
1663
- hasKnapsackCloud: (0, import_superstruct5.boolean)(),
1664
- knapsackCloudSiteId: (0, import_superstruct5.optional)((0, import_superstruct5.string)()),
1665
- serverPort: (0, import_superstruct5.optional)((0, import_superstruct5.number)()),
1666
- websocketsPort: (0, import_superstruct5.optional)((0, import_superstruct5.number)()),
1667
- https: (0, import_superstruct5.optional)((0, import_superstruct5.boolean)()),
1668
- cacheDir: (0, import_superstruct5.optional)((0, import_superstruct5.string)()),
1669
- ksVersions: (0, import_superstruct5.type)({
1670
- app: (0, import_superstruct5.string)()
1671
- })
1672
- })
1673
- )
1674
- });
1675
- var isKsMetaState = KsMetaStateStruct.is;
1676
- function isKsAppClientDataNoMetaV3(data) {
1677
- if (!(0, import_utils.isObject)(data)) return false;
1678
- const requiredKeys = [
1679
- "assetSetsState",
1680
- "customPagesState",
1681
- "navsState",
1682
- "patternsState",
1683
- "settingsState",
1684
- "tokensState"
1685
- ];
1686
- if (!requiredKeys.every((key) => (0, import_utils.isObjKey)(key, data))) return false;
1687
- if (!(0, import_utils.isObjKey)("metaState", data)) return true;
1688
- return false;
1689
- }
1690
- __name(isKsAppClientDataNoMetaV3, "isKsAppClientDataNoMetaV3");
1691
- __name2(isKsAppClientDataNoMetaV3, "isKsAppClientDataNoMetaV3");
1692
- var KsAppClientDataNoMetaStructV3 = (0, import_superstruct6.define)(
1693
- "KsAppClientDataNoMeta",
1694
- isKsAppClientDataNoMetaV3
1695
- );
1696
- function isKsAppClientDataAndMetaV3(data) {
1697
- if (!(0, import_utils.isObject)(data)) return false;
1698
- const requiredKeys = [
1699
- "assetSetsState",
1700
- "customPagesState",
1701
- "navsState",
1702
- "patternsState",
1703
- "settingsState",
1704
- "tokensState",
1705
- "metaState"
1706
- ];
1707
- return requiredKeys.every((key) => (0, import_utils.isObjKey)(key, data));
1708
- }
1709
- __name(isKsAppClientDataAndMetaV3, "isKsAppClientDataAndMetaV3");
1710
- __name2(isKsAppClientDataAndMetaV3, "isKsAppClientDataAndMetaV3");
1711
- var KsAppClientDataAndMetaStructV3 = (0, import_superstruct6.define)(
1712
- "KsAppClientDataAndMeta",
1713
- isKsAppClientDataAndMetaV3
1714
- );
1715
- var KsMetaStateStructV3 = (0, import_superstruct6.type)({
1716
- isLocalDev: (0, import_superstruct6.boolean)(),
1717
- plugins: (0, import_superstruct6.array)(
1718
- (0, import_superstruct6.type)({
1719
- id: (0, import_superstruct6.string)(),
1720
- hasContent: (0, import_superstruct6.boolean)(),
1721
- clientPluginPath: (0, import_superstruct6.optional)((0, import_superstruct6.string)()),
1722
- cssPath: (0, import_superstruct6.optional)((0, import_superstruct6.string)())
1723
- })
1724
- ),
1725
- meta: (0, import_superstruct6.optional)(
1726
- (0, import_superstruct6.type)({
1727
- version: (0, import_superstruct6.optional)((0, import_superstruct6.string)()),
1728
- hasKnapsackCloud: (0, import_superstruct6.boolean)(),
1729
- knapsackCloudSiteId: (0, import_superstruct6.optional)((0, import_superstruct6.string)()),
1730
- serverPort: (0, import_superstruct6.optional)((0, import_superstruct6.number)()),
1731
- websocketsPort: (0, import_superstruct6.optional)((0, import_superstruct6.number)()),
1732
- https: (0, import_superstruct6.optional)((0, import_superstruct6.boolean)()),
1733
- cacheDir: (0, import_superstruct6.optional)((0, import_superstruct6.string)()),
1734
- ksVersions: (0, import_superstruct6.type)({
1735
- app: (0, import_superstruct6.string)()
1736
- })
1737
- })
1738
- )
1739
- });
1740
- var isKsMetaStateV3 = KsMetaStateStructV3.is;
1741
- var PatchStructRuntime = s3.object({
1742
- op: s3.union([s3.literal("replace"), s3.literal("remove"), s3.literal("add")]),
1743
- path: s3.array(s3.union([s3.string(), s3.number()])),
1744
- value: s3.optional(s3.any())
1745
- });
1746
- var PatchesStructRuntime = s3.array(PatchStructRuntime);
1747
- var KsRemoteChangeRuntime = s3.type({
1748
- patches: PatchesStructRuntime,
1749
- inversePatches: s3.optional(PatchesStructRuntime),
1750
- event: s3.optional(s3.object({ type: s3.string() })),
1751
- id: s3.string(),
1752
- date: s3.string(),
1753
- userId: s3.optional(s3.string())
1754
- });
1755
- var KsRemoteChangesStructRuntime = s3.array(KsRemoteChangeRuntime);
1756
- var plugins_exports = {};
1757
- __export2(plugins_exports, {
1758
- ACTIONS: /* @__PURE__ */ __name(() => ACTIONS, "ACTIONS"),
1759
- endpoint: /* @__PURE__ */ __name(() => endpoint, "endpoint")
1760
- });
1761
- var endpoint = `/plugins`;
1762
- var ACTIONS = /* @__PURE__ */ ((ACTIONS3) => {
1763
- ACTIONS3["getContent"] = "getContent";
1764
- return ACTIONS3;
1765
- })(ACTIONS || {});
1766
- var files_exports = {};
1767
- __export2(files_exports, {
1768
- ACTIONS: /* @__PURE__ */ __name(() => ACTIONS2, "ACTIONS"),
1769
- endpoint: /* @__PURE__ */ __name(() => endpoint2, "endpoint")
1770
- });
1771
- var endpoint2 = `/files`;
1772
- var ACTIONS2 = /* @__PURE__ */ ((ACTIONS3) => {
1773
- ACTIONS3["verify"] = "verify";
1774
- return ACTIONS3;
1775
- })(ACTIONS2 || {});
1776
- var rolesById = {
1777
- ADMIN: "ADMIN",
1778
- ANONYMOUS: "ANONYMOUS",
1779
- CONTRIBUTOR: "CONTRIBUTOR",
1780
- EDITOR: "EDITOR",
1781
- MANAGER: "MANAGER",
1782
- VIEWER: "VIEWER"
1783
- };
1784
- var roles = Object.values(rolesById);
1785
-
1786
- // src/users.ts
1787
- var RolesEnums = (0, import_superstruct7.enums)(roles);
1788
- var RolesEnumsStruct = RolesEnums;
1789
- var canRoleAdmin = /* @__PURE__ */ __name((role) => role === "ADMIN", "canRoleAdmin");
1790
- var rolesThatCanManageUsers = ["ADMIN", "MANAGER"];
1791
- var canRoleManageUsers = /* @__PURE__ */ __name((role) => rolesThatCanManageUsers.includes(role), "canRoleManageUsers");
1792
- var rolesThatCanDelete = [
1793
- ...rolesThatCanManageUsers,
1794
- "EDITOR"
1795
- ];
1796
- var canRoleDelete = /* @__PURE__ */ __name((role) => rolesThatCanDelete.includes(role), "canRoleDelete");
1797
- var rolesThatCanEdit = [...rolesThatCanDelete, "CONTRIBUTOR"];
1798
- var canRoleEdit = /* @__PURE__ */ __name((role) => rolesThatCanEdit.includes(role), "canRoleEdit");
1799
- var rolesThatCanPublish = ["ADMIN"];
1800
- var canRolePublish = /* @__PURE__ */ __name((role) => rolesThatCanPublish.includes(role), "canRolePublish");
1801
- var rolesThatCanView = [...rolesThatCanEdit, "VIEWER"];
1802
- var canRoleView = /* @__PURE__ */ __name((role) => rolesThatCanView.includes(role), "canRoleView");
1803
- var isRoleValid = /* @__PURE__ */ __name((role) => RolesEnumsStruct.is(role), "isRoleValid");
1804
- var HasuraRoles = /* @__PURE__ */ ((HasuraRoles2) => {
1805
- HasuraRoles2["user"] = "user";
1806
- HasuraRoles2["anonymous"] = "anonymous";
1807
- return HasuraRoles2;
1808
- })(HasuraRoles || {});
1809
- var HasuraRolesStruct = (0, import_superstruct7.enums)(Object.values(HasuraRoles));
1810
- var HasuraClaimsStruct = (0, import_superstruct7.object)({
1811
- "x-hasura-allowed-roles": (0, import_superstruct7.array)(HasuraRolesStruct),
1812
- "x-hasura-default-role": HasuraRolesStruct,
1813
- "x-hasura-user-id": (0, import_superstruct7.optional)((0, import_superstruct7.string)())
1814
- });
1815
- var KsClaimsStruct = (0, import_superstruct7.object)({
1816
- userId: (0, import_superstruct7.string)(),
1817
- isSuperAdmin: (0, import_superstruct7.boolean)(),
1818
- sitesByRole: (0, import_superstruct7.record)(RolesEnums, (0, import_superstruct7.array)((0, import_superstruct7.string)()))
1819
- });
1820
- var JwtBaseStruct = (0, import_superstruct7.type)({
1821
- exp: (0, import_superstruct7.number)(),
1822
- email: (0, import_superstruct7.optional)((0, import_superstruct7.string)()),
1823
- email_verified: (0, import_superstruct7.optional)((0, import_superstruct7.union)([(0, import_superstruct7.string)(), (0, import_superstruct7.boolean)()])),
1824
- iat: (0, import_superstruct7.number)(),
1825
- iss: (0, import_superstruct7.string)(),
1826
- sub: (0, import_superstruct7.string)(),
1827
- aud: (0, import_superstruct7.union)([(0, import_superstruct7.string)(), (0, import_superstruct7.array)((0, import_superstruct7.string)())])
1828
- });
1829
- var HASURA_CLAIMS_NAMESPACE = "https://hasura.io/jwt/claims";
1830
- var KNAPSACK_CLAIMS_NAMESPACE = "https://knapsack.cloud";
1831
- var JwtCustomClaimsStruct = (0, import_superstruct7.object)({
1832
- [HASURA_CLAIMS_NAMESPACE]: HasuraClaimsStruct,
1833
- [KNAPSACK_CLAIMS_NAMESPACE]: KsClaimsStruct
1834
- });
1835
- var JwtWithCustomClaimsStruct = (0, import_superstruct7.assign)(
1836
- JwtBaseStruct,
1837
- JwtCustomClaimsStruct
1838
- );
1839
- function expandSitesByRole(sitesByRole) {
1840
- return Object.entries(sitesByRole).reduce((cur, [roleId, siteIds]) => {
1841
- if (!isRoleValid(roleId)) return cur;
1842
- siteIds.forEach((siteId) => {
1843
- cur[siteId] = roleId;
1844
- });
1845
- return cur;
1846
- }, {});
1847
- }
1848
- __name(expandSitesByRole, "expandSitesByRole");
1849
- var defaultAnonymousKsClaims = {
1850
- isSuperAdmin: false,
1851
- userId: "",
1852
- siteRoleMap: {},
1853
- getSiteRole: /* @__PURE__ */ __name(() => "ANONYMOUS", "getSiteRole")
1854
- };
1855
- var getKsClaims = /* @__PURE__ */ __name((claims) => {
1856
- if (!JwtWithCustomClaimsStruct.is(claims)) {
1857
- return defaultAnonymousKsClaims;
1858
- }
1859
- const { sitesByRole, ...ksClaims } = claims[KNAPSACK_CLAIMS_NAMESPACE];
1860
- const siteRoleMap = expandSitesByRole(sitesByRole);
1861
- return {
1862
- ...ksClaims,
1863
- siteRoleMap,
1864
- getSiteRole: /* @__PURE__ */ __name((siteId) => {
1865
- if (ksClaims.isSuperAdmin) return "ADMIN";
1866
- return siteRoleMap[siteId] || "ANONYMOUS";
1867
- }, "getSiteRole")
1868
- };
1869
- }, "getKsClaims");
1870
-
1871
- // src/webhooks.ts
1872
- init_cjs_shims();
1873
- var siteDeployedWebhookEndpoint = "/site-deployed";
1874
- var gitHubOauthInternalEndpoint = "/github-auth";
1875
-
1876
- // src/ks-urls.ts
1877
- init_cjs_shims();
1878
- var import_utils6 = require("@knapsack/utils");
1879
- var { KS_DB_URL } = process.env;
1880
- if (KS_DB_URL && !(0, import_utils6.isUrl)(KS_DB_URL)) {
1881
- throw new Error(`KS_DB_URL is not a valid URL: '${KS_DB_URL}'`);
1882
- }
1883
- var dbUrl = KS_DB_URL || "https://db.knapsack.cloud";
1884
- var dbGqlEndpoint = new URL("/v1/graphql", dbUrl).toString();
1885
- var ksUrls = {
1886
- /**
1887
- * Base URL for Knapsack DB (Hasura)
1888
- * @default 'https://db.knapsack.cloud'
1889
- */
1890
- dbUrl,
1891
- /**
1892
- * App DB GraphQL endpoint for connecting to Hasura GraphQL.
1893
- * @default 'https://db.knapsack.cloud/v1/graphql'
1894
- */
1895
- dbGqlEndpoint
1896
- };
1897
-
1898
- // src/http-headers.ts
1899
- init_cjs_shims();
1900
- var ksHttpHeaders = {
1901
- siteId: "X-KS-Site-ID",
1902
- instanceId: "X-KS-Instance-Id"
1903
- };
1904
- // Annotate the CommonJS export names for ESM import in node:
1905
- 0 && (module.exports = {
1906
- HASURA_CLAIMS_NAMESPACE,
1907
- HasuraClaimsStruct,
1908
- HasuraRoles,
1909
- JwtBaseStruct,
1910
- JwtCustomClaimsStruct,
1911
- JwtWithCustomClaimsStruct,
1912
- KNAPSACK_CLAIMS_NAMESPACE,
1913
- KsClaimsStruct,
1914
- RolesEnums,
1915
- RolesEnumsStruct,
1916
- canRoleAdmin,
1917
- canRoleDelete,
1918
- canRoleEdit,
1919
- canRoleManageUsers,
1920
- canRolePublish,
1921
- canRoleView,
1922
- defaultAnonymousKsClaims,
1923
- expandSitesByRole,
1924
- getKsClaims,
1925
- gitHubOauthInternalEndpoint,
1926
- isRoleValid,
1927
- ksHttpHeaders,
1928
- ksUrls,
1929
- rolesThatCanDelete,
1930
- rolesThatCanEdit,
1931
- rolesThatCanManageUsers,
1932
- rolesThatCanPublish,
1933
- rolesThatCanView,
1934
- siteDeployedWebhookEndpoint
1935
- });
1
+ 'use strict';
2
+
3
+ var r = require('superstruct');
4
+ var utils = require('@knapsack/utils');
5
+
6
+ function _interopNamespace(e) {
7
+ if (e && e.__esModule) return e;
8
+ var n = Object.create(null);
9
+ if (e) {
10
+ Object.keys(e).forEach(function (k) {
11
+ if (k !== 'default') {
12
+ var d = Object.getOwnPropertyDescriptor(e, k);
13
+ Object.defineProperty(n, k, d.get ? d : {
14
+ enumerable: true,
15
+ get: function () { return e[k]; }
16
+ });
17
+ }
18
+ });
19
+ }
20
+ n.default = e;
21
+ return Object.freeze(n);
22
+ }
23
+
24
+ var r__namespace = /*#__PURE__*/_interopNamespace(r);
25
+
26
+ var Lt=Object.create;var be=Object.defineProperty;var Wt=Object.getOwnPropertyDescriptor;var $t=Object.getOwnPropertyNames;var Ht=Object.getPrototypeOf,Gt=Object.prototype.hasOwnProperty;var s=(e,t)=>be(e,"name",{value:t,configurable:!0});var ne=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var jt=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $t(t))!Gt.call(e,o)&&o!==n&&be(e,o,{get:()=>t[o],enumerable:!(a=Wt(t,o))||a.enumerable});return e};var Jt=(e,t,n)=>(n=e!=null?Lt(Ht(e)):{},jt(be(n,"default",{value:e,enumerable:!0}),e));var Me=ne((Wn,Oe)=>{Oe.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};});var ze=ne(($n,Fe)=>{Fe.exports=s(function(t){return !t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")},"isArrayish");});var Ue=ne((Gn,Be)=>{var qt=ze(),Xt=Array.prototype.concat,Yt=Array.prototype.slice,Ke=Be.exports=s(function(t){for(var n=[],a=0,o=t.length;a<o;a++){var d=t[a];qt(d)?n=Xt.call(n,Yt.call(d)):n.push(d);}return n},"swizzle");Ke.wrap=function(e){return function(){return e(Ke(arguments))}};});var He=ne((Jn,$e)=>{var j=Me(),J=Ue(),Le=Object.hasOwnProperty,We=Object.create(null);for(ae in j)Le.call(j,ae)&&(We[j[ae]]=ae);var ae,_=$e.exports={to:{},get:{}};_.get=function(e){var t=e.substring(0,3).toLowerCase(),n,a;switch(t){case"hsl":n=_.get.hsl(e),a="hsl";break;case"hwb":n=_.get.hwb(e),a="hwb";break;default:n=_.get.rgb(e),a="rgb";break}return n?{model:a,value:n}:null};_.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,a=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,d=/^(\w+)$/,c=[0,0,0,1],l,p,E;if(l=e.match(n)){for(E=l[2],l=l[1],p=0;p<3;p++){var re=p*2;c[p]=parseInt(l.slice(re,re+2),16);}E&&(c[3]=parseInt(E,16)/255);}else if(l=e.match(t)){for(l=l[1],E=l[3],p=0;p<3;p++)c[p]=parseInt(l[p]+l[p],16);E&&(c[3]=parseInt(E+E,16)/255);}else if(l=e.match(a)){for(p=0;p<3;p++)c[p]=parseInt(l[p+1],0);l[4]&&(l[5]?c[3]=parseFloat(l[4])*.01:c[3]=parseFloat(l[4]));}else if(l=e.match(o)){for(p=0;p<3;p++)c[p]=Math.round(parseFloat(l[p+1])*2.55);l[4]&&(l[5]?c[3]=parseFloat(l[4])*.01:c[3]=parseFloat(l[4]));}else return (l=e.match(d))?l[1]==="transparent"?[0,0,0,0]:Le.call(j,l[1])?(c=j[l[1]],c[3]=1,c):null:null;for(p=0;p<3;p++)c[p]=O(c[p],0,255);return c[3]=O(c[3],0,1),c};_.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var a=parseFloat(n[4]),o=(parseFloat(n[1])%360+360)%360,d=O(parseFloat(n[2]),0,100),c=O(parseFloat(n[3]),0,100),l=O(isNaN(a)?1:a,0,1);return [o,d,c,l]}return null};_.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var a=parseFloat(n[4]),o=(parseFloat(n[1])%360+360)%360,d=O(parseFloat(n[2]),0,100),c=O(parseFloat(n[3]),0,100),l=O(isNaN(a)?1:a,0,1);return [o,d,c,l]}return null};_.to.hex=function(){var e=J(arguments);return "#"+ie(e[0])+ie(e[1])+ie(e[2])+(e[3]<1?ie(Math.round(e[3]*255)):"")};_.to.rgb=function(){var e=J(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};_.to.rgb.percent=function(){var e=J(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),a=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+a+"%)":"rgba("+t+"%, "+n+"%, "+a+"%, "+e[3]+")"};_.to.hsl=function(){var e=J(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};_.to.hwb=function(){var e=J(arguments),t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};_.to.keyword=function(e){return We[e.slice(0,3)]};function O(e,t,n){return Math.min(Math.max(t,e),n)}s(O,"clamp");function ie(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}s(ie,"hexDouble");});var it=Jt(He());var Ye=Symbol.for("immer-nothing"),Ge=Symbol.for("immer-draftable"),C=Symbol.for("immer-state"),Qt=process.env.NODE_ENV!=="production"?[function(e){return `The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return `'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return `'original' expects a draft, got: ${e}`}]:[];function v(e,...t){if(process.env.NODE_ENV!=="production"){let n=Qt[e],a=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${a}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}s(v,"die");var W=Object.getPrototypeOf;function M(e){return !!e&&!!e[C]}s(M,"isDraft");function K(e){return e?Qe(e)||Array.isArray(e)||!!e[Ge]||!!e.constructor?.[Ge]||ce(e)||de(e):!1}s(K,"isDraftable");var Zt=Object.prototype.constructor.toString();function Qe(e){if(!e||typeof e!="object")return !1;let t=W(e);if(t===null)return !0;let n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Zt}s(Qe,"isPlainObject");function se(e,t){ue(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e);}):e.forEach((n,a)=>t(a,n,e));}s(se,"each");function ue(e){let t=e[C];return t?t.type_:Array.isArray(e)?1:ce(e)?2:de(e)?3:0}s(ue,"getArchtype");function ke(e,t){return ue(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}s(ke,"has");function Ze(e,t,n){let a=ue(e);a===2?e.set(t,n):a===3?e.add(n):e[t]=n;}s(Ze,"set");function er(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}s(er,"is");function ce(e){return e instanceof Map}s(ce,"isMap");function de(e){return e instanceof Set}s(de,"isSet");function z(e){return e.copy_||e.base_}s(z,"latest");function _e(e,t){if(ce(e))return new Map(e);if(de(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=Qe(e);if(t===!0||t==="class_only"&&!n){let a=Object.getOwnPropertyDescriptors(e);delete a[C];let o=Reflect.ownKeys(a);for(let d=0;d<o.length;d++){let c=o[d],l=a[c];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(a[c]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[c]});}return Object.create(W(e),a)}else {let a=W(e);if(a!==null&&n)return {...e};let o=Object.create(a);return Object.assign(o,e)}}s(_e,"shallowCopy");function Ae(e,t=!1){return pe(e)||M(e)||!K(e)||(ue(e)>1&&(e.set=e.add=e.clear=e.delete=tr),Object.freeze(e),t&&Object.entries(e).forEach(([n,a])=>Ae(a,!0))),e}s(Ae,"freeze");function tr(){v(2);}s(tr,"dontMutateFrozenCollections");function pe(e){return Object.isFrozen(e)}s(pe,"isFrozen");var rr={};function B(e){let t=rr[e];return t||v(0,e),t}s(B,"getPlugin");var q;function et(){return q}s(et,"getCurrentScope");function nr(e,t){return {drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}s(nr,"createScope");function je(e,t){t&&(B("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t);}s(je,"usePatchesInScope");function Ce(e){Te(e),e.drafts_.forEach(ar),e.drafts_=null;}s(Ce,"revokeScope");function Te(e){e===q&&(q=e.parent_);}s(Te,"leaveScope");function Je(e){return q=nr(q,e)}s(Je,"enterScope");function ar(e){let t=e[C];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0;}s(ar,"revokeDraft");function qe(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[C].modified_&&(Ce(t),v(4)),K(e)&&(e=oe(t,e),t.parent_||le(t,e)),t.patches_&&B("Patches").generateReplacementPatches_(n[C].base_,e,t.patches_,t.inversePatches_)):e=oe(t,n,[]),Ce(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ye?e:void 0}s(qe,"processResult");function oe(e,t,n){if(pe(t))return t;let a=t[C];if(!a)return se(t,(o,d)=>Xe(e,a,t,o,d,n)),t;if(a.scope_!==e)return t;if(!a.modified_)return le(e,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;let o=a.copy_,d=o,c=!1;a.type_===3&&(d=new Set(o),o.clear(),c=!0),se(d,(l,p)=>Xe(e,a,o,l,p,n,c)),le(e,o,!1),n&&e.patches_&&B("Patches").generatePatches_(a,n,e.patches_,e.inversePatches_);}return a.copy_}s(oe,"finalize");function Xe(e,t,n,a,o,d,c){if(process.env.NODE_ENV!=="production"&&o===n&&v(5),M(o)){let l=d&&t&&t.type_!==3&&!ke(t.assigned_,a)?d.concat(a):void 0,p=oe(e,o,l);if(Ze(n,a,p),M(p))e.canAutoFreeze_=!1;else return}else c&&n.add(o);if(K(o)&&!pe(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;oe(e,o),(!t||!t.scope_.parent_)&&typeof a!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,a)&&le(e,o);}}s(Xe,"finalizeProperty");function le(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ae(t,n);}s(le,"maybeFreeze");function ir(e,t){let n=Array.isArray(e),a={type_:n?1:0,scope_:t?t.scope_:et(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=a,d=Ee;n&&(o=[a],d=X);let{revoke:c,proxy:l}=Proxy.revocable(o,d);return a.draft_=l,a.revoke_=c,l}s(ir,"createProxyProxy");var Ee={get(e,t){if(t===C)return e;let n=z(e);if(!ke(n,t))return sr(e,n,t);let a=n[t];return e.finalized_||!K(a)?a:a===ve(e.base_,t)?(Se(e),e.copy_[t]=xe(a,e)):a},has(e,t){return t in z(e)},ownKeys(e){return Reflect.ownKeys(z(e))},set(e,t,n){let a=tt(z(e),t);if(a?.set)return a.set.call(e.draft_,n),!0;if(!e.modified_){let o=ve(z(e),t),d=o?.[C];if(d&&d.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(er(n,o)&&(n!==void 0||ke(e.base_,t)))return !0;Se(e),we(e);}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return ve(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Se(e),we(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=z(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:a.enumerable,value:n[t]}},defineProperty(){v(11);},getPrototypeOf(e){return W(e.base_)},setPrototypeOf(){v(12);}},X={};se(Ee,(e,t)=>{X[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)};});X.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&v(13),X.set.call(this,e,t,void 0)};X.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&v(14),Ee.set.call(this,e[0],t,n,e[0])};function ve(e,t){let n=e[C];return (n?z(n):e)[t]}s(ve,"peek");function sr(e,t,n){let a=tt(t,n);return a?"value"in a?a.value:a.get?.call(e.draft_):void 0}s(sr,"readPropFromProto");function tt(e,t){if(!(t in e))return;let n=W(e);for(;n;){let a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=W(n);}}s(tt,"getDescriptorFromProto");function we(e){e.modified_||(e.modified_=!0,e.parent_&&we(e.parent_));}s(we,"markChanged");function Se(e){e.copy_||(e.copy_=_e(e.base_,e.scope_.immer_.useStrictShallowCopy_));}s(Se,"prepareCopy");var or=class{static{s(this,"Immer2");}constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,a)=>{if(typeof t=="function"&&typeof n!="function"){let d=n;n=t;let c=this;return s(function(p=d,...E){return c.produce(p,re=>n.call(this,re,...E))},"curriedProduce")}typeof n!="function"&&v(6),a!==void 0&&typeof a!="function"&&v(7);let o;if(K(t)){let d=Je(this),c=xe(t,void 0),l=!0;try{o=n(c),l=!1;}finally{l?Ce(d):Te(d);}return je(d,a),qe(o,d)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===Ye&&(o=void 0),this.autoFreeze_&&Ae(o,!0),a){let d=[],c=[];B("Patches").generateReplacementPatches_(t,o,d,c),a(d,c);}return o}else v(1,t);},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return (c,...l)=>this.produceWithPatches(c,p=>t(p,...l));let a,o;return [this.produce(t,n,(c,l)=>{a=c,o=l;}),a,o]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy);}createDraft(e){K(e)||v(8),M(e)&&(e=lr(e));let t=Je(this),n=xe(e,void 0);return n[C].isManual_=!0,Te(t),n}finishDraft(e,t){let n=e&&e[C];(!n||!n.isManual_)&&v(9);let{scope_:a}=n;return je(a,t),qe(void 0,a)}setAutoFreeze(e){this.autoFreeze_=e;}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e;}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));let a=B("Patches").applyPatches_;return M(e)?a(e,t):this.produce(e,o=>a(o,t))}};function xe(e,t){let n=ce(e)?B("MapSet").proxyMap_(e,t):de(e)?B("MapSet").proxySet_(e,t):ir(e,t);return (t?t.scope_:et()).drafts_.push(n),n}s(xe,"createProxy");function lr(e){return M(e)||v(10,e),rt(e)}s(lr,"current");function rt(e){if(!K(e)||pe(e))return e;let t=e[C],n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=_e(e,t.scope_.immer_.useStrictShallowCopy_);}else n=_e(e,!0);return se(n,(a,o)=>{Ze(n,a,rt(o));}),t&&(t.finalized_=!1),n}s(rt,"currentImpl");var T=new or;T.produceWithPatches.bind(T);T.setAutoFreeze.bind(T);T.setUseStrictShallowCopy.bind(T);T.applyPatches.bind(T);T.createDraft.bind(T);T.finishDraft.bind(T);var st=Object.defineProperty,u=s((e,t)=>st(e,"name",{value:t,configurable:!0}),"o"),ot=s((e,t)=>{for(var n in t)st(e,n,{get:t[n],enumerable:!0});},"ge");function lt(e){if(typeof e!="string")return !1;try{return !!it.default.get(e)}catch{return !1}}s(lt,"Fe");u(lt,"isColor");var ge=r.define("ColorStringStruct",e=>typeof e=="string"&&lt(e)),m=r.union([r.type({type:r.literal("value"),colorValue:ge}),r.type({type:r.literal("design-token"),tokenName:r.string()})]);r.type({type:r.literal("design-token"),tokenName:r.string()});var nt=r.object({unit:r.enums(["rem","px"]),value:r.number()}),at=r.union([r.string(),r.number()]),dr=(e=>(e.woff2="woff2",e.woff="woff",e))(dr||{}),pr=r.enums(["woff2","woff"]),fr=r.type({format:pr,type:r.literal("url"),path:r.string()}),ee=r.type({family:r.optional(r.string()),weight:r.optional(r.union([at,r.size(r.array(at),2)])),src:r.optional(r.array(fr)),style:r.optional(r.string()),display:r.optional(r.enums(["auto","block","swap","fallback","optional"])),variationSettings:r.optional(r.string()),unicodeRange:r.optional(r.string())}),gr=(e=>(e.inherit="As typed",e.capitalize="Capitalize",e.lowercase="Lowercase",e.uppercase="Uppercase",e))(gr||{}),yr=(e=>(e["ultra-condensed"]="Ultra-condensed",e["extra-condensed"]="Extra-condensed",e.condensed="Condensed",e["semi-condensed"]="Semi-condensed",e.normal="Normal",e["semi-expanded"]="Semi-expanded",e.expanded="Expanded",e["extra-expanded"]="Extra-expanded",e["ultra-expanded"]="Ultra-expanded",e))(yr||{}),te=r.type({fontWeight:r.optional(r.union([r.string(),r.number()])),textColor:r.optional(m),hoverColor:r.optional(m),underline:r.optional(r.boolean()),textTransform:r.optional(r.enums(["inherit","capitalize","lowercase","uppercase"])),fontStretch:r.optional(r.enums(["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"]))}),mr=r.type({min:nt,max:r.optional(nt)}),f=r.type({fontSize:r.optional(mr),lineHeight:r.optional(r.union([r.string(),r.number()])),fontWeight:r.optional(r.union([r.string(),r.number()])),letterSpacing:r.optional(r.string()),fontFamily:r.optional(r.string()),textColor:r.optional(m),textTransform:r.optional(r.enums(["inherit","capitalize","lowercase","uppercase"])),fontStretch:r.optional(r.enums(["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"]))});var G=r.union([f,r.type({accentColor:r.optional(m)})]),ye=r.union([G,r.type({hoverColor:r.optional(m),backgroundColor:r.optional(m)})]),me=r.union([G,r.type({backgroundColor:r.optional(m)})]);r.object({version:r.literal(1),oldSillySidebarBgColor:ge});r.object({version:r.literal(2),anotherSillySidebarBgColor:ge});r.object({version:r.literal(3),sidebarBgColor:ge});r.object({version:r.literal(4),primaryColor:m,darkColor:m,lightColor:m,enableSidebarIcons:r.optional(r.defaulted(r.boolean(),!0))});r.object({version:r.literal(5),primaryColor:m,darkColor:m,lightColor:m,linkColor:m,enableSidebarIcons:r.optional(r.defaulted(r.boolean(),!0))});r.object({version:r.literal(6),primaryColor:m,darkColor:m,lightColor:m,linkColor:m,enableSidebarIcons:r.optional(r.defaulted(r.boolean(),!0)),appearance:r.type({customFonts:r.optional(r.array(ee)),pageElements:r.type({pageTitle:r.optional(f),pageDescription:r.optional(f),headingLarge:r.optional(f),headingMedium:r.optional(f),headingSmall:r.optional(f),bodyText:r.optional(f),link:r.optional(te)})})});r.object({version:r.literal(7),primaryColor:m,darkColor:m,lightColor:m,linkColor:m,enableSidebarIcons:r.optional(r.defaulted(r.boolean(),!0)),appearance:r.type({customFonts:r.optional(r.array(ee)),navigation:r.optional(r.type({primaryNav:r.optional(ye),secondaryNav:r.optional(me),tabs:r.optional(G)})),pageElements:r.type({pageTitle:r.optional(f),pageDescription:r.optional(f),headingLarge:r.optional(f),headingMedium:r.optional(f),headingSmall:r.optional(f),bodyText:r.optional(f),link:r.optional(te)})})});r.object({version:r.literal(8),primaryColor:m,darkColor:m,lightColor:m,linkColor:m,appearance:r.type({customFonts:r.optional(r.array(ee)),navigation:r.optional(r.type({primaryNav:r.optional(ye),secondaryNav:r.optional(me),tabs:r.optional(G)})),pageElements:r.type({pageTitle:r.optional(f),pageDescription:r.optional(f),headingLarge:r.optional(f),headingMedium:r.optional(f),headingSmall:r.optional(f),bodyText:r.optional(f),link:r.optional(te)})})});r.object({version:r.literal(9),appearance:r.type({customFonts:r.optional(r.array(ee)),navigation:r.optional(r.type({primaryNav:r.optional(ye),secondaryNav:r.optional(me),tabs:r.optional(G)})),pageElements:r.type({pageTitle:r.optional(f),pageDescription:r.optional(f),headingLarge:r.optional(f),headingMedium:r.optional(f),headingSmall:r.optional(f),bodyText:r.optional(f),link:r.optional(te)})})});r.object({version:r.literal(10),appearance:r.type({customFonts:r.optional(r.array(ee)),navigation:r.optional(r.type({primaryNav:r.optional(ye),secondaryNav:r.optional(me),tabs:r.optional(G)})),pageElements:r.type({pageTitle:r.optional(f),pageDescription:r.optional(f),headingXLarge:r.optional(f),headingLarge:r.optional(f),headingMedium:r.optional(f),headingSmall:r.optional(f),headingXSmall:r.optional(f),bodyText:r.optional(f),link:r.optional(te)})})});function ut(e){return typeof e!="string"?!1:e.split("{").length-1===1&&e.startsWith("{")&&e.endsWith("}")}s(ut,"Qe");u(ut,"isTokenReference");function P(e){return typeof e=="string"&&e.includes("{")}s(P,"b");u(P,"hasTokenReferences");function ct(e){return !ut(e)}s(ct,"Ze");u(ct,"isNotTokenReference");var h=r__namespace.define("Token Reference",e=>typeof e!="string"?!1:ct(e)?"Must start and end with curly braces":!0),hr={border:"border",shadow:"shadow",transition:"transition"},br=Object.values(hr),vr={string:"string",number:"number",boolean:"boolean",color:"color",dimension:"dimension",duration:"duration",fontWeight:"fontWeight",strokeStyle:"strokeStyle",cubicBezier:"cubicBezier"},Sr=Object.values(vr);function Ve(e){return br.includes(e)}s(Ve,"q");u(Ve,"isTokenTypeComposite");function dt(e){return Sr.includes(e)}s(dt,"Te");u(dt,"isTokenTypeSingular");utils.expectType([{inset:!1,color:"#000",offsetX:"0px",offsetY:"0px",spread:"0px",blur:"0px"},{color:"#000",offsetX:"0px",offsetY:"0px",spread:"0px",blur:"0px",inset:!0}]);var b=r__namespace.type({id:r__namespace.string(),description:r__namespace.optional(r__namespace.string()),references:r__namespace.optional(r__namespace.array(r__namespace.array(r__namespace.string()))),tokenConfig:r__namespace.optional(r__namespace.type({purpose:r__namespace.optional(r__namespace.string())}))});utils.expectType([{type:"duration",value:"1ms",originalValue:"1ms",id:"1",kind:"static"},{type:"duration",value:"1ms",kind:"ref",id:"1",originalValue:"{a.b}",referencedTokenId:"1"},{type:"duration",value:"1ms",originalValue:"1ms",id:"1",kind:"ref"},{type:"duration",value:"1ms",kind:"static",id:"1",originalValue:"{a.b}",referencedTokenId:"1"},{type:"color",value:"#000",kind:"static",id:"1",originalValue:"#000"},{type:"color",value:"#000",kind:"ref",id:"1",originalValue:"{c.b}",referencedTokenId:"c.b"},{type:"cubicBezier",kind:"static",value:[0,0,0,1],originalValue:[0,0,0,1],id:"1"}]);function kr(e){return Ve(e.type)}s(kr,"To");u(kr,"isTokenDataComposite");utils.expectType([{type:"border",kind:"static",id:"1",value:{color:"#000",style:"solid",width:"1px"},originalValue:{color:"#000",style:"solid",width:"1px"}},{type:"border",kind:"ref",referencedTokenId:"a.b",id:"1",value:{color:"red",style:"dashed",width:"2px"},originalValue:"{a.b}"},{type:"shadow",value:{color:"#000",offsetX:"1px",offsetY:"1px",blur:"1px",spread:"1px",inset:!1},originalValue:{color:"#000",offsetX:"{a.a}",offsetY:"1px",blur:"1px",spread:"1px",inset:!1},id:"1",kind:"static"},{type:"shadow",kind:"ref",referencedTokenId:"a.b",value:{inset:!0,color:"red",offsetX:"1px",blur:"2px",offsetY:"3px",spread:"4px"},originalValue:"{a.b}",id:"1"},{type:"transition",value:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},originalValue:"{a.b}",kind:"ref",referencedTokenId:"a.b",id:"1"},{type:"transition",kind:"static",value:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},originalValue:{duration:"100ms",delay:"{a.c}",timingFunction:"{a.c}"},id:"1"},{type:"transition",kind:"static",value:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},originalValue:{duration:"100ms",delay:"200ms",timingFunction:[0,0,0,0]},id:"1"}]);function pt(e){return typeof e=="string"&&!P(e)}s(pt,"it");u(pt,"isTokenValueColor");var $=r__namespace.define("Color Value",e=>typeof e!="string"?"Value must be a string":e===""?"Value must not be empty":P(e)?"Value must not contain {} (token references)":!0),_r=r__namespace.assign(r__namespace.type({type:r__namespace.literal("color"),value:$,kind:r__namespace.literal("static"),originalValue:$}),b),Cr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("color"),value:$,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);function Y(e){return typeof e=="string"&&(e.endsWith("px")||e.endsWith("rem"))&&!P(e)}s(Y,"J");u(Y,"isTokenValueDimension");var D=r__namespace.define("Dimension Value",e=>typeof e!="string"?"Value must be a string":P(e)?"Value must not contain {} (token references)":!e.endsWith("px")&&!e.endsWith("rem")&&!e.endsWith("em")&&!e.endsWith("%")?"Value must end with px, rem, em or %":!0),Tr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("dimension"),value:D,kind:r__namespace.literal("static"),originalValue:D}),b),wr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("dimension"),value:D,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);function xr(e){return typeof e=="string"&&e.endsWith("ms")&&!P(e)}s(xr,"So");u(xr,"isTokenValueDuration");var L=r__namespace.define("Duration Value",e=>typeof e!="string"?"Value must be a string":P(e)?"Value must not contain {} (token references)":/^\d+ms$/.test(e)?!0:'Value must be a number followed by "ms" (e.g., "100ms")'),Ar=r__namespace.assign(r__namespace.type({type:r__namespace.literal("duration"),value:L,kind:r__namespace.literal("static"),originalValue:L}),b),Er=r__namespace.assign(r__namespace.type({type:r__namespace.literal("duration"),value:L,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);function Dr(e){return (typeof e=="string"||typeof e=="number")&&!P(e)}s(Dr,"Co");u(Dr,"isTokenValueFontWeight");var De=r__namespace.define("Font Weight Value",e=>typeof e!="string"&&typeof e!="number"?"Value must be a string or number":P(e)?"Value must not contain {} (token references)":!0),Nr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("fontWeight"),value:De,kind:r__namespace.literal("static"),originalValue:De}),b),Vr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("fontWeight"),value:De,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b),Q=r__namespace.define("Cubic Bezier Value",e=>Array.isArray(e)?e.length!==4||!e.every(t=>typeof t=="number")?"Value must be an array of 4 numbers":e[0]<0||e[0]>1||e[2]<0||e[2]>1?"The first and third cubicBezier values must be between 0 and 1":!0:"Value must be an array"),Ir=r__namespace.assign(r__namespace.type({type:r__namespace.literal("cubicBezier"),value:Q,kind:r__namespace.literal("static"),originalValue:Q}),b),Pr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("cubicBezier"),value:Q,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);function ft(e){return utils.isObject(e)&&pt(e.color)&&Y(e.offsetX)&&Y(e.offsetY)&&Y(e.blur)&&Y(e.spread)}s(ft,"yt");u(ft,"isTokenValueShadow");var gt=r__namespace.define("Shadow Value",e=>ft(e)?!0:`Expected a shadow value, got ${JSON.stringify(e)}`),Rr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("shadow"),value:gt,kind:r__namespace.literal("static"),originalValue:r__namespace.type({color:r__namespace.union([$,h]),offsetX:r__namespace.union([D,h]),offsetY:r__namespace.union([D,h]),blur:r__namespace.union([D,h]),spread:r__namespace.union([D,h]),inset:r__namespace.union([r__namespace.optional(r__namespace.boolean()),h])})}),b),Or=r__namespace.assign(r__namespace.type({type:r__namespace.literal("shadow"),value:gt,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b),H=r__namespace.union([r__namespace.literal("solid"),r__namespace.literal("dashed"),r__namespace.literal("dotted"),r__namespace.literal("double"),r__namespace.literal("groove"),r__namespace.literal("ridge"),r__namespace.literal("outset"),r__namespace.literal("inset")]);function yt(e){return utils.isObject(e)&&$.is(e.color)&&H.is(e.style)&&D.is(e.width)}s(yt,"St");u(yt,"isTokenValueBorder");var mt=r__namespace.define("Border Value",yt),Mr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("border"),value:mt,kind:r__namespace.literal("static"),originalValue:r__namespace.type({color:r__namespace.union([$,h]),style:r__namespace.union([H,h]),width:r__namespace.union([D,h])})}),b),Fr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("border"),value:mt,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);function ht(e){return utils.isObject(e)&&Q.is(e.timingFunction)&&L.is(e.duration)&&L.is(e.delay)}s(ht,"bt");u(ht,"isTokenValueTransition");var bt=r__namespace.define("Transition Value",ht),zr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("transition"),value:bt,kind:r__namespace.literal("static"),originalValue:r__namespace.type({timingFunction:r__namespace.union([Q,h]),duration:r__namespace.union([L,h]),delay:r__namespace.union([L,h])})}),b),Kr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("transition"),value:bt,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b),Br=r__namespace.assign(r__namespace.type({type:r__namespace.literal("string"),value:r__namespace.string(),kind:r__namespace.literal("static"),originalValue:r__namespace.string()}),b),Ur=r__namespace.assign(r__namespace.type({type:r__namespace.literal("string"),value:r__namespace.string(),kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b),Lr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("strokeStyle"),value:H,kind:r__namespace.literal("static"),originalValue:H}),b),Wr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("strokeStyle"),value:H,kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:H}),b),$r=r__namespace.assign(r__namespace.type({type:r__namespace.literal("number"),value:r__namespace.number(),kind:r__namespace.literal("static"),originalValue:r__namespace.number()}),b),Hr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("number"),value:r__namespace.number(),kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b),Gr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("boolean"),value:r__namespace.boolean(),kind:r__namespace.literal("static"),originalValue:r__namespace.boolean()}),b),jr=r__namespace.assign(r__namespace.type({type:r__namespace.literal("boolean"),value:r__namespace.boolean(),kind:r__namespace.literal("ref"),originalValue:h,referencedTokenId:r__namespace.string()}),b);u(e=>{if(!utils.isObject(e))throw new Error(`Expected token data to be an object, got ${JSON.stringify(e)}`);if(!utils.isObjKey("type",e))throw new Error(`Expected token data to have a "type" property, got ${JSON.stringify(e)}`);if(typeof e.type!="string")throw new Error(`Expected token data "type" property to be a string, got ${JSON.stringify(e)}`);let t=e.type,n=e.kind;try{switch(t){case"boolean":n==="ref"?jr.assert(e):Gr.assert(e);return;case"border":n==="ref"?Fr.assert(e):Mr.assert(e);return;case"color":n==="ref"?Cr.assert(e):_r.assert(e);return;case"cubicBezier":n==="ref"?Pr.assert(e):Ir.assert(e);return;case"dimension":n==="ref"?wr.assert(e):Tr.assert(e);return;case"duration":n==="ref"?Er.assert(e):Ar.assert(e);return;case"fontWeight":n==="ref"?Vr.assert(e):Nr.assert(e);return;case"number":n==="ref"?Hr.assert(e):$r.assert(e);return;case"shadow":n==="ref"?Or.assert(e):Rr.assert(e);return;case"string":n==="ref"?Ur.assert(e):Br.assert(e);return;case"strokeStyle":n==="ref"?Wr.assert(e):Lr.assert(e);return;case"transition":n==="ref"?Kr.assert(e):zr.assert(e);return;default:throw new Error(`Unknown token data type: ${t}`)}}catch(a){throw a instanceof r__namespace.StructError?new Error(`Invalid token data for type "${t}": ${a.message}. Received this data: "${JSON.stringify(e)}"`):a}},"assertTokenData");utils.expectType([{type:"dimension",kind:"static",value:"1px"},{type:"dimension",kind:"ref",referencedTokenId:"a.b"}]);utils.expectType([{type:"border",kind:"ref",referencedTokenId:"a.b"},{type:"border",kind:"static",value:{color:{kind:"static",type:"color",value:"red"},style:{kind:"ref",type:"strokeStyle",referencedTokenId:""},width:{kind:"static",type:"dimension",value:"2px"}}}]);utils.expectType([{type:"transition",kind:"ref",referencedTokenId:"a.b"},{type:"transition",kind:"static",value:{delay:{kind:"static",type:"duration",value:"1ms"},duration:{kind:"ref",type:"duration",referencedTokenId:"animation.slow"},timingFunction:{kind:"static",type:"cubicBezier",value:[.4,0,.2,1]}}}]);function Jr(e){return dt(e?.type)}s(Jr,"Bo");u(Jr,"isTokenSrcValueInfoSingular");function qr(e){return Ve(e?.type)}s(qr,"Eo");u(qr,"isTokenSrcValueInfoComposite");utils.expectType([{type:"dimension",kind:"static",value:"1px"},{type:"transition",kind:"ref",referencedTokenId:"a.b"},{type:"transition",kind:"ref",value:"1px"},{kind:"ref",type:"duration",referencedTokenId:"animation.slow"},{kind:"static",type:"cubicBezier",value:[.4,0,.2,1]},{type:"transition",kind:"static",value:{delay:{kind:"static",type:"duration",value:"1ms"},duration:{kind:"ref",type:"duration",referencedTokenId:"animation.slow"},timingFunction:{kind:"static",type:"cubicBezier",value:[.4,0,.2,1]}}}]);function vt(e){return utils.isObject(e)&&utils.isObjKey("cloud.knapsack",e)}s(vt,"At");u(vt,"isTokenSrcExtensions");utils.expectType(["#ddd",!0,[83,1,1,1],{color:"#000",style:"solid",width:"1px"},{inset:!0,color:"#000",offsetX:"0px",offsetY:"{spacing.medium}",spread:"0px",blur:"0px"},{timingFunction:"{timing.ease}",duration:"{timing.duration.medium}",delay:"7ms",color:"#000"}]);function Xr(e){return !!(utils.isObject(e)&&utils.isObjKey("$value",e))}s(Xr,"Oo");u(Xr,"isTokenSrc");function St(e){return utils.isObject(e)&&!vt(e)&&!utils.isObjKey("$value",e)&&!utils.isObjKey("cloud.knapsack",e)}s(St,"Kt");u(St,"isTokenGroup");function Yr(e){if(St(e)){let t=e.$extensions["cloud.knapsack"].group.collectionInfo;if(utils.isObjKey("type",t)&&utils.isObjKey("referenceId",t))return !0}return !1}s(Yr,"Fo");u(Yr,"isTokenTypeVarRef");function Qr(e){let t=typeof e;if(t==="string"||t==="number"||t==="boolean")return t;throw new Error(`Invalid token value type: ${JSON.stringify(t)}. Token value is: ${JSON.stringify(e)}`)}s(Qr,"jo");u(Qr,"getPrimitiveValue");u(e=>e.includes("px")||e.includes("rem")||e.includes("em")||e.includes("%"),"isDimensionString");function Zr(e){let{value:t,unit:n}=utils.parseNumberWithUnit(e);if(!n)return {value:t};if(n!=="px"&&n!=="rem"&&n!=="em"&&n!=="%")throw new Error(`Invalid unit "${n}" for value: ${t}`);return {value:t,unit:n}}s(Zr,"_o");u(Zr,"parseTokenDimensionValue");u(e=>utils.isObject(e)&&e.type==="text","isSlottedText");function en(e){return utils.isObject(e)&&e.type==="template-demo"}s(en,"qo");u(en,"isSlottedTemplateDemo");function tn(e){return utils.isObject(e)&&e.type==="template-reference"}s(tn,"Jo");u(tn,"isSlottedTemplateReference");var rn=(e=>(e.portrait="portrait",e.landscape="landscape",e))(rn||{});function nn(e){return e?.type==="data"}s(nn,"Yo");u(nn,"isDataDemo");function an(e){return e?.type==="template"}s(an,"Xo");u(an,"isTemplateDemo");var sn=(e=>(e.auto="auto",e.small="small",e.medium="medium",e.large="large",e.full="full",e))(sn||{});function kt(e){return !utils.isObject(e)||!["assetSetsState","customPagesState","navsState","patternsState","tokensSrc","db"].every(t=>utils.isObjKey(t,e))?!1:!utils.isObjKey("metaState",e)}s(kt,"zt");u(kt,"isKsAppClientDataNoMeta");r.define("KsAppClientDataNoMeta",kt);function _t(e){return utils.isObject(e)?["assetSetsState","customPagesState","navsState","patternsState","tokensSrc","metaState","db"].every(t=>utils.isObjKey(t,e)):!1}s(_t,"Mt");u(_t,"isKsAppClientDataAndMeta");r.define("KsAppClientDataAndMeta",_t);r.type({isLocalDev:r.boolean(),plugins:r.array(r.type({id:r.string(),hasContent:r.boolean(),clientPluginPath:r.optional(r.string()),cssPath:r.optional(r.string())})),meta:r.optional(r.type({version:r.optional(r.string()),hasKnapsackCloud:r.boolean(),knapsackCloudSiteId:r.optional(r.string()),serverPort:r.optional(r.number()),websocketsPort:r.optional(r.number()),https:r.optional(r.boolean()),cacheDir:r.optional(r.string()),ksVersions:r.type({app:r.string()})}))});function Ct(e){return !utils.isObject(e)||!["assetSetsState","customPagesState","navsState","patternsState","settingsState","tokensState"].every(t=>utils.isObjKey(t,e))?!1:!utils.isObjKey("metaState",e)}s(Ct,"_t");u(Ct,"isKsAppClientDataNoMetaV3");r.define("KsAppClientDataNoMeta",Ct);function Tt(e){return utils.isObject(e)?["assetSetsState","customPagesState","navsState","patternsState","settingsState","tokensState","metaState"].every(t=>utils.isObjKey(t,e)):!1}s(Tt,"Lt");u(Tt,"isKsAppClientDataAndMetaV3");r.define("KsAppClientDataAndMeta",Tt);r.type({isLocalDev:r.boolean(),plugins:r.array(r.type({id:r.string(),hasContent:r.boolean(),clientPluginPath:r.optional(r.string()),cssPath:r.optional(r.string())})),meta:r.optional(r.type({version:r.optional(r.string()),hasKnapsackCloud:r.boolean(),knapsackCloudSiteId:r.optional(r.string()),serverPort:r.optional(r.number()),websocketsPort:r.optional(r.number()),https:r.optional(r.boolean()),cacheDir:r.optional(r.string()),ksVersions:r.type({app:r.string()})}))});({version:"4.1.7",checkIfNeeded:u(e=>!0,"checkIfNeeded"),migrate:u(e=>{if(!M(e))throw new Error("Tried to run migrations on appClientData but it is not an Immer Draft");Object.values(e.patternsState.patterns).forEach(t=>{delete t.demoSize;}),Object.values(e.db.demos.byId).forEach(t=>{t.type==="data"&&(Object.entries(t.data.slots??{}).forEach(([n,a])=>{t.data.slots[n]=a.map(o=>typeof o=="string"?{type:"text",text:o}:(o.type==="template-reference"||o.type==="text"||(o.type="template-demo"),o));}),!(t.patternId&&t.templateId)&&(()=>{for(let{id:n,templates:a=[]}of Object.values(e.patternsState.patterns))for(let{id:o,demoIds:d=[]}of a)if(d.includes(t.id)){t.patternId=n,t.templateId=o;return}})());});},"migrate")});var un=(e=>(e.string="string",e.boolean="boolean",e.number="number",e.object="object",e.options="options",e.function="function",e.customTypeScript="customTypeScript",e.array="array",e.arrayOfObjects="arrayOfObjects",e.arrayOfStrings="arrayOfStrings",e.unknown="unknown",e))(un||{});u(e=>"type"in e&&e.type==="string"&&!("enum"in e),"isStringProp");u(e=>"type"in e&&e.type==="number","isNumberProp");u(e=>"type"in e&&e.type==="boolean","isBooleanProp");u(e=>"enum"in e,"isOptionsProp");u(e=>"typeof"in e&&e?.typeof==="function","isFunctionProp");u(e=>!("typeof"in e)&&"tsType"in e,"isCustomTypeScriptProp");u(e=>"type"in e&&e.type==="array"&&"items"in e&&e.items.type==="object","isArrayOfObjectsProp");u(e=>"type"in e&&e.type==="object"&&"properties"in e&&Object.keys(e.properties).length>0,"isObjectProp");u(e=>"type"in e&&e.type==="array"&&"items"in e&&e.items.type==="string","isArrayOfStringsProp");var wt=r__namespace.object({op:r__namespace.union([r__namespace.literal("replace"),r__namespace.literal("remove"),r__namespace.literal("add")]),path:r__namespace.array(r__namespace.union([r__namespace.string(),r__namespace.number()])),value:r__namespace.optional(r__namespace.any())}),cn=wt;u(e=>cn.is(e),"isPatch");var Ne=r__namespace.array(wt),dn=Ne;u(e=>dn.is(e),"isPatches");var xt=r__namespace.type({patches:Ne,inversePatches:r__namespace.optional(Ne),event:r__namespace.optional(r__namespace.object({type:r__namespace.string()})),id:r__namespace.string(),date:r__namespace.string(),userId:r__namespace.optional(r__namespace.string())}),pn=xt;u(e=>pn.is(e),"isKsRemoteChange");var fn=r__namespace.array(xt),gn=fn;u(e=>gn.is(e),"isKsRemoteChanges");var yn=(e=>(e.ready="ready",e))(yn||{});var mn=(e=>(e.GitHub="GitHub",e.GitLab="GitLab",e.GitLabRest="GitLabRest",e.Bitbucket="Bitbucket",e.Azure="Azure",e))(mn||{}),hn=(e=>(e.Conflicting="CONFLICTING",e.Mergeable="MERGEABLE",e.Unknown="UNKNOWN",e))(hn||{}),bn=(e=>(e.Create="CREATE",e.Move="MOVE",e.Update="UPDATE",e.Chmod="CHMOD",e))(bn||{}),vn=(e=>(e.Base64="BASE64",e.Text="TEXT",e))(vn||{}),Sn={};ot(Sn,{ACTIONS:s(()=>At,"ACTIONS"),endpoint:s(()=>kn,"endpoint")});var kn="/plugins",At=(e=>(e.getContent="getContent",e))(At||{}),_n={};ot(_n,{ACTIONS:s(()=>Et,"ACTIONS"),endpoint:s(()=>Cn,"endpoint")});var Cn="/files",Et=(e=>(e.verify="verify",e))(Et||{}),Tn={ADMIN:"ADMIN",ANONYMOUS:"ANONYMOUS",CONTRIBUTOR:"CONTRIBUTOR",EDITOR:"EDITOR",MANAGER:"MANAGER",VIEWER:"VIEWER"},Dt=Object.values(Tn);var Ot=r.enums(Dt),En=Ot,Ya=s(e=>e==="ADMIN","canRoleAdmin"),Mt=["ADMIN","MANAGER"],Qa=s(e=>Mt.includes(e),"canRoleManageUsers"),Ft=[...Mt,"EDITOR"],Za=s(e=>Ft.includes(e),"canRoleDelete"),zt=[...Ft,"CONTRIBUTOR"],ei=s(e=>zt.includes(e),"canRoleEdit"),Dn=["ADMIN"],ti=s(e=>Dn.includes(e),"canRolePublish"),Nn=[...zt,"VIEWER"],ri=s(e=>Nn.includes(e),"canRoleView"),Vn=s(e=>En.is(e),"isRoleValid"),Kt=(n=>(n.user="user",n.anonymous="anonymous",n))(Kt||{}),It=r.enums(Object.values(Kt)),In=r.object({"x-hasura-allowed-roles":r.array(It),"x-hasura-default-role":It,"x-hasura-user-id":r.optional(r.string())}),Pn=r.object({userId:r.string(),isSuperAdmin:r.boolean(),sitesByRole:r.record(Ot,r.array(r.string()))}),Rn=r.type({exp:r.number(),email:r.optional(r.string()),email_verified:r.optional(r.union([r.string(),r.boolean()])),iat:r.number(),iss:r.string(),sub:r.string(),aud:r.union([r.string(),r.array(r.string())])}),On="https://hasura.io/jwt/claims",Bt="https://knapsack.cloud",Mn=r.object({[On]:In,[Bt]:Pn}),Fn=r.assign(Rn,Mn);function zn(e){return Object.entries(e).reduce((t,[n,a])=>(Vn(n)&&a.forEach(o=>{t[o]=n;}),t),{})}s(zn,"expandSitesByRole");var Kn={isSuperAdmin:!1,userId:"",siteRoleMap:{},getSiteRole:s(()=>"ANONYMOUS","getSiteRole")},ni=s(e=>{if(!Fn.is(e))return Kn;let{sitesByRole:t,...n}=e[Bt],a=zn(t);return {...n,siteRoleMap:a,getSiteRole:s(o=>n.isSuperAdmin?"ADMIN":a[o]||"ANONYMOUS","getSiteRole")}},"getKsClaims");var si="/site-deployed",oi="/github-auth";var{KS_DB_URL:he}=process.env;if(he&&!utils.isUrl(he))throw new Error(`KS_DB_URL is not a valid URL: '${he}'`);var Ut=he||"https://db.knapsack.cloud",Un=new URL("/v1/graphql",Ut).toString(),ci={dbUrl:Ut,dbGqlEndpoint:Un};var pi={siteId:"X-KS-Site-ID",instanceId:"X-KS-Instance-Id"};
27
+
28
+ exports.HASURA_CLAIMS_NAMESPACE = On;
29
+ exports.HasuraClaimsStruct = In;
30
+ exports.HasuraRoles = Kt;
31
+ exports.JwtBaseStruct = Rn;
32
+ exports.JwtCustomClaimsStruct = Mn;
33
+ exports.JwtWithCustomClaimsStruct = Fn;
34
+ exports.KNAPSACK_CLAIMS_NAMESPACE = Bt;
35
+ exports.KsClaimsStruct = Pn;
36
+ exports.RolesEnums = Ot;
37
+ exports.RolesEnumsStruct = En;
38
+ exports.canRoleAdmin = Ya;
39
+ exports.canRoleDelete = Za;
40
+ exports.canRoleEdit = ei;
41
+ exports.canRoleManageUsers = Qa;
42
+ exports.canRolePublish = ti;
43
+ exports.canRoleView = ri;
44
+ exports.defaultAnonymousKsClaims = Kn;
45
+ exports.expandSitesByRole = zn;
46
+ exports.getKsClaims = ni;
47
+ exports.gitHubOauthInternalEndpoint = oi;
48
+ exports.isRoleValid = Vn;
49
+ exports.ksHttpHeaders = pi;
50
+ exports.ksUrls = ci;
51
+ exports.rolesThatCanDelete = Ft;
52
+ exports.rolesThatCanEdit = zt;
53
+ exports.rolesThatCanManageUsers = Mt;
54
+ exports.rolesThatCanPublish = Dn;
55
+ exports.rolesThatCanView = Nn;
56
+ exports.siteDeployedWebhookEndpoint = si;
57
+ //# sourceMappingURL=index.js.map
1936
58
  //# sourceMappingURL=index.js.map