@pandacss/token-dictionary 0.0.0-dev-20221121152823

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,694 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ TokenDictionary: () => TokenDictionary2
24
+ });
25
+ module.exports = __toCommonJS(src_exports);
26
+
27
+ // src/create-dictionary.ts
28
+ var import_shared7 = require("@pandacss/shared");
29
+
30
+ // src/dictionary.ts
31
+ var import_shared3 = require("@pandacss/shared");
32
+ var import_ts_pattern = require("ts-pattern");
33
+
34
+ // src/token.ts
35
+ var import_shared2 = require("@pandacss/shared");
36
+
37
+ // src/utils.ts
38
+ var import_shared = require("@pandacss/shared");
39
+ var REFERENCE_REGEX = /(\$[^\s,]+\w)|({([^}]*)})/g;
40
+ function getReferences(value) {
41
+ if (typeof value !== "string")
42
+ return [];
43
+ const matches = value.match(REFERENCE_REGEX);
44
+ if (!matches)
45
+ return [];
46
+ return matches.map((match2) => match2.replace(/[{}]/g, "")).map((value2) => value2.trim());
47
+ }
48
+ function hasReference(value) {
49
+ return REFERENCE_REGEX.test(value);
50
+ }
51
+ function mapToJson(map) {
52
+ const obj = {};
53
+ map.forEach((value, key) => {
54
+ if (value instanceof Map) {
55
+ obj[key] = Object.fromEntries(value);
56
+ } else {
57
+ obj[key] = value;
58
+ }
59
+ });
60
+ return obj;
61
+ }
62
+ var isToken = (value) => {
63
+ return (0, import_shared.isObject)(value) && "value" in value;
64
+ };
65
+ function assertTokenFormat(token) {
66
+ if (!isToken(token)) {
67
+ throw new Error(`Invalid token format: ${JSON.stringify(token)}`);
68
+ }
69
+ }
70
+
71
+ // src/token.ts
72
+ var Token = class {
73
+ name;
74
+ value;
75
+ originalValue;
76
+ path;
77
+ type;
78
+ description;
79
+ extensions;
80
+ constructor(data) {
81
+ this.name = data.name;
82
+ this.value = data.value;
83
+ this.originalValue = data.value;
84
+ this.path = data.path ?? [];
85
+ if (data.type) {
86
+ this.type = data.type;
87
+ }
88
+ if (data.description) {
89
+ this.description = data.description;
90
+ }
91
+ this.extensions = data.extensions ?? {};
92
+ this.extensions.condition = data.extensions?.condition ?? "base";
93
+ this.setType();
94
+ }
95
+ get isConditional() {
96
+ return !!this.extensions?.conditions;
97
+ }
98
+ get hasReference() {
99
+ return !!this.extensions?.references;
100
+ }
101
+ get isComposite() {
102
+ return (0, import_shared2.isObject)(this.originalValue) || Array.isArray(this.originalValue);
103
+ }
104
+ expandReferences() {
105
+ if (!this.hasReference)
106
+ return this.value;
107
+ const references = this.extensions.references ?? {};
108
+ this.value = Object.keys(references).reduce((valueStr, key) => {
109
+ const referenceToken = references[key];
110
+ if (referenceToken.isConditional) {
111
+ return valueStr;
112
+ }
113
+ const value = referenceToken.expandReferences();
114
+ return valueStr.replace(`{${key}}`, value);
115
+ }, this.value);
116
+ delete this.extensions.references;
117
+ return this.value;
118
+ }
119
+ get isReference() {
120
+ return hasReference(this.originalValue);
121
+ }
122
+ get references() {
123
+ return getReferences(this.originalValue);
124
+ }
125
+ clone() {
126
+ return new Token({
127
+ name: this.name,
128
+ value: this.value,
129
+ type: this.type,
130
+ path: [...this.path],
131
+ description: this.description,
132
+ extensions: cloneDeep(this.extensions)
133
+ });
134
+ }
135
+ getConditionTokens() {
136
+ if (!this.isConditional)
137
+ return;
138
+ const conditions = this.extensions.conditions ?? {};
139
+ const conditionalTokens = Object.entries(conditions).filter(([key]) => key !== "base").map(([key, value]) => {
140
+ const token = this.clone();
141
+ token.value = value;
142
+ token.extensions.condition = key;
143
+ return token;
144
+ });
145
+ return conditionalTokens;
146
+ }
147
+ setExtensions(extensions) {
148
+ this.extensions = { ...this.extensions, ...extensions };
149
+ this.setType();
150
+ return this;
151
+ }
152
+ setType() {
153
+ if (this.type)
154
+ return;
155
+ if (this.extensions.category) {
156
+ this.type = TokenTypes[this.extensions.category];
157
+ }
158
+ }
159
+ };
160
+ function cloneDeep(value) {
161
+ if (value instanceof Token) {
162
+ return value.clone();
163
+ }
164
+ if (Array.isArray(value)) {
165
+ return value.map((child) => cloneDeep(child));
166
+ }
167
+ if (typeof value === "object" && value !== null) {
168
+ return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, cloneDeep(v)]));
169
+ }
170
+ return value;
171
+ }
172
+ var TokenTypes = {
173
+ colors: "color",
174
+ spacing: "dimension",
175
+ sizing: "dimension",
176
+ shadows: "shadow",
177
+ fonts: "fontFamily",
178
+ fontSizes: "fontSize",
179
+ fontWeights: "fontWeight",
180
+ letterSpacings: "letterSpacing",
181
+ durations: "duration",
182
+ transitions: "transition",
183
+ radii: "borderRadius",
184
+ gradients: "gradient",
185
+ easings: "cubicBezier",
186
+ borders: "border",
187
+ components: "cti"
188
+ };
189
+
190
+ // src/dictionary.ts
191
+ var TokenDictionary = class {
192
+ allTokens = [];
193
+ prefix;
194
+ get allNames() {
195
+ return Array.from(new Set(this.allTokens.map((token) => token.name)));
196
+ }
197
+ constructor(options) {
198
+ const { tokens = {}, semanticTokens = {}, prefix } = options;
199
+ this.prefix = prefix;
200
+ (0, import_shared3.walkObject)(
201
+ tokens,
202
+ (token, path) => {
203
+ assertTokenFormat(token);
204
+ const category = path[0];
205
+ const name = path.join(".");
206
+ const node = new Token({ ...token, name, path });
207
+ node.setExtensions({
208
+ category,
209
+ prop: path.slice(1).join(".")
210
+ });
211
+ this.allTokens.push(node);
212
+ },
213
+ { stop: isToken }
214
+ );
215
+ (0, import_shared3.walkObject)(
216
+ semanticTokens,
217
+ (token, path) => {
218
+ assertTokenFormat(token);
219
+ const category = path[0];
220
+ const name = path.join(".");
221
+ const normalizedToken = (0, import_shared3.isString)(token.value) ? { value: { base: token.value } } : token;
222
+ const { value, ...restData } = normalizedToken;
223
+ const node = new Token({
224
+ ...restData,
225
+ name,
226
+ value: value.base || "",
227
+ path
228
+ });
229
+ node.setExtensions({
230
+ category,
231
+ conditions: value,
232
+ prop: path.slice(1).join(".")
233
+ });
234
+ this.allTokens.push(node);
235
+ },
236
+ { stop: isToken }
237
+ );
238
+ }
239
+ getByName = (0, import_shared3.memo)((name) => {
240
+ for (const token of this.allTokens) {
241
+ if (token.name === name)
242
+ return token;
243
+ }
244
+ });
245
+ transforms = /* @__PURE__ */ new Map();
246
+ registerTransform(...transforms2) {
247
+ transforms2.forEach((transform) => {
248
+ transform.type ||= "value";
249
+ transform.enforce ||= "pre";
250
+ this.transforms.set(transform.name, transform);
251
+ });
252
+ return this;
253
+ }
254
+ execTransform(name) {
255
+ const transform = this.transforms.get(name);
256
+ if (!transform)
257
+ return;
258
+ this.allTokens.forEach((token) => {
259
+ if (token.extensions.hasReference)
260
+ return;
261
+ if (typeof transform.match === "function" && !transform.match(token))
262
+ return;
263
+ const transformed = transform.transform(token, { prefix: this.prefix });
264
+ (0, import_ts_pattern.match)(transform).with({ type: "extensions" }, () => {
265
+ token.setExtensions(transformed);
266
+ }).with({ type: "value" }, () => {
267
+ token.value = transformed;
268
+ if (token.isComposite) {
269
+ token.originalValue = transformed;
270
+ }
271
+ }).otherwise(() => {
272
+ token[transform.type] = transformed;
273
+ });
274
+ });
275
+ }
276
+ transformTokens(enforce) {
277
+ this.transforms.forEach((transform) => {
278
+ if (transform.enforce === enforce) {
279
+ this.execTransform(transform.name);
280
+ }
281
+ });
282
+ return this;
283
+ }
284
+ middlewares = [];
285
+ registerMiddleware(...middlewares2) {
286
+ for (const middleware of middlewares2) {
287
+ middleware.enforce ||= "pre";
288
+ this.middlewares.push(middleware);
289
+ }
290
+ return this;
291
+ }
292
+ applyMiddlewares(enforce) {
293
+ this.middlewares.forEach((middleware) => {
294
+ if (middleware.enforce === enforce) {
295
+ middleware.transform(this, { prefix: this.prefix });
296
+ }
297
+ });
298
+ }
299
+ getReferences(value) {
300
+ const refs = getReferences(value);
301
+ return refs.map((ref) => this.getByName(ref)).filter(Boolean);
302
+ }
303
+ usesReference(value) {
304
+ if (!(0, import_shared3.isString)(value))
305
+ return false;
306
+ return this.getReferences(value).length > 0;
307
+ }
308
+ addReferences() {
309
+ this.allTokens.forEach((token) => {
310
+ if (!this.usesReference(token.value))
311
+ return;
312
+ const references = this.getReferences(token.value);
313
+ token.setExtensions({
314
+ references: references.reduce((object, reference) => {
315
+ object[reference.name] = reference;
316
+ return object;
317
+ }, {})
318
+ });
319
+ });
320
+ return this;
321
+ }
322
+ filter(pattern) {
323
+ const predicate = typeof pattern === "function" ? pattern : (0, import_ts_pattern.isMatching)(pattern);
324
+ return this.allTokens.filter(predicate);
325
+ }
326
+ addConditionalTokens() {
327
+ const tokens = [];
328
+ this.allTokens.forEach((token) => {
329
+ tokens.push(token);
330
+ const conditionalTokens = token.getConditionTokens();
331
+ if (conditionalTokens && conditionalTokens.length > 0) {
332
+ tokens.push(...conditionalTokens);
333
+ }
334
+ });
335
+ this.allTokens = tokens;
336
+ return this;
337
+ }
338
+ expandReferences() {
339
+ this.allTokens.forEach((token) => {
340
+ token.expandReferences();
341
+ });
342
+ return this;
343
+ }
344
+ build() {
345
+ this.applyMiddlewares("pre");
346
+ this.transformTokens("pre");
347
+ this.addConditionalTokens();
348
+ this.addReferences();
349
+ this.expandReferences();
350
+ this.applyMiddlewares("post");
351
+ this.transformTokens("post");
352
+ }
353
+ get isEmpty() {
354
+ return this.allTokens.length === 0;
355
+ }
356
+ };
357
+
358
+ // src/format.ts
359
+ var import_shared4 = require("@pandacss/shared");
360
+ var formats = {
361
+ groupByCondition(dictionary) {
362
+ const grouped = /* @__PURE__ */ new Map();
363
+ dictionary.allTokens.forEach((token) => {
364
+ const { condition } = token.extensions;
365
+ if (!condition)
366
+ return;
367
+ grouped.get(condition) || grouped.set(condition, /* @__PURE__ */ new Set());
368
+ grouped.set(condition, grouped.get(condition).add(token));
369
+ });
370
+ return grouped;
371
+ },
372
+ groupByPalette(dictionary) {
373
+ const grouped = /* @__PURE__ */ new Map();
374
+ dictionary.allTokens.forEach((token) => {
375
+ const { palette } = token.extensions;
376
+ if (!palette || token.extensions.isVirtual)
377
+ return;
378
+ grouped.get(palette) || grouped.set(palette, /* @__PURE__ */ new Map());
379
+ const virtualName = token.name.replace(palette, "palette");
380
+ const virtualToken = dictionary.getByName(virtualName);
381
+ if (!virtualToken)
382
+ return;
383
+ const virtualVar = virtualToken.extensions.var;
384
+ grouped.get(palette).set(virtualVar, token.extensions.varRef);
385
+ });
386
+ return grouped;
387
+ },
388
+ groupByCategory(dictionary) {
389
+ const grouped = /* @__PURE__ */ new Map();
390
+ dictionary.allTokens.forEach((token) => {
391
+ const { category, prop } = token.extensions;
392
+ if (!category)
393
+ return;
394
+ grouped.get(category) || grouped.set(category, /* @__PURE__ */ new Map());
395
+ grouped.set(category, grouped.get(category).set(prop, token));
396
+ });
397
+ return grouped;
398
+ },
399
+ getFlattenedValues(dictionary) {
400
+ const grouped = formats.groupByCategory(dictionary);
401
+ const result = /* @__PURE__ */ new Map();
402
+ grouped.forEach((tokens, category) => {
403
+ result.get(category) || result.set(category, /* @__PURE__ */ new Map());
404
+ tokens.forEach((token) => {
405
+ const { prop, varRef, isNegative } = token.extensions;
406
+ const value = isNegative ? token.isConditional ? token.originalValue : token.value : varRef;
407
+ result.set(category, result.get(category).set(prop, value));
408
+ });
409
+ });
410
+ return result;
411
+ },
412
+ getVars(dictionary) {
413
+ const grouped = formats.groupByCondition(dictionary);
414
+ const result = /* @__PURE__ */ new Map();
415
+ grouped.forEach((tokens, condition) => {
416
+ result.get(condition) || result.set(condition, /* @__PURE__ */ new Map());
417
+ tokens.forEach((token) => {
418
+ if (token.extensions.isNegative)
419
+ return;
420
+ result.get(condition).set(token.extensions.var, token.value);
421
+ });
422
+ });
423
+ return result;
424
+ },
425
+ createVarGetter(dictionary) {
426
+ const flatValues = mapToJson(formats.getFlattenedValues(dictionary));
427
+ return function getToken(path, fallback) {
428
+ return (0, import_shared4.getDotPath)(flatValues, path, fallback);
429
+ };
430
+ },
431
+ getPaletteValues(dictionary) {
432
+ const values = /* @__PURE__ */ new Set();
433
+ dictionary.allTokens.forEach((token) => {
434
+ const { palette } = token.extensions;
435
+ if (!palette || token.extensions.isVirtual)
436
+ return;
437
+ values.add(palette);
438
+ });
439
+ return values;
440
+ }
441
+ };
442
+
443
+ // src/middleware.ts
444
+ var import_shared5 = require("@pandacss/shared");
445
+ var addNegativeTokens = {
446
+ enforce: "pre",
447
+ transform(dictionary, { prefix }) {
448
+ const tokens = dictionary.filter({
449
+ extensions: { category: "spacing" }
450
+ });
451
+ tokens.forEach((token) => {
452
+ const originalPath = [...token.path];
453
+ const originalVar = (0, import_shared5.cssVar)(originalPath.join("-"), { prefix });
454
+ const node = token.clone();
455
+ node.setExtensions({
456
+ isNegative: true,
457
+ prop: `-${token.extensions.prop}`,
458
+ originalPath
459
+ });
460
+ node.value = import_shared5.calc.negate(originalVar);
461
+ const last = node.path.at(-1);
462
+ if (last != null) {
463
+ node.path[node.path.length - 1] = `-${last}`;
464
+ }
465
+ if (node.path) {
466
+ node.name = node.path.join(".");
467
+ }
468
+ dictionary.allTokens.push(node);
469
+ });
470
+ }
471
+ };
472
+ var addVirtualPalette = {
473
+ enforce: "post",
474
+ transform(dictionary) {
475
+ const tokens = dictionary.filter({
476
+ extensions: { category: "colors" }
477
+ });
478
+ const keys = /* @__PURE__ */ new Set();
479
+ const palettes = /* @__PURE__ */ new Map();
480
+ tokens.forEach((token) => {
481
+ const palette = token.extensions.palette;
482
+ if (!palette)
483
+ return;
484
+ const list = palettes.get(palette) || [];
485
+ keys.add(token.path.at(-1));
486
+ list.push(token);
487
+ palettes.set(palette, list);
488
+ });
489
+ keys.forEach((key) => {
490
+ const node = new Token({
491
+ name: `colors.palette.${key}`,
492
+ value: `{colors.palette.${key}}`,
493
+ path: ["colors", "palette", key]
494
+ });
495
+ node.setExtensions({
496
+ category: "colors",
497
+ prop: `palette.${key}`,
498
+ isVirtual: true
499
+ });
500
+ dictionary.allTokens.push(node);
501
+ });
502
+ dictionary.transformTokens("pre");
503
+ }
504
+ };
505
+ var removeEmptyTokens = {
506
+ enforce: "post",
507
+ transform(dictionary) {
508
+ dictionary.allTokens = dictionary.allTokens.filter((token) => token.value !== "");
509
+ }
510
+ };
511
+ var middlewares = [addNegativeTokens, addVirtualPalette, removeEmptyTokens];
512
+
513
+ // src/transform.ts
514
+ var import_shared6 = require("@pandacss/shared");
515
+ var import_ts_pattern2 = require("ts-pattern");
516
+ var isCompositeShadow = (0, import_ts_pattern2.isMatching)({
517
+ inset: import_ts_pattern2.P.optional(import_ts_pattern2.P.boolean),
518
+ offsetX: import_ts_pattern2.P.number,
519
+ offsetY: import_ts_pattern2.P.number,
520
+ blur: import_ts_pattern2.P.number,
521
+ spread: import_ts_pattern2.P.number,
522
+ color: import_ts_pattern2.P.string
523
+ });
524
+ var transformShadow = {
525
+ name: "tokens/shadow",
526
+ match: (token) => token.extensions.category === "shadows",
527
+ transform(token, { prefix }) {
528
+ if ((0, import_shared6.isString)(token.value)) {
529
+ return token.value;
530
+ }
531
+ if (Array.isArray(token.value)) {
532
+ return token.value.map((value) => this.transform({ value }, { prefix })).join(", ");
533
+ }
534
+ if (isCompositeShadow(token.value)) {
535
+ const { offsetX, offsetY, blur, spread, color, inset } = token.value;
536
+ return `${inset ? "inset " : ""}${offsetX}px ${offsetY}px ${blur}px ${spread}px ${color}`;
537
+ }
538
+ return token.value;
539
+ }
540
+ };
541
+ var isCompositeGradient = (0, import_ts_pattern2.isMatching)({
542
+ type: import_ts_pattern2.P.string,
543
+ placement: import_ts_pattern2.P.string,
544
+ stops: import_ts_pattern2.P.array({
545
+ color: import_ts_pattern2.P.string,
546
+ position: import_ts_pattern2.P.number
547
+ })
548
+ });
549
+ var transformGradient = {
550
+ name: "tokens/gradient",
551
+ match: (token) => token.extensions.category === "gradients",
552
+ transform(token) {
553
+ if ((0, import_shared6.isString)(token.value)) {
554
+ return token.value;
555
+ }
556
+ if (isCompositeGradient(token.value)) {
557
+ const { type, stops, placement } = token.value;
558
+ const rawStops = stops.map((stop) => {
559
+ const { color, position } = stop;
560
+ return `${color} ${position}px`;
561
+ });
562
+ return `${type}-gradient(${placement}, ${rawStops.join(", ")})`;
563
+ }
564
+ return token.value;
565
+ }
566
+ };
567
+ var transformFonts = {
568
+ name: "tokens/fonts",
569
+ match: (token) => token.extensions.category === "fonts",
570
+ transform(token) {
571
+ if (Array.isArray(token.value)) {
572
+ return token.value.join(", ");
573
+ }
574
+ return token.value;
575
+ }
576
+ };
577
+ var transformEasings = {
578
+ name: "tokens/easings",
579
+ match: (token) => token.extensions.category === "easings",
580
+ transform(token) {
581
+ if ((0, import_shared6.isString)(token.value)) {
582
+ return token.value;
583
+ }
584
+ return `cubic-bezier(${token.value.join(", ")})`;
585
+ }
586
+ };
587
+ var transformBorders = {
588
+ name: "tokens/borders",
589
+ match: (token) => token.extensions.category === "borders",
590
+ transform(token) {
591
+ if ((0, import_shared6.isString)(token.value)) {
592
+ return token.value;
593
+ }
594
+ const { width, style, color } = token.value;
595
+ return `${width}px ${style} ${color}`;
596
+ }
597
+ };
598
+ var addCssVariables = {
599
+ type: "extensions",
600
+ name: "tokens/css-var",
601
+ transform(token, { prefix }) {
602
+ const { isNegative, originalPath } = token.extensions;
603
+ const pathValue = isNegative ? originalPath : token.path;
604
+ const variable = (0, import_shared6.cssVar)(pathValue.join("-"), { prefix });
605
+ return {
606
+ var: variable.var,
607
+ varRef: variable.ref
608
+ };
609
+ }
610
+ };
611
+ var addConditionalCssVariables = {
612
+ enforce: "post",
613
+ name: "tokens/conditionals",
614
+ transform(token, { prefix }) {
615
+ const refs = getReferences(token.value);
616
+ if (!refs.length)
617
+ return token.value;
618
+ refs.forEach((ref) => {
619
+ const variable = (0, import_shared6.cssVar)(ref.split(".").join("-"), { prefix }).ref;
620
+ token.value = token.value.replace(`{${ref}}`, variable);
621
+ });
622
+ return token.value;
623
+ }
624
+ };
625
+ function getPaletteName(path) {
626
+ if (path.includes("colorPalette"))
627
+ return "";
628
+ const clone = [...path];
629
+ clone.pop();
630
+ clone.shift();
631
+ return clone.join(".");
632
+ }
633
+ var addPalette = {
634
+ type: "extensions",
635
+ name: "tokens/colors/palette",
636
+ match(token) {
637
+ return token.extensions.category === "colors";
638
+ },
639
+ transform(token) {
640
+ return { palette: getPaletteName(token.path) };
641
+ }
642
+ };
643
+ var transforms = [
644
+ transformShadow,
645
+ transformGradient,
646
+ transformFonts,
647
+ transformEasings,
648
+ transformBorders,
649
+ addCssVariables,
650
+ addConditionalCssVariables,
651
+ addPalette
652
+ ];
653
+
654
+ // src/create-dictionary.ts
655
+ var TokenDictionary2 = class extends TokenDictionary {
656
+ constructor(options) {
657
+ super(options);
658
+ this.registerTransform(...transforms);
659
+ this.registerMiddleware(...middlewares);
660
+ this.build();
661
+ }
662
+ get get() {
663
+ return formats.createVarGetter(this);
664
+ }
665
+ get conditionMap() {
666
+ return formats.groupByCondition(this);
667
+ }
668
+ get categoryMap() {
669
+ return formats.groupByCategory(this);
670
+ }
671
+ get values() {
672
+ return formats.getFlattenedValues(this);
673
+ }
674
+ get palettes() {
675
+ return (0, import_shared7.mapToJson)(formats.groupByPalette(this));
676
+ }
677
+ get vars() {
678
+ return formats.getVars(this);
679
+ }
680
+ getValue(path) {
681
+ const result = this.values.get(path);
682
+ if (result != null) {
683
+ return Object.fromEntries(result);
684
+ }
685
+ }
686
+ getTokenVar(path) {
687
+ const json = (0, import_shared7.mapToJson)(this.values);
688
+ return (0, import_shared7.getDotPath)(json, path);
689
+ }
690
+ };
691
+ // Annotate the CommonJS export names for ESM import in node:
692
+ 0 && (module.exports = {
693
+ TokenDictionary
694
+ });