@touchtech/web-navigation-menu 0.0.17 → 0.0.18-alpha.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.
package/dist/index.mjs ADDED
@@ -0,0 +1,1210 @@
1
+ import we, { useContext as K, useState as ce, useEffect as ge, useMemo as I, useCallback as z, Fragment as Ot } from "react";
2
+ import { AnimatePresence as Dt, motion as Mt } from "framer-motion";
3
+ import { createPortal as kt } from "react-dom";
4
+ import { AuthContext as et, userHasTenantAccess as k, Privileges as $ } from "@touchtech/web-auth";
5
+ import { TenantIdContext as Te } from "@touchtech/web-tenant-id-provider";
6
+ import ne from "classcat";
7
+ import { Image as Ft, Button as be, Icon as te, IconButton as Lt } from "@touchtech/baselayer-ui";
8
+ import { useApi as tt, createUrl as nt } from "@touchtech/web-api-client";
9
+ import Ut from "swr";
10
+ import { matchPath as Bt } from "react-router-dom";
11
+ import { useToggle as Ht } from "@touchtech/web-hooks";
12
+ var Ee = { exports: {} }, Z = {};
13
+ /**
14
+ * @license React
15
+ * react-jsx-runtime.production.min.js
16
+ *
17
+ * Copyright (c) Facebook, Inc. and its affiliates.
18
+ *
19
+ * This source code is licensed under the MIT license found in the
20
+ * LICENSE file in the root directory of this source tree.
21
+ */
22
+ var Xe;
23
+ function Vt() {
24
+ if (Xe) return Z;
25
+ Xe = 1;
26
+ var a = we, i = Symbol.for("react.element"), f = Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, c = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 };
27
+ function o(T, _, x) {
28
+ var m, S = {}, R = null, y = null;
29
+ x !== void 0 && (R = "" + x), _.key !== void 0 && (R = "" + _.key), _.ref !== void 0 && (y = _.ref);
30
+ for (m in _) l.call(_, m) && !h.hasOwnProperty(m) && (S[m] = _[m]);
31
+ if (T && T.defaultProps) for (m in _ = T.defaultProps, _) S[m] === void 0 && (S[m] = _[m]);
32
+ return { $$typeof: i, type: T, key: R, ref: y, props: S, _owner: c.current };
33
+ }
34
+ return Z.Fragment = f, Z.jsx = o, Z.jsxs = o, Z;
35
+ }
36
+ var Q = {};
37
+ /**
38
+ * @license React
39
+ * react-jsx-runtime.development.js
40
+ *
41
+ * Copyright (c) Facebook, Inc. and its affiliates.
42
+ *
43
+ * This source code is licensed under the MIT license found in the
44
+ * LICENSE file in the root directory of this source tree.
45
+ */
46
+ var Je;
47
+ function $t() {
48
+ return Je || (Je = 1, process.env.NODE_ENV !== "production" && function() {
49
+ var a = we, i = Symbol.for("react.element"), f = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), T = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), y = Symbol.for("react.offscreen"), M = Symbol.iterator, U = "@@iterator";
50
+ function B(e) {
51
+ if (e === null || typeof e != "object")
52
+ return null;
53
+ var t = M && e[M] || e[U];
54
+ return typeof t == "function" ? t : null;
55
+ }
56
+ var N = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
57
+ function E(e) {
58
+ {
59
+ for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
60
+ n[s - 1] = arguments[s];
61
+ q("error", e, n);
62
+ }
63
+ }
64
+ function q(e, t, n) {
65
+ {
66
+ var s = N.ReactDebugCurrentFrame, p = s.getStackAddendum();
67
+ p !== "" && (t += "%s", n = n.concat([p]));
68
+ var v = n.map(function(d) {
69
+ return String(d);
70
+ });
71
+ v.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, v);
72
+ }
73
+ }
74
+ var X = !1, P = !1, le = !1, at = !1, st = !1, Re;
75
+ Re = Symbol.for("react.module.reference");
76
+ function it(e) {
77
+ return !!(typeof e == "string" || typeof e == "function" || e === l || e === h || st || e === c || e === x || e === m || at || e === y || X || P || le || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === S || e.$$typeof === o || e.$$typeof === T || e.$$typeof === _ || // This needs to include all possible module reference object
78
+ // types supported by any Flight configuration anywhere since
79
+ // we don't know which Flight build this will end up being used
80
+ // with.
81
+ e.$$typeof === Re || e.getModuleId !== void 0));
82
+ }
83
+ function ot(e, t, n) {
84
+ var s = e.displayName;
85
+ if (s)
86
+ return s;
87
+ var p = t.displayName || t.name || "";
88
+ return p !== "" ? n + "(" + p + ")" : n;
89
+ }
90
+ function Ne(e) {
91
+ return e.displayName || "Context";
92
+ }
93
+ function H(e) {
94
+ if (e == null)
95
+ return null;
96
+ if (typeof e.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
97
+ return e.displayName || e.name || null;
98
+ if (typeof e == "string")
99
+ return e;
100
+ switch (e) {
101
+ case l:
102
+ return "Fragment";
103
+ case f:
104
+ return "Portal";
105
+ case h:
106
+ return "Profiler";
107
+ case c:
108
+ return "StrictMode";
109
+ case x:
110
+ return "Suspense";
111
+ case m:
112
+ return "SuspenseList";
113
+ }
114
+ if (typeof e == "object")
115
+ switch (e.$$typeof) {
116
+ case T:
117
+ var t = e;
118
+ return Ne(t) + ".Consumer";
119
+ case o:
120
+ var n = e;
121
+ return Ne(n._context) + ".Provider";
122
+ case _:
123
+ return ot(e, e.render, "ForwardRef");
124
+ case S:
125
+ var s = e.displayName || null;
126
+ return s !== null ? s : H(e.type) || "Memo";
127
+ case R: {
128
+ var p = e, v = p._payload, d = p._init;
129
+ try {
130
+ return H(d(v));
131
+ } catch {
132
+ return null;
133
+ }
134
+ }
135
+ }
136
+ return null;
137
+ }
138
+ var V = Object.assign, J = 0, Ce, Ae, Ie, ye, Pe, je, Oe;
139
+ function De() {
140
+ }
141
+ De.__reactDisabledLog = !0;
142
+ function ct() {
143
+ {
144
+ if (J === 0) {
145
+ Ce = console.log, Ae = console.info, Ie = console.warn, ye = console.error, Pe = console.group, je = console.groupCollapsed, Oe = console.groupEnd;
146
+ var e = {
147
+ configurable: !0,
148
+ enumerable: !0,
149
+ value: De,
150
+ writable: !0
151
+ };
152
+ Object.defineProperties(console, {
153
+ info: e,
154
+ log: e,
155
+ warn: e,
156
+ error: e,
157
+ group: e,
158
+ groupCollapsed: e,
159
+ groupEnd: e
160
+ });
161
+ }
162
+ J++;
163
+ }
164
+ }
165
+ function lt() {
166
+ {
167
+ if (J--, J === 0) {
168
+ var e = {
169
+ configurable: !0,
170
+ enumerable: !0,
171
+ writable: !0
172
+ };
173
+ Object.defineProperties(console, {
174
+ log: V({}, e, {
175
+ value: Ce
176
+ }),
177
+ info: V({}, e, {
178
+ value: Ae
179
+ }),
180
+ warn: V({}, e, {
181
+ value: Ie
182
+ }),
183
+ error: V({}, e, {
184
+ value: ye
185
+ }),
186
+ group: V({}, e, {
187
+ value: Pe
188
+ }),
189
+ groupCollapsed: V({}, e, {
190
+ value: je
191
+ }),
192
+ groupEnd: V({}, e, {
193
+ value: Oe
194
+ })
195
+ });
196
+ }
197
+ J < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
198
+ }
199
+ }
200
+ var ue = N.ReactCurrentDispatcher, de;
201
+ function re(e, t, n) {
202
+ {
203
+ if (de === void 0)
204
+ try {
205
+ throw Error();
206
+ } catch (p) {
207
+ var s = p.stack.trim().match(/\n( *(at )?)/);
208
+ de = s && s[1] || "";
209
+ }
210
+ return `
211
+ ` + de + e;
212
+ }
213
+ }
214
+ var fe = !1, ae;
215
+ {
216
+ var ut = typeof WeakMap == "function" ? WeakMap : Map;
217
+ ae = new ut();
218
+ }
219
+ function Me(e, t) {
220
+ if (!e || fe)
221
+ return "";
222
+ {
223
+ var n = ae.get(e);
224
+ if (n !== void 0)
225
+ return n;
226
+ }
227
+ var s;
228
+ fe = !0;
229
+ var p = Error.prepareStackTrace;
230
+ Error.prepareStackTrace = void 0;
231
+ var v;
232
+ v = ue.current, ue.current = null, ct();
233
+ try {
234
+ if (t) {
235
+ var d = function() {
236
+ throw Error();
237
+ };
238
+ if (Object.defineProperty(d.prototype, "props", {
239
+ set: function() {
240
+ throw Error();
241
+ }
242
+ }), typeof Reflect == "object" && Reflect.construct) {
243
+ try {
244
+ Reflect.construct(d, []);
245
+ } catch (j) {
246
+ s = j;
247
+ }
248
+ Reflect.construct(e, [], d);
249
+ } else {
250
+ try {
251
+ d.call();
252
+ } catch (j) {
253
+ s = j;
254
+ }
255
+ e.call(d.prototype);
256
+ }
257
+ } else {
258
+ try {
259
+ throw Error();
260
+ } catch (j) {
261
+ s = j;
262
+ }
263
+ e();
264
+ }
265
+ } catch (j) {
266
+ if (j && s && typeof j.stack == "string") {
267
+ for (var u = j.stack.split(`
268
+ `), C = s.stack.split(`
269
+ `), g = u.length - 1, w = C.length - 1; g >= 1 && w >= 0 && u[g] !== C[w]; )
270
+ w--;
271
+ for (; g >= 1 && w >= 0; g--, w--)
272
+ if (u[g] !== C[w]) {
273
+ if (g !== 1 || w !== 1)
274
+ do
275
+ if (g--, w--, w < 0 || u[g] !== C[w]) {
276
+ var A = `
277
+ ` + u[g].replace(" at new ", " at ");
278
+ return e.displayName && A.includes("<anonymous>") && (A = A.replace("<anonymous>", e.displayName)), typeof e == "function" && ae.set(e, A), A;
279
+ }
280
+ while (g >= 1 && w >= 0);
281
+ break;
282
+ }
283
+ }
284
+ } finally {
285
+ fe = !1, ue.current = v, lt(), Error.prepareStackTrace = p;
286
+ }
287
+ var G = e ? e.displayName || e.name : "", Ke = G ? re(G) : "";
288
+ return typeof e == "function" && ae.set(e, Ke), Ke;
289
+ }
290
+ function dt(e, t, n) {
291
+ return Me(e, !1);
292
+ }
293
+ function ft(e) {
294
+ var t = e.prototype;
295
+ return !!(t && t.isReactComponent);
296
+ }
297
+ function se(e, t, n) {
298
+ if (e == null)
299
+ return "";
300
+ if (typeof e == "function")
301
+ return Me(e, ft(e));
302
+ if (typeof e == "string")
303
+ return re(e);
304
+ switch (e) {
305
+ case x:
306
+ return re("Suspense");
307
+ case m:
308
+ return re("SuspenseList");
309
+ }
310
+ if (typeof e == "object")
311
+ switch (e.$$typeof) {
312
+ case _:
313
+ return dt(e.render);
314
+ case S:
315
+ return se(e.type, t, n);
316
+ case R: {
317
+ var s = e, p = s._payload, v = s._init;
318
+ try {
319
+ return se(v(p), t, n);
320
+ } catch {
321
+ }
322
+ }
323
+ }
324
+ return "";
325
+ }
326
+ var ie = Object.prototype.hasOwnProperty, ke = {}, Fe = N.ReactDebugCurrentFrame;
327
+ function oe(e) {
328
+ if (e) {
329
+ var t = e._owner, n = se(e.type, e._source, t ? t.type : null);
330
+ Fe.setExtraStackFrame(n);
331
+ } else
332
+ Fe.setExtraStackFrame(null);
333
+ }
334
+ function pt(e, t, n, s, p) {
335
+ {
336
+ var v = Function.call.bind(ie);
337
+ for (var d in e)
338
+ if (v(e, d)) {
339
+ var u = void 0;
340
+ try {
341
+ if (typeof e[d] != "function") {
342
+ var C = Error((s || "React class") + ": " + n + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
343
+ throw C.name = "Invariant Violation", C;
344
+ }
345
+ u = e[d](t, d, s, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
346
+ } catch (g) {
347
+ u = g;
348
+ }
349
+ u && !(u instanceof Error) && (oe(p), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", s || "React class", n, d, typeof u), oe(null)), u instanceof Error && !(u.message in ke) && (ke[u.message] = !0, oe(p), E("Failed %s type: %s", n, u.message), oe(null));
350
+ }
351
+ }
352
+ }
353
+ var vt = Array.isArray;
354
+ function pe(e) {
355
+ return vt(e);
356
+ }
357
+ function _t(e) {
358
+ {
359
+ var t = typeof Symbol == "function" && Symbol.toStringTag, n = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
360
+ return n;
361
+ }
362
+ }
363
+ function mt(e) {
364
+ try {
365
+ return Le(e), !1;
366
+ } catch {
367
+ return !0;
368
+ }
369
+ }
370
+ function Le(e) {
371
+ return "" + e;
372
+ }
373
+ function Ue(e) {
374
+ if (mt(e))
375
+ return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", _t(e)), Le(e);
376
+ }
377
+ var Be = N.ReactCurrentOwner, ht = {
378
+ key: !0,
379
+ ref: !0,
380
+ __self: !0,
381
+ __source: !0
382
+ }, He, Ve;
383
+ function gt(e) {
384
+ if (ie.call(e, "ref")) {
385
+ var t = Object.getOwnPropertyDescriptor(e, "ref").get;
386
+ if (t && t.isReactWarning)
387
+ return !1;
388
+ }
389
+ return e.ref !== void 0;
390
+ }
391
+ function Et(e) {
392
+ if (ie.call(e, "key")) {
393
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
394
+ if (t && t.isReactWarning)
395
+ return !1;
396
+ }
397
+ return e.key !== void 0;
398
+ }
399
+ function wt(e, t) {
400
+ typeof e.ref == "string" && Be.current;
401
+ }
402
+ function Tt(e, t) {
403
+ {
404
+ var n = function() {
405
+ He || (He = !0, E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
406
+ };
407
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
408
+ get: n,
409
+ configurable: !0
410
+ });
411
+ }
412
+ }
413
+ function bt(e, t) {
414
+ {
415
+ var n = function() {
416
+ Ve || (Ve = !0, E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
417
+ };
418
+ n.isReactWarning = !0, Object.defineProperty(e, "ref", {
419
+ get: n,
420
+ configurable: !0
421
+ });
422
+ }
423
+ }
424
+ var St = function(e, t, n, s, p, v, d) {
425
+ var u = {
426
+ // This tag allows us to uniquely identify this as a React Element
427
+ $$typeof: i,
428
+ // Built-in properties that belong on the element
429
+ type: e,
430
+ key: t,
431
+ ref: n,
432
+ props: d,
433
+ // Record the component responsible for creating this element.
434
+ _owner: v
435
+ };
436
+ return u._store = {}, Object.defineProperty(u._store, "validated", {
437
+ configurable: !1,
438
+ enumerable: !1,
439
+ writable: !0,
440
+ value: !1
441
+ }), Object.defineProperty(u, "_self", {
442
+ configurable: !1,
443
+ enumerable: !1,
444
+ writable: !1,
445
+ value: s
446
+ }), Object.defineProperty(u, "_source", {
447
+ configurable: !1,
448
+ enumerable: !1,
449
+ writable: !1,
450
+ value: p
451
+ }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
452
+ };
453
+ function xt(e, t, n, s, p) {
454
+ {
455
+ var v, d = {}, u = null, C = null;
456
+ n !== void 0 && (Ue(n), u = "" + n), Et(t) && (Ue(t.key), u = "" + t.key), gt(t) && (C = t.ref, wt(t, p));
457
+ for (v in t)
458
+ ie.call(t, v) && !ht.hasOwnProperty(v) && (d[v] = t[v]);
459
+ if (e && e.defaultProps) {
460
+ var g = e.defaultProps;
461
+ for (v in g)
462
+ d[v] === void 0 && (d[v] = g[v]);
463
+ }
464
+ if (u || C) {
465
+ var w = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
466
+ u && Tt(d, w), C && bt(d, w);
467
+ }
468
+ return St(e, u, C, p, s, Be.current, d);
469
+ }
470
+ }
471
+ var ve = N.ReactCurrentOwner, $e = N.ReactDebugCurrentFrame;
472
+ function Y(e) {
473
+ if (e) {
474
+ var t = e._owner, n = se(e.type, e._source, t ? t.type : null);
475
+ $e.setExtraStackFrame(n);
476
+ } else
477
+ $e.setExtraStackFrame(null);
478
+ }
479
+ var _e;
480
+ _e = !1;
481
+ function me(e) {
482
+ return typeof e == "object" && e !== null && e.$$typeof === i;
483
+ }
484
+ function We() {
485
+ {
486
+ if (ve.current) {
487
+ var e = H(ve.current.type);
488
+ if (e)
489
+ return `
490
+
491
+ Check the render method of \`` + e + "`.";
492
+ }
493
+ return "";
494
+ }
495
+ }
496
+ function Rt(e) {
497
+ return "";
498
+ }
499
+ var qe = {};
500
+ function Nt(e) {
501
+ {
502
+ var t = We();
503
+ if (!t) {
504
+ var n = typeof e == "string" ? e : e.displayName || e.name;
505
+ n && (t = `
506
+
507
+ Check the top-level render call using <` + n + ">.");
508
+ }
509
+ return t;
510
+ }
511
+ }
512
+ function Ye(e, t) {
513
+ {
514
+ if (!e._store || e._store.validated || e.key != null)
515
+ return;
516
+ e._store.validated = !0;
517
+ var n = Nt(t);
518
+ if (qe[n])
519
+ return;
520
+ qe[n] = !0;
521
+ var s = "";
522
+ e && e._owner && e._owner !== ve.current && (s = " It was passed a child from " + H(e._owner.type) + "."), Y(e), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, s), Y(null);
523
+ }
524
+ }
525
+ function Ge(e, t) {
526
+ {
527
+ if (typeof e != "object")
528
+ return;
529
+ if (pe(e))
530
+ for (var n = 0; n < e.length; n++) {
531
+ var s = e[n];
532
+ me(s) && Ye(s, t);
533
+ }
534
+ else if (me(e))
535
+ e._store && (e._store.validated = !0);
536
+ else if (e) {
537
+ var p = B(e);
538
+ if (typeof p == "function" && p !== e.entries)
539
+ for (var v = p.call(e), d; !(d = v.next()).done; )
540
+ me(d.value) && Ye(d.value, t);
541
+ }
542
+ }
543
+ }
544
+ function Ct(e) {
545
+ {
546
+ var t = e.type;
547
+ if (t == null || typeof t == "string")
548
+ return;
549
+ var n;
550
+ if (typeof t == "function")
551
+ n = t.propTypes;
552
+ else if (typeof t == "object" && (t.$$typeof === _ || // Note: Memo only checks outer props here.
553
+ // Inner props are checked in the reconciler.
554
+ t.$$typeof === S))
555
+ n = t.propTypes;
556
+ else
557
+ return;
558
+ if (n) {
559
+ var s = H(t);
560
+ pt(n, e.props, "prop", s, e);
561
+ } else if (t.PropTypes !== void 0 && !_e) {
562
+ _e = !0;
563
+ var p = H(t);
564
+ E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
565
+ }
566
+ typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
567
+ }
568
+ }
569
+ function At(e) {
570
+ {
571
+ for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
572
+ var s = t[n];
573
+ if (s !== "children" && s !== "key") {
574
+ Y(e), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), Y(null);
575
+ break;
576
+ }
577
+ }
578
+ e.ref !== null && (Y(e), E("Invalid attribute `ref` supplied to `React.Fragment`."), Y(null));
579
+ }
580
+ }
581
+ function ze(e, t, n, s, p, v) {
582
+ {
583
+ var d = it(e);
584
+ if (!d) {
585
+ var u = "";
586
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (u += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
587
+ var C = Rt();
588
+ C ? u += C : u += We();
589
+ var g;
590
+ e === null ? g = "null" : pe(e) ? g = "array" : e !== void 0 && e.$$typeof === i ? (g = "<" + (H(e.type) || "Unknown") + " />", u = " Did you accidentally export a JSX literal instead of a component?") : g = typeof e, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", g, u);
591
+ }
592
+ var w = xt(e, t, n, p, v);
593
+ if (w == null)
594
+ return w;
595
+ if (d) {
596
+ var A = t.children;
597
+ if (A !== void 0)
598
+ if (s)
599
+ if (pe(A)) {
600
+ for (var G = 0; G < A.length; G++)
601
+ Ge(A[G], e);
602
+ Object.freeze && Object.freeze(A);
603
+ } else
604
+ E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
605
+ else
606
+ Ge(A, e);
607
+ }
608
+ return e === l ? At(w) : Ct(w), w;
609
+ }
610
+ }
611
+ function It(e, t, n) {
612
+ return ze(e, t, n, !0);
613
+ }
614
+ function yt(e, t, n) {
615
+ return ze(e, t, n, !1);
616
+ }
617
+ var Pt = yt, jt = It;
618
+ Q.Fragment = l, Q.jsx = Pt, Q.jsxs = jt;
619
+ }()), Q;
620
+ }
621
+ process.env.NODE_ENV === "production" ? Ee.exports = Vt() : Ee.exports = $t();
622
+ var r = Ee.exports;
623
+ const D = {
624
+ SHOWROOM: "/showroom",
625
+ SENDOUTS: "/sendouts",
626
+ SENDOUTS_CMS: "/sendouts-cms",
627
+ MARKETING_ENGINE: "/media",
628
+ USER_MANAGEMENT: "/users",
629
+ TENANTS: "/tenants",
630
+ DASHBOARD: "/dashboard",
631
+ DASHBOARD_CREATE_WORKSPACE_MODAL: "/dashboard/create-workspace",
632
+ CREATE_WORKSPACE: "/create-workspace",
633
+ SETTINGS: "/settings",
634
+ INSTORE_ADMIN: "/instore-admin",
635
+ SUPERADMIN: "/superadmin",
636
+ CMS: "/cms"
637
+ }, Wt = 300, qt = 300;
638
+ var L = /* @__PURE__ */ ((a) => (a.OPEN = "OPEN", a.HIDDEN = "HIDDEN", a.EXPANDED = "EXPANDED", a))(L || {});
639
+ const Se = we.createContext(
640
+ {}
641
+ );
642
+ function W() {
643
+ return K(Se);
644
+ }
645
+ function Yt({
646
+ children: a,
647
+ isOpen: i,
648
+ onNavigationClose: f = () => {
649
+ }
650
+ }) {
651
+ const [l] = K(Te), [c, h] = ce({
652
+ selectedTenantId: l,
653
+ currentPosition: "HIDDEN"
654
+ /* HIDDEN */
655
+ }), { user: o, authService: T, canSignOut: _ } = K(et);
656
+ ge(() => {
657
+ if (i) {
658
+ h((P) => ({
659
+ ...P,
660
+ selectedTenantId: l,
661
+ currentPosition: "OPEN"
662
+ /* OPEN */
663
+ }));
664
+ return;
665
+ }
666
+ h((P) => ({
667
+ ...P,
668
+ currentPosition: "HIDDEN"
669
+ /* HIDDEN */
670
+ }));
671
+ }, [l, i, h]), ge(() => {
672
+ i && T.refreshUser(300);
673
+ }, [T, i]);
674
+ const x = I(
675
+ () => o ? k(
676
+ o,
677
+ c.selectedTenantId,
678
+ $.MARKETING_ENGINE_APP
679
+ ) : !1,
680
+ [c.selectedTenantId, o]
681
+ ), m = I(
682
+ () => o ? k(
683
+ o,
684
+ c.selectedTenantId,
685
+ $.SHOWROOM_APP
686
+ ) : !1,
687
+ [c.selectedTenantId, o]
688
+ ), S = I(
689
+ () => o ? k(
690
+ o,
691
+ c.selectedTenantId,
692
+ $.SENDOUTS_APP
693
+ ) : !1,
694
+ [c.selectedTenantId, o]
695
+ ), R = I(
696
+ () => o ? k(
697
+ o,
698
+ c.selectedTenantId,
699
+ $.SENDOUTS_CMS_APP
700
+ ) : !1,
701
+ [c.selectedTenantId, o]
702
+ ), y = I(
703
+ () => o ? k(
704
+ o,
705
+ c.selectedTenantId,
706
+ $.USER_MANAGEMENT_APP
707
+ ) : !1,
708
+ [c.selectedTenantId, o]
709
+ ), M = I(
710
+ () => o ? k(
711
+ o,
712
+ c.selectedTenantId,
713
+ $.UNIVERSAL
714
+ ) : !1,
715
+ [c.selectedTenantId, o]
716
+ ), U = I(
717
+ () => o ? k(o, c.selectedTenantId, "settings-app") : !1,
718
+ [c.selectedTenantId, o]
719
+ ), B = I(
720
+ () => o ? k(
721
+ o,
722
+ c.selectedTenantId,
723
+ $.INSTORE_ADMIN_APP
724
+ ) : !1,
725
+ [c.selectedTenantId, o]
726
+ ), N = z(
727
+ (P) => h((le) => ({
728
+ ...le,
729
+ ...P
730
+ })),
731
+ []
732
+ ), E = z(async () => {
733
+ _ && await T.signOut();
734
+ }, [T, _]), q = z(() => {
735
+ if (c.currentPosition === "OPEN") {
736
+ N({
737
+ currentPosition: "EXPANDED",
738
+ selectedTenantId: l
739
+ });
740
+ return;
741
+ }
742
+ if (c.currentPosition === "EXPANDED") {
743
+ N({
744
+ currentPosition: "OPEN"
745
+ /* OPEN */
746
+ });
747
+ return;
748
+ }
749
+ }, [l, N, c.currentPosition]), X = I(
750
+ () => ({
751
+ hasMarketingEngineAccess: x,
752
+ hasShowroomAccess: m,
753
+ hasSendoutsAccess: S,
754
+ hasCmsAccess: R,
755
+ hasUserManagementAccess: y,
756
+ hasUniversalAccess: M,
757
+ hasSettingsAccess: U,
758
+ hasInstoreAccess: B,
759
+ viewState: c,
760
+ updateViewState: N,
761
+ signOut: E,
762
+ toggleTenants: q,
763
+ onNavigationClose: f
764
+ }),
765
+ [
766
+ x,
767
+ S,
768
+ R,
769
+ m,
770
+ y,
771
+ M,
772
+ U,
773
+ B,
774
+ c,
775
+ N,
776
+ E,
777
+ q,
778
+ f
779
+ ]
780
+ );
781
+ return /* @__PURE__ */ r.jsx(Se.Provider, { value: X, children: a });
782
+ }
783
+ const Gt = "_navigation_1esaw_1", zt = {
784
+ navigation: Gt
785
+ }, Kt = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.398438%200.399902L19.5984%2019.5999M0.398438%2019.5999L19.5984%200.399902'%20stroke='black'/%3e%3c/svg%3e", Xt = "data:image/svg+xml,%3csvg%20width='14'%20height='15'%20viewBox='0%200%2014%2015'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7%201.5999L10.4667%204.7999M7%201.5999L3.8%204.7999M7%201.5999L7%2011.7332M13.4%207.46657L13.4%2014.3999L0.600002%2014.3999L0.600002%207.46657'%20stroke='%232D2D33'/%3e%3c/svg%3e", Jt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%2046%2046'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%20transform='matrix(1,0,0,1,-27,-27)'%3e%3cpath%20d='M73,50C73,37.3%2062.7,27%2050,27C37.3,27%2027,37.3%2027,50M30.9,50C30.9,39.5%2039.4,30.9%2050,30.9C60.6,30.9%2069.1,39.5%2069.1,50'%20style='fill-rule:nonzero;'%3e%3canimateTransform%20attributeName='transform'%20attributeType='XML'%20type='rotate'%20dur='1s'%20from='0%2050%2050'%20to='360%2050%2050'%20repeatCount='indefinite'%20/%3e%3c/path%3e%3c/g%3e%3c/svg%3e", Zt = () => {
786
+ const a = process.env.TENANTS_SERVICE_URL ?? process.env.REACT_APP_TENANTS_SERVICE_URL;
787
+ if (!a)
788
+ throw new Error(
789
+ "TENANTS_SERVICE_URL or REACT_APP_TENANTS_SERVICE_URL must be set"
790
+ );
791
+ return nt(
792
+ a,
793
+ "/api/Subscriptions/create-customer-portal-session"
794
+ );
795
+ };
796
+ function Qt() {
797
+ const a = tt(), i = Zt(), { viewState: f } = W(), [l] = K(Te);
798
+ return z(
799
+ async (h) => {
800
+ const o = h.replace(/^\//, "");
801
+ a.setHeader("tenant-id", f.selectedTenantId);
802
+ try {
803
+ return await a.post(
804
+ i,
805
+ o
806
+ );
807
+ } finally {
808
+ l && a.setHeader("tenant-id", l);
809
+ }
810
+ },
811
+ [a, i, f, l]
812
+ );
813
+ }
814
+ function en() {
815
+ const a = process.env.TENANTS_SERVICE_URL ?? process.env.REACT_APP_TENANTS_SERVICE_URL;
816
+ if (!a)
817
+ throw new Error(
818
+ "TENANTS_SERVICE_URL or REACT_APP_TENANTS_SERVICE_URL must be set"
819
+ );
820
+ return nt(a, "/api/Tenants/view");
821
+ }
822
+ function xe() {
823
+ const a = tt(), i = en(), { data: f, error: l } = Ut(i, a.get);
824
+ return {
825
+ tenants: f ?? [],
826
+ isLoading: !f && !l,
827
+ error: l
828
+ };
829
+ }
830
+ function tn() {
831
+ const {
832
+ viewState: { selectedTenantId: a }
833
+ } = W(), { tenants: i } = xe();
834
+ return I(() => i.find((l) => l.id === a), [i, a]);
835
+ }
836
+ function nn({ layout: a }) {
837
+ const {
838
+ viewState: { selectedTenantId: i }
839
+ } = W(), { tenants: f } = xe(), l = I(
840
+ () => f.find((c) => c.id === i),
841
+ [i, f]
842
+ );
843
+ return l ? /* @__PURE__ */ r.jsx(Ft, { src: l.logoUrl, layout: a }) : null;
844
+ }
845
+ const rn = "_tier_1cqnw_1", an = "_tier-header_1cqnw_12", sn = "_border_1cqnw_17", on = "_tier-main_1cqnw_21", cn = "_tier-footer_1cqnw_26", ee = {
846
+ tier: rn,
847
+ tierHeader: an,
848
+ border: sn,
849
+ tierMain: on,
850
+ tierFooter: cn
851
+ };
852
+ function rt({
853
+ children: a,
854
+ header: i,
855
+ footer: f,
856
+ className: l,
857
+ width: c,
858
+ showHeaderBorder: h
859
+ }) {
860
+ return /* @__PURE__ */ r.jsxs("div", { className: ne([ee.tier, l]), style: { width: c }, children: [
861
+ !!i && /* @__PURE__ */ r.jsx(
862
+ "div",
863
+ {
864
+ className: ne([
865
+ ee.tierHeader,
866
+ { [ee.border]: h }
867
+ ]),
868
+ children: i
869
+ }
870
+ ),
871
+ /* @__PURE__ */ r.jsx("div", { className: ee.tierMain, children: a }),
872
+ !!f && /* @__PURE__ */ r.jsx("div", { className: ee.tierFooter, children: f })
873
+ ] });
874
+ }
875
+ const ln = "_navigation-button_1ckcy_1", un = "_active_1ckcy_15", Ze = {
876
+ navigationButton: ln,
877
+ active: un
878
+ };
879
+ function O({
880
+ children: a,
881
+ to: i,
882
+ hidden: f,
883
+ disabled: l,
884
+ onClick: c
885
+ }) {
886
+ const [h, o] = K(Te), [T, _] = ce(!1), {
887
+ viewState: { selectedTenantId: x }
888
+ } = W();
889
+ ge(() => {
890
+ const R = () => {
891
+ h !== x && T && o(x);
892
+ };
893
+ return window.addEventListener("unload", R), () => {
894
+ window.removeEventListener("unload", R);
895
+ };
896
+ }, [o, h, x, T]);
897
+ const m = z(() => {
898
+ if (c) {
899
+ c(_);
900
+ return;
901
+ }
902
+ i && (_(!0), window.location.assign(i));
903
+ }, [i, c]), S = i ? !!Bt(`${i}/*`, window.location.pathname) && h === x : !1;
904
+ return f ? null : /* @__PURE__ */ r.jsx(
905
+ be,
906
+ {
907
+ align: "left",
908
+ noBorder: !0,
909
+ className: ne([Ze.navigationButton, { [Ze.active]: S }]),
910
+ noShadow: !0,
911
+ disabled: S || l,
912
+ onClick: m,
913
+ children: a
914
+ }
915
+ );
916
+ }
917
+ const dn = "_applications_1pwbq_1", fn = "_applications-header_1pwbq_7", pn = "_applications-header-brand_1pwbq_13", vn = "_applications-header-logo_1pwbq_21", _n = "_applications-header-close-icon_1pwbq_26", mn = "_applications-header-change-brand-button_1pwbq_32", hn = "_applications-main_1pwbq_47", gn = "_applications-main-content_1pwbq_51", En = "_applications-main-list_1pwbq_58", wn = "_applications-main-user_1pwbq_74", Tn = "_applications-main-user-name_1pwbq_81", bn = "_applications-main-user-email_1pwbq_82", Sn = "_applications-footer_1pwbq_101", xn = "_applications-footer-sign-out_1pwbq_109", Rn = "_applications-footer-sign-out-icon_1pwbq_115", Nn = "_applications-footer-sign-out-label_1pwbq_119", Cn = "_error-anim_1pwbq_161", An = "_error-text_1pwbq_169", b = {
918
+ applications: dn,
919
+ applicationsHeader: fn,
920
+ applicationsHeaderBrand: pn,
921
+ applicationsHeaderLogo: vn,
922
+ applicationsHeaderCloseIcon: _n,
923
+ applicationsHeaderChangeBrandButton: mn,
924
+ applicationsMain: hn,
925
+ applicationsMainContent: gn,
926
+ applicationsMainList: En,
927
+ applicationsMainUser: wn,
928
+ applicationsMainUserName: Tn,
929
+ applicationsMainUserEmail: bn,
930
+ applicationsFooter: Sn,
931
+ applicationsFooterSignOut: xn,
932
+ applicationsFooterSignOutIcon: Rn,
933
+ applicationsFooterSignOutLabel: Nn,
934
+ errorAnim: Cn,
935
+ errorText: An
936
+ }, In = (a) => new Promise((i) => setTimeout(i, a));
937
+ function yn() {
938
+ const { user: a } = K(et), {
939
+ signOut: i,
940
+ onNavigationClose: f,
941
+ toggleTenants: l,
942
+ hasShowroomAccess: c,
943
+ hasMarketingEngineAccess: h,
944
+ hasSendoutsAccess: o,
945
+ hasCmsAccess: T,
946
+ hasUserManagementAccess: _,
947
+ hasSettingsAccess: x,
948
+ hasUniversalAccess: m,
949
+ hasInstoreAccess: S
950
+ } = W(), R = tn(), y = R && !!R.planName, [M, U] = ce(!1), [B, N] = ce(!1), E = Qt(), q = z(
951
+ async (X) => {
952
+ try {
953
+ N(!0);
954
+ const P = await E(window.location.pathname);
955
+ X(!0), window.location.assign(P.text);
956
+ } catch {
957
+ N(!1), U(!0), await In(2500), U(!1);
958
+ }
959
+ },
960
+ [N, E]
961
+ );
962
+ return /* @__PURE__ */ r.jsx(
963
+ rt,
964
+ {
965
+ className: b.applications,
966
+ width: qt,
967
+ showHeaderBorder: !0,
968
+ header: /* @__PURE__ */ r.jsxs("div", { className: b.applicationsHeader, children: [
969
+ /* @__PURE__ */ r.jsxs("div", { className: b.applicationsHeaderBrand, children: [
970
+ /* @__PURE__ */ r.jsx("div", { className: b.applicationsHeaderLogo, children: /* @__PURE__ */ r.jsx(nn, {}) }),
971
+ /* @__PURE__ */ r.jsx(
972
+ "div",
973
+ {
974
+ className: b.applicationsHeaderCloseIcon,
975
+ onClick: f,
976
+ children: /* @__PURE__ */ r.jsx(te, { src: Kt, size: "large" })
977
+ }
978
+ )
979
+ ] }),
980
+ /* @__PURE__ */ r.jsx(
981
+ be,
982
+ {
983
+ align: "left",
984
+ noBorder: !0,
985
+ transparent: !0,
986
+ className: b.applicationsHeaderChangeBrandButton,
987
+ onClick: l,
988
+ children: "Change brand"
989
+ }
990
+ )
991
+ ] }),
992
+ footer: /* @__PURE__ */ r.jsx("div", { className: b.applicationsFooter, onClick: i, children: /* @__PURE__ */ r.jsxs("div", { className: b.applicationsFooterSignOut, children: [
993
+ /* @__PURE__ */ r.jsx("div", { className: b.applicationsFooterSignOutIcon, children: /* @__PURE__ */ r.jsx(te, { src: Xt, size: "medium" }) }),
994
+ /* @__PURE__ */ r.jsx("div", { className: b.applicationsFooterSignOutLabel, children: "Sign out" })
995
+ ] }) }),
996
+ children: /* @__PURE__ */ r.jsx("div", { className: b.applicationsMain, children: /* @__PURE__ */ r.jsxs("div", { className: b.applicationsMainContent, children: [
997
+ /* @__PURE__ */ r.jsxs("div", { className: b.applicationsMainList, children: [
998
+ /* @__PURE__ */ r.jsx(O, { to: D.DASHBOARD, children: "Dashboard" }),
999
+ /* @__PURE__ */ r.jsx(O, { hidden: !c, to: D.SHOWROOM, children: "Presentations (Showroom)" }),
1000
+ /* @__PURE__ */ r.jsx(O, { hidden: !o, to: D.SENDOUTS, children: "Sendouts" }),
1001
+ /* @__PURE__ */ r.jsx(
1002
+ O,
1003
+ {
1004
+ hidden: !h,
1005
+ to: D.MARKETING_ENGINE,
1006
+ children: "Media Library"
1007
+ }
1008
+ ),
1009
+ /* @__PURE__ */ r.jsx(
1010
+ O,
1011
+ {
1012
+ hidden: !S && !m,
1013
+ to: D.INSTORE_ADMIN,
1014
+ children: "Stores"
1015
+ }
1016
+ ),
1017
+ /* @__PURE__ */ r.jsx(O, { hidden: !T, to: D.CMS, children: "Content Manager" }),
1018
+ /* @__PURE__ */ r.jsx(
1019
+ O,
1020
+ {
1021
+ hidden: !_,
1022
+ to: D.USER_MANAGEMENT,
1023
+ children: "Users"
1024
+ }
1025
+ ),
1026
+ /* @__PURE__ */ r.jsx(
1027
+ O,
1028
+ {
1029
+ hidden: !m && !x,
1030
+ to: D.SETTINGS,
1031
+ children: "Settings"
1032
+ }
1033
+ ),
1034
+ /* @__PURE__ */ r.jsxs(
1035
+ O,
1036
+ {
1037
+ disabled: B,
1038
+ onClick: q,
1039
+ hidden: !m || !y,
1040
+ to: "#",
1041
+ children: [
1042
+ /* @__PURE__ */ r.jsx(
1043
+ "span",
1044
+ {
1045
+ className: ne({
1046
+ [b.errorAnim]: M
1047
+ }),
1048
+ children: "Subscription"
1049
+ }
1050
+ ),
1051
+ B ? /* @__PURE__ */ r.jsx(te, { size: "xlarge", src: Jt, alt: "Loading" }) : ""
1052
+ ]
1053
+ }
1054
+ ),
1055
+ M ? /* @__PURE__ */ r.jsx("p", { className: b.errorText, children: "Unable to access subscription page" }) : null
1056
+ ] }),
1057
+ a && /* @__PURE__ */ r.jsxs("div", { className: b.applicationsMainUser, children: [
1058
+ /* @__PURE__ */ r.jsxs("div", { className: b.applicationsMainUserName, children: [
1059
+ a.firstName,
1060
+ " ",
1061
+ a.lastName
1062
+ ] }),
1063
+ /* @__PURE__ */ r.jsx("div", { className: b.applicationsMainUserEmail, children: a.email })
1064
+ ] })
1065
+ ] }) })
1066
+ }
1067
+ );
1068
+ }
1069
+ const Pn = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.00170906%207L13.0017%207M6.50171%2013.5L6.50171%200.5'%20stroke='%232D2D33'/%3e%3c/svg%3e", jn = "data:image/svg+xml,%3csvg%20width='22'%20height='14'%20viewBox='0%200%2022%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.6001%207.00039L8.0001%2013.4004M1.6001%207.00039L8.0001%200.600391M1.6001%207.00039L21.6001%207.00039'%20stroke='%23262626'/%3e%3c/svg%3e", On = "_tenant-button_1m8mx_1", Dn = "_active_1m8mx_15", Qe = {
1070
+ tenantButton: On,
1071
+ active: Dn
1072
+ };
1073
+ function Mn({ tenant: a }) {
1074
+ const {
1075
+ viewState: { selectedTenantId: i },
1076
+ updateViewState: f
1077
+ } = W(), l = i === a.id;
1078
+ return /* @__PURE__ */ r.jsx(
1079
+ be,
1080
+ {
1081
+ align: "left",
1082
+ noBorder: !0,
1083
+ className: ne([Qe.tenantButton, { [Qe.active]: l }]),
1084
+ noShadow: !0,
1085
+ disabled: l,
1086
+ onClick: () => {
1087
+ f({
1088
+ selectedTenantId: a.id,
1089
+ currentPosition: L.OPEN
1090
+ });
1091
+ },
1092
+ children: a.label
1093
+ },
1094
+ a.id
1095
+ );
1096
+ }
1097
+ const kn = "_tenants_6vjyd_1", Fn = "_tenants-header_6vjyd_7", Ln = "_tenants-header-arrow-icon_6vjyd_11", Un = "_tenants-main_6vjyd_24", Bn = "_tenants-footer_6vjyd_42", Hn = "_tenants-footer-create-brand_6vjyd_50", Vn = "_tenants-footer-create-brand-icon_6vjyd_56", $n = "_tenants-footer-create-brand-label_6vjyd_60", F = {
1098
+ tenants: kn,
1099
+ tenantsHeader: Fn,
1100
+ tenantsHeaderArrowIcon: Ln,
1101
+ tenantsMain: Un,
1102
+ tenantsFooter: Bn,
1103
+ tenantsFooterCreateBrand: Hn,
1104
+ tenantsFooterCreateBrandIcon: Vn,
1105
+ tenantsFooterCreateBrandLabel: $n
1106
+ };
1107
+ function Wn() {
1108
+ const { toggleTenants: a } = W(), { tenants: i } = xe();
1109
+ return /* @__PURE__ */ r.jsx("div", { className: F.tenants, children: /* @__PURE__ */ r.jsx(
1110
+ rt,
1111
+ {
1112
+ width: Wt,
1113
+ header: /* @__PURE__ */ r.jsx("div", { className: F.tenantsHeader, children: /* @__PURE__ */ r.jsx("div", { className: F.tenantsHeaderArrowIcon, onClick: a, children: /* @__PURE__ */ r.jsx(te, { src: jn, size: "large" }) }) }),
1114
+ footer: /* @__PURE__ */ r.jsx(
1115
+ "div",
1116
+ {
1117
+ className: F.tenantsFooter,
1118
+ onClick: () => window.location.assign(D.CREATE_WORKSPACE),
1119
+ children: /* @__PURE__ */ r.jsxs("div", { className: F.tenantsFooterCreateBrand, children: [
1120
+ /* @__PURE__ */ r.jsx("div", { className: F.tenantsFooterCreateBrandIcon, children: /* @__PURE__ */ r.jsx(te, { src: Pn, size: "medium" }) }),
1121
+ /* @__PURE__ */ r.jsx("div", { className: F.tenantsFooterCreateBrandLabel, children: "Create a brand workspace" })
1122
+ ] })
1123
+ }
1124
+ ),
1125
+ children: /* @__PURE__ */ r.jsx("div", { className: F.tenantsMain, children: i.map((f) => /* @__PURE__ */ r.jsx(Mn, { tenant: f }, f.id)) })
1126
+ }
1127
+ ) });
1128
+ }
1129
+ const qn = "_tiers_dtxbu_1", Yn = {
1130
+ tiers: qn
1131
+ };
1132
+ function Gn() {
1133
+ return /* @__PURE__ */ r.jsxs("div", { className: Yn.tiers, children: [
1134
+ /* @__PURE__ */ r.jsx(yn, {}),
1135
+ /* @__PURE__ */ r.jsx(Wn, {})
1136
+ ] });
1137
+ }
1138
+ const he = { ease: "easeOut", duration: 0.3 }, zn = {
1139
+ [L.HIDDEN]: {
1140
+ left: -600,
1141
+ transition: he
1142
+ },
1143
+ [L.OPEN]: {
1144
+ left: -300,
1145
+ transition: he
1146
+ },
1147
+ [L.EXPANDED]: { left: 0, transition: he }
1148
+ };
1149
+ function Kn({
1150
+ isOpen: a,
1151
+ portalContainer: i = document.body,
1152
+ onClose: f
1153
+ }) {
1154
+ return (
1155
+ // Using framer-motion lib to animate the navigation component on mount/unmount
1156
+ // Also to prevent any api calls from being made when the navigation (Tiers component) is hidden
1157
+ /* @__PURE__ */ r.jsx(Yt, { onNavigationClose: f, isOpen: a, children: /* @__PURE__ */ r.jsx(Se.Consumer, { children: ({ viewState: { currentPosition: l } }) => kt(
1158
+ /* @__PURE__ */ r.jsx(Dt, { children: l !== L.HIDDEN && /* @__PURE__ */ r.jsx(
1159
+ Mt.div,
1160
+ {
1161
+ className: zt.navigation,
1162
+ initial: L.HIDDEN,
1163
+ variants: zn,
1164
+ animate: l,
1165
+ exit: L.HIDDEN,
1166
+ children: /* @__PURE__ */ r.jsx(Gn, {})
1167
+ }
1168
+ ) }),
1169
+ i
1170
+ ) }) })
1171
+ );
1172
+ }
1173
+ const Xn = "data:image/svg+xml,%3csvg%20width='14'%20height='15'%20viewBox='0%200%2014%2011'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.5H14M0%205.5H14M0%209.5H14M0'%20stroke='black'/%3e%3c/svg%3e";
1174
+ function cr({
1175
+ size: a = "medium",
1176
+ alt: i = "Toggle navigation menu",
1177
+ src: f = Xn,
1178
+ portalContainer: l = document.body,
1179
+ ...c
1180
+ }) {
1181
+ const [h, o] = Ht(!1);
1182
+ return /* @__PURE__ */ r.jsxs(Ot, { children: [
1183
+ /* @__PURE__ */ r.jsx(
1184
+ Lt,
1185
+ {
1186
+ size: a,
1187
+ alt: i,
1188
+ src: f,
1189
+ onClick: () => o(),
1190
+ ...c
1191
+ }
1192
+ ),
1193
+ /* @__PURE__ */ r.jsx(
1194
+ Kn,
1195
+ {
1196
+ isOpen: h,
1197
+ portalContainer: l,
1198
+ onClose: () => o()
1199
+ }
1200
+ )
1201
+ ] });
1202
+ }
1203
+ export {
1204
+ qt as APPLICATIONS_TIER_WIDTH,
1205
+ D as AppPaths,
1206
+ Kn as Navigation,
1207
+ cr as NavigationButton,
1208
+ Wt as TENANTS_TIER_WIDTH
1209
+ };
1210
+ //# sourceMappingURL=index.mjs.map