@epic-web/workshop-app 4.14.1 → 4.16.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.
Files changed (69) hide show
  1. package/build/client/assets/{_exerciseNumber-Ccwr4LZw.js → _exerciseNumber-BLQUCLPr.js} +2 -2
  2. package/build/client/assets/{_exerciseNumber-Ccwr4LZw.js.map → _exerciseNumber-BLQUCLPr.js.map} +1 -1
  3. package/build/client/assets/{_exerciseNumber_.finished-gEWcHsfL.js → _exerciseNumber_.finished-C9TSc48F.js} +2 -2
  4. package/build/client/assets/{_exerciseNumber_.finished-gEWcHsfL.js.map → _exerciseNumber_.finished-C9TSc48F.js.map} +1 -1
  5. package/build/client/assets/_layout-B789acDk.js +6 -0
  6. package/build/client/assets/_layout-B789acDk.js.map +1 -0
  7. package/build/client/assets/_layout-CZ3fjUvs.js +2 -0
  8. package/build/client/assets/_layout-CZ3fjUvs.js.map +1 -0
  9. package/build/client/assets/_layout-DLIzcS5v.js +2 -0
  10. package/build/client/assets/_layout-DLIzcS5v.js.map +1 -0
  11. package/build/client/assets/{_layout-Bn9QhWq9.js → _layout-DMuKczTu.js} +2 -2
  12. package/build/client/assets/{_layout-Bn9QhWq9.js.map → _layout-DMuKczTu.js.map} +1 -1
  13. package/build/client/assets/account-LnI_Eq0t.js +2 -0
  14. package/build/client/assets/account-LnI_Eq0t.js.map +1 -0
  15. package/build/client/assets/{diff-CpG96hGZ.js → diff-4FQLirNf.js} +2 -2
  16. package/build/client/assets/{diff-CpG96hGZ.js.map → diff-4FQLirNf.js.map} +1 -1
  17. package/build/client/assets/{diff-Bd9WnUnR.js → diff-CPrD1rHd.js} +2 -2
  18. package/build/client/assets/{diff-Bd9WnUnR.js.map → diff-CPrD1rHd.js.map} +1 -1
  19. package/build/client/assets/discord-BgaWmFRC.js +2 -0
  20. package/build/client/assets/discord-BgaWmFRC.js.map +1 -0
  21. package/build/client/assets/discord-Dk1wbXOn.js +2 -0
  22. package/build/client/assets/discord-Dk1wbXOn.js.map +1 -0
  23. package/build/client/assets/{epic-video-DJN9_SUj.js → epic-video-CfelX9-n.js} +2 -2
  24. package/build/client/assets/{epic-video-DJN9_SUj.js.map → epic-video-CfelX9-n.js.map} +1 -1
  25. package/build/client/assets/finished-C0mN8TiU.js +2 -0
  26. package/build/client/assets/finished-C0mN8TiU.js.map +1 -0
  27. package/build/client/assets/{index-3HxjMIAS.js → index-De7yI02n.js} +2 -2
  28. package/build/client/assets/{index-3HxjMIAS.js.map → index-De7yI02n.js.map} +1 -1
  29. package/build/client/assets/login-SJlLMYmL.js +2 -0
  30. package/build/client/assets/login-SJlLMYmL.js.map +1 -0
  31. package/build/client/assets/{manifest-1375f1dd.js → manifest-38193299.js} +1 -1
  32. package/build/client/assets/mdx-CQW0I4So.js +2 -0
  33. package/build/client/assets/mdx-CQW0I4So.js.map +1 -0
  34. package/build/client/assets/onboarding-BXGyEPXy.js +2 -0
  35. package/build/client/assets/onboarding-BXGyEPXy.js.map +1 -0
  36. package/build/client/assets/robots_._txt-l0sNRNKZ.js +2 -0
  37. package/build/client/assets/robots_._txt-l0sNRNKZ.js.map +1 -0
  38. package/build/client/assets/root-BUqeXmeK.js.map +1 -1
  39. package/build/client/assets/sitemap_._xml-l0sNRNKZ.js +2 -0
  40. package/build/client/assets/sitemap_._xml-l0sNRNKZ.js.map +1 -0
  41. package/build/client/assets/support-DilzTPHE.js +2 -0
  42. package/build/client/assets/support-DilzTPHE.js.map +1 -0
  43. package/build/server/index.js +982 -925
  44. package/build/server/index.js.map +1 -1
  45. package/dist/server/index.js +18 -5
  46. package/package.json +5 -3
  47. package/start.js +1 -23
  48. package/build/client/assets/_layout-B9Y-8OU6.js +0 -2
  49. package/build/client/assets/_layout-B9Y-8OU6.js.map +0 -1
  50. package/build/client/assets/_layout-DaZNLfOL.js +0 -2
  51. package/build/client/assets/_layout-DaZNLfOL.js.map +0 -1
  52. package/build/client/assets/_layout-dHX2Hcew.js +0 -6
  53. package/build/client/assets/_layout-dHX2Hcew.js.map +0 -1
  54. package/build/client/assets/account-uvU1jIL2.js +0 -2
  55. package/build/client/assets/account-uvU1jIL2.js.map +0 -1
  56. package/build/client/assets/discord-CgwNGD2p.js +0 -2
  57. package/build/client/assets/discord-CgwNGD2p.js.map +0 -1
  58. package/build/client/assets/discord-yZor-3t1.js +0 -2
  59. package/build/client/assets/discord-yZor-3t1.js.map +0 -1
  60. package/build/client/assets/finished-B9qjUR4B.js +0 -2
  61. package/build/client/assets/finished-B9qjUR4B.js.map +0 -1
  62. package/build/client/assets/login-CHE9W6po.js +0 -2
  63. package/build/client/assets/login-CHE9W6po.js.map +0 -1
  64. package/build/client/assets/mdx-BENF-kTQ.js +0 -2
  65. package/build/client/assets/mdx-BENF-kTQ.js.map +0 -1
  66. package/build/client/assets/onboarding-FD1FkQuu.js +0 -2
  67. package/build/client/assets/onboarding-FD1FkQuu.js.map +0 -1
  68. package/build/client/assets/support-D1ydJNdm.js +0 -2
  69. package/build/client/assets/support-D1ydJNdm.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import{j as e}from"./index-Czg1ruVn.js";import{B as a}from"./button-BA3iiLRs.js";import{I as i}from"./misc-S5ZD98sI.js";import{S as o}from"./tooltip-BtzSIxlB.js";import{u as m,a as u}from"./user-CdUDQ7a8.js";import{u as x}from"./presence-CW1_eiIo.js";import{u as h,a as p,L as r,F as c}from"./components-wgHiPsTg.js";import"./clsx-B-dksMZM.js";import"./request-info-DHtGM4FI.js";const O={getSitemapEntries:()=>null};function k(){const l=h(),d=p(),t=m(),s=u(),n=x();return e.jsxs("main",{className:"container flex h-full w-full max-w-3xl flex-grow flex-col items-center justify-center gap-4",children:[e.jsx("img",{className:"h-36 w-36 rounded-full",alt:(s==null?void 0:s.displayName)??t.name??t.email,src:t.avatarUrl}),e.jsx("h1",{className:"mb-1 text-2xl",children:"Your Account"}),e.jsx("p",{className:"text-center text-gray-700 dark:text-gray-300",children:t.name?`Hi ${(s==null?void 0:s.displayName)??t.name}, your device is logged in with ${t.email}.`:`Your device is logged in with ${t.email}.`}),s?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-center text-gray-700 dark:text-gray-300",children:["And you are connected to discord as ",s.displayName," (",s.id,")."]}),e.jsxs("div",{className:"flex justify-center gap-2",children:[e.jsx(d.Form,{method:"post",children:e.jsx(a,{varient:"mono",name:"intent",value:"disconnect-discord",children:"Disconnect Discord"})}),e.jsx(o,{content:"Your discord connection gives you access to the exclusive Discord channels for Epic Web",children:e.jsx(i,{name:"Question",tabIndex:0})})]})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(r,{to:l.discordAuthUrl,className:"inline-flex items-center gap-2 underline",children:[e.jsx(i,{name:"Discord",size:"lg"}),"Connect Discord"]}),e.jsx(o,{content:"This will give you access to the exclusive Discord channels for Epic Web",children:e.jsx(i,{name:"Question",tabIndex:0})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(c,{method:"POST",children:[e.jsx("input",{name:"optOut",type:"hidden",value:n!=null&&n.optOut?"false":"true"}),e.jsxs(a,{varient:"mono",name:"intent",value:"presence-opt-out",children:[n!=null&&n.optOut?"Opt in to":"Opt out of"," presence"]})]}),e.jsx(o,{content:"This controls whether your name and avatar are displayed in the pile of faces in navigation",children:e.jsx(i,{name:"Question",tabIndex:0})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(c,{method:"post",children:e.jsx(a,{varient:"mono",name:"intent",value:"logout",children:"Log device out"})}),e.jsx(o,{content:e.jsxs("div",{children:["Note: it is your ",e.jsx("i",{className:"italic",children:"device"})," that's logged in, not your browser.",e.jsx("br",{}),"So all browsers on this device will be logged in with the same account on this device."]}),children:e.jsx(i,{name:"Question",tabIndex:0})})]}),e.jsxs("p",{children:["Check"," ",e.jsx(r,{to:"/onboarding",className:"underline",children:"/onboarding"})," ","if you'd like to review onboarding again."]}),e.jsxs("p",{children:["Check"," ",e.jsx(r,{to:"/support",className:"underline",children:"/support"})," ","if you need support."]})]})}export{k as default,O as handle};
2
+ //# sourceMappingURL=account-LnI_Eq0t.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-LnI_Eq0t.js","sources":["../../../app/routes/_app+/account.tsx"],"sourcesContent":["import { deleteCache } from '@epic-web/workshop-utils/cache.server'\nimport {\n\tdeleteDb,\n\tdeleteDiscordInfo,\n\trequireAuthInfo,\n\tsetPresencePreferences,\n} from '@epic-web/workshop-utils/db.server'\nimport { type SEOHandle } from '@nasa-gcn/remix-seo'\nimport { json, redirect, type LoaderFunctionArgs } from '@remix-run/node'\nimport { Form, Link, useFetcher, useLoaderData } from '@remix-run/react'\nimport { Button } from '#app/components/button.tsx'\nimport { Icon } from '#app/components/icons.tsx'\nimport { SimpleTooltip } from '#app/components/ui/tooltip.js'\nimport { useOptionalDiscordMember, useUser } from '#app/components/user.tsx'\nimport { ensureUndeployed } from '#app/utils/misc.tsx'\nimport { usePresencePreferences } from '#app/utils/presence.tsx'\nimport { redirectWithToast } from '#app/utils/toast.server.ts'\nimport { getDiscordAuthURL } from '../discord.callback.ts'\n\nexport const handle: SEOHandle = {\n\tgetSitemapEntries: () => null,\n}\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n\tensureUndeployed()\n\tawait requireAuthInfo({ request })\n\treturn json({ discordAuthUrl: getDiscordAuthURL() })\n}\n\nexport async function action({ request }: { request: Request }) {\n\tensureUndeployed()\n\tconst formData = await request.formData()\n\tconst intent = formData.get('intent')\n\tif (intent === 'disconnect-discord') {\n\t\tawait deleteDiscordInfo()\n\t\treturn redirectWithToast('/account', {\n\t\t\ttype: 'success',\n\t\t\ttitle: 'Disconnected',\n\t\t\tdescription: 'Local discord data has been deleted.',\n\t\t})\n\t} else if (intent === 'logout') {\n\t\tawait deleteDb()\n\t\tawait deleteCache()\n\t\treturn redirectWithToast('/login', {\n\t\t\ttype: 'success',\n\t\t\ttitle: 'Logged out',\n\t\t\tdescription: 'Goodbye! Come back soon!',\n\t\t})\n\t} else if (intent === 'presence-opt-out') {\n\t\tconst optOut = formData.get('optOut') === 'true'\n\t\tawait setPresencePreferences({ optOut })\n\t\treturn redirectWithToast('/account', {\n\t\t\ttitle: optOut ? 'Opted out' : 'Opted in',\n\t\t\tdescription: `You are now ${optOut ? 'invisible' : 'visible'}.`,\n\t\t\ttype: 'success',\n\t\t})\n\t}\n\n\treturn redirect('/account')\n}\n\nexport default function Account() {\n\tconst data = useLoaderData<typeof loader>()\n\tconst disconnectFetcher = useFetcher()\n\tconst user = useUser()\n\tconst discordMember = useOptionalDiscordMember()\n\tconst presencePreferences = usePresencePreferences()\n\treturn (\n\t\t<main className=\"container flex h-full w-full max-w-3xl flex-grow flex-col items-center justify-center gap-4\">\n\t\t\t<img\n\t\t\t\tclassName=\"h-36 w-36 rounded-full\"\n\t\t\t\talt={discordMember?.displayName ?? user.name ?? user.email}\n\t\t\t\tsrc={user.avatarUrl}\n\t\t\t/>\n\t\t\t<h1 className=\"mb-1 text-2xl\">Your Account</h1>\n\t\t\t<p className=\"text-center text-gray-700 dark:text-gray-300\">\n\t\t\t\t{user.name\n\t\t\t\t\t? `Hi ${\n\t\t\t\t\t\t\tdiscordMember?.displayName ?? user.name\n\t\t\t\t\t\t}, your device is logged in with ${user.email}.`\n\t\t\t\t\t: `Your device is logged in with ${user.email}.`}\n\t\t\t</p>\n\t\t\t{discordMember ? (\n\t\t\t\t<>\n\t\t\t\t\t<p className=\"text-center text-gray-700 dark:text-gray-300\">\n\t\t\t\t\t\tAnd you are connected to discord as {discordMember.displayName} (\n\t\t\t\t\t\t{discordMember.id}).\n\t\t\t\t\t</p>\n\t\t\t\t\t<div className=\"flex justify-center gap-2\">\n\t\t\t\t\t\t<disconnectFetcher.Form method=\"post\">\n\t\t\t\t\t\t\t<Button varient=\"mono\" name=\"intent\" value=\"disconnect-discord\">\n\t\t\t\t\t\t\t\tDisconnect Discord\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</disconnectFetcher.Form>\n\t\t\t\t\t\t<SimpleTooltip content=\"Your discord connection gives you access to the exclusive Discord channels for Epic Web\">\n\t\t\t\t\t\t\t<Icon name=\"Question\" tabIndex={0} />\n\t\t\t\t\t\t</SimpleTooltip>\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t<Link\n\t\t\t\t\t\tto={data.discordAuthUrl}\n\t\t\t\t\t\tclassName=\"inline-flex items-center gap-2 underline\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon name=\"Discord\" size=\"lg\" />\n\t\t\t\t\t\tConnect Discord\n\t\t\t\t\t</Link>\n\t\t\t\t\t<SimpleTooltip content=\"This will give you access to the exclusive Discord channels for Epic Web\">\n\t\t\t\t\t\t<Icon name=\"Question\" tabIndex={0} />\n\t\t\t\t\t</SimpleTooltip>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t<Form method=\"POST\">\n\t\t\t\t\t<input\n\t\t\t\t\t\tname=\"optOut\"\n\t\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\t\tvalue={presencePreferences?.optOut ? 'false' : 'true'}\n\t\t\t\t\t/>\n\t\t\t\t\t<Button varient=\"mono\" name=\"intent\" value=\"presence-opt-out\">\n\t\t\t\t\t\t{presencePreferences?.optOut ? 'Opt in to' : 'Opt out of'} presence\n\t\t\t\t\t</Button>\n\t\t\t\t</Form>\n\t\t\t\t<SimpleTooltip content=\"This controls whether your name and avatar are displayed in the pile of faces in navigation\">\n\t\t\t\t\t<Icon name=\"Question\" tabIndex={0} />\n\t\t\t\t</SimpleTooltip>\n\t\t\t</div>\n\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t<Form method=\"post\">\n\t\t\t\t\t<Button varient=\"mono\" name=\"intent\" value=\"logout\">\n\t\t\t\t\t\tLog device out\n\t\t\t\t\t</Button>\n\t\t\t\t</Form>\n\t\t\t\t<SimpleTooltip\n\t\t\t\t\tcontent={\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\tNote: it is your <i className=\"italic\">device</i> that's logged\n\t\t\t\t\t\t\tin, not your browser.\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\tSo all browsers on this device will be logged in with the same\n\t\t\t\t\t\t\taccount on this device.\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<Icon name=\"Question\" tabIndex={0} />\n\t\t\t\t</SimpleTooltip>\n\t\t\t</div>\n\t\t\t<p>\n\t\t\t\tCheck{' '}\n\t\t\t\t<Link to=\"/onboarding\" className=\"underline\">\n\t\t\t\t\t/onboarding\n\t\t\t\t</Link>{' '}\n\t\t\t\tif you'd like to review onboarding again.\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\tCheck{' '}\n\t\t\t\t<Link to=\"/support\" className=\"underline\">\n\t\t\t\t\t/support\n\t\t\t\t</Link>{' '}\n\t\t\t\tif you need support.\n\t\t\t</p>\n\t\t</main>\n\t)\n}\n"],"names":["handle","getSitemapEntries","Account","data","useLoaderData","disconnectFetcher","useFetcher","user","useUser","discordMember","useOptionalDiscordMember","presencePreferences","usePresencePreferences","jsxs","className","children","jsx","alt","displayName","name","email","src","avatarUrl","Fragment","id","Form","method","Button","varient","value","SimpleTooltip","content","Icon","tabIndex","Link","to","discordAuthUrl","size","type","optOut"],"mappings":"2XAmBO,MAAMA,EAAoB,CAChCC,kBAAmBA,IAAM,IAC1B,EAwCA,SAAwBC,GAAU,CACjC,MAAMC,EAAOC,IACPC,EAAoBC,IACpBC,EAAOC,IACPC,EAAgBC,IAChBC,EAAsBC,IAE3B,OAAAC,EAAAA,KAAC,OAAK,CAAAC,UAAU,8FACfC,SAAA,CAAAC,EAAA,IAAC,MAAA,CACAF,UAAU,yBACVG,KAAKR,GAAAA,YAAAA,EAAeS,cAAeX,EAAKY,MAAQZ,EAAKa,MACrDC,IAAKd,EAAKe,SAAA,CACX,EACCN,EAAA,IAAA,KAAA,CAAGF,UAAU,gBAAgBC,SAAY,cAAA,CAAA,QACzC,IAAE,CAAAD,UAAU,+CACXC,SAAKR,EAAAY,KACH,OACAV,GAAAA,YAAAA,EAAeS,cAAeX,EAAKY,IACpC,mCAAmCZ,EAAKa,KAAK,IAC5C,iCAAiCb,EAAKa,KAAK,IAC/C,EACCX,EAECI,EAAA,KAAAU,WAAA,CAAAR,SAAA,CAACF,EAAA,KAAA,IAAA,CAAEC,UAAU,+CAA+CC,SAAA,CAAA,uCACtBN,EAAcS,YAAY,KAC9DT,EAAce,GAAG,IAAA,CACnB,CAAA,EACAX,EAAA,KAAC,MAAI,CAAAC,UAAU,4BACdC,SAAA,CAAAC,EAAAA,IAACX,EAAkBoB,KAAlB,CAAuBC,OAAO,OAC9BX,SAACC,EAAA,IAAAW,EAAA,CAAOC,QAAQ,OAAOT,KAAK,SAASU,MAAM,qBAAqBd,8BAEhE,CACD,CAAA,EACAC,EAAA,IAACc,EAAc,CAAAC,QAAQ,0FACtBhB,SAAAC,EAAA,IAACgB,GAAKb,KAAK,WAAWc,SAAU,EAAG,CACpC,CAAA,CAAA,CACD,CAAA,CAAA,CAAA,CACD,EAEApB,EAAA,KAAC,MAAI,CAAAC,UAAU,0BACdC,SAAA,CAAAF,EAAA,KAACqB,EAAA,CACAC,GAAIhC,EAAKiC,eACTtB,UAAU,2CAEVC,SAAA,CAAAC,EAAA,IAACgB,EAAK,CAAAb,KAAK,UAAUkB,KAAK,IAAK,CAAA,EAAE,iBAAA,CAAA,CAElC,EACArB,EAAA,IAACc,EAAc,CAAAC,QAAQ,2EACtBhB,SAAAC,EAAA,IAACgB,GAAKb,KAAK,WAAWc,SAAU,EAAG,CACpC,CAAA,CAAA,CACD,CAAA,EAEDpB,EAAA,KAAC,MAAI,CAAAC,UAAU,0BACdC,SAAA,CAACF,EAAA,KAAAY,EAAA,CAAKC,OAAO,OACZX,SAAA,CAAAC,EAAA,IAAC,QAAA,CACAG,KAAK,SACLmB,KAAK,SACLT,MAAOlB,GAAAA,MAAAA,EAAqB4B,OAAS,QAAU,MAAA,CAChD,SACCZ,EAAO,CAAAC,QAAQ,OAAOT,KAAK,SAASU,MAAM,mBACzCd,SAAA,CAAAJ,GAAAA,MAAAA,EAAqB4B,OAAS,YAAc,aAAa,WAAA,CAC3D,CAAA,CAAA,CACD,CAAA,EACAvB,EAAA,IAACc,EAAc,CAAAC,QAAQ,8FACtBhB,SAAAC,EAAA,IAACgB,GAAKb,KAAK,WAAWc,SAAU,EAAG,CACpC,CAAA,CAAA,CACD,CAAA,EACApB,EAAA,KAAC,MAAI,CAAAC,UAAU,0BACdC,SAAA,CAAAC,EAAA,IAACS,EAAK,CAAAC,OAAO,OACZX,SAAAC,EAAA,IAACW,EAAO,CAAAC,QAAQ,OAAOT,KAAK,SAASU,MAAM,SAASd,SAAA,iBAEpD,CACD,CAAA,EACAC,EAAA,IAACc,EAAA,CACAC,eACE,MAAI,CAAAhB,SAAA,CAAA,oBACcC,EAAA,IAAA,IAAA,CAAEF,UAAU,SAASC,SAAM,QAAA,CAAA,EAAI,6CAEhD,KAAG,CAAA,CAAA,EAAE,wFAAA,CAGP,CAAA,EAGDA,SAACC,EAAA,IAAAgB,EAAA,CAAKb,KAAK,WAAWc,SAAU,EAAG,CAAA,CACpC,CAAA,CACD,CAAA,SACC,IAAE,CAAAlB,SAAA,CAAA,QACI,UACLmB,EAAK,CAAAC,GAAG,cAAcrB,UAAU,YAAYC,SAE7C,aAAA,CAAA,EAAQ,IAAI,2CAAA,CAEb,CAAA,SACC,IAAE,CAAAA,SAAA,CAAA,QACI,UACLmB,EAAK,CAAAC,GAAG,WAAWrB,UAAU,YAAYC,SAE1C,UAAA,CAAA,EAAQ,IAAI,sBAAA,CAEb,CAAA,CAAA,CACD,CAAA,CAEF"}
@@ -1,2 +1,2 @@
1
- import{R as j,j as t,r as d,c as Ht}from"./index-Czg1ruVn.js";import{c as he,u as O,d as je,f as ce,g as le,P as _,a as A,b as Bt,k as K,l as Ke,A as Ft,D as $t,C as Ut,m as Wt,V as Kt,n as Gt,R as zt,S as $e}from"./tooltip-BtzSIxlB.js";import{r as Ge,e as qt,b as Yt,A as Xt,L as Zt,F as Jt}from"./components-wgHiPsTg.js";import{h as Qt,u as eo,R as to,F as oo,P as no}from"./index-C6ToujzV.js";import{c as ie}from"./clsx-B-dksMZM.js";import{I as L,d as ro,c as so}from"./misc-S5ZD98sI.js";import{M as ao}from"./mdx-BENF-kTQ.js";function ze(o){const n=o+"CollectionProvider",[e,r]=he(n),[s,c]=e(n,{collectionRef:{current:null},itemMap:new Map}),l=w=>{const{scope:f,children:h}=w,S=j.useRef(null),m=j.useRef(new Map).current;return t.jsx(s,{scope:f,itemMap:m,collectionRef:S,children:h})};l.displayName=n;const i=o+"CollectionSlot",a=j.forwardRef((w,f)=>{const{scope:h,children:S}=w,m=c(i,h),u=O(f,m.collectionRef);return t.jsx(je,{ref:u,children:S})});a.displayName=i;const p=o+"CollectionItemSlot",x="data-radix-collection-item",g=j.forwardRef((w,f)=>{const{scope:h,children:S,...m}=w,u=j.useRef(null),C=O(f,u),T=c(p,h);return j.useEffect(()=>(T.itemMap.set(u,{ref:u,...m}),()=>void T.itemMap.delete(u))),t.jsx(je,{[x]:"",ref:C,children:S})});g.displayName=p;function b(w){const f=c(o+"CollectionConsumer",w);return j.useCallback(()=>{const S=f.collectionRef.current;if(!S)return[];const m=Array.from(S.querySelectorAll(`[${x}]`));return Array.from(f.itemMap.values()).sort((T,P)=>m.indexOf(T.ref.current)-m.indexOf(P.ref.current))},[f.collectionRef,f.itemMap])}return[{Provider:l,Slot:a,ItemSlot:g},b,r]}var co=d.createContext(void 0);function qe(o){const n=d.useContext(co);return o||n||"ltr"}var De="Collapsible",[lo,Ye]=he(De),[io,Oe]=lo(De),Xe=d.forwardRef((o,n)=>{const{__scopeCollapsible:e,open:r,defaultOpen:s,disabled:c,onOpenChange:l,...i}=o,[a=!1,p]=ce({prop:r,defaultProp:s,onChange:l});return t.jsx(io,{scope:e,disabled:c,contentId:le(),open:a,onOpenToggle:d.useCallback(()=>p(x=>!x),[p]),children:t.jsx(_.div,{"data-state":Le(a),"data-disabled":c?"":void 0,...i,ref:n})})});Xe.displayName=De;var Ze="CollapsibleTrigger",Je=d.forwardRef((o,n)=>{const{__scopeCollapsible:e,...r}=o,s=Oe(Ze,e);return t.jsx(_.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Le(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:n,onClick:A(o.onClick,s.onOpenToggle)})});Je.displayName=Ze;var ke="CollapsibleContent",Qe=d.forwardRef((o,n)=>{const{forceMount:e,...r}=o,s=Oe(ke,o.__scopeCollapsible);return t.jsx(Bt,{present:e||s.open,children:({present:c})=>t.jsx(uo,{...r,ref:n,present:c})})});Qe.displayName=ke;var uo=d.forwardRef((o,n)=>{const{__scopeCollapsible:e,present:r,children:s,...c}=o,l=Oe(ke,e),[i,a]=d.useState(r),p=d.useRef(null),x=O(n,p),g=d.useRef(0),b=g.current,w=d.useRef(0),f=w.current,h=l.open||i,S=d.useRef(h),m=d.useRef();return d.useEffect(()=>{const u=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(u)},[]),K(()=>{const u=p.current;if(u){m.current=m.current||{transitionDuration:u.style.transitionDuration,animationName:u.style.animationName},u.style.transitionDuration="0s",u.style.animationName="none";const C=u.getBoundingClientRect();g.current=C.height,w.current=C.width,S.current||(u.style.transitionDuration=m.current.transitionDuration,u.style.animationName=m.current.animationName),a(r)}},[l.open,r]),t.jsx(_.div,{"data-state":Le(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!h,...c,ref:x,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":f?`${f}px`:void 0,...o.style},children:h&&s})});function Le(o){return o?"open":"closed"}var po=Xe,fo=Je,mo=Qe,G="Accordion",ho=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Ve,xo,vo]=ze(G),[xe,In]=he(G,[vo,Ye]),He=Ye(),et=j.forwardRef((o,n)=>{const{type:e,...r}=o,s=r,c=r;return t.jsx(Ve.Provider,{scope:o.__scopeAccordion,children:e==="multiple"?t.jsx(wo,{...c,ref:n}):t.jsx(Co,{...s,ref:n})})});et.displayName=G;var[tt,go]=xe(G),[ot,So]=xe(G,{collapsible:!1}),Co=j.forwardRef((o,n)=>{const{value:e,defaultValue:r,onValueChange:s=()=>{},collapsible:c=!1,...l}=o,[i,a]=ce({prop:e,defaultProp:r,onChange:s});return t.jsx(tt,{scope:o.__scopeAccordion,value:i?[i]:[],onItemOpen:a,onItemClose:j.useCallback(()=>c&&a(""),[c,a]),children:t.jsx(ot,{scope:o.__scopeAccordion,collapsible:c,children:t.jsx(nt,{...l,ref:n})})})}),wo=j.forwardRef((o,n)=>{const{value:e,defaultValue:r,onValueChange:s=()=>{},...c}=o,[l=[],i]=ce({prop:e,defaultProp:r,onChange:s}),a=j.useCallback(x=>i((g=[])=>[...g,x]),[i]),p=j.useCallback(x=>i((g=[])=>g.filter(b=>b!==x)),[i]);return t.jsx(tt,{scope:o.__scopeAccordion,value:l,onItemOpen:a,onItemClose:p,children:t.jsx(ot,{scope:o.__scopeAccordion,collapsible:!0,children:t.jsx(nt,{...c,ref:n})})})}),[bo,ve]=xe(G),nt=j.forwardRef((o,n)=>{const{__scopeAccordion:e,disabled:r,dir:s,orientation:c="vertical",...l}=o,i=j.useRef(null),a=O(i,n),p=xo(e),g=qe(s)==="ltr",b=A(o.onKeyDown,w=>{var M;if(!ho.includes(w.key))return;const f=w.target,h=p().filter(V=>{var $;return!(($=V.ref.current)!=null&&$.disabled)}),S=h.findIndex(V=>V.ref.current===f),m=h.length;if(S===-1)return;w.preventDefault();let u=S;const C=0,T=m-1,P=()=>{u=S+1,u>T&&(u=C)},F=()=>{u=S-1,u<C&&(u=T)};switch(w.key){case"Home":u=C;break;case"End":u=T;break;case"ArrowRight":c==="horizontal"&&(g?P():F());break;case"ArrowDown":c==="vertical"&&P();break;case"ArrowLeft":c==="horizontal"&&(g?F():P());break;case"ArrowUp":c==="vertical"&&F();break}const E=u%m;(M=h[E].ref.current)==null||M.focus()});return t.jsx(bo,{scope:e,disabled:r,direction:s,orientation:c,children:t.jsx(Ve.Slot,{scope:e,children:t.jsx(_.div,{...l,"data-orientation":c,ref:a,onKeyDown:r?void 0:b})})})}),fe="AccordionItem",[yo,Be]=xe(fe),rt=j.forwardRef((o,n)=>{const{__scopeAccordion:e,value:r,...s}=o,c=ve(fe,e),l=go(fe,e),i=He(e),a=le(),p=r&&l.value.includes(r)||!1,x=c.disabled||o.disabled;return t.jsx(yo,{scope:e,open:p,disabled:x,triggerId:a,children:t.jsx(po,{"data-orientation":c.orientation,"data-state":dt(p),...i,...s,ref:n,disabled:x,open:p,onOpenChange:g=>{g?l.onItemOpen(r):l.onItemClose(r)}})})});rt.displayName=fe;var st="AccordionHeader",at=j.forwardRef((o,n)=>{const{__scopeAccordion:e,...r}=o,s=ve(G,e),c=Be(st,e);return t.jsx(_.h3,{"data-orientation":s.orientation,"data-state":dt(c.open),"data-disabled":c.disabled?"":void 0,...r,ref:n})});at.displayName=st;var Te="AccordionTrigger",ct=j.forwardRef((o,n)=>{const{__scopeAccordion:e,...r}=o,s=ve(G,e),c=Be(Te,e),l=So(Te,e),i=He(e);return t.jsx(Ve.ItemSlot,{scope:e,children:t.jsx(fo,{"aria-disabled":c.open&&!l.collapsible||void 0,"data-orientation":s.orientation,id:c.triggerId,...i,...r,ref:n})})});ct.displayName=Te;var lt="AccordionContent",it=j.forwardRef((o,n)=>{const{__scopeAccordion:e,...r}=o,s=ve(G,e),c=Be(lt,e),l=He(e);return t.jsx(mo,{role:"region","aria-labelledby":c.triggerId,"data-orientation":s.orientation,...l,...r,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...o.style}})});it.displayName=lt;function dt(o){return o?"open":"closed"}var Io=et,No=rt,Ro=at,jo=ct,To=it;function Ue(o,[n,e]){return Math.min(e,Math.max(n,o))}function Po(o){const n=d.useRef({value:o,previous:o});return d.useMemo(()=>(n.current.value!==o&&(n.current.previous=n.current.value,n.current.value=o),n.current.previous),[o])}var Ao=[" ","Enter","ArrowUp","ArrowDown"],_o=[" ","Enter"],de="Select",[ge,Se,Eo]=ze(de),[re,Nn]=he(de,[Eo,Ke]),Ce=Ke(),[Mo,X]=re(de),[Do,Oo]=re(de),ut=o=>{const{__scopeSelect:n,children:e,open:r,defaultOpen:s,onOpenChange:c,value:l,defaultValue:i,onValueChange:a,dir:p,name:x,autoComplete:g,disabled:b,required:w}=o,f=Ce(n),[h,S]=d.useState(null),[m,u]=d.useState(null),[C,T]=d.useState(!1),P=qe(p),[F=!1,E]=ce({prop:r,defaultProp:s,onChange:c}),[M,V]=ce({prop:l,defaultProp:i,onChange:a}),$=d.useRef(null),J=h?!!h.closest("form"):!0,[H,z]=d.useState(new Set),q=Array.from(H).map(D=>D.props.value).join(";");return t.jsx(zt,{...f,children:t.jsxs(Mo,{required:w,scope:n,trigger:h,onTriggerChange:S,valueNode:m,onValueNodeChange:u,valueNodeHasChildren:C,onValueNodeHasChildrenChange:T,contentId:le(),value:M,onValueChange:V,open:F,onOpenChange:E,dir:P,triggerPointerDownPosRef:$,disabled:b,children:[t.jsx(ge.Provider,{scope:n,children:t.jsx(Do,{scope:o.__scopeSelect,onNativeOptionAdd:d.useCallback(D=>{z(B=>new Set(B).add(D))},[]),onNativeOptionRemove:d.useCallback(D=>{z(B=>{const U=new Set(B);return U.delete(D),U})},[]),children:e})}),J?t.jsxs(kt,{"aria-hidden":!0,required:w,tabIndex:-1,name:x,autoComplete:g,value:M,onChange:D=>V(D.target.value),disabled:b,children:[M===void 0?t.jsx("option",{value:""}):null,Array.from(H)]},q):null]})})};ut.displayName=de;var pt="SelectTrigger",ft=d.forwardRef((o,n)=>{const{__scopeSelect:e,disabled:r=!1,...s}=o,c=Ce(e),l=X(pt,e),i=l.disabled||r,a=O(n,l.onTriggerChange),p=Se(e),[x,g,b]=Lt(f=>{const h=p().filter(u=>!u.disabled),S=h.find(u=>u.value===l.value),m=Vt(h,f,S);m!==void 0&&l.onValueChange(m.value)}),w=()=>{i||(l.onOpenChange(!0),b())};return t.jsx(Ft,{asChild:!0,...c,children:t.jsx(_.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":Ot(l.value)?"":void 0,...s,ref:a,onClick:A(s.onClick,f=>{f.currentTarget.focus()}),onPointerDown:A(s.onPointerDown,f=>{const h=f.target;h.hasPointerCapture(f.pointerId)&&h.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&(w(),l.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)},f.preventDefault())}),onKeyDown:A(s.onKeyDown,f=>{const h=x.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&g(f.key),!(h&&f.key===" ")&&Ao.includes(f.key)&&(w(),f.preventDefault())})})})});ft.displayName=pt;var mt="SelectValue",ht=d.forwardRef((o,n)=>{const{__scopeSelect:e,className:r,style:s,children:c,placeholder:l="",...i}=o,a=X(mt,e),{onValueNodeHasChildrenChange:p}=a,x=c!==void 0,g=O(n,a.onValueNodeChange);return K(()=>{p(x)},[p,x]),t.jsx(_.span,{...i,ref:g,style:{pointerEvents:"none"},children:Ot(a.value)?t.jsx(t.Fragment,{children:l}):c})});ht.displayName=mt;var ko="SelectIcon",xt=d.forwardRef((o,n)=>{const{__scopeSelect:e,children:r,...s}=o;return t.jsx(_.span,{"aria-hidden":!0,...s,ref:n,children:r||"▼"})});xt.displayName=ko;var Lo="SelectPortal",vt=o=>t.jsx(no,{asChild:!0,...o});vt.displayName=Lo;var te="SelectContent",gt=d.forwardRef((o,n)=>{const e=X(te,o.__scopeSelect),[r,s]=d.useState();if(K(()=>{s(new DocumentFragment)},[]),!e.open){const c=r;return c?Ge.createPortal(t.jsx(St,{scope:o.__scopeSelect,children:t.jsx(ge.Slot,{scope:o.__scopeSelect,children:t.jsx("div",{children:o.children})})}),c):null}return t.jsx(Ct,{...o,ref:n})});gt.displayName=te;var W=10,[St,Z]=re(te),Vo="SelectContentImpl",Ct=d.forwardRef((o,n)=>{const{__scopeSelect:e,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:c,onPointerDownOutside:l,side:i,sideOffset:a,align:p,alignOffset:x,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:f,hideWhenDetached:h,avoidCollisions:S,...m}=o,u=X(te,e),[C,T]=d.useState(null),[P,F]=d.useState(null),E=O(n,v=>T(v)),[M,V]=d.useState(null),[$,J]=d.useState(null),H=Se(e),[z,q]=d.useState(!1),D=d.useRef(!1);d.useEffect(()=>{if(C)return Qt(C)},[C]),eo();const B=d.useCallback(v=>{const[R,...k]=H().map(I=>I.ref.current),[N]=k.slice(-1),y=document.activeElement;for(const I of v)if(I===y||(I==null||I.scrollIntoView({block:"nearest"}),I===R&&P&&(P.scrollTop=0),I===N&&P&&(P.scrollTop=P.scrollHeight),I==null||I.focus(),document.activeElement!==y))return},[H,P]),U=d.useCallback(()=>B([M,C]),[B,M,C]);d.useEffect(()=>{z&&U()},[z,U]);const{onOpenChange:oe,triggerPointerDownPosRef:Y}=u;d.useEffect(()=>{if(C){let v={x:0,y:0};const R=N=>{var y,I;v={x:Math.abs(Math.round(N.pageX)-(((y=Y.current)==null?void 0:y.x)??0)),y:Math.abs(Math.round(N.pageY)-(((I=Y.current)==null?void 0:I.y)??0))}},k=N=>{v.x<=10&&v.y<=10?N.preventDefault():C.contains(N.target)||oe(!1),document.removeEventListener("pointermove",R),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",R),document.addEventListener("pointerup",k,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",k,{capture:!0})}}},[C,oe,Y]),d.useEffect(()=>{const v=()=>oe(!1);return window.addEventListener("blur",v),window.addEventListener("resize",v),()=>{window.removeEventListener("blur",v),window.removeEventListener("resize",v)}},[oe]);const[we,ue]=Lt(v=>{const R=H().filter(y=>!y.disabled),k=R.find(y=>y.ref.current===document.activeElement),N=Vt(R,v,k);N&&setTimeout(()=>N.ref.current.focus())}),be=d.useCallback((v,R,k)=>{const N=!D.current&&!k;(u.value!==void 0&&u.value===R||N)&&(V(v),N&&(D.current=!0))},[u.value]),ye=d.useCallback(()=>C==null?void 0:C.focus(),[C]),ne=d.useCallback((v,R,k)=>{const N=!D.current&&!k;(u.value!==void 0&&u.value===R||N)&&J(v)},[u.value]),pe=r==="popper"?Pe:wt,se=pe===Pe?{side:i,sideOffset:a,align:p,alignOffset:x,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:f,hideWhenDetached:h,avoidCollisions:S}:{};return t.jsx(St,{scope:e,content:C,viewport:P,onViewportChange:F,itemRefCallback:be,selectedItem:M,onItemLeave:ye,itemTextRefCallback:ne,focusSelectedItem:U,selectedItemText:$,position:r,isPositioned:z,searchRef:we,children:t.jsx(to,{as:je,allowPinchZoom:!0,children:t.jsx(oo,{asChild:!0,trapped:u.open,onMountAutoFocus:v=>{v.preventDefault()},onUnmountAutoFocus:A(s,v=>{var R;(R=u.trigger)==null||R.focus({preventScroll:!0}),v.preventDefault()}),children:t.jsx($t,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:()=>u.onOpenChange(!1),children:t.jsx(pe,{role:"listbox",id:u.contentId,"data-state":u.open?"open":"closed",dir:u.dir,onContextMenu:v=>v.preventDefault(),...m,...se,onPlaced:()=>q(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:A(m.onKeyDown,v=>{const R=v.ctrlKey||v.altKey||v.metaKey;if(v.key==="Tab"&&v.preventDefault(),!R&&v.key.length===1&&ue(v.key),["ArrowUp","ArrowDown","Home","End"].includes(v.key)){let N=H().filter(y=>!y.disabled).map(y=>y.ref.current);if(["ArrowUp","End"].includes(v.key)&&(N=N.slice().reverse()),["ArrowUp","ArrowDown"].includes(v.key)){const y=v.target,I=N.indexOf(y);N=N.slice(I+1)}setTimeout(()=>B(N)),v.preventDefault()}})})})})})})});Ct.displayName=Vo;var Ho="SelectItemAlignedPosition",wt=d.forwardRef((o,n)=>{const{__scopeSelect:e,onPlaced:r,...s}=o,c=X(te,e),l=Z(te,e),[i,a]=d.useState(null),[p,x]=d.useState(null),g=O(n,E=>x(E)),b=Se(e),w=d.useRef(!1),f=d.useRef(!0),{viewport:h,selectedItem:S,selectedItemText:m,focusSelectedItem:u}=l,C=d.useCallback(()=>{if(c.trigger&&c.valueNode&&i&&p&&h&&S&&m){const E=c.trigger.getBoundingClientRect(),M=p.getBoundingClientRect(),V=c.valueNode.getBoundingClientRect(),$=m.getBoundingClientRect();if(c.dir!=="rtl"){const y=$.left-M.left,I=V.left-y,Q=E.left-I,ee=E.width+Q,Ie=Math.max(ee,M.width),Ne=window.innerWidth-W,Re=Ue(I,[W,Ne-Ie]);i.style.minWidth=ee+"px",i.style.left=Re+"px"}else{const y=M.right-$.right,I=window.innerWidth-V.right-y,Q=window.innerWidth-E.right-I,ee=E.width+Q,Ie=Math.max(ee,M.width),Ne=window.innerWidth-W,Re=Ue(I,[W,Ne-Ie]);i.style.minWidth=ee+"px",i.style.right=Re+"px"}const J=b(),H=window.innerHeight-W*2,z=h.scrollHeight,q=window.getComputedStyle(p),D=parseInt(q.borderTopWidth,10),B=parseInt(q.paddingTop,10),U=parseInt(q.borderBottomWidth,10),oe=parseInt(q.paddingBottom,10),Y=D+B+z+oe+U,we=Math.min(S.offsetHeight*5,Y),ue=window.getComputedStyle(h),be=parseInt(ue.paddingTop,10),ye=parseInt(ue.paddingBottom,10),ne=E.top+E.height/2-W,pe=H-ne,se=S.offsetHeight/2,v=S.offsetTop+se,R=D+B+v,k=Y-R;if(R<=ne){const y=S===J[J.length-1].ref.current;i.style.bottom="0px";const I=p.clientHeight-h.offsetTop-h.offsetHeight,Q=Math.max(pe,se+(y?ye:0)+I+U),ee=R+Q;i.style.height=ee+"px"}else{const y=S===J[0].ref.current;i.style.top="0px";const Q=Math.max(ne,D+h.offsetTop+(y?be:0)+se)+k;i.style.height=Q+"px",h.scrollTop=R-ne+h.offsetTop}i.style.margin=`${W}px 0`,i.style.minHeight=we+"px",i.style.maxHeight=H+"px",r==null||r(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,i,p,h,S,m,c.dir,r]);K(()=>C(),[C]);const[T,P]=d.useState();K(()=>{p&&P(window.getComputedStyle(p).zIndex)},[p]);const F=d.useCallback(E=>{E&&f.current===!0&&(C(),u==null||u(),f.current=!1)},[C,u]);return t.jsx(Fo,{scope:e,contentWrapper:i,shouldExpandOnScrollRef:w,onScrollButtonChange:F,children:t.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:t.jsx(_.div,{...s,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});wt.displayName=Ho;var Bo="SelectPopperPosition",Pe=d.forwardRef((o,n)=>{const{__scopeSelect:e,align:r="start",collisionPadding:s=W,...c}=o,l=Ce(e);return t.jsx(Ut,{...l,...c,ref:n,align:r,collisionPadding:s,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Pe.displayName=Bo;var[Fo,Fe]=re(te,{}),Ae="SelectViewport",bt=d.forwardRef((o,n)=>{const{__scopeSelect:e,nonce:r,...s}=o,c=Z(Ae,e),l=Fe(Ae,e),i=O(n,c.onViewportChange),a=d.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),t.jsx(ge.Slot,{scope:e,children:t.jsx(_.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:i,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:A(s.onScroll,p=>{const x=p.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=l;if(b!=null&&b.current&&g){const w=Math.abs(a.current-x.scrollTop);if(w>0){const f=window.innerHeight-W*2,h=parseFloat(g.style.minHeight),S=parseFloat(g.style.height),m=Math.max(h,S);if(m<f){const u=m+w,C=Math.min(f,u),T=u-C;g.style.height=C+"px",g.style.bottom==="0px"&&(x.scrollTop=T>0?T:0,g.style.justifyContent="flex-end")}}}a.current=x.scrollTop})})})]})});bt.displayName=Ae;var yt="SelectGroup",[$o,Uo]=re(yt),It=d.forwardRef((o,n)=>{const{__scopeSelect:e,...r}=o,s=le();return t.jsx($o,{scope:e,id:s,children:t.jsx(_.div,{role:"group","aria-labelledby":s,...r,ref:n})})});It.displayName=yt;var Nt="SelectLabel",Rt=d.forwardRef((o,n)=>{const{__scopeSelect:e,...r}=o,s=Uo(Nt,e);return t.jsx(_.div,{id:s.id,...r,ref:n})});Rt.displayName=Nt;var me="SelectItem",[Wo,jt]=re(me),Tt=d.forwardRef((o,n)=>{const{__scopeSelect:e,value:r,disabled:s=!1,textValue:c,...l}=o,i=X(me,e),a=Z(me,e),p=i.value===r,[x,g]=d.useState(c??""),[b,w]=d.useState(!1),f=O(n,m=>{var u;return(u=a.itemRefCallback)==null?void 0:u.call(a,m,r,s)}),h=le(),S=()=>{s||(i.onValueChange(r),i.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(Wo,{scope:e,value:r,disabled:s,textId:h,isSelected:p,onItemTextChange:d.useCallback(m=>{g(u=>u||((m==null?void 0:m.textContent)??"").trim())},[]),children:t.jsx(ge.ItemSlot,{scope:e,value:r,disabled:s,textValue:x,children:t.jsx(_.div,{role:"option","aria-labelledby":h,"data-highlighted":b?"":void 0,"aria-selected":p&&b,"data-state":p?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:f,onFocus:A(l.onFocus,()=>w(!0)),onBlur:A(l.onBlur,()=>w(!1)),onPointerUp:A(l.onPointerUp,S),onPointerMove:A(l.onPointerMove,m=>{var u;s?(u=a.onItemLeave)==null||u.call(a):m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:A(l.onPointerLeave,m=>{var u;m.currentTarget===document.activeElement&&((u=a.onItemLeave)==null||u.call(a))}),onKeyDown:A(l.onKeyDown,m=>{var C;((C=a.searchRef)==null?void 0:C.current)!==""&&m.key===" "||(_o.includes(m.key)&&S(),m.key===" "&&m.preventDefault())})})})})});Tt.displayName=me;var ae="SelectItemText",Pt=d.forwardRef((o,n)=>{const{__scopeSelect:e,className:r,style:s,...c}=o,l=X(ae,e),i=Z(ae,e),a=jt(ae,e),p=Oo(ae,e),[x,g]=d.useState(null),b=O(n,m=>g(m),a.onItemTextChange,m=>{var u;return(u=i.itemTextRefCallback)==null?void 0:u.call(i,m,a.value,a.disabled)}),w=x==null?void 0:x.textContent,f=d.useMemo(()=>t.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:h,onNativeOptionRemove:S}=p;return K(()=>(h(f),()=>S(f)),[h,S,f]),t.jsxs(t.Fragment,{children:[t.jsx(_.span,{id:a.textId,...c,ref:b}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ge.createPortal(c.children,l.valueNode):null]})});Pt.displayName=ae;var At="SelectItemIndicator",_t=d.forwardRef((o,n)=>{const{__scopeSelect:e,...r}=o;return jt(At,e).isSelected?t.jsx(_.span,{"aria-hidden":!0,...r,ref:n}):null});_t.displayName=At;var _e="SelectScrollUpButton",Et=d.forwardRef((o,n)=>{const e=Z(_e,o.__scopeSelect),r=Fe(_e,o.__scopeSelect),[s,c]=d.useState(!1),l=O(n,r.onScrollButtonChange);return K(()=>{if(e.viewport&&e.isPositioned){let i=function(){const p=a.scrollTop>0;c(p)};const a=e.viewport;return i(),a.addEventListener("scroll",i),()=>a.removeEventListener("scroll",i)}},[e.viewport,e.isPositioned]),s?t.jsx(Dt,{...o,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:a}=e;i&&a&&(i.scrollTop=i.scrollTop-a.offsetHeight)}}):null});Et.displayName=_e;var Ee="SelectScrollDownButton",Mt=d.forwardRef((o,n)=>{const e=Z(Ee,o.__scopeSelect),r=Fe(Ee,o.__scopeSelect),[s,c]=d.useState(!1),l=O(n,r.onScrollButtonChange);return K(()=>{if(e.viewport&&e.isPositioned){let i=function(){const p=a.scrollHeight-a.clientHeight,x=Math.ceil(a.scrollTop)<p;c(x)};const a=e.viewport;return i(),a.addEventListener("scroll",i),()=>a.removeEventListener("scroll",i)}},[e.viewport,e.isPositioned]),s?t.jsx(Dt,{...o,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:a}=e;i&&a&&(i.scrollTop=i.scrollTop+a.offsetHeight)}}):null});Mt.displayName=Ee;var Dt=d.forwardRef((o,n)=>{const{__scopeSelect:e,onAutoScroll:r,...s}=o,c=Z("SelectScrollButton",e),l=d.useRef(null),i=Se(e),a=d.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return d.useEffect(()=>()=>a(),[a]),K(()=>{var x;const p=i().find(g=>g.ref.current===document.activeElement);(x=p==null?void 0:p.ref.current)==null||x.scrollIntoView({block:"nearest"})},[i]),t.jsx(_.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:A(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:A(s.onPointerMove,()=>{var p;(p=c.onItemLeave)==null||p.call(c),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:A(s.onPointerLeave,()=>{a()})})}),Ko="SelectSeparator",Go=d.forwardRef((o,n)=>{const{__scopeSelect:e,...r}=o;return t.jsx(_.div,{"aria-hidden":!0,...r,ref:n})});Go.displayName=Ko;var Me="SelectArrow",zo=d.forwardRef((o,n)=>{const{__scopeSelect:e,...r}=o,s=Ce(e),c=X(Me,e),l=Z(Me,e);return c.open&&l.position==="popper"?t.jsx(Wt,{...s,...r,ref:n}):null});zo.displayName=Me;function Ot(o){return o===""||o===void 0}var kt=d.forwardRef((o,n)=>{const{value:e,...r}=o,s=d.useRef(null),c=O(n,s),l=Po(e);return d.useEffect(()=>{const i=s.current,a=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==e&&x){const g=new Event("change",{bubbles:!0});x.call(i,e),i.dispatchEvent(g)}},[l,e]),t.jsx(Kt,{asChild:!0,children:t.jsx("select",{...r,ref:c,defaultValue:e})})});kt.displayName="BubbleSelect";function Lt(o){const n=Gt(o),e=d.useRef(""),r=d.useRef(0),s=d.useCallback(l=>{const i=e.current+l;n(i),function a(p){e.current=p,window.clearTimeout(r.current),p!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(i)},[n]),c=d.useCallback(()=>{e.current="",window.clearTimeout(r.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),[e,s,c]}function Vt(o,n,e){const s=n.length>1&&Array.from(n).every(p=>p===n[0])?n[0]:n,c=e?o.indexOf(e):-1;let l=qo(o,Math.max(c,0));s.length===1&&(l=l.filter(p=>p!==e));const a=l.find(p=>p.textValue.toLowerCase().startsWith(s.toLowerCase()));return a!==e?a:void 0}function qo(o,n){return o.map((e,r)=>o[(n+r)%o.length])}var Yo=ut,Xo=ft,Zo=ht,Jo=xt,Qo=vt,en=gt,tn=bt,on=It,nn=Rt,rn=Tt,sn=Pt,an=_t,cn=Et,ln=Mt;const dn=({title:o,children:n,variant:e,icon:r,forceMount:s=!1})=>{const c=()=>{switch(e){case"changed":return t.jsx(L,{name:"Modified","aria-label":"Modified",className:"text-[#fb923c]"});case"renamed":return t.jsx(L,{name:"Renamed","aria-label":"Renamed",className:"text-[#fb923c]"});case"added":return t.jsx(L,{name:"Added","aria-label":"Added",className:"text-[#10b981]"});case"deleted":return t.jsx(L,{name:"Deleted","aria-label":"Deleted",className:"text-[#ef4444]"});default:return t.jsx(L,{name:"Modified","aria-label":"Modified",className:"text-[#fb923c]"})}},l=()=>{switch(e){case"changed":return"modified";default:return e}},i=o.replace(/\\\\/g,"\\");return t.jsxs(No,{value:o,children:[t.jsxs(un,{variant:l(),children:[r||c()," ",i]}),t.jsx(pn,{forceMount:s,className:ie("prose max-w-none whitespace-pre-wrap dark:prose-invert prose-pre:m-0 prose-pre:mb-1 prose-pre:rounded-none",{"radix-state-closed:hidden":s}),children:n})]})},un=d.forwardRef(({children:o,className:n,variant:e,...r},s)=>t.jsx(Ro,{className:"flex",asChild:!0,children:t.jsxs(jo,{className:ie("group flex w-full items-center justify-between border-b p-4 pr-3 font-mono text-sm font-medium leading-none hover:bg-foreground/20",n),...r,ref:s,children:[t.jsx("div",{className:"flex items-center gap-1.5",children:o}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-mono text-xs font-normal uppercase text-muted-foreground",children:e}),t.jsx(L,{name:"TriangleDownSmall",className:"transition group-radix-state-open:rotate-180","aria-hidden":!0})]})]})})),pn=d.forwardRef(({children:o,className:n,...e},r)=>t.jsx(To,{className:ie("",n),...e,ref:r,children:t.jsx("div",{children:o})})),fn=o=>t.jsx("pre",{...o}),mn={Accordion:dn,pre:fn};function Rn({diff:o,allApps:n}){const e=qt(),[r]=Yt(),s=new URLSearchParams(r);s.set("forceFresh","diff");const c=Ht(),l=ro.useSpinDelay(c.state!=="idle",{delay:0,minDuration:1e3}),i=[];for(const[a,p]of r.entries())a==="app1"||a==="app2"||i.push(t.jsx("input",{type:"hidden",name:a,value:p},a));return t.jsx(d.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center p-8",children:t.jsx($e,{content:"Loading diff",children:t.jsx(L,{name:"Refresh",className:"animate-spin"})})}),children:t.jsx(Xt,{resolve:o,errorElement:t.jsx("p",{className:"p-6 text-foreground-danger",children:"There was an error calculating the diff. Sorry."}),children:a=>t.jsxs("div",{className:"flex h-full w-full flex-col",children:[t.jsxs("div",{className:"flex h-14 min-h-14 w-full overflow-x-hidden border-b",children:[t.jsx("div",{className:"border-r",children:t.jsx($e,{content:"Reload diff",children:t.jsx(Zt,{to:`.?${s}`,className:"flex h-full w-14 items-center justify-center",children:t.jsx(L,{name:"Refresh",className:so({"animate-spin":l})})})})}),t.jsxs(Jt,{onChange:p=>e(p.currentTarget),className:"flex h-full flex-1 items-center overflow-x-auto scrollbar-thin scrollbar-thumb-scrollbar",children:[i,t.jsx(We,{name:"app1",label:"App 1",className:"border-r",allApps:n,defaultValue:a.app1}),t.jsx(We,{name:"app2",label:"App 2",allApps:n,defaultValue:a.app2})]},`${a.app1}${a.app2}`)]}),t.jsx("div",{className:"flex-grow overflow-y-scroll scrollbar-thin scrollbar-thumb-scrollbar",children:a.diffCode?t.jsx("div",{children:t.jsx(Io,{className:"w-full",type:"multiple",children:t.jsx(ao,{code:a.diffCode,components:mn})})}):a.app1&&a.app2?t.jsx("p",{className:"m-5 inline-flex items-center justify-center bg-foreground px-1 py-0.5 font-mono text-sm uppercase text-background",children:"There was a problem generating the diff"}):t.jsx("p",{className:"m-5 inline-flex items-center justify-center bg-foreground px-1 py-0.5 font-mono text-sm uppercase text-background",children:"Select two apps to compare"})})]})})})}function We({name:o,label:n,className:e,allApps:r,defaultValue:s}){return t.jsxs(Yo,{name:o,defaultValue:s,children:[t.jsxs(Xo,{className:ie("flex h-full w-full max-w-[50%] items-center justify-between px-3 text-left radix-placeholder:text-gray-500 focus-visible:outline-none",e),"aria-label":`Select ${n} for git Diff`,children:[t.jsxs("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:[n,":"," ",t.jsx(xn,{placeholder:`Select ${n}`,className:"inline-block w-40 text-ellipsis"})]}),t.jsx(Jo,{className:"",children:t.jsx(L,{name:"TriangleDownSmall"})})]}),t.jsx(Qo,{children:t.jsxs(en,{position:"popper",align:"start",className:"z-20 max-h-[50vh] bg-black text-white lg:max-h-[70vh]",children:[t.jsx(cn,{className:"flex h-5 cursor-default items-center justify-center ",children:t.jsx(L,{name:"ChevronUp"})}),t.jsx(tn,{className:"p-3",children:t.jsxs(on,{children:[t.jsx(nn,{className:"px-5 pb-3 font-mono uppercase",children:n}),r.map(c=>t.jsx(hn,{value:c.name,children:c.displayName},c.name))]})}),t.jsx(ln,{className:"flex h-5 cursor-default items-center justify-center ",children:t.jsx(L,{name:"ChevronDown"})})]})})]})}const hn=j.forwardRef(({children:o,className:n,...e},r)=>t.jsxs(rn,{className:ie("relative flex cursor-pointer select-none items-center rounded px-10 py-2 leading-none opacity-80 radix-disabled:text-red-500 radix-highlighted:opacity-100 radix-highlighted:outline-none radix-state-checked:opacity-100",n),...e,ref:r,children:[t.jsx(sn,{children:o}),t.jsx(an,{className:"absolute left-0 inline-flex w-[25px] items-center justify-center",children:t.jsx(L,{name:"CheckSmall"})})]})),xn=j.forwardRef(({children:o,className:n,...e},r)=>t.jsx(Zo,{...e,ref:r,children:e.value}));export{dn as A,en as C,Rn as D,on as G,Jo as I,nn as L,Qo as P,Yo as R,cn as S,Xo as T,Zo as V,tn as a,ln as b,ze as c,rn as d,sn as e,an as f,Io as g,qe as u};
2
- //# sourceMappingURL=diff-CpG96hGZ.js.map
1
+ import{R as j,j as t,r as d,c as Ht}from"./index-Czg1ruVn.js";import{c as he,u as O,d as je,f as ce,g as le,P as _,a as A,b as Bt,k as K,l as Ke,A as Ft,D as $t,C as Ut,m as Wt,V as Kt,n as Gt,R as zt,S as $e}from"./tooltip-BtzSIxlB.js";import{r as Ge,e as qt,b as Yt,A as Xt,L as Zt,F as Jt}from"./components-wgHiPsTg.js";import{h as Qt,u as eo,R as to,F as oo,P as no}from"./index-C6ToujzV.js";import{c as ie}from"./clsx-B-dksMZM.js";import{I as L,d as ro,c as so}from"./misc-S5ZD98sI.js";import{M as ao}from"./mdx-CQW0I4So.js";function ze(o){const n=o+"CollectionProvider",[e,r]=he(n),[s,c]=e(n,{collectionRef:{current:null},itemMap:new Map}),l=w=>{const{scope:f,children:h}=w,S=j.useRef(null),m=j.useRef(new Map).current;return t.jsx(s,{scope:f,itemMap:m,collectionRef:S,children:h})};l.displayName=n;const i=o+"CollectionSlot",a=j.forwardRef((w,f)=>{const{scope:h,children:S}=w,m=c(i,h),u=O(f,m.collectionRef);return t.jsx(je,{ref:u,children:S})});a.displayName=i;const p=o+"CollectionItemSlot",x="data-radix-collection-item",g=j.forwardRef((w,f)=>{const{scope:h,children:S,...m}=w,u=j.useRef(null),C=O(f,u),T=c(p,h);return j.useEffect(()=>(T.itemMap.set(u,{ref:u,...m}),()=>void T.itemMap.delete(u))),t.jsx(je,{[x]:"",ref:C,children:S})});g.displayName=p;function b(w){const f=c(o+"CollectionConsumer",w);return j.useCallback(()=>{const S=f.collectionRef.current;if(!S)return[];const m=Array.from(S.querySelectorAll(`[${x}]`));return Array.from(f.itemMap.values()).sort((T,P)=>m.indexOf(T.ref.current)-m.indexOf(P.ref.current))},[f.collectionRef,f.itemMap])}return[{Provider:l,Slot:a,ItemSlot:g},b,r]}var co=d.createContext(void 0);function qe(o){const n=d.useContext(co);return o||n||"ltr"}var De="Collapsible",[lo,Ye]=he(De),[io,Oe]=lo(De),Xe=d.forwardRef((o,n)=>{const{__scopeCollapsible:e,open:r,defaultOpen:s,disabled:c,onOpenChange:l,...i}=o,[a=!1,p]=ce({prop:r,defaultProp:s,onChange:l});return t.jsx(io,{scope:e,disabled:c,contentId:le(),open:a,onOpenToggle:d.useCallback(()=>p(x=>!x),[p]),children:t.jsx(_.div,{"data-state":Le(a),"data-disabled":c?"":void 0,...i,ref:n})})});Xe.displayName=De;var Ze="CollapsibleTrigger",Je=d.forwardRef((o,n)=>{const{__scopeCollapsible:e,...r}=o,s=Oe(Ze,e);return t.jsx(_.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Le(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:n,onClick:A(o.onClick,s.onOpenToggle)})});Je.displayName=Ze;var ke="CollapsibleContent",Qe=d.forwardRef((o,n)=>{const{forceMount:e,...r}=o,s=Oe(ke,o.__scopeCollapsible);return t.jsx(Bt,{present:e||s.open,children:({present:c})=>t.jsx(uo,{...r,ref:n,present:c})})});Qe.displayName=ke;var uo=d.forwardRef((o,n)=>{const{__scopeCollapsible:e,present:r,children:s,...c}=o,l=Oe(ke,e),[i,a]=d.useState(r),p=d.useRef(null),x=O(n,p),g=d.useRef(0),b=g.current,w=d.useRef(0),f=w.current,h=l.open||i,S=d.useRef(h),m=d.useRef();return d.useEffect(()=>{const u=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(u)},[]),K(()=>{const u=p.current;if(u){m.current=m.current||{transitionDuration:u.style.transitionDuration,animationName:u.style.animationName},u.style.transitionDuration="0s",u.style.animationName="none";const C=u.getBoundingClientRect();g.current=C.height,w.current=C.width,S.current||(u.style.transitionDuration=m.current.transitionDuration,u.style.animationName=m.current.animationName),a(r)}},[l.open,r]),t.jsx(_.div,{"data-state":Le(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!h,...c,ref:x,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":f?`${f}px`:void 0,...o.style},children:h&&s})});function Le(o){return o?"open":"closed"}var po=Xe,fo=Je,mo=Qe,G="Accordion",ho=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Ve,xo,vo]=ze(G),[xe,In]=he(G,[vo,Ye]),He=Ye(),et=j.forwardRef((o,n)=>{const{type:e,...r}=o,s=r,c=r;return t.jsx(Ve.Provider,{scope:o.__scopeAccordion,children:e==="multiple"?t.jsx(wo,{...c,ref:n}):t.jsx(Co,{...s,ref:n})})});et.displayName=G;var[tt,go]=xe(G),[ot,So]=xe(G,{collapsible:!1}),Co=j.forwardRef((o,n)=>{const{value:e,defaultValue:r,onValueChange:s=()=>{},collapsible:c=!1,...l}=o,[i,a]=ce({prop:e,defaultProp:r,onChange:s});return t.jsx(tt,{scope:o.__scopeAccordion,value:i?[i]:[],onItemOpen:a,onItemClose:j.useCallback(()=>c&&a(""),[c,a]),children:t.jsx(ot,{scope:o.__scopeAccordion,collapsible:c,children:t.jsx(nt,{...l,ref:n})})})}),wo=j.forwardRef((o,n)=>{const{value:e,defaultValue:r,onValueChange:s=()=>{},...c}=o,[l=[],i]=ce({prop:e,defaultProp:r,onChange:s}),a=j.useCallback(x=>i((g=[])=>[...g,x]),[i]),p=j.useCallback(x=>i((g=[])=>g.filter(b=>b!==x)),[i]);return t.jsx(tt,{scope:o.__scopeAccordion,value:l,onItemOpen:a,onItemClose:p,children:t.jsx(ot,{scope:o.__scopeAccordion,collapsible:!0,children:t.jsx(nt,{...c,ref:n})})})}),[bo,ve]=xe(G),nt=j.forwardRef((o,n)=>{const{__scopeAccordion:e,disabled:r,dir:s,orientation:c="vertical",...l}=o,i=j.useRef(null),a=O(i,n),p=xo(e),g=qe(s)==="ltr",b=A(o.onKeyDown,w=>{var M;if(!ho.includes(w.key))return;const f=w.target,h=p().filter(V=>{var $;return!(($=V.ref.current)!=null&&$.disabled)}),S=h.findIndex(V=>V.ref.current===f),m=h.length;if(S===-1)return;w.preventDefault();let u=S;const C=0,T=m-1,P=()=>{u=S+1,u>T&&(u=C)},F=()=>{u=S-1,u<C&&(u=T)};switch(w.key){case"Home":u=C;break;case"End":u=T;break;case"ArrowRight":c==="horizontal"&&(g?P():F());break;case"ArrowDown":c==="vertical"&&P();break;case"ArrowLeft":c==="horizontal"&&(g?F():P());break;case"ArrowUp":c==="vertical"&&F();break}const E=u%m;(M=h[E].ref.current)==null||M.focus()});return t.jsx(bo,{scope:e,disabled:r,direction:s,orientation:c,children:t.jsx(Ve.Slot,{scope:e,children:t.jsx(_.div,{...l,"data-orientation":c,ref:a,onKeyDown:r?void 0:b})})})}),fe="AccordionItem",[yo,Be]=xe(fe),rt=j.forwardRef((o,n)=>{const{__scopeAccordion:e,value:r,...s}=o,c=ve(fe,e),l=go(fe,e),i=He(e),a=le(),p=r&&l.value.includes(r)||!1,x=c.disabled||o.disabled;return t.jsx(yo,{scope:e,open:p,disabled:x,triggerId:a,children:t.jsx(po,{"data-orientation":c.orientation,"data-state":dt(p),...i,...s,ref:n,disabled:x,open:p,onOpenChange:g=>{g?l.onItemOpen(r):l.onItemClose(r)}})})});rt.displayName=fe;var st="AccordionHeader",at=j.forwardRef((o,n)=>{const{__scopeAccordion:e,...r}=o,s=ve(G,e),c=Be(st,e);return t.jsx(_.h3,{"data-orientation":s.orientation,"data-state":dt(c.open),"data-disabled":c.disabled?"":void 0,...r,ref:n})});at.displayName=st;var Te="AccordionTrigger",ct=j.forwardRef((o,n)=>{const{__scopeAccordion:e,...r}=o,s=ve(G,e),c=Be(Te,e),l=So(Te,e),i=He(e);return t.jsx(Ve.ItemSlot,{scope:e,children:t.jsx(fo,{"aria-disabled":c.open&&!l.collapsible||void 0,"data-orientation":s.orientation,id:c.triggerId,...i,...r,ref:n})})});ct.displayName=Te;var lt="AccordionContent",it=j.forwardRef((o,n)=>{const{__scopeAccordion:e,...r}=o,s=ve(G,e),c=Be(lt,e),l=He(e);return t.jsx(mo,{role:"region","aria-labelledby":c.triggerId,"data-orientation":s.orientation,...l,...r,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...o.style}})});it.displayName=lt;function dt(o){return o?"open":"closed"}var Io=et,No=rt,Ro=at,jo=ct,To=it;function Ue(o,[n,e]){return Math.min(e,Math.max(n,o))}function Po(o){const n=d.useRef({value:o,previous:o});return d.useMemo(()=>(n.current.value!==o&&(n.current.previous=n.current.value,n.current.value=o),n.current.previous),[o])}var Ao=[" ","Enter","ArrowUp","ArrowDown"],_o=[" ","Enter"],de="Select",[ge,Se,Eo]=ze(de),[re,Nn]=he(de,[Eo,Ke]),Ce=Ke(),[Mo,X]=re(de),[Do,Oo]=re(de),ut=o=>{const{__scopeSelect:n,children:e,open:r,defaultOpen:s,onOpenChange:c,value:l,defaultValue:i,onValueChange:a,dir:p,name:x,autoComplete:g,disabled:b,required:w}=o,f=Ce(n),[h,S]=d.useState(null),[m,u]=d.useState(null),[C,T]=d.useState(!1),P=qe(p),[F=!1,E]=ce({prop:r,defaultProp:s,onChange:c}),[M,V]=ce({prop:l,defaultProp:i,onChange:a}),$=d.useRef(null),J=h?!!h.closest("form"):!0,[H,z]=d.useState(new Set),q=Array.from(H).map(D=>D.props.value).join(";");return t.jsx(zt,{...f,children:t.jsxs(Mo,{required:w,scope:n,trigger:h,onTriggerChange:S,valueNode:m,onValueNodeChange:u,valueNodeHasChildren:C,onValueNodeHasChildrenChange:T,contentId:le(),value:M,onValueChange:V,open:F,onOpenChange:E,dir:P,triggerPointerDownPosRef:$,disabled:b,children:[t.jsx(ge.Provider,{scope:n,children:t.jsx(Do,{scope:o.__scopeSelect,onNativeOptionAdd:d.useCallback(D=>{z(B=>new Set(B).add(D))},[]),onNativeOptionRemove:d.useCallback(D=>{z(B=>{const U=new Set(B);return U.delete(D),U})},[]),children:e})}),J?t.jsxs(kt,{"aria-hidden":!0,required:w,tabIndex:-1,name:x,autoComplete:g,value:M,onChange:D=>V(D.target.value),disabled:b,children:[M===void 0?t.jsx("option",{value:""}):null,Array.from(H)]},q):null]})})};ut.displayName=de;var pt="SelectTrigger",ft=d.forwardRef((o,n)=>{const{__scopeSelect:e,disabled:r=!1,...s}=o,c=Ce(e),l=X(pt,e),i=l.disabled||r,a=O(n,l.onTriggerChange),p=Se(e),[x,g,b]=Lt(f=>{const h=p().filter(u=>!u.disabled),S=h.find(u=>u.value===l.value),m=Vt(h,f,S);m!==void 0&&l.onValueChange(m.value)}),w=()=>{i||(l.onOpenChange(!0),b())};return t.jsx(Ft,{asChild:!0,...c,children:t.jsx(_.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":Ot(l.value)?"":void 0,...s,ref:a,onClick:A(s.onClick,f=>{f.currentTarget.focus()}),onPointerDown:A(s.onPointerDown,f=>{const h=f.target;h.hasPointerCapture(f.pointerId)&&h.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&(w(),l.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)},f.preventDefault())}),onKeyDown:A(s.onKeyDown,f=>{const h=x.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&g(f.key),!(h&&f.key===" ")&&Ao.includes(f.key)&&(w(),f.preventDefault())})})})});ft.displayName=pt;var mt="SelectValue",ht=d.forwardRef((o,n)=>{const{__scopeSelect:e,className:r,style:s,children:c,placeholder:l="",...i}=o,a=X(mt,e),{onValueNodeHasChildrenChange:p}=a,x=c!==void 0,g=O(n,a.onValueNodeChange);return K(()=>{p(x)},[p,x]),t.jsx(_.span,{...i,ref:g,style:{pointerEvents:"none"},children:Ot(a.value)?t.jsx(t.Fragment,{children:l}):c})});ht.displayName=mt;var ko="SelectIcon",xt=d.forwardRef((o,n)=>{const{__scopeSelect:e,children:r,...s}=o;return t.jsx(_.span,{"aria-hidden":!0,...s,ref:n,children:r||"▼"})});xt.displayName=ko;var Lo="SelectPortal",vt=o=>t.jsx(no,{asChild:!0,...o});vt.displayName=Lo;var te="SelectContent",gt=d.forwardRef((o,n)=>{const e=X(te,o.__scopeSelect),[r,s]=d.useState();if(K(()=>{s(new DocumentFragment)},[]),!e.open){const c=r;return c?Ge.createPortal(t.jsx(St,{scope:o.__scopeSelect,children:t.jsx(ge.Slot,{scope:o.__scopeSelect,children:t.jsx("div",{children:o.children})})}),c):null}return t.jsx(Ct,{...o,ref:n})});gt.displayName=te;var W=10,[St,Z]=re(te),Vo="SelectContentImpl",Ct=d.forwardRef((o,n)=>{const{__scopeSelect:e,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:c,onPointerDownOutside:l,side:i,sideOffset:a,align:p,alignOffset:x,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:f,hideWhenDetached:h,avoidCollisions:S,...m}=o,u=X(te,e),[C,T]=d.useState(null),[P,F]=d.useState(null),E=O(n,v=>T(v)),[M,V]=d.useState(null),[$,J]=d.useState(null),H=Se(e),[z,q]=d.useState(!1),D=d.useRef(!1);d.useEffect(()=>{if(C)return Qt(C)},[C]),eo();const B=d.useCallback(v=>{const[R,...k]=H().map(I=>I.ref.current),[N]=k.slice(-1),y=document.activeElement;for(const I of v)if(I===y||(I==null||I.scrollIntoView({block:"nearest"}),I===R&&P&&(P.scrollTop=0),I===N&&P&&(P.scrollTop=P.scrollHeight),I==null||I.focus(),document.activeElement!==y))return},[H,P]),U=d.useCallback(()=>B([M,C]),[B,M,C]);d.useEffect(()=>{z&&U()},[z,U]);const{onOpenChange:oe,triggerPointerDownPosRef:Y}=u;d.useEffect(()=>{if(C){let v={x:0,y:0};const R=N=>{var y,I;v={x:Math.abs(Math.round(N.pageX)-(((y=Y.current)==null?void 0:y.x)??0)),y:Math.abs(Math.round(N.pageY)-(((I=Y.current)==null?void 0:I.y)??0))}},k=N=>{v.x<=10&&v.y<=10?N.preventDefault():C.contains(N.target)||oe(!1),document.removeEventListener("pointermove",R),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",R),document.addEventListener("pointerup",k,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",k,{capture:!0})}}},[C,oe,Y]),d.useEffect(()=>{const v=()=>oe(!1);return window.addEventListener("blur",v),window.addEventListener("resize",v),()=>{window.removeEventListener("blur",v),window.removeEventListener("resize",v)}},[oe]);const[we,ue]=Lt(v=>{const R=H().filter(y=>!y.disabled),k=R.find(y=>y.ref.current===document.activeElement),N=Vt(R,v,k);N&&setTimeout(()=>N.ref.current.focus())}),be=d.useCallback((v,R,k)=>{const N=!D.current&&!k;(u.value!==void 0&&u.value===R||N)&&(V(v),N&&(D.current=!0))},[u.value]),ye=d.useCallback(()=>C==null?void 0:C.focus(),[C]),ne=d.useCallback((v,R,k)=>{const N=!D.current&&!k;(u.value!==void 0&&u.value===R||N)&&J(v)},[u.value]),pe=r==="popper"?Pe:wt,se=pe===Pe?{side:i,sideOffset:a,align:p,alignOffset:x,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:f,hideWhenDetached:h,avoidCollisions:S}:{};return t.jsx(St,{scope:e,content:C,viewport:P,onViewportChange:F,itemRefCallback:be,selectedItem:M,onItemLeave:ye,itemTextRefCallback:ne,focusSelectedItem:U,selectedItemText:$,position:r,isPositioned:z,searchRef:we,children:t.jsx(to,{as:je,allowPinchZoom:!0,children:t.jsx(oo,{asChild:!0,trapped:u.open,onMountAutoFocus:v=>{v.preventDefault()},onUnmountAutoFocus:A(s,v=>{var R;(R=u.trigger)==null||R.focus({preventScroll:!0}),v.preventDefault()}),children:t.jsx($t,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:()=>u.onOpenChange(!1),children:t.jsx(pe,{role:"listbox",id:u.contentId,"data-state":u.open?"open":"closed",dir:u.dir,onContextMenu:v=>v.preventDefault(),...m,...se,onPlaced:()=>q(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:A(m.onKeyDown,v=>{const R=v.ctrlKey||v.altKey||v.metaKey;if(v.key==="Tab"&&v.preventDefault(),!R&&v.key.length===1&&ue(v.key),["ArrowUp","ArrowDown","Home","End"].includes(v.key)){let N=H().filter(y=>!y.disabled).map(y=>y.ref.current);if(["ArrowUp","End"].includes(v.key)&&(N=N.slice().reverse()),["ArrowUp","ArrowDown"].includes(v.key)){const y=v.target,I=N.indexOf(y);N=N.slice(I+1)}setTimeout(()=>B(N)),v.preventDefault()}})})})})})})});Ct.displayName=Vo;var Ho="SelectItemAlignedPosition",wt=d.forwardRef((o,n)=>{const{__scopeSelect:e,onPlaced:r,...s}=o,c=X(te,e),l=Z(te,e),[i,a]=d.useState(null),[p,x]=d.useState(null),g=O(n,E=>x(E)),b=Se(e),w=d.useRef(!1),f=d.useRef(!0),{viewport:h,selectedItem:S,selectedItemText:m,focusSelectedItem:u}=l,C=d.useCallback(()=>{if(c.trigger&&c.valueNode&&i&&p&&h&&S&&m){const E=c.trigger.getBoundingClientRect(),M=p.getBoundingClientRect(),V=c.valueNode.getBoundingClientRect(),$=m.getBoundingClientRect();if(c.dir!=="rtl"){const y=$.left-M.left,I=V.left-y,Q=E.left-I,ee=E.width+Q,Ie=Math.max(ee,M.width),Ne=window.innerWidth-W,Re=Ue(I,[W,Ne-Ie]);i.style.minWidth=ee+"px",i.style.left=Re+"px"}else{const y=M.right-$.right,I=window.innerWidth-V.right-y,Q=window.innerWidth-E.right-I,ee=E.width+Q,Ie=Math.max(ee,M.width),Ne=window.innerWidth-W,Re=Ue(I,[W,Ne-Ie]);i.style.minWidth=ee+"px",i.style.right=Re+"px"}const J=b(),H=window.innerHeight-W*2,z=h.scrollHeight,q=window.getComputedStyle(p),D=parseInt(q.borderTopWidth,10),B=parseInt(q.paddingTop,10),U=parseInt(q.borderBottomWidth,10),oe=parseInt(q.paddingBottom,10),Y=D+B+z+oe+U,we=Math.min(S.offsetHeight*5,Y),ue=window.getComputedStyle(h),be=parseInt(ue.paddingTop,10),ye=parseInt(ue.paddingBottom,10),ne=E.top+E.height/2-W,pe=H-ne,se=S.offsetHeight/2,v=S.offsetTop+se,R=D+B+v,k=Y-R;if(R<=ne){const y=S===J[J.length-1].ref.current;i.style.bottom="0px";const I=p.clientHeight-h.offsetTop-h.offsetHeight,Q=Math.max(pe,se+(y?ye:0)+I+U),ee=R+Q;i.style.height=ee+"px"}else{const y=S===J[0].ref.current;i.style.top="0px";const Q=Math.max(ne,D+h.offsetTop+(y?be:0)+se)+k;i.style.height=Q+"px",h.scrollTop=R-ne+h.offsetTop}i.style.margin=`${W}px 0`,i.style.minHeight=we+"px",i.style.maxHeight=H+"px",r==null||r(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,i,p,h,S,m,c.dir,r]);K(()=>C(),[C]);const[T,P]=d.useState();K(()=>{p&&P(window.getComputedStyle(p).zIndex)},[p]);const F=d.useCallback(E=>{E&&f.current===!0&&(C(),u==null||u(),f.current=!1)},[C,u]);return t.jsx(Fo,{scope:e,contentWrapper:i,shouldExpandOnScrollRef:w,onScrollButtonChange:F,children:t.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:t.jsx(_.div,{...s,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});wt.displayName=Ho;var Bo="SelectPopperPosition",Pe=d.forwardRef((o,n)=>{const{__scopeSelect:e,align:r="start",collisionPadding:s=W,...c}=o,l=Ce(e);return t.jsx(Ut,{...l,...c,ref:n,align:r,collisionPadding:s,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Pe.displayName=Bo;var[Fo,Fe]=re(te,{}),Ae="SelectViewport",bt=d.forwardRef((o,n)=>{const{__scopeSelect:e,nonce:r,...s}=o,c=Z(Ae,e),l=Fe(Ae,e),i=O(n,c.onViewportChange),a=d.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),t.jsx(ge.Slot,{scope:e,children:t.jsx(_.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:i,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:A(s.onScroll,p=>{const x=p.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=l;if(b!=null&&b.current&&g){const w=Math.abs(a.current-x.scrollTop);if(w>0){const f=window.innerHeight-W*2,h=parseFloat(g.style.minHeight),S=parseFloat(g.style.height),m=Math.max(h,S);if(m<f){const u=m+w,C=Math.min(f,u),T=u-C;g.style.height=C+"px",g.style.bottom==="0px"&&(x.scrollTop=T>0?T:0,g.style.justifyContent="flex-end")}}}a.current=x.scrollTop})})})]})});bt.displayName=Ae;var yt="SelectGroup",[$o,Uo]=re(yt),It=d.forwardRef((o,n)=>{const{__scopeSelect:e,...r}=o,s=le();return t.jsx($o,{scope:e,id:s,children:t.jsx(_.div,{role:"group","aria-labelledby":s,...r,ref:n})})});It.displayName=yt;var Nt="SelectLabel",Rt=d.forwardRef((o,n)=>{const{__scopeSelect:e,...r}=o,s=Uo(Nt,e);return t.jsx(_.div,{id:s.id,...r,ref:n})});Rt.displayName=Nt;var me="SelectItem",[Wo,jt]=re(me),Tt=d.forwardRef((o,n)=>{const{__scopeSelect:e,value:r,disabled:s=!1,textValue:c,...l}=o,i=X(me,e),a=Z(me,e),p=i.value===r,[x,g]=d.useState(c??""),[b,w]=d.useState(!1),f=O(n,m=>{var u;return(u=a.itemRefCallback)==null?void 0:u.call(a,m,r,s)}),h=le(),S=()=>{s||(i.onValueChange(r),i.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(Wo,{scope:e,value:r,disabled:s,textId:h,isSelected:p,onItemTextChange:d.useCallback(m=>{g(u=>u||((m==null?void 0:m.textContent)??"").trim())},[]),children:t.jsx(ge.ItemSlot,{scope:e,value:r,disabled:s,textValue:x,children:t.jsx(_.div,{role:"option","aria-labelledby":h,"data-highlighted":b?"":void 0,"aria-selected":p&&b,"data-state":p?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:f,onFocus:A(l.onFocus,()=>w(!0)),onBlur:A(l.onBlur,()=>w(!1)),onPointerUp:A(l.onPointerUp,S),onPointerMove:A(l.onPointerMove,m=>{var u;s?(u=a.onItemLeave)==null||u.call(a):m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:A(l.onPointerLeave,m=>{var u;m.currentTarget===document.activeElement&&((u=a.onItemLeave)==null||u.call(a))}),onKeyDown:A(l.onKeyDown,m=>{var C;((C=a.searchRef)==null?void 0:C.current)!==""&&m.key===" "||(_o.includes(m.key)&&S(),m.key===" "&&m.preventDefault())})})})})});Tt.displayName=me;var ae="SelectItemText",Pt=d.forwardRef((o,n)=>{const{__scopeSelect:e,className:r,style:s,...c}=o,l=X(ae,e),i=Z(ae,e),a=jt(ae,e),p=Oo(ae,e),[x,g]=d.useState(null),b=O(n,m=>g(m),a.onItemTextChange,m=>{var u;return(u=i.itemTextRefCallback)==null?void 0:u.call(i,m,a.value,a.disabled)}),w=x==null?void 0:x.textContent,f=d.useMemo(()=>t.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:h,onNativeOptionRemove:S}=p;return K(()=>(h(f),()=>S(f)),[h,S,f]),t.jsxs(t.Fragment,{children:[t.jsx(_.span,{id:a.textId,...c,ref:b}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ge.createPortal(c.children,l.valueNode):null]})});Pt.displayName=ae;var At="SelectItemIndicator",_t=d.forwardRef((o,n)=>{const{__scopeSelect:e,...r}=o;return jt(At,e).isSelected?t.jsx(_.span,{"aria-hidden":!0,...r,ref:n}):null});_t.displayName=At;var _e="SelectScrollUpButton",Et=d.forwardRef((o,n)=>{const e=Z(_e,o.__scopeSelect),r=Fe(_e,o.__scopeSelect),[s,c]=d.useState(!1),l=O(n,r.onScrollButtonChange);return K(()=>{if(e.viewport&&e.isPositioned){let i=function(){const p=a.scrollTop>0;c(p)};const a=e.viewport;return i(),a.addEventListener("scroll",i),()=>a.removeEventListener("scroll",i)}},[e.viewport,e.isPositioned]),s?t.jsx(Dt,{...o,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:a}=e;i&&a&&(i.scrollTop=i.scrollTop-a.offsetHeight)}}):null});Et.displayName=_e;var Ee="SelectScrollDownButton",Mt=d.forwardRef((o,n)=>{const e=Z(Ee,o.__scopeSelect),r=Fe(Ee,o.__scopeSelect),[s,c]=d.useState(!1),l=O(n,r.onScrollButtonChange);return K(()=>{if(e.viewport&&e.isPositioned){let i=function(){const p=a.scrollHeight-a.clientHeight,x=Math.ceil(a.scrollTop)<p;c(x)};const a=e.viewport;return i(),a.addEventListener("scroll",i),()=>a.removeEventListener("scroll",i)}},[e.viewport,e.isPositioned]),s?t.jsx(Dt,{...o,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:a}=e;i&&a&&(i.scrollTop=i.scrollTop+a.offsetHeight)}}):null});Mt.displayName=Ee;var Dt=d.forwardRef((o,n)=>{const{__scopeSelect:e,onAutoScroll:r,...s}=o,c=Z("SelectScrollButton",e),l=d.useRef(null),i=Se(e),a=d.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return d.useEffect(()=>()=>a(),[a]),K(()=>{var x;const p=i().find(g=>g.ref.current===document.activeElement);(x=p==null?void 0:p.ref.current)==null||x.scrollIntoView({block:"nearest"})},[i]),t.jsx(_.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:A(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:A(s.onPointerMove,()=>{var p;(p=c.onItemLeave)==null||p.call(c),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:A(s.onPointerLeave,()=>{a()})})}),Ko="SelectSeparator",Go=d.forwardRef((o,n)=>{const{__scopeSelect:e,...r}=o;return t.jsx(_.div,{"aria-hidden":!0,...r,ref:n})});Go.displayName=Ko;var Me="SelectArrow",zo=d.forwardRef((o,n)=>{const{__scopeSelect:e,...r}=o,s=Ce(e),c=X(Me,e),l=Z(Me,e);return c.open&&l.position==="popper"?t.jsx(Wt,{...s,...r,ref:n}):null});zo.displayName=Me;function Ot(o){return o===""||o===void 0}var kt=d.forwardRef((o,n)=>{const{value:e,...r}=o,s=d.useRef(null),c=O(n,s),l=Po(e);return d.useEffect(()=>{const i=s.current,a=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==e&&x){const g=new Event("change",{bubbles:!0});x.call(i,e),i.dispatchEvent(g)}},[l,e]),t.jsx(Kt,{asChild:!0,children:t.jsx("select",{...r,ref:c,defaultValue:e})})});kt.displayName="BubbleSelect";function Lt(o){const n=Gt(o),e=d.useRef(""),r=d.useRef(0),s=d.useCallback(l=>{const i=e.current+l;n(i),function a(p){e.current=p,window.clearTimeout(r.current),p!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(i)},[n]),c=d.useCallback(()=>{e.current="",window.clearTimeout(r.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),[e,s,c]}function Vt(o,n,e){const s=n.length>1&&Array.from(n).every(p=>p===n[0])?n[0]:n,c=e?o.indexOf(e):-1;let l=qo(o,Math.max(c,0));s.length===1&&(l=l.filter(p=>p!==e));const a=l.find(p=>p.textValue.toLowerCase().startsWith(s.toLowerCase()));return a!==e?a:void 0}function qo(o,n){return o.map((e,r)=>o[(n+r)%o.length])}var Yo=ut,Xo=ft,Zo=ht,Jo=xt,Qo=vt,en=gt,tn=bt,on=It,nn=Rt,rn=Tt,sn=Pt,an=_t,cn=Et,ln=Mt;const dn=({title:o,children:n,variant:e,icon:r,forceMount:s=!1})=>{const c=()=>{switch(e){case"changed":return t.jsx(L,{name:"Modified","aria-label":"Modified",className:"text-[#fb923c]"});case"renamed":return t.jsx(L,{name:"Renamed","aria-label":"Renamed",className:"text-[#fb923c]"});case"added":return t.jsx(L,{name:"Added","aria-label":"Added",className:"text-[#10b981]"});case"deleted":return t.jsx(L,{name:"Deleted","aria-label":"Deleted",className:"text-[#ef4444]"});default:return t.jsx(L,{name:"Modified","aria-label":"Modified",className:"text-[#fb923c]"})}},l=()=>{switch(e){case"changed":return"modified";default:return e}},i=o.replace(/\\\\/g,"\\");return t.jsxs(No,{value:o,children:[t.jsxs(un,{variant:l(),children:[r||c()," ",i]}),t.jsx(pn,{forceMount:s,className:ie("prose max-w-none whitespace-pre-wrap dark:prose-invert prose-pre:m-0 prose-pre:mb-1 prose-pre:rounded-none",{"radix-state-closed:hidden":s}),children:n})]})},un=d.forwardRef(({children:o,className:n,variant:e,...r},s)=>t.jsx(Ro,{className:"flex",asChild:!0,children:t.jsxs(jo,{className:ie("group flex w-full items-center justify-between border-b p-4 pr-3 font-mono text-sm font-medium leading-none hover:bg-foreground/20",n),...r,ref:s,children:[t.jsx("div",{className:"flex items-center gap-1.5",children:o}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-mono text-xs font-normal uppercase text-muted-foreground",children:e}),t.jsx(L,{name:"TriangleDownSmall",className:"transition group-radix-state-open:rotate-180","aria-hidden":!0})]})]})})),pn=d.forwardRef(({children:o,className:n,...e},r)=>t.jsx(To,{className:ie("",n),...e,ref:r,children:t.jsx("div",{children:o})})),fn=o=>t.jsx("pre",{...o}),mn={Accordion:dn,pre:fn};function Rn({diff:o,allApps:n}){const e=qt(),[r]=Yt(),s=new URLSearchParams(r);s.set("forceFresh","diff");const c=Ht(),l=ro.useSpinDelay(c.state!=="idle",{delay:0,minDuration:1e3}),i=[];for(const[a,p]of r.entries())a==="app1"||a==="app2"||i.push(t.jsx("input",{type:"hidden",name:a,value:p},a));return t.jsx(d.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center p-8",children:t.jsx($e,{content:"Loading diff",children:t.jsx(L,{name:"Refresh",className:"animate-spin"})})}),children:t.jsx(Xt,{resolve:o,errorElement:t.jsx("p",{className:"p-6 text-foreground-danger",children:"There was an error calculating the diff. Sorry."}),children:a=>t.jsxs("div",{className:"flex h-full w-full flex-col",children:[t.jsxs("div",{className:"flex h-14 min-h-14 w-full overflow-x-hidden border-b",children:[t.jsx("div",{className:"border-r",children:t.jsx($e,{content:"Reload diff",children:t.jsx(Zt,{to:`.?${s}`,className:"flex h-full w-14 items-center justify-center",children:t.jsx(L,{name:"Refresh",className:so({"animate-spin":l})})})})}),t.jsxs(Jt,{onChange:p=>e(p.currentTarget),className:"flex h-full flex-1 items-center overflow-x-auto scrollbar-thin scrollbar-thumb-scrollbar",children:[i,t.jsx(We,{name:"app1",label:"App 1",className:"border-r",allApps:n,defaultValue:a.app1}),t.jsx(We,{name:"app2",label:"App 2",allApps:n,defaultValue:a.app2})]},`${a.app1}${a.app2}`)]}),t.jsx("div",{className:"flex-grow overflow-y-scroll scrollbar-thin scrollbar-thumb-scrollbar",children:a.diffCode?t.jsx("div",{children:t.jsx(Io,{className:"w-full",type:"multiple",children:t.jsx(ao,{code:a.diffCode,components:mn})})}):a.app1&&a.app2?t.jsx("p",{className:"m-5 inline-flex items-center justify-center bg-foreground px-1 py-0.5 font-mono text-sm uppercase text-background",children:"There was a problem generating the diff"}):t.jsx("p",{className:"m-5 inline-flex items-center justify-center bg-foreground px-1 py-0.5 font-mono text-sm uppercase text-background",children:"Select two apps to compare"})})]})})})}function We({name:o,label:n,className:e,allApps:r,defaultValue:s}){return t.jsxs(Yo,{name:o,defaultValue:s,children:[t.jsxs(Xo,{className:ie("flex h-full w-full max-w-[50%] items-center justify-between px-3 text-left radix-placeholder:text-gray-500 focus-visible:outline-none",e),"aria-label":`Select ${n} for git Diff`,children:[t.jsxs("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:[n,":"," ",t.jsx(xn,{placeholder:`Select ${n}`,className:"inline-block w-40 text-ellipsis"})]}),t.jsx(Jo,{className:"",children:t.jsx(L,{name:"TriangleDownSmall"})})]}),t.jsx(Qo,{children:t.jsxs(en,{position:"popper",align:"start",className:"z-20 max-h-[50vh] bg-black text-white lg:max-h-[70vh]",children:[t.jsx(cn,{className:"flex h-5 cursor-default items-center justify-center ",children:t.jsx(L,{name:"ChevronUp"})}),t.jsx(tn,{className:"p-3",children:t.jsxs(on,{children:[t.jsx(nn,{className:"px-5 pb-3 font-mono uppercase",children:n}),r.map(c=>t.jsx(hn,{value:c.name,children:c.displayName},c.name))]})}),t.jsx(ln,{className:"flex h-5 cursor-default items-center justify-center ",children:t.jsx(L,{name:"ChevronDown"})})]})})]})}const hn=j.forwardRef(({children:o,className:n,...e},r)=>t.jsxs(rn,{className:ie("relative flex cursor-pointer select-none items-center rounded px-10 py-2 leading-none opacity-80 radix-disabled:text-red-500 radix-highlighted:opacity-100 radix-highlighted:outline-none radix-state-checked:opacity-100",n),...e,ref:r,children:[t.jsx(sn,{children:o}),t.jsx(an,{className:"absolute left-0 inline-flex w-[25px] items-center justify-center",children:t.jsx(L,{name:"CheckSmall"})})]})),xn=j.forwardRef(({children:o,className:n,...e},r)=>t.jsx(Zo,{...e,ref:r,children:e.value}));export{dn as A,en as C,Rn as D,on as G,Jo as I,nn as L,Qo as P,Yo as R,cn as S,Xo as T,Zo as V,tn as a,ln as b,ze as c,rn as d,sn as e,an as f,Io as g,qe as u};
2
+ //# sourceMappingURL=diff-4FQLirNf.js.map