@exulu/frontend 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.next/BUILD_ID +1 -1
- package/dist/.next/app-build-manifest.json +129 -131
- package/dist/.next/app-path-routes-manifest.json +1 -1
- package/dist/.next/build-manifest.json +2 -2
- package/dist/.next/prerender-manifest.json +1 -1
- package/dist/.next/server/app/(application)/agents/edit/[id]/page.js +1 -1
- package/dist/.next/server/app/(application)/agents/edit/[id]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/agents/edit/[id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/agents/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js +7 -7
- package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/chat/[agent]/[session]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/chat/[agent]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/chat/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/configuration/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/dashboard/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/data/[[...query]]/page.js +4 -4
- package/dist/.next/server/app/(application)/data/[[...query]]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/data/[[...query]]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/evals/[id]/page.js +1 -1
- package/dist/.next/server/app/(application)/evals/[id]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/evals/[id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/evals/cases/page.js +1 -1
- package/dist/.next/server/app/(application)/evals/cases/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/evals/cases/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/evals/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/explorer/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/keys/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/projects/[project]/page.js +1 -1
- package/dist/.next/server/app/(application)/projects/[project]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/projects/[project]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/projects/page.js +1 -1
- package/dist/.next/server/app/(application)/projects/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/prompts/page.js +1 -1
- package/dist/.next/server/app/(application)/prompts/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/roles/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/token/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/users/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/create/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/edit/[variable_id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/usage/[variable_id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/workflows/page.js +1 -1
- package/dist/.next/server/app/(application)/workflows/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(authentication)/login/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/_not-found.html +1 -1
- package/dist/.next/server/app/_not-found.rsc +1 -1
- package/dist/.next/server/app-paths-manifest.json +6 -6
- package/dist/.next/server/chunks/1025.js +1 -0
- package/dist/.next/server/chunks/2270.js +11 -48
- package/dist/.next/server/chunks/3434.js +1 -1
- package/dist/.next/server/chunks/3503.js +1 -0
- package/dist/.next/server/chunks/5084.js +1 -0
- package/dist/.next/server/chunks/5192.js +1 -1
- package/dist/.next/server/chunks/5485.js +1 -1
- package/dist/.next/server/chunks/5600.js +1 -1
- package/dist/.next/server/chunks/5974.js +1 -0
- package/dist/.next/server/chunks/6590.js +1 -1
- package/dist/.next/server/chunks/7471.js +1 -1
- package/dist/.next/server/chunks/8286.js +1 -1
- package/dist/.next/server/chunks/{3679.js → 9874.js} +5 -5
- package/dist/.next/server/middleware-manifest.json +5 -5
- package/dist/.next/server/pages/404.html +1 -1
- package/dist/.next/server/pages/500.html +1 -1
- package/dist/.next/server/server-reference-manifest.json +1 -1
- package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js +2 -0
- package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js.map +1 -0
- package/dist/.next/static/chunks/{4811-316807e25b634f9f.js → 192-72d6868cd891ccc6.js} +8 -8
- package/dist/.next/static/chunks/192-72d6868cd891ccc6.js.map +1 -0
- package/dist/.next/static/chunks/1957-cf44b1d31a9c7d5c.js +2 -0
- package/dist/.next/static/chunks/1957-cf44b1d31a9c7d5c.js.map +1 -0
- package/dist/.next/static/chunks/342-d9c2d6ae9f9435cb.js +2 -0
- package/dist/.next/static/chunks/342-d9c2d6ae9f9435cb.js.map +1 -0
- package/dist/.next/static/chunks/552-39155a93c527ec6d.js +2 -0
- package/dist/.next/static/chunks/552-39155a93c527ec6d.js.map +1 -0
- package/dist/.next/static/chunks/6367-59655a85d75e19be.js +2 -0
- package/dist/.next/static/chunks/6367-59655a85d75e19be.js.map +1 -0
- package/dist/.next/static/chunks/6373-601400fab8a3bb55.js +2 -0
- package/dist/.next/static/chunks/6373-601400fab8a3bb55.js.map +1 -0
- package/dist/.next/static/chunks/8030-9c926ea4dfd3a54e.js +2 -0
- package/dist/.next/static/chunks/8030-9c926ea4dfd3a54e.js.map +1 -0
- package/dist/.next/static/chunks/{6805-792cc8008b165c07.js → 8293-0e69d89d2dac7111.js} +10 -10
- package/dist/.next/static/chunks/8293-0e69d89d2dac7111.js.map +1 -0
- package/dist/.next/static/chunks/9953-95900a236271a222.js +2 -0
- package/dist/.next/static/chunks/9953-95900a236271a222.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-e4a4693953329671.js +2 -0
- package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-e4a4693953329671.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-7edb1c7c850f982c.js +2 -0
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-7edb1c7c850f982c.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-8d2b3995cacfd832.js +2 -0
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-8d2b3995cacfd832.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/evals/[id]/page-a7728cf9b0524489.js +2 -0
- package/dist/.next/static/chunks/app/(application)/evals/[id]/page-a7728cf9b0524489.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/evals/cases/{page-a39fef7444581565.js → page-827f50c6d1f150d0.js} +2 -2
- package/dist/.next/static/chunks/app/(application)/evals/cases/{page-a39fef7444581565.js.map → page-827f50c6d1f150d0.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/projects/[project]/page-f04fd5291a1ef7b1.js +2 -0
- package/dist/.next/static/chunks/app/(application)/projects/[project]/page-f04fd5291a1ef7b1.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/prompts/page-2c500e9898447506.js +2 -0
- package/dist/.next/static/chunks/app/(application)/prompts/page-2c500e9898447506.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/workflows/{page-47dedb88cec600d5.js → page-e38f9456120dab69.js} +2 -2
- package/dist/.next/static/chunks/app/(application)/workflows/page-e38f9456120dab69.js.map +1 -0
- package/dist/.next/static/css/6f8c5212af8ef284.css +4 -0
- package/dist/.next/static/css/6f8c5212af8ef284.css.map +1 -0
- package/dist/.next/static/css/e3f2a16ab7676b05.css.map +1 -1
- package/package.json +1 -1
- package/dist/.next/server/chunks/2948.js +0 -1
- package/dist/.next/server/chunks/38.js +0 -1
- package/dist/.next/server/chunks/7958.js +0 -1
- package/dist/.next/server/chunks/8050.js +0 -1
- package/dist/.next/static/chunks/1685-9cacdee7e3f0942f.js +0 -2
- package/dist/.next/static/chunks/1685-9cacdee7e3f0942f.js.map +0 -1
- package/dist/.next/static/chunks/1957-39a01a3915f246ab.js +0 -2
- package/dist/.next/static/chunks/1957-39a01a3915f246ab.js.map +0 -1
- package/dist/.next/static/chunks/4811-316807e25b634f9f.js.map +0 -1
- package/dist/.next/static/chunks/5282-68f9880f1f951f44.js +0 -2
- package/dist/.next/static/chunks/5282-68f9880f1f951f44.js.map +0 -1
- package/dist/.next/static/chunks/6367-59cef3c74213925b.js +0 -2
- package/dist/.next/static/chunks/6367-59cef3c74213925b.js.map +0 -1
- package/dist/.next/static/chunks/6373-4c5dffaf4193621c.js +0 -2
- package/dist/.next/static/chunks/6373-4c5dffaf4193621c.js.map +0 -1
- package/dist/.next/static/chunks/6805-792cc8008b165c07.js.map +0 -1
- package/dist/.next/static/chunks/8030-c1b6be46253076cb.js +0 -2
- package/dist/.next/static/chunks/8030-c1b6be46253076cb.js.map +0 -1
- package/dist/.next/static/chunks/9621-f81c4d7c0ecf5a67.js +0 -2
- package/dist/.next/static/chunks/9621-f81c4d7c0ecf5a67.js.map +0 -1
- package/dist/.next/static/chunks/9953-dfb5fc0e5b74ec09.js +0 -2
- package/dist/.next/static/chunks/9953-dfb5fc0e5b74ec09.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-4e7e02768ed1a72a.js +0 -2
- package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-4e7e02768ed1a72a.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-38f845d5ccdad76b.js +0 -2
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-38f845d5ccdad76b.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-a391b8407f74e9b4.js +0 -2
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-a391b8407f74e9b4.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/evals/[id]/page-cf6f8d2bd4e9c819.js +0 -2
- package/dist/.next/static/chunks/app/(application)/evals/[id]/page-cf6f8d2bd4e9c819.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/projects/[project]/page-bc859da58d8505f7.js +0 -2
- package/dist/.next/static/chunks/app/(application)/projects/[project]/page-bc859da58d8505f7.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/prompts/page-d2f36ff149385efd.js +0 -2
- package/dist/.next/static/chunks/app/(application)/prompts/page-d2f36ff149385efd.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/workflows/page-47dedb88cec600d5.js.map +0 -1
- package/dist/.next/static/css/c8c015815c72d053.css +0 -4
- package/dist/.next/static/css/c8c015815c72d053.css.map +0 -1
- /package/dist/.next/static/{GOwerAkBncYx0J8q1TqQb → ls-syPkq9-MWp-VWWDEZJ}/_buildManifest.js +0 -0
- /package/dist/.next/static/{GOwerAkBncYx0J8q1TqQb → ls-syPkq9-MWp-VWWDEZJ}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/chunks/552-39155a93c527ec6d.js","mappings":"4IAaM,IAAAA,EAAcC,CAAAA,EAAAA,SAAAA,CAAAA,EAAiB,cAAe,CAClD,CAAC,SAAU,CAAEC,GAAI,KAAMC,GAAI,KAAMC,EAAG,KAAMC,IAAK,UAAU,CACzD,CAAC,OAAQ,CAAEC,GAAI,KAAMC,GAAI,KAAMC,GAAI,IAAKC,GAAI,KAAMJ,IAAK,UAAU,CACjE,CAAC,OAAQ,CAAEC,GAAI,KAAMC,GAAI,QAASC,GAAI,KAAMC,GAAI,KAAMJ,IAAK,UAAU,CACtE,yDCJK,IAAAK,EAAYT,CAAAA,EAAAA,SAAAA,CAAAA,EAAiB,YAAa,CAC9C,CAAC,OAA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AA7B,SAA0B,GAAAyW,EAAAzV,GAAA,EAAI,OAAU,GAAAV,CAAA,CAAAN,SAAA,mBAAAA,EAAAA,EAAA6B,GAAA7B,CAAA,EAAmF,EAC7K,CASAiW,CACCA,GAAAA,CAAAA,EAAA,GAAsC,EADvCvL,OAAA,CAPA,UAAuB1K,SAAAA,CAAA,IAAAM,EAAoB,EAC3C,IAAAuB,EAAA8U,WAYA,IAAA9U,EAAoB,GAAA4N,EAAAmH,UAAA,EAAUf,GAC9B,IAAAhU,EACA,mGAEA,OAAAA,CACA,IAhBA,MAAgB,GAAA4U,EAAAzV,GAAA,EAAI,OAAUoB,IAAAP,EAAA8O,SAAA,CAAA5M,MAAA,CAC9B+Q,OAAA,OACA+B,MAAA,MACA,EAAa7W,SAAY,GAAAyW,EAAAzV,GAAA,EAAI,OAAU,GAAAV,CAAA,CAAA8B,IAAAP,EAAApB,UAAA,CAAAT,SAAA,mBAAAA,EAAAA,EAAA6B,GAAA7B,CAAA,EAA4G,EACnJ","sources":["webpack://_N_E/../../../src/icons/alert-circle.ts","webpack://_N_E/../../../src/icons/arrow-left.ts","webpack://_N_E/../../../src/icons/book.ts","webpack://_N_E/../../../src/icons/check-circle-2.ts","webpack://_N_E/../../../src/icons/chevron-down.ts","webpack://_N_E/../../../src/icons/info.ts","webpack://_N_E/../../../src/icons/loader-2.ts","webpack://_N_E/../../../src/icons/message-square.ts","webpack://_N_E/../../../src/icons/pencil.ts","webpack://_N_E/../../../src/icons/refresh-ccw.ts","webpack://_N_E/../../../src/icons/x-circle.ts","webpack://_N_E/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://_N_E/./node_modules/@radix-ui/number/dist/index.mjs","webpack://_N_E/../src/dialog.tsx","webpack://_N_E/../src/alert-dialog.tsx","webpack://_N_E/./node_modules/date-fns/differenceInCalendarMonths.mjs","webpack://_N_E/./node_modules/date-fns/endOfMonth.mjs","webpack://_N_E/./node_modules/date-fns/constructNow.mjs","webpack://_N_E/./node_modules/date-fns/compareAsc.mjs","webpack://_N_E/./node_modules/date-fns/endOfDay.mjs","webpack://_N_E/./node_modules/date-fns/isLastDayOfMonth.mjs","webpack://_N_E/./node_modules/date-fns/differenceInMonths.mjs","webpack://_N_E/./node_modules/date-fns/_lib/getRoundingMethod.mjs","webpack://_N_E/./node_modules/date-fns/differenceInMilliseconds.mjs","webpack://_N_E/./node_modules/date-fns/differenceInSeconds.mjs","webpack://_N_E/./node_modules/date-fns/formatDistance.mjs","webpack://_N_E/./node_modules/date-fns/formatDistanceToNow.mjs","webpack://_N_E/./node_modules/use-stick-to-bottom/dist/useStickToBottom.js","webpack://_N_E/./node_modules/use-stick-to-bottom/dist/StickToBottom.js"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name AlertCircle\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/alert-circle\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst AlertCircle = createLucideIcon('AlertCircle', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['line', { x1: '12', x2: '12', y1: '8', y2: '12', key: '1pkeuh' }],\n ['line', { x1: '12', x2: '12.01', y1: '16', y2: '16', key: '4dfq90' }],\n]);\n\nexport default AlertCircle;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/arrow-left\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ArrowLeft = createLucideIcon('ArrowLeft', [\n ['path', { d: 'm12 19-7-7 7-7', key: '1l729n' }],\n ['path', { d: 'M19 12H5', key: 'x3x0zl' }],\n]);\n\nexport default ArrowLeft;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Book\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/book\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Book = createLucideIcon('Book', [\n ['path', { d: 'M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20', key: 't4utmx' }],\n]);\n\nexport default Book;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CheckCircle2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/check-circle-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CheckCircle2 = createLucideIcon('CheckCircle2', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'm9 12 2 2 4-4', key: 'dzmm74' }],\n]);\n\nexport default CheckCircle2;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChevronDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/chevron-down\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ChevronDown = createLucideIcon('ChevronDown', [\n ['path', { d: 'm6 9 6 6 6-6', key: 'qrunsl' }],\n]);\n\nexport default ChevronDown;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Info\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/info\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Info = createLucideIcon('Info', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'M12 16v-4', key: '1dtifu' }],\n ['path', { d: 'M12 8h.01', key: 'e9boi3' }],\n]);\n\nexport default Info;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Loader2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/loader-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Loader2 = createLucideIcon('Loader2', [\n ['path', { d: 'M21 12a9 9 0 1 1-6.219-8.56', key: '13zald' }],\n]);\n\nexport default Loader2;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MessageSquare\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/message-square\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst MessageSquare = createLucideIcon('MessageSquare', [\n ['path', { d: 'M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z', key: '1lielz' }],\n]);\n\nexport default MessageSquare;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Pencil\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/pencil\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Pencil = createLucideIcon('Pencil', [\n ['path', { d: 'M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z', key: '5qss01' }],\n ['path', { d: 'm15 5 4 4', key: '1mk7zo' }],\n]);\n\nexport default Pencil;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name RefreshCcw\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/refresh-ccw\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst RefreshCcw = createLucideIcon('RefreshCcw', [\n ['path', { d: 'M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8', key: '14sxne' }],\n ['path', { d: 'M3 3v5h5', key: '1xhq8a' }],\n ['path', { d: 'M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16', key: '1hlbsb' }],\n ['path', { d: 'M16 16h5v5', key: 'ccwih5' }],\n]);\n\nexport default RefreshCcw;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name XCircle\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/x-circle\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst XCircle = createLucideIcon('XCircle', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'm15 9-6 6', key: '1uzhvr' }],\n ['path', { d: 'm9 9 6 6', key: 'z0biqf' }],\n]);\n\nexport default XCircle;\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","// packages/core/number/src/number.ts\nfunction clamp(value, [min, max]) {\n return Math.min(max, Math.max(min, value));\n}\nexport {\n clamp\n};\n//# sourceMappingURL=index.mjs.map\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContext, createContextScope } from '@radix-ui/react-context';\nimport { useId } from '@radix-ui/react-id';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { RemoveScroll } from 'react-remove-scroll';\nimport { hideOthers } from 'aria-hidden';\nimport { createSlot } from '@radix-ui/react-slot';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Dialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst DIALOG_NAME = 'Dialog';\n\ntype ScopedProps<P> = P & { __scopeDialog?: Scope };\nconst [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\n\ntype DialogContextValue = {\n triggerRef: React.RefObject<HTMLButtonElement | null>;\n contentRef: React.RefObject<DialogContentElement | null>;\n contentId: string;\n titleId: string;\n descriptionId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n};\n\nconst [DialogProvider, useDialogContext] = createDialogContext<DialogContextValue>(DIALOG_NAME);\n\ninterface DialogProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n}\n\nconst Dialog: React.FC<DialogProps> = (props: ScopedProps<DialogProps>) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true,\n } = props;\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const contentRef = React.useRef<DialogContentElement>(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DIALOG_NAME,\n });\n\n return (\n <DialogProvider\n scope={__scopeDialog}\n triggerRef={triggerRef}\n contentRef={contentRef}\n contentId={useId()}\n titleId={useId()}\n descriptionId={useId()}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen])}\n modal={modal}\n >\n {children}\n </DialogProvider>\n );\n};\n\nDialog.displayName = DIALOG_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DialogTrigger';\n\ntype DialogTriggerElement = React.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface DialogTriggerProps extends PrimitiveButtonProps {}\n\nconst DialogTrigger = React.forwardRef<DialogTriggerElement, DialogTriggerProps>(\n (props: ScopedProps<DialogTriggerProps>, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return (\n <Primitive.button\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={context.open}\n aria-controls={context.contentId}\n data-state={getState(context.open)}\n {...triggerProps}\n ref={composedTriggerRef}\n onClick={composeEventHandlers(props.onClick, context.onOpenToggle)}\n />\n );\n }\n);\n\nDialogTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'DialogPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createDialogContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;\ninterface DialogPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogPortal: React.FC<DialogPortalProps> = (props: ScopedProps<DialogPortalProps>) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return (\n <PortalProvider scope={__scopeDialog} forceMount={forceMount}>\n {React.Children.map(children, (child) => (\n <Presence present={forceMount || context.open}>\n <PortalPrimitive asChild container={container}>\n {child}\n </PortalPrimitive>\n </Presence>\n ))}\n </PortalProvider>\n );\n};\n\nDialogPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'DialogOverlay';\n\ntype DialogOverlayElement = DialogOverlayImplElement;\ninterface DialogOverlayProps extends DialogOverlayImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogOverlay = React.forwardRef<DialogOverlayElement, DialogOverlayProps>(\n (props: ScopedProps<DialogOverlayProps>, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? (\n <Presence present={forceMount || context.open}>\n <DialogOverlayImpl {...overlayProps} ref={forwardedRef} />\n </Presence>\n ) : null;\n }\n);\n\nDialogOverlay.displayName = OVERLAY_NAME;\n\ntype DialogOverlayImplElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface DialogOverlayImplProps extends PrimitiveDivProps {}\n\nconst Slot = createSlot('DialogOverlay.RemoveScroll');\n\nconst DialogOverlayImpl = React.forwardRef<DialogOverlayImplElement, DialogOverlayImplProps>(\n (props: ScopedProps<DialogOverlayImplProps>, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n <RemoveScroll as={Slot} allowPinchZoom shards={[context.contentRef]}>\n <Primitive.div\n data-state={getState(context.open)}\n {...overlayProps}\n ref={forwardedRef}\n // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.\n style={{ pointerEvents: 'auto', ...overlayProps.style }}\n />\n </RemoveScroll>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DialogContent';\n\ntype DialogContentElement = DialogContentTypeElement;\ninterface DialogContentProps extends DialogContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n (props: ScopedProps<DialogContentProps>, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return (\n <Presence present={forceMount || context.open}>\n {context.modal ? (\n <DialogContentModal {...contentProps} ref={forwardedRef} />\n ) : (\n <DialogContentNonModal {...contentProps} ref={forwardedRef} />\n )}\n </Presence>\n );\n }\n);\n\nDialogContent.displayName = CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentTypeElement = DialogContentImplElement;\ninterface DialogContentTypeProps\n extends Omit<DialogContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {}\n\nconst DialogContentModal = React.forwardRef<DialogContentTypeElement, DialogContentTypeProps>(\n (props: ScopedProps<DialogContentTypeProps>, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n <DialogContentImpl\n {...props}\n ref={composedRefs}\n // we make sure focus isn't trapped once `DialogContent` has been closed\n // (closed !== unmounted when animating out)\n trapFocus={context.open}\n disableOutsidePointerEvents\n onCloseAutoFocus={composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n context.triggerRef.current?.focus();\n })}\n onPointerDownOutside={composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n\n // If the event is a right-click, we shouldn't close because\n // it is effectively as if we right-clicked the `Overlay`.\n if (isRightClick) event.preventDefault();\n })}\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) =>\n event.preventDefault()\n )}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst DialogContentNonModal = React.forwardRef<DialogContentTypeElement, DialogContentTypeProps>(\n (props: ScopedProps<DialogContentTypeProps>, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n\n return (\n <DialogContentImpl\n {...props}\n ref={forwardedRef}\n trapFocus={false}\n disableOutsidePointerEvents={false}\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === 'pointerdown') {\n hasPointerDownOutsideRef.current = true;\n }\n }\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n\n // On Safari if the trigger is inside a container with tabIndex={0}, when clicked\n // we will get the pointer down outside event on the trigger, but then a subsequent\n // focus outside event on the container, we ignore any focus outside event when we've\n // already had a pointer down outside event.\n if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }}\n />\n );\n }\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentImplElement = React.ComponentRef<typeof DismissableLayer>;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype FocusScopeProps = React.ComponentPropsWithoutRef<typeof FocusScope>;\ninterface DialogContentImplProps extends Omit<DismissableLayerProps, 'onDismiss'> {\n /**\n * When `true`, focus cannot escape the `Content` via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapFocus?: FocusScopeProps['trapped'];\n\n /**\n * Event handler called when auto-focusing on open.\n * Can be prevented.\n */\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n}\n\nconst DialogContentImpl = React.forwardRef<DialogContentImplElement, DialogContentImplProps>(\n (props: ScopedProps<DialogContentImplProps>, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n\n // Make sure the whole tree has focus guards as our `Dialog` will be\n // the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n return (\n <>\n <FocusScope\n asChild\n loop\n trapped={trapFocus}\n onMountAutoFocus={onOpenAutoFocus}\n onUnmountAutoFocus={onCloseAutoFocus}\n >\n <DismissableLayer\n role=\"dialog\"\n id={context.contentId}\n aria-describedby={context.descriptionId}\n aria-labelledby={context.titleId}\n data-state={getState(context.open)}\n {...contentProps}\n ref={composedRefs}\n onDismiss={() => context.onOpenChange(false)}\n />\n </FocusScope>\n {process.env.NODE_ENV !== 'production' && (\n <>\n <TitleWarning titleId={context.titleId} />\n <DescriptionWarning contentRef={contentRef} descriptionId={context.descriptionId} />\n </>\n )}\n </>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'DialogTitle';\n\ntype DialogTitleElement = React.ComponentRef<typeof Primitive.h2>;\ntype PrimitiveHeading2Props = React.ComponentPropsWithoutRef<typeof Primitive.h2>;\ninterface DialogTitleProps extends PrimitiveHeading2Props {}\n\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>(\n (props: ScopedProps<DialogTitleProps>, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return <Primitive.h2 id={context.titleId} {...titleProps} ref={forwardedRef} />;\n }\n);\n\nDialogTitle.displayName = TITLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'DialogDescription';\n\ntype DialogDescriptionElement = React.ComponentRef<typeof Primitive.p>;\ntype PrimitiveParagraphProps = React.ComponentPropsWithoutRef<typeof Primitive.p>;\ninterface DialogDescriptionProps extends PrimitiveParagraphProps {}\n\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n (props: ScopedProps<DialogDescriptionProps>, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return <Primitive.p id={context.descriptionId} {...descriptionProps} ref={forwardedRef} />;\n }\n);\n\nDialogDescription.displayName = DESCRIPTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DialogClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'DialogClose';\n\ntype DialogCloseElement = React.ComponentRef<typeof Primitive.button>;\ninterface DialogCloseProps extends PrimitiveButtonProps {}\n\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n (props: ScopedProps<DialogCloseProps>, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return (\n <Primitive.button\n type=\"button\"\n {...closeProps}\n ref={forwardedRef}\n onClick={composeEventHandlers(props.onClick, () => context.onOpenChange(false))}\n />\n );\n }\n);\n\nDialogClose.displayName = CLOSE_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nconst TITLE_WARNING_NAME = 'DialogTitleWarning';\n\nconst [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: 'dialog',\n});\n\ntype TitleWarningProps = { titleId?: string };\n\nconst TitleWarning: React.FC<TitleWarningProps> = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n\n const MESSAGE = `\\`${titleWarningContext.contentName}\\` requires a \\`${titleWarningContext.titleName}\\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \\`${titleWarningContext.titleName}\\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;\n\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) console.error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n\n return null;\n};\n\nconst DESCRIPTION_WARNING_NAME = 'DialogDescriptionWarning';\n\ntype DescriptionWarningProps = {\n contentRef: React.RefObject<DialogContentElement | null>;\n descriptionId?: string;\n};\n\nconst DescriptionWarning: React.FC<DescriptionWarningProps> = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute('aria-describedby');\n // if we have an id and the user hasn't set aria-describedby={undefined}\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n\n return null;\n};\n\nconst Root = Dialog;\nconst Trigger = DialogTrigger;\nconst Portal = DialogPortal;\nconst Overlay = DialogOverlay;\nconst Content = DialogContent;\nconst Title = DialogTitle;\nconst Description = DialogDescription;\nconst Close = DialogClose;\n\nexport {\n createDialogScope,\n //\n Dialog,\n DialogTrigger,\n DialogPortal,\n DialogOverlay,\n DialogContent,\n DialogTitle,\n DialogDescription,\n DialogClose,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Title,\n Description,\n Close,\n //\n WarningProvider,\n};\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogContentProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogCloseProps,\n};\n","import * as React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { createDialogScope } from '@radix-ui/react-dialog';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createSlottable } from '@radix-ui/react-slot';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst ROOT_NAME = 'AlertDialog';\n\ntype ScopedProps<P> = P & { __scopeAlertDialog?: Scope };\nconst [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [\n createDialogScope,\n]);\nconst useDialogScope = createDialogScope();\n\ntype DialogProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;\ninterface AlertDialogProps extends Omit<DialogProps, 'modal'> {}\n\nconst AlertDialog: React.FC<AlertDialogProps> = (props: ScopedProps<AlertDialogProps>) => {\n const { __scopeAlertDialog, ...alertDialogProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Root {...dialogScope} {...alertDialogProps} modal={true} />;\n};\n\nAlertDialog.displayName = ROOT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogTrigger\n * -----------------------------------------------------------------------------------------------*/\nconst TRIGGER_NAME = 'AlertDialogTrigger';\n\ntype AlertDialogTriggerElement = React.ComponentRef<typeof DialogPrimitive.Trigger>;\ntype DialogTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;\ninterface AlertDialogTriggerProps extends DialogTriggerProps {}\n\nconst AlertDialogTrigger = React.forwardRef<AlertDialogTriggerElement, AlertDialogTriggerProps>(\n (props: ScopedProps<AlertDialogTriggerProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...triggerProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Trigger {...dialogScope} {...triggerProps} ref={forwardedRef} />;\n }\n);\n\nAlertDialogTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'AlertDialogPortal';\n\ntype DialogPortalProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>;\ninterface AlertDialogPortalProps extends DialogPortalProps {}\n\nconst AlertDialogPortal: React.FC<AlertDialogPortalProps> = (\n props: ScopedProps<AlertDialogPortalProps>\n) => {\n const { __scopeAlertDialog, ...portalProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Portal {...dialogScope} {...portalProps} />;\n};\n\nAlertDialogPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'AlertDialogOverlay';\n\ntype AlertDialogOverlayElement = React.ComponentRef<typeof DialogPrimitive.Overlay>;\ntype DialogOverlayProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;\ninterface AlertDialogOverlayProps extends DialogOverlayProps {}\n\nconst AlertDialogOverlay = React.forwardRef<AlertDialogOverlayElement, AlertDialogOverlayProps>(\n (props: ScopedProps<AlertDialogOverlayProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...overlayProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Overlay {...dialogScope} {...overlayProps} ref={forwardedRef} />;\n }\n);\n\nAlertDialogOverlay.displayName = OVERLAY_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'AlertDialogContent';\n\ntype AlertDialogContentContextValue = {\n cancelRef: React.MutableRefObject<AlertDialogCancelElement | null>;\n};\n\nconst [AlertDialogContentProvider, useAlertDialogContentContext] =\n createAlertDialogContext<AlertDialogContentContextValue>(CONTENT_NAME);\n\ntype AlertDialogContentElement = React.ComponentRef<typeof DialogPrimitive.Content>;\ntype DialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;\ninterface AlertDialogContentProps\n extends Omit<DialogContentProps, 'onPointerDownOutside' | 'onInteractOutside'> {}\n\nconst Slottable = createSlottable('AlertDialogContent');\n\nconst AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDialogContentProps>(\n (props: ScopedProps<AlertDialogContentProps>, forwardedRef) => {\n const { __scopeAlertDialog, children, ...contentProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const contentRef = React.useRef<AlertDialogContentElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const cancelRef = React.useRef<AlertDialogCancelElement | null>(null);\n\n return (\n <DialogPrimitive.WarningProvider\n contentName={CONTENT_NAME}\n titleName={TITLE_NAME}\n docsSlug=\"alert-dialog\"\n >\n <AlertDialogContentProvider scope={__scopeAlertDialog} cancelRef={cancelRef}>\n <DialogPrimitive.Content\n role=\"alertdialog\"\n {...dialogScope}\n {...contentProps}\n ref={composedRefs}\n onOpenAutoFocus={composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {\n event.preventDefault();\n cancelRef.current?.focus({ preventScroll: true });\n })}\n onPointerDownOutside={(event) => event.preventDefault()}\n onInteractOutside={(event) => event.preventDefault()}\n >\n {/**\n * We have to use `Slottable` here as we cannot wrap the `AlertDialogContentProvider`\n * around everything, otherwise the `DescriptionWarning` would be rendered straight away.\n * This is because we want the accessibility checks to run only once the content is actually\n * open and that behaviour is already encapsulated in `DialogContent`.\n */}\n <Slottable>{children}</Slottable>\n {process.env.NODE_ENV === 'development' && (\n <DescriptionWarning contentRef={contentRef} />\n )}\n </DialogPrimitive.Content>\n </AlertDialogContentProvider>\n </DialogPrimitive.WarningProvider>\n );\n }\n);\n\nAlertDialogContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'AlertDialogTitle';\n\ntype AlertDialogTitleElement = React.ComponentRef<typeof DialogPrimitive.Title>;\ntype DialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;\ninterface AlertDialogTitleProps extends DialogTitleProps {}\n\nconst AlertDialogTitle = React.forwardRef<AlertDialogTitleElement, AlertDialogTitleProps>(\n (props: ScopedProps<AlertDialogTitleProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...titleProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Title {...dialogScope} {...titleProps} ref={forwardedRef} />;\n }\n);\n\nAlertDialogTitle.displayName = TITLE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'AlertDialogDescription';\n\ntype AlertDialogDescriptionElement = React.ComponentRef<typeof DialogPrimitive.Description>;\ntype DialogDescriptionProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;\ninterface AlertDialogDescriptionProps extends DialogDescriptionProps {}\n\nconst AlertDialogDescription = React.forwardRef<\n AlertDialogDescriptionElement,\n AlertDialogDescriptionProps\n>((props: ScopedProps<AlertDialogDescriptionProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...descriptionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Description {...dialogScope} {...descriptionProps} ref={forwardedRef} />;\n});\n\nAlertDialogDescription.displayName = DESCRIPTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogAction\n * -----------------------------------------------------------------------------------------------*/\n\nconst ACTION_NAME = 'AlertDialogAction';\n\ntype AlertDialogActionElement = React.ComponentRef<typeof DialogPrimitive.Close>;\ntype DialogCloseProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;\ninterface AlertDialogActionProps extends DialogCloseProps {}\n\nconst AlertDialogAction = React.forwardRef<AlertDialogActionElement, AlertDialogActionProps>(\n (props: ScopedProps<AlertDialogActionProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...actionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return <DialogPrimitive.Close {...dialogScope} {...actionProps} ref={forwardedRef} />;\n }\n);\n\nAlertDialogAction.displayName = ACTION_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * AlertDialogCancel\n * -----------------------------------------------------------------------------------------------*/\n\nconst CANCEL_NAME = 'AlertDialogCancel';\n\ntype AlertDialogCancelElement = React.ComponentRef<typeof DialogPrimitive.Close>;\ninterface AlertDialogCancelProps extends DialogCloseProps {}\n\nconst AlertDialogCancel = React.forwardRef<AlertDialogCancelElement, AlertDialogCancelProps>(\n (props: ScopedProps<AlertDialogCancelProps>, forwardedRef) => {\n const { __scopeAlertDialog, ...cancelProps } = props;\n const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const ref = useComposedRefs(forwardedRef, cancelRef);\n return <DialogPrimitive.Close {...dialogScope} {...cancelProps} ref={ref} />;\n }\n);\n\nAlertDialogCancel.displayName = CANCEL_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype DescriptionWarningProps = {\n contentRef: React.RefObject<AlertDialogContentElement | null>;\n};\n\nconst DescriptionWarning: React.FC<DescriptionWarningProps> = ({ contentRef }) => {\n const MESSAGE = `\\`${CONTENT_NAME}\\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \\`${CONTENT_NAME}\\` by passing a \\`${DESCRIPTION_NAME}\\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \\`id\\` and passing the same value to the \\`aria-describedby\\` prop in \\`${CONTENT_NAME}\\`. If the description is confusing or duplicative for sighted users, you can use the \\`@radix-ui/react-visually-hidden\\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;\n\n React.useEffect(() => {\n const hasDescription = document.getElementById(\n contentRef.current?.getAttribute('aria-describedby')!\n );\n if (!hasDescription) console.warn(MESSAGE);\n }, [MESSAGE, contentRef]);\n\n return null;\n};\n\nconst Root = AlertDialog;\nconst Trigger = AlertDialogTrigger;\nconst Portal = AlertDialogPortal;\nconst Overlay = AlertDialogOverlay;\nconst Content = AlertDialogContent;\nconst Action = AlertDialogAction;\nconst Cancel = AlertDialogCancel;\nconst Title = AlertDialogTitle;\nconst Description = AlertDialogDescription;\n\nexport {\n createAlertDialogScope,\n //\n AlertDialog,\n AlertDialogTrigger,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogContent,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogTitle,\n AlertDialogDescription,\n //\n Root,\n Trigger,\n Portal,\n Overlay,\n Content,\n Action,\n Cancel,\n Title,\n Description,\n};\nexport type {\n AlertDialogProps,\n AlertDialogTriggerProps,\n AlertDialogPortalProps,\n AlertDialogOverlayProps,\n AlertDialogContentProps,\n AlertDialogActionProps,\n AlertDialogCancelProps,\n AlertDialogTitleProps,\n AlertDialogDescriptionProps,\n};\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport function differenceInCalendarMonths(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const yearDiff = _dateLeft.getFullYear() - _dateRight.getFullYear();\n const monthDiff = _dateLeft.getMonth() - _dateRight.getMonth();\n\n return yearDiff * 12 + monthDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarMonths;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The end of a month\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport function endOfMonth(date) {\n const _date = toDate(date);\n const month = _date.getMonth();\n _date.setFullYear(_date.getFullYear(), month + 1, 0);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfMonth;\n","import { constructFrom } from \"./constructFrom.mjs\";\n\n/**\n * @name constructNow\n * @category Generic Helpers\n * @summary Constructs a new current date using the passed value constructor.\n * @pure false\n *\n * @description\n * The function constructs a new current date using the constructor from\n * the reference date. It helps to build generic functions that accept date\n * extensions and use the current date.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n *\n * @returns Current date initialized using the given date constructor\n *\n * @example\n * import { constructNow, isSameDay } from 'date-fns'\n *\n * function isToday<DateType extends Date>(\n * date: DateType | number | string,\n * ): boolean {\n * // If we were to use `new Date()` directly, the function would behave\n * // differently in different timezones and return false for the same date.\n * return isSameDay(date, constructNow(date));\n * }\n */\nexport function constructNow(date) {\n return constructFrom(date, Date.now());\n}\n\n// Fallback for modularized imports:\nexport default constructNow;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nexport function compareAsc(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const diff = _dateLeft.getTime() - _dateRight.getTime();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1;\n // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}\n\n// Fallback for modularized imports:\nexport default compareAsc;\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The original date\n *\n * @returns The end of a day\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\nexport function endOfDay(date) {\n const _date = toDate(date);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfDay;\n","import { endOfDay } from \"./endOfDay.mjs\";\nimport { endOfMonth } from \"./endOfMonth.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to check\n\n * @returns The date is the last day of a month\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * const result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\nexport function isLastDayOfMonth(date) {\n const _date = toDate(date);\n return +endOfDay(_date) === +endOfMonth(_date);\n}\n\n// Fallback for modularized imports:\nexport default isLastDayOfMonth;\n","import { compareAsc } from \"./compareAsc.mjs\";\nimport { differenceInCalendarMonths } from \"./differenceInCalendarMonths.mjs\";\nimport { isLastDayOfMonth } from \"./isLastDayOfMonth.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @description\n * Get the number of full months between the given dates using trunc as a default rounding method.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of full months\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\nexport function differenceInMonths(dateLeft, dateRight) {\n const _dateLeft = toDate(dateLeft);\n const _dateRight = toDate(dateRight);\n\n const sign = compareAsc(_dateLeft, _dateRight);\n const difference = Math.abs(\n differenceInCalendarMonths(_dateLeft, _dateRight),\n );\n let result;\n\n // Check for the difference of less than month\n if (difference < 1) {\n result = 0;\n } else {\n if (_dateLeft.getMonth() === 1 && _dateLeft.getDate() > 27) {\n // This will check if the date is end of Feb and assign a higher end of month date\n // to compare it with Jan\n _dateLeft.setDate(30);\n }\n\n _dateLeft.setMonth(_dateLeft.getMonth() - sign * difference);\n\n // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full\n // If so, result must be decreased by 1 in absolute value\n let isLastMonthNotFull = compareAsc(_dateLeft, _dateRight) === -sign;\n\n // Check for cases of one full calendar month\n if (\n isLastDayOfMonth(toDate(dateLeft)) &&\n difference === 1 &&\n compareAsc(dateLeft, _dateRight) === 1\n ) {\n isLastMonthNotFull = false;\n }\n\n result = sign * (difference - Number(isLastMonthNotFull));\n }\n\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}\n\n// Fallback for modularized imports:\nexport default differenceInMonths;\n","export function getRoundingMethod(method) {\n return (number) => {\n const round = method ? Math[method] : Math.trunc;\n const result = round(number);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n };\n}\n","import { toDate } from \"./toDate.mjs\";\n\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport function differenceInMilliseconds(dateLeft, dateRight) {\n return +toDate(dateLeft) - +toDate(dateRight);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMilliseconds;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.mjs\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.mjs\";\n\n/**\n * The {@link differenceInSeconds} function options.\n */\n\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of seconds\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport function differenceInSeconds(dateLeft, dateRight, options) {\n const diff = differenceInMilliseconds(dateLeft, dateRight) / 1000;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInSeconds;\n","import { compareAsc } from \"./compareAsc.mjs\";\nimport { minutesInDay, minutesInMonth } from \"./constants.mjs\";\nimport { differenceInMonths } from \"./differenceInMonths.mjs\";\nimport { differenceInSeconds } from \"./differenceInSeconds.mjs\";\nimport { toDate } from \"./toDate.mjs\";\nimport { defaultLocale } from \"./_lib/defaultLocale.mjs\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.mjs\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.mjs\";\n\n/**\n * The {@link formatDistance} function options.\n */\n\n/**\n * @name formatDistance\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words.\n *\n * | Distance between dates | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance between dates | Result |\n * |------------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date\n * @param baseDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00, including seconds?\n * const result = formatDistance(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0),\n * { includeSeconds: true }\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> 'about 1 year ago'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> 'pli ol 1 jaro'\n */\n\nexport function formatDistance(date, baseDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n const minutesInAlmostTwoDays = 2520;\n\n const comparison = compareAsc(date, baseDate);\n\n if (isNaN(comparison)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison: comparison,\n });\n\n let dateLeft;\n let dateRight;\n if (comparison > 0) {\n dateLeft = toDate(baseDate);\n dateRight = toDate(date);\n } else {\n dateLeft = toDate(date);\n dateRight = toDate(baseDate);\n }\n\n const seconds = differenceInSeconds(dateRight, dateLeft);\n const offsetInSeconds =\n (getTimezoneOffsetInMilliseconds(dateRight) -\n getTimezoneOffsetInMilliseconds(dateLeft)) /\n 1000;\n const minutes = Math.round((seconds - offsetInSeconds) / 60);\n let months;\n\n // 0 up to 2 mins\n if (minutes < 2) {\n if (options?.includeSeconds) {\n if (seconds < 5) {\n return locale.formatDistance(\"lessThanXSeconds\", 5, localizeOptions);\n } else if (seconds < 10) {\n return locale.formatDistance(\"lessThanXSeconds\", 10, localizeOptions);\n } else if (seconds < 20) {\n return locale.formatDistance(\"lessThanXSeconds\", 20, localizeOptions);\n } else if (seconds < 40) {\n return locale.formatDistance(\"halfAMinute\", 0, localizeOptions);\n } else if (seconds < 60) {\n return locale.formatDistance(\"lessThanXMinutes\", 1, localizeOptions);\n } else {\n return locale.formatDistance(\"xMinutes\", 1, localizeOptions);\n }\n } else {\n if (minutes === 0) {\n return locale.formatDistance(\"lessThanXMinutes\", 1, localizeOptions);\n } else {\n return locale.formatDistance(\"xMinutes\", minutes, localizeOptions);\n }\n }\n\n // 2 mins up to 0.75 hrs\n } else if (minutes < 45) {\n return locale.formatDistance(\"xMinutes\", minutes, localizeOptions);\n\n // 0.75 hrs up to 1.5 hrs\n } else if (minutes < 90) {\n return locale.formatDistance(\"aboutXHours\", 1, localizeOptions);\n\n // 1.5 hrs up to 24 hrs\n } else if (minutes < minutesInDay) {\n const hours = Math.round(minutes / 60);\n return locale.formatDistance(\"aboutXHours\", hours, localizeOptions);\n\n // 1 day up to 1.75 days\n } else if (minutes < minutesInAlmostTwoDays) {\n return locale.formatDistance(\"xDays\", 1, localizeOptions);\n\n // 1.75 days up to 30 days\n } else if (minutes < minutesInMonth) {\n const days = Math.round(minutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n\n // 1 month up to 2 months\n } else if (minutes < minutesInMonth * 2) {\n months = Math.round(minutes / minutesInMonth);\n return locale.formatDistance(\"aboutXMonths\", months, localizeOptions);\n }\n\n months = differenceInMonths(dateRight, dateLeft);\n\n // 2 months up to 12 months\n if (months < 12) {\n const nearestMonth = Math.round(minutes / minutesInMonth);\n return locale.formatDistance(\"xMonths\", nearestMonth, localizeOptions);\n\n // 1 year up to max Date\n } else {\n const monthsSinceStartOfYear = months % 12;\n const years = Math.trunc(months / 12);\n\n // N years up to 1 years 3 months\n if (monthsSinceStartOfYear < 3) {\n return locale.formatDistance(\"aboutXYears\", years, localizeOptions);\n\n // N years 3 months up to N years 9 months\n } else if (monthsSinceStartOfYear < 9) {\n return locale.formatDistance(\"overXYears\", years, localizeOptions);\n\n // N years 9 months up to N year 12 months\n } else {\n return locale.formatDistance(\"almostXYears\", years + 1, localizeOptions);\n }\n }\n}\n\n// Fallback for modularized imports:\nexport default formatDistance;\n","import { constructNow } from \"./constructNow.mjs\";\nimport { formatDistance } from \"./formatDistance.mjs\";\n\n/**\n * The {@link formatDistanceToNow} function options.\n */\n\n/**\n * @name formatDistanceToNow\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The given date\n * @param options - The object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * const result = formatDistanceToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * const result = formatDistanceToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * const result = formatDistanceToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * const eoLocale = require('date-fns/locale/eo')\n * const result = formatDistanceToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nexport function formatDistanceToNow(date, options) {\n return formatDistance(date, constructNow(date), options);\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceToNow;\n","/*!---------------------------------------------------------------------------------------------\n * Copyright (c) StackBlitz. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { useCallback, useMemo, useRef, useState, } from \"react\";\nconst DEFAULT_SPRING_ANIMATION = {\n /**\n * A value from 0 to 1, on how much to damp the animation.\n * 0 means no damping, 1 means full damping.\n *\n * @default 0.7\n */\n damping: 0.7,\n /**\n * The stiffness of how fast/slow the animation gets up to speed.\n *\n * @default 0.05\n */\n stiffness: 0.05,\n /**\n * The inertial mass associated with the animation.\n * Higher numbers make the animation slower.\n *\n * @default 1.25\n */\n mass: 1.25,\n};\nconst STICK_TO_BOTTOM_OFFSET_PX = 70;\nconst SIXTY_FPS_INTERVAL_MS = 1000 / 60;\nconst RETAIN_ANIMATION_DURATION_MS = 350;\nlet mouseDown = false;\nglobalThis.document?.addEventListener(\"mousedown\", () => {\n mouseDown = true;\n});\nglobalThis.document?.addEventListener(\"mouseup\", () => {\n mouseDown = false;\n});\nglobalThis.document?.addEventListener(\"click\", () => {\n mouseDown = false;\n});\nexport const useStickToBottom = (options = {}) => {\n const [escapedFromLock, updateEscapedFromLock] = useState(false);\n const [isAtBottom, updateIsAtBottom] = useState(options.initial !== false);\n const [isNearBottom, setIsNearBottom] = useState(false);\n const optionsRef = useRef(null);\n optionsRef.current = options;\n const isSelecting = useCallback(() => {\n if (!mouseDown) {\n return false;\n }\n const selection = window.getSelection();\n if (!selection || !selection.rangeCount) {\n return false;\n }\n const range = selection.getRangeAt(0);\n return (range.commonAncestorContainer.contains(scrollRef.current) ||\n scrollRef.current?.contains(range.commonAncestorContainer));\n }, []);\n const setIsAtBottom = useCallback((isAtBottom) => {\n state.isAtBottom = isAtBottom;\n updateIsAtBottom(isAtBottom);\n }, []);\n const setEscapedFromLock = useCallback((escapedFromLock) => {\n state.escapedFromLock = escapedFromLock;\n updateEscapedFromLock(escapedFromLock);\n }, []);\n // biome-ignore lint/correctness/useExhaustiveDependencies: not needed\n const state = useMemo(() => {\n let lastCalculation;\n return {\n escapedFromLock,\n isAtBottom,\n resizeDifference: 0,\n accumulated: 0,\n velocity: 0,\n listeners: new Set(),\n get scrollTop() {\n return scrollRef.current?.scrollTop ?? 0;\n },\n set scrollTop(scrollTop) {\n if (scrollRef.current) {\n scrollRef.current.scrollTop = scrollTop;\n state.ignoreScrollToTop = scrollRef.current.scrollTop;\n }\n },\n get targetScrollTop() {\n if (!scrollRef.current || !contentRef.current) {\n return 0;\n }\n return (scrollRef.current.scrollHeight - 1 - scrollRef.current.clientHeight);\n },\n get calculatedTargetScrollTop() {\n if (!scrollRef.current || !contentRef.current) {\n return 0;\n }\n const { targetScrollTop } = this;\n if (!options.targetScrollTop) {\n return targetScrollTop;\n }\n if (lastCalculation?.targetScrollTop === targetScrollTop) {\n return lastCalculation.calculatedScrollTop;\n }\n const calculatedScrollTop = Math.max(Math.min(options.targetScrollTop(targetScrollTop, {\n scrollElement: scrollRef.current,\n contentElement: contentRef.current,\n }), targetScrollTop), 0);\n lastCalculation = { targetScrollTop, calculatedScrollTop };\n requestAnimationFrame(() => {\n lastCalculation = undefined;\n });\n return calculatedScrollTop;\n },\n get scrollDifference() {\n return this.calculatedTargetScrollTop - this.scrollTop;\n },\n get isNearBottom() {\n return this.scrollDifference <= STICK_TO_BOTTOM_OFFSET_PX;\n },\n };\n }, []);\n const scrollToBottom = useCallback((scrollOptions = {}) => {\n if (typeof scrollOptions === \"string\") {\n scrollOptions = { animation: scrollOptions };\n }\n if (!scrollOptions.preserveScrollPosition) {\n setIsAtBottom(true);\n }\n const waitElapsed = Date.now() + (Number(scrollOptions.wait) || 0);\n const behavior = mergeAnimations(optionsRef.current, scrollOptions.animation);\n const { ignoreEscapes = false } = scrollOptions;\n let durationElapsed;\n let startTarget = state.calculatedTargetScrollTop;\n if (scrollOptions.duration instanceof Promise) {\n scrollOptions.duration.finally(() => {\n durationElapsed = Date.now();\n });\n }\n else {\n durationElapsed = waitElapsed + (scrollOptions.duration ?? 0);\n }\n const next = async () => {\n const promise = new Promise(requestAnimationFrame).then(() => {\n if (!state.isAtBottom) {\n state.animation = undefined;\n return false;\n }\n const { scrollTop } = state;\n const tick = performance.now();\n const tickDelta = (tick - (state.lastTick ?? tick)) / SIXTY_FPS_INTERVAL_MS;\n state.animation || (state.animation = { behavior, promise, ignoreEscapes });\n if (state.animation.behavior === behavior) {\n state.lastTick = tick;\n }\n if (isSelecting()) {\n return next();\n }\n if (waitElapsed > Date.now()) {\n return next();\n }\n if (scrollTop < Math.min(startTarget, state.calculatedTargetScrollTop)) {\n if (state.animation?.behavior === behavior) {\n if (behavior === \"instant\") {\n state.scrollTop = state.calculatedTargetScrollTop;\n return next();\n }\n state.velocity =\n (behavior.damping * state.velocity +\n behavior.stiffness * state.scrollDifference) /\n behavior.mass;\n state.accumulated += state.velocity * tickDelta;\n state.scrollTop += state.accumulated;\n if (state.scrollTop !== scrollTop) {\n state.accumulated = 0;\n }\n }\n return next();\n }\n if (durationElapsed > Date.now()) {\n startTarget = state.calculatedTargetScrollTop;\n return next();\n }\n state.animation = undefined;\n /**\n * If we're still below the target, then queue\n * up another scroll to the bottom with the last\n * requested animatino.\n */\n if (state.scrollTop < state.calculatedTargetScrollTop) {\n return scrollToBottom({\n animation: mergeAnimations(optionsRef.current, optionsRef.current.resize),\n ignoreEscapes,\n duration: Math.max(0, durationElapsed - Date.now()) || undefined,\n });\n }\n return state.isAtBottom;\n });\n return promise.then((isAtBottom) => {\n requestAnimationFrame(() => {\n if (!state.animation) {\n state.lastTick = undefined;\n state.velocity = 0;\n }\n });\n return isAtBottom;\n });\n };\n if (scrollOptions.wait !== true) {\n state.animation = undefined;\n }\n if (state.animation?.behavior === behavior) {\n return state.animation.promise;\n }\n return next();\n }, [setIsAtBottom, isSelecting, state]);\n const stopScroll = useCallback(() => {\n setEscapedFromLock(true);\n setIsAtBottom(false);\n }, [setEscapedFromLock, setIsAtBottom]);\n const handleScroll = useCallback(({ target }) => {\n if (target !== scrollRef.current) {\n return;\n }\n const { scrollTop, ignoreScrollToTop } = state;\n let { lastScrollTop = scrollTop } = state;\n state.lastScrollTop = scrollTop;\n state.ignoreScrollToTop = undefined;\n if (ignoreScrollToTop && ignoreScrollToTop > scrollTop) {\n /**\n * When the user scrolls up while the animation plays, the `scrollTop` may\n * not come in separate events; if this happens, to make sure `isScrollingUp`\n * is correct, set the lastScrollTop to the ignored event.\n */\n lastScrollTop = ignoreScrollToTop;\n }\n setIsNearBottom(state.isNearBottom);\n /**\n * Scroll events may come before a ResizeObserver event,\n * so in order to ignore resize events correctly we use a\n * timeout.\n *\n * @see https://github.com/WICG/resize-observer/issues/25#issuecomment-248757228\n */\n setTimeout(() => {\n /**\n * When theres a resize difference ignore the resize event.\n */\n if (state.resizeDifference || scrollTop === ignoreScrollToTop) {\n return;\n }\n if (isSelecting()) {\n setEscapedFromLock(true);\n setIsAtBottom(false);\n return;\n }\n const isScrollingDown = scrollTop > lastScrollTop;\n const isScrollingUp = scrollTop < lastScrollTop;\n if (state.animation?.ignoreEscapes) {\n state.scrollTop = lastScrollTop;\n return;\n }\n if (isScrollingUp) {\n setEscapedFromLock(true);\n setIsAtBottom(false);\n }\n if (isScrollingDown) {\n setEscapedFromLock(false);\n }\n if (!state.escapedFromLock && state.isNearBottom) {\n setIsAtBottom(true);\n }\n }, 1);\n }, [setEscapedFromLock, setIsAtBottom, isSelecting, state]);\n const handleWheel = useCallback(({ target, deltaY }) => {\n let element = target;\n while (![\"scroll\", \"auto\"].includes(getComputedStyle(element).overflow)) {\n if (!element.parentElement) {\n return;\n }\n element = element.parentElement;\n }\n /**\n * The browser may cancel the scrolling from the mouse wheel\n * if we update it from the animation in meantime.\n * To prevent this, always escape when the wheel is scrolled up.\n */\n if (element === scrollRef.current &&\n deltaY < 0 &&\n scrollRef.current.scrollHeight > scrollRef.current.clientHeight &&\n !state.animation?.ignoreEscapes) {\n setEscapedFromLock(true);\n setIsAtBottom(false);\n }\n }, [setEscapedFromLock, setIsAtBottom, state]);\n const scrollRef = useRefCallback((scroll) => {\n scrollRef.current?.removeEventListener(\"scroll\", handleScroll);\n scrollRef.current?.removeEventListener(\"wheel\", handleWheel);\n scroll?.addEventListener(\"scroll\", handleScroll, { passive: true });\n scroll?.addEventListener(\"wheel\", handleWheel, { passive: true });\n }, []);\n const contentRef = useRefCallback((content) => {\n state.resizeObserver?.disconnect();\n if (!content) {\n return;\n }\n let previousHeight;\n state.resizeObserver = new ResizeObserver(([entry]) => {\n const { height } = entry.contentRect;\n const difference = height - (previousHeight ?? height);\n state.resizeDifference = difference;\n /**\n * Sometimes the browser can overscroll past the target,\n * so check for this and adjust appropriately.\n */\n if (state.scrollTop > state.targetScrollTop) {\n state.scrollTop = state.targetScrollTop;\n }\n setIsNearBottom(state.isNearBottom);\n if (difference >= 0) {\n /**\n * If it's a positive resize, scroll to the bottom when\n * we're already at the bottom.\n */\n const animation = mergeAnimations(optionsRef.current, previousHeight\n ? optionsRef.current.resize\n : optionsRef.current.initial);\n scrollToBottom({\n animation,\n wait: true,\n preserveScrollPosition: true,\n duration: animation === \"instant\" ? undefined : RETAIN_ANIMATION_DURATION_MS,\n });\n }\n else {\n /**\n * Else if it's a negative resize, check if we're near the bottom\n * if we are want to un-escape from the lock, because the resize\n * could have caused the container to be at the bottom.\n */\n if (state.isNearBottom) {\n setEscapedFromLock(false);\n setIsAtBottom(true);\n }\n }\n previousHeight = height;\n /**\n * Reset the resize difference after the scroll event\n * has fired. Requires a rAF to wait for the scroll event,\n * and a setTimeout to wait for the other timeout we have in\n * resizeObserver in case the scroll event happens after the\n * resize event.\n */\n requestAnimationFrame(() => {\n setTimeout(() => {\n if (state.resizeDifference === difference) {\n state.resizeDifference = 0;\n }\n }, 1);\n });\n });\n state.resizeObserver?.observe(content);\n }, []);\n return {\n contentRef,\n scrollRef,\n scrollToBottom,\n stopScroll,\n isAtBottom: isAtBottom || isNearBottom,\n isNearBottom,\n escapedFromLock,\n state,\n };\n};\nfunction useRefCallback(callback, deps) {\n // biome-ignore lint/correctness/useExhaustiveDependencies: not needed\n const result = useCallback((ref) => {\n result.current = ref;\n return callback(ref);\n }, deps);\n return result;\n}\nconst animationCache = new Map();\nfunction mergeAnimations(...animations) {\n const result = { ...DEFAULT_SPRING_ANIMATION };\n let instant = false;\n for (const animation of animations) {\n if (animation === \"instant\") {\n instant = true;\n continue;\n }\n if (typeof animation !== \"object\") {\n continue;\n }\n instant = false;\n result.damping = animation.damping ?? result.damping;\n result.stiffness = animation.stiffness ?? result.stiffness;\n result.mass = animation.mass ?? result.mass;\n }\n const key = JSON.stringify(result);\n if (!animationCache.has(key)) {\n animationCache.set(key, Object.freeze(result));\n }\n return instant ? \"instant\" : animationCache.get(key);\n}\n","import { jsx as _jsx } from \"react/jsx-runtime\";\n/*!---------------------------------------------------------------------------------------------\n * Copyright (c) StackBlitz. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport { createContext, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, } from \"react\";\nimport { useStickToBottom, } from \"./useStickToBottom.js\";\nconst StickToBottomContext = createContext(null);\nconst useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\nexport function StickToBottom({ instance, children, resize, initial, mass, damping, stiffness, targetScrollTop: currentTargetScrollTop, contextRef, ...props }) {\n const customTargetScrollTop = useRef(null);\n const targetScrollTop = React.useCallback((target, elements) => {\n const get = context?.targetScrollTop ?? currentTargetScrollTop;\n return get?.(target, elements) ?? target;\n }, [currentTargetScrollTop]);\n const defaultInstance = useStickToBottom({\n mass,\n damping,\n stiffness,\n resize,\n initial,\n targetScrollTop,\n });\n const { scrollRef, contentRef, scrollToBottom, stopScroll, isAtBottom, escapedFromLock, state, } = instance ?? defaultInstance;\n const context = useMemo(() => ({\n scrollToBottom,\n stopScroll,\n scrollRef,\n isAtBottom,\n escapedFromLock,\n contentRef,\n state,\n get targetScrollTop() {\n return customTargetScrollTop.current;\n },\n set targetScrollTop(targetScrollTop) {\n customTargetScrollTop.current = targetScrollTop;\n },\n }), [\n scrollToBottom,\n isAtBottom,\n contentRef,\n scrollRef,\n stopScroll,\n escapedFromLock,\n state,\n ]);\n useImperativeHandle(contextRef, () => context, [context]);\n useIsomorphicLayoutEffect(() => {\n if (!scrollRef.current) {\n return;\n }\n if (getComputedStyle(scrollRef.current).overflow === \"visible\") {\n scrollRef.current.style.overflow = \"auto\";\n }\n }, []);\n return (_jsx(StickToBottomContext.Provider, { value: context, children: _jsx(\"div\", { ...props, children: typeof children === \"function\" ? children(context) : children }) }));\n}\n(function (StickToBottom) {\n function Content({ children, ...props }) {\n const context = useStickToBottomContext();\n return (_jsx(\"div\", { ref: context.scrollRef, style: {\n height: \"100%\",\n width: \"100%\",\n }, children: _jsx(\"div\", { ...props, ref: context.contentRef, children: typeof children === \"function\" ? children(context) : children }) }));\n }\n StickToBottom.Content = Content;\n})(StickToBottom || (StickToBottom = {}));\n/**\n * Use this hook inside a <StickToBottom> component to gain access to whether the component is at the bottom of the scrollable area.\n */\nexport function useStickToBottomContext() {\n const context = useContext(StickToBottomContext);\n if (!context) {\n throw new Error(\"use-stick-to-bottom component context must be used within a StickToBottom component\");\n }\n return context;\n}\n"],"names":["AlertCircle","createLucideIcon","cx","cy","r","key","x1","x2","y1","y2","ArrowLeft","d","Book","CheckCircle2","ChevronDown","Info","Loader2","MessageSquare","Pencil","RefreshCcw","XCircle","_extends","Object","assign","bind","n","e","arguments","length","t","hasOwnProperty","call","apply","clamp","value","min","max","Math","DIALOG_NAME","createDialogContext","createDialogScope","createContextScope","DialogProvider","useDialogContext","Dialog","__scopeDialog","children","open","openProp","defaultOpen","onOpenChange","modal","props","triggerRef","React","contentRef","setOpen","useControllableState","prop","defaultProp","onChange","caller","jsx","scope","contentId","useId","titleId","descriptionId","onOpenToggle","prevOpen","displayName","TRIGGER_NAME","DialogTrigger","forwardedRef","triggerProps","context","composedTriggerRef","useComposedRefs","Primitive","button","type","getState","ref","onClick","composeEventHandlers","PORTAL_NAME","PortalProvider","usePortalContext","forceMount","DialogPortal","container","map","Presence","present","PortalPrimitive","asChild","child","OVERLAY_NAME","DialogOverlay","portalContext","overlayProps","DialogOverlayImpl","Slot","createSlot","RemoveScroll","as","allowPinchZoom","shards","div","style","pointerEvents","CONTENT_NAME","DialogContent","contentProps","DialogContentModal","DialogContentNonModal","composedRefs","content","current","hideOthers","DialogContentImpl","trapFocus","disableOutsidePointerEvents","onCloseAutoFocus","event","preventDefault","focus","onPointerDownOutside","originalEvent","detail","ctrlLeftClick","ctrlKey","onFocusOutside","hasInteractedOutsideRef","hasPointerDownOutsideRef","defaultPrevented","onInteractOutside","target","targetIsTrigger","contains","onOpenAutoFocus","useFocusGuards","jsxs","Fragment","FocusScope","loop","trapped","onMountAutoFocus","onUnmountAutoFocus","DismissableLayer","role","id","onDismiss","TitleWarning","DescriptionWarning","TITLE_NAME","DialogTitle","titleProps","h2","DESCRIPTION_NAME","DialogDescription","descriptionProps","p","CLOSE_NAME","DialogClose","closeProps","TITLE_WARNING_NAME","WarningProvider","useWarningContext","createContext","contentName","titleName","docsSlug","param","titleWarningContext","MESSAGE","concat","document","getElementById","console","error","descriptionWarningContext","describedById","getAttribute","warn","ROOT_NAME","createAlertDialogContext","createAlertDialogScope","useDialogScope","AlertDialog","__scopeAlertDialog","alertDialogProps","dialogScope","AlertDialogTrigger","AlertDialogPortal","portalProps","AlertDialogOverlay","AlertDialogContentProvider","useAlertDialogContentContext","Slottable","createSlottable","AlertDialogContent","cancelRef","DialogPrimitive","preventScroll","AlertDialogTitle","AlertDialogDescription","AlertDialogAction","actionProps","CANCEL_NAME","AlertDialogCancel","cancelProps","Root","Trigger","Portal","Overlay","Content","Action","Cancel","Title","Description","differenceInCalendarMonths","dateLeft","dateRight","_dateLeft","toDate","_dateRight","yearDiff","getFullYear","getMonth","endOfMonth","date","_date","month","setFullYear","setHours","compareAsc","diff","getTime","formatDistanceToNow","options","formatDistance","baseDate","method","months","defaultOptions","getDefaultOptions","locale","defaultLocale","comparison","isNaN","localizeOptions","addSuffix","seconds","getRoundingMethod","roundingMethod","result","round","trunc","number","minutes","getTimezoneOffsetInMilliseconds","offsetInSeconds","includeSeconds","minutesInDay","minutesInMonth","days","differenceInMonths","sign","difference","abs","getDate","setDate","setMonth","isLastMonthNotFull","isLastDayOfMonth","endOfDay","Number","nearestMonth","monthsSinceStartOfYear","years","constructFrom","Date","now","DEFAULT_SPRING_ANIMATION","damping","stiffness","mass","SIXTY_FPS_INTERVAL_MS","mouseDown","globalThis","addEventListener","useStickToBottom","escapedFromLock","updateEscapedFromLock","react","useState","isAtBottom","updateIsAtBottom","initial","isNearBottom","setIsNearBottom","optionsRef","useRef","isSelecting","useCallback","selection","window","getSelection","rangeCount","range","getRangeAt","commonAncestorContainer","scrollRef","setIsAtBottom","state","setEscapedFromLock","useMemo","lastCalculation","resizeDifference","accumulated","velocity","listeners","Set","scrollTop","ignoreScrollToTop","targetScrollTop","scrollHeight","clientHeight","calculatedTargetScrollTop","calculatedScrollTop","scrollElement","contentElement","requestAnimationFrame","undefined","scrollDifference","scrollToBottom","scrollOptions","durationElapsed","animation","preserveScrollPosition","waitElapsed","wait","behavior","mergeAnimations","ignoreEscapes","startTarget","duration","Promise","finally","next","promise","then","tick","performance","tickDelta","lastTick","resize","stopScroll","handleScroll","lastScrollTop","setTimeout","isScrollingDown","isScrollingUp","handleWheel","deltaY","element","includes","getComputedStyle","overflow","parentElement","useRefCallback","removeEventListener","scroll","passive","previousHeight","resizeObserver","disconnect","ResizeObserver","entry","height","contentRect","observe","callback","deps","animationCache","Map","animations","instant","JSON","stringify","has","set","freeze","get","StickToBottomContext","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","StickToBottom","instance","currentTargetScrollTop","contextRef","customTargetScrollTop","defaultInstance","elements","useImperativeHandle","jsx_runtime","Provider","useStickToBottomContext","useContext","width"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6367],{76367:function(e,s,t){t.d(s,{$:function(){return S}});var a=t(57437),i=t(2265),l=t(66070),n=t(62869),r=t(35974),c=t(84190),d=t(31810),o=t(17684),m=t(78867),u=t(15868),x=t(18930),h=t(82222),p=t(42488),v=t(53417),f=t(92369),j=t(31047),g=t(91723),N=t(84544),w=t(12194),y=t(35283),b=t(14438),C=t(7211),_=t(27689),A=t(7598);function S(e){var s,t;let{prompt:S,user:D,onUpdate:Z}=e,[k,P]=(0,i.useState)(!1),[z,F]=(0,i.useState)(!1),[E]=(0,w.iJ)(),{toggleFavorite:B}=(0,w.Lq)(),R=function(e,s){var t,a,i,l;let n="private"===e.rights_mode,r="public"===e.rights_mode,c="users"===e.rights_mode,d="roles"===e.rights_mode,o=s.super_admin,m=e.created_by===s.id.toString(),u=!1;if(m&&(u=!0),!n||m||o||(u=!1),r&&(u=!0),c){let i=null===(a=e.RBAC)||void 0===a?void 0:null===(t=a.users)||void 0===t?void 0:t.find(e=>e.id===s.id);u=(null==i?void 0:i.rights)==="write"}if(d){let t=null===(l=e.RBAC)||void 0===l?void 0:null===(i=l.roles)||void 0===i?void 0:i.find(e=>{var t;return e.id===(null===(t=s.role)||void 0===t?void 0:t.id)});u=(null==t?void 0:t.rights)==="write"}return o&&(u=!0),u}(S,D),I=(0,N.H)(S.content),M=S.is_favorited||!1,{data:U}=(0,C.aM)(_.W9,{variables:{ids:S.assigned_agents||[]},skip:!S.assigned_agents||0===S.assigned_agents.length}),V=(null==U?void 0:null===(s=U.agentByIds)||void 0===s?void 0:s.map(e=>e.name))||[],{data:q}=(0,C.aM)(_.L5,{variables:{id:S.created_by},skip:!S.created_by}),O=(null==q?void 0:null===(t=q.userById)||void 0===t?void 0:t.name)||"Unknown",L=async()=>{if(confirm("Are you sure you want to delete this prompt?"))try{await E({variables:{id:S.id}}),b.Am.success("Prompt deleted successfully"),Z()}catch(e){b.Am.error("Failed to delete prompt"),console.error(e)}},Q=async()=>{if(!z){F(!0);try{await B(S.id,D.id,M,S.favorite_count,void 0),b.Am.success(M?"Removed from favorites":"Added to favorites",{icon:M?"\uD83D\uDC4E":"\uD83D\uDC4D",duration:2e3}),Z()}catch(e){b.Am.error("Failed to update favorite"),console.error(e)}finally{await new Promise(e=>setTimeout(e,200)),F(!1)}}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(l.Zb,{className:"flex flex-col hover:shadow-md transition-shadow",children:[(0,a.jsx)(l.Ol,{className:"pb-3",children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h3",{className:"font-semibold text-lg truncate",children:S.name}),S.description&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:S.description})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(n.z,{variant:"ghost",size:"icon",className:"h-8 w-8 transition-all ".concat(z?"scale-125":""," ").concat(M?"text-yellow-500":""),onClick:Q,disabled:z,children:(0,a.jsx)(d.Z,{className:"h-4 w-4 transition-all ".concat(z?"animate-pulse":""," ").concat(M?"fill-yellow-400 text-yellow-400":"")})}),(0,a.jsxs)(c.h_,{modal:!1,children:[(0,a.jsx)(c.$F,{asChild:!0,children:(0,a.jsx)(n.z,{variant:"ghost",size:"icon",className:"h-8 w-8",children:(0,a.jsx)(o.Z,{className:"h-4 w-4"})})}),(0,a.jsxs)(c.AW,{align:"end",children:[(0,a.jsxs)(c.Xi,{onClick:()=>{navigator.clipboard.writeText(S.content),b.Am.success("Prompt copied to clipboard")},children:[(0,a.jsx)(m.Z,{className:"mr-2 h-4 w-4"}),"Copy Content"]}),R&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.Xi,{onClick:()=>P(!0),children:[(0,a.jsx)(u.Z,{className:"mr-2 h-4 w-4"}),"Edit"]}),(0,a.jsxs)(c.Xi,{onClick:L,className:"text-destructive",children:[(0,a.jsx)(x.Z,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]})]})]})}),(0,a.jsx)(l.aY,{className:"flex-1 pb-3",children:(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-3",children:S.content}),I.length>0&&(0,a.jsxs)(r.C,{variant:"outline",className:"text-xs",children:[I.length," variable",1!==I.length?"s":""]}),V.length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,a.jsx)(h.Z,{className:"h-3 w-3"}),(0,a.jsx)("span",{className:"font-medium",children:"Works with:"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[V.slice(0,2).map((e,s)=>(0,a.jsx)(r.C,{variant:"default",className:"text-xs bg-primary/10 text-primary hover:bg-primary/20",children:e},s)),V.length>2&&(0,a.jsxs)(r.C,{variant:"default",className:"text-xs bg-primary/10 text-primary hover:bg-primary/20",children:["+",V.length-2," more"]})]})]})]})}),(0,a.jsxs)(l.eW,{className:"flex flex-col gap-3 pt-3 border-t",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 transition-all ".concat(z?"scale-125":""," ").concat(M?"text-yellow-500":""),children:[(0,a.jsx)(d.Z,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:S.favorite_count||0})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",title:"Times used",children:[(0,a.jsx)(p.Z,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:S.usage_count||0})]})]}),(0,a.jsxs)(n.z,{variant:"secondary",size:"sm",type:"button",onClick:()=>P(!0),children:[(0,a.jsx)(v.Z,{className:"mr-2 h-3.5 w-3.5"}),"View"]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5 text-xs text-muted-foreground w-full",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(f.Z,{className:"h-3 w-3"}),(0,a.jsxs)("span",{children:["Created by ",O]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(j.Z,{className:"h-3 w-3"}),(0,a.jsxs)("span",{children:["Created ",(0,A.Q)(new Date(S.createdAt),{addSuffix:!0})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(g.Z,{className:"h-3 w-3"}),(0,a.jsxs)("span",{children:["Updated ",(0,A.Q)(new Date(S.updatedAt),{addSuffix:!0})]})]})]})]})]}),(0,a.jsx)(y.D,{open:k,onOpenChange:P,prompt:S,onSuccess:Z,user:D})]})}},35283:function(e,s,t){t.d(s,{D:function(){return _}});var a=t(57437),i=t(2265),l=t(26110),n=t(62869),r=t(95186),c=t(26815),d=t(76818),o=t(35974),m=t(25846),u=t(24156),x=t(30401),h=t(32489),p=t(12194),v=t(84544),f=t(8014),j=t(14438),g=t(74928),N=t(23518),w=t(57054),y=t(7211),b=t(27689),C=t(94508);function _(e){var s;let{open:t,onOpenChange:_,prompt:A,onSuccess:S,user:D,defaultAssignedAgents:Z=[]}=e,k=!!A,[P,{loading:z}]=(0,p.EE)(),[F,{loading:E}]=(0,p.er)(),[B,R]=(0,i.useState)(""),[I,M]=(0,i.useState)(""),[U,V]=(0,i.useState)(""),[q,O]=(0,i.useState)("private"),[L,Q]=(0,i.useState)([]),[T,W]=(0,i.useState)([]),[$,H]=(0,i.useState)(!1),[J,X]=(0,i.useState)([]),[Y,K]=(0,i.useState)(!1),{data:G}=(0,y.aM)(b.ym,{variables:{page:1,limit:100}}),ee=(null==G?void 0:null===(s=G.agentsPagination)||void 0===s?void 0:s.items)||[],es=(0,v.H)(U),{isValid:et,invalidVariables:ea}=function(e){if(!e)return{isValid:!0,invalidVariables:[]};let s=e.matchAll(/\{\{([^}]+)\}\}/g),t=[];for(let e of Array.from(s)){let s=e[1];s&&/^[a-zA-Z0-9_]+$/.test(s)||t.push(s)}return{isValid:0===t.length,invalidVariables:t}}(U);(0,i.useEffect)(()=>{if(t){if(A){var e,s;R(A.name),M(A.description||""),V(A.content),O(A.rights_mode),Q((null===(e=A.RBAC)||void 0===e?void 0:e.users)||[]),W((null===(s=A.RBAC)||void 0===s?void 0:s.roles)||[]),X(A.assigned_agents||[])}else ei(),Z&&Z.length>0&&X(Z)}},[A,t]);let ei=()=>{R(""),M(""),V(""),O("private"),Q([]),W([]),H(!1),X([])},el=async()=>{if(!B.trim()){j.Am.error("Please enter a name for the prompt");return}if(!U.trim()){j.Am.error("Please enter prompt content");return}if(!et){j.Am.error("Invalid variable names: ".concat(ea.join(", "),". Use only letters, numbers, and underscores."));return}try{let e={name:B.trim(),description:I.trim()||void 0,content:U.trim(),rights_mode:q,RBAC:"private"!==q&&"public"!==q?{users:L.length>0?L:void 0,roles:T.length>0?T:void 0}:void 0,assigned_agents:J.length>0?J:void 0};k?(await F({variables:{id:A.id,...e}}),j.Am.success("Prompt updated successfully")):(await P({variables:e}),j.Am.success("Prompt created successfully")),S(),_(!1),ei()}catch(e){console.error(e),j.Am.error(k?"Failed to update prompt":"Failed to create prompt")}};return(0,a.jsx)(l.Vq,{open:t,onOpenChange:_,children:(0,a.jsxs)(l.cZ,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,a.jsxs)(l.fK,{children:[(0,a.jsx)(l.$N,{children:k?"Edit Prompt":"Create New Prompt"}),(0,a.jsx)(l.Be,{children:k?"Update your prompt template":"Create a reusable prompt template with variables"})]}),(0,a.jsxs)("div",{className:"space-y-6 py-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)(c._,{htmlFor:"name",children:["Name ",(0,a.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,a.jsx)(r.I,{id:"name",placeholder:"Customer Support Template",value:B,onChange:e=>R(e.target.value)})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c._,{htmlFor:"description",children:"Description"}),(0,a.jsx)(r.I,{id:"description",placeholder:"Brief description of this prompt",value:I,onChange:e=>M(e.target.value)})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)(c._,{htmlFor:"content",children:["Prompt Content ",(0,a.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,a.jsx)(d.g,{id:"content",placeholder:"You are helping {{customer_name}} with their {{issue}}...",value:U,onChange:e=>V(e.target.value),rows:8,className:"font-mono text-sm"}),(0,a.jsxs)("div",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5 mt-0.5 flex-shrink-0"}),(0,a.jsxs)("span",{children:["Use"," ",(0,a.jsxs)("code",{className:"bg-muted px-1 py-0.5 rounded",children:["{","{","variable_name","}}"]})," ","format for dynamic content. Variable names can only contain letters, numbers, and underscores."]})]}),es.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 pt-2",children:[(0,a.jsx)("span",{className:"text-xs text-muted-foreground mr-2",children:"Detected variables:"}),es.map(e=>(0,a.jsx)(o.C,{variant:"outline",className:"text-xs",children:e},e))]}),!et&&(0,a.jsxs)("div",{className:"text-xs text-destructive",children:["Invalid variable names: ",ea.join(", ")]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c._,{children:"Assign to Agents"}),(0,a.jsxs)(w.J2,{modal:!0,open:Y,onOpenChange:K,children:[(0,a.jsx)(w.xo,{asChild:!0,children:(0,a.jsxs)(n.z,{variant:"outline",role:"combobox","aria-expanded":Y,className:"w-full justify-between",children:[0===J.length?"Select agents...":"".concat(J.length," agent").concat(1!==J.length?"s":""," selected"),(0,a.jsx)(u.Z,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(w.yk,{className:"w-full p-0",children:(0,a.jsxs)(N.mY,{children:[(0,a.jsx)(N.sZ,{placeholder:"Search agents..."}),(0,a.jsxs)(N.e8,{children:[(0,a.jsx)(N.rb,{children:"No agents found."}),(0,a.jsx)(N.fu,{children:ee.map(e=>(0,a.jsxs)(N.di,{value:e.id,onSelect:()=>{X(s=>s.includes(e.id)?s.filter(s=>s!==e.id):[...s,e.id])},children:[(0,a.jsx)(x.Z,{className:(0,C.cn)("mr-2 h-4 w-4",J.includes(e.id)?"opacity-100":"opacity-0")}),e.name]},e.id))})]})]})})]}),J.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-2 pt-2",children:J.map(e=>{let s=ee.find(s=>s.id===e);return s?(0,a.jsxs)(o.C,{variant:"secondary",className:"text-sm",children:[s.name,(0,a.jsx)("button",{type:"button",onClick:()=>X(s=>s.filter(s=>s!==e)),className:"ml-1.5 hover:text-destructive",children:(0,a.jsx)(h.Z,{className:"h-3 w-3"})})]},e):null})}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Assign this prompt to specific agents to show it as recommended in chat"})]}),(0,a.jsx)(g.zF,{open:$,onOpenChange:H,children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(g.wy,{asChild:!0,children:(0,a.jsxs)(n.z,{variant:"outline",className:"w-full justify-between",children:["Access Control",(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:["private"===q&&"Private","public"===q&&"Public","users"===q&&"".concat(L.length," users"),"roles"===q&&"".concat(T.length," roles")]})]})}),(0,a.jsx)(g.Fw,{className:"pt-2",children:(0,a.jsx)(f.P,{initialRightsMode:q,initialUsers:L,initialRoles:T,modalMode:!0,onChange:(e,s,t)=>{O(e),Q(s),W(t)}})})]})})]}),(0,a.jsxs)(l.cN,{children:[(0,a.jsx)(n.z,{variant:"outline",onClick:()=>_(!1),children:"Cancel"}),(0,a.jsx)(n.z,{onClick:el,disabled:z||E||!B.trim()||!U.trim()||!et,children:z||E?"Saving...":k?"Save Changes":"Create Prompt"})]})]})})}},12194:function(e,s,t){t.d(s,{EE:function(){return r},Lq:function(){return x},Sh:function(){return n},VR:function(){return o},er:function(){return c},iJ:function(){return d}});var a=t(7211),i=t(12199),l=t(27689);let n=e=>{var s,t,i,n;return(0,a.aM)(l.xx,{variables:{page:null!==(s=null==e?void 0:e.page)&&void 0!==s?s:1,limit:null!==(t=null==e?void 0:e.limit)&&void 0!==t?t:20,filters:null!==(i=null==e?void 0:e.filters)&&void 0!==i?i:[],sort:null!==(n=null==e?void 0:e.sort)&&void 0!==n?n:{field:"updatedAt",direction:"DESC"}}})},r=()=>(0,i.D)(l.Iv,{refetchQueries:[{query:l.xx,variables:{page:1,limit:20}}]}),c=()=>(0,i.D)(l.jA),d=()=>(0,i.D)(l.Ll,{refetchQueries:[{query:l.xx,variables:{page:1,limit:20}}]}),o=()=>(0,i.D)(l.re),m=()=>(0,i.D)(l.Nl),u=()=>(0,i.D)(l.m8),x=()=>{let[e]=m(),[s]=u(),[t]=(0,i.D)(l.UK);return{toggleFavorite:async(a,i,l,n,r)=>{l&&r?(await s({variables:{id:r}}),await t({variables:{id:a,favorite_count:Math.max(0,n-1)}})):(await e({variables:{user_id:i,prompt_id:a}}),await t({variables:{id:a,favorite_count:n+1}}))}}}},84544:function(e,s,t){t.d(s,{H:function(){return a}});function a(e){if(!e)return[];let s=e.matchAll(/\{\{([a-zA-Z0-9_]+)\}\}/g),t=new Set;for(let e of Array.from(s))t.add(e[1]);return Array.from(t).sort()}}}]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,EAA0B,IAC9BN,CAAAA,EAAAA,EAAAA,CAAAA,EAEJO,EAAAA,EAAsBA,EAgBdC,EAA0B,IAC9BR,CAAAA,EAAAA,EAAAA,CAAAA,EACLS,EAAAA,EAAsBA,EAObC,EAA0B,IAC9BV,CAAAA,EAAAA,EAAAA,CAAAA,EACLW,EAAAA,EAAsBA,EAQbrO,EAA0B,KACrC,GAAM,CAACsO,EAAe,CAAGJ,IACnB,CAACK,EAAe,CAAGH,IACnB,CAACI,EAAmB,CAAGd,CAAAA,EAAAA,EAAAA,CAAAA,EAAYe,EAAAA,EAA0BA,EA6BnE,MAAO,CAAE1O,eA3Bc,MACrB2O,EACAC,EACA/M,EACAgN,EACAC,KAEIjN,GAAeiN,GAEjB,MAAMN,EAAe,CAAE9M,UAAW,CAAEb,GAAIiO,CAAW,CAAE,GACrD,MAAML,EAAmB,CACvB/M,UAAW,CACTb,GAAI8N,EACJtL,eAAgB0L,KAAKC,GAAG,CAAC,EAAGH,EAAuB,EACrD,CACF,KAGA,MAAMN,EAAe,CACnB7M,UAAW,CAAEuN,QAASL,EAAQM,UAAWP,CAAS,CACpD,GACA,MAAMF,EAAmB,CACvB/M,UAAW,CAAEb,GAAI8N,EAAUtL,eAAgBwL,EAAuB,CAAE,CACtE,GAEJ,CAEwB,CAC1B,yDCvKO,SAASlN,EAAiBC,CAAe,EAC9C,GAAI,CAACA,EAAS,MAAO,EAAE,CAIvB,IAAMyH,EAAUzH,EAAQ0H,QAAQ,CADlB,4BAER5H,EAAY,IAAIyN,IAEtB,IAAK,IAAM5F,KAASC,MAAMC,IAAI,CAACJ,GAC7B3H,EAAU0N,GAAG,CAAC7F,CAAK,CAAC,EAAE,EAGxB,OAAOC,MAAMC,IAAI,CAAC/H,GAAW8L,IAAI,EACnC","sources":["webpack://_N_E/./lib/prompts/check-prompt-access.ts","webpack://_N_E/./app/(application)/prompts/components/prompt-card.tsx","webpack://_N_E/./lib/prompts/validate-variable-name.ts","webpack://_N_E/./app/(application)/prompts/components/prompt-editor-modal.tsx","webpack://_N_E/./hooks/use-prompts.tsx","webpack://_N_E/./lib/prompts/extract-variables.ts"],"sourcesContent":["import { PromptLibrary } from \"@/types/models/prompt-library\";\nimport { UserWithRole } from \"@/types/models/user\";\n\n/**\n * Checks if a user has write access to a prompt\n *\n * @param prompt - The prompt to check access for\n * @param user - The user to check access for\n * @returns true if user has write access, false otherwise\n */\nexport function checkPromptWriteAccess(\n prompt: PromptLibrary,\n user: UserWithRole\n): boolean {\n const isPrivate = prompt.rights_mode === \"private\";\n const isPublic = prompt.rights_mode === \"public\";\n const byUsers = prompt.rights_mode === \"users\";\n const byRoles = prompt.rights_mode === \"roles\";\n const isAdmin = user.super_admin;\n const isCreator = prompt.created_by === user.id.toString();\n\n let writeAccess = false;\n\n // Creator always has write access\n if (isCreator) {\n writeAccess = true;\n }\n\n // Private: only creator + admins\n if (isPrivate && !isCreator && !isAdmin) {\n writeAccess = false;\n }\n\n // Public: everyone has write access\n if (isPublic) {\n writeAccess = true;\n }\n\n // By users: check if user has write permission\n if (byUsers) {\n const userAccess = prompt.RBAC?.users?.find((u) => u.id === user.id);\n writeAccess = userAccess?.rights === \"write\";\n }\n\n // By roles: check if user's role has write permission\n if (byRoles) {\n const roleAccess = prompt.RBAC?.roles?.find((r) => r.id === user.role?.id);\n writeAccess = roleAccess?.rights === \"write\";\n }\n\n // Admin override\n if (isAdmin) {\n writeAccess = true;\n }\n\n return writeAccess;\n}\n\n/**\n * Checks if a user has read access to a prompt\n *\n * @param prompt - The prompt to check access for\n * @param user - The user to check access for\n * @returns true if user has read access, false otherwise\n */\nexport function checkPromptReadAccess(\n prompt: PromptLibrary,\n user: UserWithRole\n): boolean {\n const isPrivate = prompt.rights_mode === \"private\";\n const isPublic = prompt.rights_mode === \"public\";\n const byUsers = prompt.rights_mode === \"users\";\n const byRoles = prompt.rights_mode === \"roles\";\n const isAdmin = user.super_admin;\n const isCreator = prompt.created_by === user.id.toString();\n\n // Creator always has read access\n if (isCreator) {\n return true;\n }\n\n // Admin always has read access\n if (isAdmin) {\n return true;\n }\n\n // Private: only creator + admins\n if (isPrivate) {\n return false;\n }\n\n // Public: everyone has read access\n if (isPublic) {\n return true;\n }\n\n // By users: check if user has read or write permission\n if (byUsers) {\n const userAccess = prompt.RBAC?.users?.find((u) => u.id === user.id);\n return userAccess !== undefined;\n }\n\n // By roles: check if user's role has read or write permission\n if (byRoles) {\n const roleAccess = prompt.RBAC?.roles?.find((r) => r.id === user.role?.id);\n return roleAccess !== undefined;\n }\n\n // By projects: would need project context to check\n /* if (prompt.rights_mode === \"projects\") {\n // This would require project context - for now return false\n // Can be enhanced when project context is available\n return false;\n } */\n\n return false;\n}\n","import { useState } from \"react\";\nimport { PromptLibrary } from \"@/types/models/prompt-library\";\nimport { UserWithRole } from \"@/types/models/user\";\nimport { Card, CardContent, CardFooter, CardHeader } from \"@/components/ui/card\";\nimport { Button } from \"@/components/ui/button\";\nimport { Badge } from \"@/components/ui/badge\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport {\n Edit,\n Trash2,\n MoreVertical,\n Star,\n Activity,\n MessageSquare,\n Copy,\n Bot,\n User,\n Calendar,\n Clock,\n ThumbsUp,\n} from \"lucide-react\";\nimport { checkPromptWriteAccess } from \"@/lib/prompts/check-prompt-access\";\nimport { extractVariables } from \"@/lib/prompts/extract-variables\";\nimport { useDeletePrompt, useTogglePromptFavorite } from \"@/hooks/use-prompts\";\nimport { PromptEditorModal } from \"./prompt-editor-modal\";\nimport { toast } from \"sonner\";\nimport { useQuery } from \"@apollo/client\";\nimport { GET_AGENTS_BY_IDS, GET_USER_BY_ID } from \"@/queries/queries\";\nimport { formatDistanceToNow } from \"date-fns\";\n\ninterface PromptCardProps {\n prompt: PromptLibrary;\n user: UserWithRole;\n onUpdate: () => void;\n}\n\nexport function PromptCard({ prompt, user, onUpdate }: PromptCardProps) {\n const [isEditModalOpen, setIsEditModalOpen] = useState(false);\n const [isFavoriting, setIsFavoriting] = useState(false);\n const [deletePrompt] = useDeletePrompt();\n const { toggleFavorite } = useTogglePromptFavorite();\n\n const hasWriteAccess = checkPromptWriteAccess(prompt, user);\n const variables = extractVariables(prompt.content);\n const isFavorited = prompt.is_favorited || false;\n\n // Fetch only the assigned agents by their IDs\n const { data: agentsData } = useQuery(GET_AGENTS_BY_IDS, {\n variables: { ids: prompt.assigned_agents || [] },\n skip: !prompt.assigned_agents || prompt.assigned_agents.length === 0,\n });\n\n const assignedAgentNames =\n agentsData?.agentByIds?.map((agent: any) => agent.name) || [];\n\n // Fetch creator information\n const { data: creatorData } = useQuery(GET_USER_BY_ID, {\n variables: { id: prompt.created_by },\n skip: !prompt.created_by,\n });\n\n const creatorName = creatorData?.userById?.name || \"Unknown\";\n\n const handleDelete = async () => {\n if (confirm(\"Are you sure you want to delete this prompt?\")) {\n try {\n await deletePrompt({ variables: { id: prompt.id } });\n toast.success(\"Prompt deleted successfully\");\n onUpdate();\n } catch (error) {\n toast.error(\"Failed to delete prompt\");\n console.error(error);\n }\n }\n };\n\n const handleToggleFavorite = async () => {\n if (isFavoriting) return; // Prevent double-clicks\n\n setIsFavoriting(true);\n try {\n // This is a simplified version - you'd need to fetch the favorite ID\n // and current favorite status from the backend\n await toggleFavorite(\n prompt.id,\n user.id,\n isFavorited,\n prompt.favorite_count,\n undefined // favoriteId would come from querying favorites\n );\n toast.success(\n isFavorited ? \"Removed from favorites\" : \"Added to favorites\",\n {\n icon: isFavorited ? \"👎\" : \"👍\",\n duration: 2000,\n }\n );\n onUpdate();\n } catch (error) {\n toast.error(\"Failed to update favorite\");\n console.error(error);\n } finally {\n // wait 1 second\n await new Promise(resolve => setTimeout(resolve, 200));\n setIsFavoriting(false);\n }\n };\n\n const handleCopyContent = () => {\n navigator.clipboard.writeText(prompt.content);\n toast.success(\"Prompt copied to clipboard\");\n };\n\n return (\n <>\n <Card className=\"flex flex-col hover:shadow-md transition-shadow\">\n <CardHeader className=\"pb-3\">\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"font-semibold text-lg truncate\">{prompt.name}</h3>\n {prompt.description && (\n <p className=\"text-sm text-muted-foreground line-clamp-2 mt-1\">\n {prompt.description}\n </p>\n )}\n </div>\n <div className=\"flex items-center gap-1\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={`h-8 w-8 transition-all ${isFavoriting ? \"scale-125\" : \"\"\n } ${isFavorited ? \"text-yellow-500\" : \"\"}`}\n onClick={handleToggleFavorite}\n disabled={isFavoriting}\n >\n <ThumbsUp\n className={`h-4 w-4 transition-all ${isFavoriting ? \"animate-pulse\" : \"\"\n } ${isFavorited ? \"fill-yellow-400 text-yellow-400\" : \"\"}`}\n />\n </Button>\n <DropdownMenu modal={false}>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"icon\" className=\"h-8 w-8\">\n <MoreVertical className=\"h-4 w-4\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem onClick={handleCopyContent}>\n <Copy className=\"mr-2 h-4 w-4\" />\n Copy Content\n </DropdownMenuItem>\n {hasWriteAccess && (\n <>\n <DropdownMenuItem onClick={() => setIsEditModalOpen(true)}>\n <Edit className=\"mr-2 h-4 w-4\" />\n Edit\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={handleDelete}\n className=\"text-destructive\"\n >\n <Trash2 className=\"mr-2 h-4 w-4\" />\n Delete\n </DropdownMenuItem>\n </>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n </div>\n </CardHeader>\n\n <CardContent className=\"flex-1 pb-3\">\n <div className=\"space-y-3\">\n {/* Content Preview */}\n <p className=\"text-sm text-muted-foreground line-clamp-3\">\n {prompt.content}\n </p>\n\n {/* Variables Badge */}\n {variables.length > 0 && (\n <Badge variant=\"outline\" className=\"text-xs\">\n {variables.length} variable{variables.length !== 1 ? \"s\" : \"\"}\n </Badge>\n )}\n\n {/* Assigned Agents */}\n {assignedAgentNames.length > 0 && (\n <div className=\"flex flex-col gap-1.5\">\n <div className=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Bot className=\"h-3 w-3\" />\n <span className=\"font-medium\">Works with:</span>\n </div>\n <div className=\"flex flex-wrap gap-1\">\n {assignedAgentNames.slice(0, 2).map((name, index) => (\n <Badge\n key={index}\n variant=\"default\"\n className=\"text-xs bg-primary/10 text-primary hover:bg-primary/20\"\n >\n {name}\n </Badge>\n ))}\n {assignedAgentNames.length > 2 && (\n <Badge\n variant=\"default\"\n className=\"text-xs bg-primary/10 text-primary hover:bg-primary/20\"\n >\n +{assignedAgentNames.length - 2} more\n </Badge>\n )}\n </div>\n </div>\n )}\n </div>\n </CardContent>\n\n <CardFooter className=\"flex flex-col gap-3 pt-3 border-t\">\n {/* Stats Row */}\n <div className=\"flex items-center justify-between w-full\">\n <div className=\"flex items-center gap-3 text-xs text-muted-foreground\">\n <div className={`flex items-center gap-1 transition-all ${isFavoriting ? \"scale-125\" : \"\"\n } ${isFavorited ? \"text-yellow-500\" : \"\"}`}>\n <ThumbsUp className=\"h-3.5 w-3.5\" />\n <span>{prompt.favorite_count || 0}</span>\n\n </div>\n <div className=\"flex items-center gap-1\" title=\"Times used\">\n <Activity className=\"h-3.5 w-3.5\" />\n <span>{prompt.usage_count || 0}</span>\n </div>\n </div>\n <Button\n variant=\"secondary\"\n size=\"sm\"\n type=\"button\"\n onClick={() => setIsEditModalOpen(true)}\n >\n <MessageSquare className=\"mr-2 h-3.5 w-3.5\" />\n View\n </Button>\n </div>\n\n {/* Metadata Row */}\n <div className=\"flex flex-col gap-1.5 text-xs text-muted-foreground w-full\">\n <div className=\"flex items-center gap-1\">\n <User className=\"h-3 w-3\" />\n <span>Created by {creatorName}</span>\n </div>\n <div className=\"flex items-center gap-1\">\n <Calendar className=\"h-3 w-3\" />\n <span>\n Created {formatDistanceToNow(new Date(prompt.createdAt), { addSuffix: true })}\n </span>\n </div>\n <div className=\"flex items-center gap-1\">\n <Clock className=\"h-3 w-3\" />\n <span>\n Updated {formatDistanceToNow(new Date(prompt.updatedAt), { addSuffix: true })}\n </span>\n </div>\n </div>\n </CardFooter>\n </Card>\n\n <PromptEditorModal\n open={isEditModalOpen}\n onOpenChange={setIsEditModalOpen}\n prompt={prompt}\n onSuccess={onUpdate}\n user={user}\n />\n </>\n );\n}\n","/**\n * Validates that a variable name follows the allowed pattern\n * Valid: alphanumeric characters and underscores only\n *\n * @param variable - The variable name to validate\n * @returns true if valid, false otherwise\n *\n * @example\n * validateVariableName(\"customer_name\") // Returns: true\n * validateVariableName(\"issue-id\") // Returns: false (hyphen not allowed)\n * validateVariableName(\"user@email\") // Returns: false (@ not allowed)\n */\nexport function validateVariableName(variable: string): boolean {\n if (!variable) return false;\n\n // Only allow alphanumeric characters and underscores\n const validPattern = /^[a-zA-Z0-9_]+$/;\n return validPattern.test(variable);\n}\n\n/**\n * Validates all variables in a prompt content\n *\n * @param content - The prompt content to validate\n * @returns Object with isValid boolean and array of invalid variables\n *\n * @example\n * validatePromptVariables(\"Hello {{name}}, issue {{issue-id}}\")\n * // Returns: { isValid: false, invalidVariables: [\"issue-id\"] }\n */\nexport function validatePromptVariables(content: string): {\n isValid: boolean;\n invalidVariables: string[];\n} {\n if (!content) return { isValid: true, invalidVariables: [] };\n\n // Match all {{...}} patterns, including invalid ones\n const regex = /\\{\\{([^}]+)\\}\\}/g;\n const matches = content.matchAll(regex);\n const invalidVariables: string[] = [];\n\n for (const match of Array.from(matches)) {\n const variableName = match[1];\n if (!validateVariableName(variableName)) {\n invalidVariables.push(variableName);\n }\n }\n\n return {\n isValid: invalidVariables.length === 0,\n invalidVariables,\n };\n}\n","import { useState, useEffect } from \"react\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from \"@/components/ui/dialog\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { Label } from \"@/components/ui/label\";\nimport { Textarea } from \"@/components/ui/textarea\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { X, Lightbulb, Check, ChevronsUpDown } from \"lucide-react\";\nimport { PromptLibrary } from \"@/types/models/prompt-library\";\nimport { UserWithRole } from \"@/types/models/user\";\nimport { useCreatePrompt, useUpdatePrompt } from \"@/hooks/use-prompts\";\nimport { extractVariables, validatePromptVariables } from \"@/lib/prompts\";\nimport { RBACControl } from \"@/components/rbac\";\nimport { toast } from \"sonner\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"@/components/ui/command\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@/components/ui/popover\";\nimport { useQuery } from \"@apollo/client\";\nimport { GET_AGENTS } from \"@/queries/queries\";\nimport { cn } from \"@/lib/utils\";\n\ninterface PromptEditorModalProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n prompt?: PromptLibrary;\n onSuccess: () => void;\n user: UserWithRole;\n defaultAssignedAgents?: string[];\n}\n\nexport function PromptEditorModal({\n open,\n onOpenChange,\n prompt,\n onSuccess,\n user,\n defaultAssignedAgents = [],\n}: PromptEditorModalProps) {\n const isEditing = !!prompt;\n const [createPrompt, { loading: creating }] = useCreatePrompt();\n const [updatePrompt, { loading: updating }] = useUpdatePrompt();\n\n // Form state\n const [name, setName] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [content, setContent] = useState(\"\");\n const [rightsMode, setRightsMode] = useState<\n \"private\" | \"users\" | \"roles\" | \"public\"/* | \"projects\" */\n >(\"private\");\n const [rbacUsers, setRbacUsers] = useState<\n { id: number; rights: \"read\" | \"write\" }[]\n >([]);\n const [rbacRoles, setRbacRoles] = useState<\n { id: string; rights: \"read\" | \"write\" }[]\n >([]);\n /* const [rbacProjects, setRbacProjects] = useState<\n { id: string; rights: \"read\" | \"write\" }[]\n >([]); */\n const [rbacOpen, setRbacOpen] = useState(false);\n const [assignedAgents, setAssignedAgents] = useState<string[]>([]);\n const [agentSelectorOpen, setAgentSelectorOpen] = useState(false);\n\n // Fetch agents\n const { data: agentsData } = useQuery(GET_AGENTS, {\n variables: { page: 1, limit: 100 },\n });\n\n const agents = agentsData?.agentsPagination?.items || [];\n\n // Extract variables from content\n const variables = extractVariables(content);\n const { isValid, invalidVariables } = validatePromptVariables(content);\n\n // Initialize form when editing\n useEffect(() => {\n if (!open) return; // Only run when modal opens\n\n if (prompt) {\n setName(prompt.name);\n setDescription(prompt.description || \"\");\n setContent(prompt.content);\n setRightsMode(prompt.rights_mode);\n setRbacUsers(prompt.RBAC?.users || []);\n setRbacRoles(prompt.RBAC?.roles || []);\n // setRbacProjects(prompt.RBAC?.projects || []);\n setAssignedAgents(prompt.assigned_agents || []);\n } else {\n resetForm();\n // Apply default assigned agents when creating new prompt\n if (defaultAssignedAgents && defaultAssignedAgents.length > 0) {\n setAssignedAgents(defaultAssignedAgents);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [prompt, open]);\n\n const resetForm = () => {\n setName(\"\");\n setDescription(\"\");\n setContent(\"\");\n setRightsMode(\"private\");\n setRbacUsers([]);\n setRbacRoles([]);\n // setRbacProjects([]);\n setRbacOpen(false);\n setAssignedAgents([]);\n };\n\n const handleSubmit = async () => {\n // Validation\n if (!name.trim()) {\n toast.error(\"Please enter a name for the prompt\");\n return;\n }\n if (!content.trim()) {\n toast.error(\"Please enter prompt content\");\n return;\n }\n if (!isValid) {\n toast.error(\n `Invalid variable names: ${invalidVariables.join(\", \")}. Use only letters, numbers, and underscores.`\n );\n return;\n }\n\n try {\n const input = {\n name: name.trim(),\n description: description.trim() || undefined,\n content: content.trim(),\n rights_mode: rightsMode,\n RBAC:\n rightsMode !== \"private\" && rightsMode !== \"public\"\n ? {\n users: rbacUsers.length > 0 ? rbacUsers : undefined,\n roles: rbacRoles.length > 0 ? rbacRoles : undefined,\n // projects: rbacProjects.length > 0 ? rbacProjects : undefined,\n }\n : undefined,\n assigned_agents: assignedAgents.length > 0 ? assignedAgents : undefined,\n };\n\n if (isEditing) {\n await updatePrompt({\n variables: {\n id: prompt.id,\n ...input,\n },\n });\n toast.success(\"Prompt updated successfully\");\n } else {\n await createPrompt({\n variables: input,\n });\n toast.success(\"Prompt created successfully\");\n }\n\n onSuccess();\n onOpenChange(false);\n resetForm();\n } catch (error) {\n console.error(error);\n toast.error(isEditing ? \"Failed to update prompt\" : \"Failed to create prompt\");\n }\n };\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"max-w-3xl max-h-[90vh] overflow-y-auto\">\n <DialogHeader>\n <DialogTitle>{isEditing ? \"Edit Prompt\" : \"Create New Prompt\"}</DialogTitle>\n <DialogDescription>\n {isEditing\n ? \"Update your prompt template\"\n : \"Create a reusable prompt template with variables\"}\n </DialogDescription>\n </DialogHeader>\n\n <div className=\"space-y-6 py-4\">\n {/* Name */}\n <div className=\"space-y-2\">\n <Label htmlFor=\"name\">\n Name <span className=\"text-destructive\">*</span>\n </Label>\n <Input\n id=\"name\"\n placeholder=\"Customer Support Template\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n />\n </div>\n\n {/* Description */}\n <div className=\"space-y-2\">\n <Label htmlFor=\"description\">Description</Label>\n <Input\n id=\"description\"\n placeholder=\"Brief description of this prompt\"\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n />\n </div>\n\n {/* Content */}\n <div className=\"space-y-2\">\n <Label htmlFor=\"content\">\n Prompt Content <span className=\"text-destructive\">*</span>\n </Label>\n <Textarea\n id=\"content\"\n placeholder=\"You are helping {{customer_name}} with their {{issue}}...\"\n value={content}\n onChange={(e) => setContent(e.target.value)}\n rows={8}\n className=\"font-mono text-sm\"\n />\n <div className=\"flex items-start gap-2 text-xs text-muted-foreground\">\n <Lightbulb className=\"h-3.5 w-3.5 mt-0.5 flex-shrink-0\" />\n <span>\n Use{\" \"}\n <code className=\"bg-muted px-1 py-0.5 rounded\">\n {\"{\"}\n {\"{\"}variable_name{\"}}\"}\n </code>{\" \"}\n format for dynamic content. Variable names can only contain letters,\n numbers, and underscores.\n </span>\n </div>\n\n {/* Detected Variables */}\n {variables.length > 0 && (\n <div className=\"flex flex-wrap gap-1 pt-2\">\n <span className=\"text-xs text-muted-foreground mr-2\">\n Detected variables:\n </span>\n {variables.map((variable) => (\n <Badge key={variable} variant=\"outline\" className=\"text-xs\">\n {variable}\n </Badge>\n ))}\n </div>\n )}\n\n {/* Invalid Variables Warning */}\n {!isValid && (\n <div className=\"text-xs text-destructive\">\n Invalid variable names: {invalidVariables.join(\", \")}\n </div>\n )}\n </div>\n\n {/* Assign to Agents */}\n <div className=\"space-y-2\">\n <Label>Assign to Agents</Label>\n <Popover modal={true} open={agentSelectorOpen} onOpenChange={setAgentSelectorOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n role=\"combobox\"\n aria-expanded={agentSelectorOpen}\n className=\"w-full justify-between\"\n >\n {assignedAgents.length === 0\n ? \"Select agents...\"\n : `${assignedAgents.length} agent${assignedAgents.length !== 1 ? \"s\" : \"\"} selected`}\n <ChevronsUpDown className=\"ml-2 h-4 w-4 shrink-0 opacity-50\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-full p-0\">\n <Command>\n <CommandInput placeholder=\"Search agents...\" />\n <CommandList>\n <CommandEmpty>No agents found.</CommandEmpty>\n <CommandGroup>\n {agents.map((agent: any) => (\n <CommandItem\n key={agent.id}\n value={agent.id}\n onSelect={() => {\n setAssignedAgents((prev) =>\n prev.includes(agent.id)\n ? prev.filter((id) => id !== agent.id)\n : [...prev, agent.id]\n );\n }}\n >\n <Check\n className={cn(\n \"mr-2 h-4 w-4\",\n assignedAgents.includes(agent.id)\n ? \"opacity-100\"\n : \"opacity-0\"\n )}\n />\n {agent.name}\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n {assignedAgents.length > 0 && (\n <div className=\"flex flex-wrap gap-2 pt-2\">\n {assignedAgents.map((agentId) => {\n const agent = agents.find((a: any) => a.id === agentId);\n return agent ? (\n <Badge key={agentId} variant=\"secondary\" className=\"text-sm\">\n {agent.name}\n <button\n type=\"button\"\n onClick={() =>\n setAssignedAgents((prev) =>\n prev.filter((id) => id !== agentId)\n )\n }\n className=\"ml-1.5 hover:text-destructive\"\n >\n <X className=\"h-3 w-3\" />\n </button>\n </Badge>\n ) : null;\n })}\n </div>\n )}\n <p className=\"text-xs text-muted-foreground\">\n Assign this prompt to specific agents to show it as recommended in chat\n </p>\n </div>\n\n {/* RBAC Control */}\n <Collapsible open={rbacOpen} onOpenChange={setRbacOpen}>\n <div className=\"space-y-2\">\n <CollapsibleTrigger asChild>\n <Button variant=\"outline\" className=\"w-full justify-between\">\n Access Control\n <span className=\"text-xs text-muted-foreground\">\n {rightsMode === \"private\" && \"Private\"}\n {rightsMode === \"public\" && \"Public\"}\n {rightsMode === \"users\" && `${rbacUsers.length} users`}\n {rightsMode === \"roles\" && `${rbacRoles.length} roles`}\n {/* {rightsMode === \"projects\" && `${rbacProjects.length} projects`} */}\n </span>\n </Button>\n </CollapsibleTrigger>\n <CollapsibleContent className=\"pt-2\">\n <RBACControl\n initialRightsMode={rightsMode}\n initialUsers={rbacUsers}\n initialRoles={rbacRoles}\n modalMode={true}\n // initialProjects={rbacProjects}\n onChange={(mode, users, roles) => {\n setRightsMode(mode);\n setRbacUsers(users);\n setRbacRoles(roles);\n // setRbacProjects(projects);\n }}\n />\n </CollapsibleContent>\n </div>\n </Collapsible>\n </div>\n\n <DialogFooter>\n <Button variant=\"outline\" onClick={() => onOpenChange(false)}>\n Cancel\n </Button>\n <Button\n onClick={handleSubmit}\n disabled={creating || updating || !name.trim() || !content.trim() || !isValid}\n >\n {creating || updating ? \"Saving...\" : isEditing ? \"Save Changes\" : \"Create Prompt\"}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n","import { useMutation, useQuery } from \"@apollo/client\";\nimport {\n CREATE_PROMPT,\n CREATE_PROMPT_FAVORITE,\n DELETE_PROMPT,\n DELETE_PROMPT_FAVORITE,\n GET_PROMPT_BY_ID,\n GET_PROMPTS,\n GET_USER_PROMPT_FAVORITES,\n INCREMENT_PROMPT_FAVORITES,\n INCREMENT_PROMPT_USAGE,\n UPDATE_PROMPT,\n} from \"@/queries/queries\";\nimport {\n CreatePromptInput,\n PromptFavorite,\n PromptLibrary,\n UpdatePromptInput,\n} from \"@/types/models/prompt-library\";\n\ninterface PromptsData {\n prompt_libraryPagination: {\n pageInfo: {\n pageCount: number;\n itemCount: number;\n currentPage: number;\n hasPreviousPage: boolean;\n hasNextPage: boolean;\n };\n items: PromptLibrary[];\n };\n}\n\ninterface PromptData {\n prompt_library_itemById: PromptLibrary;\n}\n\ninterface PromptFavoritesData {\n prompt_favoritesPagination: {\n items: PromptFavorite[];\n };\n}\n\n/**\n * Hook to fetch paginated prompts with filtering and sorting\n */\nexport const usePrompts = (variables?: {\n page?: number;\n limit?: number;\n filters?: any[];\n sort?: { field: string; direction: \"ASC\" | \"DESC\" };\n}) => {\n return useQuery<PromptsData>(GET_PROMPTS, {\n variables: {\n page: variables?.page ?? 1,\n limit: variables?.limit ?? 20,\n filters: variables?.filters ?? [],\n sort: variables?.sort ?? { field: \"updatedAt\", direction: \"DESC\" },\n },\n });\n};\n\n/**\n * Hook to fetch a single prompt by ID\n */\nexport const usePrompt = (id: string) => {\n return useQuery<PromptData>(GET_PROMPT_BY_ID, {\n variables: { id },\n skip: !id,\n });\n};\n\n/**\n * Hook to create a new prompt\n */\nexport const useCreatePrompt = () => {\n return useMutation<{ prompt_libraryCreateOne: { item: PromptLibrary } }>(\n CREATE_PROMPT,\n {\n refetchQueries: [{ query: GET_PROMPTS, variables: { page: 1, limit: 20 } }],\n }\n );\n};\n\n/**\n * Hook to update an existing prompt\n */\nexport const useUpdatePrompt = () => {\n return useMutation<{ prompt_libraryUpdateOneById: { item: PromptLibrary } }>(\n UPDATE_PROMPT\n );\n};\n\n/**\n * Hook to delete a prompt\n */\nexport const useDeletePrompt = () => {\n return useMutation<{ prompt_libraryRemoveOneById: { id: string } }>(\n DELETE_PROMPT,\n {\n refetchQueries: [{ query: GET_PROMPTS, variables: { page: 1, limit: 20 } }],\n }\n );\n};\n\n/**\n * Hook to increment prompt usage count\n */\nexport const useIncrementPromptUsage = () => {\n return useMutation<{\n prompt_libraryUpdateOneById: { item: Pick<PromptLibrary, \"id\" | \"usage_count\"> };\n }>(INCREMENT_PROMPT_USAGE);\n};\n\n/**\n * Hook to fetch user's favorited prompts\n */\nexport const useUserPromptFavorites = (userId: number) => {\n return useQuery<PromptFavoritesData>(GET_USER_PROMPT_FAVORITES, {\n variables: { user_id: userId },\n skip: !userId,\n });\n};\n\n/**\n * Hook to create a prompt favorite\n */\nexport const useCreatePromptFavorite = () => {\n return useMutation<{ prompt_favoritesCreateOne: { item: PromptFavorite } }>(\n CREATE_PROMPT_FAVORITE\n );\n};\n\n/**\n * Hook to delete a prompt favorite\n */\nexport const useDeletePromptFavorite = () => {\n return useMutation<{ prompt_favoritesRemoveOneById: { id: string } }>(\n DELETE_PROMPT_FAVORITE\n );\n};\n\n/**\n * Hook to toggle favorite status of a prompt\n * Handles both creating and deleting favorites, and updating the favorite count\n */\nexport const useTogglePromptFavorite = () => {\n const [createFavorite] = useCreatePromptFavorite();\n const [deleteFavorite] = useDeletePromptFavorite();\n const [incrementFavorites] = useMutation(INCREMENT_PROMPT_FAVORITES);\n\n const toggleFavorite = async (\n promptId: string,\n userId: number,\n isFavorited: boolean,\n currentFavoriteCount: number,\n favoriteId?: string\n ) => {\n if (isFavorited && favoriteId) {\n // Remove favorite\n await deleteFavorite({ variables: { id: favoriteId } });\n await incrementFavorites({\n variables: {\n id: promptId,\n favorite_count: Math.max(0, currentFavoriteCount - 1),\n },\n });\n } else {\n // Add favorite\n await createFavorite({\n variables: { user_id: userId, prompt_id: promptId },\n });\n await incrementFavorites({\n variables: { id: promptId, favorite_count: currentFavoriteCount + 1 },\n });\n }\n };\n\n return { toggleFavorite };\n};\n","/**\n * Extracts all variable names from a prompt template\n * Variables are in the format {{variable_name}}\n * Only alphanumeric characters and underscores are allowed in variable names\n *\n * @param content - The prompt content to extract variables from\n * @returns Array of unique variable names found in the content\n *\n * @example\n * extractVariables(\"Hello {{name}}, your issue {{issue_id}} is resolved\")\n * // Returns: [\"name\", \"issue_id\"]\n */\nexport function extractVariables(content: string): string[] {\n if (!content) return [];\n\n // Match {{variable_name}} where variable_name contains only alphanumeric and underscore\n const regex = /\\{\\{([a-zA-Z0-9_]+)\\}\\}/g;\n const matches = content.matchAll(regex);\n const variables = new Set<string>();\n\n for (const match of Array.from(matches)) {\n variables.add(match[1]);\n }\n\n return Array.from(variables).sort();\n}\n"],"names":["PromptCard","param","agentsData","creatorData","prompt","user","onUpdate","isEditModalOpen","setIsEditModalOpen","useState","isFavoriting","setIsFavoriting","deletePrompt","useDeletePrompt","toggleFavorite","useTogglePromptFavorite","hasWriteAccess","checkPromptWriteAccess","isPrivate","rights_mode","isPublic","byUsers","byRoles","isAdmin","super_admin","isCreator","created_by","id","toString","writeAccess","userAccess","RBAC","users","find","u","rights","roleAccess","roles","r","role","variables","extractVariables","content","isFavorited","is_favorited","data","useQuery","GET_AGENTS_BY_IDS","ids","assigned_agents","skip","length","assignedAgentNames","agentByIds","map","agent","name","GET_USER_BY_ID","creatorName","userById","handleDelete","confirm","toast","success","error","console","handleToggleFavorite","favorite_count","undefined","icon","duration","Promise","resolve","setTimeout","jsx_runtime","jsxs","Fragment","Card","className","jsx","CardHeader","div","h3","description","p","Button","variant","size","concat","onClick","disabled","ThumbsUp","DropdownMenu","modal","DropdownMenuTrigger","asChild","MoreVertical","DropdownMenuContent","align","DropdownMenuItem","navigator","clipboard","writeText","Copy","Edit","Trash2","CardContent","Badge","Bot","span","slice","index","CardFooter","title","Activity","usage_count","type","MessageSquare","User","Calendar","formatDistanceToNow","Date","createdAt","addSuffix","Clock","updatedAt","PromptEditorModal","open","onOpenChange","onSuccess","defaultAssignedAgents","isEditing","createPrompt","loading","creating","useCreatePrompt","updatePrompt","updating","useUpdatePrompt","setName","setDescription","setContent","rightsMode","setRightsMode","rbacUsers","setRbacUsers","rbacRoles","setRbacRoles","rbacOpen","setRbacOpen","assignedAgents","setAssignedAgents","agentSelectorOpen","setAgentSelectorOpen","GET_AGENTS","page","limit","agents","agentsPagination","items","isValid","invalidVariables","validatePromptVariables","matches","matchAll","match","Array","from","variableName","validPattern","test","push","useEffect","resetForm","handleSubmit","trim","join","input","Dialog","DialogContent","DialogHeader","DialogTitle","DialogDescription","Label","htmlFor","Input","placeholder","value","onChange","e","target","Textarea","rows","Lightbulb","code","variable","Popover","PopoverTrigger","aria-expanded","ChevronsUpDown","PopoverContent","Command","CommandInput","CommandList","CommandEmpty","CommandGroup","CommandItem","onSelect","prev","includes","filter","Check","cn","a","agentId","button","X","Collapsible","CollapsibleTrigger","CollapsibleContent","RBACControl","initialRightsMode","initialUsers","initialRoles","modalMode","mode","DialogFooter","usePrompts","GET_PROMPTS","filters","sort","field","direction","useMutation","CREATE_PROMPT","refetchQueries","query","UPDATE_PROMPT","DELETE_PROMPT","useIncrementPromptUsage","INCREMENT_PROMPT_USAGE","useCreatePromptFavorite","CREATE_PROMPT_FAVORITE","useDeletePromptFavorite","DELETE_PROMPT_FAVORITE","createFavorite","deleteFavorite","incrementFavorites","INCREMENT_PROMPT_FAVORITES","promptId","userId","currentFavoriteCount","favoriteId","Math","max","user_id","prompt_id","Set","add"],"sourceRoot":""}
|