@jirawatpyk/aura-react 4.15.0 → 4.17.0

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.
@@ -0,0 +1,791 @@
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/server.ts
21
+ var server_exports = {};
22
+ __export(server_exports, {
23
+ STRINGS: () => STRINGS,
24
+ brandScale: () => scale,
25
+ breakpoints: () => breakpoints,
26
+ colorSchemeScript: () => colorSchemeScript,
27
+ contrast: () => contrast,
28
+ createTheme: () => createTheme,
29
+ formatBytes: () => formatBytes,
30
+ formatDate: () => formatDate2,
31
+ fromISO: () => fromISO,
32
+ parseDate: () => parseDate,
33
+ parseTime: () => parseTime,
34
+ statusTone: () => toneFor,
35
+ toISO: () => toISO
36
+ });
37
+ module.exports = __toCommonJS(server_exports);
38
+
39
+ // src/dates.ts
40
+ var ERA = /^พ\.ศ\.\s?|\s?(BE|พ\.ศ\.)$/g;
41
+ var pad = function(n2) {
42
+ return (n2 < 10 ? "0" : "") + n2;
43
+ };
44
+ function toISO(d) {
45
+ return d ? d.getFullYear() + "-" + pad(d.getMonth() + 1) + "-" + pad(d.getDate()) : null;
46
+ }
47
+ function fromISO(s) {
48
+ if (!s) return null;
49
+ const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(s);
50
+ return m ? new Date(+m[1], +m[2] - 1, +m[3]) : null;
51
+ }
52
+ var TAGS = { th: "th-TH", en: "en-GB", sv: "sv-SE" };
53
+ function defaultCalendar(locale) {
54
+ return locale === "th" ? "buddhist" : "gregory";
55
+ }
56
+ function localeTag(locale, calendar) {
57
+ const cal = calendar || defaultCalendar(locale);
58
+ return (TAGS[locale || "en"] || "en-GB") + "-u-ca-" + (cal === "gregory" ? "gregory" : "buddhist");
59
+ }
60
+ var fmtCache = {};
61
+ var PRESETS = {
62
+ short: { day: "numeric", month: "short", year: "numeric" },
63
+ long: { day: "numeric", month: "long", year: "numeric" },
64
+ numeric: { day: "2-digit", month: "2-digit", year: "numeric" }
65
+ };
66
+ function fmt(tag, opts, d) {
67
+ const k = tag + JSON.stringify(opts);
68
+ if (!fmtCache[k]) fmtCache[k] = new Intl.DateTimeFormat(tag, opts);
69
+ return fmtCache[k].format(d);
70
+ }
71
+ function formatDate(iso, opts) {
72
+ const o = opts || {}, d = fromISO(iso);
73
+ if (!d) return "";
74
+ const f = typeof o.format === "object" ? o.format : PRESETS[o.format || "short"];
75
+ const loc = o.locale || "th";
76
+ return fmt(localeTag(loc, o.calendar || defaultCalendar(loc)), f, d).replace(ERA, "");
77
+ }
78
+ var MONTHS = null;
79
+ function monthIndex(word) {
80
+ if (!MONTHS) {
81
+ MONTHS = {};
82
+ ["th-TH", "en-GB", "sv-SE"].forEach(function(tag) {
83
+ ["short", "long"].forEach(function(w) {
84
+ for (let i = 0; i < 12; i++) {
85
+ const n2 = new Intl.DateTimeFormat(tag, { month: w }).format(new Date(2020, i, 1)).toLowerCase().replace(/\.$/, "");
86
+ MONTHS[n2] = i;
87
+ if (/^[a-zåäö]/.test(n2)) MONTHS[n2.slice(0, 3)] = i;
88
+ }
89
+ });
90
+ });
91
+ }
92
+ const k = word.toLowerCase().replace(/\.$/, "");
93
+ return MONTHS[k] != null ? MONTHS[k] : -1;
94
+ }
95
+ function parseDate(text) {
96
+ const s = String(text || "").trim();
97
+ let m = /^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(s), y, mo, d;
98
+ if (m) {
99
+ y = +m[1];
100
+ mo = +m[2];
101
+ d = +m[3];
102
+ } else if (m = /^(\d{1,2})[\/.\-](\d{1,2})[\/.\-](\d{4})$/.exec(s)) {
103
+ d = +m[1];
104
+ mo = +m[2];
105
+ y = +m[3];
106
+ } else if ((m = /^(\d{1,2})\s+(\S+)\s+(\d{4})$/.exec(s.replace(ERA, "").trim())) && monthIndex(m[2]) >= 0) {
107
+ d = +m[1];
108
+ mo = monthIndex(m[2]) + 1;
109
+ y = +m[3];
110
+ } else return null;
111
+ if (y >= 2400) y -= 543;
112
+ const dt = new Date(y, mo - 1, d);
113
+ return dt.getMonth() === mo - 1 && dt.getDate() === d ? toISO(dt) : null;
114
+ }
115
+
116
+ // src/text.ts
117
+ function formatBytes(n2) {
118
+ if (n2 == null) return "";
119
+ if (n2 < 1024) return n2 + " B";
120
+ let u = ["KB", "MB", "GB"], i = -1;
121
+ do {
122
+ n2 /= 1024;
123
+ i++;
124
+ } while (n2 >= 1024 && i < u.length - 1);
125
+ return (n2 >= 10 || Math.round(n2) === n2 ? Math.round(n2) : n2.toFixed(1)) + " " + u[i];
126
+ }
127
+ function pad2(n2) {
128
+ return (n2 < 10 ? "0" : "") + n2;
129
+ }
130
+ function parseTime(text) {
131
+ let s = String(text || "").trim().toLowerCase().replace(/\s*(น\.?|นาฬิกา)$/, "").trim();
132
+ const pm = /\s*(pm|p\.m\.)$/.test(s), am = /\s*(am|a\.m\.)$/.test(s);
133
+ s = s.replace(/\s*(am|pm|a\.m\.|p\.m\.)$/, "");
134
+ const m = /^(\d{1,2})(?:[:.](\d{2}))?$/.exec(s) || /^(\d{1,2})(\d{2})$/.exec(s);
135
+ if (!m) return null;
136
+ let hh = +m[1], mm = m[2] ? +m[2] : 0;
137
+ if (pm && hh < 12) hh += 12;
138
+ if (am && hh === 12) hh = 0;
139
+ if (hh > 23 || mm > 59) return null;
140
+ return pad2(hh) + ":" + pad2(mm);
141
+ }
142
+
143
+ // src/status.ts
144
+ var TONE_WORDS = {
145
+ ready: ["ready", "done", "complete", "completed", "approved", "live", "passed"],
146
+ progress: ["in progress", "in review", "review", "syncing", "running", "pending"],
147
+ blocked: ["blocked", "failed", "error", "rejected", "on hold", "cancelled"]
148
+ };
149
+ function toneFor(status) {
150
+ const s = String(status == null ? "" : status).trim().toLowerCase();
151
+ for (const t in TONE_WORDS) if (TONE_WORDS[t].indexOf(s) >= 0) return t;
152
+ return "neutral";
153
+ }
154
+
155
+ // src/strings.ts
156
+ var n = function(x) {
157
+ return Number(x).toLocaleString("en");
158
+ };
159
+ var nsv = function(x) {
160
+ return Number(x).toLocaleString("sv-SE");
161
+ };
162
+ var STRINGS = {
163
+ en: {
164
+ close: "Close",
165
+ dismiss: "Dismiss",
166
+ dismissToast: "Dismiss notification",
167
+ showPassword: "Show password",
168
+ filters: "Filters",
169
+ search: "Search",
170
+ clearFilters: "Clear all",
171
+ results: function(n2) {
172
+ return n2 === 1 ? "1 result" : n2.toLocaleString("en") + " results";
173
+ },
174
+ commandMenu: "Command menu",
175
+ commandPlaceholder: "Type a command or search\u2026",
176
+ commandHint: "\u2191\u2193 to move \xB7 Enter to open \xB7 Esc to close",
177
+ errorSummary: function(n2) {
178
+ return n2 === 1 ? "Fix 1 field to continue" : "Fix " + n2 + " fields to continue";
179
+ },
180
+ notifications: "Notifications",
181
+ mainNav: "Main",
182
+ breadcrumb: "Breadcrumb",
183
+ navigation: "Navigation",
184
+ openNav: "Open navigation",
185
+ collapseNav: "Collapse sidebar",
186
+ expandNav: "Expand sidebar",
187
+ searching: "Searching\u2026",
188
+ noMatches: "No matches",
189
+ clear: function(what) {
190
+ return "Clear " + (what || "selection");
191
+ },
192
+ keepTyping: function(total) {
193
+ return "Keep typing to narrow " + n(total) + " options";
194
+ },
195
+ sortAsc: "Sort ascending",
196
+ sortDesc: "Sort descending",
197
+ pin: "Pin to left",
198
+ unpin: "Unpin column",
199
+ moveLeft: "Move left",
200
+ moveRight: "Move right",
201
+ hideColumn: "Hide column",
202
+ resetColumns: "Reset columns",
203
+ selectRows: "Select rows",
204
+ selectAllRows: "Select all rows",
205
+ deselectAllRows: "Deselect all rows",
206
+ selectAll: "Select all",
207
+ selectRow: function(k) {
208
+ return "Select " + k;
209
+ },
210
+ selectedCount: function(c) {
211
+ return n(c) + " selected";
212
+ },
213
+ pinned: "Pinned",
214
+ columnOptions: function(label) {
215
+ return label + " column options";
216
+ },
217
+ column: function(label) {
218
+ return label ? label + " column" : "Column";
219
+ },
220
+ columns: "Columns",
221
+ showHideColumns: "Show or hide columns",
222
+ empty: "Nothing here yet",
223
+ loading: "Loading\u2026",
224
+ loadingRows: "Loading rows",
225
+ range: function(a, b, total) {
226
+ return a + "\u2013" + b + " of " + n(total);
227
+ },
228
+ page: function(p, total) {
229
+ return "Page " + p + " of " + total;
230
+ },
231
+ prevPage: "Previous page",
232
+ nextPage: "Next page",
233
+ rowCount: function(c) {
234
+ return n(c) + " rows";
235
+ },
236
+ actions: "Actions",
237
+ optional: "optional",
238
+ timePlaceholder: "hh:mm",
239
+ timeInvalid: "Type a time like 09:30",
240
+ timeOutOfRange: function(a, b) {
241
+ return "Choose a time between " + a + " and " + b;
242
+ },
243
+ dropFiles: "Drag files here or",
244
+ browse: "Choose files",
245
+ browseOne: "Choose a file",
246
+ remove: function(n2) {
247
+ return "Remove " + n2;
248
+ },
249
+ fileTooBig: function(max) {
250
+ return "Larger than " + max;
251
+ },
252
+ fileWrongType: "This file type isn\u2019t accepted",
253
+ tooManyFiles: function(n2) {
254
+ return "Up to " + n2 + " files";
255
+ },
256
+ colorScheme: "Colour scheme",
257
+ increase: "Increase",
258
+ decrease: "Decrease",
259
+ stepDone: "completed",
260
+ stepOf: function(i, total) {
261
+ return "Step " + i + " of " + total;
262
+ },
263
+ schemeLight: "Light",
264
+ schemeDark: "Dark",
265
+ schemeSystem: "System",
266
+ uploading: "Uploading\u2026",
267
+ images: "Images",
268
+ pagination: "Pagination",
269
+ pageN: function(p) {
270
+ return "Page " + p;
271
+ },
272
+ accepts: function(list, max) {
273
+ return [list, max && "up to " + max + " each"].filter(Boolean).join(", ");
274
+ }
275
+ },
276
+ th: {
277
+ close: "\u0E1B\u0E34\u0E14",
278
+ dismiss: "\u0E1B\u0E34\u0E14",
279
+ dismissToast: "\u0E1B\u0E34\u0E14\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19",
280
+ showPassword: "\u0E41\u0E2A\u0E14\u0E07\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19",
281
+ filters: "\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07",
282
+ search: "\u0E04\u0E49\u0E19\u0E2B\u0E32",
283
+ clearFilters: "\u0E25\u0E49\u0E32\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
284
+ results: function(n2) {
285
+ return n2.toLocaleString("en") + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
286
+ },
287
+ commandMenu: "\u0E40\u0E21\u0E19\u0E39\u0E04\u0E33\u0E2A\u0E31\u0E48\u0E07",
288
+ commandPlaceholder: "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E04\u0E33\u0E2A\u0E31\u0E48\u0E07\u0E2B\u0E23\u0E37\u0E2D\u0E04\u0E49\u0E19\u0E2B\u0E32\u2026",
289
+ commandHint: "\u2191\u2193 \u0E40\u0E25\u0E37\u0E48\u0E2D\u0E19 \xB7 Enter \u0E40\u0E1B\u0E34\u0E14 \xB7 Esc \u0E1B\u0E34\u0E14",
290
+ errorSummary: function(n2) {
291
+ return "\u0E41\u0E01\u0E49\u0E44\u0E02 " + n2 + " \u0E0A\u0E48\u0E2D\u0E07\u0E01\u0E48\u0E2D\u0E19\u0E44\u0E1B\u0E15\u0E48\u0E2D";
292
+ },
293
+ notifications: "\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19",
294
+ mainNav: "\u0E40\u0E21\u0E19\u0E39\u0E2B\u0E25\u0E31\u0E01",
295
+ breadcrumb: "\u0E40\u0E2A\u0E49\u0E19\u0E17\u0E32\u0E07",
296
+ navigation: "\u0E40\u0E21\u0E19\u0E39",
297
+ openNav: "\u0E40\u0E1B\u0E34\u0E14\u0E40\u0E21\u0E19\u0E39",
298
+ collapseNav: "\u0E22\u0E48\u0E2D\u0E41\u0E16\u0E1A\u0E40\u0E21\u0E19\u0E39",
299
+ expandNav: "\u0E02\u0E22\u0E32\u0E22\u0E41\u0E16\u0E1A\u0E40\u0E21\u0E19\u0E39",
300
+ searching: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E04\u0E49\u0E19\u0E2B\u0E32\u2026",
301
+ noMatches: "\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E17\u0E35\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E19",
302
+ clear: function(what) {
303
+ return "\u0E25\u0E49\u0E32\u0E07" + (what || "\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01");
304
+ },
305
+ keepTyping: function(total) {
306
+ return "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E01\u0E23\u0E2D\u0E07\u0E08\u0E32\u0E01 " + n(total) + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
307
+ },
308
+ sortAsc: "\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E19\u0E49\u0E2D\u0E22\u0E44\u0E1B\u0E21\u0E32\u0E01",
309
+ sortDesc: "\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E21\u0E32\u0E01\u0E44\u0E1B\u0E19\u0E49\u0E2D\u0E22",
310
+ pin: "\u0E15\u0E23\u0E36\u0E07\u0E44\u0E27\u0E49\u0E0B\u0E49\u0E32\u0E22",
311
+ unpin: "\u0E40\u0E25\u0E34\u0E01\u0E15\u0E23\u0E36\u0E07\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
312
+ moveLeft: "\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E0B\u0E49\u0E32\u0E22",
313
+ moveRight: "\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E02\u0E27\u0E32",
314
+ hideColumn: "\u0E0B\u0E48\u0E2D\u0E19\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
315
+ resetColumns: "\u0E04\u0E37\u0E19\u0E04\u0E48\u0E32\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
316
+ selectRows: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E16\u0E27",
317
+ selectAllRows: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",
318
+ deselectAllRows: "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01\u0E01\u0E32\u0E23\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",
319
+ selectAll: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
320
+ selectRow: function(k) {
321
+ return "\u0E40\u0E25\u0E37\u0E2D\u0E01 " + k;
322
+ },
323
+ selectedCount: function(c) {
324
+ return "\u0E40\u0E25\u0E37\u0E2D\u0E01 " + n(c) + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
325
+ },
326
+ pinned: "\u0E15\u0E23\u0E36\u0E07\u0E2D\u0E22\u0E39\u0E48",
327
+ columnOptions: function(label) {
328
+ return "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C " + label;
329
+ },
330
+ column: function(label) {
331
+ return label ? "\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C " + label : "\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C";
332
+ },
333
+ columns: "\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
334
+ showHideColumns: "\u0E41\u0E2A\u0E14\u0E07\u0E2B\u0E23\u0E37\u0E2D\u0E0B\u0E48\u0E2D\u0E19\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
335
+ empty: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
336
+ loading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u2026",
337
+ loadingRows: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
338
+ range: function(a, b, total) {
339
+ return a + "\u2013" + b + " \u0E08\u0E32\u0E01 " + n(total);
340
+ },
341
+ page: function(p, total) {
342
+ return "\u0E2B\u0E19\u0E49\u0E32 " + p + " / " + total;
343
+ },
344
+ prevPage: "\u0E2B\u0E19\u0E49\u0E32\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",
345
+ nextPage: "\u0E2B\u0E19\u0E49\u0E32\u0E16\u0E31\u0E14\u0E44\u0E1B",
346
+ rowCount: function(c) {
347
+ return n(c) + " \u0E41\u0E16\u0E27";
348
+ },
349
+ actions: "\u0E01\u0E32\u0E23\u0E08\u0E31\u0E14\u0E01\u0E32\u0E23",
350
+ optional: "\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A",
351
+ timePlaceholder: "\u0E0A\u0E0A:\u0E19\u0E19",
352
+ timeInvalid: "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A 09:30",
353
+ timeOutOfRange: function(a, b) {
354
+ return "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E40\u0E27\u0E25\u0E32\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07 " + a + "\u2013" + b + " \u0E19.";
355
+ },
356
+ dropFiles: "\u0E25\u0E32\u0E01\u0E44\u0E1F\u0E25\u0E4C\u0E21\u0E32\u0E27\u0E32\u0E07 \u0E2B\u0E23\u0E37\u0E2D",
357
+ browse: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E1F\u0E25\u0E4C",
358
+ browseOne: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E1F\u0E25\u0E4C",
359
+ remove: function(n2) {
360
+ return "\u0E25\u0E1A " + n2;
361
+ },
362
+ fileTooBig: function(max) {
363
+ return "\u0E44\u0E1F\u0E25\u0E4C\u0E43\u0E2B\u0E0D\u0E48\u0E40\u0E01\u0E34\u0E19 " + max;
364
+ },
365
+ fileWrongType: "\u0E44\u0E21\u0E48\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E44\u0E1F\u0E25\u0E4C\u0E0A\u0E19\u0E34\u0E14\u0E19\u0E35\u0E49",
366
+ tooManyFiles: function(n2) {
367
+ return "\u0E41\u0E19\u0E1A\u0E44\u0E14\u0E49\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + n2 + " \u0E44\u0E1F\u0E25\u0E4C";
368
+ },
369
+ colorScheme: "\u0E42\u0E2B\u0E21\u0E14\u0E2A\u0E35",
370
+ increase: "\u0E40\u0E1E\u0E34\u0E48\u0E21",
371
+ decrease: "\u0E25\u0E14",
372
+ stepDone: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E41\u0E25\u0E49\u0E27",
373
+ stepOf: function(i, total) {
374
+ return "\u0E02\u0E31\u0E49\u0E19\u0E17\u0E35\u0E48 " + i + " \u0E08\u0E32\u0E01 " + total;
375
+ },
376
+ schemeLight: "\u0E2A\u0E27\u0E48\u0E32\u0E07",
377
+ schemeDark: "\u0E21\u0E37\u0E14",
378
+ schemeSystem: "\u0E15\u0E32\u0E21\u0E23\u0E30\u0E1A\u0E1A",
379
+ uploading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u2026",
380
+ images: "\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E",
381
+ pagination: "\u0E40\u0E25\u0E02\u0E2B\u0E19\u0E49\u0E32",
382
+ pageN: function(p) {
383
+ return "\u0E2B\u0E19\u0E49\u0E32 " + p;
384
+ },
385
+ accepts: function(list, max) {
386
+ return [list, max && "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + max + " \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"].filter(Boolean).join(" \xB7 ");
387
+ }
388
+ },
389
+ sv: {
390
+ close: "St\xE4ng",
391
+ dismiss: "St\xE4ng",
392
+ dismissToast: "St\xE4ng aviseringen",
393
+ showPassword: "Visa l\xF6senord",
394
+ filters: "Filter",
395
+ search: "S\xF6k",
396
+ clearFilters: "Rensa alla",
397
+ results: function(n2) {
398
+ return n2 === 1 ? "1 tr\xE4ff" : n2.toLocaleString("sv-SE") + " tr\xE4ffar";
399
+ },
400
+ commandMenu: "Kommandomeny",
401
+ commandPlaceholder: "Skriv ett kommando eller s\xF6k\u2026",
402
+ commandHint: "\u2191\u2193 flytta \xB7 Enter \xF6ppna \xB7 Esc st\xE4ng",
403
+ errorSummary: function(n2) {
404
+ return n2 === 1 ? "R\xE4tta 1 f\xE4lt f\xF6r att forts\xE4tta" : "R\xE4tta " + n2 + " f\xE4lt f\xF6r att forts\xE4tta";
405
+ },
406
+ notifications: "Aviseringar",
407
+ mainNav: "Huvudmeny",
408
+ breadcrumb: "Br\xF6dsmulor",
409
+ navigation: "Navigering",
410
+ openNav: "\xD6ppna menyn",
411
+ collapseNav: "F\xE4ll ihop sidof\xE4ltet",
412
+ expandNav: "F\xE4ll ut sidof\xE4ltet",
413
+ searching: "S\xF6ker\u2026",
414
+ noMatches: "Inga tr\xE4ffar",
415
+ clear: function(what) {
416
+ return "Rensa " + (what || "urvalet");
417
+ },
418
+ keepTyping: function(total) {
419
+ return "Skriv mer f\xF6r att begr\xE4nsa " + nsv(total) + " alternativ";
420
+ },
421
+ sortAsc: "Sortera stigande",
422
+ sortDesc: "Sortera fallande",
423
+ pin: "F\xE4st till v\xE4nster",
424
+ unpin: "Lossa kolumnen",
425
+ moveLeft: "Flytta v\xE4nster",
426
+ moveRight: "Flytta h\xF6ger",
427
+ hideColumn: "D\xF6lj kolumnen",
428
+ resetColumns: "\xC5terst\xE4ll kolumner",
429
+ selectRows: "V\xE4lj rader",
430
+ selectAllRows: "V\xE4lj alla rader",
431
+ deselectAllRows: "Avmarkera alla rader",
432
+ selectAll: "V\xE4lj alla",
433
+ selectRow: function(k) {
434
+ return "V\xE4lj " + k;
435
+ },
436
+ selectedCount: function(c) {
437
+ return nsv(c) + " valda";
438
+ },
439
+ pinned: "F\xE4st",
440
+ columnOptions: function(label) {
441
+ return "Alternativ f\xF6r kolumnen " + label;
442
+ },
443
+ column: function(label) {
444
+ return label ? "Kolumnen " + label : "Kolumn";
445
+ },
446
+ columns: "Kolumner",
447
+ showHideColumns: "Visa eller d\xF6lj kolumner",
448
+ empty: "Inget h\xE4r \xE4nnu",
449
+ loading: "Laddar\u2026",
450
+ loadingRows: "Laddar rader",
451
+ range: function(a, b, total) {
452
+ return a + "\u2013" + b + " av " + nsv(total);
453
+ },
454
+ page: function(p, total) {
455
+ return "Sida " + p + " av " + total;
456
+ },
457
+ prevPage: "F\xF6reg\xE5ende sida",
458
+ nextPage: "N\xE4sta sida",
459
+ rowCount: function(c) {
460
+ return nsv(c) + " rader";
461
+ },
462
+ actions: "\xC5tg\xE4rder",
463
+ optional: "valfritt",
464
+ timePlaceholder: "tt:mm",
465
+ timeInvalid: "Skriv en tid som 09:30",
466
+ timeOutOfRange: function(a, b) {
467
+ return "V\xE4lj en tid mellan " + a + " och " + b;
468
+ },
469
+ dropFiles: "Dra filer hit eller",
470
+ browse: "V\xE4lj filer",
471
+ browseOne: "V\xE4lj en fil",
472
+ remove: function(n2) {
473
+ return "Ta bort " + n2;
474
+ },
475
+ fileTooBig: function(max) {
476
+ return "St\xF6rre \xE4n " + max;
477
+ },
478
+ fileWrongType: "Den h\xE4r filtypen godtas inte",
479
+ tooManyFiles: function(n2) {
480
+ return "H\xF6gst " + n2 + " filer";
481
+ },
482
+ colorScheme: "F\xE4rgl\xE4ge",
483
+ increase: "\xD6ka",
484
+ decrease: "Minska",
485
+ stepDone: "klart",
486
+ stepOf: function(i, total) {
487
+ return "Steg " + i + " av " + total;
488
+ },
489
+ schemeLight: "Ljust",
490
+ schemeDark: "M\xF6rkt",
491
+ schemeSystem: "System",
492
+ uploading: "Laddar upp\u2026",
493
+ images: "Bilder",
494
+ pagination: "Sidnumrering",
495
+ pageN: function(p) {
496
+ return "Sida " + p;
497
+ },
498
+ accepts: function(list, max) {
499
+ return [list, max && "h\xF6gst " + max + " per fil"].filter(Boolean).join(", ");
500
+ }
501
+ }
502
+ };
503
+
504
+ // src/theme.ts
505
+ function hexToRgb(hex) {
506
+ let h = String(hex).trim().replace("#", "");
507
+ if (h.length === 3)
508
+ h = h.split("").map(function(c) {
509
+ return c + c;
510
+ }).join("");
511
+ if (!/^[0-9a-f]{6}$/i.test(h)) throw new Error('createTheme: "' + hex + '" is not a #rgb or #rrggbb colour');
512
+ return [0, 2, 4].map(function(i) {
513
+ return parseInt(h.slice(i, i + 2), 16) / 255;
514
+ });
515
+ }
516
+ function rgbToHex(rgb) {
517
+ return "#" + rgb.map(function(v) {
518
+ const n2 = Math.round(Math.min(1, Math.max(0, v)) * 255);
519
+ return (n2 < 16 ? "0" : "") + n2.toString(16);
520
+ }).join("");
521
+ }
522
+ function lin(c) {
523
+ return c <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
524
+ }
525
+ function delin(c) {
526
+ return c <= 31308e-7 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;
527
+ }
528
+ function rgbToOklch(rgb) {
529
+ const r = lin(rgb[0]), g = lin(rgb[1]), b = lin(rgb[2]);
530
+ const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
531
+ const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
532
+ const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
533
+ const L = 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s;
534
+ const A = 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s;
535
+ const B = 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s;
536
+ return [L, Math.sqrt(A * A + B * B), (Math.atan2(B, A) * 180 / Math.PI + 360) % 360];
537
+ }
538
+ function oklchToRgbRaw(L, C, H) {
539
+ const a = C * Math.cos(H * Math.PI / 180), b = C * Math.sin(H * Math.PI / 180);
540
+ const l = Math.pow(L + 0.3963377774 * a + 0.2158037573 * b, 3);
541
+ const m = Math.pow(L - 0.1055613458 * a - 0.0638541728 * b, 3);
542
+ const s = Math.pow(L - 0.0894841775 * a - 1.291485548 * b, 3);
543
+ return [
544
+ 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,
545
+ -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,
546
+ -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s
547
+ ].map(delin);
548
+ }
549
+ function inGamut(rgb) {
550
+ return rgb.every(function(v) {
551
+ return v >= -5e-4 && v <= 1.0005;
552
+ });
553
+ }
554
+ function oklchToHex(L, C, H) {
555
+ let lo = 0, hi = C, rgb = oklchToRgbRaw(L, C, H);
556
+ if (inGamut(rgb)) return rgbToHex(rgb);
557
+ for (let i = 0; i < 24; i++) {
558
+ const mid = (lo + hi) / 2;
559
+ if (inGamut(oklchToRgbRaw(L, mid, H))) lo = mid;
560
+ else hi = mid;
561
+ }
562
+ return rgbToHex(oklchToRgbRaw(L, lo, H));
563
+ }
564
+ function luminance(hex) {
565
+ const c = hexToRgb(hex).map(lin);
566
+ return 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2];
567
+ }
568
+ function contrast(a, b) {
569
+ const x = luminance(a), y = luminance(b);
570
+ return (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05);
571
+ }
572
+ function mix(a, b, t) {
573
+ const x = hexToRgb(a), y = hexToRgb(b);
574
+ return rgbToHex(
575
+ x.map(function(v, i) {
576
+ return v + (y[i] - v) * t;
577
+ })
578
+ );
579
+ }
580
+ var STEPS = {
581
+ 50: [0.975, 0.18],
582
+ 100: [0.945, 0.3],
583
+ 200: [0.895, 0.5],
584
+ 300: [0.81, 0.72],
585
+ 400: [0.715, 0.9],
586
+ 500: [0.635, 1],
587
+ 600: [0.555, 1],
588
+ 700: [0.49, 0.95],
589
+ 800: [0.43, 0.85],
590
+ 900: [0.38, 0.72]
591
+ };
592
+ function scale(hex) {
593
+ const o = rgbToOklch(hexToRgb(hex)), C = Math.max(o[1], 0.02), out = {};
594
+ Object.keys(STEPS).forEach(function(k) {
595
+ out[k] = oklchToHex(STEPS[k][0], C * STEPS[k][1] / 0.95 * (o[1] < 0.03 ? 0.4 : 1), o[2]);
596
+ });
597
+ return out;
598
+ }
599
+ function fit(hex, grounds, target, dir) {
600
+ let o = rgbToOklch(hexToRgb(hex)), L = o[0], c = hex;
601
+ for (let i = 0; i < 80; i++) {
602
+ if (grounds.every(function(g) {
603
+ return contrast(c, g) >= target;
604
+ }))
605
+ return c;
606
+ L = Math.min(1, Math.max(0, L + dir * 0.01));
607
+ c = oklchToHex(L, o[1], o[2]);
608
+ }
609
+ return c;
610
+ }
611
+ function atLuminance(hex, Y) {
612
+ const o = rgbToOklch(hexToRgb(hex)), C = Math.max(o[1], 0.02);
613
+ let lo = 0, hi = 1, c = hex;
614
+ for (let i = 0; i < 30; i++) {
615
+ const mid = (lo + hi) / 2;
616
+ c = oklchToHex(mid, C, o[2]);
617
+ if (luminance(c) < Y) lo = mid;
618
+ else hi = mid;
619
+ }
620
+ return c;
621
+ }
622
+ var CHART_Y = { light: 0.075, dark: 0.46 };
623
+ var SEQ_Y = { light: [0.26, 0.165, 0.1, 0.055, 0.028], dark: [0.14, 0.22, 0.34, 0.5, 0.7] };
624
+ var CHART_2 = "#0a8b7a";
625
+ var ZINC = { 0: "#ffffff", 50: "#fafafa", 100: "#f4f4f5", 800: "#27272a", 900: "#18181b", 950: "#09090b" };
626
+ var INK = "#18181b";
627
+ function createTheme(opts) {
628
+ const o = opts || {};
629
+ if (!o.brand) throw new Error('createTheme: pass { brand: "#rrggbb" }');
630
+ const b = scale(o.brand), s = o.signal ? scale(o.signal) : null;
631
+ const lightGrounds = [ZINC[0], ZINC[50]], darkGrounds = [ZINC[900], ZINC[950]];
632
+ const L = {}, D = {};
633
+ L["fg-accent"] = fit(b[700], lightGrounds, 4.5, -1);
634
+ L["accent-violet"] = L["fg-accent"];
635
+ L["focus-ring"] = fit(b[700], lightGrounds.concat([b[50]]), 3, -1);
636
+ L["bg-selected"] = b[50];
637
+ L["status-progress-bg"] = b[100];
638
+ L["status-progress-fg"] = fit(b[800], [b[100]], 4.5, -1);
639
+ L["alert-info-bg"] = b[50];
640
+ L["alert-info-fg"] = fit(b[800], [b[50]], 4.5, -1);
641
+ L["alert-info-border"] = b[200];
642
+ L["mesh-from"] = b[400];
643
+ L["chart-1"] = atLuminance(o.brand, CHART_Y.light);
644
+ D["chart-1"] = atLuminance(o.brand, CHART_Y.dark);
645
+ SEQ_Y.light.forEach(function(y, i) {
646
+ L["chart-seq-" + (i + 1)] = atLuminance(o.brand, y);
647
+ });
648
+ SEQ_Y.dark.forEach(function(y, i) {
649
+ D["chart-seq-" + (i + 1)] = atLuminance(o.brand, y);
650
+ });
651
+ D["fg-accent"] = fit(b[300], darkGrounds, 4.5, 1);
652
+ D["accent-violet"] = fit(b[400], darkGrounds, 3, 1);
653
+ D["focus-ring"] = fit(b[400], darkGrounds, 3, 1);
654
+ D["bg-selected"] = mix(ZINC[900], b[500], 0.16);
655
+ D["alert-info-bg"] = D["bg-selected"];
656
+ D["alert-info-fg"] = fit(b[300], [D["alert-info-bg"]], 4.5, 1);
657
+ D["alert-info-border"] = mix(ZINC[900], b[400], 0.4);
658
+ D["status-progress-bg"] = mix(ZINC[900], b[500], 0.2);
659
+ D["status-progress-fg"] = fit(b[300], [D["status-progress-bg"]], 4.5, 1);
660
+ if (s) {
661
+ L["accent-dot"] = s[200];
662
+ L["accent-lime"] = s[200];
663
+ L["mesh-to"] = s[200];
664
+ D["accent-dot"] = s[200];
665
+ D["accent-lime"] = s[200];
666
+ D["mesh-to"] = s[200];
667
+ }
668
+ const shadowLight = INK, shadowDark = D["accent-violet"];
669
+ if (o.primary === "brand") {
670
+ L["button-primary-bg"] = fit(b[600], [ZINC[0]], 4.5, -1);
671
+ L["button-primary-fg"] = ZINC[0];
672
+ L["button-primary-bg-hover"] = fit(b[700], [ZINC[0]], 4.5, -1);
673
+ D["button-primary-bg"] = fit(b[400], [ZINC[900]], 4.5, 1);
674
+ D["button-primary-fg"] = ZINC[900];
675
+ D["button-primary-bg-hover"] = fit(b[300], [ZINC[900]], 4.5, 1);
676
+ }
677
+ L["shadow-creative"] = "4px 4px 0px " + shadowLight;
678
+ L["shadow-creative-hover"] = "6px 6px 0px " + shadowLight;
679
+ L["card-shadow-creative"] = "8px 8px 0px " + shadowLight;
680
+ D["shadow-creative"] = "4px 4px 0px " + shadowDark;
681
+ D["shadow-creative-hover"] = "6px 6px 0px " + shadowDark;
682
+ D["card-shadow-creative"] = "8px 8px 0px " + shadowDark;
683
+ const checks = [];
684
+ function check(theme, fg, bg, target, fgHex, bgHex) {
685
+ const r = contrast(fgHex, bgHex);
686
+ checks.push({
687
+ theme,
688
+ pair: fg + " on " + bg,
689
+ ratio: Math.round(r * 100) / 100,
690
+ target,
691
+ pass: r >= target - 5e-3
692
+ });
693
+ }
694
+ [
695
+ ["bg-surface", ZINC[0]],
696
+ ["bg-canvas", ZINC[50]],
697
+ ["bg-selected", L["bg-selected"]]
698
+ ].forEach(function(g) {
699
+ check("light", "fg-accent", g[0], 4.5, L["fg-accent"], g[1]);
700
+ check("light", "focus-ring", g[0], 3, L["focus-ring"], g[1]);
701
+ });
702
+ [
703
+ ["bg-surface", ZINC[900]],
704
+ ["bg-canvas", ZINC[950]],
705
+ ["bg-selected", D["bg-selected"]]
706
+ ].forEach(function(g) {
707
+ check("dark", "fg-accent", g[0], 4.5, D["fg-accent"], g[1]);
708
+ check("dark", "focus-ring", g[0], 3, D["focus-ring"], g[1]);
709
+ });
710
+ [
711
+ ["light", ZINC[0], L],
712
+ ["light", ZINC[50], L],
713
+ ["dark", ZINC[900], D],
714
+ ["dark", ZINC[950], D]
715
+ ].forEach(function(g) {
716
+ const t = g[0], ground = g[1], m = g[2], name = ground === ZINC[0] || ground === ZINC[900] ? "bg-surface" : "bg-canvas";
717
+ ["chart-1", "chart-seq-1", "chart-seq-5"].forEach(function(k) {
718
+ check(t, k, name, 3, m[k], ground);
719
+ });
720
+ });
721
+ check("light", "chart-1", "chart-2 (lightness step)", 1.8, L["chart-1"], CHART_2);
722
+ check("dark", "chart-1", "chart-2 (lightness step)", 1.8, D["chart-1"], CHART_2);
723
+ check("light", "fg-primary", "bg-selected", 4.5, INK, L["bg-selected"]);
724
+ check("dark", "fg-primary", "bg-selected", 4.5, "#ffffff", D["bg-selected"]);
725
+ check("light", "status-progress-fg", "status-progress-bg", 4.5, L["status-progress-fg"], L["status-progress-bg"]);
726
+ check("dark", "status-progress-fg", "status-progress-bg", 4.5, D["status-progress-fg"], D["status-progress-bg"]);
727
+ check("light", "alert-info-fg", "alert-info-bg", 4.5, L["alert-info-fg"], L["alert-info-bg"]);
728
+ check("dark", "alert-info-fg", "alert-info-bg", 4.5, D["alert-info-fg"], D["alert-info-bg"]);
729
+ if (o.primary === "brand") {
730
+ check("light", "button-primary-fg", "button-primary-bg", 4.5, L["button-primary-fg"], L["button-primary-bg"]);
731
+ check(
732
+ "light",
733
+ "button-primary-fg",
734
+ "button-primary-bg-hover",
735
+ 4.5,
736
+ L["button-primary-fg"],
737
+ L["button-primary-bg-hover"]
738
+ );
739
+ check("dark", "button-primary-fg", "button-primary-bg", 4.5, D["button-primary-fg"], D["button-primary-bg"]);
740
+ check(
741
+ "dark",
742
+ "button-primary-fg",
743
+ "button-primary-bg-hover",
744
+ 4.5,
745
+ D["button-primary-fg"],
746
+ D["button-primary-bg-hover"]
747
+ );
748
+ }
749
+ if (s) check("light", "ink", "accent-lime (signal)", 4.5, INK, s[200]);
750
+ function css(selector) {
751
+ const light = selector ? selector : ':root, [data-theme="light"]';
752
+ const dark = selector ? selector + ".dark, .dark " + selector + ", " + selector + '[data-theme="dark"], [data-theme="dark"] ' + selector : '.dark, [data-theme="dark"]';
753
+ const system = selector ? '[data-theme="system"] ' + selector + ", " + selector + '[data-theme="system"]' : '[data-theme="system"]';
754
+ function block(sel, m) {
755
+ return sel + " {\n" + Object.keys(m).map(function(k) {
756
+ return " --aura-" + k + ": " + m[k] + ";";
757
+ }).join("\n") + "\n}";
758
+ }
759
+ return "/* AURA theme" + (o.name ? ' "' + o.name + '"' : "") + ": brand " + o.brand + (o.signal ? ", signal " + o.signal : "") + (o.primary === "brand" ? ", brand primary buttons" : "") + ". Load after aura.css. Generated by createTheme. */\n" + block(light, L) + "\n" + block(dark, D) + "\n@media (prefers-color-scheme: dark) {\n" + block(system, D) + "\n}\n";
760
+ }
761
+ return {
762
+ name: o.name || null,
763
+ brand: b,
764
+ signal: s,
765
+ light: L,
766
+ dark: D,
767
+ checks,
768
+ ok: checks.every(function(c) {
769
+ return c.pass;
770
+ }),
771
+ css
772
+ };
773
+ }
774
+
775
+ // src/colorSchemeScript.ts
776
+ var DEFAULT_KEY = "aura-color-scheme";
777
+ function colorSchemeScript(options) {
778
+ const key = JSON.stringify(options && options.storageKey || DEFAULT_KEY);
779
+ const fallback = JSON.stringify(options && options.defaultScheme || "system");
780
+ return "(function(){try{var s=localStorage.getItem(" + key + ");if(s!=='light'&&s!=='dark'&&s!=='system')s=" + fallback + `;var d=document.documentElement;d.setAttribute("data-theme",s);var dark=s==='dark'||(s==='system'&&window.matchMedia('(prefers-color-scheme: dark)').matches);d.classList.toggle("dark",dark);}catch(e){}})();`;
781
+ }
782
+
783
+ // src/breakpoints.ts
784
+ var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
785
+
786
+ // src/server.ts
787
+ function formatDate2(iso, opts) {
788
+ const o = Object.assign({}, opts);
789
+ if (!o.locale) o.locale = "en";
790
+ return formatDate(iso, o);
791
+ }