@feedmepos/mf-miniprogram-v2 0.2.8-dev.2 → 0.2.8-dev.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/{App-C8Vn8LvE.js → App-dgkwfArX.js} +337 -338
  2. package/dist/{BrandFontPicker-JHyoGusq.js → BrandFontPicker-CF3O3meB.js} +1 -1
  3. package/dist/BrandKitView-CdLMBZKd.js +276 -0
  4. package/dist/ControlPlaneView-fc2wIqfk.js +27162 -0
  5. package/dist/{EcosystemView-XP9IZ9wn.js → EcosystemView-DHtS5IDN.js} +115 -93
  6. package/dist/MobileProjectDialog-Bt6r-bHC.js +446 -0
  7. package/dist/MobileProjectsView-Dvj7YKlO.js +237 -0
  8. package/dist/ModuleCenterView-t8rhd419.js +283 -0
  9. package/dist/ModuleDetailView-CcqJ4Hfu.js +296 -0
  10. package/dist/{PagesView-DzDqCd8N.js → PagesView-D0RMTyqw.js} +2 -2
  11. package/dist/{PlatformUnavailableView-CdHjkolw.js → PlatformUnavailableView-OHEJAztd.js} +1 -1
  12. package/dist/{PortalSettingsView-Df5jChmi.js → PortalSettingsView-B68s6fiS.js} +3 -3
  13. package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-DMm_s9ua.js +41 -0
  14. package/dist/TemplateCenterView-Cpr39Y5S.js +515 -0
  15. package/dist/{WorkspaceEntryView-DQkYJWdf.js → WorkspaceEntryView-gM7RX5BV.js} +2 -2
  16. package/dist/app.js +15 -15
  17. package/dist/{controlPlane-sXaC6pAh.js → controlPlane-DR5ykj4d.js} +8 -8
  18. package/dist/{adminAccess-D2K-L-Vt.js → localPreference-Do4VKtxT.js} +35 -35
  19. package/dist/package.json +1 -1
  20. package/dist/{portalContext-DV-6uUwp.js → portalContext-BeKN8Bcx.js} +2 -2
  21. package/dist/portalNavigation-DLcC7Koh.js +43 -0
  22. package/dist/{routes-CeuodIgg.js → routes-B9oMJsaM.js} +45 -27
  23. package/dist/style.css +1 -1
  24. package/dist/{useBrandKit-CXLIXo5j.js → useBrandKit-MkgkEuIX.js} +265 -233
  25. package/dist/useModuleCatalog-Daw8KA--.js +147 -0
  26. package/package.json +1 -1
  27. package/dist/AppTemplatePicker.vue_vue_type_script_setup_true_lang-LE_aKvfg.js +0 -198
  28. package/dist/BrandKitView-Dlt_ifI0.js +0 -249
  29. package/dist/ControlPlaneView-qDA8RgiR.js +0 -25317
  30. package/dist/MobileProjectsView-aAyHV5G-.js +0 -333
  31. package/dist/ModuleCenterView-C6mCPATr.js +0 -147
  32. package/dist/ModuleDetailView-CSfMF0Uo.js +0 -189
  33. package/dist/StatusBadge.vue_vue_type_script_setup_true_lang-CMgQ0bd_.js +0 -30
  34. package/dist/TemplateCenterView-DrWImUYO.js +0 -425
  35. package/dist/portalNavigation-C29ihtq_.js +0 -38
  36. package/dist/useModuleCatalog-Cep-pzWO.js +0 -124
