@iblai/iblai-js 1.4.2 → 1.4.4
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/data-layer/playwright/audit-log-helpers.d.ts +119 -0
- package/dist/data-layer/playwright/index.d.ts +1 -0
- package/dist/data-layer/playwright/shared-test-helpers.d.ts +12 -0
- package/dist/playwright/index.cjs +535 -109
- package/dist/playwright/index.cjs.map +1 -1
- package/dist/playwright/index.d.ts +120 -1
- package/dist/playwright/index.esm.js +510 -110
- package/dist/playwright/index.esm.js.map +1 -1
- package/dist/playwright/playwright/audit-log-helpers.d.ts +119 -0
- package/dist/playwright/playwright/index.d.ts +1 -0
- package/dist/playwright/playwright/shared-test-helpers.d.ts +12 -0
- package/dist/web-containers/playwright/audit-log-helpers.d.ts +119 -0
- package/dist/web-containers/playwright/index.d.ts +1 -0
- package/dist/web-containers/playwright/shared-test-helpers.d.ts +12 -0
- package/dist/web-containers/source/index.esm.js +1458 -655
- package/dist/web-containers/source/next/index.esm.js +950 -406
- package/dist/web-utils/playwright/audit-log-helpers.d.ts +119 -0
- package/dist/web-utils/playwright/index.d.ts +1 -0
- package/dist/web-utils/playwright/shared-test-helpers.d.ts +12 -0
- package/package.json +5 -5
|
@@ -229,7 +229,7 @@ function createSlot$3(ownerName) {
|
|
|
229
229
|
Slot2.displayName = `${ownerName}.Slot`;
|
|
230
230
|
return Slot2;
|
|
231
231
|
}
|
|
232
|
-
var Slot$
|
|
232
|
+
var Slot$7 = /* @__PURE__ */ createSlot$3("Slot");
|
|
233
233
|
// @__NO_SIDE_EFFECTS__
|
|
234
234
|
function createSlotClone$3(ownerName) {
|
|
235
235
|
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
@@ -4792,7 +4792,7 @@ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whites
|
|
|
4792
4792
|
},
|
|
4793
4793
|
});
|
|
4794
4794
|
const Button$1 = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
4795
|
-
const Comp = asChild ? Slot$
|
|
4795
|
+
const Comp = asChild ? Slot$7 : "button";
|
|
4796
4796
|
return (jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref: ref, ...props }));
|
|
4797
4797
|
});
|
|
4798
4798
|
Button$1.displayName = "Button";
|
|
@@ -15521,12 +15521,12 @@ const __iconNode$hY = [
|
|
|
15521
15521
|
{ d: "M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3", key: "11bfej" }
|
|
15522
15522
|
]
|
|
15523
15523
|
];
|
|
15524
|
-
const Command = createLucideIcon("command", __iconNode$hY);
|
|
15524
|
+
const Command$1 = createLucideIcon("command", __iconNode$hY);
|
|
15525
15525
|
|
|
15526
15526
|
var command$1 = /*#__PURE__*/Object.freeze({
|
|
15527
15527
|
__proto__: null,
|
|
15528
15528
|
__iconNode: __iconNode$hY,
|
|
15529
|
-
default: Command
|
|
15529
|
+
default: Command$1
|
|
15530
15530
|
});
|
|
15531
15531
|
|
|
15532
15532
|
/**
|
|
@@ -20387,7 +20387,7 @@ const __iconNode$eQ = [
|
|
|
20387
20387
|
];
|
|
20388
20388
|
const Focus = createLucideIcon("focus", __iconNode$eQ);
|
|
20389
20389
|
|
|
20390
|
-
var focus$
|
|
20390
|
+
var focus$4 = /*#__PURE__*/Object.freeze({
|
|
20391
20391
|
__proto__: null,
|
|
20392
20392
|
__iconNode: __iconNode$eQ,
|
|
20393
20393
|
default: Focus
|
|
@@ -43560,12 +43560,12 @@ const __iconNode$5 = [
|
|
|
43560
43560
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
43561
43561
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
43562
43562
|
];
|
|
43563
|
-
const X = createLucideIcon("x", __iconNode$5);
|
|
43563
|
+
const X$1 = createLucideIcon("x", __iconNode$5);
|
|
43564
43564
|
|
|
43565
43565
|
var x$1 = /*#__PURE__*/Object.freeze({
|
|
43566
43566
|
__proto__: null,
|
|
43567
43567
|
__iconNode: __iconNode$5,
|
|
43568
|
-
default: X
|
|
43568
|
+
default: X$1
|
|
43569
43569
|
});
|
|
43570
43570
|
|
|
43571
43571
|
/**
|
|
@@ -44240,22 +44240,22 @@ function handleAndDispatchCustomEvent$4(name, handler, detail, { discrete }) {
|
|
|
44240
44240
|
}
|
|
44241
44241
|
}
|
|
44242
44242
|
|
|
44243
|
-
var count$
|
|
44244
|
-
function useFocusGuards() {
|
|
44243
|
+
var count$2 = 0;
|
|
44244
|
+
function useFocusGuards$1() {
|
|
44245
44245
|
React.useEffect(() => {
|
|
44246
44246
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
44247
|
-
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
44248
|
-
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
44249
|
-
count$
|
|
44247
|
+
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard$1());
|
|
44248
|
+
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard$1());
|
|
44249
|
+
count$2++;
|
|
44250
44250
|
return () => {
|
|
44251
|
-
if (count$
|
|
44251
|
+
if (count$2 === 1) {
|
|
44252
44252
|
document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
|
|
44253
44253
|
}
|
|
44254
|
-
count$
|
|
44254
|
+
count$2--;
|
|
44255
44255
|
};
|
|
44256
44256
|
}, []);
|
|
44257
44257
|
}
|
|
44258
|
-
function createFocusGuard() {
|
|
44258
|
+
function createFocusGuard$1() {
|
|
44259
44259
|
const element = document.createElement("span");
|
|
44260
44260
|
element.setAttribute("data-radix-focus-guard", "");
|
|
44261
44261
|
element.tabIndex = 0;
|
|
@@ -44266,11 +44266,11 @@ function createFocusGuard() {
|
|
|
44266
44266
|
return element;
|
|
44267
44267
|
}
|
|
44268
44268
|
|
|
44269
|
-
var AUTOFOCUS_ON_MOUNT$
|
|
44270
|
-
var AUTOFOCUS_ON_UNMOUNT$
|
|
44271
|
-
var EVENT_OPTIONS$
|
|
44272
|
-
var FOCUS_SCOPE_NAME$
|
|
44273
|
-
var FocusScope$
|
|
44269
|
+
var AUTOFOCUS_ON_MOUNT$2 = "focusScope.autoFocusOnMount";
|
|
44270
|
+
var AUTOFOCUS_ON_UNMOUNT$2 = "focusScope.autoFocusOnUnmount";
|
|
44271
|
+
var EVENT_OPTIONS$3 = { bubbles: false, cancelable: true };
|
|
44272
|
+
var FOCUS_SCOPE_NAME$2 = "FocusScope";
|
|
44273
|
+
var FocusScope$2 = React.forwardRef((props, forwardedRef) => {
|
|
44274
44274
|
const {
|
|
44275
44275
|
loop = false,
|
|
44276
44276
|
trapped = false,
|
|
@@ -44300,20 +44300,20 @@ var FocusScope$1 = React.forwardRef((props, forwardedRef) => {
|
|
|
44300
44300
|
if (container.contains(target)) {
|
|
44301
44301
|
lastFocusedElementRef.current = target;
|
|
44302
44302
|
} else {
|
|
44303
|
-
focus$
|
|
44303
|
+
focus$3(lastFocusedElementRef.current, { select: true });
|
|
44304
44304
|
}
|
|
44305
44305
|
}, handleFocusOut2 = function(event) {
|
|
44306
44306
|
if (focusScope.paused || !container) return;
|
|
44307
44307
|
const relatedTarget = event.relatedTarget;
|
|
44308
44308
|
if (relatedTarget === null) return;
|
|
44309
44309
|
if (!container.contains(relatedTarget)) {
|
|
44310
|
-
focus$
|
|
44310
|
+
focus$3(lastFocusedElementRef.current, { select: true });
|
|
44311
44311
|
}
|
|
44312
44312
|
}, handleMutations2 = function(mutations) {
|
|
44313
44313
|
const focusedElement = document.activeElement;
|
|
44314
44314
|
if (focusedElement !== document.body) return;
|
|
44315
44315
|
for (const mutation of mutations) {
|
|
44316
|
-
if (mutation.removedNodes.length > 0) focus$
|
|
44316
|
+
if (mutation.removedNodes.length > 0) focus$3(container);
|
|
44317
44317
|
}
|
|
44318
44318
|
};
|
|
44319
44319
|
document.addEventListener("focusin", handleFocusIn2);
|
|
@@ -44329,31 +44329,31 @@ var FocusScope$1 = React.forwardRef((props, forwardedRef) => {
|
|
|
44329
44329
|
}, [trapped, container, focusScope.paused]);
|
|
44330
44330
|
React.useEffect(() => {
|
|
44331
44331
|
if (container) {
|
|
44332
|
-
focusScopesStack$
|
|
44332
|
+
focusScopesStack$2.add(focusScope);
|
|
44333
44333
|
const previouslyFocusedElement = document.activeElement;
|
|
44334
44334
|
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
44335
44335
|
if (!hasFocusedCandidate) {
|
|
44336
|
-
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT$
|
|
44337
|
-
container.addEventListener(AUTOFOCUS_ON_MOUNT$
|
|
44336
|
+
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT$2, EVENT_OPTIONS$3);
|
|
44337
|
+
container.addEventListener(AUTOFOCUS_ON_MOUNT$2, onMountAutoFocus);
|
|
44338
44338
|
container.dispatchEvent(mountEvent);
|
|
44339
44339
|
if (!mountEvent.defaultPrevented) {
|
|
44340
|
-
focusFirst$
|
|
44340
|
+
focusFirst$5(removeLinks$2(getTabbableCandidates$3(container)), { select: true });
|
|
44341
44341
|
if (document.activeElement === previouslyFocusedElement) {
|
|
44342
|
-
focus$
|
|
44342
|
+
focus$3(container);
|
|
44343
44343
|
}
|
|
44344
44344
|
}
|
|
44345
44345
|
}
|
|
44346
44346
|
return () => {
|
|
44347
|
-
container.removeEventListener(AUTOFOCUS_ON_MOUNT$
|
|
44347
|
+
container.removeEventListener(AUTOFOCUS_ON_MOUNT$2, onMountAutoFocus);
|
|
44348
44348
|
setTimeout(() => {
|
|
44349
|
-
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT$
|
|
44350
|
-
container.addEventListener(AUTOFOCUS_ON_UNMOUNT$
|
|
44349
|
+
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT$2, EVENT_OPTIONS$3);
|
|
44350
|
+
container.addEventListener(AUTOFOCUS_ON_UNMOUNT$2, onUnmountAutoFocus);
|
|
44351
44351
|
container.dispatchEvent(unmountEvent);
|
|
44352
44352
|
if (!unmountEvent.defaultPrevented) {
|
|
44353
|
-
focus$
|
|
44353
|
+
focus$3(previouslyFocusedElement ?? document.body, { select: true });
|
|
44354
44354
|
}
|
|
44355
|
-
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT$
|
|
44356
|
-
focusScopesStack$
|
|
44355
|
+
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT$2, onUnmountAutoFocus);
|
|
44356
|
+
focusScopesStack$2.remove(focusScope);
|
|
44357
44357
|
}, 0);
|
|
44358
44358
|
};
|
|
44359
44359
|
}
|
|
@@ -44366,17 +44366,17 @@ var FocusScope$1 = React.forwardRef((props, forwardedRef) => {
|
|
|
44366
44366
|
const focusedElement = document.activeElement;
|
|
44367
44367
|
if (isTabKey && focusedElement) {
|
|
44368
44368
|
const container2 = event.currentTarget;
|
|
44369
|
-
const [first, last] = getTabbableEdges$
|
|
44369
|
+
const [first, last] = getTabbableEdges$2(container2);
|
|
44370
44370
|
const hasTabbableElementsInside = first && last;
|
|
44371
44371
|
if (!hasTabbableElementsInside) {
|
|
44372
44372
|
if (focusedElement === container2) event.preventDefault();
|
|
44373
44373
|
} else {
|
|
44374
44374
|
if (!event.shiftKey && focusedElement === last) {
|
|
44375
44375
|
event.preventDefault();
|
|
44376
|
-
if (loop) focus$
|
|
44376
|
+
if (loop) focus$3(first, { select: true });
|
|
44377
44377
|
} else if (event.shiftKey && focusedElement === first) {
|
|
44378
44378
|
event.preventDefault();
|
|
44379
|
-
if (loop) focus$
|
|
44379
|
+
if (loop) focus$3(last, { select: true });
|
|
44380
44380
|
}
|
|
44381
44381
|
}
|
|
44382
44382
|
}
|
|
@@ -44385,21 +44385,21 @@ var FocusScope$1 = React.forwardRef((props, forwardedRef) => {
|
|
|
44385
44385
|
);
|
|
44386
44386
|
return /* @__PURE__ */ jsx(Primitive$5.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
44387
44387
|
});
|
|
44388
|
-
FocusScope$
|
|
44389
|
-
function focusFirst$
|
|
44388
|
+
FocusScope$2.displayName = FOCUS_SCOPE_NAME$2;
|
|
44389
|
+
function focusFirst$5(candidates, { select = false } = {}) {
|
|
44390
44390
|
const previouslyFocusedElement = document.activeElement;
|
|
44391
44391
|
for (const candidate of candidates) {
|
|
44392
|
-
focus$
|
|
44392
|
+
focus$3(candidate, { select });
|
|
44393
44393
|
if (document.activeElement !== previouslyFocusedElement) return;
|
|
44394
44394
|
}
|
|
44395
44395
|
}
|
|
44396
|
-
function getTabbableEdges$
|
|
44397
|
-
const candidates = getTabbableCandidates$
|
|
44398
|
-
const first = findVisible$
|
|
44399
|
-
const last = findVisible$
|
|
44396
|
+
function getTabbableEdges$2(container) {
|
|
44397
|
+
const candidates = getTabbableCandidates$3(container);
|
|
44398
|
+
const first = findVisible$2(candidates, container);
|
|
44399
|
+
const last = findVisible$2(candidates.reverse(), container);
|
|
44400
44400
|
return [first, last];
|
|
44401
44401
|
}
|
|
44402
|
-
function getTabbableCandidates$
|
|
44402
|
+
function getTabbableCandidates$3(container) {
|
|
44403
44403
|
const nodes = [];
|
|
44404
44404
|
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
44405
44405
|
acceptNode: (node) => {
|
|
@@ -44411,12 +44411,12 @@ function getTabbableCandidates$2(container) {
|
|
|
44411
44411
|
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
44412
44412
|
return nodes;
|
|
44413
44413
|
}
|
|
44414
|
-
function findVisible$
|
|
44414
|
+
function findVisible$2(elements, container) {
|
|
44415
44415
|
for (const element of elements) {
|
|
44416
|
-
if (!isHidden$
|
|
44416
|
+
if (!isHidden$2(element, { upTo: container })) return element;
|
|
44417
44417
|
}
|
|
44418
44418
|
}
|
|
44419
|
-
function isHidden$
|
|
44419
|
+
function isHidden$2(node, { upTo }) {
|
|
44420
44420
|
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
44421
44421
|
while (node) {
|
|
44422
44422
|
if (upTo !== void 0 && node === upTo) return false;
|
|
@@ -44425,19 +44425,19 @@ function isHidden$1(node, { upTo }) {
|
|
|
44425
44425
|
}
|
|
44426
44426
|
return false;
|
|
44427
44427
|
}
|
|
44428
|
-
function isSelectableInput$
|
|
44428
|
+
function isSelectableInput$2(element) {
|
|
44429
44429
|
return element instanceof HTMLInputElement && "select" in element;
|
|
44430
44430
|
}
|
|
44431
|
-
function focus$
|
|
44431
|
+
function focus$3(element, { select = false } = {}) {
|
|
44432
44432
|
if (element && element.focus) {
|
|
44433
44433
|
const previouslyFocusedElement = document.activeElement;
|
|
44434
44434
|
element.focus({ preventScroll: true });
|
|
44435
|
-
if (element !== previouslyFocusedElement && isSelectableInput$
|
|
44435
|
+
if (element !== previouslyFocusedElement && isSelectableInput$2(element) && select)
|
|
44436
44436
|
element.select();
|
|
44437
44437
|
}
|
|
44438
44438
|
}
|
|
44439
|
-
var focusScopesStack$
|
|
44440
|
-
function createFocusScopesStack$
|
|
44439
|
+
var focusScopesStack$2 = createFocusScopesStack$2();
|
|
44440
|
+
function createFocusScopesStack$2() {
|
|
44441
44441
|
let stack = [];
|
|
44442
44442
|
return {
|
|
44443
44443
|
add(focusScope) {
|
|
@@ -44445,16 +44445,16 @@ function createFocusScopesStack$1() {
|
|
|
44445
44445
|
if (focusScope !== activeFocusScope) {
|
|
44446
44446
|
activeFocusScope?.pause();
|
|
44447
44447
|
}
|
|
44448
|
-
stack = arrayRemove$
|
|
44448
|
+
stack = arrayRemove$2(stack, focusScope);
|
|
44449
44449
|
stack.unshift(focusScope);
|
|
44450
44450
|
},
|
|
44451
44451
|
remove(focusScope) {
|
|
44452
|
-
stack = arrayRemove$
|
|
44452
|
+
stack = arrayRemove$2(stack, focusScope);
|
|
44453
44453
|
stack[0]?.resume();
|
|
44454
44454
|
}
|
|
44455
44455
|
};
|
|
44456
44456
|
}
|
|
44457
|
-
function arrayRemove$
|
|
44457
|
+
function arrayRemove$2(array, item) {
|
|
44458
44458
|
const updatedArray = [...array];
|
|
44459
44459
|
const index = updatedArray.indexOf(item);
|
|
44460
44460
|
if (index !== -1) {
|
|
@@ -44462,7 +44462,7 @@ function arrayRemove$1(array, item) {
|
|
|
44462
44462
|
}
|
|
44463
44463
|
return updatedArray;
|
|
44464
44464
|
}
|
|
44465
|
-
function removeLinks$
|
|
44465
|
+
function removeLinks$2(items) {
|
|
44466
44466
|
return items.filter((item) => item.tagName !== "A");
|
|
44467
44467
|
}
|
|
44468
44468
|
|
|
@@ -44472,11 +44472,11 @@ var useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {
|
|
|
44472
44472
|
|
|
44473
44473
|
// packages/react/id/src/id.tsx
|
|
44474
44474
|
var useReactId = React[" useId ".trim().toString()] || (() => void 0);
|
|
44475
|
-
var count = 0;
|
|
44475
|
+
var count$1 = 0;
|
|
44476
44476
|
function useId(deterministicId) {
|
|
44477
44477
|
const [id, setId] = React.useState(useReactId());
|
|
44478
44478
|
useLayoutEffect2(() => {
|
|
44479
|
-
setId((reactId) => reactId ?? String(count++));
|
|
44479
|
+
setId((reactId) => reactId ?? String(count$1++));
|
|
44480
44480
|
}, [deterministicId]);
|
|
44481
44481
|
return (id ? `radix-${id}` : "");
|
|
44482
44482
|
}
|
|
@@ -46736,7 +46736,7 @@ var Arrow$3 = React.forwardRef((props, forwardedRef) => {
|
|
|
46736
46736
|
);
|
|
46737
46737
|
});
|
|
46738
46738
|
Arrow$3.displayName = NAME$7;
|
|
46739
|
-
var Root$
|
|
46739
|
+
var Root$e = Arrow$3;
|
|
46740
46740
|
|
|
46741
46741
|
// packages/react/use-size/src/use-size.tsx
|
|
46742
46742
|
function useSize(element) {
|
|
@@ -46797,8 +46797,8 @@ var PopperAnchor$1 = React.forwardRef(
|
|
|
46797
46797
|
}
|
|
46798
46798
|
);
|
|
46799
46799
|
PopperAnchor$1.displayName = ANCHOR_NAME$3;
|
|
46800
|
-
var CONTENT_NAME$
|
|
46801
|
-
var [PopperContentProvider$1, useContentContext$1] = createPopperContext$1(CONTENT_NAME$
|
|
46800
|
+
var CONTENT_NAME$b = "PopperContent";
|
|
46801
|
+
var [PopperContentProvider$1, useContentContext$1] = createPopperContext$1(CONTENT_NAME$b);
|
|
46802
46802
|
var PopperContent$1 = React.forwardRef(
|
|
46803
46803
|
(props, forwardedRef) => {
|
|
46804
46804
|
const {
|
|
@@ -46817,7 +46817,7 @@ var PopperContent$1 = React.forwardRef(
|
|
|
46817
46817
|
onPlaced,
|
|
46818
46818
|
...contentProps
|
|
46819
46819
|
} = props;
|
|
46820
|
-
const context = usePopperContext$1(CONTENT_NAME$
|
|
46820
|
+
const context = usePopperContext$1(CONTENT_NAME$b, __scopePopper);
|
|
46821
46821
|
const [content, setContent] = React.useState(null);
|
|
46822
46822
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
46823
46823
|
const [arrow, setArrow] = React.useState(null);
|
|
@@ -46940,7 +46940,7 @@ var PopperContent$1 = React.forwardRef(
|
|
|
46940
46940
|
);
|
|
46941
46941
|
}
|
|
46942
46942
|
);
|
|
46943
|
-
PopperContent$1.displayName = CONTENT_NAME$
|
|
46943
|
+
PopperContent$1.displayName = CONTENT_NAME$b;
|
|
46944
46944
|
var ARROW_NAME$6 = "PopperArrow";
|
|
46945
46945
|
var OPPOSITE_SIDE$1 = {
|
|
46946
46946
|
top: "bottom",
|
|
@@ -46980,7 +46980,7 @@ var PopperArrow$1 = React.forwardRef(function PopperArrow2(props, forwardedRef)
|
|
|
46980
46980
|
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
46981
46981
|
},
|
|
46982
46982
|
children: /* @__PURE__ */ jsx(
|
|
46983
|
-
Root$
|
|
46983
|
+
Root$e,
|
|
46984
46984
|
{
|
|
46985
46985
|
...arrowProps,
|
|
46986
46986
|
ref: forwardedRef,
|
|
@@ -47036,18 +47036,18 @@ function getSideAndAlignFromPlacement$1(placement) {
|
|
|
47036
47036
|
}
|
|
47037
47037
|
var Root2$6 = Popper$1;
|
|
47038
47038
|
var Anchor$1 = PopperAnchor$1;
|
|
47039
|
-
var Content$
|
|
47039
|
+
var Content$5 = PopperContent$1;
|
|
47040
47040
|
var Arrow$2 = PopperArrow$1;
|
|
47041
47041
|
|
|
47042
|
-
var PORTAL_NAME$
|
|
47043
|
-
var Portal$
|
|
47042
|
+
var PORTAL_NAME$c = "Portal";
|
|
47043
|
+
var Portal$a = React.forwardRef((props, forwardedRef) => {
|
|
47044
47044
|
const { container: containerProp, ...portalProps } = props;
|
|
47045
47045
|
const [mounted, setMounted] = React.useState(false);
|
|
47046
47046
|
useLayoutEffect2(() => setMounted(true), []);
|
|
47047
47047
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
47048
47048
|
return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive$5.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
47049
47049
|
});
|
|
47050
|
-
Portal$
|
|
47050
|
+
Portal$a.displayName = PORTAL_NAME$c;
|
|
47051
47051
|
|
|
47052
47052
|
function useStateMachine$2(initialState, machine) {
|
|
47053
47053
|
return React.useReducer((state, event) => {
|
|
@@ -47175,7 +47175,7 @@ function getElementRef$5(element) {
|
|
|
47175
47175
|
}
|
|
47176
47176
|
|
|
47177
47177
|
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
47178
|
-
var EVENT_OPTIONS$
|
|
47178
|
+
var EVENT_OPTIONS$2 = { bubbles: false, cancelable: true };
|
|
47179
47179
|
var GROUP_NAME$3 = "RovingFocusGroup";
|
|
47180
47180
|
var [Collection$3, useCollection$3, createCollectionScope$3] = createCollection$1(GROUP_NAME$3);
|
|
47181
47181
|
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope$1(
|
|
@@ -47257,7 +47257,7 @@ var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
|
|
|
47257
47257
|
onFocus: composeEventHandlers$2(props.onFocus, (event) => {
|
|
47258
47258
|
const isKeyboardFocus = !isClickFocusRef.current;
|
|
47259
47259
|
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
47260
|
-
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS$
|
|
47260
|
+
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS$2);
|
|
47261
47261
|
event.currentTarget.dispatchEvent(entryFocusEvent);
|
|
47262
47262
|
if (!entryFocusEvent.defaultPrevented) {
|
|
47263
47263
|
const items = getItems().filter((item) => item.focusable);
|
|
@@ -47267,7 +47267,7 @@ var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
|
|
|
47267
47267
|
Boolean
|
|
47268
47268
|
);
|
|
47269
47269
|
const candidateNodes = candidateItems.map((item) => item.ref.current);
|
|
47270
|
-
focusFirst$
|
|
47270
|
+
focusFirst$4(candidateNodes, preventScrollOnEntryFocus);
|
|
47271
47271
|
}
|
|
47272
47272
|
}
|
|
47273
47273
|
isClickFocusRef.current = false;
|
|
@@ -47337,7 +47337,7 @@ var RovingFocusGroupItem = React.forwardRef(
|
|
|
47337
47337
|
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
47338
47338
|
candidateNodes = context.loop ? wrapArray$2(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
47339
47339
|
}
|
|
47340
|
-
setTimeout(() => focusFirst$
|
|
47340
|
+
setTimeout(() => focusFirst$4(candidateNodes));
|
|
47341
47341
|
}
|
|
47342
47342
|
})
|
|
47343
47343
|
}
|
|
@@ -47367,7 +47367,7 @@ function getFocusIntent(event, orientation, dir) {
|
|
|
47367
47367
|
if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
|
|
47368
47368
|
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
47369
47369
|
}
|
|
47370
|
-
function focusFirst$
|
|
47370
|
+
function focusFirst$4(candidates, preventScroll = false) {
|
|
47371
47371
|
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
47372
47372
|
for (const candidate of candidates) {
|
|
47373
47373
|
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
@@ -47378,7 +47378,7 @@ function focusFirst$3(candidates, preventScroll = false) {
|
|
|
47378
47378
|
function wrapArray$2(array, startIndex) {
|
|
47379
47379
|
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
47380
47380
|
}
|
|
47381
|
-
var Root$
|
|
47381
|
+
var Root$d = RovingFocusGroup;
|
|
47382
47382
|
var Item$2 = RovingFocusGroupItem;
|
|
47383
47383
|
|
|
47384
47384
|
var getDefaultParent = function (originalTarget) {
|
|
@@ -48351,30 +48351,30 @@ var MenuAnchor = React.forwardRef(
|
|
|
48351
48351
|
}
|
|
48352
48352
|
);
|
|
48353
48353
|
MenuAnchor.displayName = ANCHOR_NAME$2;
|
|
48354
|
-
var PORTAL_NAME$
|
|
48355
|
-
var [PortalProvider$
|
|
48354
|
+
var PORTAL_NAME$b = "MenuPortal";
|
|
48355
|
+
var [PortalProvider$5, usePortalContext$5] = createMenuContext(PORTAL_NAME$b, {
|
|
48356
48356
|
forceMount: void 0
|
|
48357
48357
|
});
|
|
48358
48358
|
var MenuPortal = (props) => {
|
|
48359
48359
|
const { __scopeMenu, forceMount, children, container } = props;
|
|
48360
|
-
const context = useMenuContext(PORTAL_NAME$
|
|
48361
|
-
return /* @__PURE__ */ jsx(PortalProvider$
|
|
48360
|
+
const context = useMenuContext(PORTAL_NAME$b, __scopeMenu);
|
|
48361
|
+
return /* @__PURE__ */ jsx(PortalProvider$5, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx(Presence$2, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$a, { asChild: true, container, children }) }) });
|
|
48362
48362
|
};
|
|
48363
|
-
MenuPortal.displayName = PORTAL_NAME$
|
|
48364
|
-
var CONTENT_NAME$
|
|
48365
|
-
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME$
|
|
48363
|
+
MenuPortal.displayName = PORTAL_NAME$b;
|
|
48364
|
+
var CONTENT_NAME$a = "MenuContent";
|
|
48365
|
+
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME$a);
|
|
48366
48366
|
var MenuContent = React.forwardRef(
|
|
48367
48367
|
(props, forwardedRef) => {
|
|
48368
|
-
const portalContext = usePortalContext$
|
|
48368
|
+
const portalContext = usePortalContext$5(CONTENT_NAME$a, props.__scopeMenu);
|
|
48369
48369
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
48370
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
48371
|
-
const rootContext = useMenuRootContext(CONTENT_NAME$
|
|
48370
|
+
const context = useMenuContext(CONTENT_NAME$a, props.__scopeMenu);
|
|
48371
|
+
const rootContext = useMenuRootContext(CONTENT_NAME$a, props.__scopeMenu);
|
|
48372
48372
|
return /* @__PURE__ */ jsx(Collection$2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence$2, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection$2.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
|
|
48373
48373
|
}
|
|
48374
48374
|
);
|
|
48375
48375
|
var MenuRootContentModal = React.forwardRef(
|
|
48376
48376
|
(props, forwardedRef) => {
|
|
48377
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
48377
|
+
const context = useMenuContext(CONTENT_NAME$a, props.__scopeMenu);
|
|
48378
48378
|
const ref = React.useRef(null);
|
|
48379
48379
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
48380
48380
|
React.useEffect(() => {
|
|
@@ -48400,7 +48400,7 @@ var MenuRootContentModal = React.forwardRef(
|
|
|
48400
48400
|
}
|
|
48401
48401
|
);
|
|
48402
48402
|
var MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => {
|
|
48403
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
48403
|
+
const context = useMenuContext(CONTENT_NAME$a, props.__scopeMenu);
|
|
48404
48404
|
return /* @__PURE__ */ jsx(
|
|
48405
48405
|
MenuContentImpl,
|
|
48406
48406
|
{
|
|
@@ -48413,7 +48413,7 @@ var MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => {
|
|
|
48413
48413
|
}
|
|
48414
48414
|
);
|
|
48415
48415
|
});
|
|
48416
|
-
var Slot$
|
|
48416
|
+
var Slot$6 = createSlot$2("MenuContent.ScrollLock");
|
|
48417
48417
|
var MenuContentImpl = React.forwardRef(
|
|
48418
48418
|
(props, forwardedRef) => {
|
|
48419
48419
|
const {
|
|
@@ -48432,8 +48432,8 @@ var MenuContentImpl = React.forwardRef(
|
|
|
48432
48432
|
disableOutsideScroll,
|
|
48433
48433
|
...contentProps
|
|
48434
48434
|
} = props;
|
|
48435
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
48436
|
-
const rootContext = useMenuRootContext(CONTENT_NAME$
|
|
48435
|
+
const context = useMenuContext(CONTENT_NAME$a, __scopeMenu);
|
|
48436
|
+
const rootContext = useMenuRootContext(CONTENT_NAME$a, __scopeMenu);
|
|
48437
48437
|
const popperScope = usePopperScope$3(__scopeMenu);
|
|
48438
48438
|
const rovingFocusGroupScope = useRovingFocusGroupScope$1(__scopeMenu);
|
|
48439
48439
|
const getItems = useCollection$2(__scopeMenu);
|
|
@@ -48447,7 +48447,7 @@ var MenuContentImpl = React.forwardRef(
|
|
|
48447
48447
|
const pointerDirRef = React.useRef("right");
|
|
48448
48448
|
const lastPointerXRef = React.useRef(0);
|
|
48449
48449
|
const ScrollLockWrapper = disableOutsideScroll ? ReactRemoveScroll : React.Fragment;
|
|
48450
|
-
const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot$
|
|
48450
|
+
const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot$6, allowPinchZoom: true } : void 0;
|
|
48451
48451
|
const handleTypeaheadSearch = (key) => {
|
|
48452
48452
|
const search = searchRef.current + key;
|
|
48453
48453
|
const items = getItems().filter((item) => !item.disabled);
|
|
@@ -48468,7 +48468,7 @@ var MenuContentImpl = React.forwardRef(
|
|
|
48468
48468
|
React.useEffect(() => {
|
|
48469
48469
|
return () => window.clearTimeout(timerRef.current);
|
|
48470
48470
|
}, []);
|
|
48471
|
-
useFocusGuards();
|
|
48471
|
+
useFocusGuards$1();
|
|
48472
48472
|
const isPointerMovingToSubmenu = React.useCallback((event) => {
|
|
48473
48473
|
const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;
|
|
48474
48474
|
return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);
|
|
@@ -48503,7 +48503,7 @@ var MenuContentImpl = React.forwardRef(
|
|
|
48503
48503
|
pointerGraceIntentRef.current = intent;
|
|
48504
48504
|
}, []),
|
|
48505
48505
|
children: /* @__PURE__ */ jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx(
|
|
48506
|
-
FocusScope$
|
|
48506
|
+
FocusScope$2,
|
|
48507
48507
|
{
|
|
48508
48508
|
asChild: true,
|
|
48509
48509
|
trapped: trapFocus,
|
|
@@ -48523,7 +48523,7 @@ var MenuContentImpl = React.forwardRef(
|
|
|
48523
48523
|
onInteractOutside,
|
|
48524
48524
|
onDismiss,
|
|
48525
48525
|
children: /* @__PURE__ */ jsx(
|
|
48526
|
-
Root$
|
|
48526
|
+
Root$d,
|
|
48527
48527
|
{
|
|
48528
48528
|
asChild: true,
|
|
48529
48529
|
...rovingFocusGroupScope,
|
|
@@ -48537,7 +48537,7 @@ var MenuContentImpl = React.forwardRef(
|
|
|
48537
48537
|
}),
|
|
48538
48538
|
preventScrollOnEntryFocus: true,
|
|
48539
48539
|
children: /* @__PURE__ */ jsx(
|
|
48540
|
-
Content$
|
|
48540
|
+
Content$5,
|
|
48541
48541
|
{
|
|
48542
48542
|
role: "menu",
|
|
48543
48543
|
"aria-orientation": "vertical",
|
|
@@ -48564,7 +48564,7 @@ var MenuContentImpl = React.forwardRef(
|
|
|
48564
48564
|
const items = getItems().filter((item) => !item.disabled);
|
|
48565
48565
|
const candidateNodes = items.map((item) => item.ref.current);
|
|
48566
48566
|
if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();
|
|
48567
|
-
focusFirst$
|
|
48567
|
+
focusFirst$3(candidateNodes);
|
|
48568
48568
|
}),
|
|
48569
48569
|
onBlur: composeEventHandlers$2(props.onBlur, (event) => {
|
|
48570
48570
|
if (!event.currentTarget.contains(event.target)) {
|
|
@@ -48596,7 +48596,7 @@ var MenuContentImpl = React.forwardRef(
|
|
|
48596
48596
|
);
|
|
48597
48597
|
}
|
|
48598
48598
|
);
|
|
48599
|
-
MenuContent.displayName = CONTENT_NAME$
|
|
48599
|
+
MenuContent.displayName = CONTENT_NAME$a;
|
|
48600
48600
|
var GROUP_NAME$2 = "MenuGroup";
|
|
48601
48601
|
var MenuGroup = React.forwardRef(
|
|
48602
48602
|
(props, forwardedRef) => {
|
|
@@ -48936,10 +48936,10 @@ MenuSubTrigger.displayName = SUB_TRIGGER_NAME$1;
|
|
|
48936
48936
|
var SUB_CONTENT_NAME$1 = "MenuSubContent";
|
|
48937
48937
|
var MenuSubContent = React.forwardRef(
|
|
48938
48938
|
(props, forwardedRef) => {
|
|
48939
|
-
const portalContext = usePortalContext$
|
|
48939
|
+
const portalContext = usePortalContext$5(CONTENT_NAME$a, props.__scopeMenu);
|
|
48940
48940
|
const { forceMount = portalContext.forceMount, ...subContentProps } = props;
|
|
48941
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
48942
|
-
const rootContext = useMenuRootContext(CONTENT_NAME$
|
|
48941
|
+
const context = useMenuContext(CONTENT_NAME$a, props.__scopeMenu);
|
|
48942
|
+
const rootContext = useMenuRootContext(CONTENT_NAME$a, props.__scopeMenu);
|
|
48943
48943
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME$1, props.__scopeMenu);
|
|
48944
48944
|
const ref = React.useRef(null);
|
|
48945
48945
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
@@ -48990,7 +48990,7 @@ function isIndeterminate$1(checked) {
|
|
|
48990
48990
|
function getCheckedState(checked) {
|
|
48991
48991
|
return isIndeterminate$1(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
48992
48992
|
}
|
|
48993
|
-
function focusFirst$
|
|
48993
|
+
function focusFirst$3(candidates) {
|
|
48994
48994
|
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
48995
48995
|
for (const candidate of candidates) {
|
|
48996
48996
|
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
@@ -49036,7 +49036,7 @@ function whenMouse(handler) {
|
|
|
49036
49036
|
}
|
|
49037
49037
|
var Root3$1 = Menu;
|
|
49038
49038
|
var Anchor2 = MenuAnchor;
|
|
49039
|
-
var Portal$
|
|
49039
|
+
var Portal$9 = MenuPortal;
|
|
49040
49040
|
var Content2$5 = MenuContent;
|
|
49041
49041
|
var Group = MenuGroup;
|
|
49042
49042
|
var Label$3 = MenuLabel;
|
|
@@ -49090,11 +49090,11 @@ var DropdownMenu$1 = (props) => {
|
|
|
49090
49090
|
);
|
|
49091
49091
|
};
|
|
49092
49092
|
DropdownMenu$1.displayName = DROPDOWN_MENU_NAME;
|
|
49093
|
-
var TRIGGER_NAME$
|
|
49093
|
+
var TRIGGER_NAME$8 = "DropdownMenuTrigger";
|
|
49094
49094
|
var DropdownMenuTrigger$1 = React.forwardRef(
|
|
49095
49095
|
(props, forwardedRef) => {
|
|
49096
49096
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
49097
|
-
const context = useDropdownMenuContext(TRIGGER_NAME$
|
|
49097
|
+
const context = useDropdownMenuContext(TRIGGER_NAME$8, __scopeDropdownMenu);
|
|
49098
49098
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
49099
49099
|
return /* @__PURE__ */ jsx(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx(
|
|
49100
49100
|
Primitive$5.button,
|
|
@@ -49125,19 +49125,19 @@ var DropdownMenuTrigger$1 = React.forwardRef(
|
|
|
49125
49125
|
) });
|
|
49126
49126
|
}
|
|
49127
49127
|
);
|
|
49128
|
-
DropdownMenuTrigger$1.displayName = TRIGGER_NAME$
|
|
49129
|
-
var PORTAL_NAME$
|
|
49128
|
+
DropdownMenuTrigger$1.displayName = TRIGGER_NAME$8;
|
|
49129
|
+
var PORTAL_NAME$a = "DropdownMenuPortal";
|
|
49130
49130
|
var DropdownMenuPortal = (props) => {
|
|
49131
49131
|
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
49132
49132
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
49133
|
-
return /* @__PURE__ */ jsx(Portal$
|
|
49133
|
+
return /* @__PURE__ */ jsx(Portal$9, { ...menuScope, ...portalProps });
|
|
49134
49134
|
};
|
|
49135
|
-
DropdownMenuPortal.displayName = PORTAL_NAME$
|
|
49136
|
-
var CONTENT_NAME$
|
|
49135
|
+
DropdownMenuPortal.displayName = PORTAL_NAME$a;
|
|
49136
|
+
var CONTENT_NAME$9 = "DropdownMenuContent";
|
|
49137
49137
|
var DropdownMenuContent$1 = React.forwardRef(
|
|
49138
49138
|
(props, forwardedRef) => {
|
|
49139
49139
|
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
49140
|
-
const context = useDropdownMenuContext(CONTENT_NAME$
|
|
49140
|
+
const context = useDropdownMenuContext(CONTENT_NAME$9, __scopeDropdownMenu);
|
|
49141
49141
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
49142
49142
|
const hasInteractedOutsideRef = React.useRef(false);
|
|
49143
49143
|
return /* @__PURE__ */ jsx(
|
|
@@ -49174,7 +49174,7 @@ var DropdownMenuContent$1 = React.forwardRef(
|
|
|
49174
49174
|
);
|
|
49175
49175
|
}
|
|
49176
49176
|
);
|
|
49177
|
-
DropdownMenuContent$1.displayName = CONTENT_NAME$
|
|
49177
|
+
DropdownMenuContent$1.displayName = CONTENT_NAME$9;
|
|
49178
49178
|
var GROUP_NAME$1 = "DropdownMenuGroup";
|
|
49179
49179
|
var DropdownMenuGroup = React.forwardRef(
|
|
49180
49180
|
(props, forwardedRef) => {
|
|
@@ -49645,12 +49645,12 @@ function useImageLoadingStatus(src, { referrerPolicy, crossOrigin }) {
|
|
|
49645
49645
|
}, [image, crossOrigin, referrerPolicy]);
|
|
49646
49646
|
return loadingStatus;
|
|
49647
49647
|
}
|
|
49648
|
-
var Root$
|
|
49648
|
+
var Root$c = Avatar$1;
|
|
49649
49649
|
var Image$1 = AvatarImage$1;
|
|
49650
49650
|
var Fallback = AvatarFallback$1;
|
|
49651
49651
|
|
|
49652
|
-
const Avatar = React.forwardRef(({ className, onClick, ...props }, ref) => (jsx(Root$
|
|
49653
|
-
Avatar.displayName = Root$
|
|
49652
|
+
const Avatar = React.forwardRef(({ className, onClick, ...props }, ref) => (jsx(Root$c, { ref: ref, className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className), onClick: onClick, ...props })));
|
|
49653
|
+
Avatar.displayName = Root$c.displayName;
|
|
49654
49654
|
const AvatarImage = React.forwardRef(({ className, onClick, ...props }, ref) => (jsx(Image$1, { ref: ref, className: cn("aspect-square h-full w-full cursor-pointer rounded-full border-0 object-cover", // Changed object-center to object-cover for better image fitting
|
|
49655
49655
|
className), onClick: onClick, ...props })));
|
|
49656
49656
|
AvatarImage.displayName = "AvatarImage";
|
|
@@ -49829,12 +49829,12 @@ var Select$2 = (props) => {
|
|
|
49829
49829
|
) });
|
|
49830
49830
|
};
|
|
49831
49831
|
Select$2.displayName = SELECT_NAME;
|
|
49832
|
-
var TRIGGER_NAME$
|
|
49832
|
+
var TRIGGER_NAME$7 = "SelectTrigger";
|
|
49833
49833
|
var SelectTrigger$1 = React.forwardRef(
|
|
49834
49834
|
(props, forwardedRef) => {
|
|
49835
49835
|
const { __scopeSelect, disabled = false, ...triggerProps } = props;
|
|
49836
49836
|
const popperScope = usePopperScope$2(__scopeSelect);
|
|
49837
|
-
const context = useSelectContext(TRIGGER_NAME$
|
|
49837
|
+
const context = useSelectContext(TRIGGER_NAME$7, __scopeSelect);
|
|
49838
49838
|
const isDisabled = context.disabled || disabled;
|
|
49839
49839
|
const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);
|
|
49840
49840
|
const getItems = useCollection$1(__scopeSelect);
|
|
@@ -49906,7 +49906,7 @@ var SelectTrigger$1 = React.forwardRef(
|
|
|
49906
49906
|
) });
|
|
49907
49907
|
}
|
|
49908
49908
|
);
|
|
49909
|
-
SelectTrigger$1.displayName = TRIGGER_NAME$
|
|
49909
|
+
SelectTrigger$1.displayName = TRIGGER_NAME$7;
|
|
49910
49910
|
var VALUE_NAME = "SelectValue";
|
|
49911
49911
|
var SelectValue$1 = React.forwardRef(
|
|
49912
49912
|
(props, forwardedRef) => {
|
|
@@ -49938,15 +49938,15 @@ var SelectIcon = React.forwardRef(
|
|
|
49938
49938
|
}
|
|
49939
49939
|
);
|
|
49940
49940
|
SelectIcon.displayName = ICON_NAME;
|
|
49941
|
-
var PORTAL_NAME$
|
|
49941
|
+
var PORTAL_NAME$9 = "SelectPortal";
|
|
49942
49942
|
var SelectPortal = (props) => {
|
|
49943
|
-
return /* @__PURE__ */ jsx(Portal$
|
|
49943
|
+
return /* @__PURE__ */ jsx(Portal$a, { asChild: true, ...props });
|
|
49944
49944
|
};
|
|
49945
|
-
SelectPortal.displayName = PORTAL_NAME$
|
|
49946
|
-
var CONTENT_NAME$
|
|
49945
|
+
SelectPortal.displayName = PORTAL_NAME$9;
|
|
49946
|
+
var CONTENT_NAME$8 = "SelectContent";
|
|
49947
49947
|
var SelectContent$1 = React.forwardRef(
|
|
49948
49948
|
(props, forwardedRef) => {
|
|
49949
|
-
const context = useSelectContext(CONTENT_NAME$
|
|
49949
|
+
const context = useSelectContext(CONTENT_NAME$8, props.__scopeSelect);
|
|
49950
49950
|
const [fragment, setFragment] = React.useState();
|
|
49951
49951
|
useLayoutEffect2(() => {
|
|
49952
49952
|
setFragment(new DocumentFragment());
|
|
@@ -49961,11 +49961,11 @@ var SelectContent$1 = React.forwardRef(
|
|
|
49961
49961
|
return /* @__PURE__ */ jsx(SelectContentImpl, { ...props, ref: forwardedRef });
|
|
49962
49962
|
}
|
|
49963
49963
|
);
|
|
49964
|
-
SelectContent$1.displayName = CONTENT_NAME$
|
|
49964
|
+
SelectContent$1.displayName = CONTENT_NAME$8;
|
|
49965
49965
|
var CONTENT_MARGIN = 10;
|
|
49966
|
-
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME$
|
|
49966
|
+
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME$8);
|
|
49967
49967
|
var CONTENT_IMPL_NAME = "SelectContentImpl";
|
|
49968
|
-
var Slot$
|
|
49968
|
+
var Slot$5 = createSlot$2("SelectContent.RemoveScroll");
|
|
49969
49969
|
var SelectContentImpl = React.forwardRef(
|
|
49970
49970
|
(props, forwardedRef) => {
|
|
49971
49971
|
const {
|
|
@@ -49989,7 +49989,7 @@ var SelectContentImpl = React.forwardRef(
|
|
|
49989
49989
|
//
|
|
49990
49990
|
...contentProps
|
|
49991
49991
|
} = props;
|
|
49992
|
-
const context = useSelectContext(CONTENT_NAME$
|
|
49992
|
+
const context = useSelectContext(CONTENT_NAME$8, __scopeSelect);
|
|
49993
49993
|
const [content, setContent] = React.useState(null);
|
|
49994
49994
|
const [viewport, setViewport] = React.useState(null);
|
|
49995
49995
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
@@ -50003,7 +50003,7 @@ var SelectContentImpl = React.forwardRef(
|
|
|
50003
50003
|
React.useEffect(() => {
|
|
50004
50004
|
if (content) return hideOthers(content);
|
|
50005
50005
|
}, [content]);
|
|
50006
|
-
useFocusGuards();
|
|
50006
|
+
useFocusGuards$1();
|
|
50007
50007
|
const focusFirst = React.useCallback(
|
|
50008
50008
|
(candidates) => {
|
|
50009
50009
|
const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);
|
|
@@ -50128,8 +50128,8 @@ var SelectContentImpl = React.forwardRef(
|
|
|
50128
50128
|
position,
|
|
50129
50129
|
isPositioned,
|
|
50130
50130
|
searchRef,
|
|
50131
|
-
children: /* @__PURE__ */ jsx(ReactRemoveScroll, { as: Slot$
|
|
50132
|
-
FocusScope$
|
|
50131
|
+
children: /* @__PURE__ */ jsx(ReactRemoveScroll, { as: Slot$5, allowPinchZoom: true, children: /* @__PURE__ */ jsx(
|
|
50132
|
+
FocusScope$2,
|
|
50133
50133
|
{
|
|
50134
50134
|
asChild: true,
|
|
50135
50135
|
trapped: context.open,
|
|
@@ -50202,8 +50202,8 @@ SelectContentImpl.displayName = CONTENT_IMPL_NAME;
|
|
|
50202
50202
|
var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition";
|
|
50203
50203
|
var SelectItemAlignedPosition = React.forwardRef((props, forwardedRef) => {
|
|
50204
50204
|
const { __scopeSelect, onPlaced, ...popperProps } = props;
|
|
50205
|
-
const context = useSelectContext(CONTENT_NAME$
|
|
50206
|
-
const contentContext = useSelectContentContext(CONTENT_NAME$
|
|
50205
|
+
const context = useSelectContext(CONTENT_NAME$8, __scopeSelect);
|
|
50206
|
+
const contentContext = useSelectContentContext(CONTENT_NAME$8, __scopeSelect);
|
|
50207
50207
|
const [contentWrapper, setContentWrapper] = React.useState(null);
|
|
50208
50208
|
const [content, setContent] = React.useState(null);
|
|
50209
50209
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
@@ -50373,7 +50373,7 @@ var SelectPopperPosition = React.forwardRef((props, forwardedRef) => {
|
|
|
50373
50373
|
} = props;
|
|
50374
50374
|
const popperScope = usePopperScope$2(__scopeSelect);
|
|
50375
50375
|
return /* @__PURE__ */ jsx(
|
|
50376
|
-
Content$
|
|
50376
|
+
Content$5,
|
|
50377
50377
|
{
|
|
50378
50378
|
...popperScope,
|
|
50379
50379
|
...popperProps,
|
|
@@ -50397,7 +50397,7 @@ var SelectPopperPosition = React.forwardRef((props, forwardedRef) => {
|
|
|
50397
50397
|
);
|
|
50398
50398
|
});
|
|
50399
50399
|
SelectPopperPosition.displayName = POPPER_POSITION_NAME;
|
|
50400
|
-
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME$
|
|
50400
|
+
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME$8, {});
|
|
50401
50401
|
var VIEWPORT_NAME$1 = "SelectViewport";
|
|
50402
50402
|
var SelectViewport = React.forwardRef(
|
|
50403
50403
|
(props, forwardedRef) => {
|
|
@@ -50828,7 +50828,7 @@ var Root2$4 = Select$2;
|
|
|
50828
50828
|
var Trigger$5 = SelectTrigger$1;
|
|
50829
50829
|
var Value = SelectValue$1;
|
|
50830
50830
|
var Icon$1 = SelectIcon;
|
|
50831
|
-
var Portal$
|
|
50831
|
+
var Portal$8 = SelectPortal;
|
|
50832
50832
|
var Content2$3 = SelectContent$1;
|
|
50833
50833
|
var Viewport$1 = SelectViewport;
|
|
50834
50834
|
var Label$2 = SelectLabel$1;
|
|
@@ -50848,7 +50848,7 @@ SelectScrollUpButton.displayName = ScrollUpButton.displayName;
|
|
|
50848
50848
|
const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (jsx(ScrollDownButton, { ref: ref, className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: jsx(ChevronDown, { className: "h-4 w-4" }) })));
|
|
50849
50849
|
SelectScrollDownButton.displayName =
|
|
50850
50850
|
ScrollDownButton.displayName;
|
|
50851
|
-
const SelectContent = React.forwardRef(({ className, children, position = "popper", ...props }, ref) => (jsx(Portal$
|
|
50851
|
+
const SelectContent = React.forwardRef(({ className, children, position = "popper", ...props }, ref) => (jsx(Portal$8, { children: jsxs(Content2$3, { ref: ref, className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-60 min-w-[8rem] overflow-hidden rounded-md border shadow-md", position === "popper" &&
|
|
50852
50852
|
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), position: position, ...props, children: [jsx(SelectScrollUpButton, {}), jsx(Viewport$1, { className: cn("h-[var(--radix-select-viewport-height)] overflow-auto p-1", position === "popper" &&
|
|
50853
50853
|
"w-full min-w-[var(--radix-select-trigger-width)]"), style: {
|
|
50854
50854
|
"--radix-select-viewport-height": "var(--radix-select-content-available-height)",
|
|
@@ -51256,18 +51256,18 @@ function handleAndDispatchCustomEvent$3(name, handler, detail, { discrete }) {
|
|
|
51256
51256
|
target.dispatchEvent(event);
|
|
51257
51257
|
}
|
|
51258
51258
|
}
|
|
51259
|
-
var Root$
|
|
51259
|
+
var Root$b = DismissableLayer$2;
|
|
51260
51260
|
var Branch$1 = DismissableLayerBranch$2;
|
|
51261
51261
|
|
|
51262
|
-
var PORTAL_NAME$
|
|
51263
|
-
var Portal$
|
|
51262
|
+
var PORTAL_NAME$8 = "Portal";
|
|
51263
|
+
var Portal$7 = React.forwardRef((props, forwardedRef) => {
|
|
51264
51264
|
const { container: containerProp, ...portalProps } = props;
|
|
51265
51265
|
const [mounted, setMounted] = React.useState(false);
|
|
51266
51266
|
useLayoutEffect2(() => setMounted(true), []);
|
|
51267
51267
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
51268
51268
|
return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive$3.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
51269
51269
|
});
|
|
51270
|
-
Portal$
|
|
51270
|
+
Portal$7.displayName = PORTAL_NAME$8;
|
|
51271
51271
|
|
|
51272
51272
|
function useStateMachine$1(initialState, machine) {
|
|
51273
51273
|
return React.useReducer((state, event) => {
|
|
@@ -51607,7 +51607,7 @@ var ToastViewport$1 = React.forwardRef(
|
|
|
51607
51607
|
const toastItems = getItems();
|
|
51608
51608
|
const tabbableCandidates = toastItems.map((toastItem) => {
|
|
51609
51609
|
const toastNode = toastItem.ref.current;
|
|
51610
|
-
const toastTabbableCandidates = [toastNode, ...getTabbableCandidates$
|
|
51610
|
+
const toastTabbableCandidates = [toastNode, ...getTabbableCandidates$2(toastNode)];
|
|
51611
51611
|
return tabbingDirection === "forwards" ? toastTabbableCandidates : toastTabbableCandidates.reverse();
|
|
51612
51612
|
});
|
|
51613
51613
|
return (tabbingDirection === "forwards" ? tabbableCandidates.reverse() : tabbableCandidates).flat();
|
|
@@ -51631,7 +51631,7 @@ var ToastViewport$1 = React.forwardRef(
|
|
|
51631
51631
|
const tabbingDirection = isTabbingBackwards ? "backwards" : "forwards";
|
|
51632
51632
|
const sortedCandidates = getSortedTabbableCandidates({ tabbingDirection });
|
|
51633
51633
|
const index = sortedCandidates.findIndex((candidate) => candidate === focusedElement);
|
|
51634
|
-
if (focusFirst$
|
|
51634
|
+
if (focusFirst$2(sortedCandidates.slice(index + 1))) {
|
|
51635
51635
|
event.preventDefault();
|
|
51636
51636
|
} else {
|
|
51637
51637
|
isTabbingBackwards ? headFocusProxyRef.current?.focus() : tailFocusProxyRef.current?.focus();
|
|
@@ -51659,7 +51659,7 @@ var ToastViewport$1 = React.forwardRef(
|
|
|
51659
51659
|
const tabbableCandidates = getSortedTabbableCandidates({
|
|
51660
51660
|
tabbingDirection: "forwards"
|
|
51661
51661
|
});
|
|
51662
|
-
focusFirst$
|
|
51662
|
+
focusFirst$2(tabbableCandidates);
|
|
51663
51663
|
}
|
|
51664
51664
|
}
|
|
51665
51665
|
),
|
|
@@ -51672,7 +51672,7 @@ var ToastViewport$1 = React.forwardRef(
|
|
|
51672
51672
|
const tabbableCandidates = getSortedTabbableCandidates({
|
|
51673
51673
|
tabbingDirection: "backwards"
|
|
51674
51674
|
});
|
|
51675
|
-
focusFirst$
|
|
51675
|
+
focusFirst$2(tabbableCandidates);
|
|
51676
51676
|
}
|
|
51677
51677
|
}
|
|
51678
51678
|
)
|
|
@@ -51846,7 +51846,7 @@ var ToastImpl = React.forwardRef(
|
|
|
51846
51846
|
),
|
|
51847
51847
|
/* @__PURE__ */ jsx(ToastInteractiveProvider, { scope: __scopeToast, onClose: handleClose, children: ReactDOM.createPortal(
|
|
51848
51848
|
/* @__PURE__ */ jsx(Collection.ItemSlot, { scope: __scopeToast, children: /* @__PURE__ */ jsx(
|
|
51849
|
-
Root$
|
|
51849
|
+
Root$b,
|
|
51850
51850
|
{
|
|
51851
51851
|
asChild: true,
|
|
51852
51852
|
onEscapeKeyDown: composeEventHandlers$1(onEscapeKeyDown, () => {
|
|
@@ -51950,28 +51950,28 @@ var ToastAnnounce = (props) => {
|
|
|
51950
51950
|
const timer = window.setTimeout(() => setIsAnnounced(true), 1e3);
|
|
51951
51951
|
return () => window.clearTimeout(timer);
|
|
51952
51952
|
}, []);
|
|
51953
|
-
return isAnnounced ? null : /* @__PURE__ */ jsx(Portal$
|
|
51953
|
+
return isAnnounced ? null : /* @__PURE__ */ jsx(Portal$7, { asChild: true, children: /* @__PURE__ */ jsx(VisuallyHidden$1, { ...announceProps, children: renderAnnounceText && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
51954
51954
|
context.label,
|
|
51955
51955
|
" ",
|
|
51956
51956
|
children
|
|
51957
51957
|
] }) }) });
|
|
51958
51958
|
};
|
|
51959
|
-
var TITLE_NAME$
|
|
51959
|
+
var TITLE_NAME$4 = "ToastTitle";
|
|
51960
51960
|
var ToastTitle$1 = React.forwardRef(
|
|
51961
51961
|
(props, forwardedRef) => {
|
|
51962
51962
|
const { __scopeToast, ...titleProps } = props;
|
|
51963
51963
|
return /* @__PURE__ */ jsx(Primitive$3.div, { ...titleProps, ref: forwardedRef });
|
|
51964
51964
|
}
|
|
51965
51965
|
);
|
|
51966
|
-
ToastTitle$1.displayName = TITLE_NAME$
|
|
51967
|
-
var DESCRIPTION_NAME$
|
|
51966
|
+
ToastTitle$1.displayName = TITLE_NAME$4;
|
|
51967
|
+
var DESCRIPTION_NAME$4 = "ToastDescription";
|
|
51968
51968
|
var ToastDescription$1 = React.forwardRef(
|
|
51969
51969
|
(props, forwardedRef) => {
|
|
51970
51970
|
const { __scopeToast, ...descriptionProps } = props;
|
|
51971
51971
|
return /* @__PURE__ */ jsx(Primitive$3.div, { ...descriptionProps, ref: forwardedRef });
|
|
51972
51972
|
}
|
|
51973
51973
|
);
|
|
51974
|
-
ToastDescription$1.displayName = DESCRIPTION_NAME$
|
|
51974
|
+
ToastDescription$1.displayName = DESCRIPTION_NAME$4;
|
|
51975
51975
|
var ACTION_NAME$1 = "ToastAction";
|
|
51976
51976
|
var ToastAction$1 = React.forwardRef(
|
|
51977
51977
|
(props, forwardedRef) => {
|
|
@@ -51986,11 +51986,11 @@ var ToastAction$1 = React.forwardRef(
|
|
|
51986
51986
|
}
|
|
51987
51987
|
);
|
|
51988
51988
|
ToastAction$1.displayName = ACTION_NAME$1;
|
|
51989
|
-
var CLOSE_NAME$
|
|
51989
|
+
var CLOSE_NAME$4 = "ToastClose";
|
|
51990
51990
|
var ToastClose$1 = React.forwardRef(
|
|
51991
51991
|
(props, forwardedRef) => {
|
|
51992
51992
|
const { __scopeToast, ...closeProps } = props;
|
|
51993
|
-
const interactiveContext = useToastInteractiveContext(CLOSE_NAME$
|
|
51993
|
+
const interactiveContext = useToastInteractiveContext(CLOSE_NAME$4, __scopeToast);
|
|
51994
51994
|
return /* @__PURE__ */ jsx(ToastAnnounceExclude, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
51995
51995
|
Primitive$3.button,
|
|
51996
51996
|
{
|
|
@@ -52002,7 +52002,7 @@ var ToastClose$1 = React.forwardRef(
|
|
|
52002
52002
|
) });
|
|
52003
52003
|
}
|
|
52004
52004
|
);
|
|
52005
|
-
ToastClose$1.displayName = CLOSE_NAME$
|
|
52005
|
+
ToastClose$1.displayName = CLOSE_NAME$4;
|
|
52006
52006
|
var ToastAnnounceExclude = React.forwardRef((props, forwardedRef) => {
|
|
52007
52007
|
const { __scopeToast, altText, ...announceExcludeProps } = props;
|
|
52008
52008
|
return /* @__PURE__ */ jsx(
|
|
@@ -52071,7 +52071,7 @@ function useNextFrame(callback = () => {
|
|
|
52071
52071
|
function isHTMLElement(node) {
|
|
52072
52072
|
return node.nodeType === node.ELEMENT_NODE;
|
|
52073
52073
|
}
|
|
52074
|
-
function getTabbableCandidates$
|
|
52074
|
+
function getTabbableCandidates$2(container) {
|
|
52075
52075
|
const nodes = [];
|
|
52076
52076
|
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
52077
52077
|
acceptNode: (node) => {
|
|
@@ -52083,7 +52083,7 @@ function getTabbableCandidates$1(container) {
|
|
|
52083
52083
|
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
52084
52084
|
return nodes;
|
|
52085
52085
|
}
|
|
52086
|
-
function focusFirst$
|
|
52086
|
+
function focusFirst$2(candidates) {
|
|
52087
52087
|
const previouslyFocusedElement = document.activeElement;
|
|
52088
52088
|
return candidates.some((candidate) => {
|
|
52089
52089
|
if (candidate === previouslyFocusedElement) return true;
|
|
@@ -52119,7 +52119,7 @@ const Toast = React.forwardRef(({ className, variant, ...props }, ref) => {
|
|
|
52119
52119
|
Toast.displayName = Root2$3.displayName;
|
|
52120
52120
|
const ToastAction = React.forwardRef(({ className, ...props }, ref) => (jsx(Action$1, { ref: ref, className: cn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive", className), ...props })));
|
|
52121
52121
|
ToastAction.displayName = Action$1.displayName;
|
|
52122
|
-
const ToastClose = React.forwardRef(({ className, ...props }, ref) => (jsx(Close$2, { ref: ref, className: cn("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600", className), "toast-close": "", ...props, children: jsx(X, { className: "h-4 w-4" }) })));
|
|
52122
|
+
const ToastClose = React.forwardRef(({ className, ...props }, ref) => (jsx(Close$2, { ref: ref, className: cn("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600", className), "toast-close": "", ...props, children: jsx(X$1, { className: "h-4 w-4" }) })));
|
|
52123
52123
|
ToastClose.displayName = Close$2.displayName;
|
|
52124
52124
|
const ToastTitle = React.forwardRef(({ className, ...props }, ref) => (jsx(Title$2, { ref: ref, className: cn("text-sm font-semibold", className), ...props })));
|
|
52125
52125
|
ToastTitle.displayName = Title$2.displayName;
|
|
@@ -52295,7 +52295,7 @@ var Checkbox$1 = React.forwardRef(
|
|
|
52295
52295
|
role: "checkbox",
|
|
52296
52296
|
"aria-checked": isIndeterminate(checked) ? "mixed" : checked,
|
|
52297
52297
|
"aria-required": required,
|
|
52298
|
-
"data-state": getState$
|
|
52298
|
+
"data-state": getState$5(checked),
|
|
52299
52299
|
"data-disabled": disabled ? "" : void 0,
|
|
52300
52300
|
disabled,
|
|
52301
52301
|
value,
|
|
@@ -52340,7 +52340,7 @@ var CheckboxIndicator = React.forwardRef(
|
|
|
52340
52340
|
return /* @__PURE__ */ jsx(Presence, { present: forceMount || isIndeterminate(context.state) || context.state === true, children: /* @__PURE__ */ jsx(
|
|
52341
52341
|
Primitive$4.span,
|
|
52342
52342
|
{
|
|
52343
|
-
"data-state": getState$
|
|
52343
|
+
"data-state": getState$5(context.state),
|
|
52344
52344
|
"data-disabled": context.disabled ? "" : void 0,
|
|
52345
52345
|
...indicatorProps,
|
|
52346
52346
|
ref: forwardedRef,
|
|
@@ -52406,14 +52406,14 @@ CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME$1;
|
|
|
52406
52406
|
function isIndeterminate(checked) {
|
|
52407
52407
|
return checked === "indeterminate";
|
|
52408
52408
|
}
|
|
52409
|
-
function getState$
|
|
52409
|
+
function getState$5(checked) {
|
|
52410
52410
|
return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
52411
52411
|
}
|
|
52412
|
-
var Root$
|
|
52412
|
+
var Root$a = Checkbox$1;
|
|
52413
52413
|
var Indicator$1 = CheckboxIndicator;
|
|
52414
52414
|
|
|
52415
|
-
const Checkbox = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$
|
|
52416
|
-
Checkbox.displayName = Root$
|
|
52415
|
+
const Checkbox = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$a, { ref: ref, className: cn("peer border-primary focus-visible:ring-ring h-4 w-4 shrink-0 rounded-sm border shadow-sm focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500 data-[state=checked]:text-white", className), ...props, children: jsx(Indicator$1, { className: cn("flex items-center justify-center text-current"), children: jsx(Check, { className: "h-4 w-4" }) }) })));
|
|
52416
|
+
Checkbox.displayName = Root$a.displayName;
|
|
52417
52417
|
|
|
52418
52418
|
const __storeToDerived = /* @__PURE__ */ new WeakMap();
|
|
52419
52419
|
const __derivedToStore = /* @__PURE__ */ new WeakMap();
|
|
@@ -55073,7 +55073,7 @@ const useProfile = (username) => {
|
|
|
55073
55073
|
};
|
|
55074
55074
|
};
|
|
55075
55075
|
|
|
55076
|
-
var M=(e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n);}),R(n);}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n);}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y);}catch(n){}};var x=React.createContext(void 0),U={setTheme:e=>{},themes:[]},z=()=>{var e;return (e=React.useContext(x))!=null?e:U};React.memo(({forcedTheme:e,storageKey:i,attribute:s,enableSystem:u,enableColorScheme:m,defaultTheme:a,value:l,themes:h,nonce:d,scriptProps:w})=>{let p=JSON.stringify([s,i,a,e,h,l,u,m]).slice(1,-1);return React.createElement("script",{...w,suppressHydrationWarning:true,nonce:typeof window=="undefined"?d:"",dangerouslySetInnerHTML:{__html:`(${M.toString()})(${p})`}})});
|
|
55076
|
+
var M=(e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n);}),R(n);}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n);}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y);}catch(n){}};var x=React.createContext(void 0),U$1={setTheme:e=>{},themes:[]},z=()=>{var e;return (e=React.useContext(x))!=null?e:U$1};React.memo(({forcedTheme:e,storageKey:i,attribute:s,enableSystem:u,enableColorScheme:m,defaultTheme:a,value:l,themes:h,nonce:d,scriptProps:w})=>{let p=JSON.stringify([s,i,a,e,h,l,u,m]).slice(1,-1);return React.createElement("script",{...w,suppressHydrationWarning:true,nonce:typeof window=="undefined"?d:"",dangerouslySetInnerHTML:{__html:`(${M.toString()})(${p})`}})});
|
|
55077
55077
|
|
|
55078
55078
|
const Toaster = ({ ...props }) => {
|
|
55079
55079
|
const { theme = "system" } = z();
|
|
@@ -55087,10 +55087,10 @@ const Toaster = ({ ...props }) => {
|
|
|
55087
55087
|
}, ...props }));
|
|
55088
55088
|
};
|
|
55089
55089
|
|
|
55090
|
-
var DIALOG_NAME$
|
|
55091
|
-
var [createDialogContext$
|
|
55092
|
-
var [DialogProvider$
|
|
55093
|
-
var Dialog$
|
|
55090
|
+
var DIALOG_NAME$2 = "Dialog";
|
|
55091
|
+
var [createDialogContext$2, createDialogScope$2] = createContextScope$1(DIALOG_NAME$2);
|
|
55092
|
+
var [DialogProvider$2, useDialogContext$2] = createDialogContext$2(DIALOG_NAME$2);
|
|
55093
|
+
var Dialog$2 = (props) => {
|
|
55094
55094
|
const {
|
|
55095
55095
|
__scopeDialog,
|
|
55096
55096
|
children,
|
|
@@ -55107,7 +55107,7 @@ var Dialog$1 = (props) => {
|
|
|
55107
55107
|
onChange: onOpenChange
|
|
55108
55108
|
});
|
|
55109
55109
|
return /* @__PURE__ */ jsx(
|
|
55110
|
-
DialogProvider$
|
|
55110
|
+
DialogProvider$2,
|
|
55111
55111
|
{
|
|
55112
55112
|
scope: __scopeDialog,
|
|
55113
55113
|
triggerRef,
|
|
@@ -55123,12 +55123,12 @@ var Dialog$1 = (props) => {
|
|
|
55123
55123
|
}
|
|
55124
55124
|
);
|
|
55125
55125
|
};
|
|
55126
|
-
Dialog$
|
|
55127
|
-
var TRIGGER_NAME$
|
|
55128
|
-
var DialogTrigger$
|
|
55126
|
+
Dialog$2.displayName = DIALOG_NAME$2;
|
|
55127
|
+
var TRIGGER_NAME$6 = "DialogTrigger";
|
|
55128
|
+
var DialogTrigger$3 = React.forwardRef(
|
|
55129
55129
|
(props, forwardedRef) => {
|
|
55130
55130
|
const { __scopeDialog, ...triggerProps } = props;
|
|
55131
|
-
const context = useDialogContext$
|
|
55131
|
+
const context = useDialogContext$2(TRIGGER_NAME$6, __scopeDialog);
|
|
55132
55132
|
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
55133
55133
|
return /* @__PURE__ */ jsx(
|
|
55134
55134
|
Primitive$5.button,
|
|
@@ -55137,7 +55137,7 @@ var DialogTrigger$2 = React.forwardRef(
|
|
|
55137
55137
|
"aria-haspopup": "dialog",
|
|
55138
55138
|
"aria-expanded": context.open,
|
|
55139
55139
|
"aria-controls": context.contentId,
|
|
55140
|
-
"data-state": getState$
|
|
55140
|
+
"data-state": getState$4(context.open),
|
|
55141
55141
|
...triggerProps,
|
|
55142
55142
|
ref: composedTriggerRef,
|
|
55143
55143
|
onClick: composeEventHandlers$2(props.onClick, context.onOpenToggle)
|
|
@@ -55145,39 +55145,39 @@ var DialogTrigger$2 = React.forwardRef(
|
|
|
55145
55145
|
);
|
|
55146
55146
|
}
|
|
55147
55147
|
);
|
|
55148
|
-
DialogTrigger$
|
|
55149
|
-
var PORTAL_NAME$
|
|
55150
|
-
var [PortalProvider$
|
|
55148
|
+
DialogTrigger$3.displayName = TRIGGER_NAME$6;
|
|
55149
|
+
var PORTAL_NAME$7 = "DialogPortal";
|
|
55150
|
+
var [PortalProvider$4, usePortalContext$4] = createDialogContext$2(PORTAL_NAME$7, {
|
|
55151
55151
|
forceMount: void 0
|
|
55152
55152
|
});
|
|
55153
|
-
var DialogPortal$
|
|
55153
|
+
var DialogPortal$3 = (props) => {
|
|
55154
55154
|
const { __scopeDialog, forceMount, children, container } = props;
|
|
55155
|
-
const context = useDialogContext$
|
|
55156
|
-
return /* @__PURE__ */ jsx(PortalProvider$
|
|
55155
|
+
const context = useDialogContext$2(PORTAL_NAME$7, __scopeDialog);
|
|
55156
|
+
return /* @__PURE__ */ jsx(PortalProvider$4, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence$2, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$a, { asChild: true, container, children: child }) })) });
|
|
55157
55157
|
};
|
|
55158
|
-
DialogPortal$
|
|
55159
|
-
var OVERLAY_NAME$
|
|
55160
|
-
var DialogOverlay$
|
|
55158
|
+
DialogPortal$3.displayName = PORTAL_NAME$7;
|
|
55159
|
+
var OVERLAY_NAME$3 = "DialogOverlay";
|
|
55160
|
+
var DialogOverlay$3 = React.forwardRef(
|
|
55161
55161
|
(props, forwardedRef) => {
|
|
55162
|
-
const portalContext = usePortalContext$
|
|
55162
|
+
const portalContext = usePortalContext$4(OVERLAY_NAME$3, props.__scopeDialog);
|
|
55163
55163
|
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
|
|
55164
|
-
const context = useDialogContext$
|
|
55165
|
-
return context.modal ? /* @__PURE__ */ jsx(Presence$2, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl$
|
|
55164
|
+
const context = useDialogContext$2(OVERLAY_NAME$3, props.__scopeDialog);
|
|
55165
|
+
return context.modal ? /* @__PURE__ */ jsx(Presence$2, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl$2, { ...overlayProps, ref: forwardedRef }) }) : null;
|
|
55166
55166
|
}
|
|
55167
55167
|
);
|
|
55168
|
-
DialogOverlay$
|
|
55169
|
-
var Slot$
|
|
55170
|
-
var DialogOverlayImpl$
|
|
55168
|
+
DialogOverlay$3.displayName = OVERLAY_NAME$3;
|
|
55169
|
+
var Slot$4 = createSlot$2("DialogOverlay.RemoveScroll");
|
|
55170
|
+
var DialogOverlayImpl$2 = React.forwardRef(
|
|
55171
55171
|
(props, forwardedRef) => {
|
|
55172
55172
|
const { __scopeDialog, ...overlayProps } = props;
|
|
55173
|
-
const context = useDialogContext$
|
|
55173
|
+
const context = useDialogContext$2(OVERLAY_NAME$3, __scopeDialog);
|
|
55174
55174
|
return (
|
|
55175
55175
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
55176
55176
|
// ie. when `Overlay` and `Content` are siblings
|
|
55177
|
-
/* @__PURE__ */ jsx(ReactRemoveScroll, { as: Slot$
|
|
55177
|
+
/* @__PURE__ */ jsx(ReactRemoveScroll, { as: Slot$4, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(
|
|
55178
55178
|
Primitive$5.div,
|
|
55179
55179
|
{
|
|
55180
|
-
"data-state": getState$
|
|
55180
|
+
"data-state": getState$4(context.open),
|
|
55181
55181
|
...overlayProps,
|
|
55182
55182
|
ref: forwardedRef,
|
|
55183
55183
|
style: { pointerEvents: "auto", ...overlayProps.style }
|
|
@@ -55186,19 +55186,19 @@ var DialogOverlayImpl$1 = React.forwardRef(
|
|
|
55186
55186
|
);
|
|
55187
55187
|
}
|
|
55188
55188
|
);
|
|
55189
|
-
var CONTENT_NAME$
|
|
55190
|
-
var DialogContent$
|
|
55189
|
+
var CONTENT_NAME$7 = "DialogContent";
|
|
55190
|
+
var DialogContent$3 = React.forwardRef(
|
|
55191
55191
|
(props, forwardedRef) => {
|
|
55192
|
-
const portalContext = usePortalContext$
|
|
55192
|
+
const portalContext = usePortalContext$4(CONTENT_NAME$7, props.__scopeDialog);
|
|
55193
55193
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
55194
|
-
const context = useDialogContext$
|
|
55195
|
-
return /* @__PURE__ */ jsx(Presence$2, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal$
|
|
55194
|
+
const context = useDialogContext$2(CONTENT_NAME$7, props.__scopeDialog);
|
|
55195
|
+
return /* @__PURE__ */ jsx(Presence$2, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal$2, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal$2, { ...contentProps, ref: forwardedRef }) });
|
|
55196
55196
|
}
|
|
55197
55197
|
);
|
|
55198
|
-
DialogContent$
|
|
55199
|
-
var DialogContentModal$
|
|
55198
|
+
DialogContent$3.displayName = CONTENT_NAME$7;
|
|
55199
|
+
var DialogContentModal$2 = React.forwardRef(
|
|
55200
55200
|
(props, forwardedRef) => {
|
|
55201
|
-
const context = useDialogContext$
|
|
55201
|
+
const context = useDialogContext$2(CONTENT_NAME$7, props.__scopeDialog);
|
|
55202
55202
|
const contentRef = React.useRef(null);
|
|
55203
55203
|
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
55204
55204
|
React.useEffect(() => {
|
|
@@ -55206,7 +55206,7 @@ var DialogContentModal$1 = React.forwardRef(
|
|
|
55206
55206
|
if (content) return hideOthers(content);
|
|
55207
55207
|
}, []);
|
|
55208
55208
|
return /* @__PURE__ */ jsx(
|
|
55209
|
-
DialogContentImpl$
|
|
55209
|
+
DialogContentImpl$2,
|
|
55210
55210
|
{
|
|
55211
55211
|
...props,
|
|
55212
55212
|
ref: composedRefs,
|
|
@@ -55230,13 +55230,13 @@ var DialogContentModal$1 = React.forwardRef(
|
|
|
55230
55230
|
);
|
|
55231
55231
|
}
|
|
55232
55232
|
);
|
|
55233
|
-
var DialogContentNonModal$
|
|
55233
|
+
var DialogContentNonModal$2 = React.forwardRef(
|
|
55234
55234
|
(props, forwardedRef) => {
|
|
55235
|
-
const context = useDialogContext$
|
|
55235
|
+
const context = useDialogContext$2(CONTENT_NAME$7, props.__scopeDialog);
|
|
55236
55236
|
const hasInteractedOutsideRef = React.useRef(false);
|
|
55237
55237
|
const hasPointerDownOutsideRef = React.useRef(false);
|
|
55238
55238
|
return /* @__PURE__ */ jsx(
|
|
55239
|
-
DialogContentImpl$
|
|
55239
|
+
DialogContentImpl$2,
|
|
55240
55240
|
{
|
|
55241
55241
|
...props,
|
|
55242
55242
|
ref: forwardedRef,
|
|
@@ -55270,16 +55270,16 @@ var DialogContentNonModal$1 = React.forwardRef(
|
|
|
55270
55270
|
);
|
|
55271
55271
|
}
|
|
55272
55272
|
);
|
|
55273
|
-
var DialogContentImpl$
|
|
55273
|
+
var DialogContentImpl$2 = React.forwardRef(
|
|
55274
55274
|
(props, forwardedRef) => {
|
|
55275
55275
|
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
55276
|
-
const context = useDialogContext$
|
|
55276
|
+
const context = useDialogContext$2(CONTENT_NAME$7, __scopeDialog);
|
|
55277
55277
|
const contentRef = React.useRef(null);
|
|
55278
55278
|
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
55279
|
-
useFocusGuards();
|
|
55279
|
+
useFocusGuards$1();
|
|
55280
55280
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
55281
55281
|
/* @__PURE__ */ jsx(
|
|
55282
|
-
FocusScope$
|
|
55282
|
+
FocusScope$2,
|
|
55283
55283
|
{
|
|
55284
55284
|
asChild: true,
|
|
55285
55285
|
loop: true,
|
|
@@ -55293,7 +55293,7 @@ var DialogContentImpl$1 = React.forwardRef(
|
|
|
55293
55293
|
id: context.contentId,
|
|
55294
55294
|
"aria-describedby": context.descriptionId,
|
|
55295
55295
|
"aria-labelledby": context.titleId,
|
|
55296
|
-
"data-state": getState$
|
|
55296
|
+
"data-state": getState$4(context.open),
|
|
55297
55297
|
...contentProps,
|
|
55298
55298
|
ref: composedRefs,
|
|
55299
55299
|
onDismiss: () => context.onOpenChange(false)
|
|
@@ -55302,35 +55302,35 @@ var DialogContentImpl$1 = React.forwardRef(
|
|
|
55302
55302
|
}
|
|
55303
55303
|
),
|
|
55304
55304
|
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
55305
|
-
/* @__PURE__ */ jsx(TitleWarning$
|
|
55306
|
-
/* @__PURE__ */ jsx(DescriptionWarning$
|
|
55305
|
+
/* @__PURE__ */ jsx(TitleWarning$2, { titleId: context.titleId }),
|
|
55306
|
+
/* @__PURE__ */ jsx(DescriptionWarning$3, { contentRef, descriptionId: context.descriptionId })
|
|
55307
55307
|
] })
|
|
55308
55308
|
] });
|
|
55309
55309
|
}
|
|
55310
55310
|
);
|
|
55311
|
-
var TITLE_NAME$
|
|
55312
|
-
var DialogTitle$
|
|
55311
|
+
var TITLE_NAME$3 = "DialogTitle";
|
|
55312
|
+
var DialogTitle$3 = React.forwardRef(
|
|
55313
55313
|
(props, forwardedRef) => {
|
|
55314
55314
|
const { __scopeDialog, ...titleProps } = props;
|
|
55315
|
-
const context = useDialogContext$
|
|
55315
|
+
const context = useDialogContext$2(TITLE_NAME$3, __scopeDialog);
|
|
55316
55316
|
return /* @__PURE__ */ jsx(Primitive$5.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
|
55317
55317
|
}
|
|
55318
55318
|
);
|
|
55319
|
-
DialogTitle$
|
|
55320
|
-
var DESCRIPTION_NAME$
|
|
55321
|
-
var DialogDescription$
|
|
55319
|
+
DialogTitle$3.displayName = TITLE_NAME$3;
|
|
55320
|
+
var DESCRIPTION_NAME$3 = "DialogDescription";
|
|
55321
|
+
var DialogDescription$3 = React.forwardRef(
|
|
55322
55322
|
(props, forwardedRef) => {
|
|
55323
55323
|
const { __scopeDialog, ...descriptionProps } = props;
|
|
55324
|
-
const context = useDialogContext$
|
|
55324
|
+
const context = useDialogContext$2(DESCRIPTION_NAME$3, __scopeDialog);
|
|
55325
55325
|
return /* @__PURE__ */ jsx(Primitive$5.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
|
55326
55326
|
}
|
|
55327
55327
|
);
|
|
55328
|
-
DialogDescription$
|
|
55329
|
-
var CLOSE_NAME$
|
|
55330
|
-
var DialogClose$
|
|
55328
|
+
DialogDescription$3.displayName = DESCRIPTION_NAME$3;
|
|
55329
|
+
var CLOSE_NAME$3 = "DialogClose";
|
|
55330
|
+
var DialogClose$2 = React.forwardRef(
|
|
55331
55331
|
(props, forwardedRef) => {
|
|
55332
55332
|
const { __scopeDialog, ...closeProps } = props;
|
|
55333
|
-
const context = useDialogContext$
|
|
55333
|
+
const context = useDialogContext$2(CLOSE_NAME$3, __scopeDialog);
|
|
55334
55334
|
return /* @__PURE__ */ jsx(
|
|
55335
55335
|
Primitive$5.button,
|
|
55336
55336
|
{
|
|
@@ -55342,18 +55342,18 @@ var DialogClose$1 = React.forwardRef(
|
|
|
55342
55342
|
);
|
|
55343
55343
|
}
|
|
55344
55344
|
);
|
|
55345
|
-
DialogClose$
|
|
55346
|
-
function getState$
|
|
55345
|
+
DialogClose$2.displayName = CLOSE_NAME$3;
|
|
55346
|
+
function getState$4(open) {
|
|
55347
55347
|
return open ? "open" : "closed";
|
|
55348
55348
|
}
|
|
55349
|
-
var TITLE_WARNING_NAME$
|
|
55350
|
-
var [WarningProvider$
|
|
55351
|
-
contentName: CONTENT_NAME$
|
|
55352
|
-
titleName: TITLE_NAME$
|
|
55349
|
+
var TITLE_WARNING_NAME$2 = "DialogTitleWarning";
|
|
55350
|
+
var [WarningProvider$2, useWarningContext$2] = createContext2(TITLE_WARNING_NAME$2, {
|
|
55351
|
+
contentName: CONTENT_NAME$7,
|
|
55352
|
+
titleName: TITLE_NAME$3,
|
|
55353
55353
|
docsSlug: "dialog"
|
|
55354
55354
|
});
|
|
55355
|
-
var TitleWarning$
|
|
55356
|
-
const titleWarningContext = useWarningContext$
|
|
55355
|
+
var TitleWarning$2 = ({ titleId }) => {
|
|
55356
|
+
const titleWarningContext = useWarningContext$2(TITLE_WARNING_NAME$2);
|
|
55357
55357
|
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
|
|
55358
55358
|
|
|
55359
55359
|
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
@@ -55367,9 +55367,9 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
|
|
|
55367
55367
|
}, [MESSAGE, titleId]);
|
|
55368
55368
|
return null;
|
|
55369
55369
|
};
|
|
55370
|
-
var DESCRIPTION_WARNING_NAME$
|
|
55371
|
-
var DescriptionWarning$
|
|
55372
|
-
const descriptionWarningContext = useWarningContext$
|
|
55370
|
+
var DESCRIPTION_WARNING_NAME$2 = "DialogDescriptionWarning";
|
|
55371
|
+
var DescriptionWarning$3 = ({ contentRef, descriptionId }) => {
|
|
55372
|
+
const descriptionWarningContext = useWarningContext$2(DESCRIPTION_WARNING_NAME$2);
|
|
55373
55373
|
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
|
|
55374
55374
|
React.useEffect(() => {
|
|
55375
55375
|
const describedById = contentRef.current?.getAttribute("aria-describedby");
|
|
@@ -55380,30 +55380,30 @@ var DescriptionWarning$2 = ({ contentRef, descriptionId }) => {
|
|
|
55380
55380
|
}, [MESSAGE, contentRef, descriptionId]);
|
|
55381
55381
|
return null;
|
|
55382
55382
|
};
|
|
55383
|
-
var Root$
|
|
55384
|
-
var Trigger$4 = DialogTrigger$
|
|
55385
|
-
var Portal$
|
|
55386
|
-
var Overlay$
|
|
55387
|
-
var Content$
|
|
55388
|
-
var Title$1 = DialogTitle$
|
|
55389
|
-
var Description$1 = DialogDescription$
|
|
55390
|
-
var Close$1 = DialogClose$
|
|
55391
|
-
|
|
55392
|
-
const Dialog = Root$
|
|
55393
|
-
const DialogTrigger$
|
|
55394
|
-
const DialogPortal$
|
|
55395
|
-
const DialogOverlay$
|
|
55396
|
-
DialogOverlay$
|
|
55397
|
-
const DialogContent$
|
|
55398
|
-
DialogContent$
|
|
55383
|
+
var Root$9 = Dialog$2;
|
|
55384
|
+
var Trigger$4 = DialogTrigger$3;
|
|
55385
|
+
var Portal$6 = DialogPortal$3;
|
|
55386
|
+
var Overlay$2 = DialogOverlay$3;
|
|
55387
|
+
var Content$4 = DialogContent$3;
|
|
55388
|
+
var Title$1 = DialogTitle$3;
|
|
55389
|
+
var Description$1 = DialogDescription$3;
|
|
55390
|
+
var Close$1 = DialogClose$2;
|
|
55391
|
+
|
|
55392
|
+
const Dialog$1 = Root$9;
|
|
55393
|
+
const DialogTrigger$2 = Trigger$4;
|
|
55394
|
+
const DialogPortal$2 = Portal$6;
|
|
55395
|
+
const DialogOverlay$2 = React.forwardRef(({ className, ...props }, ref) => (jsx(Overlay$2, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props })));
|
|
55396
|
+
DialogOverlay$2.displayName = Overlay$2.displayName;
|
|
55397
|
+
const DialogContent$2 = React.forwardRef(({ className, children, ...props }, ref) => (jsxs(DialogPortal$2, { children: [jsx(DialogOverlay$2, {}), jsxs(Content$4, { ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className), ...props, children: [children, jsxs(Close$1, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [jsx(X$1, { className: "h-4 w-4" }), jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
|
|
55398
|
+
DialogContent$2.displayName = Content$4.displayName;
|
|
55399
55399
|
const DialogHeader = ({ className, ...props }) => (jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props }));
|
|
55400
55400
|
DialogHeader.displayName = "DialogHeader";
|
|
55401
55401
|
const DialogFooter = ({ className, ...props }) => (jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props }));
|
|
55402
55402
|
DialogFooter.displayName = "DialogFooter";
|
|
55403
|
-
const DialogTitle$
|
|
55404
|
-
DialogTitle$
|
|
55405
|
-
const DialogDescription$
|
|
55406
|
-
DialogDescription$
|
|
55403
|
+
const DialogTitle$2 = React.forwardRef(({ className, ...props }, ref) => (jsx(Title$1, { ref: ref, className: cn("text-lg font-semibold leading-none tracking-tight", className), ...props })));
|
|
55404
|
+
DialogTitle$2.displayName = Title$1.displayName;
|
|
55405
|
+
const DialogDescription$2 = React.forwardRef(({ className, ...props }, ref) => (jsx(Description$1, { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
|
|
55406
|
+
DialogDescription$2.displayName = Description$1.displayName;
|
|
55407
55407
|
|
|
55408
55408
|
const Security = ({ email, onAccountDeleted, }) => {
|
|
55409
55409
|
const [resetPassword] = useResetPasswordMutation();
|
|
@@ -55446,7 +55446,7 @@ const Security = ({ email, onAccountDeleted, }) => {
|
|
|
55446
55446
|
setDeleting(false);
|
|
55447
55447
|
}
|
|
55448
55448
|
};
|
|
55449
|
-
return (jsxs(Fragment$1, { children: [jsxs("div", { className: "border border-gray-200 rounded-lg p-6", children: [jsxs("div", { className: "max-w-md mx-auto text-center py-12", children: [jsx("div", { className: "text-gray-400 dark:text-gray-500 mb-6", children: jsx(Shield, { className: "h-20 w-20 mx-auto" }) }), jsx("h4", { className: "text-xl font-semibold text-gray-900 dark:text-gray-100 mb-4", children: "Security Settings" }), jsx("p", { className: "text-gray-600 dark:text-gray-400 mb-8", children: "Click to reset your password." }), jsx(Button$1, { className: "w-full bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", onClick: handleResetPasswordLink, disabled: processing, children: processing ? 'Sending Password Reset Link...' : 'Send Password Reset Link' })] }), jsx("div", { className: "flex justify-end", children: jsx("button", { type: "button", className: "text-sm text-gray-400 hover:text-[#2563EB] hover:underline transition-colors", onClick: () => setIsConfirmOpen(true), children: "Delete account" }) })] }), jsx(Dialog, { open: isConfirmOpen, onOpenChange: setIsConfirmOpen, children: jsxs(DialogContent$
|
|
55449
|
+
return (jsxs(Fragment$1, { children: [jsxs("div", { className: "border border-gray-200 rounded-lg p-6", children: [jsxs("div", { className: "max-w-md mx-auto text-center py-12", children: [jsx("div", { className: "text-gray-400 dark:text-gray-500 mb-6", children: jsx(Shield, { className: "h-20 w-20 mx-auto" }) }), jsx("h4", { className: "text-xl font-semibold text-gray-900 dark:text-gray-100 mb-4", children: "Security Settings" }), jsx("p", { className: "text-gray-600 dark:text-gray-400 mb-8", children: "Click to reset your password." }), jsx(Button$1, { className: "w-full bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", onClick: handleResetPasswordLink, disabled: processing, children: processing ? 'Sending Password Reset Link...' : 'Send Password Reset Link' })] }), jsx("div", { className: "flex justify-end", children: jsx("button", { type: "button", className: "text-sm text-gray-400 hover:text-[#2563EB] hover:underline transition-colors", onClick: () => setIsConfirmOpen(true), children: "Delete account" }) })] }), jsx(Dialog$1, { open: isConfirmOpen, onOpenChange: setIsConfirmOpen, children: jsxs(DialogContent$2, { children: [jsxs(DialogHeader, { children: [jsx(DialogTitle$2, { children: "Are you sure?" }), jsx(DialogDescription$2, { children: "This will permanently delete your account and all associated data. This action cannot be undone. You will be logged out upon successful deletion." })] }), jsxs(DialogFooter, { children: [jsx(Button$1, { variant: "outline", onClick: () => setIsConfirmOpen(false), disabled: deleting, children: "Cancel" }), jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", onClick: handleDeleteAccount, disabled: deleting, children: deleting ? 'Deleting...' : 'Yes, Delete My Account' })] })] }) }), jsx(Toaster, {})] }));
|
|
55450
55450
|
};
|
|
55451
55451
|
|
|
55452
55452
|
var md5 = {exports: {}};
|
|
@@ -57357,7 +57357,7 @@ var Switch$1 = React.forwardRef(
|
|
|
57357
57357
|
role: "switch",
|
|
57358
57358
|
"aria-checked": checked,
|
|
57359
57359
|
"aria-required": required,
|
|
57360
|
-
"data-state": getState$
|
|
57360
|
+
"data-state": getState$3(checked),
|
|
57361
57361
|
"data-disabled": disabled ? "" : void 0,
|
|
57362
57362
|
disabled,
|
|
57363
57363
|
value,
|
|
@@ -57398,7 +57398,7 @@ var SwitchThumb = React.forwardRef(
|
|
|
57398
57398
|
return /* @__PURE__ */ jsx(
|
|
57399
57399
|
Primitive$3.span,
|
|
57400
57400
|
{
|
|
57401
|
-
"data-state": getState$
|
|
57401
|
+
"data-state": getState$3(context.checked),
|
|
57402
57402
|
"data-disabled": context.disabled ? "" : void 0,
|
|
57403
57403
|
...thumbProps,
|
|
57404
57404
|
ref: forwardedRef
|
|
@@ -57457,14 +57457,14 @@ var SwitchBubbleInput = React.forwardRef(
|
|
|
57457
57457
|
}
|
|
57458
57458
|
);
|
|
57459
57459
|
SwitchBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
|
57460
|
-
function getState$
|
|
57460
|
+
function getState$3(checked) {
|
|
57461
57461
|
return checked ? "checked" : "unchecked";
|
|
57462
57462
|
}
|
|
57463
|
-
var Root$
|
|
57463
|
+
var Root$8 = Switch$1;
|
|
57464
57464
|
var Thumb = SwitchThumb;
|
|
57465
57465
|
|
|
57466
|
-
const Switch = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$
|
|
57467
|
-
Switch.displayName = Root$
|
|
57466
|
+
const Switch = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$8, { className: cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className), ...props, ref: ref, children: jsx(Thumb, { className: cn("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0") }) })));
|
|
57467
|
+
Switch.displayName = Root$8.displayName;
|
|
57468
57468
|
|
|
57469
57469
|
var DISMISSABLE_LAYER_NAME$1 = "DismissableLayer";
|
|
57470
57470
|
var CONTEXT_UPDATE$1 = "dismissableLayer.update";
|
|
@@ -57686,7 +57686,7 @@ var Arrow$1 = React.forwardRef((props, forwardedRef) => {
|
|
|
57686
57686
|
);
|
|
57687
57687
|
});
|
|
57688
57688
|
Arrow$1.displayName = NAME$4;
|
|
57689
|
-
var Root$
|
|
57689
|
+
var Root$7 = Arrow$1;
|
|
57690
57690
|
|
|
57691
57691
|
var POPPER_NAME = "Popper";
|
|
57692
57692
|
var [createPopperContext, createPopperScope] = createContextScope$1(POPPER_NAME);
|
|
@@ -57711,8 +57711,8 @@ var PopperAnchor = React.forwardRef(
|
|
|
57711
57711
|
}
|
|
57712
57712
|
);
|
|
57713
57713
|
PopperAnchor.displayName = ANCHOR_NAME$1;
|
|
57714
|
-
var CONTENT_NAME$
|
|
57715
|
-
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$
|
|
57714
|
+
var CONTENT_NAME$6 = "PopperContent";
|
|
57715
|
+
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$6);
|
|
57716
57716
|
var PopperContent = React.forwardRef(
|
|
57717
57717
|
(props, forwardedRef) => {
|
|
57718
57718
|
const {
|
|
@@ -57731,7 +57731,7 @@ var PopperContent = React.forwardRef(
|
|
|
57731
57731
|
onPlaced,
|
|
57732
57732
|
...contentProps
|
|
57733
57733
|
} = props;
|
|
57734
|
-
const context = usePopperContext(CONTENT_NAME$
|
|
57734
|
+
const context = usePopperContext(CONTENT_NAME$6, __scopePopper);
|
|
57735
57735
|
const [content, setContent] = React.useState(null);
|
|
57736
57736
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
57737
57737
|
const [arrow, setArrow] = React.useState(null);
|
|
@@ -57854,7 +57854,7 @@ var PopperContent = React.forwardRef(
|
|
|
57854
57854
|
);
|
|
57855
57855
|
}
|
|
57856
57856
|
);
|
|
57857
|
-
PopperContent.displayName = CONTENT_NAME$
|
|
57857
|
+
PopperContent.displayName = CONTENT_NAME$6;
|
|
57858
57858
|
var ARROW_NAME$2 = "PopperArrow";
|
|
57859
57859
|
var OPPOSITE_SIDE = {
|
|
57860
57860
|
top: "bottom",
|
|
@@ -57894,7 +57894,7 @@ var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
|
57894
57894
|
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
57895
57895
|
},
|
|
57896
57896
|
children: /* @__PURE__ */ jsx(
|
|
57897
|
-
Root$
|
|
57897
|
+
Root$7,
|
|
57898
57898
|
{
|
|
57899
57899
|
...arrowProps,
|
|
57900
57900
|
ref: forwardedRef,
|
|
@@ -57950,18 +57950,18 @@ function getSideAndAlignFromPlacement(placement) {
|
|
|
57950
57950
|
}
|
|
57951
57951
|
var Root2$2 = Popper;
|
|
57952
57952
|
var Anchor = PopperAnchor;
|
|
57953
|
-
var Content$
|
|
57953
|
+
var Content$3 = PopperContent;
|
|
57954
57954
|
var Arrow = PopperArrow;
|
|
57955
57955
|
|
|
57956
|
-
var PORTAL_NAME$
|
|
57957
|
-
var Portal$
|
|
57956
|
+
var PORTAL_NAME$6 = "Portal";
|
|
57957
|
+
var Portal$5 = React.forwardRef((props, forwardedRef) => {
|
|
57958
57958
|
const { container: containerProp, ...portalProps } = props;
|
|
57959
57959
|
const [mounted, setMounted] = React.useState(false);
|
|
57960
57960
|
useLayoutEffect2(() => setMounted(true), []);
|
|
57961
57961
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
57962
57962
|
return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive$4.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
57963
57963
|
});
|
|
57964
|
-
Portal$
|
|
57964
|
+
Portal$5.displayName = PORTAL_NAME$6;
|
|
57965
57965
|
|
|
57966
57966
|
// src/visually-hidden.tsx
|
|
57967
57967
|
var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
@@ -57991,7 +57991,7 @@ var VisuallyHidden = React.forwardRef(
|
|
|
57991
57991
|
}
|
|
57992
57992
|
);
|
|
57993
57993
|
VisuallyHidden.displayName = NAME$3;
|
|
57994
|
-
var Root$
|
|
57994
|
+
var Root$6 = VisuallyHidden;
|
|
57995
57995
|
|
|
57996
57996
|
var [createTooltipContext, createTooltipScope] = createContextScope$1("Tooltip", [
|
|
57997
57997
|
createPopperScope
|
|
@@ -58136,12 +58136,12 @@ var Tooltip$1 = (props) => {
|
|
|
58136
58136
|
) });
|
|
58137
58137
|
};
|
|
58138
58138
|
Tooltip$1.displayName = TOOLTIP_NAME;
|
|
58139
|
-
var TRIGGER_NAME$
|
|
58139
|
+
var TRIGGER_NAME$5 = "TooltipTrigger";
|
|
58140
58140
|
var TooltipTrigger$1 = React.forwardRef(
|
|
58141
58141
|
(props, forwardedRef) => {
|
|
58142
58142
|
const { __scopeTooltip, ...triggerProps } = props;
|
|
58143
|
-
const context = useTooltipContext(TRIGGER_NAME$
|
|
58144
|
-
const providerContext = useTooltipProviderContext(TRIGGER_NAME$
|
|
58143
|
+
const context = useTooltipContext(TRIGGER_NAME$5, __scopeTooltip);
|
|
58144
|
+
const providerContext = useTooltipProviderContext(TRIGGER_NAME$5, __scopeTooltip);
|
|
58145
58145
|
const popperScope = usePopperScope$1(__scopeTooltip);
|
|
58146
58146
|
const ref = React.useRef(null);
|
|
58147
58147
|
const composedRefs = useComposedRefs(forwardedRef, ref, context.onTriggerChange);
|
|
@@ -58185,29 +58185,29 @@ var TooltipTrigger$1 = React.forwardRef(
|
|
|
58185
58185
|
) });
|
|
58186
58186
|
}
|
|
58187
58187
|
);
|
|
58188
|
-
TooltipTrigger$1.displayName = TRIGGER_NAME$
|
|
58189
|
-
var PORTAL_NAME$
|
|
58190
|
-
var [PortalProvider$
|
|
58188
|
+
TooltipTrigger$1.displayName = TRIGGER_NAME$5;
|
|
58189
|
+
var PORTAL_NAME$5 = "TooltipPortal";
|
|
58190
|
+
var [PortalProvider$3, usePortalContext$3] = createTooltipContext(PORTAL_NAME$5, {
|
|
58191
58191
|
forceMount: void 0
|
|
58192
58192
|
});
|
|
58193
58193
|
var TooltipPortal = (props) => {
|
|
58194
58194
|
const { __scopeTooltip, forceMount, children, container } = props;
|
|
58195
|
-
const context = useTooltipContext(PORTAL_NAME$
|
|
58196
|
-
return /* @__PURE__ */ jsx(PortalProvider$
|
|
58195
|
+
const context = useTooltipContext(PORTAL_NAME$5, __scopeTooltip);
|
|
58196
|
+
return /* @__PURE__ */ jsx(PortalProvider$3, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$5, { asChild: true, container, children }) }) });
|
|
58197
58197
|
};
|
|
58198
|
-
TooltipPortal.displayName = PORTAL_NAME$
|
|
58199
|
-
var CONTENT_NAME$
|
|
58198
|
+
TooltipPortal.displayName = PORTAL_NAME$5;
|
|
58199
|
+
var CONTENT_NAME$5 = "TooltipContent";
|
|
58200
58200
|
var TooltipContent$1 = React.forwardRef(
|
|
58201
58201
|
(props, forwardedRef) => {
|
|
58202
|
-
const portalContext = usePortalContext$
|
|
58202
|
+
const portalContext = usePortalContext$3(CONTENT_NAME$5, props.__scopeTooltip);
|
|
58203
58203
|
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
|
|
58204
|
-
const context = useTooltipContext(CONTENT_NAME$
|
|
58204
|
+
const context = useTooltipContext(CONTENT_NAME$5, props.__scopeTooltip);
|
|
58205
58205
|
return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ jsx(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });
|
|
58206
58206
|
}
|
|
58207
58207
|
);
|
|
58208
58208
|
var TooltipContentHoverable = React.forwardRef((props, forwardedRef) => {
|
|
58209
|
-
const context = useTooltipContext(CONTENT_NAME$
|
|
58210
|
-
const providerContext = useTooltipProviderContext(CONTENT_NAME$
|
|
58209
|
+
const context = useTooltipContext(CONTENT_NAME$5, props.__scopeTooltip);
|
|
58210
|
+
const providerContext = useTooltipProviderContext(CONTENT_NAME$5, props.__scopeTooltip);
|
|
58211
58211
|
const ref = React.useRef(null);
|
|
58212
58212
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
58213
58213
|
const [pointerGraceArea, setPointerGraceArea] = React.useState(null);
|
|
@@ -58278,7 +58278,7 @@ var TooltipContentImpl = React.forwardRef(
|
|
|
58278
58278
|
onPointerDownOutside,
|
|
58279
58279
|
...contentProps
|
|
58280
58280
|
} = props;
|
|
58281
|
-
const context = useTooltipContext(CONTENT_NAME$
|
|
58281
|
+
const context = useTooltipContext(CONTENT_NAME$5, __scopeTooltip);
|
|
58282
58282
|
const popperScope = usePopperScope$1(__scopeTooltip);
|
|
58283
58283
|
const { onClose } = context;
|
|
58284
58284
|
React.useEffect(() => {
|
|
@@ -58305,7 +58305,7 @@ var TooltipContentImpl = React.forwardRef(
|
|
|
58305
58305
|
onFocusOutside: (event) => event.preventDefault(),
|
|
58306
58306
|
onDismiss: onClose,
|
|
58307
58307
|
children: /* @__PURE__ */ jsxs(
|
|
58308
|
-
Content$
|
|
58308
|
+
Content$3,
|
|
58309
58309
|
{
|
|
58310
58310
|
"data-state": context.stateAttribute,
|
|
58311
58311
|
...popperScope,
|
|
@@ -58324,7 +58324,7 @@ var TooltipContentImpl = React.forwardRef(
|
|
|
58324
58324
|
},
|
|
58325
58325
|
children: [
|
|
58326
58326
|
/* @__PURE__ */ jsx(Slottable$2, { children }),
|
|
58327
|
-
/* @__PURE__ */ jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsx(Root$
|
|
58327
|
+
/* @__PURE__ */ jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsx(Root$6, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
|
|
58328
58328
|
]
|
|
58329
58329
|
}
|
|
58330
58330
|
)
|
|
@@ -58332,7 +58332,7 @@ var TooltipContentImpl = React.forwardRef(
|
|
|
58332
58332
|
);
|
|
58333
58333
|
}
|
|
58334
58334
|
);
|
|
58335
|
-
TooltipContent$1.displayName = CONTENT_NAME$
|
|
58335
|
+
TooltipContent$1.displayName = CONTENT_NAME$5;
|
|
58336
58336
|
var ARROW_NAME$1 = "TooltipArrow";
|
|
58337
58337
|
var TooltipArrow = React.forwardRef(
|
|
58338
58338
|
(props, forwardedRef) => {
|
|
@@ -58464,7 +58464,7 @@ function getHullPresorted(points) {
|
|
|
58464
58464
|
var Provider = TooltipProvider$1;
|
|
58465
58465
|
var Root3 = Tooltip$1;
|
|
58466
58466
|
var Trigger$3 = TooltipTrigger$1;
|
|
58467
|
-
var Portal$
|
|
58467
|
+
var Portal$4 = TooltipPortal;
|
|
58468
58468
|
var Content2$2 = TooltipContent$1;
|
|
58469
58469
|
var Arrow2 = TooltipArrow;
|
|
58470
58470
|
|
|
@@ -58478,7 +58478,7 @@ function TooltipTrigger({ ...props }) {
|
|
|
58478
58478
|
return jsx(Trigger$3, { "data-slot": "tooltip-trigger", ...props });
|
|
58479
58479
|
}
|
|
58480
58480
|
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
58481
|
-
return (jsx(Portal$
|
|
58481
|
+
return (jsx(Portal$4, { children: jsxs(Content2$2, { "data-slot": "tooltip-content", sideOffset: sideOffset, className: cn("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance", className), ...props, children: [children, jsx(Arrow2, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })] }) }));
|
|
58482
58482
|
}
|
|
58483
58483
|
|
|
58484
58484
|
// packages/react/context/src/createContext.tsx
|
|
@@ -58574,7 +58574,7 @@ function composeRefs(...refs) {
|
|
|
58574
58574
|
}
|
|
58575
58575
|
|
|
58576
58576
|
// packages/react/slot/src/Slot.tsx
|
|
58577
|
-
var Slot$
|
|
58577
|
+
var Slot$3 = React.forwardRef((props, forwardedRef) => {
|
|
58578
58578
|
const { children, ...slotProps } = props;
|
|
58579
58579
|
const childrenArray = React.Children.toArray(children);
|
|
58580
58580
|
const slottable = childrenArray.find(isSlottable$1);
|
|
@@ -58592,7 +58592,7 @@ var Slot$2 = React.forwardRef((props, forwardedRef) => {
|
|
|
58592
58592
|
}
|
|
58593
58593
|
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
58594
58594
|
});
|
|
58595
|
-
Slot$
|
|
58595
|
+
Slot$3.displayName = "Slot";
|
|
58596
58596
|
var SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
58597
58597
|
const { children, ...slotProps } = props;
|
|
58598
58598
|
if (React.isValidElement(children)) {
|
|
@@ -58671,7 +58671,7 @@ var NODES$2 = [
|
|
|
58671
58671
|
var Primitive$2 = NODES$2.reduce((primitive, node) => {
|
|
58672
58672
|
const Node = React.forwardRef((props, forwardedRef) => {
|
|
58673
58673
|
const { asChild, ...primitiveProps } = props;
|
|
58674
|
-
const Comp = asChild ? Slot$
|
|
58674
|
+
const Comp = asChild ? Slot$3 : node;
|
|
58675
58675
|
if (typeof window !== "undefined") {
|
|
58676
58676
|
window[Symbol.for("radix-ui")] = true;
|
|
58677
58677
|
}
|
|
@@ -58765,11 +58765,11 @@ function getInvalidValueError(propValue, componentName) {
|
|
|
58765
58765
|
|
|
58766
58766
|
Defaulting to \`null\`.`;
|
|
58767
58767
|
}
|
|
58768
|
-
var Root$
|
|
58768
|
+
var Root$5 = Progress$1;
|
|
58769
58769
|
var Indicator = ProgressIndicator;
|
|
58770
58770
|
|
|
58771
|
-
const Progress = React.forwardRef(({ className, value, ...props }, ref) => (jsx(Root$
|
|
58772
|
-
Progress.displayName = Root$
|
|
58771
|
+
const Progress = React.forwardRef(({ className, value, ...props }, ref) => (jsx(Root$5, { ref: ref, className: cn('bg-secondary relative h-4 w-full overflow-hidden rounded-full', className), ...props, children: jsx(Indicator, { className: "bg-primary h-full w-full flex-1 transition-all", style: { transform: `translateX(-${100 - (value || 0)}%)` } }) })));
|
|
58772
|
+
Progress.displayName = Root$5.displayName;
|
|
58773
58773
|
|
|
58774
58774
|
const LOCAL_LLM_ENABLED_KEY = 'ibl_local_llm_enabled';
|
|
58775
58775
|
/**
|
|
@@ -58918,7 +58918,7 @@ function LocalLLMTab({ isAvailable, state, ollamaStatus, isUsingFoundry = false,
|
|
|
58918
58918
|
state.status === 'checking' ||
|
|
58919
58919
|
!(ollamaStatus === null || ollamaStatus === void 0 ? void 0 : ollamaStatus.installed) ||
|
|
58920
58920
|
!(ollamaStatus === null || ollamaStatus === void 0 ? void 0 : ollamaStatus.model_installed);
|
|
58921
|
-
return (jsx("div", { className: "max-w-2xl space-y-6", children: jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "flex items-center justify-between rounded-lg border px-6 py-4", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "Enable Local LLM" }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { "aria-label": "More info about Local LLM", className: "hidden sm:block", children: jsx(Info, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium max-w-xs text-white shadow-sm transition-opacity duration-300 z-50", children: jsxs("div", { className: "space-y-2", children: [jsx("p", { children: "Work offline with AI capabilities on your device." }), (foundryStatus === null || foundryStatus === void 0 ? void 0 : foundryStatus.is_supported) && (jsx("p", { className: "text-xs text-gray-300", children: "Your device automatically uses the best offline AI option available." }))] }) })] }) })] }), jsx(Switch, { checked: switchChecked, onCheckedChange: handleToggle, disabled: switchDisabled, "aria-label": `Enable Local LLM ${switchChecked ? 'enabled' : 'disabled'}`, className: "cursor-pointer data-[state=checked]:bg-blue-500" })] }), shouldShowFoundryInstall ? (jsx("div", { className: "rounded-lg border px-6 py-4 bg-blue-50/30 dark:bg-blue-950/10", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs("div", { className: "space-y-4", children: [jsx("div", { className: "flex items-start gap-3", children: jsxs("div", { className: "flex items-center gap-2 flex-shrink-0 mt-0.5", children: [jsx(Star, { className: "h-5 w-5 text-blue-600 fill-blue-600" }), jsx("span", { className: "px-2 py-0.5 text-xs font-semibold bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300 rounded-full", children: "PREFERRED" })] }) }), jsxs("div", { className: "flex items-start gap-3", children: [jsx(Info, { className: "h-5 w-5 text-blue-500 flex-shrink-0 mt-0.5" }), jsxs("div", { className: "flex-1", children: [jsx("h3", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Setting up offline AI" }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-1", children: "Downloading optimized AI capabilities for your device. This enables you to work offline with full AI features." })] })] }), state.status === 'downloading' || state.status === 'checking' ? (jsxs("div", { className: "space-y-2", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500" }), jsx("span", { className: "text-sm text-gray-700 dark:text-gray-300", children: state.message || 'Preparing download...' })] }), state.progress > 0 && jsx(Progress, { value: state.progress, className: "h-2" })] })) : state.status === 'error' ? (jsxs("div", { className: "space-y-2", children: [jsxs("div", { className: "flex items-center gap-2 text-red-600 dark:text-red-400", children: [jsx(CircleX, { className: "h-4 w-4" }), jsx("span", { className: "text-sm", children: state.error || 'Download failed' })] }), jsx("div", { className: "flex gap-2", children: jsxs(Button$1, { onClick: onInstallFoundry, size: "sm", variant: "outline", children: [jsx(RefreshCw, { className: "h-4 w-4 mr-2" }), "Try Again"] }) })] })) : (jsx("div", { className: "space-y-2", children: jsxs("div", { className: "flex items-center gap-2", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500" }), jsx("span", { className: "text-sm text-gray-700 dark:text-gray-300", children: "Starting download..." })] }) })), jsxs("div", { className: "text-xs text-gray-500 dark:text-gray-400", children: [jsx("p", { className: "font-medium mb-1", children: "Download size: ~500MB" }), jsx("p", { children: "This is a one-time setup to enable offline capabilities." })] })] }) })) : /* Requirements Table - Hidden when using Foundry Local */ !isUsingFoundry ? (jsxs(Fragment$1, { children: [(foundryStatus === null || foundryStatus === void 0 ? void 0 : foundryStatus.is_supported) && (jsx("div", { className: "rounded-lg border px-4 py-3 bg-blue-50/20 dark:bg-blue-950/10", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs("div", { className: "flex items-start gap-2", children: [jsx(Info, { className: "h-4 w-4 text-blue-600 flex-shrink-0 mt-0.5" }), jsxs("div", { className: "text-xs text-gray-600 dark:text-gray-400", children: [jsx("span", { className: "font-medium text-gray-900 dark:text-gray-100", children: "Note:" }), " Your device supports an optimized offline AI option. Currently using alternative setup. For best performance, download the recommended option above."] })] }) })), jsx("div", { className: "rounded-lg border overflow-hidden", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs("table", { className: "w-full", children: [jsx("thead", { children: jsxs("tr", { className: "bg-gray-50 dark:bg-gray-800/50", children: [jsx("th", { className: "px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider", children: "Component" }), jsx("th", { className: "px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider", children: "Status" }), jsx("th", { className: "px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider", children: "Action" })] }) }), jsxs("tbody", { className: "bg-white dark:bg-gray-900 divide-y divide-gray-200 dark:divide-gray-800", children: [jsxs("tr", { children: [jsxs("td", { className: "px-6 py-4 whitespace-nowrap", children: [jsx("div", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Model Manager" }), jsx("div", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Required to run AI models locally" })] }), jsx("td", { className: "px-6 py-4", children: jsx("div", { className: "space-y-2", children: isManagerInstalling ? (jsxs("div", { className: "space-y-2", children: [jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300 rounded-full", children: [jsx(LoaderCircle, { className: "h-3 w-3 animate-spin" }), "Installing..."] }), jsx("div", { className: "w-full max-w-[200px]", children: jsx(Progress, { value: state.managerInstallProgress || 0, className: "h-1.5" }) })] })) : (ollamaStatus === null || ollamaStatus === void 0 ? void 0 : ollamaStatus.installed) ? (jsxs("div", { className: "flex items-center gap-2", children: [jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300 rounded-full", children: [jsx(CircleCheckBig, { className: "h-3 w-3" }), "Installed"] }), ollamaStatus.running && (jsx("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300 rounded-full", children: "Running" }))] })) : (jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300 rounded-full", children: [jsx(CircleX, { className: "h-3 w-3" }), "Not Installed"] })) }) }), jsxs("td", { className: "px-6 py-4 text-right", children: [showInstallManagerButton && !isManagerInstalling && (jsxs(Button$1, { onClick: onInstallOllama, size: "sm", variant: "outline", children: [jsx(Download, { className: "h-4 w-4 mr-2" }), "Install"] })), (ollamaStatus === null || ollamaStatus === void 0 ? void 0 : ollamaStatus.installed) && (jsx(Button$1, { onClick: onCheckStatus, variant: "ghost", size: "sm", children: jsx(RefreshCw, { className: "h-4 w-4" }) }))] })] }), jsxs("tr", { children: [jsxs("td", { className: "px-6 py-4 whitespace-nowrap", children: [jsx("div", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "AI Model (Phi-3 Mini)" }), jsx("div", { className: "text-xs text-gray-500 dark:text-gray-400", children: isDownloading ? state.message : 'Local language model for offline use' })] }), jsx("td", { className: "px-6 py-4", children: jsx("div", { className: "space-y-2", children: isDownloading ? (jsxs("div", { className: "space-y-2", children: [jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300 rounded-full", children: [jsx(LoaderCircle, { className: "h-3 w-3 animate-spin" }), Math.round(state.progress), "%"] }), jsx("div", { className: "w-full max-w-[200px]", children: jsx(Progress, { value: state.progress, className: "h-1.5" }) })] })) : state.status === 'checking' ? (jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300 rounded-full", children: [jsx(LoaderCircle, { className: "h-3 w-3 animate-spin" }), "Checking"] })) : state.status === 'completed' || (ollamaStatus === null || ollamaStatus === void 0 ? void 0 : ollamaStatus.model_installed) ? (jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300 rounded-full", children: [jsx(CircleCheckBig, { className: "h-3 w-3" }), "Ready"] })) : state.status === 'error' ? (jsxs("div", { className: "space-y-1", children: [jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300 rounded-full", children: [jsx(CircleX, { className: "h-3 w-3" }), "Error"] }), state.error && (jsx("p", { className: "text-xs text-red-600 dark:text-red-400 max-w-[200px]", children: state.error }))] })) : state.status === 'cancelled' ? (jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300 rounded-full", children: [jsx(X, { className: "h-3 w-3" }), "Cancelled"] })) : (jsx("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300 rounded-full", children: "Not Downloaded" })) }) }), jsx("td", { className: "px-6 py-4 text-right", children: jsxs("div", { className: "flex items-center justify-end gap-2", children: [isDownloading && (jsxs(Button$1, { onClick: onCancelDownload, variant: "outline", size: "sm", children: [jsx(X, { className: "h-4 w-4 mr-2" }), "Cancel"] })), needsModelDownload && !isDownloading && (jsxs(Button$1, { onClick: onStartDownload, size: "sm", variant: "outline", children: [jsx(Download, { className: "h-4 w-4 mr-2" }), "Download"] })), state.status === 'error' && (jsx(Button$1, { onClick: onResetState, variant: "ghost", size: "sm", children: "Reset" })), (state.status === 'completed' || state.status === 'cancelled') && (jsx(Button$1, { onClick: onCheckStatus, variant: "ghost", size: "sm", children: jsx(RefreshCw, { className: "h-4 w-4" }) }))] }) })] })] })] }) })] })) : (jsx("div", { className: "rounded-lg border px-6 py-4 bg-green-50/30 dark:bg-green-950/10", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs("div", { className: "space-y-4", children: [jsx("div", { className: "flex items-center justify-between", children: jsxs("div", { className: "flex items-center gap-3", children: [jsx(CircleCheckBig, { className: "h-8 w-8 text-green-500 flex-shrink-0" }), jsxs("div", { className: "flex-1", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("h3", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Offline AI Ready" }), jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-semibold bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300 rounded-full", children: [jsx(Star, { className: "h-3 w-3 fill-blue-700 dark:fill-blue-300" }), "PREFERRED"] })] }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-1", children: "Your device is using the optimized offline AI setup. You can work with full capabilities even without internet." })] })] }) }), foundryModels.length > 0 && (jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-xs font-medium text-gray-700 dark:text-gray-300", children: "Select Model" }), jsxs(Select$1, { value: selectedFoundryModel || ((_b = foundryModels[0]) === null || _b === void 0 ? void 0 : _b.id), onValueChange: (value) => onSelectFoundryModel === null || onSelectFoundryModel === void 0 ? void 0 : onSelectFoundryModel(value), children: [jsx(SelectTrigger, { className: "w-full bg-gray-50 border-gray-200 dark:bg-gray-800 dark:border-gray-700", children: jsx(SelectValue, { placeholder: "Select a model" }) }), jsx(SelectContent, { children: foundryModels.map((model) => (jsx(SelectItem, { value: model.id, children: jsxs("div", { className: "flex items-center justify-between w-full gap-4", children: [jsx("span", { className: "font-medium", children: model.name || model.id }), jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500", children: [model.device && (jsx("span", { className: "px-2 py-0.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300 rounded", children: model.device })), model.size && jsx("span", { children: model.size }), !model.is_downloaded && (jsx("span", { className: "px-2 py-0.5 bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-300 rounded", children: "Not Downloaded" })), model.is_downloaded && (jsx("span", { className: "px-2 py-0.5 bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300 rounded", children: "Downloaded" }))] })] }) }, model.id))) })] }), jsxs("div", { className: "flex flex-col gap-1", children: [jsxs("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: [foundryModels.length, " model", foundryModels.length !== 1 ? 's' : '', " available"] }), selectedFoundryModel && (jsxs("div", { className: "flex items-center gap-1.5 text-xs text-green-600 dark:text-green-400", children: [jsx(CircleCheckBig, { className: "h-3.5 w-3.5" }), jsxs("span", { children: ["Using:", ' ', ((_c = foundryModels.find((m) => m.id === selectedFoundryModel)) === null || _c === void 0 ? void 0 : _c.name) ||
|
|
58921
|
+
return (jsx("div", { className: "max-w-2xl space-y-6", children: jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "flex items-center justify-between rounded-lg border px-6 py-4", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "Enable Local LLM" }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { "aria-label": "More info about Local LLM", className: "hidden sm:block", children: jsx(Info, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium max-w-xs text-white shadow-sm transition-opacity duration-300 z-50", children: jsxs("div", { className: "space-y-2", children: [jsx("p", { children: "Work offline with AI capabilities on your device." }), (foundryStatus === null || foundryStatus === void 0 ? void 0 : foundryStatus.is_supported) && (jsx("p", { className: "text-xs text-gray-300", children: "Your device automatically uses the best offline AI option available." }))] }) })] }) })] }), jsx(Switch, { checked: switchChecked, onCheckedChange: handleToggle, disabled: switchDisabled, "aria-label": `Enable Local LLM ${switchChecked ? 'enabled' : 'disabled'}`, className: "cursor-pointer data-[state=checked]:bg-blue-500" })] }), shouldShowFoundryInstall ? (jsx("div", { className: "rounded-lg border px-6 py-4 bg-blue-50/30 dark:bg-blue-950/10", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs("div", { className: "space-y-4", children: [jsx("div", { className: "flex items-start gap-3", children: jsxs("div", { className: "flex items-center gap-2 flex-shrink-0 mt-0.5", children: [jsx(Star, { className: "h-5 w-5 text-blue-600 fill-blue-600" }), jsx("span", { className: "px-2 py-0.5 text-xs font-semibold bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300 rounded-full", children: "PREFERRED" })] }) }), jsxs("div", { className: "flex items-start gap-3", children: [jsx(Info, { className: "h-5 w-5 text-blue-500 flex-shrink-0 mt-0.5" }), jsxs("div", { className: "flex-1", children: [jsx("h3", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Setting up offline AI" }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-1", children: "Downloading optimized AI capabilities for your device. This enables you to work offline with full AI features." })] })] }), state.status === 'downloading' || state.status === 'checking' ? (jsxs("div", { className: "space-y-2", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500" }), jsx("span", { className: "text-sm text-gray-700 dark:text-gray-300", children: state.message || 'Preparing download...' })] }), state.progress > 0 && jsx(Progress, { value: state.progress, className: "h-2" })] })) : state.status === 'error' ? (jsxs("div", { className: "space-y-2", children: [jsxs("div", { className: "flex items-center gap-2 text-red-600 dark:text-red-400", children: [jsx(CircleX, { className: "h-4 w-4" }), jsx("span", { className: "text-sm", children: state.error || 'Download failed' })] }), jsx("div", { className: "flex gap-2", children: jsxs(Button$1, { onClick: onInstallFoundry, size: "sm", variant: "outline", children: [jsx(RefreshCw, { className: "h-4 w-4 mr-2" }), "Try Again"] }) })] })) : (jsx("div", { className: "space-y-2", children: jsxs("div", { className: "flex items-center gap-2", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500" }), jsx("span", { className: "text-sm text-gray-700 dark:text-gray-300", children: "Starting download..." })] }) })), jsxs("div", { className: "text-xs text-gray-500 dark:text-gray-400", children: [jsx("p", { className: "font-medium mb-1", children: "Download size: ~500MB" }), jsx("p", { children: "This is a one-time setup to enable offline capabilities." })] })] }) })) : /* Requirements Table - Hidden when using Foundry Local */ !isUsingFoundry ? (jsxs(Fragment$1, { children: [(foundryStatus === null || foundryStatus === void 0 ? void 0 : foundryStatus.is_supported) && (jsx("div", { className: "rounded-lg border px-4 py-3 bg-blue-50/20 dark:bg-blue-950/10", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs("div", { className: "flex items-start gap-2", children: [jsx(Info, { className: "h-4 w-4 text-blue-600 flex-shrink-0 mt-0.5" }), jsxs("div", { className: "text-xs text-gray-600 dark:text-gray-400", children: [jsx("span", { className: "font-medium text-gray-900 dark:text-gray-100", children: "Note:" }), " Your device supports an optimized offline AI option. Currently using alternative setup. For best performance, download the recommended option above."] })] }) })), jsx("div", { className: "rounded-lg border overflow-hidden", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs("table", { className: "w-full", children: [jsx("thead", { children: jsxs("tr", { className: "bg-gray-50 dark:bg-gray-800/50", children: [jsx("th", { className: "px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider", children: "Component" }), jsx("th", { className: "px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider", children: "Status" }), jsx("th", { className: "px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider", children: "Action" })] }) }), jsxs("tbody", { className: "bg-white dark:bg-gray-900 divide-y divide-gray-200 dark:divide-gray-800", children: [jsxs("tr", { children: [jsxs("td", { className: "px-6 py-4 whitespace-nowrap", children: [jsx("div", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Model Manager" }), jsx("div", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Required to run AI models locally" })] }), jsx("td", { className: "px-6 py-4", children: jsx("div", { className: "space-y-2", children: isManagerInstalling ? (jsxs("div", { className: "space-y-2", children: [jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300 rounded-full", children: [jsx(LoaderCircle, { className: "h-3 w-3 animate-spin" }), "Installing..."] }), jsx("div", { className: "w-full max-w-[200px]", children: jsx(Progress, { value: state.managerInstallProgress || 0, className: "h-1.5" }) })] })) : (ollamaStatus === null || ollamaStatus === void 0 ? void 0 : ollamaStatus.installed) ? (jsxs("div", { className: "flex items-center gap-2", children: [jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300 rounded-full", children: [jsx(CircleCheckBig, { className: "h-3 w-3" }), "Installed"] }), ollamaStatus.running && (jsx("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300 rounded-full", children: "Running" }))] })) : (jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300 rounded-full", children: [jsx(CircleX, { className: "h-3 w-3" }), "Not Installed"] })) }) }), jsxs("td", { className: "px-6 py-4 text-right", children: [showInstallManagerButton && !isManagerInstalling && (jsxs(Button$1, { onClick: onInstallOllama, size: "sm", variant: "outline", children: [jsx(Download, { className: "h-4 w-4 mr-2" }), "Install"] })), (ollamaStatus === null || ollamaStatus === void 0 ? void 0 : ollamaStatus.installed) && (jsx(Button$1, { onClick: onCheckStatus, variant: "ghost", size: "sm", children: jsx(RefreshCw, { className: "h-4 w-4" }) }))] })] }), jsxs("tr", { children: [jsxs("td", { className: "px-6 py-4 whitespace-nowrap", children: [jsx("div", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "AI Model (Phi-3 Mini)" }), jsx("div", { className: "text-xs text-gray-500 dark:text-gray-400", children: isDownloading ? state.message : 'Local language model for offline use' })] }), jsx("td", { className: "px-6 py-4", children: jsx("div", { className: "space-y-2", children: isDownloading ? (jsxs("div", { className: "space-y-2", children: [jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300 rounded-full", children: [jsx(LoaderCircle, { className: "h-3 w-3 animate-spin" }), Math.round(state.progress), "%"] }), jsx("div", { className: "w-full max-w-[200px]", children: jsx(Progress, { value: state.progress, className: "h-1.5" }) })] })) : state.status === 'checking' ? (jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300 rounded-full", children: [jsx(LoaderCircle, { className: "h-3 w-3 animate-spin" }), "Checking"] })) : state.status === 'completed' || (ollamaStatus === null || ollamaStatus === void 0 ? void 0 : ollamaStatus.model_installed) ? (jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300 rounded-full", children: [jsx(CircleCheckBig, { className: "h-3 w-3" }), "Ready"] })) : state.status === 'error' ? (jsxs("div", { className: "space-y-1", children: [jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300 rounded-full", children: [jsx(CircleX, { className: "h-3 w-3" }), "Error"] }), state.error && (jsx("p", { className: "text-xs text-red-600 dark:text-red-400 max-w-[200px]", children: state.error }))] })) : state.status === 'cancelled' ? (jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300 rounded-full", children: [jsx(X$1, { className: "h-3 w-3" }), "Cancelled"] })) : (jsx("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300 rounded-full", children: "Not Downloaded" })) }) }), jsx("td", { className: "px-6 py-4 text-right", children: jsxs("div", { className: "flex items-center justify-end gap-2", children: [isDownloading && (jsxs(Button$1, { onClick: onCancelDownload, variant: "outline", size: "sm", children: [jsx(X$1, { className: "h-4 w-4 mr-2" }), "Cancel"] })), needsModelDownload && !isDownloading && (jsxs(Button$1, { onClick: onStartDownload, size: "sm", variant: "outline", children: [jsx(Download, { className: "h-4 w-4 mr-2" }), "Download"] })), state.status === 'error' && (jsx(Button$1, { onClick: onResetState, variant: "ghost", size: "sm", children: "Reset" })), (state.status === 'completed' || state.status === 'cancelled') && (jsx(Button$1, { onClick: onCheckStatus, variant: "ghost", size: "sm", children: jsx(RefreshCw, { className: "h-4 w-4" }) }))] }) })] })] })] }) })] })) : (jsx("div", { className: "rounded-lg border px-6 py-4 bg-green-50/30 dark:bg-green-950/10", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs("div", { className: "space-y-4", children: [jsx("div", { className: "flex items-center justify-between", children: jsxs("div", { className: "flex items-center gap-3", children: [jsx(CircleCheckBig, { className: "h-8 w-8 text-green-500 flex-shrink-0" }), jsxs("div", { className: "flex-1", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("h3", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: "Offline AI Ready" }), jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-semibold bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300 rounded-full", children: [jsx(Star, { className: "h-3 w-3 fill-blue-700 dark:fill-blue-300" }), "PREFERRED"] })] }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-1", children: "Your device is using the optimized offline AI setup. You can work with full capabilities even without internet." })] })] }) }), foundryModels.length > 0 && (jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-xs font-medium text-gray-700 dark:text-gray-300", children: "Select Model" }), jsxs(Select$1, { value: selectedFoundryModel || ((_b = foundryModels[0]) === null || _b === void 0 ? void 0 : _b.id), onValueChange: (value) => onSelectFoundryModel === null || onSelectFoundryModel === void 0 ? void 0 : onSelectFoundryModel(value), children: [jsx(SelectTrigger, { className: "w-full bg-gray-50 border-gray-200 dark:bg-gray-800 dark:border-gray-700", children: jsx(SelectValue, { placeholder: "Select a model" }) }), jsx(SelectContent, { children: foundryModels.map((model) => (jsx(SelectItem, { value: model.id, children: jsxs("div", { className: "flex items-center justify-between w-full gap-4", children: [jsx("span", { className: "font-medium", children: model.name || model.id }), jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500", children: [model.device && (jsx("span", { className: "px-2 py-0.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300 rounded", children: model.device })), model.size && jsx("span", { children: model.size }), !model.is_downloaded && (jsx("span", { className: "px-2 py-0.5 bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-300 rounded", children: "Not Downloaded" })), model.is_downloaded && (jsx("span", { className: "px-2 py-0.5 bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300 rounded", children: "Downloaded" }))] })] }) }, model.id))) })] }), jsxs("div", { className: "flex flex-col gap-1", children: [jsxs("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: [foundryModels.length, " model", foundryModels.length !== 1 ? 's' : '', " available"] }), selectedFoundryModel && (jsxs("div", { className: "flex items-center gap-1.5 text-xs text-green-600 dark:text-green-400", children: [jsx(CircleCheckBig, { className: "h-3.5 w-3.5" }), jsxs("span", { children: ["Using:", ' ', ((_c = foundryModels.find((m) => m.id === selectedFoundryModel)) === null || _c === void 0 ? void 0 : _c.name) ||
|
|
58922
58922
|
selectedFoundryModel, ((_d = foundryModels.find((m) => m.id === selectedFoundryModel)) === null || _d === void 0 ? void 0 : _d.device) && (jsxs("span", { className: "ml-1 text-gray-500 dark:text-gray-400", children: ["(", (_e = foundryModels.find((m) => m.id === selectedFoundryModel)) === null || _e === void 0 ? void 0 : _e.device, ")"] }))] })] }))] })] })), state.status === 'downloading' && (jsxs("div", { className: "mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg", children: [jsxs("div", { className: "flex items-center gap-3", children: [jsx("div", { className: "animate-spin h-5 w-5 border-2 border-blue-600 dark:border-blue-400 border-t-transparent rounded-full" }), jsxs("div", { className: "flex-1", children: [jsx("p", { className: "text-sm font-medium text-blue-900 dark:text-blue-100", children: state.message }), state.progress > 0 && (jsx("div", { className: "mt-2 w-full bg-blue-200 dark:bg-blue-800 rounded-full h-2", children: jsx("div", { className: "bg-blue-600 dark:bg-blue-400 h-2 rounded-full transition-all duration-300", style: { width: `${state.progress}%` } }) }))] })] }), state.logs.length > 0 && (jsx("div", { className: "mt-3 max-h-32 overflow-y-auto bg-white dark:bg-gray-800 rounded border border-blue-200 dark:border-blue-700 p-2", children: state.logs.slice(-10).map((log, idx) => (jsx("div", { className: `text-xs font-mono ${log.level === 'error'
|
|
58923
58923
|
? 'text-red-600 dark:text-red-400'
|
|
58924
58924
|
: log.level === 'warn'
|
|
@@ -58977,11 +58977,11 @@ var Label$1 = React.forwardRef((props, forwardedRef) => {
|
|
|
58977
58977
|
);
|
|
58978
58978
|
});
|
|
58979
58979
|
Label$1.displayName = NAME$2;
|
|
58980
|
-
var Root$
|
|
58980
|
+
var Root$4 = Label$1;
|
|
58981
58981
|
|
|
58982
58982
|
const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
58983
|
-
const Label = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$
|
|
58984
|
-
Label.displayName = Root$
|
|
58983
|
+
const Label = React.forwardRef(({ className, ...props }, ref) => (jsx(Root$4, { ref: ref, className: cn(labelVariants(), className), ...props })));
|
|
58984
|
+
Label.displayName = Root$4.displayName;
|
|
58985
58985
|
|
|
58986
58986
|
var dayjs_min = {exports: {}};
|
|
58987
58987
|
|
|
@@ -59098,7 +59098,7 @@ function InstitutionDialog({ open, onOpenChange, org, username }) {
|
|
|
59098
59098
|
}
|
|
59099
59099
|
},
|
|
59100
59100
|
});
|
|
59101
|
-
return (jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: jsx(DialogContent$
|
|
59101
|
+
return (jsx(Dialog$1, { open: open, onOpenChange: onOpenChange, children: jsx(DialogContent$2, { className: "p-0 overflow-hidden max-w-lg", children: jsxs("form", { onSubmit: (event) => {
|
|
59102
59102
|
event.preventDefault();
|
|
59103
59103
|
event.stopPropagation();
|
|
59104
59104
|
if (!form.state.isFormValid) {
|
|
@@ -59106,7 +59106,7 @@ function InstitutionDialog({ open, onOpenChange, org, username }) {
|
|
|
59106
59106
|
return;
|
|
59107
59107
|
}
|
|
59108
59108
|
form.handleSubmit();
|
|
59109
|
-
}, children: [jsx("div", { className: "flex items-center justify-between px-6 py-4 border-b", children: jsx(DialogTitle$
|
|
59109
|
+
}, children: [jsx("div", { className: "flex items-center justify-between px-6 py-4 border-b", children: jsx(DialogTitle$2, { className: "text-lg font-semibold text-gray-900", children: "Add Institution" }) }), jsx(DialogDescription$2, { className: "sr-only", children: "Create a new institution entry" }), jsxs("div", { className: "p-6 space-y-6 max-h-[70vh] overflow-y-auto", children: [jsx(form.Field, { name: "name", validators: {
|
|
59110
59110
|
onChange: ({ value }) => (!value ? 'Name is required' : undefined),
|
|
59111
59111
|
}, children: (field) => (jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "institution-name", children: "Name" }), jsx(Input, { id: "institution-name", value: field.state.value, onChange: (event) => field.handleChange(event.target.value), placeholder: "e.g. Harvard University" }), !field.state.meta.isValid && (jsx("p", { className: "text-sm text-red-500", children: field.state.meta.errors.join(', ') }))] })) }), jsx(form.Field, { name: "institution_type", validators: {
|
|
59112
59112
|
onChange: ({ value }) => (!value ? 'Institution type is required' : undefined),
|
|
@@ -59254,7 +59254,7 @@ function EducationDialog({ open, onOpenChange, org, username, education, onCompl
|
|
|
59254
59254
|
};
|
|
59255
59255
|
const isCurrent = useStore(form.store, (state) => state.values.is_current);
|
|
59256
59256
|
const isSubmitting = form.state.isSubmitting || isCreating || isUpdating;
|
|
59257
|
-
return (jsxs(Fragment$1, { children: [jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: jsx(DialogContent$
|
|
59257
|
+
return (jsxs(Fragment$1, { children: [jsx(Dialog$1, { open: open, onOpenChange: onOpenChange, children: jsx(DialogContent$2, { className: "p-0 overflow-hidden max-w-2xl max-h-[90vh] overflow-y-auto", children: jsxs("form", { onSubmit: (event) => {
|
|
59258
59258
|
event.preventDefault();
|
|
59259
59259
|
event.stopPropagation();
|
|
59260
59260
|
if (!form.state.isFormValid) {
|
|
@@ -59262,7 +59262,7 @@ function EducationDialog({ open, onOpenChange, org, username, education, onCompl
|
|
|
59262
59262
|
return;
|
|
59263
59263
|
}
|
|
59264
59264
|
form.handleSubmit();
|
|
59265
|
-
}, children: [jsx("div", { className: "px-6 py-4 border-b", children: jsxs("div", { children: [jsx(DialogTitle$
|
|
59265
|
+
}, children: [jsx("div", { className: "px-6 py-4 border-b", children: jsxs("div", { children: [jsx(DialogTitle$2, { className: "text-lg font-semibold text-gray-900", children: education ? 'Edit education' : 'Add education' }), jsx(DialogDescription$2, { className: "text-sm text-gray-500", children: "Provide details about your academic background" })] }) }), jsxs("div", { className: "grid gap-6 p-6 md:grid-cols-2", children: [jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "education-degree", children: "Degree" }), jsx(form.Field, { name: "degree", validators: {
|
|
59266
59266
|
onChange: ({ value }) => (!value ? 'Degree is required' : undefined),
|
|
59267
59267
|
}, children: (field) => (jsxs("div", { className: "space-y-2", children: [jsx(Input, { id: "education-degree", className: "h-10", value: field.state.value, onChange: (event) => field.handleChange(event.target.value), placeholder: "e.g. Bachelor of Science" }), !field.state.meta.isValid && (jsx("p", { className: "text-sm text-red-500", children: field.state.meta.errors.join(', ') }))] })) })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "education-field", children: "Field of study" }), jsx(form.Field, { name: "field_of_study", children: (field) => (jsxs(Select$1, { value: field.state.value, onValueChange: (value) => field.handleChange(value), children: [jsx(SelectTrigger, { id: "education-field", className: "h-10", children: jsx(SelectValue, { placeholder: "Select field" }) }), jsx(SelectContent, { children: FIELDS_OF_STUDY.map((fieldOption) => (jsx(SelectItem, { value: fieldOption, children: fieldOption }, fieldOption))) })] })) })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "education-institution", children: "Institution" }), jsx(form.Field, { name: "institution_id", validators: {
|
|
59268
59268
|
onChange: ({ value }) => (!value ? 'Institution is required' : undefined),
|
|
@@ -59354,7 +59354,7 @@ function CompanyDialog({ open, onOpenChange, org, username }) {
|
|
|
59354
59354
|
}
|
|
59355
59355
|
},
|
|
59356
59356
|
});
|
|
59357
|
-
return (jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: jsx(DialogContent$
|
|
59357
|
+
return (jsx(Dialog$1, { open: open, onOpenChange: onOpenChange, children: jsx(DialogContent$2, { className: "p-0 overflow-hidden max-w-lg", children: jsxs("form", { onSubmit: (event) => {
|
|
59358
59358
|
event.preventDefault();
|
|
59359
59359
|
event.stopPropagation();
|
|
59360
59360
|
if (!form.state.isFormValid) {
|
|
@@ -59362,7 +59362,7 @@ function CompanyDialog({ open, onOpenChange, org, username }) {
|
|
|
59362
59362
|
return;
|
|
59363
59363
|
}
|
|
59364
59364
|
form.handleSubmit();
|
|
59365
|
-
}, children: [jsx("div", { className: "flex items-center justify-between px-6 py-4 border-b", children: jsx(DialogTitle$
|
|
59365
|
+
}, children: [jsx("div", { className: "flex items-center justify-between px-6 py-4 border-b", children: jsx(DialogTitle$2, { className: "text-lg font-semibold text-gray-900", children: "Add Company" }) }), jsx(DialogDescription$2, { className: "sr-only", children: "Create a new company entry" }), jsxs("div", { className: "p-6 space-y-6", children: [jsx(form.Field, { name: "name", validators: {
|
|
59366
59366
|
onChange: ({ value }) => (!value ? 'Name is required' : undefined),
|
|
59367
59367
|
}, children: (field) => (jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "company-name", children: "Name" }), jsx(Input, { id: "company-name", value: field.state.value, onChange: (event) => field.handleChange(event.target.value), placeholder: "Enter company name" }), !field.state.meta.isValid && (jsx("p", { className: "text-sm text-red-500", children: field.state.meta.errors.join(', ') }))] })) }), jsx(form.Field, { name: "industry", validators: {
|
|
59368
59368
|
onChange: ({ value }) => (!value ? 'Industry is required' : undefined),
|
|
@@ -59507,7 +59507,7 @@ function ExperienceDialog({ open, onOpenChange, org, username, experience, onCom
|
|
|
59507
59507
|
};
|
|
59508
59508
|
const isCurrent = useStore(form.store, (state) => state.values.is_current);
|
|
59509
59509
|
const isSubmitting = form.state.isSubmitting || isCreating || isUpdating;
|
|
59510
|
-
return (jsxs(Fragment$1, { children: [jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: jsx(DialogContent$
|
|
59510
|
+
return (jsxs(Fragment$1, { children: [jsx(Dialog$1, { open: open, onOpenChange: onOpenChange, children: jsx(DialogContent$2, { className: "p-0 overflow-hidden max-w-2xl max-h-[90vh] overflow-y-auto", children: jsxs("form", { onSubmit: (event) => {
|
|
59511
59511
|
event.preventDefault();
|
|
59512
59512
|
event.stopPropagation();
|
|
59513
59513
|
if (!form.state.isFormValid) {
|
|
@@ -59515,7 +59515,7 @@ function ExperienceDialog({ open, onOpenChange, org, username, experience, onCom
|
|
|
59515
59515
|
return;
|
|
59516
59516
|
}
|
|
59517
59517
|
form.handleSubmit();
|
|
59518
|
-
}, children: [jsx("div", { className: "px-6 py-4 border-b", children: jsxs("div", { children: [jsx(DialogTitle$
|
|
59518
|
+
}, children: [jsx("div", { className: "px-6 py-4 border-b", children: jsxs("div", { children: [jsx(DialogTitle$2, { className: "text-lg font-semibold text-gray-900", children: experience ? 'Edit experience' : 'Add experience' }), jsx(DialogDescription$2, { className: "text-sm text-gray-500", children: "Share your professional experience" })] }) }), jsxs("div", { className: "grid gap-6 p-6 md:grid-cols-2", children: [jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "experience-title", children: "Title" }), jsx(form.Field, { name: "title", validators: {
|
|
59519
59519
|
onChange: ({ value }) => (!value ? 'Title is required' : undefined),
|
|
59520
59520
|
}, children: (field) => (jsxs("div", { className: "space-y-2", children: [jsx(Input, { id: "experience-title", className: "h-10", value: field.state.value, onChange: (event) => field.handleChange(event.target.value), placeholder: "Enter title" }), !field.state.meta.isValid && (jsx("p", { className: "text-sm text-red-500", children: field.state.meta.errors.join(', ') }))] })) })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "experience-company", children: "Company" }), jsx(form.Field, { name: "company_id", validators: {
|
|
59521
59521
|
onChange: ({ value }) => (!value ? 'Company is required' : undefined),
|
|
@@ -81808,11 +81808,11 @@ function AddMemoryDialog({ open, onOpenChange, org, username }) {
|
|
|
81808
81808
|
}
|
|
81809
81809
|
}
|
|
81810
81810
|
};
|
|
81811
|
-
return (jsx(Dialog, { open: open, onOpenChange: (isOpen) => {
|
|
81811
|
+
return (jsx(Dialog$1, { open: open, onOpenChange: (isOpen) => {
|
|
81812
81812
|
if (!isOpen)
|
|
81813
81813
|
setContent('');
|
|
81814
81814
|
onOpenChange(isOpen);
|
|
81815
|
-
}, children: jsx(DialogContent$
|
|
81815
|
+
}, children: jsx(DialogContent$2, { className: "p-0 overflow-hidden max-w-lg", children: jsxs("form", { onSubmit: handleSubmit, children: [jsx("div", { className: "flex items-center justify-between px-6 py-4 border-b", children: jsx(DialogTitle$2, { className: "text-lg font-semibold text-gray-900", children: "Add Memory" }) }), jsx(DialogDescription$2, { className: "sr-only", children: "Add a new memory for the AI to remember about you" }), jsx("div", { className: "p-6 space-y-4", children: jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "memory-content", children: "What should the AI remember?" }), jsx(Textarea, { id: "memory-content", placeholder: "e.g., I prefer learning through practical examples rather than theory.", value: content, onChange: (e) => setContent(e.target.value), rows: 4, className: "w-full bg-gray-50 border-gray-200 focus:ring-blue-500 focus:border-blue-500 text-sm resize-none", disabled: isLoading }), content.length > 0 && content.trim().length < 10 && (jsx("p", { className: "text-sm text-red-500", children: "Must be at least 10 characters" }))] }) }), jsxs("div", { className: "flex justify-end gap-3 border-t px-6 py-4", children: [jsx(Button$1, { type: "button", variant: "outline", onClick: () => onOpenChange(false), disabled: isLoading, children: "Cancel" }), jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", type: "submit", disabled: isLoading || content.trim().length < 10, children: isLoading ? 'Saving...' : 'Save Memory' })] })] }) }) }));
|
|
81816
81816
|
}
|
|
81817
81817
|
|
|
81818
81818
|
const Pagination = ({ className, ...props }) => (jsx("nav", { role: "navigation", "aria-label": "pagination", className: cn("mx-auto flex w-full justify-center", className), ...props }));
|
|
@@ -82198,7 +82198,7 @@ var TabsList$1 = React.forwardRef(
|
|
|
82198
82198
|
const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
|
|
82199
82199
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
|
82200
82200
|
return /* @__PURE__ */ jsx(
|
|
82201
|
-
Root$
|
|
82201
|
+
Root$d,
|
|
82202
82202
|
{
|
|
82203
82203
|
asChild: true,
|
|
82204
82204
|
...rovingFocusGroupScope,
|
|
@@ -82219,11 +82219,11 @@ var TabsList$1 = React.forwardRef(
|
|
|
82219
82219
|
}
|
|
82220
82220
|
);
|
|
82221
82221
|
TabsList$1.displayName = TAB_LIST_NAME;
|
|
82222
|
-
var TRIGGER_NAME$
|
|
82222
|
+
var TRIGGER_NAME$4 = "TabsTrigger";
|
|
82223
82223
|
var TabsTrigger$1 = React.forwardRef(
|
|
82224
82224
|
(props, forwardedRef) => {
|
|
82225
82225
|
const { __scopeTabs, value, disabled = false, ...triggerProps } = props;
|
|
82226
|
-
const context = useTabsContext(TRIGGER_NAME$
|
|
82226
|
+
const context = useTabsContext(TRIGGER_NAME$4, __scopeTabs);
|
|
82227
82227
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
|
82228
82228
|
const triggerId = makeTriggerId(context.baseId, value);
|
|
82229
82229
|
const contentId = makeContentId(context.baseId, value);
|
|
@@ -82270,12 +82270,12 @@ var TabsTrigger$1 = React.forwardRef(
|
|
|
82270
82270
|
);
|
|
82271
82271
|
}
|
|
82272
82272
|
);
|
|
82273
|
-
TabsTrigger$1.displayName = TRIGGER_NAME$
|
|
82274
|
-
var CONTENT_NAME$
|
|
82273
|
+
TabsTrigger$1.displayName = TRIGGER_NAME$4;
|
|
82274
|
+
var CONTENT_NAME$4 = "TabsContent";
|
|
82275
82275
|
var TabsContent$1 = React.forwardRef(
|
|
82276
82276
|
(props, forwardedRef) => {
|
|
82277
82277
|
const { __scopeTabs, value, forceMount, children, ...contentProps } = props;
|
|
82278
|
-
const context = useTabsContext(CONTENT_NAME$
|
|
82278
|
+
const context = useTabsContext(CONTENT_NAME$4, __scopeTabs);
|
|
82279
82279
|
const triggerId = makeTriggerId(context.baseId, value);
|
|
82280
82280
|
const contentId = makeContentId(context.baseId, value);
|
|
82281
82281
|
const isSelected = value === context.value;
|
|
@@ -82305,7 +82305,7 @@ var TabsContent$1 = React.forwardRef(
|
|
|
82305
82305
|
) });
|
|
82306
82306
|
}
|
|
82307
82307
|
);
|
|
82308
|
-
TabsContent$1.displayName = CONTENT_NAME$
|
|
82308
|
+
TabsContent$1.displayName = CONTENT_NAME$4;
|
|
82309
82309
|
function makeTriggerId(baseId, value) {
|
|
82310
82310
|
return `${baseId}-trigger-${value}`;
|
|
82311
82311
|
}
|
|
@@ -82315,15 +82315,15 @@ function makeContentId(baseId, value) {
|
|
|
82315
82315
|
var Root2$1 = Tabs$1;
|
|
82316
82316
|
var List = TabsList$1;
|
|
82317
82317
|
var Trigger$2 = TabsTrigger$1;
|
|
82318
|
-
var Content$
|
|
82318
|
+
var Content$2 = TabsContent$1;
|
|
82319
82319
|
|
|
82320
82320
|
const Tabs = Root2$1;
|
|
82321
82321
|
const TabsList = React.forwardRef(({ className, ...props }, ref) => (jsx(List, { ref: ref, className: cn("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1", className), ...props })));
|
|
82322
82322
|
TabsList.displayName = List.displayName;
|
|
82323
82323
|
const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => (jsx(Trigger$2, { ref: ref, className: cn("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow", className), ...props })));
|
|
82324
82324
|
TabsTrigger.displayName = Trigger$2.displayName;
|
|
82325
|
-
const TabsContent = React.forwardRef(({ className, ...props }, ref) => (jsx(Content$
|
|
82326
|
-
TabsContent.displayName = Content$
|
|
82325
|
+
const TabsContent = React.forwardRef(({ className, ...props }, ref) => (jsx(Content$2, { ref: ref, className: cn("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none", className), ...props })));
|
|
82326
|
+
TabsContent.displayName = Content$2.displayName;
|
|
82327
82327
|
|
|
82328
82328
|
const getUserName$1 = () => {
|
|
82329
82329
|
var _a;
|
|
@@ -82420,7 +82420,7 @@ function CSVEditor({ csvData, onSave, onCancel }) {
|
|
|
82420
82420
|
const getRowAccessibleName = (row, rowIndex) => {
|
|
82421
82421
|
return row.join(' ') || `Row ${rowIndex + 1}`;
|
|
82422
82422
|
};
|
|
82423
|
-
return (jsx(Dialog, { open: true, onOpenChange: (open) => !open && onCancel(), children: jsxs(DialogContent$
|
|
82423
|
+
return (jsx(Dialog$1, { open: true, onOpenChange: (open) => !open && onCancel(), children: jsxs(DialogContent$2, { className: "max-w-6xl max-h-[90vh] flex flex-col p-0", "data-testid": "csv-editor-dialog", "aria-describedby": "csv-editor-description", children: [jsxs(DialogHeader, { className: "px-6 py-4 border-b", children: [jsx("div", { className: "flex items-center justify-between", children: jsx(DialogTitle$2, { className: "text-xl font-bold", children: "Edit CSV Data" }) }), jsx("p", { id: "csv-editor-description", className: "sr-only", children: "Edit CSV data in a table format. Click on cells to edit values, use Tab to navigate between cells, and press Enter to confirm edits." })] }), jsx("div", { className: "flex-1 overflow-auto px-6 py-4", role: "region", "aria-label": "CSV data editor", children: jsx("div", { className: "overflow-auto max-h-[60vh] overflow-x-auto", children: jsxs("table", { className: "w-full border-collapse min-w-full", "data-testid": "csv-editor-table", "aria-label": "CSV data table", children: [jsx("thead", { className: "sticky top-0 bg-gray-50 z-10", children: jsxs("tr", { children: [headers.map((header, colIndex) => (jsx("th", { className: "border border-gray-300 p-2 bg-gray-100 whitespace-nowrap", scope: "col", children: jsx(Input, { value: header, onChange: (e) => handleHeaderChange(colIndex, e.target.value), className: "h-8 text-sm font-medium border-0 bg-transparent p-1 min-w-[120px]", "aria-label": `Column header ${colIndex + 1}`, "data-testid": `csv-header-input-${colIndex}` }) }, colIndex))), jsx("th", { className: "border border-gray-300 p-2 bg-gray-100 whitespace-nowrap", scope: "col", "aria-label": "Row actions" })] }) }), jsxs("tbody", { children: [rows.map((row, rowIndex) => (jsxs("tr", { className: `transition-all duration-200 ${deletingRowIndex === rowIndex
|
|
82424
82424
|
? 'bg-red-100 opacity-0 scale-y-0'
|
|
82425
82425
|
: 'hover:bg-gray-50'}`, "aria-label": getRowAccessibleName(row, rowIndex), children: [row.map((cell, colIndex) => (jsx("td", { className: "border border-gray-300 p-0 min-w-[120px] whitespace-nowrap", onClick: () => handleCellClick(rowIndex, colIndex), "data-testid": `csv-cell-${rowIndex}-${colIndex}`, "aria-label": `${headers[colIndex]}: ${cell || 'empty'}`, children: (isEditing === null || isEditing === void 0 ? void 0 : isEditing.row) === rowIndex && (isEditing === null || isEditing === void 0 ? void 0 : isEditing.col) === colIndex ? (jsx(Input, { value: editValue, onChange: (e) => handleCellChange(e.target.value), onBlur: handleCellBlur, onKeyDown: handleKeyDown, className: "h-8 border-0 rounded-none focus:ring-0 p-2", autoFocus: true, "aria-label": `Edit ${headers[colIndex]} for row ${rowIndex + 1}`, "data-testid": `csv-cell-input-${rowIndex}-${colIndex}` })) : (jsx("div", { className: "p-2 h-8 flex items-center cursor-pointer hover:bg-blue-50", role: "button", tabIndex: 0, onKeyDown: (e) => {
|
|
82426
82426
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
@@ -83016,7 +83016,7 @@ function CoursesTab({ tenant, currentPage, itemsPerPage, hasManageUsersPermissio
|
|
|
83016
83016
|
else {
|
|
83017
83017
|
setSelectedCourses(selectedCourses.filter((c) => c.id !== course.id));
|
|
83018
83018
|
}
|
|
83019
|
-
} }), jsx("div", { className: "flex-1", children: jsx(Label, { htmlFor: `course-${course.id}`, className: "font-medium cursor-pointer text-sm", children: course.name }) })] }, course.id))), isFetchingCourses && courseCurrentPage > 1 && (jsxs("div", { className: "p-3 text-sm text-gray-500 flex items-center justify-center gap-2", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" }), "Loading more..."] }))] })) })] }))] }), jsxs("div", { className: "flex gap-2 w-full lg:w-auto", children: [jsx(Button$1, { type: "submit", className: "gap-2 bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90 hover:text-white text-sm h-11 flex-1 lg:flex-none", disabled: inviteSent || !isFormValid, children: inviteSent ? (jsxs(Fragment$1, { children: [jsx(Check, { className: "h-4 w-4" }), jsx("span", { className: "hidden sm:inline", children: "Invite Sent" }), jsx("span", { className: "sm:hidden", children: "Sent" })] })) : (jsxs(Fragment$1, { children: [jsx(Plus, { className: "h-4 w-4" }), jsx("span", { className: "hidden sm:inline", children: "Send Invite" }), jsx("span", { className: "sm:hidden", children: "Send" })] })) }), jsxs("label", { className: isParsingCSV ? 'cursor-not-allowed' : 'cursor-pointer', children: [jsx(Button$1, { variant: "outline", size: "default", className: "gap-2 bg-transparent h-11", disabled: isParsingCSV, asChild: !isParsingCSV, type: "button", children: jsxs("span", { className: "flex items-center gap-2", children: [isParsingCSV ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" })) : (jsx(Upload, { className: "h-4 w-4" })), jsx("span", { className: "hidden sm:inline", children: isParsingCSV ? 'Parsing...' : 'Upload CSV' }), jsx("span", { className: "sm:hidden", children: isParsingCSV ? '...' : 'CSV' })] }) }), jsx("input", { type: "file", accept: ".csv", onChange: handleFileUpload, className: "hidden", disabled: isParsingCSV })] })] })] }), selectedUsers.length > 0 && (jsxs("div", { className: "space-y-2", children: [jsx(Label, { className: "text-sm font-medium text-gray-700", children: "Selected Users:" }), jsx("div", { className: "flex flex-wrap gap-2", children: selectedUsers.map((user) => (jsxs("div", { className: "flex items-center gap-1 bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs", children: [jsx("span", { children: user.name || user.email || user.username }), jsx("button", { type: "button", onClick: () => removeSelectedUser(user.email), className: "ml-1 hover:bg-blue-200 rounded-full p-0.5", children: jsx(X, { className: "h-3 w-3" }) })] }, user.email))) })] })), selectedCourses.length > 0 && (jsxs("div", { className: "space-y-2", children: [jsx(Label, { className: "text-sm font-medium text-gray-700", children: "Selected Courses:" }), jsx("div", { className: "flex flex-wrap gap-2", children: selectedCourses.map((course) => (jsxs("div", { className: "flex items-center gap-1 bg-green-100 text-green-800 px-2 py-1 rounded-full text-xs", children: [jsx("span", { children: course.name }), jsx("button", { type: "button", onClick: () => removeSelectedCourse(course.id), className: "ml-1 hover:bg-green-200 rounded-full p-0.5", children: jsx(X, { className: "h-3 w-3" }) })] }, course.id))) })] }))] }), jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-700", children: [jsx("span", { children: "Need a template?" }), jsx(Button$1, { variant: "link", size: "sm", onClick: downloadTemplate, className: "p-0 h-auto text-blue-700 hover:text-blue-800", children: "Download CSV template" })] })] }), jsx("div", { className: "space-y-4", children: jsx("div", { className: "overflow-x-auto w-full scrollbar-hide", children: jsx("div", { className: "min-w-[200px] align-middle", children: jsx("div", { className: "overflow-hidden rounded-lg border border-gray-200 w-full", children: jsxs("table", { className: "w-full divide-y divide-gray-200", children: [jsx("thead", { className: "bg-gray-50", children: jsxs("tr", { children: [jsx("th", { className: "px-4 py-3.5 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider min-w-[150px]", children: "Email" }), jsx("th", { className: "px-4 py-3.5 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider min-w-[200px]", children: "Course" }), jsx("th", { className: "px-4 py-3.5 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider min-w-[80px]", children: "Status" })] }) }), jsx("tbody", { className: "bg-white divide-y divide-gray-200", children: isLoadingData ? (
|
|
83019
|
+
} }), jsx("div", { className: "flex-1", children: jsx(Label, { htmlFor: `course-${course.id}`, className: "font-medium cursor-pointer text-sm", children: course.name }) })] }, course.id))), isFetchingCourses && courseCurrentPage > 1 && (jsxs("div", { className: "p-3 text-sm text-gray-500 flex items-center justify-center gap-2", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" }), "Loading more..."] }))] })) })] }))] }), jsxs("div", { className: "flex gap-2 w-full lg:w-auto", children: [jsx(Button$1, { type: "submit", className: "gap-2 bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90 hover:text-white text-sm h-11 flex-1 lg:flex-none", disabled: inviteSent || !isFormValid, children: inviteSent ? (jsxs(Fragment$1, { children: [jsx(Check, { className: "h-4 w-4" }), jsx("span", { className: "hidden sm:inline", children: "Invite Sent" }), jsx("span", { className: "sm:hidden", children: "Sent" })] })) : (jsxs(Fragment$1, { children: [jsx(Plus, { className: "h-4 w-4" }), jsx("span", { className: "hidden sm:inline", children: "Send Invite" }), jsx("span", { className: "sm:hidden", children: "Send" })] })) }), jsxs("label", { className: isParsingCSV ? 'cursor-not-allowed' : 'cursor-pointer', children: [jsx(Button$1, { variant: "outline", size: "default", className: "gap-2 bg-transparent h-11", disabled: isParsingCSV, asChild: !isParsingCSV, type: "button", children: jsxs("span", { className: "flex items-center gap-2", children: [isParsingCSV ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" })) : (jsx(Upload, { className: "h-4 w-4" })), jsx("span", { className: "hidden sm:inline", children: isParsingCSV ? 'Parsing...' : 'Upload CSV' }), jsx("span", { className: "sm:hidden", children: isParsingCSV ? '...' : 'CSV' })] }) }), jsx("input", { type: "file", accept: ".csv", onChange: handleFileUpload, className: "hidden", disabled: isParsingCSV })] })] })] }), selectedUsers.length > 0 && (jsxs("div", { className: "space-y-2", children: [jsx(Label, { className: "text-sm font-medium text-gray-700", children: "Selected Users:" }), jsx("div", { className: "flex flex-wrap gap-2", children: selectedUsers.map((user) => (jsxs("div", { className: "flex items-center gap-1 bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs", children: [jsx("span", { children: user.name || user.email || user.username }), jsx("button", { type: "button", onClick: () => removeSelectedUser(user.email), className: "ml-1 hover:bg-blue-200 rounded-full p-0.5", children: jsx(X$1, { className: "h-3 w-3" }) })] }, user.email))) })] })), selectedCourses.length > 0 && (jsxs("div", { className: "space-y-2", children: [jsx(Label, { className: "text-sm font-medium text-gray-700", children: "Selected Courses:" }), jsx("div", { className: "flex flex-wrap gap-2", children: selectedCourses.map((course) => (jsxs("div", { className: "flex items-center gap-1 bg-green-100 text-green-800 px-2 py-1 rounded-full text-xs", children: [jsx("span", { children: course.name }), jsx("button", { type: "button", onClick: () => removeSelectedCourse(course.id), className: "ml-1 hover:bg-green-200 rounded-full p-0.5", children: jsx(X$1, { className: "h-3 w-3" }) })] }, course.id))) })] }))] }), jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-700", children: [jsx("span", { children: "Need a template?" }), jsx(Button$1, { variant: "link", size: "sm", onClick: downloadTemplate, className: "p-0 h-auto text-blue-700 hover:text-blue-800", children: "Download CSV template" })] })] }), jsx("div", { className: "space-y-4", children: jsx("div", { className: "overflow-x-auto w-full scrollbar-hide", children: jsx("div", { className: "min-w-[200px] align-middle", children: jsx("div", { className: "overflow-hidden rounded-lg border border-gray-200 w-full", children: jsxs("table", { className: "w-full divide-y divide-gray-200", children: [jsx("thead", { className: "bg-gray-50", children: jsxs("tr", { children: [jsx("th", { className: "px-4 py-3.5 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider min-w-[150px]", children: "Email" }), jsx("th", { className: "px-4 py-3.5 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider min-w-[200px]", children: "Course" }), jsx("th", { className: "px-4 py-3.5 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider min-w-[80px]", children: "Status" })] }) }), jsx("tbody", { className: "bg-white divide-y divide-gray-200", children: isLoadingData ? (
|
|
83020
83020
|
// Loading skeleton rows
|
|
83021
83021
|
Array.from({ length: 5 }).map((_, index) => (jsxs("tr", { className: "animate-pulse", children: [jsx("td", { className: "px-4 py-4 whitespace-nowrap", children: jsxs("div", { className: "flex items-center", children: [jsx("div", { className: "flex-shrink-0 h-8 w-8", children: jsx("div", { className: "h-8 w-8 rounded-full bg-gray-200", "aria-hidden": "true" }) }), jsx("div", { className: "ml-3", children: jsx("div", { className: "h-4 bg-gray-200 rounded w-32", "aria-hidden": "true" }) })] }) }), jsx("td", { className: "px-4 py-4 whitespace-nowrap", children: jsx("div", { className: "h-4 bg-gray-200 rounded w-40", "aria-hidden": "true" }) }), jsx("td", { className: "px-4 py-4 whitespace-nowrap", children: jsx("div", { className: "h-5 bg-gray-200 rounded-full w-16", "aria-hidden": "true" }) })] }, `loading-${index}`)))) : currentUsers.length === 0 ? (
|
|
83022
83022
|
// Empty state
|
|
@@ -83393,7 +83393,7 @@ function ProgramsTab({ tenant, currentPage, itemsPerPage, hasManageUsersPermissi
|
|
|
83393
83393
|
else {
|
|
83394
83394
|
setSelectedPrograms(selectedPrograms.filter((p) => p.id !== program.id));
|
|
83395
83395
|
}
|
|
83396
|
-
} }), jsx("div", { className: "flex-1", children: jsx(Label, { htmlFor: `program-${program.id}`, className: "font-medium cursor-pointer text-sm", children: program.name }) })] }, program.id))), isFetchingPrograms && programCurrentPage > 1 && (jsxs("div", { className: "p-3 text-sm text-gray-500 flex items-center justify-center gap-2", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" }), "Loading more..."] }))] })) })] }))] }), jsxs("div", { className: "flex gap-2 w-full lg:w-auto", children: [jsx(Button$1, { type: "submit", className: "gap-2 bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90 hover:text-white text-sm h-11 flex-1 lg:flex-none", disabled: inviteSent || !isFormValid, children: inviteSent ? (jsxs(Fragment$1, { children: [jsx(Check, { className: "h-4 w-4" }), jsx("span", { className: "hidden sm:inline", children: "Invite Sent" }), jsx("span", { className: "sm:hidden", children: "Sent" })] })) : (jsxs(Fragment$1, { children: [jsx(Plus, { className: "h-4 w-4" }), jsx("span", { className: "hidden sm:inline", children: "Send Invite" }), jsx("span", { className: "sm:hidden", children: "Send" })] })) }), jsxs("label", { className: isParsingCSV ? 'cursor-not-allowed' : 'cursor-pointer', children: [jsx(Button$1, { variant: "outline", size: "default", className: "gap-2 bg-transparent h-11", disabled: isParsingCSV, asChild: !isParsingCSV, type: "button", children: jsxs("span", { className: "flex items-center gap-2", children: [isParsingCSV ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" })) : (jsx(Upload, { className: "h-4 w-4" })), jsx("span", { className: "hidden sm:inline", children: isParsingCSV ? 'Parsing...' : 'Upload CSV' }), jsx("span", { className: "sm:hidden", children: isParsingCSV ? '...' : 'CSV' })] }) }), jsx("input", { type: "file", accept: ".csv", onChange: handleFileUpload, className: "hidden", disabled: isParsingCSV })] })] })] }), selectedUsers.length > 0 && (jsxs("div", { className: "space-y-2", children: [jsx(Label, { className: "text-sm font-medium text-gray-700", children: "Selected Users:" }), jsx("div", { className: "flex flex-wrap gap-2", children: selectedUsers.map((user) => (jsxs("div", { className: "flex items-center gap-1 bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs", children: [jsx("span", { children: user.name || user.email || user.username }), jsx("button", { type: "button", onClick: () => removeSelectedUser(user.email), className: "ml-1 hover:bg-blue-200 rounded-full p-0.5", children: jsx(X, { className: "h-3 w-3" }) })] }, user.email))) })] })), selectedPrograms.length > 0 && (jsxs("div", { className: "space-y-2", children: [jsx(Label, { className: "text-sm font-medium text-gray-700", children: "Selected Programs:" }), jsx("div", { className: "flex flex-wrap gap-2", children: selectedPrograms.map((program) => (jsxs("div", { className: "flex items-center gap-1 bg-purple-100 text-purple-800 px-2 py-1 rounded-full text-xs", children: [jsx("span", { children: program.name }), jsx("button", { type: "button", onClick: () => removeSelectedProgram(program.id), className: "ml-1 hover:bg-purple-200 rounded-full p-0.5", children: jsx(X, { className: "h-3 w-3" }) })] }, program.id))) })] }))] }), jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-700", children: [jsx("span", { children: "Need a template?" }), jsx(Button$1, { variant: "link", size: "sm", onClick: downloadTemplate, className: "p-0 h-auto text-blue-700 hover:text-blue-800", children: "Download CSV template" })] })] }), jsx("div", { className: "space-y-4", children: jsx("div", { className: "overflow-x-auto w-full scrollbar-hide", children: jsx("div", { className: "min-w-[200px] align-middle", children: jsx("div", { className: "overflow-hidden rounded-lg border border-gray-200 w-full", children: jsxs("table", { className: "w-full divide-y divide-gray-200", children: [jsx("thead", { className: "bg-gray-50", children: jsxs("tr", { children: [jsx("th", { className: "px-4 py-3.5 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider min-w-[150px]", children: "Email" }), jsx("th", { className: "px-4 py-3.5 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider min-w-[200px]", children: "Program" }), jsx("th", { className: "px-4 py-3.5 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider min-w-[80px]", children: "Status" })] }) }), jsx("tbody", { className: "bg-white divide-y divide-gray-200", children: isLoadingData ? (
|
|
83396
|
+
} }), jsx("div", { className: "flex-1", children: jsx(Label, { htmlFor: `program-${program.id}`, className: "font-medium cursor-pointer text-sm", children: program.name }) })] }, program.id))), isFetchingPrograms && programCurrentPage > 1 && (jsxs("div", { className: "p-3 text-sm text-gray-500 flex items-center justify-center gap-2", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" }), "Loading more..."] }))] })) })] }))] }), jsxs("div", { className: "flex gap-2 w-full lg:w-auto", children: [jsx(Button$1, { type: "submit", className: "gap-2 bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90 hover:text-white text-sm h-11 flex-1 lg:flex-none", disabled: inviteSent || !isFormValid, children: inviteSent ? (jsxs(Fragment$1, { children: [jsx(Check, { className: "h-4 w-4" }), jsx("span", { className: "hidden sm:inline", children: "Invite Sent" }), jsx("span", { className: "sm:hidden", children: "Sent" })] })) : (jsxs(Fragment$1, { children: [jsx(Plus, { className: "h-4 w-4" }), jsx("span", { className: "hidden sm:inline", children: "Send Invite" }), jsx("span", { className: "sm:hidden", children: "Send" })] })) }), jsxs("label", { className: isParsingCSV ? 'cursor-not-allowed' : 'cursor-pointer', children: [jsx(Button$1, { variant: "outline", size: "default", className: "gap-2 bg-transparent h-11", disabled: isParsingCSV, asChild: !isParsingCSV, type: "button", children: jsxs("span", { className: "flex items-center gap-2", children: [isParsingCSV ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" })) : (jsx(Upload, { className: "h-4 w-4" })), jsx("span", { className: "hidden sm:inline", children: isParsingCSV ? 'Parsing...' : 'Upload CSV' }), jsx("span", { className: "sm:hidden", children: isParsingCSV ? '...' : 'CSV' })] }) }), jsx("input", { type: "file", accept: ".csv", onChange: handleFileUpload, className: "hidden", disabled: isParsingCSV })] })] })] }), selectedUsers.length > 0 && (jsxs("div", { className: "space-y-2", children: [jsx(Label, { className: "text-sm font-medium text-gray-700", children: "Selected Users:" }), jsx("div", { className: "flex flex-wrap gap-2", children: selectedUsers.map((user) => (jsxs("div", { className: "flex items-center gap-1 bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs", children: [jsx("span", { children: user.name || user.email || user.username }), jsx("button", { type: "button", onClick: () => removeSelectedUser(user.email), className: "ml-1 hover:bg-blue-200 rounded-full p-0.5", children: jsx(X$1, { className: "h-3 w-3" }) })] }, user.email))) })] })), selectedPrograms.length > 0 && (jsxs("div", { className: "space-y-2", children: [jsx(Label, { className: "text-sm font-medium text-gray-700", children: "Selected Programs:" }), jsx("div", { className: "flex flex-wrap gap-2", children: selectedPrograms.map((program) => (jsxs("div", { className: "flex items-center gap-1 bg-purple-100 text-purple-800 px-2 py-1 rounded-full text-xs", children: [jsx("span", { children: program.name }), jsx("button", { type: "button", onClick: () => removeSelectedProgram(program.id), className: "ml-1 hover:bg-purple-200 rounded-full p-0.5", children: jsx(X$1, { className: "h-3 w-3" }) })] }, program.id))) })] }))] }), jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-700", children: [jsx("span", { children: "Need a template?" }), jsx(Button$1, { variant: "link", size: "sm", onClick: downloadTemplate, className: "p-0 h-auto text-blue-700 hover:text-blue-800", children: "Download CSV template" })] })] }), jsx("div", { className: "space-y-4", children: jsx("div", { className: "overflow-x-auto w-full scrollbar-hide", children: jsx("div", { className: "min-w-[200px] align-middle", children: jsx("div", { className: "overflow-hidden rounded-lg border border-gray-200 w-full", children: jsxs("table", { className: "w-full divide-y divide-gray-200", children: [jsx("thead", { className: "bg-gray-50", children: jsxs("tr", { children: [jsx("th", { className: "px-4 py-3.5 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider min-w-[150px]", children: "Email" }), jsx("th", { className: "px-4 py-3.5 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider min-w-[200px]", children: "Program" }), jsx("th", { className: "px-4 py-3.5 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider min-w-[80px]", children: "Status" })] }) }), jsx("tbody", { className: "bg-white divide-y divide-gray-200", children: isLoadingData ? (
|
|
83397
83397
|
// Loading skeleton rows
|
|
83398
83398
|
Array.from({ length: 5 }).map((_, index) => (jsxs("tr", { className: "animate-pulse", children: [jsx("td", { className: "px-4 py-4 whitespace-nowrap", children: jsxs("div", { className: "flex items-center", children: [jsx("div", { className: "flex-shrink-0 h-8 w-8", children: jsx("div", { className: "h-8 w-8 rounded-full bg-gray-200", "aria-hidden": "true" }) }), jsx("div", { className: "ml-3", children: jsx("div", { className: "h-4 bg-gray-200 rounded w-32", "aria-hidden": "true" }) })] }) }), jsx("td", { className: "px-4 py-4 whitespace-nowrap", children: jsx("div", { className: "h-4 bg-gray-200 rounded w-40", "aria-hidden": "true" }) }), jsx("td", { className: "px-4 py-4 whitespace-nowrap", children: jsx("div", { className: "h-5 bg-gray-200 rounded-full w-16", "aria-hidden": "true" }) })] }, `loading-${index}`)))) : currentUsers.length === 0 ? (
|
|
83399
83399
|
// Empty state
|
|
@@ -83486,7 +83486,7 @@ function InviteUserDialog({ tenant, onClose, isOpen, enableCatalogInvite = false
|
|
|
83486
83486
|
}
|
|
83487
83487
|
};
|
|
83488
83488
|
const headerContent = getHeaderContent();
|
|
83489
|
-
return (jsx(Fragment$1, { children: jsx(Dialog, { open: isOpen, onOpenChange: onClose, children: jsxs(DialogContent$
|
|
83489
|
+
return (jsx(Fragment$1, { children: jsx(Dialog$1, { open: isOpen, onOpenChange: onClose, children: jsxs(DialogContent$2, { className: "sm:max-w-5xl w-[95vw] p-0 gap-0 mx-auto my-auto rounded-lg flex flex-col justify-between max-h-[90vh]", "aria-describedby": "invite-users-description", children: [jsxs(DialogHeader, { className: "p-4 pt-[30px] flex-shrink-0 border-b border-gray-200", children: [jsx(DialogTitle$2, { className: "text-xl sm:text-2xl font-bold text-gray-800", children: headerContent.title }), jsx(DialogDescription$2, { id: "invite-users-description", className: "mt-1 text-xs sm:text-sm text-gray-700", children: headerContent.description })] }), jsx("div", { className: "flex-grow overflow-y-auto scrollbar-hide p-2 sm:p-4 pb-20 max-h-[60vh]", children: enableCatalogInvite ? (jsxs(Tabs, { value: activeTab, onValueChange: setActiveTab, className: "w-full", children: [jsxs(TabsList, { className: "grid w-full grid-cols-3 mb-6", children: [jsxs(TabsTrigger, { value: "users", className: "flex items-center gap-2", children: [jsx(Users, { className: "h-4 w-4" }), jsx("span", { className: "hidden sm:inline", children: "Users" })] }), jsxs(TabsTrigger, { value: "courses", className: "flex items-center gap-2", children: [jsx(BookOpen, { className: "h-4 w-4" }), jsx("span", { className: "hidden sm:inline", children: "Courses" })] }), jsxs(TabsTrigger, { value: "programs", className: "flex items-center gap-2", children: [jsx(GraduationCap, { className: "h-4 w-4" }), jsx("span", { className: "hidden sm:inline", children: "Programs" })] })] }), jsx(TabsContent, { value: "users", children: jsx(UsersTab$1, { tenant: tenant, currentPage: currentPage, itemsPerPage: itemsPerPage, onInviteSuccess: handleInviteSuccess }) }), jsx(TabsContent, { value: "courses", children: jsx(CoursesTab, { tenant: tenant, currentPage: currentPage, itemsPerPage: itemsPerPage, hasManageUsersPermission: hasManageUsersPermission }) }), jsx(TabsContent, { value: "programs", children: jsx(ProgramsTab, { tenant: tenant, currentPage: currentPage, itemsPerPage: itemsPerPage, hasManageUsersPermission: hasManageUsersPermission }) })] })) : (jsx(UsersTab$1, { tenant: tenant, currentPage: currentPage, itemsPerPage: itemsPerPage, onInviteSuccess: handleInviteSuccess })) }), currentData && currentData.count > 0 && (jsx("div", { className: "flex items-center justify-between border-t border-gray-200 px-3 sm:px-6 py-3 sm:py-4 bg-gray-50 flex-shrink-0", children: jsxs("div", { className: "flex flex-1 items-center justify-between", children: [jsx("div", { className: "hidden sm:block", children: jsxs("p", { className: "text-sm text-gray-700", children: ["Showing", ' ', jsx("span", { className: "font-medium", children: (currentPage - 1) * itemsPerPage + 1 }), " to", ' ', jsx("span", { className: "font-medium", children: Math.min(currentPage * itemsPerPage, currentData.count) }), ' ', "of ", jsx("span", { className: "font-medium", children: currentData.count }), " invites"] }) }), jsxs("div", { className: "flex items-center justify-center gap-1 sm:gap-2", children: [jsx(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 p-0 flex items-center justify-center rounded-md border-gray-300 hover:bg-gray-100 hidden sm:flex bg-transparent", onClick: () => setCurrentPage(1), disabled: currentPage === 1, "aria-label": "Go to first page", children: jsx(ChevronFirst, { className: "h-4 w-4" }) }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 px-2 sm:p-0 flex items-center justify-center rounded-md border-none sm:border-gray-300 hover:bg-gray-100 text-xs sm:text-sm bg-transparent", onClick: () => setCurrentPage(currentPage - 1), disabled: currentPage === 1, "aria-label": "Go to previous page", children: [jsx(ChevronLeft, { className: "h-4 w-4 mr-1 sm:mr-0" }), jsx("span", { className: "sm:hidden", children: "Prev" })] }), jsxs("span", { className: "text-xs sm:text-sm text-gray-700 mx-1 sm:mx-2 px-2", children: [jsx("span", { className: "hidden sm:inline", children: "Page " }), currentPage, " ", jsx("span", { className: "hidden sm:inline", children: "of " }), jsx("span", { className: "inline sm:hidden", children: " / " }), totalPages] }), jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 px-2 sm:p-0 flex items-center justify-center rounded-md border-none sm:border-gray-300 hover:bg-gray-100 text-xs sm:text-sm bg-transparent", onClick: () => setCurrentPage(currentPage + 1), disabled: currentPage === totalPages, "aria-label": "Go to next page", children: [jsx("span", { className: "sm:hidden", children: "Next" }), jsx(ChevronRight, { className: "h-4 w-4 ml-1 sm:ml-0" })] }), jsx(Button$1, { variant: "outline", size: "sm", className: "h-8 w-8 p-0 flex items-center justify-center rounded-md border-gray-300 hover:bg-gray-100 hidden sm:flex bg-transparent", onClick: () => setCurrentPage(totalPages), disabled: currentPage === totalPages, "aria-label": "Go to last page", children: jsx(ChevronLast, { className: "h-4 w-4" }) })] })] }) }))] }) }) }));
|
|
83490
83490
|
}
|
|
83491
83491
|
|
|
83492
83492
|
function InvitedUsersDialog({ tenant, onClose, }) {
|
|
@@ -83497,12 +83497,12 @@ function InvitedUsersDialog({ tenant, onClose, }) {
|
|
|
83497
83497
|
//org: tenant,
|
|
83498
83498
|
});
|
|
83499
83499
|
const [open, setOpen] = useState(true);
|
|
83500
|
-
return (jsx(Dialog, { open: open, onOpenChange: (_open) => {
|
|
83500
|
+
return (jsx(Dialog$1, { open: open, onOpenChange: (_open) => {
|
|
83501
83501
|
if (!_open) {
|
|
83502
83502
|
setOpen(_open);
|
|
83503
83503
|
onClose();
|
|
83504
83504
|
}
|
|
83505
|
-
}, children: jsx(DialogPortal$
|
|
83505
|
+
}, children: jsx(DialogPortal$2, { forceMount: true, children: jsxs(DialogContent$2, { "aria-label": "Invited Users Dialog", className: "max-w-sm rounded-2xl px-6 py-8 pointer-events-auto", "aria-describedby": "invited-users-dialog", children: [jsx(DialogHeader, { className: "relative flex-row justify-between", children: jsx(DialogTitle$2, { className: "text-blue-600 text-xl font-semibold", children: "Invited Users" }) }), jsxs("div", { className: "mt-4 space-y-1", children: [jsx("p", { className: "text-gray-500 text-sm", children: "Showing list of invited users pending confirmation" }), jsx("form", { children: jsx(Input, { value: query, onChange: (event) => setQuery(event.target.value), placeholder: "Search Invited Users", className: "mt-2" }) })] }), jsxs("div", { children: [jsx("h2", { className: "text-md text-gray-600 font-semibold mb-4", children: "Email" }), invitedUsers === null || invitedUsers === void 0 ? void 0 : invitedUsers.results.map((user) => (jsx("div", { className: "border-b-gray-50 pb-2 mb-4 text-sm text-gray-600 dark:text-gray-400", children: user.email }, user.id))), (invitedUsers === null || invitedUsers === void 0 ? void 0 : invitedUsers.results.length) === 0 && (jsx("p", { className: "text-gray", children: "No records found" }))] })] }) }) }));
|
|
83506
83506
|
}
|
|
83507
83507
|
|
|
83508
83508
|
// ::- Persistent data structure representing an ordered mapping from
|
|
@@ -93347,7 +93347,7 @@ __export$1(commands_exports, {
|
|
|
93347
93347
|
exitCode: () => exitCode,
|
|
93348
93348
|
extendMarkRange: () => extendMarkRange,
|
|
93349
93349
|
first: () => first,
|
|
93350
|
-
focus: () => focus$
|
|
93350
|
+
focus: () => focus$2,
|
|
93351
93351
|
forEach: () => forEach,
|
|
93352
93352
|
insertContent: () => insertContent,
|
|
93353
93353
|
insertContentAt: () => insertContentAt,
|
|
@@ -93683,7 +93683,7 @@ function isSafari() {
|
|
|
93683
93683
|
}
|
|
93684
93684
|
|
|
93685
93685
|
// src/commands/focus.ts
|
|
93686
|
-
var focus$
|
|
93686
|
+
var focus$2 = (position = null, options = {}) => ({ editor, view, tr, dispatch }) => {
|
|
93687
93687
|
options = {
|
|
93688
93688
|
scrollIntoView: true,
|
|
93689
93689
|
...options
|
|
@@ -103621,7 +103621,7 @@ var Toggle$1 = React.forwardRef((props, forwardedRef) => {
|
|
|
103621
103621
|
);
|
|
103622
103622
|
});
|
|
103623
103623
|
Toggle$1.displayName = NAME$1;
|
|
103624
|
-
var Root$
|
|
103624
|
+
var Root$3 = Toggle$1;
|
|
103625
103625
|
|
|
103626
103626
|
const toggleVariants = cva('inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground', {
|
|
103627
103627
|
variants: {
|
|
@@ -103640,8 +103640,8 @@ const toggleVariants = cva('inline-flex items-center justify-center rounded-md t
|
|
|
103640
103640
|
size: 'default',
|
|
103641
103641
|
},
|
|
103642
103642
|
});
|
|
103643
|
-
const Toggle = React.forwardRef(({ className, variant, size, ...props }, ref) => (jsx(Root$
|
|
103644
|
-
Toggle.displayName = Root$
|
|
103643
|
+
const Toggle = React.forwardRef(({ className, variant, size, ...props }, ref) => (jsx(Root$3, { ref: ref, className: cn(toggleVariants({ variant, size, className })), ...props })));
|
|
103644
|
+
Toggle.displayName = Root$3.displayName;
|
|
103645
103645
|
|
|
103646
103646
|
// src/separator.tsx
|
|
103647
103647
|
var NAME = "Separator";
|
|
@@ -103666,10 +103666,10 @@ Separator$1.displayName = NAME;
|
|
|
103666
103666
|
function isValidOrientation(orientation) {
|
|
103667
103667
|
return ORIENTATIONS.includes(orientation);
|
|
103668
103668
|
}
|
|
103669
|
-
var Root$
|
|
103669
|
+
var Root$2 = Separator$1;
|
|
103670
103670
|
|
|
103671
|
-
const Separator = React.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => (jsx(Root$
|
|
103672
|
-
Separator.displayName = Root$
|
|
103671
|
+
const Separator = React.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => (jsx(Root$2, { ref: ref, decorative: decorative, orientation: orientation, className: cn("shrink-0 bg-border", orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", className), ...props })));
|
|
103672
|
+
Separator.displayName = Root$2.displayName;
|
|
103673
103673
|
|
|
103674
103674
|
// Custom Div extension to preserve div elements with inline styles
|
|
103675
103675
|
Node3.create({
|
|
@@ -107619,11 +107619,11 @@ var PopoverAnchor = React.forwardRef(
|
|
|
107619
107619
|
}
|
|
107620
107620
|
);
|
|
107621
107621
|
PopoverAnchor.displayName = ANCHOR_NAME;
|
|
107622
|
-
var TRIGGER_NAME$
|
|
107622
|
+
var TRIGGER_NAME$3 = "PopoverTrigger";
|
|
107623
107623
|
var PopoverTrigger$1 = React.forwardRef(
|
|
107624
107624
|
(props, forwardedRef) => {
|
|
107625
107625
|
const { __scopePopover, ...triggerProps } = props;
|
|
107626
|
-
const context = usePopoverContext(TRIGGER_NAME$
|
|
107626
|
+
const context = usePopoverContext(TRIGGER_NAME$3, __scopePopover);
|
|
107627
107627
|
const popperScope = usePopperScope(__scopePopover);
|
|
107628
107628
|
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
107629
107629
|
const trigger = /* @__PURE__ */ jsx(
|
|
@@ -107633,7 +107633,7 @@ var PopoverTrigger$1 = React.forwardRef(
|
|
|
107633
107633
|
"aria-haspopup": "dialog",
|
|
107634
107634
|
"aria-expanded": context.open,
|
|
107635
107635
|
"aria-controls": context.contentId,
|
|
107636
|
-
"data-state": getState$
|
|
107636
|
+
"data-state": getState$2(context.open),
|
|
107637
107637
|
...triggerProps,
|
|
107638
107638
|
ref: composedTriggerRef,
|
|
107639
107639
|
onClick: composeEventHandlers$2(props.onClick, context.onOpenToggle)
|
|
@@ -107642,31 +107642,31 @@ var PopoverTrigger$1 = React.forwardRef(
|
|
|
107642
107642
|
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(Anchor$1, { asChild: true, ...popperScope, children: trigger });
|
|
107643
107643
|
}
|
|
107644
107644
|
);
|
|
107645
|
-
PopoverTrigger$1.displayName = TRIGGER_NAME$
|
|
107646
|
-
var PORTAL_NAME$
|
|
107647
|
-
var [PortalProvider$
|
|
107645
|
+
PopoverTrigger$1.displayName = TRIGGER_NAME$3;
|
|
107646
|
+
var PORTAL_NAME$4 = "PopoverPortal";
|
|
107647
|
+
var [PortalProvider$2, usePortalContext$2] = createPopoverContext(PORTAL_NAME$4, {
|
|
107648
107648
|
forceMount: void 0
|
|
107649
107649
|
});
|
|
107650
107650
|
var PopoverPortal = (props) => {
|
|
107651
107651
|
const { __scopePopover, forceMount, children, container } = props;
|
|
107652
|
-
const context = usePopoverContext(PORTAL_NAME$
|
|
107653
|
-
return /* @__PURE__ */ jsx(PortalProvider$
|
|
107652
|
+
const context = usePopoverContext(PORTAL_NAME$4, __scopePopover);
|
|
107653
|
+
return /* @__PURE__ */ jsx(PortalProvider$2, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence$2, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$a, { asChild: true, container, children }) }) });
|
|
107654
107654
|
};
|
|
107655
|
-
PopoverPortal.displayName = PORTAL_NAME$
|
|
107656
|
-
var CONTENT_NAME$
|
|
107655
|
+
PopoverPortal.displayName = PORTAL_NAME$4;
|
|
107656
|
+
var CONTENT_NAME$3 = "PopoverContent";
|
|
107657
107657
|
var PopoverContent$1 = React.forwardRef(
|
|
107658
107658
|
(props, forwardedRef) => {
|
|
107659
|
-
const portalContext = usePortalContext$
|
|
107659
|
+
const portalContext = usePortalContext$2(CONTENT_NAME$3, props.__scopePopover);
|
|
107660
107660
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
107661
|
-
const context = usePopoverContext(CONTENT_NAME$
|
|
107661
|
+
const context = usePopoverContext(CONTENT_NAME$3, props.__scopePopover);
|
|
107662
107662
|
return /* @__PURE__ */ jsx(Presence$2, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
107663
107663
|
}
|
|
107664
107664
|
);
|
|
107665
|
-
PopoverContent$1.displayName = CONTENT_NAME$
|
|
107666
|
-
var Slot$
|
|
107665
|
+
PopoverContent$1.displayName = CONTENT_NAME$3;
|
|
107666
|
+
var Slot$2 = createSlot$2("PopoverContent.RemoveScroll");
|
|
107667
107667
|
var PopoverContentModal = React.forwardRef(
|
|
107668
107668
|
(props, forwardedRef) => {
|
|
107669
|
-
const context = usePopoverContext(CONTENT_NAME$
|
|
107669
|
+
const context = usePopoverContext(CONTENT_NAME$3, props.__scopePopover);
|
|
107670
107670
|
const contentRef = React.useRef(null);
|
|
107671
107671
|
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
107672
107672
|
const isRightClickOutsideRef = React.useRef(false);
|
|
@@ -107674,7 +107674,7 @@ var PopoverContentModal = React.forwardRef(
|
|
|
107674
107674
|
const content = contentRef.current;
|
|
107675
107675
|
if (content) return hideOthers(content);
|
|
107676
107676
|
}, []);
|
|
107677
|
-
return /* @__PURE__ */ jsx(ReactRemoveScroll, { as: Slot$
|
|
107677
|
+
return /* @__PURE__ */ jsx(ReactRemoveScroll, { as: Slot$2, allowPinchZoom: true, children: /* @__PURE__ */ jsx(
|
|
107678
107678
|
PopoverContentImpl,
|
|
107679
107679
|
{
|
|
107680
107680
|
...props,
|
|
@@ -107706,7 +107706,7 @@ var PopoverContentModal = React.forwardRef(
|
|
|
107706
107706
|
);
|
|
107707
107707
|
var PopoverContentNonModal = React.forwardRef(
|
|
107708
107708
|
(props, forwardedRef) => {
|
|
107709
|
-
const context = usePopoverContext(CONTENT_NAME$
|
|
107709
|
+
const context = usePopoverContext(CONTENT_NAME$3, props.__scopePopover);
|
|
107710
107710
|
const hasInteractedOutsideRef = React.useRef(false);
|
|
107711
107711
|
const hasPointerDownOutsideRef = React.useRef(false);
|
|
107712
107712
|
return /* @__PURE__ */ jsx(
|
|
@@ -107758,11 +107758,11 @@ var PopoverContentImpl = React.forwardRef(
|
|
|
107758
107758
|
onInteractOutside,
|
|
107759
107759
|
...contentProps
|
|
107760
107760
|
} = props;
|
|
107761
|
-
const context = usePopoverContext(CONTENT_NAME$
|
|
107761
|
+
const context = usePopoverContext(CONTENT_NAME$3, __scopePopover);
|
|
107762
107762
|
const popperScope = usePopperScope(__scopePopover);
|
|
107763
|
-
useFocusGuards();
|
|
107763
|
+
useFocusGuards$1();
|
|
107764
107764
|
return /* @__PURE__ */ jsx(
|
|
107765
|
-
FocusScope$
|
|
107765
|
+
FocusScope$2,
|
|
107766
107766
|
{
|
|
107767
107767
|
asChild: true,
|
|
107768
107768
|
loop: true,
|
|
@@ -107780,9 +107780,9 @@ var PopoverContentImpl = React.forwardRef(
|
|
|
107780
107780
|
onFocusOutside,
|
|
107781
107781
|
onDismiss: () => context.onOpenChange(false),
|
|
107782
107782
|
children: /* @__PURE__ */ jsx(
|
|
107783
|
-
Content$
|
|
107783
|
+
Content$5,
|
|
107784
107784
|
{
|
|
107785
|
-
"data-state": getState$
|
|
107785
|
+
"data-state": getState$2(context.open),
|
|
107786
107786
|
role: "dialog",
|
|
107787
107787
|
id: context.contentId,
|
|
107788
107788
|
...popperScope,
|
|
@@ -107807,11 +107807,11 @@ var PopoverContentImpl = React.forwardRef(
|
|
|
107807
107807
|
);
|
|
107808
107808
|
}
|
|
107809
107809
|
);
|
|
107810
|
-
var CLOSE_NAME$
|
|
107810
|
+
var CLOSE_NAME$2 = "PopoverClose";
|
|
107811
107811
|
var PopoverClose = React.forwardRef(
|
|
107812
107812
|
(props, forwardedRef) => {
|
|
107813
107813
|
const { __scopePopover, ...closeProps } = props;
|
|
107814
|
-
const context = usePopoverContext(CLOSE_NAME$
|
|
107814
|
+
const context = usePopoverContext(CLOSE_NAME$2, __scopePopover);
|
|
107815
107815
|
return /* @__PURE__ */ jsx(
|
|
107816
107816
|
Primitive$5.button,
|
|
107817
107817
|
{
|
|
@@ -107823,7 +107823,7 @@ var PopoverClose = React.forwardRef(
|
|
|
107823
107823
|
);
|
|
107824
107824
|
}
|
|
107825
107825
|
);
|
|
107826
|
-
PopoverClose.displayName = CLOSE_NAME$
|
|
107826
|
+
PopoverClose.displayName = CLOSE_NAME$2;
|
|
107827
107827
|
var ARROW_NAME = "PopoverArrow";
|
|
107828
107828
|
var PopoverArrow = React.forwardRef(
|
|
107829
107829
|
(props, forwardedRef) => {
|
|
@@ -107833,17 +107833,17 @@ var PopoverArrow = React.forwardRef(
|
|
|
107833
107833
|
}
|
|
107834
107834
|
);
|
|
107835
107835
|
PopoverArrow.displayName = ARROW_NAME;
|
|
107836
|
-
function getState$
|
|
107836
|
+
function getState$2(open) {
|
|
107837
107837
|
return open ? "open" : "closed";
|
|
107838
107838
|
}
|
|
107839
107839
|
var Root2 = Popover$1;
|
|
107840
107840
|
var Trigger$1 = PopoverTrigger$1;
|
|
107841
|
-
var Portal$
|
|
107841
|
+
var Portal$3 = PopoverPortal;
|
|
107842
107842
|
var Content2$1 = PopoverContent$1;
|
|
107843
107843
|
|
|
107844
107844
|
const Popover = Root2;
|
|
107845
107845
|
const PopoverTrigger = Trigger$1;
|
|
107846
|
-
const PopoverContent = React.forwardRef(({ className, align =
|
|
107846
|
+
const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (jsx(Portal$3, { children: jsx(Content2$1, { ref: ref, align: align, sideOffset: sideOffset, className: cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none', className), ...props }) })));
|
|
107847
107847
|
PopoverContent.displayName = Content2$1.displayName;
|
|
107848
107848
|
|
|
107849
107849
|
const offsetFormatCache = {};
|
|
@@ -109436,7 +109436,7 @@ function PreviousMonthButton(props) {
|
|
|
109436
109436
|
* @group Components
|
|
109437
109437
|
* @see https://daypicker.dev/guides/custom-components
|
|
109438
109438
|
*/
|
|
109439
|
-
function Root(props) {
|
|
109439
|
+
function Root$1(props) {
|
|
109440
109440
|
const { rootRef, ...rest } = props;
|
|
109441
109441
|
return React__default.createElement("div", { ...rest, ref: rootRef });
|
|
109442
109442
|
}
|
|
@@ -109544,7 +109544,7 @@ var components = /*#__PURE__*/Object.freeze({
|
|
|
109544
109544
|
NextMonthButton: NextMonthButton,
|
|
109545
109545
|
Option: Option,
|
|
109546
109546
|
PreviousMonthButton: PreviousMonthButton,
|
|
109547
|
-
Root: Root,
|
|
109547
|
+
Root: Root$1,
|
|
109548
109548
|
Select: Select,
|
|
109549
109549
|
Week: Week,
|
|
109550
109550
|
WeekNumber: WeekNumber,
|
|
@@ -113682,6 +113682,550 @@ function useCopyToClipboard(timeout = 500) {
|
|
|
113682
113682
|
const AnalyticsSettingsContext = createContext({});
|
|
113683
113683
|
AnalyticsSettingsContext.Provider;
|
|
113684
113684
|
|
|
113685
|
+
var U=1,Y$1=.9,H=.8,J=.17,p=.1,u=.999,$=.9999;var k$1=.99,m=/[\\\/_+.#"@\[\(\{&]/,B$1=/[\\\/_+.#"@\[\(\{&]/g,K$1=/[\s-]/,X=/[\s-]/g;function G(_,C,h,P,A,f,O){if(f===C.length)return A===_.length?U:k$1;var T=`${A},${f}`;if(O[T]!==void 0)return O[T];for(var L=P.charAt(f),c=h.indexOf(L,A),S=0,E,N,R,M;c>=0;)E=G(_,C,h,P,c+1,f+1,O),E>S&&(c===A?E*=U:m.test(_.charAt(c-1))?(E*=H,R=_.slice(A,c-1).match(B$1),R&&A>0&&(E*=Math.pow(u,R.length))):K$1.test(_.charAt(c-1))?(E*=Y$1,M=_.slice(A,c-1).match(X),M&&A>0&&(E*=Math.pow(u,M.length))):(E*=J,A>0&&(E*=Math.pow(u,c-A))),_.charAt(c)!==C.charAt(f)&&(E*=$)),(E<p&&h.charAt(c-1)===P.charAt(f+1)||P.charAt(f+1)===P.charAt(f)&&h.charAt(c-1)!==P.charAt(f))&&(N=G(_,C,h,P,c+1,f+2,O),N*p>E&&(E=N*p)),E>S&&(S=E),c=h.indexOf(L,c+1);return O[T]=S,S}function D(_){return _.toLowerCase().replace(X," ")}function W(_,C,h){return _=h&&h.length>0?`${_+" "+h.join(" ")}`:_,G(_,C,D(_),D(C),0,0,{})}
|
|
113686
|
+
|
|
113687
|
+
var AUTOFOCUS_ON_MOUNT$1 = "focusScope.autoFocusOnMount";
|
|
113688
|
+
var AUTOFOCUS_ON_UNMOUNT$1 = "focusScope.autoFocusOnUnmount";
|
|
113689
|
+
var EVENT_OPTIONS$1 = { bubbles: false, cancelable: true };
|
|
113690
|
+
var FOCUS_SCOPE_NAME$1 = "FocusScope";
|
|
113691
|
+
var FocusScope$1 = React.forwardRef((props, forwardedRef) => {
|
|
113692
|
+
const {
|
|
113693
|
+
loop = false,
|
|
113694
|
+
trapped = false,
|
|
113695
|
+
onMountAutoFocus: onMountAutoFocusProp,
|
|
113696
|
+
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
113697
|
+
...scopeProps
|
|
113698
|
+
} = props;
|
|
113699
|
+
const [container, setContainer] = React.useState(null);
|
|
113700
|
+
const onMountAutoFocus = useCallbackRef$2(onMountAutoFocusProp);
|
|
113701
|
+
const onUnmountAutoFocus = useCallbackRef$2(onUnmountAutoFocusProp);
|
|
113702
|
+
const lastFocusedElementRef = React.useRef(null);
|
|
113703
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
113704
|
+
const focusScope = React.useRef({
|
|
113705
|
+
paused: false,
|
|
113706
|
+
pause() {
|
|
113707
|
+
this.paused = true;
|
|
113708
|
+
},
|
|
113709
|
+
resume() {
|
|
113710
|
+
this.paused = false;
|
|
113711
|
+
}
|
|
113712
|
+
}).current;
|
|
113713
|
+
React.useEffect(() => {
|
|
113714
|
+
if (trapped) {
|
|
113715
|
+
let handleFocusIn2 = function(event) {
|
|
113716
|
+
if (focusScope.paused || !container) return;
|
|
113717
|
+
const target = event.target;
|
|
113718
|
+
if (container.contains(target)) {
|
|
113719
|
+
lastFocusedElementRef.current = target;
|
|
113720
|
+
} else {
|
|
113721
|
+
focus$1(lastFocusedElementRef.current, { select: true });
|
|
113722
|
+
}
|
|
113723
|
+
}, handleFocusOut2 = function(event) {
|
|
113724
|
+
if (focusScope.paused || !container) return;
|
|
113725
|
+
const relatedTarget = event.relatedTarget;
|
|
113726
|
+
if (relatedTarget === null) return;
|
|
113727
|
+
if (!container.contains(relatedTarget)) {
|
|
113728
|
+
focus$1(lastFocusedElementRef.current, { select: true });
|
|
113729
|
+
}
|
|
113730
|
+
}, handleMutations2 = function(mutations) {
|
|
113731
|
+
const focusedElement = document.activeElement;
|
|
113732
|
+
if (focusedElement !== document.body) return;
|
|
113733
|
+
for (const mutation of mutations) {
|
|
113734
|
+
if (mutation.removedNodes.length > 0) focus$1(container);
|
|
113735
|
+
}
|
|
113736
|
+
};
|
|
113737
|
+
document.addEventListener("focusin", handleFocusIn2);
|
|
113738
|
+
document.addEventListener("focusout", handleFocusOut2);
|
|
113739
|
+
const mutationObserver = new MutationObserver(handleMutations2);
|
|
113740
|
+
if (container) mutationObserver.observe(container, { childList: true, subtree: true });
|
|
113741
|
+
return () => {
|
|
113742
|
+
document.removeEventListener("focusin", handleFocusIn2);
|
|
113743
|
+
document.removeEventListener("focusout", handleFocusOut2);
|
|
113744
|
+
mutationObserver.disconnect();
|
|
113745
|
+
};
|
|
113746
|
+
}
|
|
113747
|
+
}, [trapped, container, focusScope.paused]);
|
|
113748
|
+
React.useEffect(() => {
|
|
113749
|
+
if (container) {
|
|
113750
|
+
focusScopesStack$1.add(focusScope);
|
|
113751
|
+
const previouslyFocusedElement = document.activeElement;
|
|
113752
|
+
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
113753
|
+
if (!hasFocusedCandidate) {
|
|
113754
|
+
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT$1, EVENT_OPTIONS$1);
|
|
113755
|
+
container.addEventListener(AUTOFOCUS_ON_MOUNT$1, onMountAutoFocus);
|
|
113756
|
+
container.dispatchEvent(mountEvent);
|
|
113757
|
+
if (!mountEvent.defaultPrevented) {
|
|
113758
|
+
focusFirst$1(removeLinks$1(getTabbableCandidates$1(container)), { select: true });
|
|
113759
|
+
if (document.activeElement === previouslyFocusedElement) {
|
|
113760
|
+
focus$1(container);
|
|
113761
|
+
}
|
|
113762
|
+
}
|
|
113763
|
+
}
|
|
113764
|
+
return () => {
|
|
113765
|
+
container.removeEventListener(AUTOFOCUS_ON_MOUNT$1, onMountAutoFocus);
|
|
113766
|
+
setTimeout(() => {
|
|
113767
|
+
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT$1, EVENT_OPTIONS$1);
|
|
113768
|
+
container.addEventListener(AUTOFOCUS_ON_UNMOUNT$1, onUnmountAutoFocus);
|
|
113769
|
+
container.dispatchEvent(unmountEvent);
|
|
113770
|
+
if (!unmountEvent.defaultPrevented) {
|
|
113771
|
+
focus$1(previouslyFocusedElement ?? document.body, { select: true });
|
|
113772
|
+
}
|
|
113773
|
+
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT$1, onUnmountAutoFocus);
|
|
113774
|
+
focusScopesStack$1.remove(focusScope);
|
|
113775
|
+
}, 0);
|
|
113776
|
+
};
|
|
113777
|
+
}
|
|
113778
|
+
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
113779
|
+
const handleKeyDown = React.useCallback(
|
|
113780
|
+
(event) => {
|
|
113781
|
+
if (!loop && !trapped) return;
|
|
113782
|
+
if (focusScope.paused) return;
|
|
113783
|
+
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
113784
|
+
const focusedElement = document.activeElement;
|
|
113785
|
+
if (isTabKey && focusedElement) {
|
|
113786
|
+
const container2 = event.currentTarget;
|
|
113787
|
+
const [first, last] = getTabbableEdges$1(container2);
|
|
113788
|
+
const hasTabbableElementsInside = first && last;
|
|
113789
|
+
if (!hasTabbableElementsInside) {
|
|
113790
|
+
if (focusedElement === container2) event.preventDefault();
|
|
113791
|
+
} else {
|
|
113792
|
+
if (!event.shiftKey && focusedElement === last) {
|
|
113793
|
+
event.preventDefault();
|
|
113794
|
+
if (loop) focus$1(first, { select: true });
|
|
113795
|
+
} else if (event.shiftKey && focusedElement === first) {
|
|
113796
|
+
event.preventDefault();
|
|
113797
|
+
if (loop) focus$1(last, { select: true });
|
|
113798
|
+
}
|
|
113799
|
+
}
|
|
113800
|
+
}
|
|
113801
|
+
},
|
|
113802
|
+
[loop, trapped, focusScope.paused]
|
|
113803
|
+
);
|
|
113804
|
+
return /* @__PURE__ */ jsx(Primitive$3.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
113805
|
+
});
|
|
113806
|
+
FocusScope$1.displayName = FOCUS_SCOPE_NAME$1;
|
|
113807
|
+
function focusFirst$1(candidates, { select = false } = {}) {
|
|
113808
|
+
const previouslyFocusedElement = document.activeElement;
|
|
113809
|
+
for (const candidate of candidates) {
|
|
113810
|
+
focus$1(candidate, { select });
|
|
113811
|
+
if (document.activeElement !== previouslyFocusedElement) return;
|
|
113812
|
+
}
|
|
113813
|
+
}
|
|
113814
|
+
function getTabbableEdges$1(container) {
|
|
113815
|
+
const candidates = getTabbableCandidates$1(container);
|
|
113816
|
+
const first = findVisible$1(candidates, container);
|
|
113817
|
+
const last = findVisible$1(candidates.reverse(), container);
|
|
113818
|
+
return [first, last];
|
|
113819
|
+
}
|
|
113820
|
+
function getTabbableCandidates$1(container) {
|
|
113821
|
+
const nodes = [];
|
|
113822
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
113823
|
+
acceptNode: (node) => {
|
|
113824
|
+
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
113825
|
+
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
113826
|
+
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
113827
|
+
}
|
|
113828
|
+
});
|
|
113829
|
+
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
113830
|
+
return nodes;
|
|
113831
|
+
}
|
|
113832
|
+
function findVisible$1(elements, container) {
|
|
113833
|
+
for (const element of elements) {
|
|
113834
|
+
if (!isHidden$1(element, { upTo: container })) return element;
|
|
113835
|
+
}
|
|
113836
|
+
}
|
|
113837
|
+
function isHidden$1(node, { upTo }) {
|
|
113838
|
+
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
113839
|
+
while (node) {
|
|
113840
|
+
if (upTo !== void 0 && node === upTo) return false;
|
|
113841
|
+
if (getComputedStyle(node).display === "none") return true;
|
|
113842
|
+
node = node.parentElement;
|
|
113843
|
+
}
|
|
113844
|
+
return false;
|
|
113845
|
+
}
|
|
113846
|
+
function isSelectableInput$1(element) {
|
|
113847
|
+
return element instanceof HTMLInputElement && "select" in element;
|
|
113848
|
+
}
|
|
113849
|
+
function focus$1(element, { select = false } = {}) {
|
|
113850
|
+
if (element && element.focus) {
|
|
113851
|
+
const previouslyFocusedElement = document.activeElement;
|
|
113852
|
+
element.focus({ preventScroll: true });
|
|
113853
|
+
if (element !== previouslyFocusedElement && isSelectableInput$1(element) && select)
|
|
113854
|
+
element.select();
|
|
113855
|
+
}
|
|
113856
|
+
}
|
|
113857
|
+
var focusScopesStack$1 = createFocusScopesStack$1();
|
|
113858
|
+
function createFocusScopesStack$1() {
|
|
113859
|
+
let stack = [];
|
|
113860
|
+
return {
|
|
113861
|
+
add(focusScope) {
|
|
113862
|
+
const activeFocusScope = stack[0];
|
|
113863
|
+
if (focusScope !== activeFocusScope) {
|
|
113864
|
+
activeFocusScope?.pause();
|
|
113865
|
+
}
|
|
113866
|
+
stack = arrayRemove$1(stack, focusScope);
|
|
113867
|
+
stack.unshift(focusScope);
|
|
113868
|
+
},
|
|
113869
|
+
remove(focusScope) {
|
|
113870
|
+
stack = arrayRemove$1(stack, focusScope);
|
|
113871
|
+
stack[0]?.resume();
|
|
113872
|
+
}
|
|
113873
|
+
};
|
|
113874
|
+
}
|
|
113875
|
+
function arrayRemove$1(array, item) {
|
|
113876
|
+
const updatedArray = [...array];
|
|
113877
|
+
const index = updatedArray.indexOf(item);
|
|
113878
|
+
if (index !== -1) {
|
|
113879
|
+
updatedArray.splice(index, 1);
|
|
113880
|
+
}
|
|
113881
|
+
return updatedArray;
|
|
113882
|
+
}
|
|
113883
|
+
function removeLinks$1(items) {
|
|
113884
|
+
return items.filter((item) => item.tagName !== "A");
|
|
113885
|
+
}
|
|
113886
|
+
|
|
113887
|
+
var count = 0;
|
|
113888
|
+
function useFocusGuards() {
|
|
113889
|
+
React.useEffect(() => {
|
|
113890
|
+
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
113891
|
+
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
113892
|
+
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
113893
|
+
count++;
|
|
113894
|
+
return () => {
|
|
113895
|
+
if (count === 1) {
|
|
113896
|
+
document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
|
|
113897
|
+
}
|
|
113898
|
+
count--;
|
|
113899
|
+
};
|
|
113900
|
+
}, []);
|
|
113901
|
+
}
|
|
113902
|
+
function createFocusGuard() {
|
|
113903
|
+
const element = document.createElement("span");
|
|
113904
|
+
element.setAttribute("data-radix-focus-guard", "");
|
|
113905
|
+
element.tabIndex = 0;
|
|
113906
|
+
element.style.outline = "none";
|
|
113907
|
+
element.style.opacity = "0";
|
|
113908
|
+
element.style.position = "fixed";
|
|
113909
|
+
element.style.pointerEvents = "none";
|
|
113910
|
+
return element;
|
|
113911
|
+
}
|
|
113912
|
+
|
|
113913
|
+
var DIALOG_NAME$1 = "Dialog";
|
|
113914
|
+
var [createDialogContext$1, createDialogScope$1] = createContextScope$1(DIALOG_NAME$1);
|
|
113915
|
+
var [DialogProvider$1, useDialogContext$1] = createDialogContext$1(DIALOG_NAME$1);
|
|
113916
|
+
var Dialog = (props) => {
|
|
113917
|
+
const {
|
|
113918
|
+
__scopeDialog,
|
|
113919
|
+
children,
|
|
113920
|
+
open: openProp,
|
|
113921
|
+
defaultOpen,
|
|
113922
|
+
onOpenChange,
|
|
113923
|
+
modal = true
|
|
113924
|
+
} = props;
|
|
113925
|
+
const triggerRef = React.useRef(null);
|
|
113926
|
+
const contentRef = React.useRef(null);
|
|
113927
|
+
const [open, setOpen] = useControllableState$1({
|
|
113928
|
+
prop: openProp,
|
|
113929
|
+
defaultProp: defaultOpen ?? false,
|
|
113930
|
+
onChange: onOpenChange,
|
|
113931
|
+
caller: DIALOG_NAME$1
|
|
113932
|
+
});
|
|
113933
|
+
return /* @__PURE__ */ jsx(
|
|
113934
|
+
DialogProvider$1,
|
|
113935
|
+
{
|
|
113936
|
+
scope: __scopeDialog,
|
|
113937
|
+
triggerRef,
|
|
113938
|
+
contentRef,
|
|
113939
|
+
contentId: useId(),
|
|
113940
|
+
titleId: useId(),
|
|
113941
|
+
descriptionId: useId(),
|
|
113942
|
+
open,
|
|
113943
|
+
onOpenChange: setOpen,
|
|
113944
|
+
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
113945
|
+
modal,
|
|
113946
|
+
children
|
|
113947
|
+
}
|
|
113948
|
+
);
|
|
113949
|
+
};
|
|
113950
|
+
Dialog.displayName = DIALOG_NAME$1;
|
|
113951
|
+
var TRIGGER_NAME$2 = "DialogTrigger";
|
|
113952
|
+
var DialogTrigger$1 = React.forwardRef(
|
|
113953
|
+
(props, forwardedRef) => {
|
|
113954
|
+
const { __scopeDialog, ...triggerProps } = props;
|
|
113955
|
+
const context = useDialogContext$1(TRIGGER_NAME$2, __scopeDialog);
|
|
113956
|
+
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
113957
|
+
return /* @__PURE__ */ jsx(
|
|
113958
|
+
Primitive$3.button,
|
|
113959
|
+
{
|
|
113960
|
+
type: "button",
|
|
113961
|
+
"aria-haspopup": "dialog",
|
|
113962
|
+
"aria-expanded": context.open,
|
|
113963
|
+
"aria-controls": context.contentId,
|
|
113964
|
+
"data-state": getState$1(context.open),
|
|
113965
|
+
...triggerProps,
|
|
113966
|
+
ref: composedTriggerRef,
|
|
113967
|
+
onClick: composeEventHandlers$1(props.onClick, context.onOpenToggle)
|
|
113968
|
+
}
|
|
113969
|
+
);
|
|
113970
|
+
}
|
|
113971
|
+
);
|
|
113972
|
+
DialogTrigger$1.displayName = TRIGGER_NAME$2;
|
|
113973
|
+
var PORTAL_NAME$3 = "DialogPortal";
|
|
113974
|
+
var [PortalProvider$1, usePortalContext$1] = createDialogContext$1(PORTAL_NAME$3, {
|
|
113975
|
+
forceMount: void 0
|
|
113976
|
+
});
|
|
113977
|
+
var DialogPortal$1 = (props) => {
|
|
113978
|
+
const { __scopeDialog, forceMount, children, container } = props;
|
|
113979
|
+
const context = useDialogContext$1(PORTAL_NAME$3, __scopeDialog);
|
|
113980
|
+
return /* @__PURE__ */ jsx(PortalProvider$1, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence$1, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$7, { asChild: true, container, children: child }) })) });
|
|
113981
|
+
};
|
|
113982
|
+
DialogPortal$1.displayName = PORTAL_NAME$3;
|
|
113983
|
+
var OVERLAY_NAME$2 = "DialogOverlay";
|
|
113984
|
+
var DialogOverlay$1 = React.forwardRef(
|
|
113985
|
+
(props, forwardedRef) => {
|
|
113986
|
+
const portalContext = usePortalContext$1(OVERLAY_NAME$2, props.__scopeDialog);
|
|
113987
|
+
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
|
|
113988
|
+
const context = useDialogContext$1(OVERLAY_NAME$2, props.__scopeDialog);
|
|
113989
|
+
return context.modal ? /* @__PURE__ */ jsx(Presence$1, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl$1, { ...overlayProps, ref: forwardedRef }) }) : null;
|
|
113990
|
+
}
|
|
113991
|
+
);
|
|
113992
|
+
DialogOverlay$1.displayName = OVERLAY_NAME$2;
|
|
113993
|
+
var Slot$1 = createSlot$1("DialogOverlay.RemoveScroll");
|
|
113994
|
+
var DialogOverlayImpl$1 = React.forwardRef(
|
|
113995
|
+
(props, forwardedRef) => {
|
|
113996
|
+
const { __scopeDialog, ...overlayProps } = props;
|
|
113997
|
+
const context = useDialogContext$1(OVERLAY_NAME$2, __scopeDialog);
|
|
113998
|
+
return (
|
|
113999
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
114000
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
114001
|
+
/* @__PURE__ */ jsx(ReactRemoveScroll, { as: Slot$1, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(
|
|
114002
|
+
Primitive$3.div,
|
|
114003
|
+
{
|
|
114004
|
+
"data-state": getState$1(context.open),
|
|
114005
|
+
...overlayProps,
|
|
114006
|
+
ref: forwardedRef,
|
|
114007
|
+
style: { pointerEvents: "auto", ...overlayProps.style }
|
|
114008
|
+
}
|
|
114009
|
+
) })
|
|
114010
|
+
);
|
|
114011
|
+
}
|
|
114012
|
+
);
|
|
114013
|
+
var CONTENT_NAME$2 = "DialogContent";
|
|
114014
|
+
var DialogContent$1 = React.forwardRef(
|
|
114015
|
+
(props, forwardedRef) => {
|
|
114016
|
+
const portalContext = usePortalContext$1(CONTENT_NAME$2, props.__scopeDialog);
|
|
114017
|
+
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
114018
|
+
const context = useDialogContext$1(CONTENT_NAME$2, props.__scopeDialog);
|
|
114019
|
+
return /* @__PURE__ */ jsx(Presence$1, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal$1, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal$1, { ...contentProps, ref: forwardedRef }) });
|
|
114020
|
+
}
|
|
114021
|
+
);
|
|
114022
|
+
DialogContent$1.displayName = CONTENT_NAME$2;
|
|
114023
|
+
var DialogContentModal$1 = React.forwardRef(
|
|
114024
|
+
(props, forwardedRef) => {
|
|
114025
|
+
const context = useDialogContext$1(CONTENT_NAME$2, props.__scopeDialog);
|
|
114026
|
+
const contentRef = React.useRef(null);
|
|
114027
|
+
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
114028
|
+
React.useEffect(() => {
|
|
114029
|
+
const content = contentRef.current;
|
|
114030
|
+
if (content) return hideOthers(content);
|
|
114031
|
+
}, []);
|
|
114032
|
+
return /* @__PURE__ */ jsx(
|
|
114033
|
+
DialogContentImpl$1,
|
|
114034
|
+
{
|
|
114035
|
+
...props,
|
|
114036
|
+
ref: composedRefs,
|
|
114037
|
+
trapFocus: context.open,
|
|
114038
|
+
disableOutsidePointerEvents: true,
|
|
114039
|
+
onCloseAutoFocus: composeEventHandlers$1(props.onCloseAutoFocus, (event) => {
|
|
114040
|
+
event.preventDefault();
|
|
114041
|
+
context.triggerRef.current?.focus();
|
|
114042
|
+
}),
|
|
114043
|
+
onPointerDownOutside: composeEventHandlers$1(props.onPointerDownOutside, (event) => {
|
|
114044
|
+
const originalEvent = event.detail.originalEvent;
|
|
114045
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
114046
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
114047
|
+
if (isRightClick) event.preventDefault();
|
|
114048
|
+
}),
|
|
114049
|
+
onFocusOutside: composeEventHandlers$1(
|
|
114050
|
+
props.onFocusOutside,
|
|
114051
|
+
(event) => event.preventDefault()
|
|
114052
|
+
)
|
|
114053
|
+
}
|
|
114054
|
+
);
|
|
114055
|
+
}
|
|
114056
|
+
);
|
|
114057
|
+
var DialogContentNonModal$1 = React.forwardRef(
|
|
114058
|
+
(props, forwardedRef) => {
|
|
114059
|
+
const context = useDialogContext$1(CONTENT_NAME$2, props.__scopeDialog);
|
|
114060
|
+
const hasInteractedOutsideRef = React.useRef(false);
|
|
114061
|
+
const hasPointerDownOutsideRef = React.useRef(false);
|
|
114062
|
+
return /* @__PURE__ */ jsx(
|
|
114063
|
+
DialogContentImpl$1,
|
|
114064
|
+
{
|
|
114065
|
+
...props,
|
|
114066
|
+
ref: forwardedRef,
|
|
114067
|
+
trapFocus: false,
|
|
114068
|
+
disableOutsidePointerEvents: false,
|
|
114069
|
+
onCloseAutoFocus: (event) => {
|
|
114070
|
+
props.onCloseAutoFocus?.(event);
|
|
114071
|
+
if (!event.defaultPrevented) {
|
|
114072
|
+
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
114073
|
+
event.preventDefault();
|
|
114074
|
+
}
|
|
114075
|
+
hasInteractedOutsideRef.current = false;
|
|
114076
|
+
hasPointerDownOutsideRef.current = false;
|
|
114077
|
+
},
|
|
114078
|
+
onInteractOutside: (event) => {
|
|
114079
|
+
props.onInteractOutside?.(event);
|
|
114080
|
+
if (!event.defaultPrevented) {
|
|
114081
|
+
hasInteractedOutsideRef.current = true;
|
|
114082
|
+
if (event.detail.originalEvent.type === "pointerdown") {
|
|
114083
|
+
hasPointerDownOutsideRef.current = true;
|
|
114084
|
+
}
|
|
114085
|
+
}
|
|
114086
|
+
const target = event.target;
|
|
114087
|
+
const targetIsTrigger = context.triggerRef.current?.contains(target);
|
|
114088
|
+
if (targetIsTrigger) event.preventDefault();
|
|
114089
|
+
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
|
114090
|
+
event.preventDefault();
|
|
114091
|
+
}
|
|
114092
|
+
}
|
|
114093
|
+
}
|
|
114094
|
+
);
|
|
114095
|
+
}
|
|
114096
|
+
);
|
|
114097
|
+
var DialogContentImpl$1 = React.forwardRef(
|
|
114098
|
+
(props, forwardedRef) => {
|
|
114099
|
+
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
114100
|
+
const context = useDialogContext$1(CONTENT_NAME$2, __scopeDialog);
|
|
114101
|
+
const contentRef = React.useRef(null);
|
|
114102
|
+
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
114103
|
+
useFocusGuards();
|
|
114104
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
114105
|
+
/* @__PURE__ */ jsx(
|
|
114106
|
+
FocusScope$1,
|
|
114107
|
+
{
|
|
114108
|
+
asChild: true,
|
|
114109
|
+
loop: true,
|
|
114110
|
+
trapped: trapFocus,
|
|
114111
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
114112
|
+
onUnmountAutoFocus: onCloseAutoFocus,
|
|
114113
|
+
children: /* @__PURE__ */ jsx(
|
|
114114
|
+
DismissableLayer$2,
|
|
114115
|
+
{
|
|
114116
|
+
role: "dialog",
|
|
114117
|
+
id: context.contentId,
|
|
114118
|
+
"aria-describedby": context.descriptionId,
|
|
114119
|
+
"aria-labelledby": context.titleId,
|
|
114120
|
+
"data-state": getState$1(context.open),
|
|
114121
|
+
...contentProps,
|
|
114122
|
+
ref: composedRefs,
|
|
114123
|
+
onDismiss: () => context.onOpenChange(false)
|
|
114124
|
+
}
|
|
114125
|
+
)
|
|
114126
|
+
}
|
|
114127
|
+
),
|
|
114128
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
114129
|
+
/* @__PURE__ */ jsx(TitleWarning$1, { titleId: context.titleId }),
|
|
114130
|
+
/* @__PURE__ */ jsx(DescriptionWarning$2, { contentRef, descriptionId: context.descriptionId })
|
|
114131
|
+
] })
|
|
114132
|
+
] });
|
|
114133
|
+
}
|
|
114134
|
+
);
|
|
114135
|
+
var TITLE_NAME$2 = "DialogTitle";
|
|
114136
|
+
var DialogTitle$1 = React.forwardRef(
|
|
114137
|
+
(props, forwardedRef) => {
|
|
114138
|
+
const { __scopeDialog, ...titleProps } = props;
|
|
114139
|
+
const context = useDialogContext$1(TITLE_NAME$2, __scopeDialog);
|
|
114140
|
+
return /* @__PURE__ */ jsx(Primitive$3.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
|
114141
|
+
}
|
|
114142
|
+
);
|
|
114143
|
+
DialogTitle$1.displayName = TITLE_NAME$2;
|
|
114144
|
+
var DESCRIPTION_NAME$2 = "DialogDescription";
|
|
114145
|
+
var DialogDescription$1 = React.forwardRef(
|
|
114146
|
+
(props, forwardedRef) => {
|
|
114147
|
+
const { __scopeDialog, ...descriptionProps } = props;
|
|
114148
|
+
const context = useDialogContext$1(DESCRIPTION_NAME$2, __scopeDialog);
|
|
114149
|
+
return /* @__PURE__ */ jsx(Primitive$3.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
|
114150
|
+
}
|
|
114151
|
+
);
|
|
114152
|
+
DialogDescription$1.displayName = DESCRIPTION_NAME$2;
|
|
114153
|
+
var CLOSE_NAME$1 = "DialogClose";
|
|
114154
|
+
var DialogClose$1 = React.forwardRef(
|
|
114155
|
+
(props, forwardedRef) => {
|
|
114156
|
+
const { __scopeDialog, ...closeProps } = props;
|
|
114157
|
+
const context = useDialogContext$1(CLOSE_NAME$1, __scopeDialog);
|
|
114158
|
+
return /* @__PURE__ */ jsx(
|
|
114159
|
+
Primitive$3.button,
|
|
114160
|
+
{
|
|
114161
|
+
type: "button",
|
|
114162
|
+
...closeProps,
|
|
114163
|
+
ref: forwardedRef,
|
|
114164
|
+
onClick: composeEventHandlers$1(props.onClick, () => context.onOpenChange(false))
|
|
114165
|
+
}
|
|
114166
|
+
);
|
|
114167
|
+
}
|
|
114168
|
+
);
|
|
114169
|
+
DialogClose$1.displayName = CLOSE_NAME$1;
|
|
114170
|
+
function getState$1(open) {
|
|
114171
|
+
return open ? "open" : "closed";
|
|
114172
|
+
}
|
|
114173
|
+
var TITLE_WARNING_NAME$1 = "DialogTitleWarning";
|
|
114174
|
+
var [WarningProvider$1, useWarningContext$1] = createContext2(TITLE_WARNING_NAME$1, {
|
|
114175
|
+
contentName: CONTENT_NAME$2,
|
|
114176
|
+
titleName: TITLE_NAME$2,
|
|
114177
|
+
docsSlug: "dialog"
|
|
114178
|
+
});
|
|
114179
|
+
var TitleWarning$1 = ({ titleId }) => {
|
|
114180
|
+
const titleWarningContext = useWarningContext$1(TITLE_WARNING_NAME$1);
|
|
114181
|
+
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
|
|
114182
|
+
|
|
114183
|
+
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
114184
|
+
|
|
114185
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
|
|
114186
|
+
React.useEffect(() => {
|
|
114187
|
+
if (titleId) {
|
|
114188
|
+
const hasTitle = document.getElementById(titleId);
|
|
114189
|
+
if (!hasTitle) console.error(MESSAGE);
|
|
114190
|
+
}
|
|
114191
|
+
}, [MESSAGE, titleId]);
|
|
114192
|
+
return null;
|
|
114193
|
+
};
|
|
114194
|
+
var DESCRIPTION_WARNING_NAME$1 = "DialogDescriptionWarning";
|
|
114195
|
+
var DescriptionWarning$2 = ({ contentRef, descriptionId }) => {
|
|
114196
|
+
const descriptionWarningContext = useWarningContext$1(DESCRIPTION_WARNING_NAME$1);
|
|
114197
|
+
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
|
|
114198
|
+
React.useEffect(() => {
|
|
114199
|
+
const describedById = contentRef.current?.getAttribute("aria-describedby");
|
|
114200
|
+
if (descriptionId && describedById) {
|
|
114201
|
+
const hasDescription = document.getElementById(descriptionId);
|
|
114202
|
+
if (!hasDescription) console.warn(MESSAGE);
|
|
114203
|
+
}
|
|
114204
|
+
}, [MESSAGE, contentRef, descriptionId]);
|
|
114205
|
+
return null;
|
|
114206
|
+
};
|
|
114207
|
+
var Root = Dialog;
|
|
114208
|
+
var Portal$2 = DialogPortal$1;
|
|
114209
|
+
var Overlay$1 = DialogOverlay$1;
|
|
114210
|
+
var Content$1 = DialogContent$1;
|
|
114211
|
+
|
|
114212
|
+
var N='[cmdk-group=""]',Y='[cmdk-group-items=""]',be='[cmdk-group-heading=""]',le='[cmdk-item=""]',ce=`${le}:not([aria-disabled="true"])`,Z="cmdk-item-select",T="data-value",Re=(r,o,n)=>W(r,o,n),ue=React.createContext(void 0),K=()=>React.useContext(ue),de=React.createContext(void 0),ee=()=>React.useContext(de),fe=React.createContext(void 0),me=React.forwardRef((r,o)=>{let n=L(()=>{var e,a;return {search:"",value:(a=(e=r.value)!=null?e:r.defaultValue)!=null?a:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),u=L(()=>new Set),c=L(()=>new Map),d=L(()=>new Map),f=L(()=>new Set),p=pe(r),{label:b,children:m,value:R,onValueChange:x,filter:C,shouldFilter:S,loop:A,disablePointerSelection:ge=false,vimBindings:j=true,...O}=r,$=useId(),q=useId(),_=useId(),I=React.useRef(null),v=ke();k(()=>{if(R!==void 0){let e=R.trim();n.current.value=e,E.emit();}},[R]),k(()=>{v(6,ne);},[]);let E=React.useMemo(()=>({subscribe:e=>(f.current.add(e),()=>f.current.delete(e)),snapshot:()=>n.current,setState:(e,a,s)=>{var i,l,g,y;if(!Object.is(n.current[e],a)){if(n.current[e]=a,e==="search")J(),z(),v(1,W);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let h=document.getElementById(_);h?h.focus():(i=document.getElementById($))==null||i.focus();}if(v(7,()=>{var h;n.current.selectedItemId=(h=M())==null?void 0:h.id,E.emit();}),s||v(5,ne),((l=p.current)==null?void 0:l.value)!==void 0){let h=a!=null?a:"";(y=(g=p.current).onValueChange)==null||y.call(g,h);return}}E.emit();}},emit:()=>{f.current.forEach(e=>e());}}),[]),U=React.useMemo(()=>({value:(e,a,s)=>{var i;a!==((i=d.current.get(e))==null?void 0:i.value)&&(d.current.set(e,{value:a,keywords:s}),n.current.filtered.items.set(e,te(a,s)),v(2,()=>{z(),E.emit();}));},item:(e,a)=>(u.current.add(e),a&&(c.current.has(a)?c.current.get(a).add(e):c.current.set(a,new Set([e]))),v(3,()=>{J(),z(),n.current.value||W(),E.emit();}),()=>{d.current.delete(e),u.current.delete(e),n.current.filtered.items.delete(e);let s=M();v(4,()=>{J(),(s==null?void 0:s.getAttribute("id"))===e&&W(),E.emit();});}),group:e=>(c.current.has(e)||c.current.set(e,new Set),()=>{d.current.delete(e),c.current.delete(e);}),filter:()=>p.current.shouldFilter,label:b||r["aria-label"],getDisablePointerSelection:()=>p.current.disablePointerSelection,listId:$,inputId:_,labelId:q,listInnerRef:I}),[]);function te(e,a){var i,l;let s=(l=(i=p.current)==null?void 0:i.filter)!=null?l:Re;return e?s(e,n.current.search,a):0}function z(){if(!n.current.search||p.current.shouldFilter===false)return;let e=n.current.filtered.items,a=[];n.current.filtered.groups.forEach(i=>{let l=c.current.get(i),g=0;l.forEach(y=>{let h=e.get(y);g=Math.max(h,g);}),a.push([i,g]);});let s=I.current;V().sort((i,l)=>{var h,F;let g=i.getAttribute("id"),y=l.getAttribute("id");return ((h=e.get(y))!=null?h:0)-((F=e.get(g))!=null?F:0)}).forEach(i=>{let l=i.closest(Y);l?l.appendChild(i.parentElement===l?i:i.closest(`${Y} > *`)):s.appendChild(i.parentElement===s?i:i.closest(`${Y} > *`));}),a.sort((i,l)=>l[1]-i[1]).forEach(i=>{var g;let l=(g=I.current)==null?void 0:g.querySelector(`${N}[${T}="${encodeURIComponent(i[0])}"]`);l==null||l.parentElement.appendChild(l);});}function W(){let e=V().find(s=>s.getAttribute("aria-disabled")!=="true"),a=e==null?void 0:e.getAttribute(T);E.setState("value",a||void 0);}function J(){var a,s,i,l;if(!n.current.search||p.current.shouldFilter===false){n.current.filtered.count=u.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let g of u.current){let y=(s=(a=d.current.get(g))==null?void 0:a.value)!=null?s:"",h=(l=(i=d.current.get(g))==null?void 0:i.keywords)!=null?l:[],F=te(y,h);n.current.filtered.items.set(g,F),F>0&&e++;}for(let[g,y]of c.current)for(let h of y)if(n.current.filtered.items.get(h)>0){n.current.filtered.groups.add(g);break}n.current.filtered.count=e;}function ne(){var a,s,i;let e=M();e&&(((a=e.parentElement)==null?void 0:a.firstChild)===e&&((i=(s=e.closest(N))==null?void 0:s.querySelector(be))==null||i.scrollIntoView({block:"nearest"})),e.scrollIntoView({block:"nearest"}));}function M(){var e;return (e=I.current)==null?void 0:e.querySelector(`${le}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=I.current)==null?void 0:e.querySelectorAll(ce))||[])}function X(e){let s=V()[e];s&&E.setState("value",s.getAttribute(T));}function Q(e){var g;let a=M(),s=V(),i=s.findIndex(y=>y===a),l=s[i+e];(g=p.current)!=null&&g.loop&&(l=i+e<0?s[s.length-1]:i+e===s.length?s[0]:s[i+e]),l&&E.setState("value",l.getAttribute(T));}function re(e){let a=M(),s=a==null?void 0:a.closest(N),i;for(;s&&!i;)s=e>0?we(s,N):De(s,N),i=s==null?void 0:s.querySelector(ce);i?E.setState("value",i.getAttribute(T)):Q(e);}let oe=()=>X(V().length-1),ie=e=>{e.preventDefault(),e.metaKey?oe():e.altKey?re(1):Q(1);},se=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?re(-1):Q(-1);};return React.createElement(Primitive$1.div,{ref:o,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var s;(s=O.onKeyDown)==null||s.call(O,e);let a=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||a))switch(e.key){case "n":case "j":{j&&e.ctrlKey&&ie(e);break}case "ArrowDown":{ie(e);break}case "p":case "k":{j&&e.ctrlKey&&se(e);break}case "ArrowUp":{se(e);break}case "Home":{e.preventDefault(),X(0);break}case "End":{e.preventDefault(),oe();break}case "Enter":{e.preventDefault();let i=M();if(i){let l=new Event(Z);i.dispatchEvent(l);}}}}},React.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:Te},b),B(r,e=>React.createElement(de.Provider,{value:E},React.createElement(ue.Provider,{value:U},e))))}),he=React.forwardRef((r,o)=>{var _,I;let n=useId(),u=React.useRef(null),c=React.useContext(fe),d=K(),f=pe(r),p=(I=(_=f.current)==null?void 0:_.forceMount)!=null?I:c==null?void 0:c.forceMount;k(()=>{if(!p)return d.item(n,c==null?void 0:c.id)},[p]);let b=ve(n,u,[r.value,r.children,u],r.keywords),m=ee(),R=P(v=>v.value&&v.value===b.current),x=P(v=>p||d.filter()===false?true:v.search?v.filtered.items.get(n)>0:true);React.useEffect(()=>{let v=u.current;if(!(!v||r.disabled))return v.addEventListener(Z,C),()=>v.removeEventListener(Z,C)},[x,r.onSelect,r.disabled]);function C(){var v,E;S(),(E=(v=f.current).onSelect)==null||E.call(v,b.current);}function S(){m.setState("value",b.current,true);}if(!x)return null;let{disabled:A,value:ge,onSelect:j,forceMount:O,keywords:$,...q}=r;return React.createElement(Primitive$1.div,{ref:composeRefs$1(u,o),...q,id:n,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!R,"data-disabled":!!A,"data-selected":!!R,onPointerMove:A||d.getDisablePointerSelection()?void 0:S,onClick:A?void 0:C},r.children)}),Ee=React.forwardRef((r,o)=>{let{heading:n,children:u,forceMount:c,...d}=r,f=useId(),p=React.useRef(null),b=React.useRef(null),m=useId(),R=K(),x=P(S=>c||R.filter()===false?true:S.search?S.filtered.groups.has(f):true);k(()=>R.group(f),[]),ve(f,p,[r.value,r.heading,b]);let C=React.useMemo(()=>({id:f,forceMount:c}),[c]);return React.createElement(Primitive$1.div,{ref:composeRefs$1(p,o),...d,"cmdk-group":"",role:"presentation",hidden:x?void 0:true},n&&React.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":true,id:m},n),B(r,S=>React.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},React.createElement(fe.Provider,{value:C},S))))}),ye=React.forwardRef((r,o)=>{let{alwaysRender:n,...u}=r,c=React.useRef(null),d=P(f=>!f.search);return !n&&!d?null:React.createElement(Primitive$1.div,{ref:composeRefs$1(c,o),...u,"cmdk-separator":"",role:"separator"})}),Se=React.forwardRef((r,o)=>{let{onValueChange:n,...u}=r,c=r.value!=null,d=ee(),f=P(m=>m.search),p=P(m=>m.selectedItemId),b=K();return React.useEffect(()=>{r.value!=null&&d.setState("search",r.value);},[r.value]),React.createElement(Primitive$1.input,{ref:o,...u,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:false,"aria-autocomplete":"list",role:"combobox","aria-expanded":true,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":p,id:b.inputId,type:"text",value:c?r.value:f,onChange:m=>{c||d.setState("search",m.target.value),n==null||n(m.target.value);}})}),Ce=React.forwardRef((r,o)=>{let{children:n,label:u="Suggestions",...c}=r,d=React.useRef(null),f=React.useRef(null),p=P(m=>m.selectedItemId),b=K();return React.useEffect(()=>{if(f.current&&d.current){let m=f.current,R=d.current,x,C=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let S=m.offsetHeight;R.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px");});});return C.observe(m),()=>{cancelAnimationFrame(x),C.unobserve(m);}}},[]),React.createElement(Primitive$1.div,{ref:composeRefs$1(d,o),...c,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":p,"aria-label":u,id:b.listId},B(r,m=>React.createElement("div",{ref:composeRefs$1(f,b.listInnerRef),"cmdk-list-sizer":""},m)))}),xe=React.forwardRef((r,o)=>{let{open:n,onOpenChange:u,overlayClassName:c,contentClassName:d,container:f,...p}=r;return React.createElement(Root,{open:n,onOpenChange:u},React.createElement(Portal$2,{container:f},React.createElement(Overlay$1,{"cmdk-overlay":"",className:c}),React.createElement(Content$1,{"aria-label":r.label,"cmdk-dialog":"",className:d},React.createElement(me,{ref:o,...p}))))}),Ie=React.forwardRef((r,o)=>P(u=>u.filtered.count===0)?React.createElement(Primitive$1.div,{ref:o,...r,"cmdk-empty":"",role:"presentation"}):null),Pe=React.forwardRef((r,o)=>{let{progress:n,children:u,label:c="Loading...",...d}=r;return React.createElement(Primitive$1.div,{ref:o,...d,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},B(r,f=>React.createElement("div",{"aria-hidden":true},f)))}),_e=Object.assign(me,{List:Ce,Item:he,Input:Se,Group:Ee,Separator:ye,Dialog:xe,Empty:Ie,Loading:Pe});function we(r,o){let n=r.nextElementSibling;for(;n;){if(n.matches(o))return n;n=n.nextElementSibling;}}function De(r,o){let n=r.previousElementSibling;for(;n;){if(n.matches(o))return n;n=n.previousElementSibling;}}function pe(r){let o=React.useRef(r);return k(()=>{o.current=r;}),o}var k=typeof window=="undefined"?React.useEffect:React.useLayoutEffect;function L(r){let o=React.useRef();return o.current===void 0&&(o.current=r()),o}function P(r){let o=ee(),n=()=>r(o.snapshot());return React.useSyncExternalStore(o.subscribe,n,n)}function ve(r,o,n,u=[]){let c=React.useRef(),d=K();return k(()=>{var b;let f=(()=>{var m;for(let R of n){if(typeof R=="string")return R.trim();if(typeof R=="object"&&"current"in R)return R.current?(m=R.current.textContent)==null?void 0:m.trim():c.current}})(),p=u.map(m=>m.trim());d.value(r,f,p),(b=o.current)==null||b.setAttribute(T,f),c.current=f;}),c}var ke=()=>{let[r,o]=React.useState(),n=L(()=>new Map);return k(()=>{n.current.forEach(u=>u()),n.current=new Map;},[r]),(u,c)=>{n.current.set(u,c),o({});}};function Me(r){let o=r.type;return typeof o=="function"?o(r.props):"render"in o?o.render(r.props):r}function B({asChild:r,children:o},n){return r&&React.isValidElement(o)?React.cloneElement(Me(o),{ref:o.ref},n(o.props.children)):n(o)}var Te={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};
|
|
114213
|
+
|
|
114214
|
+
const Command = React.forwardRef(({ className, ...props }, ref) => (jsx(_e, { ref: ref, className: cn('bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md', className), ...props })));
|
|
114215
|
+
Command.displayName = _e.displayName;
|
|
114216
|
+
const CommandInput = React.forwardRef(({ className, ...props }, ref) => (jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), jsx(_e.Input, { ref: ref, className: cn('placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50', className), ...props })] })));
|
|
114217
|
+
CommandInput.displayName = _e.Input.displayName;
|
|
114218
|
+
const CommandList = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.List, { ref: ref, className: cn('max-h-[300px] overflow-x-hidden overflow-y-auto', className), ...props })));
|
|
114219
|
+
CommandList.displayName = _e.List.displayName;
|
|
114220
|
+
const CommandEmpty = React.forwardRef((props, ref) => (jsx(_e.Empty, { ref: ref, className: "py-6 text-center text-sm", ...props })));
|
|
114221
|
+
CommandEmpty.displayName = _e.Empty.displayName;
|
|
114222
|
+
const CommandGroup = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.Group, { ref: ref, className: cn('text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium', className), ...props })));
|
|
114223
|
+
CommandGroup.displayName = _e.Group.displayName;
|
|
114224
|
+
const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.Separator, { ref: ref, className: cn('bg-border -mx-1 h-px', className), ...props })));
|
|
114225
|
+
CommandSeparator.displayName = _e.Separator.displayName;
|
|
114226
|
+
const CommandItem = React.forwardRef(({ className, ...props }, ref) => (jsx(_e.Item, { ref: ref, className: cn("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className), ...props })));
|
|
114227
|
+
CommandItem.displayName = _e.Item.displayName;
|
|
114228
|
+
|
|
113685
114229
|
const SkeletonMultiplier = ({ Skeleton, multiplier }) => {
|
|
113686
114230
|
return (jsx(Fragment$1, { children: Array.from({ length: multiplier }).map((_, index) => (jsx(Skeleton, {}, index))) }));
|
|
113687
114231
|
};
|
|
@@ -114592,20 +115136,20 @@ const CourseOutline = () => {
|
|
|
114592
115136
|
};
|
|
114593
115137
|
|
|
114594
115138
|
function Sheet({ ...props }) {
|
|
114595
|
-
return jsx(Root$
|
|
115139
|
+
return jsx(Root$9, { "data-slot": "sheet", ...props });
|
|
114596
115140
|
}
|
|
114597
115141
|
function SheetPortal({ ...props }) {
|
|
114598
|
-
return jsx(Portal$
|
|
115142
|
+
return jsx(Portal$6, { "data-slot": "sheet-portal", ...props });
|
|
114599
115143
|
}
|
|
114600
115144
|
function SheetOverlay({ className, ...props }) {
|
|
114601
|
-
return (jsx(Overlay$
|
|
115145
|
+
return (jsx(Overlay$2, { "data-slot": "sheet-overlay", className: cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50', className), ...props }));
|
|
114602
115146
|
}
|
|
114603
115147
|
function SheetContent({ className, children, side = 'right', ...props }) {
|
|
114604
|
-
return (jsxs(SheetPortal, { children: [jsx(SheetOverlay, {}), jsxs(Content$
|
|
115148
|
+
return (jsxs(SheetPortal, { children: [jsx(SheetOverlay, {}), jsxs(Content$4, { "data-slot": "sheet-content", className: cn('bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500', side === 'right' &&
|
|
114605
115149
|
'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm', side === 'left' &&
|
|
114606
115150
|
'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm', side === 'top' &&
|
|
114607
115151
|
'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b', side === 'bottom' &&
|
|
114608
|
-
'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t', className), ...props, children: [children, jsxs(Close$1, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [jsx(X, { className: "size-4" }), jsx("span", { className: "sr-only", children: "Close" })] })] })] }));
|
|
115152
|
+
'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t', className), ...props, children: [children, jsxs(Close$1, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [jsx(X$1, { className: "size-4" }), jsx("span", { className: "sr-only", children: "Close" })] })] })] }));
|
|
114609
115153
|
}
|
|
114610
115154
|
function SheetHeader({ className, ...props }) {
|
|
114611
115155
|
return (jsx("div", { "data-slot": "sheet-header", className: cn('flex flex-col gap-1.5 p-4', className), ...props }));
|
|
@@ -115515,7 +116059,7 @@ var DialogContentImpl = React.forwardRef(
|
|
|
115515
116059
|
const context = useDialogContext(CONTENT_NAME$1, __scopeDialog);
|
|
115516
116060
|
const contentRef = React.useRef(null);
|
|
115517
116061
|
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
115518
|
-
useFocusGuards();
|
|
116062
|
+
useFocusGuards$1();
|
|
115519
116063
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
115520
116064
|
/* @__PURE__ */ jsx(
|
|
115521
116065
|
FocusScope,
|
|
@@ -116184,13 +116728,13 @@ function TeamsAccessPanel({ isOpen, onClose, tenant, teamId, teamName, }) {
|
|
|
116184
116728
|
setFormError(null);
|
|
116185
116729
|
onClose();
|
|
116186
116730
|
}
|
|
116187
|
-
return (jsx(Dialog, { open: isOpen, onOpenChange: handleClose, children: jsxs(DialogContent$
|
|
116731
|
+
return (jsx(Dialog$1, { open: isOpen, onOpenChange: handleClose, children: jsxs(DialogContent$2, { "aria-describedby": undefined, className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [jsx(DialogHeader, { children: jsxs(DialogTitle$2, { children: ["Share Team: ", teamName] }) }), jsxs("div", { className: "space-y-6", children: [jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "permission-select", children: "Permission Level" }), jsxs(Select$1, { value: selectedPermission, onValueChange: setSelectedPermission, children: [jsx(SelectTrigger, { id: "permission-select", children: jsx(SelectValue, { placeholder: "Select permission" }) }), jsx(SelectContent, { children: PERMISSION_OPTIONS.map((option) => (jsx(SelectItem, { value: option.value, children: option.label }, option.value))) })] })] }), isLoadingAccess ? (jsxs("div", { className: "flex items-center justify-center py-8", children: [jsx(LoaderCircle, { className: "h-6 w-6 animate-spin text-gray-400" }), jsx("span", { className: "ml-2 text-sm text-gray-500", children: "Loading access data..." })] })) : (jsxs(Fragment$1, { children: [jsxs("div", { className: "grid gap-1.5", children: [jsxs(Label, { children: ["Users with ", (_a = PERMISSION_OPTIONS.find((p) => p.value === selectedPermission)) === null || _a === void 0 ? void 0 : _a.label, ' ', "access"] }), jsxs("div", { className: "space-y-2", children: [currentUsers.length > 0 ? (jsx("div", { className: "space-y-2 max-h-32 overflow-y-auto border border-gray-200 dark:border-gray-700 rounded-md p-2", children: currentUsers.map((user) => (jsxs("div", { className: "flex items-center justify-between bg-gray-50 dark:bg-gray-800 p-2 rounded-md", children: [jsxs("div", { className: "flex flex-col", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: user.username }), user.email && (jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: user.email }))] }), jsx(Button$1, { type: "button", variant: "ghost", size: "sm", onClick: () => removeUser(user.id), className: "h-8 w-8 p-0 text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-900/20", "aria-label": `Remove ${user.username}`, children: jsx(X$1, { className: "h-4 w-4" }) })] }, user.id))) })) : (jsx("div", { className: "text-sm text-gray-500 dark:text-gray-400 p-3 text-center border border-dashed border-gray-300 dark:border-gray-600 rounded-md", children: "No users have this permission" })), jsxs("div", { className: "relative", children: [jsx(Input, { value: userSearch, onChange: (e) => {
|
|
116188
116732
|
setUserSearch(e.target.value);
|
|
116189
116733
|
setShowUserSearch(e.target.value.length > 0);
|
|
116190
116734
|
}, onFocus: () => setShowUserSearch(userSearch.length > 0), placeholder: "Search users to add..." }), showUserSearch && availableUsers.length > 0 && (jsx("div", { className: "absolute top-full left-0 right-0 mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-48 overflow-y-auto z-50", children: availableUsers.map((user) => {
|
|
116191
116735
|
var _a, _b;
|
|
116192
116736
|
return (jsxs("button", { type: "button", onClick: () => addUser(user), className: "w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 flex flex-col", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: (_a = user.name) !== null && _a !== void 0 ? _a : user.username }), user.email && (jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: user.email }))] }, (_b = user.user_id) !== null && _b !== void 0 ? _b : user.id));
|
|
116193
|
-
}) })), showUserSearch && userSearch.length > 2 && availableUsers.length === 0 && (jsx("div", { className: "absolute top-full left-0 right-0 mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg p-3 z-50", children: jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "No users found" }) }))] }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Type at least 3 characters to search for users" })] })] }), jsxs("div", { className: "grid gap-1.5", children: [jsxs(Label, { children: ["Groups with", ' ', (_b = PERMISSION_OPTIONS.find((p) => p.value === selectedPermission)) === null || _b === void 0 ? void 0 : _b.label, " access"] }), jsxs("div", { className: "space-y-2", children: [currentGroups.length > 0 ? (jsx("div", { className: "space-y-2 max-h-32 overflow-y-auto border border-gray-200 dark:border-gray-700 rounded-md p-2", children: currentGroups.map((group) => (jsxs("div", { className: "flex items-center justify-between bg-gray-50 dark:bg-gray-800 p-2 rounded-md", children: [jsxs("div", { className: "flex flex-col", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: group.name }), group.description && (jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: group.description }))] }), jsx(Button$1, { type: "button", variant: "ghost", size: "sm", onClick: () => removeGroup(group.id), className: "h-8 w-8 p-0 text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-900/20", "aria-label": `Remove ${group.name}`, children: jsx(X, { className: "h-4 w-4" }) })] }, group.id))) })) : (jsx("div", { className: "text-sm text-gray-500 dark:text-gray-400 p-3 text-center border border-dashed border-gray-300 dark:border-gray-600 rounded-md", children: "No groups have this permission" })), jsxs("div", { className: "relative", children: [jsx(Input, { value: groupSearch, onChange: (e) => {
|
|
116737
|
+
}) })), showUserSearch && userSearch.length > 2 && availableUsers.length === 0 && (jsx("div", { className: "absolute top-full left-0 right-0 mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg p-3 z-50", children: jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "No users found" }) }))] }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Type at least 3 characters to search for users" })] })] }), jsxs("div", { className: "grid gap-1.5", children: [jsxs(Label, { children: ["Groups with", ' ', (_b = PERMISSION_OPTIONS.find((p) => p.value === selectedPermission)) === null || _b === void 0 ? void 0 : _b.label, " access"] }), jsxs("div", { className: "space-y-2", children: [currentGroups.length > 0 ? (jsx("div", { className: "space-y-2 max-h-32 overflow-y-auto border border-gray-200 dark:border-gray-700 rounded-md p-2", children: currentGroups.map((group) => (jsxs("div", { className: "flex items-center justify-between bg-gray-50 dark:bg-gray-800 p-2 rounded-md", children: [jsxs("div", { className: "flex flex-col", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: group.name }), group.description && (jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: group.description }))] }), jsx(Button$1, { type: "button", variant: "ghost", size: "sm", onClick: () => removeGroup(group.id), className: "h-8 w-8 p-0 text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-900/20", "aria-label": `Remove ${group.name}`, children: jsx(X$1, { className: "h-4 w-4" }) })] }, group.id))) })) : (jsx("div", { className: "text-sm text-gray-500 dark:text-gray-400 p-3 text-center border border-dashed border-gray-300 dark:border-gray-600 rounded-md", children: "No groups have this permission" })), jsxs("div", { className: "relative", children: [jsx(Input, { value: groupSearch, onChange: (e) => {
|
|
116194
116738
|
setGroupSearch(e.target.value);
|
|
116195
116739
|
setShowGroupSearch(e.target.value.length > 0 || availableGroups.length > 0);
|
|
116196
116740
|
}, onFocus: () => setShowGroupSearch(groupSearch.length > 0 || availableGroups.length > 0), placeholder: "Search groups to add..." }), showGroupSearch && availableGroups.length > 0 && (jsx("div", { className: "absolute top-full left-0 right-0 mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-48 overflow-y-auto z-50", children: availableGroups.map((group) => (jsx("button", { type: "button", onClick: () => addGroup(group), className: "w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700", children: jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: group.name }) }, group.id))) }))] }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Type to search or click to see available groups" })] })] })] }))] }), formError && (jsx("div", { className: "mt-4 p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-md", children: jsx("p", { className: "text-sm text-red-600 dark:text-red-400", children: formError }) })), jsxs(DialogFooter, { className: "mt-6", children: [jsx(Button$1, { variant: "outline", onClick: handleClose, children: "Cancel" }), jsx(Button$1, { onClick: handleSave, disabled: isSubmitting || isLoadingAccess, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", children: isSubmitting ? (jsxs(Fragment$1, { children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin mr-2", "aria-hidden": "true" }), "Saving..."] })) : ('Save Changes') })] })] }) }));
|
|
@@ -116544,7 +117088,7 @@ function GroupsTab({ tenant, isTeam = false, hasInviteUserPermission = false, ha
|
|
|
116544
117088
|
}
|
|
116545
117089
|
return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: `flex mb-6 gap-2 ${isTeam ? 'flex-col sm:flex-row sm:items-center sm:justify-between' : 'flex-row items-center justify-between'}`, children: [jsxs("div", { className: "relative max-w-sm w-full sm:w-auto", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: isTeam ? 'Search teams' : 'Search groups', "aria-label": isTeam ? 'Search teams' : 'Search groups', className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]" }), isLoading && (jsx(LoaderCircle, { "data-testid": "search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), jsxs("div", { className: "flex gap-2", children: [isTeam && hasInviteUserPermission && onInviteClick && (jsx(Button$1, { onClick: onInviteClick, "aria-label": "Invite users", className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", children: "Invite" })), isTeam ? (hasCreateTeamPermission && (jsx(Button$1, { onClick: openNew, "aria-label": "New team", className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", children: "New Team" }))) : (jsx(Button$1, { onClick: openNew, "aria-label": "New group", className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", children: "New Group" }))] })] }), isLoading && (jsx("div", { className: "flex justify-center items-center h-64", children: jsx("div", { className: "py-8 text-center text-sm text-gray-500 dark:text-gray-400", children: "Loading\u2026" }) })), isError && (jsx("div", { className: "py-8 text-center text-sm text-red-500", children: isTeam ? 'Failed to load teams' : 'Failed to load groups' })), !isLoading && !isError && (jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400", children: isTeam ? 'Team Name' : 'Group Name' }), !isTeam && (jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400", children: "Unique ID" })), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400", children: "Description" }), jsx("th", { className: "px-6 py-3 text-right font-medium text-gray-500 dark:text-gray-400 w-[120px]" })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [groups.map((g) => (jsxs("tr", { children: [jsx("td", { className: "px-6 py-4 text-gray-900 dark:text-gray-100 text-sm", children: g.name }), !isTeam && (jsx("td", { className: "px-6 py-4 text-gray-600 dark:text-gray-300 text-sm", children: g.unique_id })), jsx("td", { className: "px-6 py-4 text-gray-600 dark:text-gray-300 text-sm", children: g.description }), jsx("td", { className: "px-6 py-4", children: jsxs("div", { className: "flex gap-2 justify-end", children: [isTeam && (jsx(WithPermissions, { rbacResource: `/platforms/${tenant}/usergroups/${g.id}/#share_usergroup`, rbacPermissions: rbacPermissions, children: ({ hasPermission }) => (hasPermission || !enableRbac) && (jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => openSharePanel(g), disabled: deletingGroupId === g.id, "aria-label": `Share team ${g.name}`, children: jsx(Share2, { className: "h-4 w-4", "aria-hidden": "true" }) })) })), jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => openEdit(g), disabled: deletingGroupId === g.id, "aria-label": `Edit ${isTeam ? 'team' : 'group'} ${g.name}`, children: jsx(Pencil, { className: "h-4 w-4", "aria-hidden": "true" }) }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { tabIndex: 0, children: jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => onDelete(g), className: "text-red-600 hover:text-red-700", disabled: deletingGroupId === g.id ||
|
|
116546
117090
|
g.is_internal ||
|
|
116547
|
-
!g.permissions.object.delete, "aria-label": `Delete ${isTeam ? 'team' : 'group'} ${g.name}`, children: deletingGroupId === g.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })) }) }) }), g.is_internal && (jsx(TooltipContent, { children: jsxs("p", { children: ["Cannot delete internal ", isTeam ? 'teams' : 'groups'] }) })), !g.permissions.object.delete && (jsx(TooltipContent, { children: jsxs("p", { children: ["Cannot delete ", isTeam ? 'teams' : 'groups'] }) }))] }) })] }) })] }, g.id))), groups.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: isTeam ? 3 : 4, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: isTeam ? 'No teams found' : 'No groups found' }) }))] })] }) })), !isLoading && !isError && (jsx("div", { className: "mt-6", children: jsx(AdvancedPagination, { totalPages: totalPages, currentPage: page, onPageChange: (newPage) => handlePageChange(newPage) }) })), jsx(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: jsxs(DialogContent$
|
|
117091
|
+
!g.permissions.object.delete, "aria-label": `Delete ${isTeam ? 'team' : 'group'} ${g.name}`, children: deletingGroupId === g.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })) }) }) }), g.is_internal && (jsx(TooltipContent, { children: jsxs("p", { children: ["Cannot delete internal ", isTeam ? 'teams' : 'groups'] }) })), !g.permissions.object.delete && (jsx(TooltipContent, { children: jsxs("p", { children: ["Cannot delete ", isTeam ? 'teams' : 'groups'] }) }))] }) })] }) })] }, g.id))), groups.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: isTeam ? 3 : 4, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: isTeam ? 'No teams found' : 'No groups found' }) }))] })] }) })), !isLoading && !isError && (jsx("div", { className: "mt-6", children: jsx(AdvancedPagination, { totalPages: totalPages, currentPage: page, onPageChange: (newPage) => handlePageChange(newPage) }) })), jsx(Dialog$1, { open: isOpen, onOpenChange: setIsOpen, children: jsxs(DialogContent$2, { "aria-describedby": undefined, className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [jsx(DialogHeader, { children: jsx(DialogTitle$2, { children: editing ? (isTeam ? 'Edit Team' : 'Edit Group') : isTeam ? 'New Team' : 'New Group' }) }), jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "g-name", children: isTeam ? 'Team Name' : 'Group Name' }), jsx(Input, { id: "g-name", value: form.name, onChange: (e) => setForm({ ...form, name: e.target.value }), placeholder: isTeam ? 'Enter team name' : 'Enter group name', required: true })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "g-desc", children: "Description" }), jsx(Input, { id: "g-desc", value: form.description, onChange: (e) => setForm({ ...form, description: e.target.value }), placeholder: isTeam ? 'Enter team description' : 'Enter group description' })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { children: isTeam ? 'Team Members' : 'Group Members' }), jsx("div", { className: "space-y-2", children: members.length > 0 ? (jsx("div", { className: "space-y-2 max-h-48 overflow-y-auto border border-gray-200 dark:border-gray-700 rounded-md p-2", children: members.map((member) => (jsxs("div", { className: "flex items-center justify-between bg-gray-50 dark:bg-gray-800 p-2 rounded-md", children: [jsxs("div", { className: "flex flex-col", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: member.name || member.username }), member.email && (jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: member.email }))] }), jsx(Button$1, { type: "button", variant: "ghost", size: "sm", onClick: () => removeMember(member.id), className: "h-8 w-8 p-0 text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-900/20", "aria-label": `Remove ${member.name}`, children: jsx(X$1, { className: "h-4 w-4" }) })] }, member.id))) })) : (jsx("div", { className: "text-sm text-gray-500 dark:text-gray-400 p-4 text-center border border-dashed border-gray-300 dark:border-gray-600 rounded-md", children: "No members added yet" })) })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "user-search", children: "Add Members" }), jsxs("div", { className: "relative", children: [jsx(Input, { id: "user-search", value: userSearch, onChange: (e) => {
|
|
116548
117092
|
setUserSearch(e.target.value);
|
|
116549
117093
|
setShowUserSearch(e.target.value.length > 0);
|
|
116550
117094
|
}, onFocus: () => setShowUserSearch(userSearch.length > 0), placeholder: "Type to search users...", className: "w-full" }), showUserSearch && availableUsers.length > 0 && (jsx("div", { className: "absolute top-full left-0 right-0 mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-48 overflow-y-auto z-50", children: availableUsers.map((user) => (jsxs("button", { type: "button", onClick: () => {
|
|
@@ -116715,7 +117259,7 @@ function RolesTab({ tenant }) {
|
|
|
116715
117259
|
setDeletingRoleId(null);
|
|
116716
117260
|
}
|
|
116717
117261
|
}
|
|
116718
|
-
return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex justify-between items-center gap-1 mb-6", children: [jsxs("div", { className: "relative max-w-sm", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: "Search roles", "aria-label": "Search roles", className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]" }), isLoading && (jsx(LoaderCircle, { "data-testid": "search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), jsx(Button$1, { onClick: openNew, "aria-label": "New role", className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", children: "New Role" })] }), isLoading && (jsx("div", { className: "flex justify-center items-center h-64", children: jsx("div", { className: "py-8 text-center text-sm text-gray-500 dark:text-gray-400", children: "Loading\u2026" }) })), isError && jsx("div", { className: "py-8 text-center text-sm text-red-500", children: "Failed to load roles" }), !isLoading && !isError && (jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400", children: "Name" }), jsx("th", { className: "px-6 py-3 text-right font-medium text-gray-500 dark:text-gray-400 w-[100px]" })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [roles.map((r) => (jsxs("tr", { children: [jsx("td", { className: "px-6 py-4 text-gray-900 dark:text-gray-100 text-sm", children: r.name }), jsx("td", { className: "px-6 py-4", children: jsxs("div", { className: "flex gap-2 justify-end", children: [jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => openEdit(r), disabled: deletingRoleId === r.id, "aria-label": `Edit role ${r.name}`, children: jsx(Pencil, { className: "h-4 w-4", "aria-hidden": "true" }) }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { tabIndex: 0, children: jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => onDelete(r), className: "text-red-600 hover:text-red-700", disabled: deletingRoleId === r.id || r.is_internal, "aria-label": `Delete role ${r.name}`, children: deletingRoleId === r.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })) }) }) }), r.is_internal && (jsx(TooltipContent, { children: jsx("p", { children: "Cannot delete internal roles" }) }))] }) })] }) })] }, r.id))), roles.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: 2, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: "No roles found" }) }))] })] }) })), !isLoading && !isError && (jsx("div", { className: "mt-6", children: jsx(AdvancedPagination, { totalPages: totalPages, currentPage: page, onPageChange: (newPage) => handlePageChange(newPage) }) })), jsx(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: jsxs(DialogContent$
|
|
117262
|
+
return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex justify-between items-center gap-1 mb-6", children: [jsxs("div", { className: "relative max-w-sm", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: "Search roles", "aria-label": "Search roles", className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]" }), isLoading && (jsx(LoaderCircle, { "data-testid": "search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), jsx(Button$1, { onClick: openNew, "aria-label": "New role", className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", children: "New Role" })] }), isLoading && (jsx("div", { className: "flex justify-center items-center h-64", children: jsx("div", { className: "py-8 text-center text-sm text-gray-500 dark:text-gray-400", children: "Loading\u2026" }) })), isError && jsx("div", { className: "py-8 text-center text-sm text-red-500", children: "Failed to load roles" }), !isLoading && !isError && (jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400", children: "Name" }), jsx("th", { className: "px-6 py-3 text-right font-medium text-gray-500 dark:text-gray-400 w-[100px]" })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [roles.map((r) => (jsxs("tr", { children: [jsx("td", { className: "px-6 py-4 text-gray-900 dark:text-gray-100 text-sm", children: r.name }), jsx("td", { className: "px-6 py-4", children: jsxs("div", { className: "flex gap-2 justify-end", children: [jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => openEdit(r), disabled: deletingRoleId === r.id, "aria-label": `Edit role ${r.name}`, children: jsx(Pencil, { className: "h-4 w-4", "aria-hidden": "true" }) }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { tabIndex: 0, children: jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => onDelete(r), className: "text-red-600 hover:text-red-700", disabled: deletingRoleId === r.id || r.is_internal, "aria-label": `Delete role ${r.name}`, children: deletingRoleId === r.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })) }) }) }), r.is_internal && (jsx(TooltipContent, { children: jsx("p", { children: "Cannot delete internal roles" }) }))] }) })] }) })] }, r.id))), roles.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: 2, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: "No roles found" }) }))] })] }) })), !isLoading && !isError && (jsx("div", { className: "mt-6", children: jsx(AdvancedPagination, { totalPages: totalPages, currentPage: page, onPageChange: (newPage) => handlePageChange(newPage) }) })), jsx(Dialog$1, { open: isOpen, onOpenChange: setIsOpen, children: jsxs(DialogContent$2, { "aria-describedby": undefined, className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [jsx(DialogHeader, { children: jsx(DialogTitle$2, { children: editing ? 'Edit Role' : 'New Role' }) }), jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "r-name", children: "Role Name" }), jsx(Input, { id: "r-name", value: form.name, onChange: (e) => setForm({ ...form, name: e.target.value }), placeholder: "Enter role name", required: true })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "r-actions", children: "Actions" }), jsxs("div", { className: "space-y-2", children: [actions.length > 0 && (jsx("div", { className: "flex flex-wrap gap-2 p-2 border border-gray-200 dark:border-gray-700 rounded-md bg-gray-50 dark:bg-gray-800", children: actions.map((action, index) => (jsxs(Badge, { variant: "secondary", className: "px-2 py-1 flex items-center gap-1 font-mono text-xs", children: [jsx("span", { children: action }), jsx("button", { type: "button", onClick: () => removeAction(action), className: "ml-1 hover:text-red-600", "aria-label": `Remove action ${action}`, children: jsx(X$1, { className: "h-3 w-3" }) })] }, index))) })), jsxs("div", { className: "flex gap-2", children: [jsx(Input, { id: "r-actions", value: actionInput, onChange: (e) => setActionInput(e.target.value), onKeyDown: handleActionKeyDown, placeholder: "e.g., Ibl.Mentor/Settings/read, Ibl.Mentor/*/write", className: "flex-1 font-mono text-sm" }), jsx(Button$1, { type: "button", variant: "outline", size: "sm", onClick: addAction, disabled: !actionInput.trim(), "aria-label": "Add action", children: jsx(Plus, { className: "h-4 w-4" }) })] }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Press Enter or click + to add. Supports wildcards (e.g., Ibl.Mentor/*/read)" })] })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "r-data-actions", children: "Data Actions" }), jsxs("div", { className: "space-y-2", children: [dataActions.length > 0 && (jsx("div", { className: "flex flex-wrap gap-2 p-2 border border-gray-200 dark:border-gray-700 rounded-md bg-gray-50 dark:bg-gray-800", children: dataActions.map((action, index) => (jsxs(Badge, { variant: "secondary", className: "px-2 py-1 flex items-center gap-1 font-mono text-xs", children: [jsx("span", { children: action }), jsx("button", { type: "button", onClick: () => removeDataAction(action), className: "ml-1 hover:text-red-600", "aria-label": `Remove data action ${action}`, children: jsx(X$1, { className: "h-3 w-3" }) })] }, index))) })), jsxs("div", { className: "flex gap-2", children: [jsx(Input, { id: "r-data-actions", value: dataActionInput, onChange: (e) => setDataActionInput(e.target.value), onKeyDown: handleDataActionKeyDown, placeholder: "e.g., Ibl.Mentor/Settings/email/read, Ibl.Core/*/name/write", className: "flex-1 font-mono text-sm" }), jsx(Button$1, { type: "button", variant: "outline", size: "sm", onClick: addDataAction, disabled: !dataActionInput.trim(), "aria-label": "Add data action", children: jsx(Plus, { className: "h-4 w-4" }) })] }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Press Enter or click + to add. Field-level access (e.g., Ibl.Mentor/Settings/email/read)" })] })] })] }), jsxs(DialogFooter, { className: "mt-6", children: [jsx(Button$1, { variant: "outline", onClick: () => setIsOpen(false), children: "Cancel" }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { tabIndex: 0, children: jsx(Button$1, { onClick: onSubmit, disabled: !!editing && (roleDetails === null || roleDetails === void 0 ? void 0 : roleDetails.is_internal), className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", children: editing ? 'Save Role' : 'Create Role' }) }) }), editing && (roleDetails === null || roleDetails === void 0 ? void 0 : roleDetails.is_internal) && (jsx(TooltipContent, { children: jsx("p", { children: "Cannot edit internal roles" }) }))] }) })] })] }) })] }));
|
|
116719
117263
|
}
|
|
116720
117264
|
|
|
116721
117265
|
function PoliciesTab({ tenant }) {
|
|
@@ -116984,7 +117528,7 @@ function PoliciesTab({ tenant }) {
|
|
|
116984
117528
|
return (jsxs("div", { className: "mt-4", children: [jsxs("div", { className: "flex justify-between items-center gap-1 mb-6", children: [jsxs("div", { className: "relative max-w-sm", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: "Search policies", "aria-label": "Search policies", className: "pl-10 pr-10 focus:ring-blue-500 focus:border-blue-500 h-[35px]" }), isLoading && (jsx(LoaderCircle, { "data-testid": "search-spinner", className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 animate-spin", "aria-hidden": "true" }))] }), jsx(Button$1, { onClick: openNew, "aria-label": "New policy", className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white h-[35px]", children: "New Policy" })] }), isLoading && (jsx("div", { className: "flex justify-center items-center h-64", children: jsx("div", { className: "py-8 text-center text-sm text-gray-500 dark:text-gray-400", children: "Loading\u2026" }) })), isError && (jsx("div", { className: "py-8 text-center text-sm text-red-500", children: "Failed to load policies" })), !isLoading && !isError && (jsx("div", { className: "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-x-auto", children: jsxs("table", { className: "w-full text-sm", children: [jsx("thead", { className: "bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600", children: jsxs("tr", { children: [jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400", children: "Policy Name" }), jsx("th", { className: "px-6 py-3 text-left font-medium text-gray-500 dark:text-gray-400", children: "Role" }), jsx("th", { className: "px-6 py-3 text-right font-medium text-gray-500 dark:text-gray-400 w-[100px]" })] }) }), jsxs("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-600", children: [policies.map((p) => {
|
|
116985
117529
|
var _a, _b;
|
|
116986
117530
|
return (jsxs("tr", { children: [jsx("td", { className: "px-6 py-4 text-gray-900 dark:text-gray-100 text-sm", children: p.name }), jsx("td", { className: "px-6 py-4 text-gray-600 dark:text-gray-300 text-sm", children: (_b = (_a = p.role) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : 'N/A' }), jsx("td", { className: "px-6 py-4", children: jsxs("div", { className: "flex gap-2 justify-end", children: [jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => openEdit(p), disabled: deletingPolicyId === p.id, "aria-label": `Edit policy ${p.name}`, children: jsx(Pencil, { className: "h-4 w-4", "aria-hidden": "true" }) }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { tabIndex: 0, children: jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => onDelete(p), className: "text-red-600 hover:text-red-700", disabled: deletingPolicyId === p.id || p.is_internal, "aria-label": `Delete policy ${p.name}`, children: deletingPolicyId === p.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })) }) }) }), p.is_internal && (jsx(TooltipContent, { children: jsx("p", { children: "Cannot delete internal policies" }) }))] }) })] }) })] }, p.id));
|
|
116987
|
-
}), policies.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: 3, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: "No policies found" }) }))] })] }) })), !isLoading && !isError && (jsx("div", { className: "mt-6", children: jsx(AdvancedPagination, { totalPages: totalPages, currentPage: page, onPageChange: (newPage) => handlePageChange(newPage) }) })), jsx(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: jsxs(DialogContent$
|
|
117531
|
+
}), policies.length === 0 && (jsx("tr", { children: jsx("td", { colSpan: 3, className: "px-6 py-8 text-center text-gray-500 dark:text-gray-400", children: "No policies found" }) }))] })] }) })), !isLoading && !isError && (jsx("div", { className: "mt-6", children: jsx(AdvancedPagination, { totalPages: totalPages, currentPage: page, onPageChange: (newPage) => handlePageChange(newPage) }) })), jsx(Dialog$1, { open: isOpen, onOpenChange: setIsOpen, children: jsxs(DialogContent$2, { "aria-describedby": undefined, className: "max-w-3xl max-h-[90vh] overflow-y-auto", children: [jsx(DialogHeader, { children: jsx(DialogTitle$2, { children: editing ? 'Edit Policy' : 'New Policy' }) }), jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "p-name", children: "Policy Name" }), jsx(Input, { id: "p-name", value: form.name, onChange: (e) => setForm({ ...form, name: e.target.value }), placeholder: "Enter policy name", required: true })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "p-role", children: "Role" }), jsxs("div", { className: "relative", children: [jsx(Input, { id: "p-role", value: form.roleName || roleSearch, onChange: (e) => {
|
|
116988
117532
|
setRoleSearch(e.target.value);
|
|
116989
117533
|
setForm({ ...form, roleId: 0, roleName: '' });
|
|
116990
117534
|
setShowRoleSearch(e.target.value.length > 0);
|
|
@@ -116992,14 +117536,14 @@ function PoliciesTab({ tenant }) {
|
|
|
116992
117536
|
setForm({ ...form, roleId: role.id, roleName: role.name });
|
|
116993
117537
|
setRoleSearch('');
|
|
116994
117538
|
setShowRoleSearch(false);
|
|
116995
|
-
}, className: "w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 flex flex-col", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: role.name }), role.description && (jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: role.description }))] }, role.id))) }))] })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "p-res", children: "Resources" }), jsxs("div", { className: "space-y-2", children: [resources.length > 0 && (jsx("div", { className: "flex flex-wrap gap-2 p-2 border border-gray-200 dark:border-gray-700 rounded-md bg-gray-50 dark:bg-gray-800", children: resources.map((resource, index) => (jsxs(Badge, { variant: "secondary", className: "px-2 py-1 flex items-center gap-1 font-mono text-xs", children: [jsx("span", { children: resource }), jsx("button", { type: "button", onClick: () => removeResource(resource), className: "ml-1 hover:text-red-600", "aria-label": `Remove resource ${resource}`, children: jsx(X, { className: "h-3 w-3" }) })] }, index))) })), jsxs("div", { className: "flex gap-2", children: [jsx(Input, { id: "p-res", value: resourceInput, onChange: (e) => setResourceInput(e.target.value), onKeyDown: handleResourceKeyDown, placeholder: "e.g., /platforms/{pk}/projects, /platforms/{pk}/mentors/*", className: "flex-1 font-mono text-sm" }), jsx(Button$1, { type: "button", variant: "outline", size: "sm", onClick: addResource, disabled: !resourceInput.trim(), "aria-label": "Add resource", children: jsx(Plus, { className: "h-4 w-4" }) })] }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Press Enter or click + to add. Supports wildcards and path parameters" })] })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { children: "Users" }), jsxs("div", { className: "space-y-2", children: [selectedUsers.length > 0 ? (jsx("div", { className: "space-y-2 max-h-32 overflow-y-auto border border-gray-200 dark:border-gray-700 rounded-md p-2", children: selectedUsers.map((user) => (jsxs("div", { className: "flex items-center justify-between bg-gray-50 dark:bg-gray-800 p-2 rounded-md", children: [jsxs("div", { className: "flex flex-col", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: user.name }), jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: user.email })] }), jsx(Button$1, { type: "button", variant: "ghost", size: "sm", onClick: () => removeUser(user.id), className: "h-8 w-8 p-0 text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-900/20", "aria-label": `Remove ${user.name}`, children: jsx(X, { className: "h-4 w-4" }) })] }, user.id))) })) : (jsx("div", { className: "text-sm text-gray-500 dark:text-gray-400 p-3 text-center border border-dashed border-gray-300 dark:border-gray-600 rounded-md", children: "No users added" })), jsxs("div", { className: "relative", children: [jsx(Input, { value: userSearch, onChange: (e) => {
|
|
117539
|
+
}, className: "w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 flex flex-col", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: role.name }), role.description && (jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: role.description }))] }, role.id))) }))] })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { htmlFor: "p-res", children: "Resources" }), jsxs("div", { className: "space-y-2", children: [resources.length > 0 && (jsx("div", { className: "flex flex-wrap gap-2 p-2 border border-gray-200 dark:border-gray-700 rounded-md bg-gray-50 dark:bg-gray-800", children: resources.map((resource, index) => (jsxs(Badge, { variant: "secondary", className: "px-2 py-1 flex items-center gap-1 font-mono text-xs", children: [jsx("span", { children: resource }), jsx("button", { type: "button", onClick: () => removeResource(resource), className: "ml-1 hover:text-red-600", "aria-label": `Remove resource ${resource}`, children: jsx(X$1, { className: "h-3 w-3" }) })] }, index))) })), jsxs("div", { className: "flex gap-2", children: [jsx(Input, { id: "p-res", value: resourceInput, onChange: (e) => setResourceInput(e.target.value), onKeyDown: handleResourceKeyDown, placeholder: "e.g., /platforms/{pk}/projects, /platforms/{pk}/mentors/*", className: "flex-1 font-mono text-sm" }), jsx(Button$1, { type: "button", variant: "outline", size: "sm", onClick: addResource, disabled: !resourceInput.trim(), "aria-label": "Add resource", children: jsx(Plus, { className: "h-4 w-4" }) })] }), jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Press Enter or click + to add. Supports wildcards and path parameters" })] })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { children: "Users" }), jsxs("div", { className: "space-y-2", children: [selectedUsers.length > 0 ? (jsx("div", { className: "space-y-2 max-h-32 overflow-y-auto border border-gray-200 dark:border-gray-700 rounded-md p-2", children: selectedUsers.map((user) => (jsxs("div", { className: "flex items-center justify-between bg-gray-50 dark:bg-gray-800 p-2 rounded-md", children: [jsxs("div", { className: "flex flex-col", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: user.name }), jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: user.email })] }), jsx(Button$1, { type: "button", variant: "ghost", size: "sm", onClick: () => removeUser(user.id), className: "h-8 w-8 p-0 text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-900/20", "aria-label": `Remove ${user.name}`, children: jsx(X$1, { className: "h-4 w-4" }) })] }, user.id))) })) : (jsx("div", { className: "text-sm text-gray-500 dark:text-gray-400 p-3 text-center border border-dashed border-gray-300 dark:border-gray-600 rounded-md", children: "No users added" })), jsxs("div", { className: "relative", children: [jsx(Input, { value: userSearch, onChange: (e) => {
|
|
116996
117540
|
setUserSearch(e.target.value);
|
|
116997
117541
|
setShowUserSearch(e.target.value.length > 0);
|
|
116998
117542
|
}, onFocus: () => setShowUserSearch(userSearch.length > 0), placeholder: "Type to search and add users..." }), showUserSearch && availableUsers.length > 0 && (jsx("div", { className: "absolute top-full left-0 right-0 mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-48 overflow-y-auto z-50", children: availableUsers.map((user) => (jsxs("button", { type: "button", onClick: () => addUser({
|
|
116999
117543
|
id: user.user_id,
|
|
117000
117544
|
name: user.name,
|
|
117001
117545
|
email: user.email,
|
|
117002
|
-
}), className: "w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 flex flex-col", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: user.name }), jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: user.email })] }, user.user_id))) }))] })] })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { children: "Groups" }), jsxs("div", { className: "space-y-2", children: [selectedGroups.length > 0 ? (jsx("div", { className: "space-y-2 max-h-32 overflow-y-auto border border-gray-200 dark:border-gray-700 rounded-md p-2", children: selectedGroups.map((group) => (jsxs("div", { className: "flex items-center justify-between bg-gray-50 dark:bg-gray-800 p-2 rounded-md", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: group.name }), jsx(Button$1, { type: "button", variant: "ghost", size: "sm", onClick: () => removeGroup(group.id), className: "h-8 w-8 p-0 text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-900/20", "aria-label": `Remove ${group.name}`, children: jsx(X, { className: "h-4 w-4" }) })] }, group.id))) })) : (jsx("div", { className: "text-sm text-gray-500 dark:text-gray-400 p-3 text-center border border-dashed border-gray-300 dark:border-gray-600 rounded-md", children: "No groups added" })), jsxs("div", { className: "relative", children: [jsx(Input, { value: groupSearch, onChange: (e) => {
|
|
117546
|
+
}), className: "w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 flex flex-col", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: user.name }), jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: user.email })] }, user.user_id))) }))] })] })] }), jsxs("div", { className: "grid gap-1.5", children: [jsx(Label, { children: "Groups" }), jsxs("div", { className: "space-y-2", children: [selectedGroups.length > 0 ? (jsx("div", { className: "space-y-2 max-h-32 overflow-y-auto border border-gray-200 dark:border-gray-700 rounded-md p-2", children: selectedGroups.map((group) => (jsxs("div", { className: "flex items-center justify-between bg-gray-50 dark:bg-gray-800 p-2 rounded-md", children: [jsx("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: group.name }), jsx(Button$1, { type: "button", variant: "ghost", size: "sm", onClick: () => removeGroup(group.id), className: "h-8 w-8 p-0 text-red-600 hover:text-red-700 hover:bg-red-50 dark:hover:bg-red-900/20", "aria-label": `Remove ${group.name}`, children: jsx(X$1, { className: "h-4 w-4" }) })] }, group.id))) })) : (jsx("div", { className: "text-sm text-gray-500 dark:text-gray-400 p-3 text-center border border-dashed border-gray-300 dark:border-gray-600 rounded-md", children: "No groups added" })), jsxs("div", { className: "relative", children: [jsx(Input, { value: groupSearch, onChange: (e) => {
|
|
117003
117547
|
setGroupSearch(e.target.value);
|
|
117004
117548
|
setShowGroupSearch(e.target.value.length > 0);
|
|
117005
117549
|
}, onFocus: () => setShowGroupSearch(groupSearch.length > 0 || availableGroups.length > 0), placeholder: "Type to search and add groups..." }), showGroupSearch && availableGroups.length > 0 && (jsx("div", { className: "absolute top-full left-0 right-0 mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-48 overflow-y-auto z-50", children: availableGroups.map((group) => (jsx("button", { type: "button", onClick: () => addGroup({
|
|
@@ -117173,9 +117717,9 @@ function OrganizationTab({ platformKey, setOrganizationLogoFromOutside, tenant,
|
|
|
117173
117717
|
toast.success(`Help Center ${checked ? 'enabled' : 'disabled'}`);
|
|
117174
117718
|
});
|
|
117175
117719
|
};
|
|
117176
|
-
return (jsxs("div", { className: "container mx-auto max-w-7xl !mt-0", children: [jsxs("div", { className: "mb-6", children: [jsx(Label, { htmlFor: "orgName", className: "text-gray-500 dark:text-gray-400 text-base", children: "ID" }), jsx("div", { className: "flex items-center gap-2 mt-1", children: jsx("span", { className: "text-sm text-gray-600 font-semibold", children: platformKey }) })] }), jsxs("div", { className: "mb-6", children: [jsx(Label, { htmlFor: "orgName", className: "text-gray-500 dark:text-gray-400 text-base", children: "Name" }), isEditingOrg ? (jsxs("div", { className: "flex items-center gap-2 mt-1", children: [jsx(Input, { id: "orgName", value: tempOrgName, onChange: (e) => setTempOrgName(e.target.value), className: "max-w-md text-sm text-gray-600 font-semibold", placeholder: "Enter organization name", autoFocus: true }), jsxs(Button$1, { onClick: handleSaveOrg, size: "sm", disabled: !tempOrgName.trim() || isUpdatingPlatformInfo, className: "h-9 bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", children: [jsx(Check, { className: "w-4 h-4 mr-1" }), isUpdatingPlatformInfo ? 'Saving...' : 'Save'] }), jsxs(Button$1, { onClick: handleCancelOrg, variant: "outline", size: "sm", className: "h-9 bg-transparent", children: [jsx(X, { className: "w-4 h-4 mr-1" }), "Cancel"] })] })) : (jsxs("div", { className: "flex items-center gap-2 mt-1", children: [jsx("span", { className: "text-sm text-gray-600 font-semibold", children: organizationName || 'Default' }), jsx(Button$1, { onClick: handleEditOrg, variant: "ghost", size: "sm", className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground", children: jsx(SquarePen, { className: "w-3 h-3" }) })] }))] }), jsxs("div", { className: "mb-6", children: [jsx(Label, { htmlFor: "orgName", className: "text-gray-500 dark:text-gray-400 text-base", children: "Support" }), isEditingSupportEmail ? (jsxs("div", { className: "flex items-center gap-2 mt-1", children: [jsx(Input, { id: "supportEmail", value: tempSupportEmail, onChange: (e) => setTempSupportEmail(e.target.value), className: "max-w-md text-sm text-gray-600 font-semibold", placeholder: "Enter organization support address", autoFocus: true }), jsxs(Button$1, { onClick: handleSaveSupportEmail, size: "sm", disabled: !tempSupportEmail.trim() || isUpdatingTenantMetadata, className: "h-9 bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", children: [jsx(Check, { className: "w-4 h-4 mr-1" }), "Save"] }), jsxs(Button$1, { onClick: handleCancelSupportEmail, variant: "outline", size: "sm", className: "h-9 bg-transparent", children: [jsx(X, { className: "w-4 h-4 mr-1" }), "Cancel"] })] })) : (jsxs("div", { className: "flex items-center gap-2 mt-1", children: [jsx("span", { className: "text-sm text-gray-600 font-semibold", children: supportEmail }), jsx(Button$1, { onClick: handleEditSupportEmail, variant: "ghost", size: "sm", className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground", children: jsx(SquarePen, { className: "w-3 h-3" }) })] }))] }), jsxs("div", { className: "mb-6", children: [jsxs("div", { className: "flex items-center gap-3", children: [jsx(Label, { htmlFor: "helpCenterUrl", className: "text-gray-500 dark:text-gray-400 text-base", children: "Help Center" }), jsx(Switch, { checked: showHelp, onCheckedChange: handleToggleShowHelp, disabled: isUpdatingTenantMetadata, "aria-label": "Toggle Help Center visibility", className: "cursor-pointer data-[state=checked]:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50" })] }), isEditingHelpCenterUrl ? (jsxs("div", { className: "flex items-center gap-2 mt-1", children: [jsx(Input, { id: "helpCenterUrl", value: tempHelpCenterUrl, onChange: (e) => setTempHelpCenterUrl(e.target.value), className: "max-w-md text-sm font-semibold", placeholder: "Enter help center URL", autoFocus: true }), jsxs(Button$1, { onClick: handleSaveHelpCenterUrl, size: "sm",
|
|
117720
|
+
return (jsxs("div", { className: "container mx-auto max-w-7xl !mt-0", children: [jsxs("div", { className: "mb-6", children: [jsx(Label, { htmlFor: "orgName", className: "text-gray-500 dark:text-gray-400 text-base", children: "ID" }), jsx("div", { className: "flex items-center gap-2 mt-1", children: jsx("span", { className: "text-sm text-gray-600 font-semibold", children: platformKey }) })] }), jsxs("div", { className: "mb-6", children: [jsx(Label, { htmlFor: "orgName", className: "text-gray-500 dark:text-gray-400 text-base", children: "Name" }), isEditingOrg ? (jsxs("div", { className: "flex items-center gap-2 mt-1", children: [jsx(Input, { id: "orgName", value: tempOrgName, onChange: (e) => setTempOrgName(e.target.value), className: "max-w-md text-sm text-gray-600 font-semibold", placeholder: "Enter organization name", autoFocus: true }), jsxs(Button$1, { onClick: handleSaveOrg, size: "sm", disabled: !tempOrgName.trim() || isUpdatingPlatformInfo, className: "h-9 bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", children: [jsx(Check, { className: "w-4 h-4 mr-1" }), isUpdatingPlatformInfo ? 'Saving...' : 'Save'] }), jsxs(Button$1, { onClick: handleCancelOrg, variant: "outline", size: "sm", className: "h-9 bg-transparent", children: [jsx(X$1, { className: "w-4 h-4 mr-1" }), "Cancel"] })] })) : (jsxs("div", { className: "flex items-center gap-2 mt-1", children: [jsx("span", { className: "text-sm text-gray-600 font-semibold", children: organizationName || 'Default' }), jsx(Button$1, { onClick: handleEditOrg, variant: "ghost", size: "sm", className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground", children: jsx(SquarePen, { className: "w-3 h-3" }) })] }))] }), jsxs("div", { className: "mb-6", children: [jsx(Label, { htmlFor: "orgName", className: "text-gray-500 dark:text-gray-400 text-base", children: "Support" }), isEditingSupportEmail ? (jsxs("div", { className: "flex items-center gap-2 mt-1", children: [jsx(Input, { id: "supportEmail", value: tempSupportEmail, onChange: (e) => setTempSupportEmail(e.target.value), className: "max-w-md text-sm text-gray-600 font-semibold", placeholder: "Enter organization support address", autoFocus: true }), jsxs(Button$1, { onClick: handleSaveSupportEmail, size: "sm", disabled: !tempSupportEmail.trim() || isUpdatingTenantMetadata, className: "h-9 bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", children: [jsx(Check, { className: "w-4 h-4 mr-1" }), "Save"] }), jsxs(Button$1, { onClick: handleCancelSupportEmail, variant: "outline", size: "sm", className: "h-9 bg-transparent", children: [jsx(X$1, { className: "w-4 h-4 mr-1" }), "Cancel"] })] })) : (jsxs("div", { className: "flex items-center gap-2 mt-1", children: [jsx("span", { className: "text-sm text-gray-600 font-semibold", children: supportEmail }), jsx(Button$1, { onClick: handleEditSupportEmail, variant: "ghost", size: "sm", className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground", children: jsx(SquarePen, { className: "w-3 h-3" }) })] }))] }), jsxs("div", { className: "mb-6", children: [jsxs("div", { className: "flex items-center gap-3", children: [jsx(Label, { htmlFor: "helpCenterUrl", className: "text-gray-500 dark:text-gray-400 text-base", children: "Help Center" }), jsx(Switch, { checked: showHelp, onCheckedChange: handleToggleShowHelp, disabled: isUpdatingTenantMetadata, "aria-label": "Toggle Help Center visibility", className: "cursor-pointer data-[state=checked]:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50" })] }), isEditingHelpCenterUrl ? (jsxs("div", { className: "flex items-center gap-2 mt-1", children: [jsx(Input, { id: "helpCenterUrl", value: tempHelpCenterUrl, onChange: (e) => setTempHelpCenterUrl(e.target.value), className: "max-w-md text-sm font-semibold", placeholder: "Enter help center URL", autoFocus: true }), jsxs(Button$1, { onClick: handleSaveHelpCenterUrl, size: "sm",
|
|
117177
117721
|
//disabled={!tempCustomFaqUrl.trim()}
|
|
117178
|
-
className: "h-9 bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", children: [jsx(Check, { className: "w-4 h-4 mr-1" }), "Save"] }), jsxs(Button$1, { onClick: handleCancelHelpCenterUrl, variant: "outline", size: "sm", className: "h-9 bg-transparent", children: [jsx(X, { className: "w-4 h-4 mr-1" }), "Cancel"] })] })) : (jsxs("div", { className: "flex items-center gap-2 mt-1", children: [jsx("span", { className: "text-sm text-gray-600 font-semibold", children: helpCenterUrl }), jsx(Button$1, { onClick: handleEditHelpCenterUrl, variant: "ghost", size: "sm", className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground", children: jsx(SquarePen, { className: "w-3 h-3" }) })] }))] }), jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4 mb-6", children: [jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "orgName", className: "text-gray-500 dark:text-gray-400 text-base", children: "Light Logo" }), jsxs("div", { className: "flex h-[200px] w-full sm:w-[200px] flex-col items-center justify-center rounded-lg border-2 border-dashed border-gray-200 mt-3 hover:bg-gray-50 cursor-pointer", onClick: (event) => {
|
|
117722
|
+
className: "h-9 bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", children: [jsx(Check, { className: "w-4 h-4 mr-1" }), "Save"] }), jsxs(Button$1, { onClick: handleCancelHelpCenterUrl, variant: "outline", size: "sm", className: "h-9 bg-transparent", children: [jsx(X$1, { className: "w-4 h-4 mr-1" }), "Cancel"] })] })) : (jsxs("div", { className: "flex items-center gap-2 mt-1", children: [jsx("span", { className: "text-sm text-gray-600 font-semibold", children: helpCenterUrl }), jsx(Button$1, { onClick: handleEditHelpCenterUrl, variant: "ghost", size: "sm", className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground", children: jsx(SquarePen, { className: "w-3 h-3" }) })] }))] }), jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4 mb-6", children: [jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "orgName", className: "text-gray-500 dark:text-gray-400 text-base", children: "Light Logo" }), jsxs("div", { className: "flex h-[200px] w-full sm:w-[200px] flex-col items-center justify-center rounded-lg border-2 border-dashed border-gray-200 mt-3 hover:bg-gray-50 cursor-pointer", onClick: (event) => {
|
|
117179
117723
|
event.stopPropagation();
|
|
117180
117724
|
if (lightLogoInputRef.current) {
|
|
117181
117725
|
lightLogoInputRef.current.click();
|
|
@@ -117194,7 +117738,7 @@ function OrganizationTab({ platformKey, setOrganizationLogoFromOutside, tenant,
|
|
|
117194
117738
|
setOrganizationLogoFromOutside(`${LOGO_ENDPOINTS.light_logo(platformKey)}?v=${Date.now()}`);
|
|
117195
117739
|
lightLogoInputRef.current.value = '';
|
|
117196
117740
|
}
|
|
117197
|
-
}, "aria-label": "Remove image", children: jsx(X, { className: "h-3 w-3" }) })] })) : (jsx("span", { className: "text-sm text-gray-500", children: "+ Upload" })), jsx("input", { type: "file", accept: "image/*", ref: lightLogoInputRef, onChange: (event) => {
|
|
117741
|
+
}, "aria-label": "Remove image", children: jsx(X$1, { className: "h-3 w-3" }) })] })) : (jsx("span", { className: "text-sm text-gray-500", children: "+ Upload" })), jsx("input", { type: "file", accept: "image/*", ref: lightLogoInputRef, onChange: (event) => {
|
|
117198
117742
|
var _a;
|
|
117199
117743
|
const file = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
117200
117744
|
if (file) {
|
|
@@ -117219,7 +117763,7 @@ function OrganizationTab({ platformKey, setOrganizationLogoFromOutside, tenant,
|
|
|
117219
117763
|
setOrganizationDarkLogo('');
|
|
117220
117764
|
darkLogoInputRef.current.value = '';
|
|
117221
117765
|
}
|
|
117222
|
-
}, "aria-label": "Remove image", children: jsx(X, { className: "h-3 w-3" }) })] })) : (jsx("span", { className: "text-sm text-gray-500", children: "+ Upload" })), jsx("input", { type: "file", accept: "image/*", ref: darkLogoInputRef, onChange: (event) => {
|
|
117766
|
+
}, "aria-label": "Remove image", children: jsx(X$1, { className: "h-3 w-3" }) })] })) : (jsx("span", { className: "text-sm text-gray-500", children: "+ Upload" })), jsx("input", { type: "file", accept: "image/*", ref: darkLogoInputRef, onChange: (event) => {
|
|
117223
117767
|
var _a;
|
|
117224
117768
|
const file = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
117225
117769
|
if (file) {
|
|
@@ -117246,7 +117790,7 @@ function DeleteApiModal({ isOpen, onClose, apiKey, tenantKey }) {
|
|
|
117246
117790
|
//Sentry.captureException(String(error));
|
|
117247
117791
|
}
|
|
117248
117792
|
}
|
|
117249
|
-
return (jsx(Dialog, { open: isOpen, onOpenChange: onClose, children: jsxs(DialogContent$
|
|
117793
|
+
return (jsx(Dialog$1, { open: isOpen, onOpenChange: onClose, children: jsxs(DialogContent$2, { "aria-describedby": "delete-api-key-description", children: [jsx(DialogHeader, { children: jsx(DialogTitle$2, { className: "ibl-dialog-title", children: "Delete API Key" }) }), jsx("div", { className: "my-5", children: jsxs("p", { className: "text-sm text-[#646464]", children: ["Are you sure you want to delete the API Key with the name", ' ', jsx("span", { className: "font-bold italic", children: apiKey.name }), "? This action cannot be undone."] }) }), jsxs(DialogFooter, { className: "gap-3", children: [jsx(Button$1, { variant: "outline", onClick: onClose, children: "Cancel" }), jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", onClick: handleDeleteApiKey, disabled: isLoading, children: isLoading ? 'Deleting...' : 'Delete' })] })] }) }));
|
|
117250
117794
|
}
|
|
117251
117795
|
|
|
117252
117796
|
function IntegrationAutogeneratedTab({ tenantKey }) {
|
|
@@ -117266,7 +117810,7 @@ function IntegrationAutogeneratedTab({ tenantKey }) {
|
|
|
117266
117810
|
function ApiKeyModal({ isOpen, onClose, apiKey }) {
|
|
117267
117811
|
const { copy, status } = useCopyToClipboard(800);
|
|
117268
117812
|
const Icon = status === 'success' ? Check : Copy;
|
|
117269
|
-
return (jsx(Dialog, { open: isOpen, onOpenChange: onClose, children: jsxs(DialogContent$
|
|
117813
|
+
return (jsx(Dialog$1, { open: isOpen, onOpenChange: onClose, children: jsxs(DialogContent$2, { children: [jsx(DialogHeader, { children: jsx(DialogTitle$2, { className: "ibl-dialog-title", children: "API Key" }) }), jsx(DialogDescription$2, { className: "sr-only", children: "Copy and paste the API key." }), jsxs("div", { className: "grid gap-6", children: [jsxs("p", { className: "text-sm text-muted-foreground grid gap-2", children: [jsx("span", { children: "Please copy your API key and store it in a secure location. For security reasons, this key will only be displayed once and cannot be retrieved again after you leave this page." }), jsx("span", { children: "If you lose your API key, you'll need to generate a new one." })] }), jsxs("div", { className: "flex items-center gap-4", children: [jsx(Input, { defaultValue: apiKey, readOnly: true }), jsx(Button$1, { size: "icon", className: "ibl-button-primary cursor-pointer", onClick: () => copy(apiKey), children: jsx(Icon, { className: "h-4 w-4" }) })] })] })] }) }));
|
|
117270
117814
|
}
|
|
117271
117815
|
|
|
117272
117816
|
const createApiFormSchema = z$1.object({
|
|
@@ -117322,7 +117866,7 @@ function CreateApiModal({ isOpen, onClose, tenantKey, username }) {
|
|
|
117322
117866
|
}
|
|
117323
117867
|
},
|
|
117324
117868
|
});
|
|
117325
|
-
return (jsxs(Fragment$1, { children: [jsx(Dialog, { open: isOpen, onOpenChange: isLoading ? undefined : onClose, children: jsxs(DialogContent$
|
|
117869
|
+
return (jsxs(Fragment$1, { children: [jsx(Dialog$1, { open: isOpen, onOpenChange: isLoading ? undefined : onClose, children: jsxs(DialogContent$2, { "aria-describedby": "api-key-creation-description", className: "w-full max-w-md", children: [jsx(DialogDescription$2, { className: "sr-only", children: "Create API Key" }), jsx(DialogHeader, { children: jsx(DialogTitle$2, { className: "ibl-dialog-title", children: "Create API Key" }) }), jsxs("form", { onSubmit: (formEvent) => {
|
|
117326
117870
|
formEvent.preventDefault();
|
|
117327
117871
|
formEvent.stopPropagation();
|
|
117328
117872
|
form.handleSubmit();
|
|
@@ -117541,7 +118085,7 @@ function CreateLLMModal({ isOpen, onClose, tenantKey, onSuccess }) {
|
|
|
117541
118085
|
}
|
|
117542
118086
|
},
|
|
117543
118087
|
});
|
|
117544
|
-
return (jsx(Dialog, { open: isOpen, onOpenChange: isLoading ? undefined : onClose, children: jsxs(DialogContent$
|
|
118088
|
+
return (jsx(Dialog$1, { open: isOpen, onOpenChange: isLoading ? undefined : onClose, children: jsxs(DialogContent$2, { "aria-describedby": "external-provider-key-creation-description", className: "w-full max-w-md max-h-[90vh] overflow-y-auto", children: [jsx(DialogDescription$2, { className: "sr-only", children: "Add LLM Key" }), jsx(DialogHeader, { children: jsx(DialogTitle$2, { className: "ibl-dialog-title", children: "Add LLM" }) }), jsxs("form", { onSubmit: (formEvent) => {
|
|
117545
118089
|
formEvent.preventDefault();
|
|
117546
118090
|
formEvent.stopPropagation();
|
|
117547
118091
|
if (isAzureOpenAI) {
|
|
@@ -117740,7 +118284,7 @@ function CreateDataSourceModal({ isOpen, onClose, tenantKey, onSuccess }) {
|
|
|
117740
118284
|
}
|
|
117741
118285
|
},
|
|
117742
118286
|
});
|
|
117743
|
-
return (jsx(Dialog, { open: isOpen, onOpenChange: isLoading ? undefined : onClose, children: jsxs(DialogContent$
|
|
118287
|
+
return (jsx(Dialog$1, { open: isOpen, onOpenChange: isLoading ? undefined : onClose, children: jsxs(DialogContent$2, { "aria-describedby": "data-source-credential-creation-description", className: "w-full max-w-md max-h-[90vh] overflow-y-auto", children: [jsx(DialogDescription$2, { className: "sr-only", children: "Add Data Source" }), jsx(DialogHeader, { children: jsx(DialogTitle$2, { className: "ibl-dialog-title", children: "Add Data Source" }) }), jsxs("form", { onSubmit: (formEvent) => {
|
|
117744
118288
|
formEvent.preventDefault();
|
|
117745
118289
|
formEvent.stopPropagation();
|
|
117746
118290
|
form.handleSubmit();
|
|
@@ -117926,7 +118470,7 @@ function AutoRechargeModal({ isOpen, onClose, tenant }) {
|
|
|
117926
118470
|
}
|
|
117927
118471
|
return date.toLocaleDateString('en-US', options);
|
|
117928
118472
|
};
|
|
117929
|
-
return (jsx(Dialog, { open: isOpen, onOpenChange: handleClose, children: jsxs(DialogContent$
|
|
118473
|
+
return (jsx(Dialog$1, { open: isOpen, onOpenChange: handleClose, children: jsxs(DialogContent$2, { className: "max-w-md", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle$2, { children: "Manage Usage" }), jsx(DialogDescription$2, { children: "Configure automatic recharge and spending limits." })] }), isLoading ? (jsx("div", { className: "flex items-center justify-center py-8", children: jsx(LoaderCircle, { className: "h-8 w-8 animate-spin text-primary" }) })) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [jsxs("div", { className: "bg-slate-50 dark:bg-slate-800/50 rounded-lg p-4 border border-slate-200 dark:border-slate-700", children: [(parseFloat((autoRechargeInfo === null || autoRechargeInfo === void 0 ? void 0 : autoRechargeInfo.auto_recharge_total_charged_usd) || '0') > 0 ||
|
|
117930
118474
|
(autoRechargeInfo === null || autoRechargeInfo === void 0 ? void 0 : autoRechargeInfo.auto_recharge_period_ends_at)) && (jsxs("div", { className: "flex items-center justify-between gap-4 mb-4 pb-4 border-b border-slate-200 dark:border-slate-700", children: [parseFloat((autoRechargeInfo === null || autoRechargeInfo === void 0 ? void 0 : autoRechargeInfo.auto_recharge_total_charged_usd) || '0') > 0 && (jsxs("div", { className: "flex-1", children: [jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400 mb-1", children: "Total Spent" }), jsxs("div", { className: "inline-flex items-center gap-1 px-2.5 py-1 bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300 rounded-full text-sm font-medium", children: [jsx(DollarSign, { className: "h-3.5 w-3.5" }), formatCurrencyInput(autoRechargeInfo === null || autoRechargeInfo === void 0 ? void 0 : autoRechargeInfo.auto_recharge_total_charged_usd)] })] })), (autoRechargeInfo === null || autoRechargeInfo === void 0 ? void 0 : autoRechargeInfo.auto_recharge_period_ends_at) && (jsxs("div", { className: "flex-1 text-right", children: [jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400 mb-1", children: "Resets On" }), jsxs("div", { className: "inline-flex items-center gap-1 text-sm text-slate-700 dark:text-slate-300", children: [jsx(Calendar$1, { className: "h-3.5 w-3.5" }), formatLastTriggered(autoRechargeInfo.auto_recharge_period_ends_at, false)] })] }))] })), jsxs("div", { className: "flex items-center justify-between", children: [jsxs("div", { className: "space-y-1", children: [jsx(Label, { htmlFor: "auto-recharge-toggle", className: "text-sm font-medium text-slate-700 dark:text-slate-300", children: "Enable Auto Recharge" }), jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: "Automatically top up credits when balance is low" })] }), jsx(Switch, { id: "auto-recharge-toggle", checked: isEnabled, onCheckedChange: setIsEnabled, className: "data-[state=checked]:bg-blue-500" })] }), (autoRechargeInfo === null || autoRechargeInfo === void 0 ? void 0 : autoRechargeInfo.auto_recharge_last_triggered_at) && (jsxs("div", { className: "text-xs text-slate-500 dark:text-slate-400 mt-3 pt-3 border-t border-slate-200 dark:border-slate-700", children: [jsx("span", { children: "Last triggered: " }), jsx("span", { className: "font-medium", children: formatLastTriggered(autoRechargeInfo === null || autoRechargeInfo === void 0 ? void 0 : autoRechargeInfo.auto_recharge_last_triggered_at) })] }))] }), isEnabled && (jsxs(Fragment$1, { children: [jsxs("div", { className: "space-y-2", children: [jsxs("div", { className: "flex items-center justify-between", children: [jsx(Label, { htmlFor: "spending-limit", className: "text-sm font-medium", children: "Spending Limit" }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(Switch, { id: "unlimited-toggle", checked: isUnlimited, onCheckedChange: (checked) => {
|
|
117931
118475
|
setIsUnlimited(checked);
|
|
117932
118476
|
if (checked)
|
|
@@ -117965,7 +118509,7 @@ function AddCreditsModal({ isOpen, onClose, tenant }) {
|
|
|
117965
118509
|
setAmount('');
|
|
117966
118510
|
onClose();
|
|
117967
118511
|
};
|
|
117968
|
-
return (jsx(Dialog, { open: isOpen, onOpenChange: handleClose, children: jsxs(DialogContent$
|
|
118512
|
+
return (jsx(Dialog$1, { open: isOpen, onOpenChange: handleClose, children: jsxs(DialogContent$2, { className: "max-w-md", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle$2, { children: "Add Credits" }), jsx(DialogDescription$2, { children: "Add credits to your account using your payment method on file." })] }), jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "credit-amount", className: "text-sm font-medium", children: "Amount (USD)" }), jsxs("div", { className: "relative", children: [jsx(DollarSign, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400" }), jsx(Input, { id: "credit-amount", type: "number", min: "0.01", step: "0.01", placeholder: "50.00", value: amount, onChange: (e) => setAmount(e.target.value), className: "pl-9" })] }), jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: "Enter the amount you want to add to your credit balance" })] }), jsxs("div", { className: "flex items-start gap-2 p-3 bg-blue-50 dark:bg-blue-900/20 rounded-lg border border-blue-100 dark:border-blue-800", children: [jsx(CircleAlert, { className: "h-4 w-4 text-blue-500 mt-0.5 flex-shrink-0" }), jsx("p", { className: "text-xs text-blue-700 dark:text-blue-300", children: "Your payment method on file will be charged for this amount." })] }), jsxs(DialogFooter, { className: "gap-2 sm:gap-0", children: [jsx(Button$1, { type: "button", variant: "outline", onClick: handleClose, children: "Cancel" }), jsx(Button$1, { type: "submit", disabled: isLoading, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", children: isLoading ? (jsxs(Fragment$1, { children: [jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }), "Processing..."] })) : ('Add Credits') })] })] })] }) }));
|
|
117969
118513
|
}
|
|
117970
118514
|
|
|
117971
118515
|
function formatCredits(credits) {
|
|
@@ -118453,7 +118997,7 @@ const CustomDomainsContent = ({ platformKey, currentSPA, currentPlatformBaseDoma
|
|
|
118453
118997
|
toast.error('Unable to copy');
|
|
118454
118998
|
}
|
|
118455
118999
|
};
|
|
118456
|
-
return (jsxs("div", { className: "rounded-lg px-6 py-5 border border-gray-200 dark:border-gray-700", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex sm:items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-3", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "DNS Configuration" }), isFetching && !isLoading && (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500", "aria-hidden": "true" }))] }), jsxs("div", { className: "flex items-center gap-2 self-end sm:self-auto", children: [!currentDomain && (jsxs(Dialog, { open: isModalOpen, onOpenChange: setIsModalOpen, children: [jsx(DialogTrigger$
|
|
119000
|
+
return (jsxs("div", { className: "rounded-lg px-6 py-5 border border-gray-200 dark:border-gray-700", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex sm:items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-3", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "DNS Configuration" }), isFetching && !isLoading && (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500", "aria-hidden": "true" }))] }), jsxs("div", { className: "flex items-center gap-2 self-end sm:self-auto", children: [!currentDomain && (jsxs(Dialog$1, { open: isModalOpen, onOpenChange: setIsModalOpen, children: [jsx(DialogTrigger$2, { asChild: true, children: jsxs(Button$1, { type: "button", variant: "secondary", size: "sm", className: "gap-1", children: [jsx(Plus, { className: "h-4 w-4", "aria-hidden": "true" }), "Add"] }) }), jsxs(DialogContent$2, { className: "sm:max-w-[425px]", children: [jsx(DialogHeader, { children: jsx(DialogTitle$2, { children: "Your custom domain" }) }), jsxs("form", { onSubmit: handleAddCustomDomain, className: "space-y-4", children: [jsxs("div", { className: "space-y-2", children: [jsx("div", { className: "bg-blue-50 border border-blue-200 rounded-md p-3", children: jsxs("div", { className: "flex items-center gap-2", children: [jsx("div", { className: "w-4 h-4 bg-blue-400 rounded-full flex items-center justify-center", children: jsx("span", { className: "text-white text-xs", children: "!" }) }), jsx("span", { className: "text-sm text-blue-800", children: "Domain verification is necessary after making changes" })] }) }), jsxs("div", { className: "space-y-2", children: [jsx("label", { htmlFor: "custom-domain", className: "text-sm", children: "Custom Domain" }), jsx(Input, { id: "custom-domain", value: customDomainValue, onChange: (event) => setCustomDomainValue(event.target.value), placeholder: "example.com", className: "w-full", required: true })] })] }), jsxs("div", { className: "flex justify-end gap-2", children: [jsx(Button$1, { type: "button", variant: "outline", onClick: () => {
|
|
118457
119001
|
setIsModalOpen(false);
|
|
118458
119002
|
handleResetForm();
|
|
118459
119003
|
}, children: "Cancel" }), jsxs(Button$1, { className: "bg-gradient-to-r from-blue-500 to-blue-600 text-white hover:opacity-90", type: "submit", disabled: isCreating, children: [isCreating && jsx(LoaderCircle, { className: "h-4 w-4 animate-spin mr-2" }), "Save"] })] })] })] })] })), jsx("button", { onClick: () => setIsCollapsed((previous) => !previous), className: "p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1", "aria-label": isCollapsed ? 'Expand custom domain' : 'Collapse custom domain', type: "button", children: isCollapsed ? (jsx(ChevronDown, { className: "h-5 w-5 text-gray-400", "aria-hidden": "true" })) : (jsx(ChevronUp, { className: "h-5 w-5 text-gray-400", "aria-hidden": "true" })) })] })] }), !isCollapsed && (jsx("div", { className: "mt-4", children: isLoading ? (jsx("div", { className: "p-4 text-gray-500", children: "Loading custom domain..." })) : currentDomain ? (jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "flex items-center justify-between p-3 bg-gray-50 rounded-lg", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { children: currentDomain.custom_domain }), isVerifying ? (jsxs("span", { className: "px-2 py-1 text-xs bg-gray-100 text-gray-600 rounded flex items-center gap-1", children: [jsx(LoaderCircle, { className: "h-3 w-3 animate-spin" }), "Verifying..."] })) : isVerified ? (jsx("span", { className: "px-2 py-1 text-xs bg-green-100 text-green-800 rounded", children: "Verified" })) : !currentDomain.registered_with_dns_pro ? (jsx("span", { className: "px-2 py-1 text-xs bg-yellow-100 text-yellow-800 rounded", children: "Unregistered" })) : isVerified === false ? (jsx("span", { className: "px-2 py-1 text-xs bg-yellow-100 text-yellow-800 rounded", children: "Not Verified" })) : null] }), jsxs("div", { className: "flex items-center gap-2", children: [!isVerified && isVerified !== null && currentDomain.registered_with_dns_pro && (jsx(Button$1, { variant: "outline", size: "sm", onClick: () => verifyCustomDomain(currentDomain.custom_domain), disabled: isVerifying, children: isVerifying ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" })) : (jsxs(Fragment$1, { children: [jsx(RefreshCw, { className: "h-4 w-4 mr-1" }), "Retry"] })) })), jsx(Button$1, { variant: "outline", size: "sm", className: "text-red-600 hover:text-red-700", onClick: () => handleDeleteCustomDomain(currentDomain.id), disabled: deletingDomainId === currentDomain.id, children: deletingDomainId === currentDomain.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" })) : ('Delete') })] })] }), jsx("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: jsxs("div", { className: "flex items-start gap-2", children: [jsx("div", { className: "w-5 h-5 bg-blue-500 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5", children: jsx("span", { className: "text-white text-xs", children: "i" }) }), jsxs("div", { className: "space-y-2", children: [jsx("h4", { className: "font-medium text-blue-900", children: "Domain verification" }), jsx("p", { className: "text-sm text-blue-800", children: "To verify your domain ownership and enable it to point to your application, you need to add the following DNS records at your domain registrar (like Namecheap, GoDaddy, or Google Domains)." })] })] }) }), jsxs("div", { className: "space-y-4", children: [jsx("div", { className: "flex items-center justify-between", children: jsx("h5", { children: "Domain records" }) }), jsx("div", { className: "", children: jsxs(Table, { children: [jsx(TableHeader, { children: jsxs(TableRow, { children: [jsx(TableHead, { className: "w-[100px]", children: "Type" }), jsx(TableHead, { children: "Name/Host" }), jsx(TableHead, { children: "Value" }), jsx(TableHead, { className: "w-[100px]", children: "Status" })] }) }), jsx(TableBody, { children: jsxs(TableRow, { children: [jsx(TableCell, { className: "text-sm", children: "CNAME" }), jsx(TableCell, { children: jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm", children: currentDomain.custom_domain }), jsx(Button$1, { type: "button", variant: "ghost", size: "icon", className: "h-6 w-6 shrink-0", onClick: () => handleCopyField(currentDomain.custom_domain, 'name'), "aria-label": `Copy name/host: ${currentDomain.custom_domain}`, children: copiedField === 'name' ? (jsx(Check, { className: "h-4 w-4 text-blue-600", "aria-hidden": "true" })) : (jsx(Copy, { className: "h-4 w-4", "aria-hidden": "true" })) })] }) }), jsx(TableCell, { children: jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm", children: sslValue }), jsx(Button$1, { type: "button", variant: "ghost", size: "icon", className: "h-6 w-6 shrink-0", onClick: () => handleCopyField(sslValue, 'value'), "aria-label": "Copy value/target", children: copiedField === 'value' ? (jsx(Check, { className: "h-4 w-4 text-blue-600", "aria-hidden": "true" })) : (jsx(Copy, { className: "h-4 w-4", "aria-hidden": "true" })) })] }) }), jsx(TableCell, { children: isVerifying ? (jsxs("span", { className: "px-2 py-1 text-xs bg-gray-100 text-gray-600 rounded flex items-center gap-1 w-fit", children: [jsx(LoaderCircle, { className: "h-3 w-3 animate-spin" }), "Verifying..."] })) : isVerified ? (jsx("span", { className: "px-2 py-1 text-xs bg-green-100 text-green-800 rounded", children: "Verified" })) : !currentDomain.registered_with_dns_pro ? (jsx("span", { className: "px-2 py-1 text-xs bg-yellow-100 text-yellow-800 rounded", children: "Unregistered" })) : isVerified === false ? (jsxs(Button$1, { variant: "outline", size: "sm", onClick: () => verifyCustomDomain(currentDomain.custom_domain), disabled: isVerifying, className: "h-7 text-xs", children: [jsx(RefreshCw, { className: "h-3 w-3 mr-1" }), "Retry"] })) : null })] }) })] }) })] })] })) : (jsx("div", { className: "p-4 text-sm text-gray-500 text-center", children: "No custom domain configured for this application." })) }))] }));
|
|
@@ -118634,7 +119178,7 @@ const RecommendationSystemPromptsContent = ({ platformKey, currentSPA, }) => {
|
|
|
118634
119178
|
? 'Catalog'
|
|
118635
119179
|
: 'Mentor', ' ', "Prompt"] }), prompt.id === null ? (jsx("span", { className: "px-2 py-0.5 text-xs rounded bg-gray-100 text-gray-600", children: "Default" })) : (jsx("span", { className: `px-2 py-0.5 text-xs rounded ${prompt.active
|
|
118636
119180
|
? 'bg-blue-100 text-blue-800'
|
|
118637
|
-
: 'bg-gray-100 text-gray-600'}`, children: prompt.active ? 'Active' : 'Inactive' }))] }), jsx("p", { className: "text-sm text-gray-700 line-clamp-2", children: prompt.prompt_text })] }), jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => handleOpenDialog(prompt), disabled: prompt.id && deletingPromptId === prompt.id, "aria-label": prompt.id === null ? 'Create custom prompt from default' : 'Edit prompt', children: jsx(Pen, { className: "h-4 w-4", "aria-hidden": "true" }) }), prompt.id !== null && (jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => handleDelete(prompt.id), className: "text-red-600 hover:text-red-700", disabled: deletingPromptId === prompt.id, "aria-label": "Delete prompt", children: deletingPromptId === prompt.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })) }))] })] }) }, prompt.id === null ? 'default-prompt' : prompt.id))) })) })), jsx(Dialog, { open: isDialogOpen, onOpenChange: setIsDialogOpen, children: jsxs(DialogContent$
|
|
119181
|
+
: 'bg-gray-100 text-gray-600'}`, children: prompt.active ? 'Active' : 'Inactive' }))] }), jsx("p", { className: "text-sm text-gray-700 line-clamp-2", children: prompt.prompt_text })] }), jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => handleOpenDialog(prompt), disabled: prompt.id && deletingPromptId === prompt.id, "aria-label": prompt.id === null ? 'Create custom prompt from default' : 'Edit prompt', children: jsx(Pen, { className: "h-4 w-4", "aria-hidden": "true" }) }), prompt.id !== null && (jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => handleDelete(prompt.id), className: "text-red-600 hover:text-red-700", disabled: deletingPromptId === prompt.id, "aria-label": "Delete prompt", children: deletingPromptId === prompt.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })) }))] })] }) }, prompt.id === null ? 'default-prompt' : prompt.id))) })) })), jsx(Dialog$1, { open: isDialogOpen, onOpenChange: setIsDialogOpen, children: jsxs(DialogContent$2, { className: "sm:max-w-[600px]", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle$2, { children: editingPrompt ? 'Edit Prompt' : 'Add New Prompt' }), jsx(DialogDescription$2, { children: editingPrompt
|
|
118638
119182
|
? 'Update the recommendation system prompt details.'
|
|
118639
119183
|
: `Create a new ${recommendationType === recommendationPromptTypeEnum.catalog ? 'catalog' : 'mentors'} recommendation prompt.` })] }), jsx("div", { className: "space-y-4", children: jsxs("div", { children: [jsx("label", { className: "text-sm font-medium text-gray-700 mb-1 block", children: "Prompt Text *" }), jsx(Textarea, { value: formData.prompt_text, onChange: (e) => handleInputChange('prompt_text', e.target.value), placeholder: "Enter the prompt text that will guide users to relevant recommendations", className: "w-full min-h-[120px]", rows: 8 })] }) }), jsxs("div", { className: "flex justify-end gap-2 mt-4", children: [jsx(Button$1, { type: "button", variant: "outline", onClick: handleCloseDialog, disabled: isSubmitting, children: "Cancel" }), jsxs(Button$1, { className: "bg-gradient-to-r from-blue-500 to-blue-600 text-white hover:opacity-90", type: "button", onClick: handleSubmit, disabled: isSubmitting || !formData.prompt_text.trim(), children: [isSubmitting && jsx(LoaderCircle, { className: "h-4 w-4 animate-spin mr-2" }), editingPrompt ? 'Update' : 'Save'] })] })] }) })] }));
|
|
118640
119184
|
};
|
|
@@ -118952,7 +119496,7 @@ const AuthSpaCustomizationContent = ({ platformKey, currentSPA, }) => {
|
|
|
118952
119496
|
e.currentTarget.style.display = 'none';
|
|
118953
119497
|
} }) }))] })] }), jsxs("div", { className: "space-y-4", children: [jsx("h3", { className: "text-sm font-semibold text-gray-700", children: "Legal Links" }), jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "privacy_policy_url", className: "text-sm font-medium text-[#646464]", children: "Privacy Policy URL" }), jsx(Input, { id: "privacy_policy_url", value: formData.privacy_policy_url, onChange: (e) => handleFieldChange('privacy_policy_url', e.target.value), placeholder: "https://example.com/privacy-policy", className: "font-medium text-[#646464]", "aria-label": "Privacy policy URL" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "terms_of_use_url", className: "text-sm font-medium text-[#646464]", children: "Terms of Use URL" }), jsx(Input, { id: "terms_of_use_url", value: formData.terms_of_use_url, onChange: (e) => handleFieldChange('terms_of_use_url', e.target.value), placeholder: "https://example.com/terms-of-use", className: "font-medium text-[#646464]", "aria-label": "Terms of use URL" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "footer_credit", className: "text-sm font-medium text-[#646464]", children: "Footer Credit" }), jsx(Input, { id: "footer_credit", value: formData.footer_credit, onChange: (e) => handleFieldChange('footer_credit', e.target.value), placeholder: "Powered by {{logo}} in New York", className: "font-medium text-[#646464]", "aria-label": "Footer credit text" }), jsxs("p", { className: "text-xs text-gray-500", children: ["Use ", `{{logo}}`, " to display the logo, ", `{{favicon}}`, " for the favicon, and", ' ', `{{year}}`, " for the current year."] })] })] }), jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "flex items-center justify-between", children: [jsx("h3", { className: "text-sm font-semibold text-gray-700", children: "Display Images" }), jsxs(Button$1, { type: "button", variant: "outline", size: "sm", onClick: handleAddDisplayImage, "aria-label": "Add display image", children: [jsx(Plus, { className: "h-4 w-4 mr-2", "aria-hidden": "true" }), "Add Image"] })] }), formData.display_images.length === 0 ? (jsxs("div", { className: "text-center py-8 border-2 border-dashed rounded-lg text-gray-500", children: [jsx(Image$2, { className: "h-12 w-12 mx-auto mb-2 text-gray-400", "aria-hidden": "true" }), jsx("p", { className: "text-sm", children: "No display images added yet" }), jsx(Button$1, { type: "button", variant: "link", onClick: handleAddDisplayImage, className: "mt-2", "aria-label": "Add first display image", children: "Add your first image" })] })) : (jsx("div", { className: "space-y-4", children: formData.display_images.map((img, index) => (jsxs("div", { className: "p-4 border rounded-lg space-y-3 bg-gray-50", children: [jsxs("div", { className: "flex items-center justify-between", children: [jsxs(Label, { className: "text-sm font-medium text-[#646464]", children: ["Display Image ", index + 1] }), jsx(Button$1, { type: "button", variant: "ghost", size: "sm", onClick: () => handleRemoveDisplayImage(index), className: "text-red-600 hover:text-red-700 hover:bg-red-50", "aria-label": `Remove display image ${index + 1}`, children: jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" }) })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: `image-url-${index}`, className: "text-xs text-gray-600", children: "Image URL or Upload" }), jsxs("div", { className: "flex gap-2", children: [jsx(Input, { id: `image-url-${index}`, value: img.image, onChange: (e) => handleDisplayImageChange(index, 'image', e.target.value), placeholder: "https://example.com/image.png", className: "flex-1 font-medium text-[#646464]", "aria-label": `Image ${index + 1} URL` }), jsxs("div", { children: [jsx("input", { type: "file", id: `image-upload-${index}`, accept: "image/*", onChange: (e) => handleDisplayImageUpload(index, e), className: "hidden", "aria-label": `Upload image ${index + 1}`, "aria-hidden": "true", disabled: uploadingImageIndex === index }), jsx(Button$1, { type: "button", variant: "outline", onClick: () => { var _a; return (_a = document.getElementById(`image-upload-${index}`)) === null || _a === void 0 ? void 0 : _a.click(); }, "aria-label": `Upload image ${index + 1}`, disabled: uploadingImageIndex === index, children: uploadingImageIndex === index ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Upload, { className: "h-4 w-4", "aria-hidden": "true" })) })] })] }), img.image && (jsx("div", { className: "mt-2 p-2 border rounded-lg bg-white", children: jsx("img", { src: img.image, alt: img.alt || `Display image ${index + 1}`, className: "h-24 w-auto object-contain mx-auto", onError: (e) => {
|
|
118954
119498
|
e.currentTarget.style.display = 'none';
|
|
118955
|
-
} }) }))] }), jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: `image-alt-${index}`, className: "text-xs text-gray-600", children: "Alt Text (for accessibility)" }), jsx(Input, { id: `image-alt-${index}`, value: img.alt, onChange: (e) => handleDisplayImageChange(index, 'alt', e.target.value), className: "font-medium text-[#646464]", "aria-label": `Image ${index + 1} alt text` })] })] }, index))) }))] }), jsxs("div", { className: "flex items-center justify-end gap-3 pt-4 border-t", children: [hasChanges && (jsxs(Button$1, { type: "button", variant: "outline", onClick: handleReset, disabled: isSaving, "aria-label": "Discard changes", children: [jsx(X, { className: "h-4 w-4 mr-2" }), "Discard"] })), jsx(Button$1, { type: "button", onClick: handleSave, disabled: isSaving || !hasChanges, className: "bg-blue-500 hover:bg-blue-600", "aria-label": "Save auth SPA customization", children: isSaving ? (jsxs(Fragment$1, { children: [jsx("div", { className: "w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin mr-2" }), "Saving..."] })) : (jsxs(Fragment$1, { children: [jsx(Save, { className: "h-4 w-4 mr-2" }), "Save"] })) })] })] }))] }));
|
|
119499
|
+
} }) }))] }), jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: `image-alt-${index}`, className: "text-xs text-gray-600", children: "Alt Text (for accessibility)" }), jsx(Input, { id: `image-alt-${index}`, value: img.alt, onChange: (e) => handleDisplayImageChange(index, 'alt', e.target.value), className: "font-medium text-[#646464]", "aria-label": `Image ${index + 1} alt text` })] })] }, index))) }))] }), jsxs("div", { className: "flex items-center justify-end gap-3 pt-4 border-t", children: [hasChanges && (jsxs(Button$1, { type: "button", variant: "outline", onClick: handleReset, disabled: isSaving, "aria-label": "Discard changes", children: [jsx(X$1, { className: "h-4 w-4 mr-2" }), "Discard"] })), jsx(Button$1, { type: "button", onClick: handleSave, disabled: isSaving || !hasChanges, className: "bg-blue-500 hover:bg-blue-600", "aria-label": "Save auth SPA customization", children: isSaving ? (jsxs(Fragment$1, { children: [jsx("div", { className: "w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin mr-2" }), "Saving..."] })) : (jsxs(Fragment$1, { children: [jsx(Save, { className: "h-4 w-4 mr-2" }), "Save"] })) })] })] }))] }));
|
|
118956
119500
|
};
|
|
118957
119501
|
|
|
118958
119502
|
function ChatAreaWidth({ chatAreaSize, isUpdating, onUpdate, onError }) {
|
|
@@ -119305,7 +119849,7 @@ const AdvancedCssContent = ({ platformKey, currentSPA }) => {
|
|
|
119305
119849
|
padding: 16px;
|
|
119306
119850
|
}`, rows: 15, className: "font-mono text-sm text-[#646464] resize-y", "aria-label": "Custom CSS input", "aria-describedby": "css-validation-status", spellCheck: false }), jsx("p", { className: "text-xs text-gray-500", children: "Enter valid CSS to customize the appearance of your platform. The CSS will be applied globally." })] }), jsx("div", { id: "css-validation-status", className: "space-y-2", children: cssValue.trim() && (showValidation || !validationResult.isValid) && (jsx("div", { className: `flex items-start gap-2 p-3 rounded-lg transition-opacity duration-300 ${validationResult.isValid
|
|
119307
119851
|
? 'bg-green-50 border border-green-200'
|
|
119308
|
-
: 'bg-red-50 border border-red-200'}`, children: validationResult.isValid ? (jsxs(Fragment$1, { children: [jsx(CircleCheckBig, { className: "h-4 w-4 text-green-600 mt-0.5 flex-shrink-0" }), jsx("span", { className: "text-sm text-green-700", children: "CSS syntax is valid" })] })) : (jsxs("div", { className: "flex-1", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx(CircleAlert, { className: "h-4 w-4 text-red-600 flex-shrink-0" }), jsx("span", { className: "text-sm font-medium text-red-700", children: "CSS validation errors:" })] }), jsx("ul", { className: "mt-2 space-y-1 ml-6", children: validationResult.errors.map((error, index) => (jsx("li", { className: "text-sm text-red-600 list-disc", children: error }, index))) })] })) })) })] }), jsxs("div", { className: "flex items-center justify-end gap-3 pt-4 border-t", children: [hasChanges && (jsxs(Button$1, { type: "button", variant: "outline", onClick: handleReset, disabled: isSaving, "aria-label": "Discard changes", children: [jsx(X, { className: "h-4 w-4 mr-2" }), "Discard"] })), jsx(Button$1, { type: "button", onClick: handleSave, disabled: isSaving || !hasChanges || !validationResult.isValid, className: "bg-blue-500 hover:bg-blue-600", "aria-label": "Save advanced CSS", children: isSaving ? (jsxs(Fragment$1, { children: [jsx("div", { className: "w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin mr-2" }), "Saving..."] })) : (jsxs(Fragment$1, { children: [jsx(Save, { className: "h-4 w-4 mr-2" }), "Save"] })) })] })] }))] }));
|
|
119852
|
+
: 'bg-red-50 border border-red-200'}`, children: validationResult.isValid ? (jsxs(Fragment$1, { children: [jsx(CircleCheckBig, { className: "h-4 w-4 text-green-600 mt-0.5 flex-shrink-0" }), jsx("span", { className: "text-sm text-green-700", children: "CSS syntax is valid" })] })) : (jsxs("div", { className: "flex-1", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx(CircleAlert, { className: "h-4 w-4 text-red-600 flex-shrink-0" }), jsx("span", { className: "text-sm font-medium text-red-700", children: "CSS validation errors:" })] }), jsx("ul", { className: "mt-2 space-y-1 ml-6", children: validationResult.errors.map((error, index) => (jsx("li", { className: "text-sm text-red-600 list-disc", children: error }, index))) })] })) })) })] }), jsxs("div", { className: "flex items-center justify-end gap-3 pt-4 border-t", children: [hasChanges && (jsxs(Button$1, { type: "button", variant: "outline", onClick: handleReset, disabled: isSaving, "aria-label": "Discard changes", children: [jsx(X$1, { className: "h-4 w-4 mr-2" }), "Discard"] })), jsx(Button$1, { type: "button", onClick: handleSave, disabled: isSaving || !hasChanges || !validationResult.isValid, className: "bg-blue-500 hover:bg-blue-600", "aria-label": "Save advanced CSS", children: isSaving ? (jsxs(Fragment$1, { children: [jsx("div", { className: "w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin mr-2" }), "Saving..."] })) : (jsxs(Fragment$1, { children: [jsx(Save, { className: "h-4 w-4 mr-2" }), "Save"] })) })] })] }))] }));
|
|
119309
119853
|
};
|
|
119310
119854
|
|
|
119311
119855
|
const normalizeProviderConfigs$1 = (response) => {
|
|
@@ -119460,11 +120004,11 @@ const ProviderConfigContent = ({ platformKey, username }) => {
|
|
|
119460
120004
|
return dateString;
|
|
119461
120005
|
}
|
|
119462
120006
|
};
|
|
119463
|
-
return (jsxs("div", { className: "rounded-lg px-6 py-5 border border-gray-200 dark:border-gray-700", style: { borderColor: 'oklch(.922 0 0)' }, role: "region", "aria-label": "Provider Configuration", children: [jsxs("div", { className: "flex sm:items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-3", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "Provider Configuration" }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { "aria-label": "More info about Provider Configuration", className: "hidden sm:block", children: jsx(Info, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium whitespace-nowrap text-white shadow-sm transition-opacity duration-300 z-50", children: jsx("p", { children: "Configure external credential providers for your platform" }) })] }) }), isFetching && !isLoading && (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500", "aria-hidden": "true" }))] }), jsxs("div", { className: "flex items-center gap-2 self-end sm:self-auto", children: [jsxs(Dialog, { open: isModalOpen, onOpenChange: (open) => {
|
|
120007
|
+
return (jsxs("div", { className: "rounded-lg px-6 py-5 border border-gray-200 dark:border-gray-700", style: { borderColor: 'oklch(.922 0 0)' }, role: "region", "aria-label": "Provider Configuration", children: [jsxs("div", { className: "flex sm:items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-3", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "Provider Configuration" }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { "aria-label": "More info about Provider Configuration", className: "hidden sm:block", children: jsx(Info, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium whitespace-nowrap text-white shadow-sm transition-opacity duration-300 z-50", children: jsx("p", { children: "Configure external credential providers for your platform" }) })] }) }), isFetching && !isLoading && (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500", "aria-hidden": "true" }))] }), jsxs("div", { className: "flex items-center gap-2 self-end sm:self-auto", children: [jsxs(Dialog$1, { open: isModalOpen, onOpenChange: (open) => {
|
|
119464
120008
|
setIsModalOpen(open);
|
|
119465
120009
|
if (!open)
|
|
119466
120010
|
handleResetForm();
|
|
119467
|
-
}, children: [jsx(DialogTrigger$
|
|
120011
|
+
}, children: [jsx(DialogTrigger$2, { asChild: true, children: jsxs(Button$1, { type: "button", variant: "secondary", size: "sm", className: "gap-1", onClick: handleOpenAddModal, children: [jsx(Plus, { className: "h-4 w-4", "aria-hidden": "true" }), "Add"] }) }), jsxs(DialogContent$2, { className: "sm:max-w-[500px]", children: [jsx(DialogHeader, { children: jsx(DialogTitle$2, { children: editingConfig ? 'Edit Provider Configuration' : 'Add Provider Configuration' }) }), jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "provider-name", children: "Provider Name" }), jsx(Input, { id: "provider-name", value: providerName, onChange: (e) => setProviderName(e.target.value), placeholder: "e.g., accredible", disabled: !!editingConfig, className: editingConfig ? 'bg-gray-100 cursor-not-allowed' : '', required: true }), editingConfig && (jsx("p", { className: "text-xs text-gray-500", children: "Provider name cannot be changed when editing" }))] }), jsxs("div", { className: "space-y-2", children: [jsxs(Label, { htmlFor: "config-json", children: ["Configuration (JSON)", ' ', jsx("span", { className: "text-gray-400 font-normal", children: "- Optional" })] }), jsx(Textarea, { id: "config-json", value: configJson, onChange: (e) => handleConfigJsonChange(e.target.value), placeholder: '{"api_key": "your-api-key", "base_url": "https://api.example.com/"}', rows: 8, className: `font-mono text-sm ${jsonError ? 'border-red-500' : ''}` }), jsonError && (jsx("p", { className: "text-xs text-red-500", role: "alert", children: jsonError })), jsx("p", { className: "text-xs text-gray-500", children: "Provider-specific settings in JSON format. Leave empty if not required." })] }), jsxs("div", { className: "flex items-center justify-between", children: [jsx(Label, { htmlFor: "provider-enabled", className: "text-sm", children: "Enabled" }), jsx(Switch, { id: "provider-enabled", checked: isEnabled, onCheckedChange: setIsEnabled, "aria-label": `Provider ${isEnabled ? 'enabled' : 'disabled'}`, className: "cursor-pointer data-[state=checked]:bg-blue-500" })] }), jsxs("div", { className: "flex justify-end gap-2 pt-2", children: [jsx(Button$1, { type: "button", variant: "outline", onClick: () => {
|
|
119468
120012
|
setIsModalOpen(false);
|
|
119469
120013
|
handleResetForm();
|
|
119470
120014
|
}, children: "Cancel" }), jsxs(Button$1, { className: "bg-gradient-to-r from-blue-500 to-blue-600 text-white hover:opacity-90", type: "submit", disabled: isCreating || !!jsonError, children: [isCreating && jsx(LoaderCircle, { className: "h-4 w-4 animate-spin mr-2" }), editingConfig ? 'Update' : 'Create'] })] })] })] })] }), jsx("button", { onClick: () => setIsCollapsed((previous) => !previous), className: "p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1", "aria-label": isCollapsed ? 'Expand provider configuration' : 'Collapse provider configuration', type: "button", children: isCollapsed ? (jsx(ChevronDown, { className: "h-5 w-5 text-gray-400", "aria-hidden": "true" })) : (jsx(ChevronUp, { className: "h-5 w-5 text-gray-400", "aria-hidden": "true" })) })] })] }), !isCollapsed && (jsx("div", { className: "mt-4", children: isLoading ? (jsxs("div", { className: "p-4 text-gray-500 text-center", children: [jsx(LoaderCircle, { className: "h-5 w-5 animate-spin inline-block mr-2" }), "Loading provider configurations..."] })) : activeConfigs.length > 0 ? (jsx("div", { className: "overflow-x-auto", children: jsxs(Table, { children: [jsx(TableHeader, { children: jsxs(TableRow, { children: [jsx(TableHead, { children: "Provider" }), jsx(TableHead, { children: "Configuration" }), jsx(TableHead, { children: "Status" }), jsx(TableHead, { children: "Updated" }), jsx(TableHead, { className: "text-right", children: "Actions" })] }) }), jsx(TableBody, { children: activeConfigs.map((config) => (jsxs(TableRow, { children: [jsx(TableCell, { className: "font-medium", children: config.provider_name_display || config.provider_name }), jsx(TableCell, { children: jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsxs("code", { className: "text-xs bg-gray-100 px-2 py-1 rounded cursor-help", children: [Object.keys(config.config || {}).length, " key(s)"] }) }), jsx(TooltipContent, { className: "max-w-sm", children: jsx("pre", { className: "text-xs whitespace-pre-wrap", children: JSON.stringify(config.config, null, 2) }) })] }) }) }), jsx(TableCell, { children: jsx("span", { className: `px-2 py-1 text-xs rounded ${config.enabled
|
|
@@ -119685,11 +120229,11 @@ const ExternalMappingContent = ({ platformKey, username }) => {
|
|
|
119685
120229
|
const credential = credentials.find((c) => c.entity_id === entityId);
|
|
119686
120230
|
return (credential === null || credential === void 0 ? void 0 : credential.name) || entityId;
|
|
119687
120231
|
};
|
|
119688
|
-
return (jsxs("div", { className: "rounded-lg px-6 py-5 border border-gray-200 dark:border-gray-700", style: { borderColor: 'oklch(.922 0 0)' }, role: "region", "aria-label": "External Credential Mapping", children: [jsxs("div", { className: "flex sm:items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-3", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "External Credential Mapping" }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { "aria-label": "More info about External Credential Mapping", className: "hidden sm:block", children: jsx(Info, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium whitespace-nowrap text-white shadow-sm transition-opacity duration-300 z-50", children: jsx("p", { children: "Map credentials to external provider templates (e.g., Accredible)" }) })] }) }), isFetching && !isLoading && (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500", "aria-hidden": "true" }))] }), jsxs("div", { className: "flex items-center gap-2 self-end sm:self-auto", children: [jsxs(Dialog, { open: isModalOpen, onOpenChange: (open) => {
|
|
120232
|
+
return (jsxs("div", { className: "rounded-lg px-6 py-5 border border-gray-200 dark:border-gray-700", style: { borderColor: 'oklch(.922 0 0)' }, role: "region", "aria-label": "External Credential Mapping", children: [jsxs("div", { className: "flex sm:items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-3", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "External Credential Mapping" }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { "aria-label": "More info about External Credential Mapping", className: "hidden sm:block", children: jsx(Info, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium whitespace-nowrap text-white shadow-sm transition-opacity duration-300 z-50", children: jsx("p", { children: "Map credentials to external provider templates (e.g., Accredible)" }) })] }) }), isFetching && !isLoading && (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500", "aria-hidden": "true" }))] }), jsxs("div", { className: "flex items-center gap-2 self-end sm:self-auto", children: [jsxs(Dialog$1, { open: isModalOpen, onOpenChange: (open) => {
|
|
119689
120233
|
setIsModalOpen(open);
|
|
119690
120234
|
if (!open)
|
|
119691
120235
|
handleResetForm();
|
|
119692
|
-
}, children: [jsx(DialogTrigger$
|
|
120236
|
+
}, children: [jsx(DialogTrigger$2, { asChild: true, children: jsxs(Button$1, { type: "button", variant: "secondary", size: "sm", className: "gap-1", onClick: handleOpenAddModal, children: [jsx(Plus, { className: "h-4 w-4", "aria-hidden": "true" }), "Add"] }) }), jsxs(DialogContent$2, { className: "sm:max-w-[500px]", children: [jsx(DialogHeader, { children: jsx(DialogTitle$2, { children: editingMapping ? 'Edit External Mapping' : 'Add External Mapping' }) }), jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "credential-select", children: "Credential" }), jsxs(Select$1, { value: credentialId, onValueChange: setCredentialId, disabled: !!editingMapping, children: [jsx(SelectTrigger, { id: "credential-select", className: editingMapping ? 'bg-gray-100 cursor-not-allowed' : '', children: jsx(SelectValue, { placeholder: "Select a credential", children: credentialId ? getCredentialName(credentialId) : '' }) }), jsxs(SelectContent, { children: [jsx("div", { className: "p-2", onPointerDown: (e) => e.stopPropagation(), children: jsx(Input, { placeholder: "Search credentials...", value: credentialSearchQuery, onChange: (e) => setCredentialSearchQuery(e.target.value), onKeyDown: (e) => e.stopPropagation(), className: "mb-2" }) }), isLoadingCredentials ? (jsx(SelectItem, { value: "loading", disabled: true, children: "Loading credentials..." })) : credentials.length > 0 ? (credentials.map((cred) => (jsx(SelectItem, { value: cred.entity_id, children: cred.name }, cred.entity_id)))) : (jsx(SelectItem, { value: "no-results", disabled: true, children: "No credentials found" }))] })] }), editingMapping && (jsx("p", { className: "text-xs text-gray-500", children: "Credential cannot be changed when editing" }))] }), jsxs("div", { className: "space-y-2", children: [jsx(Label, { htmlFor: "provider-select", children: "Provider" }), jsxs(Select$1, { value: providerName, onValueChange: setProviderName, disabled: !!editingMapping, children: [jsx(SelectTrigger, { id: "provider-select", className: editingMapping ? 'bg-gray-100 cursor-not-allowed' : '', children: jsx(SelectValue, { placeholder: "Select a provider" }) }), jsx(SelectContent, { children: providerConfigs.length > 0 ? (providerConfigs.map((config) => (jsx(SelectItem, { value: config.provider_name, children: config.provider_name_display || config.provider_name }, config.provider_name)))) : (jsx(SelectItem, { value: "no-providers", disabled: true, children: "No providers configured" })) })] }), editingMapping && (jsx("p", { className: "text-xs text-gray-500", children: "Provider cannot be changed when editing" })), providerConfigs.length === 0 && !editingMapping && (jsx("p", { className: "text-xs text-amber-600", children: "Configure a provider first in Provider Configuration" }))] }), jsxs("div", { className: "space-y-2", children: [jsxs(Label, { htmlFor: "external-template-id", children: ["External Template ID", ' ', jsx("span", { className: "text-gray-400 font-normal", children: "- Optional" })] }), jsx(Input, { id: "external-template-id", value: externalTemplateId, onChange: (e) => setExternalTemplateId(e.target.value), placeholder: "e.g., 123456789" }), jsx("p", { className: "text-xs text-gray-500", children: "The template ID in the external system (e.g., Accredible template ID)" })] }), jsxs("div", { className: "space-y-2", children: [jsxs(Label, { htmlFor: "group-id", children: ["Group ID ", jsx("span", { className: "text-gray-400 font-normal", children: "- Optional" })] }), jsx(Input, { id: "group-id", value: groupId, onChange: (e) => setGroupId(e.target.value), placeholder: "e.g., 679866" }), jsx("p", { className: "text-xs text-gray-500", children: "Overrides the group ID from provider config for this mapping" })] }), jsxs("div", { className: "space-y-2", children: [jsxs(Label, { htmlFor: "metadata-json", children: ["Metadata (JSON) ", jsx("span", { className: "text-gray-400 font-normal", children: "- Optional" })] }), jsx(Textarea, { id: "metadata-json", value: metadataJson, onChange: (e) => handleMetadataJsonChange(e.target.value), placeholder: '{"notes": "Additional information"}', rows: 4, className: `font-mono text-sm ${jsonError ? 'border-red-500' : ''}` }), jsonError && (jsx("p", { className: "text-xs text-red-500", role: "alert", children: jsonError }))] }), jsxs("div", { className: "flex justify-end gap-2 pt-2", children: [jsx(Button$1, { type: "button", variant: "outline", onClick: () => {
|
|
119693
120237
|
setIsModalOpen(false);
|
|
119694
120238
|
handleResetForm();
|
|
119695
120239
|
}, children: "Cancel" }), jsxs(Button$1, { className: "bg-gradient-to-r from-blue-500 to-blue-600 text-white hover:opacity-90", type: "submit", disabled: isCreating || !!jsonError || providerConfigs.length === 0, children: [isCreating && jsx(LoaderCircle, { className: "h-4 w-4 animate-spin mr-2" }), editingMapping ? 'Update' : 'Create'] })] })] })] })] }), jsx("button", { onClick: () => setIsCollapsed((previous) => !previous), className: "p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1", "aria-label": isCollapsed ? 'Expand external mapping' : 'Collapse external mapping', type: "button", children: isCollapsed ? (jsx(ChevronDown, { className: "h-5 w-5 text-gray-400", "aria-hidden": "true" })) : (jsx(ChevronUp, { className: "h-5 w-5 text-gray-400", "aria-hidden": "true" })) })] })] }), !isCollapsed && (jsx("div", { className: "mt-4", children: isLoading ? (jsxs("div", { className: "p-4 text-gray-500 text-center", children: [jsx(LoaderCircle, { className: "h-5 w-5 animate-spin inline-block mr-2" }), "Loading external mappings..."] })) : externalMappings.length > 0 ? (jsx("div", { className: "overflow-x-auto", children: jsxs(Table, { children: [jsx(TableHeader, { children: jsxs(TableRow, { children: [jsx(TableHead, { children: "Credential" }), jsx(TableHead, { children: "Provider" }), jsx(TableHead, { children: "Template ID" }), jsx(TableHead, { children: "Group ID" }), jsx(TableHead, { children: "Updated" }), jsx(TableHead, { className: "text-right", children: "Actions" })] }) }), jsx(TableBody, { children: externalMappings.map((mapping) => {
|
|
@@ -120030,12 +120574,12 @@ function PriceForm({ form, onChange, onSave, onCancel, isSaving, isEdit, }) {
|
|
|
120030
120574
|
const handleRemoveFeature = (index) => {
|
|
120031
120575
|
onChange({ ...form, features: form.features.filter((_, i) => i !== index) });
|
|
120032
120576
|
};
|
|
120033
|
-
return (jsx(Card, { className: "shadow-sm border border-blue-200 bg-blue-50/30", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4 space-y-3", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [jsxs("div", { children: [jsx(Label, { className: "text-xs text-gray-500", children: "Name *" }), jsx(Input, { value: form.name, onChange: (e) => onChange({ ...form, name: e.target.value }), placeholder: "e.g. Monthly Plan", className: "mt-1" })] }), jsxs("div", { children: [jsx(Label, { className: "text-xs text-gray-500", children: "Amount (USD) *" }), jsx(Input, { type: "number", min: 0, step: "0.01", value: form.amount, onChange: (e) => onChange({ ...form, amount: e.target.value }), placeholder: "9.99", className: "mt-1" })] }), jsxs("div", { children: [jsx(Label, { className: "text-xs text-gray-500", children: "Interval" }), jsxs(Select$1, { value: form.interval, onValueChange: (v) => onChange({ ...form, interval: v }), children: [jsx(SelectTrigger, { className: "mt-1", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "month", children: "Monthly" }), jsx(SelectItem, { value: "year", children: "Yearly" }), jsx(SelectItem, { value: "one_time", children: "One-Time" })] })] })] }), jsxs("div", { children: [jsx(Label, { className: "text-xs text-gray-500", children: "Currency" }), jsx(Input, { value: form.currency, disabled: true, className: "mt-1 bg-gray-50 text-gray-500 cursor-not-allowed" })] })] }), jsxs("div", { children: [jsx(Label, { className: "text-xs text-gray-500", children: "Description" }), jsx(Input, { value: form.description, onChange: (e) => onChange({ ...form, description: e.target.value }), placeholder: "Optional description", className: "mt-1" })] }), jsxs("div", { children: [jsx(Label, { className: "text-xs text-gray-500", children: "Features" }), form.features.length > 0 && (jsx("div", { className: "flex flex-wrap gap-1.5 mt-1.5 mb-1.5", children: form.features.map((feature, i) => (jsxs(Badge, { variant: "secondary", className: "text-xs font-normal pl-2 pr-1 py-0.5 flex items-center gap-1", children: [feature, jsx("button", { type: "button", onClick: () => handleRemoveFeature(i), className: "hover:bg-gray-300 rounded-full p-0.5 transition-colors cursor-pointer", children: jsx(X, { className: "h-2.5 w-2.5" }) })] }, i))) })), jsxs("div", { className: "flex gap-1.5 mt-1", children: [jsx(Input, { value: featureInput, onChange: (e) => setFeatureInput(e.target.value), onKeyDown: (e) => {
|
|
120577
|
+
return (jsx(Card, { className: "shadow-sm border border-blue-200 bg-blue-50/30", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4 space-y-3", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [jsxs("div", { children: [jsx(Label, { className: "text-xs text-gray-500", children: "Name *" }), jsx(Input, { value: form.name, onChange: (e) => onChange({ ...form, name: e.target.value }), placeholder: "e.g. Monthly Plan", className: "mt-1" })] }), jsxs("div", { children: [jsx(Label, { className: "text-xs text-gray-500", children: "Amount (USD) *" }), jsx(Input, { type: "number", min: 0, step: "0.01", value: form.amount, onChange: (e) => onChange({ ...form, amount: e.target.value }), placeholder: "9.99", className: "mt-1" })] }), jsxs("div", { children: [jsx(Label, { className: "text-xs text-gray-500", children: "Interval" }), jsxs(Select$1, { value: form.interval, onValueChange: (v) => onChange({ ...form, interval: v }), children: [jsx(SelectTrigger, { className: "mt-1", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "month", children: "Monthly" }), jsx(SelectItem, { value: "year", children: "Yearly" }), jsx(SelectItem, { value: "one_time", children: "One-Time" })] })] })] }), jsxs("div", { children: [jsx(Label, { className: "text-xs text-gray-500", children: "Currency" }), jsx(Input, { value: form.currency, disabled: true, className: "mt-1 bg-gray-50 text-gray-500 cursor-not-allowed" })] })] }), jsxs("div", { children: [jsx(Label, { className: "text-xs text-gray-500", children: "Description" }), jsx(Input, { value: form.description, onChange: (e) => onChange({ ...form, description: e.target.value }), placeholder: "Optional description", className: "mt-1" })] }), jsxs("div", { children: [jsx(Label, { className: "text-xs text-gray-500", children: "Features" }), form.features.length > 0 && (jsx("div", { className: "flex flex-wrap gap-1.5 mt-1.5 mb-1.5", children: form.features.map((feature, i) => (jsxs(Badge, { variant: "secondary", className: "text-xs font-normal pl-2 pr-1 py-0.5 flex items-center gap-1", children: [feature, jsx("button", { type: "button", onClick: () => handleRemoveFeature(i), className: "hover:bg-gray-300 rounded-full p-0.5 transition-colors cursor-pointer", children: jsx(X$1, { className: "h-2.5 w-2.5" }) })] }, i))) })), jsxs("div", { className: "flex gap-1.5 mt-1", children: [jsx(Input, { value: featureInput, onChange: (e) => setFeatureInput(e.target.value), onKeyDown: (e) => {
|
|
120034
120578
|
if (e.key === 'Enter') {
|
|
120035
120579
|
e.preventDefault();
|
|
120036
120580
|
handleAddFeature();
|
|
120037
120581
|
}
|
|
120038
|
-
}, placeholder: "Add a feature...", className: "flex-1" }), jsx(Button$1, { type: "button", onClick: handleAddFeature, disabled: !featureInput.trim(), variant: "outline", size: "sm", className: "h-9 px-2 cursor-pointer", children: jsx(Plus, { className: "h-3.5 w-3.5" }) })] })] }), jsx("div", { className: "flex items-center justify-between pt-2", children: jsxs("div", { className: "flex gap-2", children: [jsxs(Button$1, { onClick: onSave, disabled: isSaving || !form.name.trim() || !form.amount, size: "sm", className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white cursor-pointer", children: [isSaving ? (jsx(LoaderCircle, { className: "h-3 w-3 mr-1 animate-spin" })) : (jsx(Check, { className: "h-3 w-3 mr-1" })), isEdit ? 'Update' : 'Create'] }), jsxs(Button$1, { onClick: onCancel, variant: "outline", size: "sm", className: "cursor-pointer", children: [jsx(X, { className: "h-3 w-3 mr-1" }), "Cancel"] })] }) })] }) }));
|
|
120582
|
+
}, placeholder: "Add a feature...", className: "flex-1" }), jsx(Button$1, { type: "button", onClick: handleAddFeature, disabled: !featureInput.trim(), variant: "outline", size: "sm", className: "h-9 px-2 cursor-pointer", children: jsx(Plus, { className: "h-3.5 w-3.5" }) })] })] }), jsx("div", { className: "flex items-center justify-between pt-2", children: jsxs("div", { className: "flex gap-2", children: [jsxs(Button$1, { onClick: onSave, disabled: isSaving || !form.name.trim() || !form.amount, size: "sm", className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white cursor-pointer", children: [isSaving ? (jsx(LoaderCircle, { className: "h-3 w-3 mr-1 animate-spin" })) : (jsx(Check, { className: "h-3 w-3 mr-1" })), isEdit ? 'Update' : 'Create'] }), jsxs(Button$1, { onClick: onCancel, variant: "outline", size: "sm", className: "cursor-pointer", children: [jsx(X$1, { className: "h-3 w-3 mr-1" }), "Cancel"] })] }) })] }) }));
|
|
120039
120583
|
}
|
|
120040
120584
|
// ── Main Component ──
|
|
120041
120585
|
function PriceManagement({ platformKey, itemType, itemId }) {
|
|
@@ -120486,11 +121030,11 @@ function UserProfileModal({ isOpen, onClose, params, billingEnabled = false, bil
|
|
|
120486
121030
|
setStripeTopUpURL(topUpURL);
|
|
120487
121031
|
}
|
|
120488
121032
|
}, [topUpURL, topUpEnabled]);
|
|
120489
|
-
return (jsx(Fragment$1, { children: jsx(Dialog, { open: isOpen, onOpenChange: () => {
|
|
121033
|
+
return (jsx(Fragment$1, { children: jsx(Dialog$1, { open: isOpen, onOpenChange: () => {
|
|
120490
121034
|
if (!isInviteUserDialogOpen) {
|
|
120491
121035
|
onClose();
|
|
120492
121036
|
}
|
|
120493
|
-
}, children: jsxs(DialogContent$
|
|
121037
|
+
}, children: jsxs(DialogContent$2, { autoFocus: false, forceMount: true, className: "max-w-7xl w-[85vw] p-0 gap-0 overflow-hidden bg-white profile-component-dialog", style: { height: '75vh', display: 'flex', flexDirection: 'column' }, children: [jsx(DialogTitle$2, { className: "sr-only", children: "User Profile" }), jsx(DialogDescription$2, { className: "sr-only", children: "Manage your profile settings, social links, education, experience, resume, and security options." }), [
|
|
120494
121038
|
'basic',
|
|
120495
121039
|
'social',
|
|
120496
121040
|
'security',
|
|
@@ -121996,7 +122540,7 @@ const dynamicIconImports = {
|
|
|
121996
122540
|
"flip-vertical": () => Promise.resolve().then(function () { return flipVertical; }),
|
|
121997
122541
|
"flower-2": () => Promise.resolve().then(function () { return flower2; }),
|
|
121998
122542
|
"flower": () => Promise.resolve().then(function () { return flower; }),
|
|
121999
|
-
"focus": () => Promise.resolve().then(function () { return focus$
|
|
122543
|
+
"focus": () => Promise.resolve().then(function () { return focus$4; }),
|
|
122000
122544
|
"fold-horizontal": () => Promise.resolve().then(function () { return foldHorizontal; }),
|
|
122001
122545
|
"fold-vertical": () => Promise.resolve().then(function () { return foldVertical; }),
|
|
122002
122546
|
"folder-archive": () => Promise.resolve().then(function () { return folderArchive; }),
|
|
@@ -123195,7 +123739,7 @@ const sidebarMenuButtonVariants = cva('peer/menu-button flex w-full items-center
|
|
|
123195
123739
|
},
|
|
123196
123740
|
});
|
|
123197
123741
|
function SidebarMenuButton({ asChild = false, isActive = false, variant = 'default', size = 'default', tooltip, className, ...props }) {
|
|
123198
|
-
const Comp = asChild ? Slot$
|
|
123742
|
+
const Comp = asChild ? Slot$7 : 'button';
|
|
123199
123743
|
const { isMobile, state } = useSidebar();
|
|
123200
123744
|
const button = (jsx(Comp, { "data-slot": "sidebar-menu-button", "data-sidebar": "menu-button", "data-size": size, "data-active": isActive, className: cn(sidebarMenuButtonVariants({ variant, size }), className), ...props }));
|
|
123201
123745
|
if (!tooltip) {
|
|
@@ -140719,7 +141263,7 @@ function CredentialDetailModal({ credential, onClose, defaultImage = FALLBACK_CR
|
|
|
140719
141263
|
return null;
|
|
140720
141264
|
}
|
|
140721
141265
|
const displayTitle = recipientTitle || ((_a = credential.recipient) === null || _a === void 0 ? void 0 : _a.name) || ((_b = credential.recipient) === null || _b === void 0 ? void 0 : _b.username) || 'Recipient';
|
|
140722
|
-
return (jsx("div", { className: "bg-opacity-50 fixed inset-0 z-50 flex items-center justify-center bg-black p-4", children: jsxs("div", { className: "flex h-[85vh] w-full max-w-lg flex-col rounded-lg bg-white", children: [jsxs("div", { className: "flex items-center justify-between rounded-t-lg border-b border-gray-200 bg-gradient-to-r from-[var(--background-light)] to-[var(--primary-light)]/30 p-4", children: [jsx("h3", { className: "text-lg font-medium text-[var(--text)]", children: "Credential Details" }), jsx("button", { onClick: onClose, className: "rounded-full p-1 text-gray-400 hover:bg-[var(--primary-light)] hover:text-gray-500", "aria-label": "Close credential details", children: jsx(X, { className: "h-5 w-5" }) })] }), jsxs("div", { ref: certificateElement, className: "flex-1 overflow-y-auto p-6", children: [jsxs("div", { className: "mb-8 flex flex-col items-center", children: [jsx("div", { className: "mb-4 h-28 w-28 overflow-hidden rounded-full border-4 border-[var(--primary-light)] shadow-lg", children: jsx(Image$3, { src: ((_c = credential.credentialDetails) === null || _c === void 0 ? void 0 : _c.iconImage) || defaultImage, alt: ((_d = credential.credentialDetails) === null || _d === void 0 ? void 0 : _d.name) || 'Credential', width: 112, height: 112, className: "h-full w-full object-contain" }) }), jsx("h2", { className: "text-center text-xl font-semibold text-[var(--text)]", children: displayTitle }), jsxs("div", { className: "mt-2 flex items-center gap-2", children: [jsx(Award, { className: "h-4 w-4 text-[var(--primary)]" }), jsxs("p", { className: "text-base text-gray-600", children: ["Issued by ", ((_f = (_e = credential.credentialDetails) === null || _e === void 0 ? void 0 : _e.issuerDetails) === null || _f === void 0 ? void 0 : _f.name) || '-'] })] })] }), jsx("div", { className: "mb-6 rounded-lg border border-gray-100 bg-gray-50 p-4", children: jsxs("p", { className: "text-sm leading-relaxed text-gray-600", children: ["A completion credential for ", ((_g = credential.course) === null || _g === void 0 ? void 0 : _g.name) || 'a course', " was issued to", ' ', ((_h = credential.recipient) === null || _h === void 0 ? void 0 : _h.name) || ((_j = credential.recipient) === null || _j === void 0 ? void 0 : _j.username) || 'You', " on", ' ', dayjs(credential.issuedOn).format('MMM D, YYYY'), "."] }) }), !_.isEmpty(credential.course) && (jsxs("div", { className: "mb-6 overflow-hidden rounded-lg border border-gray-200", children: [jsx("div", { className: "border-b border-gray-200 bg-gray-50 px-4 py-3", children: jsxs("h3", { className: "text-md flex items-center gap-2 font-medium text-gray-700", children: [jsx(FileText, { className: "h-4 w-4 text-[var(--primary)]" }), "Course"] }) }), jsxs("div", { className: "flex items-center gap-4 p-4", children: [jsx("div", { className: "h-16 w-24 flex-shrink-0 overflow-hidden rounded-md border border-gray-200", children: jsx(Image$3, { src: resolvedCourseImage, alt: ((_k = credential.course) === null || _k === void 0 ? void 0 : _k.name) || 'Course', width: 96, height: 64, className: "h-full w-full object-cover" }) }), jsx("div", { children: jsx("h4", { className: "text-sm font-medium text-[var(--primary)]", children: ((_l = credential.course) === null || _l === void 0 ? void 0 : _l.name) || 'Course' }) })] })] })), jsxs("div", { className: "overflow-hidden rounded-lg border border-gray-200", children: [jsx("div", { className: "border-b border-gray-200 bg-gray-50 px-4 py-3", children: jsxs("h3", { className: "text-md flex items-center gap-2 font-medium text-gray-700", children: [jsx(Calendar$1, { className: "h-4 w-4 text-[var(--primary)]" }), "Issued on"] }) }), jsx("div", { className: "p-4", children: jsx("p", { className: "text-sm font-medium text-[var(--primary)]", children: dayjs(credential.issuedOn).format('MMM D, YYYY') }) })] })] }), jsx("div", { className: "flex justify-end gap-3 rounded-b-lg border-t border-gray-200 bg-gradient-to-r from-[var(--background-light)] to-[var(--primary-light)]/30 p-4", children: jsxs("button", { onClick: () => onDownload(certificateElement.current), className: "flex items-center gap-2 rounded-md bg-gradient-to-r from-[var(--button-primary-gradient-from)] to-[var(--button-primary-gradient-to)] px-5 py-2.5 text-sm font-medium text-[var(--button-primary-text)] shadow-sm transition-opacity hover:opacity-[var(--button-primary-hover-opacity)]", children: [jsx(Download, { className: "h-4 w-4" }), "Download Certificate"] }) })] }) }));
|
|
141266
|
+
return (jsx("div", { className: "bg-opacity-50 fixed inset-0 z-50 flex items-center justify-center bg-black p-4", children: jsxs("div", { className: "flex h-[85vh] w-full max-w-lg flex-col rounded-lg bg-white", children: [jsxs("div", { className: "flex items-center justify-between rounded-t-lg border-b border-gray-200 bg-gradient-to-r from-[var(--background-light)] to-[var(--primary-light)]/30 p-4", children: [jsx("h3", { className: "text-lg font-medium text-[var(--text)]", children: "Credential Details" }), jsx("button", { onClick: onClose, className: "rounded-full p-1 text-gray-400 hover:bg-[var(--primary-light)] hover:text-gray-500", "aria-label": "Close credential details", children: jsx(X$1, { className: "h-5 w-5" }) })] }), jsxs("div", { ref: certificateElement, className: "flex-1 overflow-y-auto p-6", children: [jsxs("div", { className: "mb-8 flex flex-col items-center", children: [jsx("div", { className: "mb-4 h-28 w-28 overflow-hidden rounded-full border-4 border-[var(--primary-light)] shadow-lg", children: jsx(Image$3, { src: ((_c = credential.credentialDetails) === null || _c === void 0 ? void 0 : _c.iconImage) || defaultImage, alt: ((_d = credential.credentialDetails) === null || _d === void 0 ? void 0 : _d.name) || 'Credential', width: 112, height: 112, className: "h-full w-full object-contain" }) }), jsx("h2", { className: "text-center text-xl font-semibold text-[var(--text)]", children: displayTitle }), jsxs("div", { className: "mt-2 flex items-center gap-2", children: [jsx(Award, { className: "h-4 w-4 text-[var(--primary)]" }), jsxs("p", { className: "text-base text-gray-600", children: ["Issued by ", ((_f = (_e = credential.credentialDetails) === null || _e === void 0 ? void 0 : _e.issuerDetails) === null || _f === void 0 ? void 0 : _f.name) || '-'] })] })] }), jsx("div", { className: "mb-6 rounded-lg border border-gray-100 bg-gray-50 p-4", children: jsxs("p", { className: "text-sm leading-relaxed text-gray-600", children: ["A completion credential for ", ((_g = credential.course) === null || _g === void 0 ? void 0 : _g.name) || 'a course', " was issued to", ' ', ((_h = credential.recipient) === null || _h === void 0 ? void 0 : _h.name) || ((_j = credential.recipient) === null || _j === void 0 ? void 0 : _j.username) || 'You', " on", ' ', dayjs(credential.issuedOn).format('MMM D, YYYY'), "."] }) }), !_.isEmpty(credential.course) && (jsxs("div", { className: "mb-6 overflow-hidden rounded-lg border border-gray-200", children: [jsx("div", { className: "border-b border-gray-200 bg-gray-50 px-4 py-3", children: jsxs("h3", { className: "text-md flex items-center gap-2 font-medium text-gray-700", children: [jsx(FileText, { className: "h-4 w-4 text-[var(--primary)]" }), "Course"] }) }), jsxs("div", { className: "flex items-center gap-4 p-4", children: [jsx("div", { className: "h-16 w-24 flex-shrink-0 overflow-hidden rounded-md border border-gray-200", children: jsx(Image$3, { src: resolvedCourseImage, alt: ((_k = credential.course) === null || _k === void 0 ? void 0 : _k.name) || 'Course', width: 96, height: 64, className: "h-full w-full object-cover" }) }), jsx("div", { children: jsx("h4", { className: "text-sm font-medium text-[var(--primary)]", children: ((_l = credential.course) === null || _l === void 0 ? void 0 : _l.name) || 'Course' }) })] })] })), jsxs("div", { className: "overflow-hidden rounded-lg border border-gray-200", children: [jsx("div", { className: "border-b border-gray-200 bg-gray-50 px-4 py-3", children: jsxs("h3", { className: "text-md flex items-center gap-2 font-medium text-gray-700", children: [jsx(Calendar$1, { className: "h-4 w-4 text-[var(--primary)]" }), "Issued on"] }) }), jsx("div", { className: "p-4", children: jsx("p", { className: "text-sm font-medium text-[var(--primary)]", children: dayjs(credential.issuedOn).format('MMM D, YYYY') }) })] })] }), jsx("div", { className: "flex justify-end gap-3 rounded-b-lg border-t border-gray-200 bg-gradient-to-r from-[var(--background-light)] to-[var(--primary-light)]/30 p-4", children: jsxs("button", { onClick: () => onDownload(certificateElement.current), className: "flex items-center gap-2 rounded-md bg-gradient-to-r from-[var(--button-primary-gradient-from)] to-[var(--button-primary-gradient-to)] px-5 py-2.5 text-sm font-medium text-[var(--button-primary-text)] shadow-sm transition-opacity hover:opacity-[var(--button-primary-hover-opacity)]", children: [jsx(Download, { className: "h-4 w-4" }), "Download Certificate"] }) })] }) }));
|
|
140723
141267
|
}
|
|
140724
141268
|
|
|
140725
141269
|
dayjs.extend(duration);
|
|
@@ -140754,7 +141298,7 @@ const PathwayDetailModal = ({ pathway, paths, pathwayDetailLoading = false, path
|
|
|
140754
141298
|
const resolvedBanner = bannerImageSrc !== null && bannerImageSrc !== void 0 ? bannerImageSrc : fallbackImage;
|
|
140755
141299
|
const hasCompletion = !!pathwayCompletion && Object.keys(pathwayCompletion).length > 0;
|
|
140756
141300
|
const showEnrollButton = !enrollmentStatus && !isEnrollmentSuccess && !isEnrollmentLoading;
|
|
140757
|
-
return (jsx("div", { className: "bg-opacity-50 fixed inset-0 z-50 flex items-center justify-center bg-black p-4", children: jsxs("div", { className: "max-h-[85vh] w-full max-w-2xl overflow-y-auto rounded-lg bg-white", children: [jsxs("div", { className: "flex items-center justify-between border-b border-gray-200 bg-gradient-to-r from-[var(--background-light)] to-[var(--primary-light)]/30 p-4", children: [jsx("h3", { className: "text-lg font-medium text-[var(--text)]", children: "Pathway Details" }), jsx("button", { onClick: onClose, "aria-label": "Close", className: "rounded-full p-1 text-gray-400 hover:bg-[var(--primary-light)] hover:text-gray-500", children: jsx(X, { className: "h-5 w-5" }) })] }), jsxs("div", { className: "max-h-[70vh] overflow-y-auto p-6 [&::-webkit-scrollbar]:hidden", style: { scrollbarWidth: 'none', msOverflowStyle: 'none' }, children: [jsxs("div", { className: "relative mb-6 h-48 w-full overflow-hidden rounded-lg", children: [jsx(Image$3, { src: resolvedBanner, alt: pathway.name || '', fill: true, className: "object-cover", onError: (e) => {
|
|
141301
|
+
return (jsx("div", { className: "bg-opacity-50 fixed inset-0 z-50 flex items-center justify-center bg-black p-4", children: jsxs("div", { className: "max-h-[85vh] w-full max-w-2xl overflow-y-auto rounded-lg bg-white", children: [jsxs("div", { className: "flex items-center justify-between border-b border-gray-200 bg-gradient-to-r from-[var(--background-light)] to-[var(--primary-light)]/30 p-4", children: [jsx("h3", { className: "text-lg font-medium text-[var(--text)]", children: "Pathway Details" }), jsx("button", { onClick: onClose, "aria-label": "Close", className: "rounded-full p-1 text-gray-400 hover:bg-[var(--primary-light)] hover:text-gray-500", children: jsx(X$1, { className: "h-5 w-5" }) })] }), jsxs("div", { className: "max-h-[70vh] overflow-y-auto p-6 [&::-webkit-scrollbar]:hidden", style: { scrollbarWidth: 'none', msOverflowStyle: 'none' }, children: [jsxs("div", { className: "relative mb-6 h-48 w-full overflow-hidden rounded-lg", children: [jsx(Image$3, { src: resolvedBanner, alt: pathway.name || '', fill: true, className: "object-cover", onError: (e) => {
|
|
140758
141302
|
e.target.src = fallbackImage;
|
|
140759
141303
|
}, priority: true }), jsx("div", { className: "absolute bottom-2 left-2 rounded bg-amber-500 px-2 py-1 text-xs text-white", children: "PATHWAY" })] }), jsx("h2", { className: "mb-2 text-xl font-semibold text-gray-800", children: pathway.name }), hasCompletion && (jsxs("div", { className: "mb-6 space-y-1", children: [jsxs("div", { className: "flex justify-between text-sm", children: [jsx("span", { className: "text-gray-600", children: "Progress" }), jsxs("span", { className: "font-medium text-gray-800", children: [pathwayCompletion.completion_percentage || 0, "%"] })] }), jsx("div", { className: "h-2 w-full rounded-full bg-gray-200", children: jsx("div", { className: "h-2 rounded-full bg-amber-500", style: {
|
|
140760
141304
|
width: `${pathwayCompletion.completion_percentage || 0}%`,
|
|
@@ -140811,7 +141355,7 @@ const MultiValueInput = ({ label, values, onChange, placeholder }) => {
|
|
|
140811
141355
|
const handleRemove = (index) => {
|
|
140812
141356
|
onChange(values.filter((_, i) => i !== index));
|
|
140813
141357
|
};
|
|
140814
|
-
return (jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: label }), jsx("div", { className: "mb-2 flex flex-wrap gap-2", children: values.map((value, index) => (jsxs("span", { className: "inline-flex items-center gap-1 rounded-md bg-amber-100 px-2 py-1 text-sm text-amber-800", children: [value, jsx("button", { type: "button", onClick: () => handleRemove(index), "aria-label": `Remove ${value}`, className: "text-amber-600 hover:text-amber-800", children: jsx(X, { className: "h-3 w-3" }) })] }, index))) }), jsxs("div", { className: "flex gap-2", children: [jsx("input", { type: "text", value: inputValue, onChange: (e) => setInputValue(e.target.value), onKeyDown: handleKeyDown, placeholder: placeholder || 'Type and press Enter to add', className: "flex-1 rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-transparent focus:ring-2 focus:ring-amber-500 focus:outline-none" }), jsx("button", { type: "button", onClick: add, "aria-label": `Add ${label.toLowerCase()}`, className: "rounded-md bg-amber-500 px-3 py-2 text-white transition-colors hover:bg-amber-600", children: jsx(Plus, { className: "h-4 w-4" }) })] })] }));
|
|
141358
|
+
return (jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: label }), jsx("div", { className: "mb-2 flex flex-wrap gap-2", children: values.map((value, index) => (jsxs("span", { className: "inline-flex items-center gap-1 rounded-md bg-amber-100 px-2 py-1 text-sm text-amber-800", children: [value, jsx("button", { type: "button", onClick: () => handleRemove(index), "aria-label": `Remove ${value}`, className: "text-amber-600 hover:text-amber-800", children: jsx(X$1, { className: "h-3 w-3" }) })] }, index))) }), jsxs("div", { className: "flex gap-2", children: [jsx("input", { type: "text", value: inputValue, onChange: (e) => setInputValue(e.target.value), onKeyDown: handleKeyDown, placeholder: placeholder || 'Type and press Enter to add', className: "flex-1 rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-transparent focus:ring-2 focus:ring-amber-500 focus:outline-none" }), jsx("button", { type: "button", onClick: add, "aria-label": `Add ${label.toLowerCase()}`, className: "rounded-md bg-amber-500 px-3 py-2 text-white transition-colors hover:bg-amber-600", children: jsx(Plus, { className: "h-4 w-4" }) })] })] }));
|
|
140815
141359
|
};
|
|
140816
141360
|
const ImageUrlInput = ({ label, value, onChange, placeholder }) => {
|
|
140817
141361
|
const [previewError, setPreviewError] = React.useState(false);
|
|
@@ -140871,7 +141415,7 @@ const ProgramDetailModal = ({ program, courses = [], courseListLoading = false,
|
|
|
140871
141415
|
} }) }), jsx("div", { children: jsx("h4", { className: "text-sm font-medium text-amber-500", children: (_h = course.course) === null || _h === void 0 ? void 0 : _h.name }) })] })] }, String((_k = (_j = course.course) === null || _j === void 0 ? void 0 : _j.id) !== null && _k !== void 0 ? _k : index)));
|
|
140872
141416
|
})] })] }));
|
|
140873
141417
|
const settingsPanel = (jsxs("div", { className: "space-y-6", children: [jsxs("fieldset", { className: "space-y-4", children: [jsx("legend", { className: "w-full border-b border-gray-200 pb-2 text-sm font-semibold text-gray-800", children: "Basic Information" }), jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "Subject" }), jsx("input", { type: "text", value: settings.subject, onChange: (e) => updateSetting('subject', e.target.value), placeholder: "e.g., Computer Science", className: BASE_INPUT_CLASSES })] }), jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "URL Slug" }), jsx("input", { type: "text", value: settings.slug, onChange: (e) => updateSetting('slug', e.target.value), placeholder: "e.g., my-program", className: BASE_INPUT_CLASSES })] }), jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "Level" }), jsx("input", { type: "text", value: settings.level, onChange: (e) => updateSetting('level', e.target.value), placeholder: "e.g., Beginner, Intermediate, Advanced", className: BASE_INPUT_CLASSES })] }), jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "Language" }), jsx("input", { type: "text", value: settings.language, onChange: (e) => updateSetting('language', e.target.value), placeholder: "e.g., en", className: BASE_INPUT_CLASSES })] })] }), jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "Description" }), jsx("textarea", { value: settings.description, onChange: (e) => updateSetting('description', e.target.value), placeholder: "Program description...", rows: 3, className: BASE_INPUT_CLASSES })] }), jsx(MultiValueInput, { label: "Tags", values: settings.tags, onChange: (values) => updateSetting('tags', values), placeholder: "Type a tag and press Enter" }), jsx(MultiValueInput, { label: "Topics", values: settings.topics, onChange: (values) => updateSetting('topics', values), placeholder: "Type a topic and press Enter" })] }), jsxs("fieldset", { className: "space-y-4", children: [jsx("legend", { className: "w-full border-b border-gray-200 pb-2 text-sm font-semibold text-gray-800", children: "Pricing & Dates" }), jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "Display Price" }), jsx("input", { type: "text", value: settings.display_price, onChange: (e) => updateSetting('display_price', e.target.value), placeholder: "e.g., $99.00", className: BASE_INPUT_CLASSES })] }), jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "Start Date" }), jsx("input", { type: "date", value: settings.start_date, onChange: (e) => updateSetting('start_date', e.target.value), max: settings.end_date || undefined, className: BASE_INPUT_CLASSES })] }), jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "End Date" }), jsx("input", { type: "date", value: settings.end_date, onChange: (e) => updateSetting('end_date', e.target.value), min: settings.start_date || undefined, className: BASE_INPUT_CLASSES })] }), jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "Enrollment Start" }), jsx("input", { type: "date", value: settings.enrollment_start, onChange: (e) => updateSetting('enrollment_start', e.target.value), max: settings.enrollment_end || undefined, className: BASE_INPUT_CLASSES })] }), jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "Enrollment End" }), jsx("input", { type: "date", value: settings.enrollment_end, onChange: (e) => updateSetting('enrollment_end', e.target.value), min: settings.enrollment_start || undefined, className: BASE_INPUT_CLASSES })] })] })] }), jsxs("fieldset", { className: "space-y-4", children: [jsx("legend", { className: "w-full border-b border-gray-200 pb-2 text-sm font-semibold text-gray-800", children: "Visibility & Access" }), jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "Catalog Visibility" }), jsxs(Select$1, { value: settings.catalog_visibility, onValueChange: (value) => updateSetting('catalog_visibility', value), children: [jsx(SelectTrigger, { className: "w-full", children: jsx(SelectValue, { placeholder: "Select visibility" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "both", children: "Both" }), jsx(SelectItem, { value: "about", children: "About" }), jsx(SelectItem, { value: "none", children: "None" })] })] })] }), jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "Invitation Only" }), jsxs("div", { className: "flex items-center gap-2 pt-2", children: [jsx(Switch, { checked: settings.invitation_only, onCheckedChange: (checked) => updateSetting('invitation_only', checked), className: "data-[state=checked]:bg-amber-500" }), jsx("span", { className: "text-sm text-gray-600", children: settings.invitation_only ? 'Yes' : 'No' })] })] })] }), jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "Credential" }), jsx("input", { type: "text", value: settings.credential, onChange: (e) => updateSetting('credential', e.target.value), placeholder: "Credential information", className: BASE_INPUT_CLASSES })] })] }), jsxs("fieldset", { className: "space-y-4", children: [jsx("legend", { className: "w-full border-b border-gray-200 pb-2 text-sm font-semibold text-gray-800", children: "Images" }), jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [jsx(ImageUrlInput, { label: "Banner Image URL", value: settings.banner_image, onChange: (value) => updateSetting('banner_image', value), placeholder: "https://example.com/banner.jpg" }), jsx(ImageUrlInput, { label: "Card Image URL", value: settings.card_image, onChange: (value) => updateSetting('card_image', value), placeholder: "https://example.com/card.jpg" })] })] }), jsxs("fieldset", { className: "space-y-4", children: [jsx("legend", { className: "w-full border-b border-gray-200 pb-2 text-sm font-semibold text-gray-800", children: "Social & Promotion" }), jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "Promotion" }), jsx("input", { type: "text", value: settings.promotion, onChange: (e) => updateSetting('promotion', e.target.value), placeholder: "Promotion data", className: BASE_INPUT_CLASSES })] }), jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "Social Team" }), jsx("input", { type: "text", value: settings.social_team, onChange: (e) => updateSetting('social_team', e.target.value), placeholder: "Social team info", className: BASE_INPUT_CLASSES })] }), jsxs("div", { className: "space-y-2", children: [jsx("label", { className: "text-sm font-medium text-gray-700", children: "Social Channels" }), jsx("input", { type: "text", value: settings.social_channels, onChange: (e) => updateSetting('social_channels', e.target.value), placeholder: "Social channels", className: BASE_INPUT_CLASSES })] })] })] }), jsx("div", { className: "border-t border-gray-200 pt-4", children: jsxs("button", { onClick: handleSave, disabled: isSavingSettings, "data-testid": "save-settings-button", className: "flex w-full items-center justify-center gap-2 rounded-md bg-gradient-to-r from-[var(--button-primary-gradient-from)] to-[var(--button-primary-gradient-to)] px-4 py-2 text-sm font-medium text-[var(--button-primary-text)] transition-opacity hover:opacity-[var(--button-primary-hover-opacity)] disabled:opacity-50", children: [isSavingSettings ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-label": "Saving" })) : (jsx(Save, { className: "h-4 w-4" })), "Save Settings"] }) })] }));
|
|
140874
|
-
return (jsx("div", { className: "bg-opacity-50 fixed inset-0 z-50 flex items-center justify-center bg-black p-4", role: "dialog", "aria-modal": "true", "aria-labelledby": "program-detail-modal-title", "data-testid": "program-detail-modal", children: jsxs("div", { className: "max-h-[85vh] w-full max-w-2xl overflow-y-auto rounded-lg bg-white", children: [jsxs("div", { className: "flex items-center justify-between border-b border-gray-200 bg-gradient-to-r from-[var(--background-light)] to-[var(--primary-light)]/30 p-4", children: [jsx("h3", { id: "program-detail-modal-title", className: "text-lg font-medium text-[var(--text)]", children: "Program Details" }), jsx("button", { onClick: onClose, "aria-label": "Close modal", className: "rounded-full p-1 text-gray-400 hover:bg-[var(--primary-light)] hover:text-gray-500", children: jsx(X, { className: "h-5 w-5" }) })] }), jsxs("div", { className: "max-h-[70vh] overflow-y-auto p-6 [&::-webkit-scrollbar]:hidden", style: { scrollbarWidth: 'none', msOverflowStyle: 'none' }, children: [jsxs("div", { className: "relative mb-6 h-48 w-full overflow-hidden rounded-lg", children: [jsx(Image$3, { src: resolvedBanner, alt: (program === null || program === void 0 ? void 0 : program.name) || '', fill: true, className: "object-cover", onError: (e) => {
|
|
141418
|
+
return (jsx("div", { className: "bg-opacity-50 fixed inset-0 z-50 flex items-center justify-center bg-black p-4", role: "dialog", "aria-modal": "true", "aria-labelledby": "program-detail-modal-title", "data-testid": "program-detail-modal", children: jsxs("div", { className: "max-h-[85vh] w-full max-w-2xl overflow-y-auto rounded-lg bg-white", children: [jsxs("div", { className: "flex items-center justify-between border-b border-gray-200 bg-gradient-to-r from-[var(--background-light)] to-[var(--primary-light)]/30 p-4", children: [jsx("h3", { id: "program-detail-modal-title", className: "text-lg font-medium text-[var(--text)]", children: "Program Details" }), jsx("button", { onClick: onClose, "aria-label": "Close modal", className: "rounded-full p-1 text-gray-400 hover:bg-[var(--primary-light)] hover:text-gray-500", children: jsx(X$1, { className: "h-5 w-5" }) })] }), jsxs("div", { className: "max-h-[70vh] overflow-y-auto p-6 [&::-webkit-scrollbar]:hidden", style: { scrollbarWidth: 'none', msOverflowStyle: 'none' }, children: [jsxs("div", { className: "relative mb-6 h-48 w-full overflow-hidden rounded-lg", children: [jsx(Image$3, { src: resolvedBanner, alt: (program === null || program === void 0 ? void 0 : program.name) || '', fill: true, className: "object-cover", onError: (e) => {
|
|
140875
141419
|
e.currentTarget.src = randomImage;
|
|
140876
141420
|
} }), jsx("div", { className: "absolute bottom-2 left-2 rounded bg-amber-500 px-2 py-1 text-xs text-white", children: "PROGRAM" })] }), jsx("h2", { className: "mb-2 text-xl font-semibold text-gray-800", children: program === null || program === void 0 ? void 0 : program.name }), hasCompletion && (jsxs("div", { className: "mb-6 space-y-1", children: [jsxs("div", { className: "flex justify-between text-sm", children: [jsx("span", { className: "text-gray-600", children: "Progress" }), jsxs("span", { className: "font-medium text-gray-800", children: [programCompletion.completion_percentage || 0, "%"] })] }), jsx("div", { className: "h-2 w-full rounded-full bg-gray-200", children: jsx("div", { className: "h-2 rounded-full bg-amber-500", style: {
|
|
140877
141421
|
width: `${programCompletion.completion_percentage || 0}%`,
|
|
@@ -141063,7 +141607,7 @@ const CreatePathwayModal = ({ open, onOpenChange, onSearchChange, onSave, search
|
|
|
141063
141607
|
});
|
|
141064
141608
|
};
|
|
141065
141609
|
const saveDisabled = !name || (selectedCourses.length === 0 && selectedResources.length === 0);
|
|
141066
|
-
return (jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: jsxs(DialogContent$
|
|
141610
|
+
return (jsx(Dialog$1, { open: open, onOpenChange: onOpenChange, children: jsxs(DialogContent$2, { className: "flex max-h-[85vh] w-full max-w-4xl flex-col gap-0 overflow-hidden rounded-lg bg-white p-0", children: [jsxs("div", { className: "flex items-center justify-between border-b p-4", children: [jsx("h3", { className: "text-lg font-medium text-gray-600", children: "Create New Pathway" }), jsx("button", { onClick: () => onOpenChange(false), "aria-label": "Close", className: "rounded-full p-1 hover:bg-gray-100", children: jsx(X$1, { className: "h-4 w-4" }) })] }), jsxs("div", { className: "flex flex-1 flex-col overflow-auto md:flex-row", children: [jsx("div", { className: "overflow-y-auto bg-gray-50 p-6 md:w-1/2 [&::-webkit-scrollbar]:hidden", style: { scrollbarWidth: 'none', msOverflowStyle: 'none' }, children: jsx("div", { className: "space-y-6", children: jsxs("div", { className: "space-y-6", children: [jsxs("div", { children: [jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "Pathway Cover Image" }), jsx("div", { className: "flex cursor-pointer flex-col items-center justify-center rounded-lg border border-gray-200 bg-white p-6 transition-colors hover:bg-gray-100", onClick: openFilePicker, children: coverImage ? (jsx("div", { className: "relative mb-2 h-40 w-full", children: jsx(Image$3, { src: coverImage, alt: "Pathway cover", fill: true, className: "rounded-md object-cover" }) })) : (jsxs(Fragment$1, { children: [jsx(Upload, { className: "mb-4 h-10 w-10 text-amber-500" }), jsx("p", { className: "mb-1 font-medium text-gray-700", children: "Upload a cover image" }), jsx("p", { className: "text-sm text-gray-500", children: "(Recommended size: 1280\u00D7720px)" })] })) })] }), jsxs("div", { children: [jsxs("label", { htmlFor: "pathway-name", className: "mb-2 block text-sm font-medium text-gray-700", children: ["Pathway Name ", jsx("span", { className: "text-red-500", children: "*" })] }), jsx("input", { id: "pathway-name", type: "text", value: name, onChange: (e) => setName(e.target.value), placeholder: "Enter pathway name", className: "w-full rounded-md border border-gray-200 bg-white px-4 py-2 placeholder-gray-400 focus:border-transparent focus:ring-2 focus:ring-amber-500 focus:outline-none" })] }), jsxs("div", { children: [jsx("label", { htmlFor: "pathway-subject", className: "mb-2 block text-sm font-medium text-gray-700", children: "Subject/Category" }), jsx("input", { id: "pathway-subject", type: "text", value: subject, onChange: (e) => setSubject(e.target.value), placeholder: "Enter subject", className: "w-full rounded-md border border-gray-200 bg-white px-4 py-2 placeholder-gray-400 focus:border-transparent focus:ring-2 focus:ring-amber-500 focus:outline-none" })] }), jsxs("div", { children: [jsx("label", { htmlFor: "pathway-description", className: "mb-2 block text-sm font-medium text-gray-700", children: "Description" }), jsx("textarea", { id: "pathway-description", value: description, onChange: (e) => setDescription(e.target.value), placeholder: "Enter pathway description", rows: 3, className: "w-full resize-none rounded-md border border-gray-200 bg-white px-4 py-2 placeholder-gray-400 focus:border-transparent focus:ring-2 focus:ring-amber-500 focus:outline-none" })] })] }) }) }), jsx("div", { className: "overflow-y-auto border-t border-gray-200 bg-white p-6 md:w-1/2 md:border-t-0 md:border-l [&::-webkit-scrollbar]:hidden", style: { scrollbarWidth: 'none', msOverflowStyle: 'none' }, children: jsxs("div", { className: "flex h-full flex-col space-y-0", children: [jsx("h2", { className: "mb-2 text-sm font-medium text-gray-700", children: "Add Content" }), jsxs("div", { className: "relative mb-4 flex items-center", children: [jsx(Search, { className: "absolute left-4 h-4 w-4 text-gray-400" }), jsx("input", { type: "text", placeholder: "Search content to add", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), className: "mb-2 w-full rounded-md border border-gray-200 bg-gray-50 py-2 pr-4 pl-10 placeholder-gray-400 focus:border-transparent focus:ring-2 focus:ring-amber-500 focus:outline-none" })] }), jsxs("div", { className: "mt-3 mb-2 text-sm text-gray-600", children: [selectedCourses.length + selectedResources.length, " items selected"] }), jsxs("div", { className: "flex-1 space-y-3 overflow-y-auto [&::-webkit-scrollbar]:hidden", style: { scrollbarWidth: 'none', msOverflowStyle: 'none' }, children: [(isCoursesLoading || isResourceSearchLoading) && (jsx(SkeletonMultiplier, { multiplier: 6, Skeleton: SkeletonCreatePathwaySearchList })), !isCoursesLoading &&
|
|
141067
141611
|
searchedCourses.map((courseResult) => {
|
|
141068
141612
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
141069
141613
|
const courseId = (_b = (_a = courseResult === null || courseResult === void 0 ? void 0 : courseResult.data) === null || _a === void 0 ? void 0 : _a.course_id) !== null && _b !== void 0 ? _b : '';
|