@@ -1,9 +1,9 @@
1
- import { a as xt, e as jt } from "./index-CIJWcl_6.js";
2
- import { computed as nt, reactive as Et } from "vue";
3
- import { h as j, e as ot } from "./controlPlane-sXaC6pAh.js";
4
- import { useCoreStore as At } from "@feedmepos/mf-common";
5
- import { g as Nt, c as Tt } from "./_commonjsHelpers-DaMA6jEr.js";
6
- const it = [
1
+ import { a as At, e as Nt } from "./index-CIJWcl_6.js";
2
+ import { computed as L, reactive as Tt } from "vue";
3
+ import { h as R, e as it } from "./controlPlane-DR5ykj4d.js";
4
+ import { useCoreStore as kt } from "@feedmepos/mf-common";
5
+ import { g as Ct, c as Mt } from "./_commonjsHelpers-DaMA6jEr.js";
6
+ const at = [
7
7
  "Inter",
8
8
  "Roboto",
9
9
  "Open Sans",
@@ -26,18 +26,18 @@ const it = [
26
26
  "Noto Sans SC",
27
27
  "Noto Sans TC"
28
28
  ];
29
- function kt(e) {
29
+ function It(e) {
30
30
  var i;
31
31
  return ((i = e.split(",")[0]) == null ? void 0 : i.trim().replace(/^(['"])(.*)\1$/, "$2")) || "App default";
32
32
  }
33
- function ge(e) {
33
+ function Fe(e) {
34
34
  const i = ["Playfair Display", "Merriweather", "Lora"].includes(e) ? "serif" : "sans-serif";
35
35
  return `'${e}', ${i === "serif" ? "" : "system-ui, "}${i}`;
36
36
  }
37
- function vt(e) {
37
+ function yt(e) {
38
38
  return `https://fonts.googleapis.com/css2?${[...new Set(e)].sort().map((s) => `family=${encodeURIComponent(s)}:wght@400;500;600;700`).join("&")}&display=swap`;
39
39
  }
40
- function Mt(e) {
40
+ function Bt(e) {
41
41
  if (!e || typeof e != "object" || !("stylesheet" in e) || typeof e.stylesheet != "string")
42
42
  return !1;
43
43
  try {
@@ -45,7 +45,7 @@ function Mt(e) {
45
45
  if (i.hostname !== "fonts.googleapis.com" || !["/css", "/css2"].includes(i.pathname)) return !1;
46
46
  const s = i.searchParams.getAll("family").flatMap((r) => r.split("|"));
47
47
  return s.length > 0 && s.every(
48
- (r) => it.some((n) => {
48
+ (r) => at.some((n) => {
49
49
  var o;
50
50
  return n.toLowerCase() === ((o = r.split(":")[0]) == null ? void 0 : o.trim().toLowerCase());
51
51
  })
@@ -54,26 +54,26 @@ function Mt(e) {
54
54
  return !1;
55
55
  }
56
56
  }
57
- function Ct(e, i) {
57
+ function Dt(e, i) {
58
58
  const s = ["brand", "heading", "body"].flatMap(
59
59
  (n) => (i[n] || "").split(",").flatMap((o) => {
60
- const u = it.find((d) => d.toLowerCase() === kt(o).toLowerCase());
60
+ const u = at.find((d) => d.toLowerCase() === It(o).toLowerCase());
61
61
  return u ? [u] : [];
62
62
  })
63
- ), r = Array.isArray(e) ? e.filter((n) => !Mt(n)) : [];
64
- return s.length ? [...r, { stylesheet: vt(s) }] : r;
63
+ ), r = Array.isArray(e) ? e.filter((n) => !Bt(n)) : [];
64
+ return s.length ? [...r, { stylesheet: yt(s) }] : r;
65
65
  }
66
- const z = /* @__PURE__ */ new Map();
67
- function ve(e) {
68
- if (!it.some((r) => r === e)) return Promise.resolve();
69
- const i = z.get(e);
66
+ const Q = /* @__PURE__ */ new Map();
67
+ function Oe(e) {
68
+ if (!at.some((r) => r === e)) return Promise.resolve();
69
+ const i = Q.get(e);
70
70
  if (i) return i;
71
71
  const s = new Promise((r, n) => {
72
72
  const o = document.createElement("link");
73
- o.rel = "stylesheet", o.href = vt([e]);
73
+ o.rel = "stylesheet", o.href = yt([e]);
74
74
  let u = !1;
75
75
  const d = window.setTimeout(() => v(), 15e3), v = () => {
76
- u || (u = !0, window.clearTimeout(d), o.remove(), z.delete(e), n(new Error(`Could not load ${e}`)));
76
+ u || (u = !0, window.clearTimeout(d), o.remove(), Q.delete(e), n(new Error(`Could not load ${e}`)));
77
77
  };
78
78
  o.onerror = v, o.onload = () => {
79
79
  document.fonts.load(`400 16px "${e}"`).then((m) => {
@@ -84,13 +84,13 @@ function ve(e) {
84
84
  }, v);
85
85
  }, document.head.append(o);
86
86
  });
87
- return z.set(e, s), s;
87
+ return Q.set(e, s), s;
88
88
  }
89
- var yt = { exports: {} };
89
+ var mt = { exports: {} };
90
90
  (function(e, i) {
91
91
  (function(s, r) {
92
92
  e.exports = r();
93
- })(Tt, function() {
93
+ })(Mt, function() {
94
94
  return function(s) {
95
95
  var r = {};
96
96
  function n(o) {
@@ -144,11 +144,11 @@ var yt = { exports: {} };
144
144
  };
145
145
  }
146
146
  n.r(r), n.d(r, "default", function() {
147
- return Ft;
147
+ return xt;
148
148
  }), n.d(r, "compare", function() {
149
149
  return ct;
150
150
  }), n.d(r, "comparable", function() {
151
- return X;
151
+ return Y;
152
152
  });
153
153
  var d = u("Array"), v = u("Object"), m = u("Function");
154
154
  function b(t, a) {
@@ -170,7 +170,7 @@ var yt = { exports: {} };
170
170
  return !0;
171
171
  };
172
172
  }
173
- function S(t, a, l, f) {
173
+ function F(t, a, l, f) {
174
174
  return t.validate(t.options, a, l, f);
175
175
  }
176
176
  var _ = {
@@ -215,7 +215,7 @@ var yt = { exports: {} };
215
215
  },
216
216
  $or: function(t, a, l, f) {
217
217
  for (var p = 0, h = t.length; p < h; p++)
218
- if (S(b(t, p), a, l, f)) return !0;
218
+ if (F(b(t, p), a, l, f)) return !0;
219
219
  return !1;
220
220
  },
221
221
  $nor: function(t, a, l, f) {
@@ -223,7 +223,7 @@ var yt = { exports: {} };
223
223
  },
224
224
  $and: function(t, a, l, f) {
225
225
  for (var p = 0, h = t.length; p < h; p++)
226
- if (!S(b(t, p), a, l, f)) return !1;
226
+ if (!F(b(t, p), a, l, f)) return !1;
227
227
  return !0;
228
228
  },
229
229
  $regex: w(function(t, a) {
@@ -235,14 +235,14 @@ var yt = { exports: {} };
235
235
  $elemMatch: function(t, a, l, f) {
236
236
  return d(a) ? !!~function(p, h) {
237
237
  for (var g = 0; g < p.length; g++)
238
- if (b(p, g), S(h, b(p, g))) return g;
238
+ if (b(p, g), F(h, b(p, g))) return g;
239
239
  return -1;
240
- }(a, t) : S(t, a, l, f);
240
+ }(a, t) : F(t, a, l, f);
241
241
  },
242
242
  $exists: function(t, a, l, f) {
243
243
  return f.hasOwnProperty(l) === t;
244
244
  }
245
- }, R = {
245
+ }, x = {
246
246
  $eq: function(t, a, l) {
247
247
  var f = l.comparable, p = l.compare;
248
248
  return t instanceof RegExp ? w(function(h) {
@@ -295,7 +295,7 @@ var yt = { exports: {} };
295
295
  for (y = t.length; y--; ) if (t[y] == null) return !0;
296
296
  }
297
297
  for (y = t.length; y--; ) {
298
- var g = S(lt(b(t, y), l), h, y, t);
298
+ var g = F(lt(b(t, y), l), h, y, t);
299
299
  if (g && String(g) !== "[object Object]" && String(h) !== "[object Object]")
300
300
  return !0;
301
301
  }
@@ -307,7 +307,7 @@ var yt = { exports: {} };
307
307
  };
308
308
  },
309
309
  $nin: function(t, a, l) {
310
- var f = R.$in(t, a, l);
310
+ var f = x.$in(t, a, l);
311
311
  return function(p, h, g, y) {
312
312
  return !f(p, h, g, y);
313
313
  };
@@ -318,7 +318,7 @@ var yt = { exports: {} };
318
318
  };
319
319
  },
320
320
  $ne: function(t, a, l) {
321
- var f = R.$eq(t, a, l);
321
+ var f = x.$eq(t, a, l);
322
322
  return N(function(p, h, g, y) {
323
323
  return !f(p, h, g, y);
324
324
  });
@@ -327,7 +327,7 @@ var yt = { exports: {} };
327
327
  return t.map(T(l));
328
328
  },
329
329
  $all: function(t, a, l) {
330
- return R.$and(t, a, l);
330
+ return x.$and(t, a, l);
331
331
  },
332
332
  $or: function(t, a, l) {
333
333
  return t.map(T(l));
@@ -338,7 +338,7 @@ var yt = { exports: {} };
338
338
  $not: function(t, a, l) {
339
339
  var f = T(l)(t);
340
340
  return function(p, h, g) {
341
- return !S(f, p, h, g);
341
+ return !F(f, p, h, g);
342
342
  };
343
343
  },
344
344
  $type: function(t) {
@@ -362,30 +362,30 @@ var yt = { exports: {} };
362
362
  return !!t;
363
363
  }
364
364
  };
365
- function E(t, a) {
365
+ function j(t, a) {
366
366
  return { options: t, validate: a };
367
367
  }
368
- function Pt(t, a) {
368
+ function _t(t, a) {
369
369
  var l = t.keyPath, f = t.child, p = t.query, h = [];
370
- if (function ft(A, M, C, _t, W) {
371
- if (C === M.length || A == null)
372
- return void W.push([A, M[C - 1], _t]);
373
- var dt = b(M, C);
370
+ if (function ft(A, M, I, Et, z) {
371
+ if (I === M.length || A == null)
372
+ return void z.push([A, M[I - 1], Et]);
373
+ var dt = b(M, I);
374
374
  if (d(A) && isNaN(Number(dt)))
375
- for (var Y = 0, Rt = A.length; Y < Rt; Y++) ft(b(A, Y), M, C, A, W);
376
- else ft(b(A, dt), M, C + 1, A, W);
375
+ for (var V = 0, jt = A.length; V < jt; V++) ft(b(A, V), M, I, A, z);
376
+ else ft(b(A, dt), M, I + 1, A, z);
377
377
  }(a, l, 0, a, h), h.length === 1) {
378
378
  var g = h[0];
379
- return S(f, g[0], g[1], g[2]);
379
+ return F(f, g[0], g[1], g[2]);
380
380
  }
381
- for (var y = p && p.$ne !== void 0, O = y, P = 0; P < h.length; P++) {
382
- var x = h[P], K = S(f, x[0], x[1], x[2]);
383
- y ? O &= K : O |= K;
381
+ for (var y = p && p.$ne !== void 0, O = y, S = 0; S < h.length; S++) {
382
+ var E = h[S], J = F(f, E[0], E[1], E[2]);
383
+ y ? O &= J : O |= J;
384
384
  }
385
385
  return O;
386
386
  }
387
- function $t(t, a, l) {
388
- return E({ keyPath: t, child: a, query: l }, Pt);
387
+ function Rt(t, a, l) {
388
+ return j({ keyPath: t, child: a, query: l }, _t);
389
389
  }
390
390
  function T(t) {
391
391
  var a = t.comparable, l = t.expressions, f = function(g) {
@@ -395,42 +395,42 @@ var yt = { exports: {} };
395
395
  g = a(g);
396
396
  var y = [];
397
397
  for (var O in g) {
398
- var P = g[O];
398
+ var S = g[O];
399
399
  if (O !== "$options") {
400
- var x = _[O] || t && l && l[O];
401
- if (x) R[O] && (P = R[O](P, g, t)), y.push(E(a(P), x));
400
+ var E = _[O] || t && l && l[O];
401
+ if (E) x[O] && (S = x[O](S, g, t)), y.push(j(a(S), E));
402
402
  else {
403
403
  if (O.charCodeAt(0) === 36)
404
404
  throw new Error("Unknown operation " + O);
405
- var K = O.split(".");
406
- y.push($t(K, h(P), P));
405
+ var J = O.split(".");
406
+ y.push(Rt(J, h(S), S));
407
407
  }
408
408
  }
409
409
  }
410
- return y.length === 1 ? y[0] : E(y, _.$and);
410
+ return y.length === 1 ? y[0] : j(y, _.$and);
411
411
  }, h = function(g) {
412
- return g = f(g), function y(O, P) {
413
- if (!v(O)) return P;
414
- for (var x in O) P.push(x), y(O[x], P);
415
- return P;
416
- }(g, []).join(",").search(/[$.]/) === -1 ? E(g, D) : p(g);
412
+ return g = f(g), function y(O, S) {
413
+ if (!v(O)) return S;
414
+ for (var E in O) S.push(E), y(O[E], S);
415
+ return S;
416
+ }(g, []).join(",").search(/[$.]/) === -1 ? j(g, U) : p(g);
417
417
  };
418
418
  return function(g) {
419
419
  return p(f(g));
420
420
  };
421
421
  }
422
- function D(t, a) {
422
+ function U(t, a) {
423
423
  if (Object.prototype.toString.call(t) !== Object.prototype.toString.call(a))
424
424
  return !1;
425
425
  if (v(t)) {
426
426
  if (Object.keys(t).length !== Object.keys(a).length) return !1;
427
- for (var l in t) if (!D(t[l], a[l])) return !1;
427
+ for (var l in t) if (!U(t[l], a[l])) return !1;
428
428
  return !0;
429
429
  }
430
430
  if (d(t)) {
431
431
  if (t.length !== a.length) return !1;
432
432
  for (var f = 0, p = t.length; f < p; f++)
433
- if (!D(t[f], a[f])) return !1;
433
+ if (!U(t[f], a[f])) return !1;
434
434
  return !0;
435
435
  }
436
436
  return t === a;
@@ -440,55 +440,55 @@ var yt = { exports: {} };
440
440
  return a && a.select && (l = {
441
441
  options: l,
442
442
  validate: function(f, p, h, g) {
443
- return S(f, p && a.select(p), h, g);
443
+ return F(f, p && a.select(p), h, g);
444
444
  }
445
445
  }), l;
446
446
  }
447
- function Ft(t, a) {
448
- var l = lt(t, a = Object.assign({ compare: ct, comparable: X }, a));
447
+ function xt(t, a) {
448
+ var l = lt(t, a = Object.assign({ compare: ct, comparable: Y }, a));
449
449
  return function(f, p, h) {
450
- return S(l, f, p, h);
450
+ return F(l, f, p, h);
451
451
  };
452
452
  }
453
453
  function ct(t, a) {
454
- if (D(t, a)) return 0;
454
+ if (U(t, a)) return 0;
455
455
  if (o(t) === o(a)) {
456
456
  if (t > a) return 1;
457
457
  if (t < a) return -1;
458
458
  }
459
459
  }
460
- function X(t) {
461
- return t instanceof Date ? t.getTime() : d(t) ? t.map(X) : t && typeof t.toJSON == "function" ? t.toJSON() : t;
460
+ function Y(t) {
461
+ return t instanceof Date ? t.getTime() : d(t) ? t.map(Y) : t && typeof t.toJSON == "function" ? t.toJSON() : t;
462
462
  }
463
463
  }
464
464
  ]);
465
465
  });
466
- })(yt);
467
- var It = yt.exports;
468
- const Bt = /* @__PURE__ */ Nt(It);
469
- function Lt(e, i) {
466
+ })(mt);
467
+ var Lt = mt.exports;
468
+ const Kt = /* @__PURE__ */ Ct(Lt);
469
+ function Ut(e, i) {
470
470
  for (var s = 0; s < i.length; s++) {
471
471
  var r = i[s];
472
472
  r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
473
473
  }
474
474
  }
475
- function Dt(e, i, s) {
476
- return i && Lt(e.prototype, i), e;
475
+ function Jt(e, i, s) {
476
+ return i && Ut(e.prototype, i), e;
477
477
  }
478
- function Kt(e, i) {
478
+ function Gt(e, i) {
479
479
  e.prototype = Object.create(i.prototype), e.prototype.constructor = e, e.__proto__ = i;
480
480
  }
481
- function V(e) {
482
- return V = Object.setPrototypeOf ? Object.getPrototypeOf : function(s) {
481
+ function Z(e) {
482
+ return Z = Object.setPrototypeOf ? Object.getPrototypeOf : function(s) {
483
483
  return s.__proto__ || Object.getPrototypeOf(s);
484
- }, V(e);
484
+ }, Z(e);
485
485
  }
486
- function G(e, i) {
487
- return G = Object.setPrototypeOf || function(r, n) {
486
+ function H(e, i) {
487
+ return H = Object.setPrototypeOf || function(r, n) {
488
488
  return r.__proto__ = n, r;
489
- }, G(e, i);
489
+ }, H(e, i);
490
490
  }
491
- function Ut() {
491
+ function qt() {
492
492
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
493
493
  if (typeof Proxy == "function") return !0;
494
494
  try {
@@ -498,21 +498,21 @@ function Ut() {
498
498
  return !1;
499
499
  }
500
500
  }
501
- function J(e, i, s) {
502
- return Ut() ? J = Reflect.construct : J = function(n, o, u) {
501
+ function q(e, i, s) {
502
+ return qt() ? q = Reflect.construct : q = function(n, o, u) {
503
503
  var d = [null];
504
504
  d.push.apply(d, o);
505
505
  var v = Function.bind.apply(n, d), m = new v();
506
- return u && G(m, u.prototype), m;
507
- }, J.apply(null, arguments);
506
+ return u && H(m, u.prototype), m;
507
+ }, q.apply(null, arguments);
508
508
  }
509
- function Jt(e) {
509
+ function Ht(e) {
510
510
  return Function.toString.call(e).indexOf("[native code]") !== -1;
511
511
  }
512
- function Q(e) {
512
+ function tt(e) {
513
513
  var i = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
514
- return Q = function(r) {
515
- if (r === null || !Jt(r)) return r;
514
+ return tt = function(r) {
515
+ if (r === null || !Ht(r)) return r;
516
516
  if (typeof r != "function")
517
517
  throw new TypeError("Super expression must either be null or a function");
518
518
  if (typeof i < "u") {
@@ -520,7 +520,7 @@ function Q(e) {
520
520
  i.set(r, n);
521
521
  }
522
522
  function n() {
523
- return J(r, arguments, V(this).constructor);
523
+ return q(r, arguments, Z(this).constructor);
524
524
  }
525
525
  return n.prototype = Object.create(r.prototype, {
526
526
  constructor: {
@@ -529,19 +529,19 @@ function Q(e) {
529
529
  writable: !0,
530
530
  configurable: !0
531
531
  }
532
- }), G(n, r);
533
- }, Q(e);
532
+ }), H(n, r);
533
+ }, tt(e);
534
534
  }
535
535
  function pt(e) {
536
536
  if (e === void 0)
537
537
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
538
538
  return e;
539
539
  }
540
- var mt = function(i) {
540
+ var bt = function(i) {
541
541
  return 'Cannot execute "' + i.action + '" on "' + i.subjectName + '"';
542
- }, U = mt, Gt = /* @__PURE__ */ function(e) {
543
- Kt(i, e), i.setDefaultMessage = function(n) {
544
- n === null ? U = mt : U = typeof n == "string" ? function() {
542
+ }, G = bt, Xt = /* @__PURE__ */ function(e) {
543
+ Gt(i, e), i.setDefaultMessage = function(n) {
544
+ n === null ? G = bt : G = typeof n == "string" ? function() {
545
545
  return n;
546
546
  } : n;
547
547
  }, i.from = function(n) {
@@ -552,7 +552,7 @@ var mt = function(i) {
552
552
  };
553
553
  function i(r, n) {
554
554
  var o;
555
- return n === void 0 && (n = {}), o = e.call(this, r) || this, o._setMetadata(n), o.message = r || U(pt(o)), o._customMessage = null, typeof Error.captureStackTrace == "function" && (o.name = o.constructor.name, Error.captureStackTrace(pt(o), o.constructor)), o;
555
+ return n === void 0 && (n = {}), o = e.call(this, r) || this, o._setMetadata(n), o.message = r || G(pt(o)), o._customMessage = null, typeof Error.captureStackTrace == "function" && (o.name = o.constructor.name, Error.captureStackTrace(pt(o), o.constructor)), o;
556
556
  }
557
557
  var s = i.prototype;
558
558
  return s.setMessage = function(n) {
@@ -569,45 +569,45 @@ var mt = function(i) {
569
569
  subjectName: this.ability.subjectName(o)
570
570
  });
571
571
  var v = d ? d.reason : "";
572
- throw this.message = this._customMessage || v || U(this), this;
572
+ throw this.message = this._customMessage || v || G(this), this;
573
573
  }
574
574
  }, s._setMetadata = function(n) {
575
575
  this.subject = n.subject, this.subjectName = n.subjectName, this.action = n.action, this.field = n.field;
576
576
  }, i;
577
- }(Q(Error));
578
- function Z(e) {
577
+ }(tt(Error));
578
+ function et(e) {
579
579
  return Array.isArray(e) ? e : [e];
580
580
  }
581
- function qt(e) {
581
+ function Wt(e) {
582
582
  if (!e || typeof e == "string")
583
583
  return e;
584
584
  var i = typeof e == "object" ? e.constructor : e;
585
585
  return i.modelName || i.name;
586
586
  }
587
- function Ht(e) {
587
+ function Yt(e) {
588
588
  return JSON.parse(JSON.stringify(e));
589
589
  }
590
- var Xt = /[-/\\^$+?.()|[\]{}]/g, Wt = /\.?\*+\.?/g, Yt = /\*+/, zt = /\./g;
591
- function Vt(e, i, s) {
592
- var r = s[0] === "*" || e[0] === "." && e[e.length - 1] === "." ? "+" : "*", n = e.indexOf("**") === -1 ? "[^.]" : ".", o = e.replace(zt, "\\$&").replace(Yt, n + r);
590
+ var zt = /[-/\\^$+?.()|[\]{}]/g, Vt = /\.?\*+\.?/g, Qt = /\*+/, Zt = /\./g;
591
+ function te(e, i, s) {
592
+ var r = s[0] === "*" || e[0] === "." && e[e.length - 1] === "." ? "+" : "*", n = e.indexOf("**") === -1 ? "[^.]" : ".", o = e.replace(Zt, "\\$&").replace(Qt, n + r);
593
593
  return i + e.length === s.length ? "(?:" + o + ")?" : o;
594
594
  }
595
- function Qt(e, i, s) {
595
+ function ee(e, i, s) {
596
596
  return e === "." && (s[i - 1] === "*" || s[i + 1] === "*") ? e : "\\" + e;
597
597
  }
598
- function Zt(e) {
598
+ function re(e) {
599
599
  var i = e.map(function(r) {
600
- return r.replace(Xt, Qt).replace(Wt, Vt);
600
+ return r.replace(zt, ee).replace(Vt, te);
601
601
  }), s = i.length > 1 ? "(?:" + i.join("|") + ")" : i[0];
602
602
  return new RegExp("^" + s + "$");
603
603
  }
604
- var te = /* @__PURE__ */ function() {
604
+ var ne = /* @__PURE__ */ function() {
605
605
  function e(s) {
606
- this.actions = s.actions || s.action, this.subject = s.subject, this.fields = !s.fields || s.fields.length === 0 ? void 0 : Z(s.fields), Object.defineProperty(this, "_fieldsPattern", {
606
+ this.actions = s.actions || s.action, this.subject = s.subject, this.fields = !s.fields || s.fields.length === 0 ? void 0 : et(s.fields), Object.defineProperty(this, "_fieldsPattern", {
607
607
  writable: !0
608
608
  }), this.inverted = !!s.inverted, this.conditions = s.conditions, Object.defineProperty(this, "_matches", {
609
609
  writable: !0,
610
- value: this.conditions ? Bt(this.conditions) : void 0
610
+ value: this.conditions ? Kt(this.conditions) : void 0
611
611
  }), this.reason = s.reason;
612
612
  }
613
613
  var i = e.prototype;
@@ -616,15 +616,15 @@ var te = /* @__PURE__ */ function() {
616
616
  }, i.isRelevantFor = function(r, n) {
617
617
  return this.fields ? n ? this.matchesField(n) : !this.inverted : !0;
618
618
  }, i.matchesField = function(r) {
619
- return typeof this._fieldsPattern > "u" && (this._fieldsPattern = this.fields.join("").indexOf("*") === -1 ? null : Zt(this.fields)), this._fieldsPattern === null || r.indexOf("*") !== -1 ? this.fields.indexOf(r) !== -1 : this._fieldsPattern.test(r);
619
+ return typeof this._fieldsPattern > "u" && (this._fieldsPattern = this.fields.join("").indexOf("*") === -1 ? null : re(this.fields)), this._fieldsPattern === null || r.indexOf("*") !== -1 ? this.fields.indexOf(r) !== -1 : this._fieldsPattern.test(r);
620
620
  }, e;
621
- }(), $ = typeof Symbol < "u" ? Symbol("private") : "__" + Date.now(), ht = {
621
+ }(), P = typeof Symbol < "u" ? Symbol("private") : "__" + Date.now(), ht = {
622
622
  crud: ["create", "read", "update", "delete"]
623
623
  };
624
624
  function gt(e, i) {
625
625
  return e === i || Array.isArray(i) && i.indexOf(e) !== -1;
626
626
  }
627
- var ee = /* @__PURE__ */ function() {
627
+ var oe = /* @__PURE__ */ function() {
628
628
  e.addAlias = function(r, n) {
629
629
  if (r === "manage" || gt("manage", n))
630
630
  throw new Error('Cannot add alias for "manage" action because it represents any action');
@@ -634,15 +634,15 @@ var ee = /* @__PURE__ */ function() {
634
634
  };
635
635
  function e(s, r) {
636
636
  r === void 0 && (r = {}), Object.defineProperty(this, "subjectName", {
637
- value: r.subjectName || qt
638
- }), this[$] = {
639
- RuleType: r.RuleType || te,
637
+ value: r.subjectName || Wt
638
+ }), this[P] = {
639
+ RuleType: r.RuleType || ne,
640
640
  originalRules: s || [],
641
641
  hasPerFieldRules: !1,
642
642
  indexedRules: /* @__PURE__ */ Object.create(null),
643
643
  mergedRules: /* @__PURE__ */ Object.create(null),
644
644
  events: {},
645
- aliases: Ht(ht)
645
+ aliases: Yt(ht)
646
646
  }, this.update(s);
647
647
  }
648
648
  var i = e.prototype;
@@ -653,19 +653,19 @@ var ee = /* @__PURE__ */ function() {
653
653
  rules: r,
654
654
  ability: this
655
655
  };
656
- this.emit("update", n), this[$].originalRules = r.slice(0), this[$].mergedRules = /* @__PURE__ */ Object.create(null);
656
+ this.emit("update", n), this[P].originalRules = r.slice(0), this[P].mergedRules = /* @__PURE__ */ Object.create(null);
657
657
  var o = this.buildIndexFor(r);
658
- return this[$].indexedRules = o.rules, this[$].hasPerFieldRules = o.hasPerFieldRules, this.emit("updated", n), this;
658
+ return this[P].indexedRules = o.rules, this[P].hasPerFieldRules = o.hasPerFieldRules, this.emit("updated", n), this;
659
659
  }, i.buildIndexFor = function(r) {
660
- for (var n = /* @__PURE__ */ Object.create(null), o = this[$].RuleType, u = !0, d = !1, v = 0; v < r.length; v++) {
661
- var m = new o(r[v]), b = this.expandActions(m.actions), w = Z(m.subject), N = r.length - v - 1;
660
+ for (var n = /* @__PURE__ */ Object.create(null), o = this[P].RuleType, u = !0, d = !1, v = 0; v < r.length; v++) {
661
+ var m = new o(r[v]), b = this.expandActions(m.actions), w = et(m.subject), N = r.length - v - 1;
662
662
  u = !!(u && m.inverted), !d && m.fields && (d = !0);
663
- for (var S = 0; S < w.length; S++) {
664
- var _ = w[S];
663
+ for (var F = 0; F < w.length; F++) {
664
+ var _ = w[F];
665
665
  n[_] = n[_] || /* @__PURE__ */ Object.create(null);
666
- for (var R = 0; R < b.length; R++) {
667
- var E = b[R];
668
- n[_][E] = n[_][E] || /* @__PURE__ */ Object.create(null), n[_][E][N] = m;
666
+ for (var x = 0; x < b.length; x++) {
667
+ var j = b[x];
668
+ n[_][j] = n[_][j] || /* @__PURE__ */ Object.create(null), n[_][j][N] = m;
669
669
  }
670
670
  }
671
671
  }
@@ -675,7 +675,7 @@ var ee = /* @__PURE__ */ function() {
675
675
  rules: n
676
676
  };
677
677
  }, i.expandActions = function(r) {
678
- for (var n = this[$].aliases, o = Z(r), u = 0; u < o.length; ) {
678
+ for (var n = this[P].aliases, o = et(r), u = 0; u < o.length; ) {
679
679
  var d = o[u++];
680
680
  n.hasOwnProperty(d) && (o = o.concat(n[d]));
681
681
  }
@@ -691,17 +691,17 @@ var ee = /* @__PURE__ */ function() {
691
691
  return u[d];
692
692
  return null;
693
693
  }, i.possibleRulesFor = function(r, n) {
694
- var o = this.subjectName(n), u = this[$].mergedRules, d = o + "_" + r;
694
+ var o = this.subjectName(n), u = this[P].mergedRules, d = o + "_" + r;
695
695
  return u[d] || (u[d] = this.mergeRulesFor(r, o)), u[d];
696
696
  }, i.mergeRulesFor = function(r, n) {
697
- var o = this[$].indexedRules, u = [n, "all"].reduce(function(d, v) {
697
+ var o = this[P].indexedRules, u = [n, "all"].reduce(function(d, v) {
698
698
  var m = o[v];
699
699
  return m ? Object.assign(d, m[r], m.manage) : d;
700
700
  }, []);
701
701
  return u.filter(Boolean);
702
702
  }, i.rulesFor = function(r, n, o) {
703
703
  var u = this.possibleRulesFor(r, n);
704
- return this[$].hasPerFieldRules ? u.filter(function(d) {
704
+ return this[P].hasPerFieldRules ? u.filter(function(d) {
705
705
  return d.isRelevantFor(n, o);
706
706
  }) : u;
707
707
  }, i.cannot = function() {
@@ -711,9 +711,9 @@ var ee = /* @__PURE__ */ function() {
711
711
  console.warn(`
712
712
  Ability.throwUnlessCan is deprecated and will be removed in 4.x version.
713
713
  Please use "ForbiddenError.from(ability).throwUnlessCan(...)" instead.
714
- `.trim()), (r = Gt.from(this)).throwUnlessCan.apply(r, arguments);
714
+ `.trim()), (r = Xt.from(this)).throwUnlessCan.apply(r, arguments);
715
715
  }, i.on = function(r, n) {
716
- var o = this[$].events, u = !0;
716
+ var o = this[P].events, u = !0;
717
717
  return o[r] || (o[r] = []), o[r].push(n), function() {
718
718
  if (u) {
719
719
  var d = o[r].indexOf(n);
@@ -721,24 +721,24 @@ var ee = /* @__PURE__ */ function() {
721
721
  }
722
722
  };
723
723
  }, i.emit = function(r, n) {
724
- var o = this[$].events[r];
724
+ var o = this[P].events[r];
725
725
  o && o.slice(0).forEach(function(u) {
726
726
  return u(n);
727
727
  });
728
- }, Dt(e, [{
728
+ }, Jt(e, [{
729
729
  key: "rules",
730
730
  get: function() {
731
- return this[$].originalRules;
731
+ return this[P].originalRules;
732
732
  }
733
733
  }]), e;
734
734
  }();
735
- function re(e) {
736
- return new ee(e).can("manage", "business::miniProgram::brandkit");
735
+ function ie(e) {
736
+ return new oe(e).can("manage", "business::miniProgram::brandkit");
737
737
  }
738
- function at() {
738
+ function W() {
739
739
  var i;
740
- const e = ((i = At().sessionUser.value) == null ? void 0 : i.permissions) ?? [];
741
- return re(
740
+ const e = ((i = kt().sessionUser.value) == null ? void 0 : i.permissions) ?? [];
741
+ return ie(
742
742
  e.map(({ fields: s, inverted: r, reason: n, ...o }) => ({
743
743
  ...o,
744
744
  fields: s ?? void 0,
@@ -747,10 +747,10 @@ function at() {
747
747
  }))
748
748
  );
749
749
  }
750
- function ye() {
751
- return nt(at);
750
+ function Se() {
751
+ return L(W);
752
752
  }
753
- const H = [
753
+ const K = [
754
754
  { path: "primary", label: "Primary", group: "Brand", hint: "Dominant brand color" },
755
755
  {
756
756
  path: "secondary",
@@ -777,28 +777,49 @@ const H = [
777
777
  { path: "status.warning", label: "Warning", group: "Status" },
778
778
  { path: "status.error", label: "Error", group: "Status" },
779
779
  { path: "status.info", label: "Info", group: "Status" }
780
- ], L = [
780
+ ], C = [
781
781
  { path: "brand", label: "Brand", group: "Fonts", hint: "Logo / wordmark contexts" },
782
782
  { path: "heading", label: "Heading", group: "Fonts" },
783
783
  { path: "body", label: "Body", group: "Fonts" }
784
- ], bt = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
785
- function ne(e) {
786
- return bt.test(e.trim());
784
+ ], wt = {
785
+ primary: "#ff7823",
786
+ secondary: "#fff3e6",
787
+ accent: "#B25300",
788
+ "background.base": "#F8F8F8",
789
+ "background.elevated": "#FFFFFF",
790
+ "neutral.light": "#DADADA",
791
+ "neutral.mid": "#B2B3B6",
792
+ "neutral.dark": "#1C1C1E",
793
+ "text.onPrimary": "#FFFFFF",
794
+ "text.primary": "#1C1C1E",
795
+ "text.secondary": "#555555",
796
+ "text.tertiary": "#A2A09E",
797
+ "status.success": "#10B981",
798
+ "status.warning": "#F59E0B",
799
+ "status.error": "#EF4444",
800
+ "status.info": "#3B82F6"
801
+ }, Ft = {
802
+ brand: "'Inter', sans-serif",
803
+ heading: "'Inter', sans-serif",
804
+ body: "'Roboto', sans-serif"
805
+ }, Ot = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
806
+ function ae(e) {
807
+ return Ot.test(e.trim());
787
808
  }
788
- function me(e) {
809
+ function vt(e) {
789
810
  const i = e.trim().toLowerCase();
790
- if (!bt.test(i)) return "#000000";
811
+ if (!Ot.test(i)) return "#000000";
791
812
  if (i.length === 7) return i;
792
813
  const [s, r, n] = i.slice(1);
793
814
  return `#${s}${s}${r}${r}${n}${n}`;
794
815
  }
795
- function oe() {
796
- return xt(jt("fmmf:dev")).apiOrigin;
816
+ function se() {
817
+ return At(Nt("fmmf:dev")).apiOrigin;
797
818
  }
798
819
  function st(e) {
799
- return `${oe()}/metadata/${e}/brandkit`;
820
+ return `${se()}/metadata/${e}/brandkit`;
800
821
  }
801
- function I(e, i) {
822
+ function B(e, i) {
802
823
  let s = e;
803
824
  for (const r of i.split(".")) {
804
825
  if (!s || typeof s != "object") return;
@@ -806,7 +827,7 @@ function I(e, i) {
806
827
  }
807
828
  return s;
808
829
  }
809
- function tt(e, i, s) {
830
+ function rt(e, i, s) {
810
831
  const r = i.split("."), n = r.pop();
811
832
  if (!n) return;
812
833
  let o = e;
@@ -816,18 +837,18 @@ function tt(e, i, s) {
816
837
  }
817
838
  o[n] = s;
818
839
  }
819
- function et(e, i, s) {
840
+ function nt(e, i, s) {
820
841
  const r = {};
821
842
  for (const n of s) {
822
- const o = I(e == null ? void 0 : e[i], n.path);
843
+ const o = B(e == null ? void 0 : e[i], n.path);
823
844
  r[n.path] = typeof o == "string" ? o : "";
824
845
  }
825
846
  return r;
826
847
  }
827
- function rt(e) {
848
+ function ot(e) {
828
849
  return JSON.parse(JSON.stringify(e));
829
850
  }
830
- const c = Et({
851
+ const c = Tt({
831
852
  panelOpen: !1,
832
853
  loading: !1,
833
854
  saving: !1,
@@ -848,63 +869,63 @@ async function ut(e) {
848
869
  if (!i.ok) throw new Error(`GET brandkit failed: HTTP ${i.status}`);
849
870
  return await i.json();
850
871
  }
851
- function q(e) {
852
- c.colors = et(e, "colors", H), c.fonts = et(e, "fonts", L), c.savedColors = { ...c.colors }, c.savedFonts = { ...c.fonts }, c.loaded = !0;
872
+ function X(e) {
873
+ c.colors = nt(e, "colors", K), c.fonts = nt(e, "fonts", C), c.savedColors = { ...c.colors }, c.savedFonts = { ...c.fonts }, c.loaded = !0;
853
874
  }
854
- let k = null, F = 0, B = null;
855
- function wt(e = !1) {
856
- const i = j();
875
+ let k = null, $ = 0, D = null;
876
+ function St(e = !1) {
877
+ const i = R();
857
878
  if (c.loaded && !e && c.businessId === i) return Promise.resolve();
858
879
  if ((k == null ? void 0 : k.businessId) === i) return k.promise;
859
- const s = ++F;
860
- c.businessId !== i && (c.businessId = i, c.loaded = !1, c.revertKit = null, B = null, c.appliedProposal = null, q(null), c.loaded = !1);
880
+ const s = ++$;
881
+ c.businessId !== i && (c.businessId = i, c.loaded = !1, c.revertKit = null, D = null, c.appliedProposal = null, X(null), c.loaded = !1);
861
882
  const r = (async () => {
862
883
  c.loading = !0, c.error = null;
863
884
  try {
864
885
  const n = await ut(i);
865
- s === F && q(n);
886
+ s === $ && X(n);
866
887
  } catch (n) {
867
- s === F && (c.error = ot(n));
888
+ s === $ && (c.error = it(n));
868
889
  } finally {
869
- s === F && (c.loading = !1, k = null);
890
+ s === $ && (c.loading = !1, k = null);
870
891
  }
871
892
  })();
872
893
  return k = { businessId: i, promise: r }, r;
873
894
  }
874
- function St() {
875
- const e = H.filter((s) => c.colors[s.path] !== c.savedColors[s.path]).map(
895
+ function Pt() {
896
+ const e = K.filter((s) => c.colors[s.path] !== c.savedColors[s.path]).map(
876
897
  (s) => s.path
877
- ), i = L.filter((s) => c.fonts[s.path] !== c.savedFonts[s.path]).map(
898
+ ), i = C.filter((s) => c.fonts[s.path] !== c.savedFonts[s.path]).map(
878
899
  (s) => s.path
879
900
  );
880
901
  return { colorPaths: e, fontPaths: i };
881
902
  }
882
- const ie = nt(() => {
883
- const { colorPaths: e, fontPaths: i } = St();
903
+ const ue = L(() => {
904
+ const { colorPaths: e, fontPaths: i } = Pt();
884
905
  return e.length + i.length;
885
- }), Ot = nt(
886
- () => H.some((e) => {
906
+ }), $t = L(
907
+ () => K.some((e) => {
887
908
  const i = c.colors[e.path] ?? "";
888
- return i !== "" && !ne(i);
909
+ return i !== "" && !ae(i);
889
910
  })
890
911
  );
891
- async function ae() {
892
- const e = j();
893
- if (!at())
912
+ async function le() {
913
+ const e = R();
914
+ if (!W())
894
915
  throw c.error = "You do not have permission to manage this Brand Kit. Contact an administrator.", new Error(c.error);
895
916
  if (c.saving || c.loading || !c.loaded || c.businessId !== e)
896
917
  throw new Error("Wait for the current Brand Kit to finish loading or saving.");
897
- if (Ot.value) throw new Error("Enter valid hex colors before saving.");
898
- const { colorPaths: i, fontPaths: s } = St();
918
+ if ($t.value) throw new Error("Enter valid hex colors before saving.");
919
+ const { colorPaths: i, fontPaths: s } = Pt();
899
920
  if (!i.length && !s.length) return;
900
- const r = { ...c.colors }, n = { ...c.fonts }, o = F;
921
+ const r = { ...c.colors }, n = { ...c.fonts }, o = $;
901
922
  c.saving = !0, c.error = null;
902
923
  try {
903
- const u = await ut(e) ?? {}, d = rt(u), v = rt(u);
924
+ const u = await ut(e) ?? {}, d = ot(u), v = ot(u);
904
925
  (!v.colors || typeof v.colors != "object") && (v.colors = {}), (!v.fonts || typeof v.fonts != "object") && (v.fonts = {});
905
- for (const b of i) tt(v.colors, b, (r[b] ?? "").trim());
906
- for (const b of s) tt(v.fonts, b, (n[b] ?? "").trim());
907
- if (s.length && (v.fontFamilies = Ct(u.fontFamilies, et(v, "fonts", L))), o !== F || e !== j())
926
+ for (const b of i) rt(v.colors, b, (r[b] ?? "").trim());
927
+ for (const b of s) rt(v.fonts, b, (n[b] ?? "").trim());
928
+ if (s.length && (v.fontFamilies = Dt(u.fontFamilies, nt(v, "fonts", C))), o !== $ || e !== R())
908
929
  throw new Error("Business changed. No Brand Kit was saved.");
909
930
  const m = await fetch(st(e), {
910
931
  method: "POST",
@@ -913,29 +934,29 @@ async function ae() {
913
934
  signal: AbortSignal.timeout(2e4)
914
935
  });
915
936
  if (!m.ok) throw new Error(`Save failed: HTTP ${m.status}`);
916
- o === F && e === j() && (c.revertKit = d, B = {
937
+ o === $ && e === R() && (c.revertKit = d, D = {
917
938
  colorPaths: i,
918
939
  fontPaths: s,
919
940
  savedFontFamilies: s.length ? JSON.stringify(v.fontFamilies) : void 0
920
- }, c.appliedProposal = null, q(v));
941
+ }, c.appliedProposal = null, X(v));
921
942
  } catch (u) {
922
- throw o === F && (c.error = ot(u)), u;
943
+ throw o === $ && (c.error = it(u)), u;
923
944
  } finally {
924
945
  c.saving = !1;
925
946
  }
926
947
  }
927
- async function se() {
928
- if (!c.revertKit || !B || c.saving || c.loading) return;
929
- const e = j();
930
- if (!at())
948
+ async function ce() {
949
+ if (!c.revertKit || !D || c.saving || c.loading) return;
950
+ const e = R();
951
+ if (!W())
931
952
  throw c.error = "You do not have permission to manage this Brand Kit. Contact an administrator.", new Error(c.error);
932
953
  if (c.businessId !== e) throw new Error("Load the current business before reverting.");
933
- const i = F, s = rt(c.revertKit), r = B;
954
+ const i = $, s = ot(c.revertKit), r = D;
934
955
  c.saving = !0, c.error = null;
935
956
  try {
936
957
  const n = await ut(e) ?? {};
937
958
  if (r.fontPaths.length) {
938
- if (L.some((u) => (I(n.fonts, u.path) ?? "") !== c.savedFonts[u.path]) || JSON.stringify(n.fontFamilies) !== r.savedFontFamilies)
959
+ if (C.some((u) => (B(n.fonts, u.path) ?? "") !== c.savedFonts[u.path]) || JSON.stringify(n.fontFamilies) !== r.savedFontFamilies)
939
960
  throw new Error("Brand Kit changed since your save. Reload it before editing again.");
940
961
  Object.hasOwn(s, "fontFamilies") ? n.fontFamilies = s.fontFamilies : delete n.fontFamilies;
941
962
  }
@@ -945,18 +966,18 @@ async function se() {
945
966
  ]) {
946
967
  const v = u === "colors" ? c.savedColors : c.savedFonts;
947
968
  for (const m of d) {
948
- if ((I(n[u], m) ?? "") !== v[m])
969
+ if ((B(n[u], m) ?? "") !== v[m])
949
970
  throw new Error("Brand Kit changed since your save. Reload it before editing again.");
950
971
  (!n[u] || typeof n[u] != "object") && (n[u] = {});
951
- const b = I(s[u], m);
952
- if (typeof b == "string") tt(n[u], m, b);
972
+ const b = B(s[u], m);
973
+ if (typeof b == "string") rt(n[u], m, b);
953
974
  else {
954
- const w = m.split("."), N = w.pop(), S = w.length ? I(n[u], w.join(".")) : n[u];
955
- S && typeof S == "object" && delete S[N];
975
+ const w = m.split("."), N = w.pop(), F = w.length ? B(n[u], w.join(".")) : n[u];
976
+ F && typeof F == "object" && delete F[N];
956
977
  }
957
978
  }
958
979
  }
959
- if (i !== F || e !== j())
980
+ if (i !== $ || e !== R())
960
981
  throw new Error("Business changed. No Brand Kit was reverted.");
961
982
  const o = await fetch(st(e), {
962
983
  method: "POST",
@@ -965,52 +986,63 @@ async function se() {
965
986
  signal: AbortSignal.timeout(2e4)
966
987
  });
967
988
  if (!o.ok) throw new Error(`Revert failed: HTTP ${o.status}`);
968
- i === F && e === j() && (c.revertKit = null, B = null, q(n));
989
+ i === $ && e === R() && (c.revertKit = null, D = null, X(n));
969
990
  } catch (n) {
970
- throw i === F && (c.error = ot(n)), n;
991
+ throw i === $ && (c.error = it(n)), n;
971
992
  } finally {
972
993
  c.saving = !1;
973
994
  }
974
995
  }
975
- async function ue(e) {
996
+ async function fe(e) {
976
997
  c.panelOpen = !0;
977
- const i = j();
978
- if (await wt(), !(!c.loaded || c.loading || c.saving || c.businessId !== i || j() !== i)) {
979
- for (const s of H) {
998
+ const i = R();
999
+ if (await St(), !(!c.loaded || c.loading || c.saving || c.businessId !== i || R() !== i)) {
1000
+ for (const s of K) {
980
1001
  const r = e.colors[s.path];
981
1002
  r && (c.colors[s.path] = r);
982
1003
  }
983
- for (const s of L) {
1004
+ for (const s of C) {
984
1005
  const r = e.fonts[s.path];
985
1006
  r && (c.fonts[s.path] = r);
986
1007
  }
987
1008
  c.appliedProposal = e.name ?? "Untitled proposal";
988
1009
  }
989
1010
  }
990
- function le() {
1011
+ function de() {
991
1012
  c.colors = { ...c.savedColors }, c.fonts = { ...c.savedFonts }, c.appliedProposal = null;
992
1013
  }
993
- function be() {
1014
+ const pe = L(
1015
+ () => K.every((e) => vt(c.colors[e.path] ?? "") === vt(wt[e.path]))
1016
+ ), he = L(
1017
+ () => C.every((e) => c.fonts[e.path] === Ft[e.path])
1018
+ );
1019
+ function ge(e) {
1020
+ !W() || !c.loaded || c.loading || c.saving || c.businessId !== R() || (e === "colors" ? c.colors = { ...wt } : c.fonts = { ...Ft }, c.appliedProposal = null);
1021
+ }
1022
+ function Pe() {
994
1023
  return {
995
1024
  state: c,
996
- dirtyCount: ie,
997
- hasInvalidColor: Ot,
998
- load: wt,
999
- save: ae,
1000
- revertLastSave: se,
1001
- applyProposal: ue,
1002
- discardEdits: le
1025
+ dirtyCount: ue,
1026
+ hasInvalidColor: $t,
1027
+ colorsAreDefault: pe,
1028
+ fontsAreDefault: he,
1029
+ load: St,
1030
+ save: le,
1031
+ revertLastSave: ce,
1032
+ applyProposal: fe,
1033
+ resetToDefault: ge,
1034
+ discardEdits: de
1003
1035
  };
1004
1036
  }
1005
1037
  export {
1006
- H as C,
1007
- L as F,
1008
- it as G,
1009
- ye as a,
1010
- kt as b,
1011
- ge as f,
1012
- ne as i,
1013
- ve as l,
1014
- me as t,
1015
- be as u
1038
+ K as C,
1039
+ C as F,
1040
+ at as G,
1041
+ Se as a,
1042
+ It as b,
1043
+ Fe as f,
1044
+ ae as i,
1045
+ Oe as l,
1046
+ vt as t,
1047
+ Pe as u
1016
1048
  };