@epic-web/workshop-app 6.70.0 → 6.71.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 (33) hide show
  1. package/build/client/assets/{_exerciseNumber-DNg1F_Vn.js → _exerciseNumber-DgMb13KP.js} +2 -2
  2. package/build/client/assets/{_exerciseNumber-DNg1F_Vn.js.map → _exerciseNumber-DgMb13KP.js.map} +1 -1
  3. package/build/client/assets/{_exerciseNumber_.finished-BmUlhiS8.js → _exerciseNumber_.finished-DkAs61X_.js} +2 -2
  4. package/build/client/assets/{_exerciseNumber_.finished-BmUlhiS8.js.map → _exerciseNumber_.finished-DkAs61X_.js.map} +1 -1
  5. package/build/client/assets/_layout-BQ8VYaze.js +2 -0
  6. package/build/client/assets/_layout-BQ8VYaze.js.map +1 -0
  7. package/build/client/assets/{_layout-C-j5TKNx.js → _layout-DR0LQ06M.js} +2 -2
  8. package/build/client/assets/{_layout-C-j5TKNx.js.map → _layout-DR0LQ06M.js.map} +1 -1
  9. package/build/client/assets/{finished-Cr3pXmrH.js → finished-CiVHAeSV.js} +2 -2
  10. package/build/client/assets/{finished-Cr3pXmrH.js.map → finished-CiVHAeSV.js.map} +1 -1
  11. package/build/client/assets/guide-Cinib8Ji.js +9 -0
  12. package/build/client/assets/guide-Cinib8Ji.js.map +1 -0
  13. package/build/client/assets/{index-wDjETrF-.js → index-C_wcF1aP.js} +2 -2
  14. package/build/client/assets/{index-wDjETrF-.js.map → index-C_wcF1aP.js.map} +1 -1
  15. package/build/client/assets/index-CdzVFL-Z.js.map +1 -1
  16. package/build/client/assets/index-DuFMeXSm.js +2 -0
  17. package/build/client/assets/index-DuFMeXSm.js.map +1 -0
  18. package/build/client/assets/{manifest-e2f9a54b.js → manifest-970c9ad1.js} +1 -1
  19. package/build/client/assets/{progress-By6-_9Ii.js → progress-ILaVQtOO.js} +2 -2
  20. package/build/client/assets/{progress-By6-_9Ii.js.map → progress-ILaVQtOO.js.map} +1 -1
  21. package/build/client/assets/{root-BkPGxm0k.js → root-Bktp3RtN.js} +2 -2
  22. package/build/client/assets/{root-BkPGxm0k.js.map → root-Bktp3RtN.js.map} +1 -1
  23. package/build/client/assets/tailwind-B97VvnKU.css +1 -0
  24. package/build/server/index.js +274 -30
  25. package/build/server/index.js.map +1 -1
  26. package/package.json +3 -3
  27. package/build/client/assets/_layout-BLOYb3Iq.js +0 -2
  28. package/build/client/assets/_layout-BLOYb3Iq.js.map +0 -1
  29. package/build/client/assets/guide-B4wAqzq_.js +0 -9
  30. package/build/client/assets/guide-B4wAqzq_.js.map +0 -1
  31. package/build/client/assets/index-AMZhCeTP.js +0 -2
  32. package/build/client/assets/index-AMZhCeTP.js.map +0 -1
  33. package/build/client/assets/tailwind-D_K12wB7.css +0 -1
@@ -1,2 +1,2 @@
1
- import{w as s,a as n,L as c}from"./chunk-EPOLDU6W-BCLmut3y.js";import{j as r}from"./jsx-runtime-C5WNSv3b.js";import{E as m}from"./index-CEVyDj51.js";import{E as l}from"./epic-video-D0drHmgC.js";import{G as p}from"./error-boundary-DVp6wKiz.js";import{u as a}from"./revalidation-ws-BJWJviUX.js";import{E as x}from"./launch-editor-D2exGfVu.js";import{P as u}from"./progress-By6-_9Ii.js";import{M as f}from"./mdx-BzyhMqFg.js";import{g as d}from"./root-loader-BOzEMapJ.js";import{g as b}from"./seo-t5J-DRxw.js";import{E as h}from"./error-boundary-BDqWjIFP.js";import"./index-CqIc3cxq.js";import"./use-event-source-BuD4_2SF.js";import"./index-DzdDahau.js";import"./index-vDCSPjrM.js";import"./index-CdzVFL-Z.js";import"./misc-W4055b-0.js";import"./tooltip-Tlsyx2YO.js";import"./pe-CIZUOJMr.js";import"./schemas-Uj5SZtvt.js";import"./online-DiNLkgTC.js";import"./loading-CDNzW5oO.js";import"./user-BsPobzjB.js";import"./workshop-config-Zfc8zU0x.js";import"./preload-helper-BXl3LOEh.js";import"./progress-bar-DpWhcyhC.js";import"./chunk-FNSCYPCZ-BHgC5cdx.js";import"./coerce-CkHW0SMv.js";const K=({loaderData:t,matches:e})=>{const o=t?.exercise.exerciseNumber.toString().padStart(2,"0"),i=d(e);return!t||!i?[{title:"🦉 | Error"}]:b({title:`📝 | ${o}. ${t.exercise.title} | ${i?.workshopTitle}`,description:`Introduction for ${o}. ${t.exercise.title}`,ogTitle:t.exercise.title,ogDescription:`Introduction for exercise ${Number(o)}`,instructor:i.instructor,requestInfo:i.requestInfo})},g={h1:()=>null},U=s(function({loaderData:e}){a({watchPaths:[e.exerciseReadme.file]});const o=String(e.firstStep?.stepNumber??"01").padStart(2,"0");return r.jsxs("main",{className:"relative flex h-full w-full max-w-5xl flex-col justify-between border-r md:w-3/4 xl:w-2/3",children:[r.jsxs("article",{id:e.articleId,className:"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar flex w-full flex-1 flex-col gap-12 overflow-y-scroll px-3 py-4 pt-6 md:px-10 md:py-12 md:pt-16",children:[r.jsx("div",{children:r.jsx("h1",{className:"text-[clamp(3rem,6vw,7.5rem)] leading-none font-extrabold",children:e.exercise.title})}),r.jsx("div",{children:e.exercise.instructionsCode?r.jsx(l,{epicVideoInfosPromise:e.epicVideoInfosPromise,children:r.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:r.jsx(f,{code:e.exercise.instructionsCode,components:g})})}):"No instructions yet..."})]},e.articleId),r.jsx(m,{elementQuery:`#${e.articleId}`},`scroll-${e.articleId}`),r.jsx(u,{type:"instructions",exerciseNumber:e.exerciseNumber,className:"h-14 border-t px-6"}),r.jsxs("div",{className:"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0",children:[r.jsx("div",{}),r.jsx(x,{file:e.exerciseReadme.file,relativePath:e.exerciseReadme.relativePath}),r.jsx(c,{to:`${o}/${e.firstType}`,prefetch:"intent",className:"bg-foreground text-background flex h-full items-center justify-center px-7","data-keyboard-action":"g+n",children:"Start Learning"})]})]})}),X=n(function(){return r.jsx(p,{className:"container flex items-center justify-center",statusHandlers:{404:h}})});export{X as ErrorBoundary,U as default,K as meta};
2
- //# sourceMappingURL=_exerciseNumber-DNg1F_Vn.js.map
1
+ import{w as s,a as n,L as c}from"./chunk-EPOLDU6W-BCLmut3y.js";import{j as r}from"./jsx-runtime-C5WNSv3b.js";import{E as m}from"./index-CEVyDj51.js";import{E as l}from"./epic-video-D0drHmgC.js";import{G as p}from"./error-boundary-DVp6wKiz.js";import{u as a}from"./revalidation-ws-BJWJviUX.js";import{E as x}from"./launch-editor-D2exGfVu.js";import{P as u}from"./progress-ILaVQtOO.js";import{M as f}from"./mdx-BzyhMqFg.js";import{g as d}from"./root-loader-BOzEMapJ.js";import{g as b}from"./seo-t5J-DRxw.js";import{E as h}from"./error-boundary-BDqWjIFP.js";import"./index-CqIc3cxq.js";import"./use-event-source-BuD4_2SF.js";import"./index-DzdDahau.js";import"./index-vDCSPjrM.js";import"./index-CdzVFL-Z.js";import"./misc-W4055b-0.js";import"./tooltip-Tlsyx2YO.js";import"./pe-CIZUOJMr.js";import"./schemas-Uj5SZtvt.js";import"./online-DiNLkgTC.js";import"./loading-CDNzW5oO.js";import"./user-BsPobzjB.js";import"./workshop-config-Zfc8zU0x.js";import"./preload-helper-BXl3LOEh.js";import"./progress-bar-DpWhcyhC.js";import"./chunk-FNSCYPCZ-BHgC5cdx.js";import"./coerce-CkHW0SMv.js";const K=({loaderData:t,matches:e})=>{const o=t?.exercise.exerciseNumber.toString().padStart(2,"0"),i=d(e);return!t||!i?[{title:"🦉 | Error"}]:b({title:`📝 | ${o}. ${t.exercise.title} | ${i?.workshopTitle}`,description:`Introduction for ${o}. ${t.exercise.title}`,ogTitle:t.exercise.title,ogDescription:`Introduction for exercise ${Number(o)}`,instructor:i.instructor,requestInfo:i.requestInfo})},g={h1:()=>null},U=s(function({loaderData:e}){a({watchPaths:[e.exerciseReadme.file]});const o=String(e.firstStep?.stepNumber??"01").padStart(2,"0");return r.jsxs("main",{className:"relative flex h-full w-full max-w-5xl flex-col justify-between border-r md:w-3/4 xl:w-2/3",children:[r.jsxs("article",{id:e.articleId,className:"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar flex w-full flex-1 flex-col gap-12 overflow-y-scroll px-3 py-4 pt-6 md:px-10 md:py-12 md:pt-16",children:[r.jsx("div",{children:r.jsx("h1",{className:"text-[clamp(3rem,6vw,7.5rem)] leading-none font-extrabold",children:e.exercise.title})}),r.jsx("div",{children:e.exercise.instructionsCode?r.jsx(l,{epicVideoInfosPromise:e.epicVideoInfosPromise,children:r.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:r.jsx(f,{code:e.exercise.instructionsCode,components:g})})}):"No instructions yet..."})]},e.articleId),r.jsx(m,{elementQuery:`#${e.articleId}`},`scroll-${e.articleId}`),r.jsx(u,{type:"instructions",exerciseNumber:e.exerciseNumber,className:"h-14 border-t px-6"}),r.jsxs("div",{className:"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0",children:[r.jsx("div",{}),r.jsx(x,{file:e.exerciseReadme.file,relativePath:e.exerciseReadme.relativePath}),r.jsx(c,{to:`${o}/${e.firstType}`,prefetch:"intent",className:"bg-foreground text-background flex h-full items-center justify-center px-7","data-keyboard-action":"g+n",children:"Start Learning"})]})]})}),X=n(function(){return r.jsx(p,{className:"container flex items-center justify-center",statusHandlers:{404:h}})});export{X as ErrorBoundary,U as default,K as meta};
2
+ //# sourceMappingURL=_exerciseNumber-DgMb13KP.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_exerciseNumber-DNg1F_Vn.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetExercises,\n\tgetWorkshopRoot,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n\ttime,\n} from '@epic-web/workshop-utils/timing.server'\nimport slugify from '@sindresorhus/slugify'\nimport { data, type HeadersFunction, Link } from 'react-router'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { GeneralErrorBoundary } from '#app/components/error-boundary.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { ProgressToggle } from '#app/routes/progress.tsx'\nimport { Mdx } from '#app/utils/mdx.tsx'\nimport { getRootMatchLoaderData } from '#app/utils/root-loader.ts'\nimport { getSeoMetaTags } from '#app/utils/seo.ts'\nimport { type Route } from './+types/$exerciseNumber.tsx'\nimport { getExercise404Data } from './__shared/error-boundary.server.ts'\nimport { Exercise404ErrorBoundary } from './__shared/error-boundary.tsx'\n\nexport const meta: Route.MetaFunction = ({ loaderData, matches }) => {\n\tconst number = loaderData?.exercise.exerciseNumber.toString().padStart(2, '0')\n\n\tconst rootData = getRootMatchLoaderData(matches)\n\tif (!loaderData || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `📝 | ${number}. ${loaderData.exercise.title} | ${rootData?.workshopTitle}`,\n\t\tdescription: `Introduction for ${number}. ${loaderData.exercise.title}`,\n\t\togTitle: loaderData.exercise.title,\n\t\togDescription: `Introduction for exercise ${Number(number)}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: Route.LoaderArgs) {\n\tconst timings = makeTimings('exerciseNumberLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst { title: workshopTitle } = getWorkshopConfig()\n\tconst exercises = await time(() => getExercises({ request, timings }), {\n\t\ttimings,\n\t\ttype: 'getExercises',\n\t\tdesc: 'getExercises in $exerciseNumber.tsx',\n\t})\n\tconst exercise = exercises.find(\n\t\t(e) => e.exerciseNumber === Number(params.exerciseNumber),\n\t)\n\tif (!exercise) {\n\t\tthrow Response.json(getExercise404Data({ exercises }), { status: 404 })\n\t}\n\n\tconst readmeFilepath = path.join(\n\t\tgetWorkshopRoot(),\n\t\t'exercises',\n\t\texercise.dirName,\n\t\t'README.mdx',\n\t)\n\n\tconst firstStep = exercise.steps.find(Boolean)\n\n\tconst articleId = `workshop-${slugify(workshopTitle)}-${\n\t\texercise.exerciseNumber\n\t}-instructions`\n\n\treturn data(\n\t\t{\n\t\t\tarticleId,\n\t\t\texercise,\n\t\t\texerciseNumber: exercise.exerciseNumber,\n\t\t\texerciseReadme: {\n\t\t\t\tfile: readmeFilepath,\n\t\t\t\trelativePath: `exercises/${exercise.dirName}/README.mdx`,\n\t\t\t},\n\t\t\texerciseTitle: exercise.title,\n\t\t\tfirstStep,\n\t\t\tfirstType: firstStep?.problem ? 'problem' : 'solution',\n\t\t\ttitle: workshopTitle,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(\n\t\t\t\texercise.instructionsEpicVideoEmbeds,\n\t\t\t\t{ request },\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\n// we'll render the title ourselves thank you\nconst mdxComponents = { h1: () => null }\n\nexport default function ExerciseNumberRoute({\n\tloaderData: data,\n}: Route.ComponentProps) {\n\tuseRevalidationWS({\n\t\twatchPaths: [data.exerciseReadme.file],\n\t})\n\n\tconst firstStepNumber = String(data.firstStep?.stepNumber ?? '01').padStart(\n\t\t2,\n\t\t'0',\n\t)\n\treturn (\n\t\t<main className=\"relative flex h-full w-full max-w-5xl flex-col justify-between border-r md:w-3/4 xl:w-2/3\">\n\t\t\t<article\n\t\t\t\tid={data.articleId}\n\t\t\t\tkey={data.articleId}\n\t\t\t\tclassName=\"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar flex w-full flex-1 flex-col gap-12 overflow-y-scroll px-3 py-4 pt-6 md:px-10 md:py-12 md:pt-16\"\n\t\t\t>\n\t\t\t\t<div>\n\t\t\t\t\t<h1 className=\"text-[clamp(3rem,6vw,7.5rem)] leading-none font-extrabold\">\n\t\t\t\t\t\t{data.exercise.title}\n\t\t\t\t\t</h1>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t{data.exercise.instructionsCode ? (\n\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\tcode={data.exercise.instructionsCode}\n\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t'No instructions yet...'\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</article>\n\t\t\t<ElementScrollRestoration\n\t\t\t\telementQuery={`#${data.articleId}`}\n\t\t\t\tkey={`scroll-${data.articleId}`}\n\t\t\t/>\n\t\t\t<ProgressToggle\n\t\t\t\ttype=\"instructions\"\n\t\t\t\texerciseNumber={data.exerciseNumber}\n\t\t\t\tclassName=\"h-14 border-t px-6\"\n\t\t\t/>\n\t\t\t<div className=\"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0\">\n\t\t\t\t<div />\n\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\tfile={data.exerciseReadme.file}\n\t\t\t\t\trelativePath={data.exerciseReadme.relativePath}\n\t\t\t\t/>\n\t\t\t\t<Link\n\t\t\t\t\tto={`${firstStepNumber}/${data.firstType}`}\n\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\tclassName=\"bg-foreground text-background flex h-full items-center justify-center px-7\"\n\t\t\t\t\tdata-keyboard-action=\"g+n\"\n\t\t\t\t>\n\t\t\t\t\tStart Learning\n\t\t\t\t</Link>\n\t\t\t</div>\n\t\t</main>\n\t)\n}\n\nexport function ErrorBoundary() {\n\treturn (\n\t\t<GeneralErrorBoundary\n\t\t\tclassName=\"container flex items-center justify-center\"\n\t\t\tstatusHandlers={{\n\t\t\t\t404: Exercise404ErrorBoundary,\n\t\t\t}}\n\t\t/>\n\t)\n}\n"],"names":["meta","loaderData","matches","number","exercise","exerciseNumber","toString","padStart","rootData","getRootMatchLoaderData","title","getSeoMetaTags","workshopTitle","description","ogTitle","ogDescription","Number","instructor","requestInfo","mdxComponents","h1","$exerciseNumber","_UNSAFE_withComponentProps","data","useRevalidationWS","watchPaths","exerciseReadme","file","firstStepNumber","String","firstStep","stepNumber","jsxs","className","children","id","articleId","jsx","instructionsCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","ElementScrollRestoration","elementQuery","ProgressToggle","type","EditFileOnGitHub","relativePath","Link","to","firstType","prefetch","ErrorBoundary","_UNSAFE_withErrorBoundaryProps","GeneralErrorBoundary","statusHandlers","Exercise404ErrorBoundary"],"mappings":"wjCA6BO,MAAMA,EAA2BA,CAAC,CAAEC,WAAAA,EAAYC,QAAAA,CAAQ,IAAM,CACpE,MAAMC,EAASF,GAAYG,SAASC,eAAeC,WAAWC,SAAS,EAAG,GAAG,EAEvEC,EAAWC,EAAuBP,CAAO,EAC/C,MAAI,CAACD,GAAc,CAACO,EAAiB,CAAC,CAAEE,MAAO,YAAa,CAAC,EAEtDC,EAAe,CACrBD,MAAO,QAAQP,CAAM,KAAKF,EAAWG,SAASM,KAAK,MAAMF,GAAUI,aAAa,GAChFC,YAAa,oBAAoBV,CAAM,KAAKF,EAAWG,SAASM,KAAK,GACrEI,QAASb,EAAWG,SAASM,MAC7BK,cAAe,6BAA6BC,OAAOb,CAAM,CAAC,GAC1Dc,WAAYT,EAASS,WACrBC,YAAaV,EAASU,WACvB,CAAC,CACF,EAkEMC,EAAgB,CAAEC,GAAIA,IAAM,IAAK,EAEvCC,EAAAC,EAAA,SAA4C,CAC3CrB,WAAYsB,CACb,EAAyB,CACxBC,EAAkB,CACjBC,WAAY,CAACF,EAAKG,eAAeC,IAAI,CACtC,CAAC,EAED,MAAMC,EAAkBC,OAAON,EAAKO,WAAWC,YAAc,IAAI,EAAExB,SAClE,EACA,GACD,EACA,OACCyB,EAAAA,KAAC,OAAA,CAAKC,UAAU,4FACfC,SAAA,CAAAF,EAAAA,KAAC,UAAA,CACAG,GAAIZ,EAAKa,UAETH,UAAU,8JAEVC,SAAA,CAAAG,EAAAA,IAAC,MAAA,CACAH,eAAC,KAAA,CAAGD,UAAU,4DACZC,SAAAX,EAAKnB,SAASM,MAChB,CAAA,CACD,EACA2B,EAAAA,IAAC,MAAA,CACCH,SAAAX,EAAKnB,SAASkC,iBACdD,EAAAA,IAACE,EAAA,CACAC,sBAAuBjB,EAAKiB,sBAE5BN,SAAAG,EAAAA,IAAC,MAAA,CAAIJ,UAAU,sCACdC,SAAAG,EAAAA,IAACI,EAAA,CACAC,KAAMnB,EAAKnB,SAASkC,iBACpBK,WAAYxB,EACb,EACD,CAAA,CACD,EAEA,wBAAA,CAEF,CAAA,GAvBKI,EAAKa,SAwBX,EACAC,EAAAA,IAACO,EAAA,CACAC,aAAc,IAAItB,EAAKa,SAAS,EAAA,EAC3B,UAAUb,EAAKa,SAAS,EAC9B,EACAC,EAAAA,IAACS,EAAA,CACAC,KAAK,eACL1C,eAAgBkB,EAAKlB,eACrB4B,UAAU,oBAAA,CACX,EACAD,EAAAA,KAAC,MAAA,CAAIC,UAAU,yEACdC,SAAA,CAAAG,EAAAA,IAAC,MAAA,CAAA,CAAI,EACLA,EAAAA,IAACW,EAAA,CACArB,KAAMJ,EAAKG,eAAeC,KAC1BsB,aAAc1B,EAAKG,eAAeuB,YAAA,CACnC,EACAZ,EAAAA,IAACa,EAAA,CACAC,GAAI,GAAGvB,CAAe,IAAIL,EAAK6B,SAAS,GACxCC,SAAS,SACTpB,UAAU,6EACV,uBAAqB,MACrBC,SAAA,gBAAA,CAED,CAAA,CAAA,CACD,CAAA,CAAA,CACD,CAEF,CAAA,EAEOoB,EAAAC,EAAA,UAAyB,CAC/B,OACClB,EAAAA,IAACmB,EAAA,CACAvB,UAAU,6CACVwB,eAAgB,CACf,IAAKC,CACN,CAAA,CACD,CAEF,CAAA"}
1
+ {"version":3,"file":"_exerciseNumber-DgMb13KP.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetExercises,\n\tgetWorkshopRoot,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n\ttime,\n} from '@epic-web/workshop-utils/timing.server'\nimport slugify from '@sindresorhus/slugify'\nimport { data, type HeadersFunction, Link } from 'react-router'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { GeneralErrorBoundary } from '#app/components/error-boundary.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { ProgressToggle } from '#app/routes/progress.tsx'\nimport { Mdx } from '#app/utils/mdx.tsx'\nimport { getRootMatchLoaderData } from '#app/utils/root-loader.ts'\nimport { getSeoMetaTags } from '#app/utils/seo.ts'\nimport { type Route } from './+types/$exerciseNumber.tsx'\nimport { getExercise404Data } from './__shared/error-boundary.server.ts'\nimport { Exercise404ErrorBoundary } from './__shared/error-boundary.tsx'\n\nexport const meta: Route.MetaFunction = ({ loaderData, matches }) => {\n\tconst number = loaderData?.exercise.exerciseNumber.toString().padStart(2, '0')\n\n\tconst rootData = getRootMatchLoaderData(matches)\n\tif (!loaderData || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `📝 | ${number}. ${loaderData.exercise.title} | ${rootData?.workshopTitle}`,\n\t\tdescription: `Introduction for ${number}. ${loaderData.exercise.title}`,\n\t\togTitle: loaderData.exercise.title,\n\t\togDescription: `Introduction for exercise ${Number(number)}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: Route.LoaderArgs) {\n\tconst timings = makeTimings('exerciseNumberLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst { title: workshopTitle } = getWorkshopConfig()\n\tconst exercises = await time(() => getExercises({ request, timings }), {\n\t\ttimings,\n\t\ttype: 'getExercises',\n\t\tdesc: 'getExercises in $exerciseNumber.tsx',\n\t})\n\tconst exercise = exercises.find(\n\t\t(e) => e.exerciseNumber === Number(params.exerciseNumber),\n\t)\n\tif (!exercise) {\n\t\tthrow Response.json(getExercise404Data({ exercises }), { status: 404 })\n\t}\n\n\tconst readmeFilepath = path.join(\n\t\tgetWorkshopRoot(),\n\t\t'exercises',\n\t\texercise.dirName,\n\t\t'README.mdx',\n\t)\n\n\tconst firstStep = exercise.steps.find(Boolean)\n\n\tconst articleId = `workshop-${slugify(workshopTitle)}-${\n\t\texercise.exerciseNumber\n\t}-instructions`\n\n\treturn data(\n\t\t{\n\t\t\tarticleId,\n\t\t\texercise,\n\t\t\texerciseNumber: exercise.exerciseNumber,\n\t\t\texerciseReadme: {\n\t\t\t\tfile: readmeFilepath,\n\t\t\t\trelativePath: `exercises/${exercise.dirName}/README.mdx`,\n\t\t\t},\n\t\t\texerciseTitle: exercise.title,\n\t\t\tfirstStep,\n\t\t\tfirstType: firstStep?.problem ? 'problem' : 'solution',\n\t\t\ttitle: workshopTitle,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(\n\t\t\t\texercise.instructionsEpicVideoEmbeds,\n\t\t\t\t{ request },\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\n// we'll render the title ourselves thank you\nconst mdxComponents = { h1: () => null }\n\nexport default function ExerciseNumberRoute({\n\tloaderData: data,\n}: Route.ComponentProps) {\n\tuseRevalidationWS({\n\t\twatchPaths: [data.exerciseReadme.file],\n\t})\n\n\tconst firstStepNumber = String(data.firstStep?.stepNumber ?? '01').padStart(\n\t\t2,\n\t\t'0',\n\t)\n\treturn (\n\t\t<main className=\"relative flex h-full w-full max-w-5xl flex-col justify-between border-r md:w-3/4 xl:w-2/3\">\n\t\t\t<article\n\t\t\t\tid={data.articleId}\n\t\t\t\tkey={data.articleId}\n\t\t\t\tclassName=\"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar flex w-full flex-1 flex-col gap-12 overflow-y-scroll px-3 py-4 pt-6 md:px-10 md:py-12 md:pt-16\"\n\t\t\t>\n\t\t\t\t<div>\n\t\t\t\t\t<h1 className=\"text-[clamp(3rem,6vw,7.5rem)] leading-none font-extrabold\">\n\t\t\t\t\t\t{data.exercise.title}\n\t\t\t\t\t</h1>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t{data.exercise.instructionsCode ? (\n\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\tcode={data.exercise.instructionsCode}\n\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t'No instructions yet...'\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</article>\n\t\t\t<ElementScrollRestoration\n\t\t\t\telementQuery={`#${data.articleId}`}\n\t\t\t\tkey={`scroll-${data.articleId}`}\n\t\t\t/>\n\t\t\t<ProgressToggle\n\t\t\t\ttype=\"instructions\"\n\t\t\t\texerciseNumber={data.exerciseNumber}\n\t\t\t\tclassName=\"h-14 border-t px-6\"\n\t\t\t/>\n\t\t\t<div className=\"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0\">\n\t\t\t\t<div />\n\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\tfile={data.exerciseReadme.file}\n\t\t\t\t\trelativePath={data.exerciseReadme.relativePath}\n\t\t\t\t/>\n\t\t\t\t<Link\n\t\t\t\t\tto={`${firstStepNumber}/${data.firstType}`}\n\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\tclassName=\"bg-foreground text-background flex h-full items-center justify-center px-7\"\n\t\t\t\t\tdata-keyboard-action=\"g+n\"\n\t\t\t\t>\n\t\t\t\t\tStart Learning\n\t\t\t\t</Link>\n\t\t\t</div>\n\t\t</main>\n\t)\n}\n\nexport function ErrorBoundary() {\n\treturn (\n\t\t<GeneralErrorBoundary\n\t\t\tclassName=\"container flex items-center justify-center\"\n\t\t\tstatusHandlers={{\n\t\t\t\t404: Exercise404ErrorBoundary,\n\t\t\t}}\n\t\t/>\n\t)\n}\n"],"names":["meta","loaderData","matches","number","exercise","exerciseNumber","toString","padStart","rootData","getRootMatchLoaderData","title","getSeoMetaTags","workshopTitle","description","ogTitle","ogDescription","Number","instructor","requestInfo","mdxComponents","h1","$exerciseNumber","_UNSAFE_withComponentProps","data","useRevalidationWS","watchPaths","exerciseReadme","file","firstStepNumber","String","firstStep","stepNumber","jsxs","className","children","id","articleId","jsx","instructionsCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","ElementScrollRestoration","elementQuery","ProgressToggle","type","EditFileOnGitHub","relativePath","Link","to","firstType","prefetch","ErrorBoundary","_UNSAFE_withErrorBoundaryProps","GeneralErrorBoundary","statusHandlers","Exercise404ErrorBoundary"],"mappings":"wjCA6BO,MAAMA,EAA2BA,CAAC,CAAEC,WAAAA,EAAYC,QAAAA,CAAQ,IAAM,CACpE,MAAMC,EAASF,GAAYG,SAASC,eAAeC,WAAWC,SAAS,EAAG,GAAG,EAEvEC,EAAWC,EAAuBP,CAAO,EAC/C,MAAI,CAACD,GAAc,CAACO,EAAiB,CAAC,CAAEE,MAAO,YAAa,CAAC,EAEtDC,EAAe,CACrBD,MAAO,QAAQP,CAAM,KAAKF,EAAWG,SAASM,KAAK,MAAMF,GAAUI,aAAa,GAChFC,YAAa,oBAAoBV,CAAM,KAAKF,EAAWG,SAASM,KAAK,GACrEI,QAASb,EAAWG,SAASM,MAC7BK,cAAe,6BAA6BC,OAAOb,CAAM,CAAC,GAC1Dc,WAAYT,EAASS,WACrBC,YAAaV,EAASU,WACvB,CAAC,CACF,EAkEMC,EAAgB,CAAEC,GAAIA,IAAM,IAAK,EAEvCC,EAAAC,EAAA,SAA4C,CAC3CrB,WAAYsB,CACb,EAAyB,CACxBC,EAAkB,CACjBC,WAAY,CAACF,EAAKG,eAAeC,IAAI,CACtC,CAAC,EAED,MAAMC,EAAkBC,OAAON,EAAKO,WAAWC,YAAc,IAAI,EAAExB,SAClE,EACA,GACD,EACA,OACCyB,EAAAA,KAAC,OAAA,CAAKC,UAAU,4FACfC,SAAA,CAAAF,EAAAA,KAAC,UAAA,CACAG,GAAIZ,EAAKa,UAETH,UAAU,8JAEVC,SAAA,CAAAG,EAAAA,IAAC,MAAA,CACAH,eAAC,KAAA,CAAGD,UAAU,4DACZC,SAAAX,EAAKnB,SAASM,MAChB,CAAA,CACD,EACA2B,EAAAA,IAAC,MAAA,CACCH,SAAAX,EAAKnB,SAASkC,iBACdD,EAAAA,IAACE,EAAA,CACAC,sBAAuBjB,EAAKiB,sBAE5BN,SAAAG,EAAAA,IAAC,MAAA,CAAIJ,UAAU,sCACdC,SAAAG,EAAAA,IAACI,EAAA,CACAC,KAAMnB,EAAKnB,SAASkC,iBACpBK,WAAYxB,EACb,EACD,CAAA,CACD,EAEA,wBAAA,CAEF,CAAA,GAvBKI,EAAKa,SAwBX,EACAC,EAAAA,IAACO,EAAA,CACAC,aAAc,IAAItB,EAAKa,SAAS,EAAA,EAC3B,UAAUb,EAAKa,SAAS,EAC9B,EACAC,EAAAA,IAACS,EAAA,CACAC,KAAK,eACL1C,eAAgBkB,EAAKlB,eACrB4B,UAAU,oBAAA,CACX,EACAD,EAAAA,KAAC,MAAA,CAAIC,UAAU,yEACdC,SAAA,CAAAG,EAAAA,IAAC,MAAA,CAAA,CAAI,EACLA,EAAAA,IAACW,EAAA,CACArB,KAAMJ,EAAKG,eAAeC,KAC1BsB,aAAc1B,EAAKG,eAAeuB,YAAA,CACnC,EACAZ,EAAAA,IAACa,EAAA,CACAC,GAAI,GAAGvB,CAAe,IAAIL,EAAK6B,SAAS,GACxCC,SAAS,SACTpB,UAAU,6EACV,uBAAqB,MACrBC,SAAA,gBAAA,CAED,CAAA,CAAA,CACD,CAAA,CAAA,CACD,CAEF,CAAA,EAEOoB,EAAAC,EAAA,UAAyB,CAC/B,OACClB,EAAAA,IAACmB,EAAA,CACAvB,UAAU,6CACVwB,eAAgB,CACf,IAAKC,CACN,CAAA,CACD,CAEF,CAAA"}
@@ -1,2 +1,2 @@
1
- import{w as n,L as l}from"./chunk-EPOLDU6W-BCLmut3y.js";import{j as e}from"./jsx-runtime-C5WNSv3b.js";import{E as c}from"./index-CEVyDj51.js";import{r as m}from"./index-CqIc3cxq.js";import{E as a}from"./epic-video-D0drHmgC.js";import{I as x,c as d}from"./misc-W4055b-0.js";import{L as f}from"./loading-CDNzW5oO.js";import{N as p}from"./nav-chevrons-Dk4GtZwQ.js";import{u as h}from"./revalidation-ws-BJWJviUX.js";import{E as u}from"./launch-editor-D2exGfVu.js";import{P as b}from"./progress-By6-_9Ii.js";import{u as j}from"./index-CdzVFL-Z.js";import{M as g}from"./mdx-BzyhMqFg.js";import{u as N}from"./online-DiNLkgTC.js";import{g as v}from"./root-loader-BOzEMapJ.js";import{g as w}from"./seo-t5J-DRxw.js";import"./use-event-source-BuD4_2SF.js";import"./index-DzdDahau.js";import"./index-vDCSPjrM.js";import"./schemas-Uj5SZtvt.js";import"./tooltip-Tlsyx2YO.js";import"./user-BsPobzjB.js";import"./workshop-config-Zfc8zU0x.js";import"./progress-bar-DpWhcyhC.js";import"./pe-CIZUOJMr.js";import"./preload-helper-BXl3LOEh.js";const Y=({loaderData:s,matches:r})=>{const i=s?.exercise.exerciseNumber.toString().padStart(2,"0"),o=v(r);return!s||!o?[{title:"🦉 | Error"}]:w({title:`🦉 | ${i}. ${s.exercise.title} | ${o?.workshopTitle}`,description:`Elaboration for ${i}. ${s.exercise.title}`,ogTitle:`Finished: ${s.exercise.title}`,ogDescription:`Elaboration for exercise ${Number(i)}`,instructor:o.instructor,requestInfo:o.requestInfo})},E={h1:()=>null},Z=n(function({loaderData:r}){const i=r.exercise.exerciseNumber.toString().padStart(2,"0");return h({watchPaths:[`./exercises/${i}/FINISHED.mdx`]}),e.jsx("div",{className:"flex max-w-full grow flex-col",children:e.jsxs("main",{className:"flex grow flex-col sm:grid sm:h-full sm:min-h-[800px] sm:grid-cols-1 sm:grid-rows-2 md:min-h-[unset] lg:grid-cols-2 lg:grid-rows-1",children:[e.jsxs("div",{className:"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r",children:[e.jsx("h1",{className:"h-14 border-b pr-5 pl-10 text-sm leading-tight font-medium",children:e.jsx("div",{className:"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2",children:e.jsxs("div",{className:"flex items-center justify-start gap-x-2",children:[e.jsx(l,{to:`/${i}`,className:"hover:underline",children:`${i}. ${r.exercise.title}`}),e.jsx("span",{children:"/"}),e.jsx("span",{children:"Elaboration"})]})})}),e.jsx("article",{className:"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar h-full w-full max-w-none flex-1 scroll-pt-6 space-y-6 overflow-y-auto p-2 sm:p-10 sm:pt-8",id:r.articleId,children:r.exercise.finishedCode?e.jsx(a,{epicVideoInfosPromise:r.epicVideoInfosPromise,children:e.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:e.jsx(g,{code:r.exercise.finishedCode,components:E})})}):"No finished instructions yet..."}),e.jsx(c,{elementQuery:`#${r.articleId}`}),e.jsx(b,{type:"finished",exerciseNumber:r.exercise.exerciseNumber,className:"h-14 border-t px-6"}),e.jsxs("div",{className:"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0",children:[e.jsx("div",{}),e.jsx(u,{file:r.exerciseFinished.file,relativePath:r.exerciseFinished.relativePath}),e.jsx(p,{prev:r.prevStepLink,next:r.nextStepLink})]})]}),e.jsx(y,{exerciseFormEmbedUrl:r.exerciseFormEmbedUrl,exerciseTitle:r.exercise.title})]})})});function y({exerciseFormEmbedUrl:s,exerciseTitle:r}){const i=j(),[o,t]=m.useState(!1);return N()?e.jsxs("div",{className:"relative min-h-full sm:min-h-[unset] sm:shrink-0",children:[o?null:e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:e.jsx(f,{children:e.jsxs("span",{children:["Loading ",r," Elaboration form"]})})}),e.jsx("iframe",{onLoad:()=>t(!0),onError:()=>t(!0),title:"Elaboration",src:s,className:d("absolute inset-0 flex h-full w-full transition-opacity duration-300",o?"opacity-100":"opacity-0"),style:{colorScheme:i}})]}):e.jsx("div",{className:"relative shrink-0",children:e.jsx("div",{className:"text-body-md text-foreground-destructive absolute inset-0 z-10 flex items-center justify-center",children:e.jsx(x,{name:"WifiNoConnection",size:"xl",children:e.jsxs("span",{children:["Unable to load the ",e.jsx("a",{href:s,className:"underline",children:`${r} feedback form`})," when offline"]})})})})}export{Z as default,Y as meta};
2
- //# sourceMappingURL=_exerciseNumber_.finished-BmUlhiS8.js.map
1
+ import{w as n,L as l}from"./chunk-EPOLDU6W-BCLmut3y.js";import{j as e}from"./jsx-runtime-C5WNSv3b.js";import{E as c}from"./index-CEVyDj51.js";import{r as m}from"./index-CqIc3cxq.js";import{E as a}from"./epic-video-D0drHmgC.js";import{I as x,c as d}from"./misc-W4055b-0.js";import{L as f}from"./loading-CDNzW5oO.js";import{N as p}from"./nav-chevrons-Dk4GtZwQ.js";import{u as h}from"./revalidation-ws-BJWJviUX.js";import{E as u}from"./launch-editor-D2exGfVu.js";import{P as b}from"./progress-ILaVQtOO.js";import{u as j}from"./index-CdzVFL-Z.js";import{M as g}from"./mdx-BzyhMqFg.js";import{u as N}from"./online-DiNLkgTC.js";import{g as v}from"./root-loader-BOzEMapJ.js";import{g as w}from"./seo-t5J-DRxw.js";import"./use-event-source-BuD4_2SF.js";import"./index-DzdDahau.js";import"./index-vDCSPjrM.js";import"./schemas-Uj5SZtvt.js";import"./tooltip-Tlsyx2YO.js";import"./user-BsPobzjB.js";import"./workshop-config-Zfc8zU0x.js";import"./progress-bar-DpWhcyhC.js";import"./pe-CIZUOJMr.js";import"./preload-helper-BXl3LOEh.js";const Y=({loaderData:s,matches:r})=>{const i=s?.exercise.exerciseNumber.toString().padStart(2,"0"),o=v(r);return!s||!o?[{title:"🦉 | Error"}]:w({title:`🦉 | ${i}. ${s.exercise.title} | ${o?.workshopTitle}`,description:`Elaboration for ${i}. ${s.exercise.title}`,ogTitle:`Finished: ${s.exercise.title}`,ogDescription:`Elaboration for exercise ${Number(i)}`,instructor:o.instructor,requestInfo:o.requestInfo})},E={h1:()=>null},Z=n(function({loaderData:r}){const i=r.exercise.exerciseNumber.toString().padStart(2,"0");return h({watchPaths:[`./exercises/${i}/FINISHED.mdx`]}),e.jsx("div",{className:"flex max-w-full grow flex-col",children:e.jsxs("main",{className:"flex grow flex-col sm:grid sm:h-full sm:min-h-[800px] sm:grid-cols-1 sm:grid-rows-2 md:min-h-[unset] lg:grid-cols-2 lg:grid-rows-1",children:[e.jsxs("div",{className:"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r",children:[e.jsx("h1",{className:"h-14 border-b pr-5 pl-10 text-sm leading-tight font-medium",children:e.jsx("div",{className:"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2",children:e.jsxs("div",{className:"flex items-center justify-start gap-x-2",children:[e.jsx(l,{to:`/${i}`,className:"hover:underline",children:`${i}. ${r.exercise.title}`}),e.jsx("span",{children:"/"}),e.jsx("span",{children:"Elaboration"})]})})}),e.jsx("article",{className:"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar h-full w-full max-w-none flex-1 scroll-pt-6 space-y-6 overflow-y-auto p-2 sm:p-10 sm:pt-8",id:r.articleId,children:r.exercise.finishedCode?e.jsx(a,{epicVideoInfosPromise:r.epicVideoInfosPromise,children:e.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:e.jsx(g,{code:r.exercise.finishedCode,components:E})})}):"No finished instructions yet..."}),e.jsx(c,{elementQuery:`#${r.articleId}`}),e.jsx(b,{type:"finished",exerciseNumber:r.exercise.exerciseNumber,className:"h-14 border-t px-6"}),e.jsxs("div",{className:"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0",children:[e.jsx("div",{}),e.jsx(u,{file:r.exerciseFinished.file,relativePath:r.exerciseFinished.relativePath}),e.jsx(p,{prev:r.prevStepLink,next:r.nextStepLink})]})]}),e.jsx(y,{exerciseFormEmbedUrl:r.exerciseFormEmbedUrl,exerciseTitle:r.exercise.title})]})})});function y({exerciseFormEmbedUrl:s,exerciseTitle:r}){const i=j(),[o,t]=m.useState(!1);return N()?e.jsxs("div",{className:"relative min-h-full sm:min-h-[unset] sm:shrink-0",children:[o?null:e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:e.jsx(f,{children:e.jsxs("span",{children:["Loading ",r," Elaboration form"]})})}),e.jsx("iframe",{onLoad:()=>t(!0),onError:()=>t(!0),title:"Elaboration",src:s,className:d("absolute inset-0 flex h-full w-full transition-opacity duration-300",o?"opacity-100":"opacity-0"),style:{colorScheme:i}})]}):e.jsx("div",{className:"relative shrink-0",children:e.jsx("div",{className:"text-body-md text-foreground-destructive absolute inset-0 z-10 flex items-center justify-center",children:e.jsx(x,{name:"WifiNoConnection",size:"xl",children:e.jsxs("span",{children:["Unable to load the ",e.jsx("a",{href:s,className:"underline",children:`${r} feedback form`})," when offline"]})})})})}export{Z as default,Y as meta};
2
+ //# sourceMappingURL=_exerciseNumber_.finished-DkAs61X_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_exerciseNumber_.finished-BmUlhiS8.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber_.finished.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetAppPageRoute,\n\tgetApps,\n\tgetExercise,\n\tgetWorkshopRoot,\n\tisExtraApp,\n\tisExerciseStepApp,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n} from '@epic-web/workshop-utils/timing.server'\nimport slugify from '@sindresorhus/slugify'\nimport * as React from 'react'\nimport { data, type HeadersFunction, Link } from 'react-router'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { Icon } from '#app/components/icons.tsx'\nimport { Loading } from '#app/components/loading.tsx'\nimport { NavChevrons } from '#app/components/nav-chevrons.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { ProgressToggle } from '#app/routes/progress.tsx'\nimport { useTheme } from '#app/routes/theme/index.tsx'\nimport { Mdx } from '#app/utils/mdx.tsx'\nimport { cn } from '#app/utils/misc.tsx'\nimport { useIsOnline } from '#app/utils/online.ts'\nimport { getRootMatchLoaderData } from '#app/utils/root-loader.ts'\nimport { getSeoMetaTags } from '#app/utils/seo.ts'\nimport { type Route } from './+types/$exerciseNumber_.finished.tsx'\n\nexport const meta: Route.MetaFunction = ({ loaderData, matches }) => {\n\tconst number = loaderData?.exercise.exerciseNumber.toString().padStart(2, '0')\n\n\tconst rootData = getRootMatchLoaderData(matches)\n\tif (!loaderData || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `🦉 | ${number}. ${loaderData.exercise.title} | ${rootData?.workshopTitle}`,\n\t\tdescription: `Elaboration for ${number}. ${loaderData.exercise.title}`,\n\t\togTitle: `Finished: ${loaderData.exercise.title}`,\n\t\togDescription: `Elaboration for exercise ${Number(number)}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: Route.LoaderArgs) {\n\tconst timings = makeTimings('exerciseFinishedLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst exercise = await getExercise(params.exerciseNumber, {\n\t\ttimings,\n\t\trequest,\n\t})\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\tconst workshopConfig = getWorkshopConfig()\n\tconst exerciseFormTemplate = workshopConfig.forms.exercise\n\tconst exerciseFormEmbedUrl = exerciseFormTemplate\n\t\t.replace('{workshopTitle}', encodeURIComponent(workshopConfig.title))\n\t\t.replace('{exerciseTitle}', encodeURIComponent(exercise.title))\n\tconst nextExercise = await getExercise(exercise.exerciseNumber + 1, {\n\t\ttimings,\n\t\trequest,\n\t})\n\n\tconst finishedFilepath = path.join(\n\t\tgetWorkshopRoot(),\n\t\t'exercises',\n\t\texercise.dirName,\n\t\t'FINISHED.mdx',\n\t)\n\n\tconst apps = await getApps({ request, timings })\n\tconst hasExtras = apps.some(isExtraApp)\n\tconst exerciseApps = apps\n\t\t.filter(isExerciseStepApp)\n\t\t.filter((app) => app.exerciseNumber === exercise.exerciseNumber)\n\tconst prevApp = exerciseApps[exerciseApps.length - 1]\n\n\tconst articleId = `workshop-${slugify(workshopConfig.title)}-${\n\t\texercise.exerciseNumber\n\t}-finished`\n\n\treturn data(\n\t\t{\n\t\t\tarticleId,\n\t\t\tworkshopTitle: workshopConfig.title,\n\t\t\texercise,\n\t\t\texerciseFormEmbedUrl,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(\n\t\t\t\texercise.finishedEpicVideoEmbeds,\n\t\t\t\t{ request },\n\t\t\t),\n\t\t\texerciseFinished: {\n\t\t\t\tfile: finishedFilepath,\n\t\t\t\trelativePath: `exercises/${exercise.dirName}/FINISHED.mdx`,\n\t\t\t},\n\t\t\tprevStepLink: prevApp\n\t\t\t\t? {\n\t\t\t\t\t\tto: getAppPageRoute(prevApp),\n\t\t\t\t\t\t'aria-label': `${prevApp.title} (${prevApp.type})`,\n\t\t\t\t\t}\n\t\t\t\t: null,\n\t\t\tnextStepLink: nextExercise\n\t\t\t\t? {\n\t\t\t\t\t\tto: `/exercise/${nextExercise.exerciseNumber.toString().padStart(2, '0')}`,\n\t\t\t\t\t\t'aria-label': `${nextExercise.title}`,\n\t\t\t\t\t}\n\t\t\t\t: hasExtras\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tto: '/extra',\n\t\t\t\t\t\t\t'aria-label': 'Extras',\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tto: '/finished',\n\t\t\t\t\t\t\t'aria-label': 'Finished! 🎉',\n\t\t\t\t\t\t},\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nconst mdxComponents = { h1: () => null }\nexport default function ExerciseFinished({\n\tloaderData: data,\n}: Route.ComponentProps) {\n\tconst exerciseNumber = data.exercise.exerciseNumber\n\t\t.toString()\n\t\t.padStart(2, '0')\n\n\tuseRevalidationWS({\n\t\twatchPaths: [`./exercises/${exerciseNumber}/FINISHED.mdx`],\n\t})\n\n\treturn (\n\t\t<div className=\"flex max-w-full grow flex-col\">\n\t\t\t<main className=\"flex grow flex-col sm:grid sm:h-full sm:min-h-[800px] sm:grid-cols-1 sm:grid-rows-2 md:min-h-[unset] lg:grid-cols-2 lg:grid-rows-1\">\n\t\t\t\t<div className=\"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r\">\n\t\t\t\t\t<h1 className=\"h-14 border-b pr-5 pl-10 text-sm leading-tight font-medium\">\n\t\t\t\t\t\t<div className=\"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2\">\n\t\t\t\t\t\t\t<div className=\"flex items-center justify-start gap-x-2\">\n\t\t\t\t\t\t\t\t<Link to={`/${exerciseNumber}`} className=\"hover:underline\">\n\t\t\t\t\t\t\t\t\t{`${exerciseNumber}. ${data.exercise.title}`}\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t<span>/</span>\n\t\t\t\t\t\t\t\t<span>Elaboration</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</h1>\n\n\t\t\t\t\t<article\n\t\t\t\t\t\tclassName=\"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar h-full w-full max-w-none flex-1 scroll-pt-6 space-y-6 overflow-y-auto p-2 sm:p-10 sm:pt-8\"\n\t\t\t\t\t\tid={data.articleId}\n\t\t\t\t\t>\n\t\t\t\t\t\t{data.exercise.finishedCode ? (\n\t\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\t\tcode={data.exercise.finishedCode}\n\t\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t// TODO: render a random dad joke...\n\t\t\t\t\t\t\t'No finished instructions yet...'\n\t\t\t\t\t\t)}\n\t\t\t\t\t</article>\n\t\t\t\t\t<ElementScrollRestoration elementQuery={`#${data.articleId}`} />\n\t\t\t\t\t<ProgressToggle\n\t\t\t\t\t\ttype=\"finished\"\n\t\t\t\t\t\texerciseNumber={data.exercise.exerciseNumber}\n\t\t\t\t\t\tclassName=\"h-14 border-t px-6\"\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0\">\n\t\t\t\t\t\t<div />\n\t\t\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\t\t\tfile={data.exerciseFinished.file}\n\t\t\t\t\t\t\trelativePath={data.exerciseFinished.relativePath}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NavChevrons prev={data.prevStepLink} next={data.nextStepLink} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<Survey\n\t\t\t\t\texerciseFormEmbedUrl={data.exerciseFormEmbedUrl}\n\t\t\t\t\texerciseTitle={data.exercise.title}\n\t\t\t\t/>\n\t\t\t</main>\n\t\t</div>\n\t)\n}\n\nfunction Survey({\n\texerciseFormEmbedUrl,\n\texerciseTitle,\n}: {\n\texerciseFormEmbedUrl: string\n\texerciseTitle: string\n}) {\n\tconst theme = useTheme()\n\tconst [iframeLoaded, setIframeLoaded] = React.useState(false)\n\tconst isOnline = useIsOnline()\n\tif (!isOnline) {\n\t\treturn (\n\t\t\t<div className=\"relative shrink-0\">\n\t\t\t\t<div className=\"text-body-md text-foreground-destructive absolute inset-0 z-10 flex items-center justify-center\">\n\t\t\t\t\t<Icon name=\"WifiNoConnection\" size=\"xl\">\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{'Unable to load the '}\n\t\t\t\t\t\t\t<a href={exerciseFormEmbedUrl} className=\"underline\">\n\t\t\t\t\t\t\t\t{`${exerciseTitle} feedback form`}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t{' when offline'}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Icon>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t)\n\t}\n\treturn (\n\t\t<div className=\"relative min-h-full sm:min-h-[unset] sm:shrink-0\">\n\t\t\t{!iframeLoaded ? (\n\t\t\t\t<div className=\"absolute inset-0 z-10 flex items-center justify-center\">\n\t\t\t\t\t<Loading>\n\t\t\t\t\t\t<span>Loading {exerciseTitle} Elaboration form</span>\n\t\t\t\t\t</Loading>\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t<iframe\n\t\t\t\tonLoad={() => setIframeLoaded(true)}\n\t\t\t\t// show what would have shown if there is an error\n\t\t\t\tonError={() => setIframeLoaded(true)}\n\t\t\t\ttitle=\"Elaboration\"\n\t\t\t\tsrc={exerciseFormEmbedUrl}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'absolute inset-0 flex h-full w-full transition-opacity duration-300',\n\t\t\t\t\tiframeLoaded ? 'opacity-100' : 'opacity-0',\n\t\t\t\t)}\n\t\t\t\tstyle={{ colorScheme: theme }}\n\t\t\t/>\n\t\t</div>\n\t)\n}\n"],"names":["meta","loaderData","matches","number","exercise","exerciseNumber","toString","padStart","rootData","getRootMatchLoaderData","title","getSeoMetaTags","workshopTitle","description","ogTitle","ogDescription","Number","instructor","requestInfo","mdxComponents","h1","$exerciseNumber__finished","_UNSAFE_withComponentProps","data","useRevalidationWS","watchPaths","className","children","jsxs","jsx","Link","to","id","articleId","finishedCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","ElementScrollRestoration","elementQuery","ProgressToggle","type","EditFileOnGitHub","file","exerciseFinished","relativePath","NavChevrons","prev","prevStepLink","next","nextStepLink","Survey","exerciseFormEmbedUrl","exerciseTitle","theme","useTheme","iframeLoaded","setIframeLoaded","React","useIsOnline","Loading","onLoad","onError","src","cn","style","colorScheme","Icon","name","size","href"],"mappings":"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"}
1
+ {"version":3,"file":"_exerciseNumber_.finished-DkAs61X_.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber_.finished.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetAppPageRoute,\n\tgetApps,\n\tgetExercise,\n\tgetWorkshopRoot,\n\tisExtraApp,\n\tisExerciseStepApp,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n} from '@epic-web/workshop-utils/timing.server'\nimport slugify from '@sindresorhus/slugify'\nimport * as React from 'react'\nimport { data, type HeadersFunction, Link } from 'react-router'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { Icon } from '#app/components/icons.tsx'\nimport { Loading } from '#app/components/loading.tsx'\nimport { NavChevrons } from '#app/components/nav-chevrons.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { ProgressToggle } from '#app/routes/progress.tsx'\nimport { useTheme } from '#app/routes/theme/index.tsx'\nimport { Mdx } from '#app/utils/mdx.tsx'\nimport { cn } from '#app/utils/misc.tsx'\nimport { useIsOnline } from '#app/utils/online.ts'\nimport { getRootMatchLoaderData } from '#app/utils/root-loader.ts'\nimport { getSeoMetaTags } from '#app/utils/seo.ts'\nimport { type Route } from './+types/$exerciseNumber_.finished.tsx'\n\nexport const meta: Route.MetaFunction = ({ loaderData, matches }) => {\n\tconst number = loaderData?.exercise.exerciseNumber.toString().padStart(2, '0')\n\n\tconst rootData = getRootMatchLoaderData(matches)\n\tif (!loaderData || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `🦉 | ${number}. ${loaderData.exercise.title} | ${rootData?.workshopTitle}`,\n\t\tdescription: `Elaboration for ${number}. ${loaderData.exercise.title}`,\n\t\togTitle: `Finished: ${loaderData.exercise.title}`,\n\t\togDescription: `Elaboration for exercise ${Number(number)}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: Route.LoaderArgs) {\n\tconst timings = makeTimings('exerciseFinishedLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst exercise = await getExercise(params.exerciseNumber, {\n\t\ttimings,\n\t\trequest,\n\t})\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\tconst workshopConfig = getWorkshopConfig()\n\tconst exerciseFormTemplate = workshopConfig.forms.exercise\n\tconst exerciseFormEmbedUrl = exerciseFormTemplate\n\t\t.replace('{workshopTitle}', encodeURIComponent(workshopConfig.title))\n\t\t.replace('{exerciseTitle}', encodeURIComponent(exercise.title))\n\tconst nextExercise = await getExercise(exercise.exerciseNumber + 1, {\n\t\ttimings,\n\t\trequest,\n\t})\n\n\tconst finishedFilepath = path.join(\n\t\tgetWorkshopRoot(),\n\t\t'exercises',\n\t\texercise.dirName,\n\t\t'FINISHED.mdx',\n\t)\n\n\tconst apps = await getApps({ request, timings })\n\tconst hasExtras = apps.some(isExtraApp)\n\tconst exerciseApps = apps\n\t\t.filter(isExerciseStepApp)\n\t\t.filter((app) => app.exerciseNumber === exercise.exerciseNumber)\n\tconst prevApp = exerciseApps[exerciseApps.length - 1]\n\n\tconst articleId = `workshop-${slugify(workshopConfig.title)}-${\n\t\texercise.exerciseNumber\n\t}-finished`\n\n\treturn data(\n\t\t{\n\t\t\tarticleId,\n\t\t\tworkshopTitle: workshopConfig.title,\n\t\t\texercise,\n\t\t\texerciseFormEmbedUrl,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(\n\t\t\t\texercise.finishedEpicVideoEmbeds,\n\t\t\t\t{ request },\n\t\t\t),\n\t\t\texerciseFinished: {\n\t\t\t\tfile: finishedFilepath,\n\t\t\t\trelativePath: `exercises/${exercise.dirName}/FINISHED.mdx`,\n\t\t\t},\n\t\t\tprevStepLink: prevApp\n\t\t\t\t? {\n\t\t\t\t\t\tto: getAppPageRoute(prevApp),\n\t\t\t\t\t\t'aria-label': `${prevApp.title} (${prevApp.type})`,\n\t\t\t\t\t}\n\t\t\t\t: null,\n\t\t\tnextStepLink: nextExercise\n\t\t\t\t? {\n\t\t\t\t\t\tto: `/exercise/${nextExercise.exerciseNumber.toString().padStart(2, '0')}`,\n\t\t\t\t\t\t'aria-label': `${nextExercise.title}`,\n\t\t\t\t\t}\n\t\t\t\t: hasExtras\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tto: '/extra',\n\t\t\t\t\t\t\t'aria-label': 'Extras',\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tto: '/finished',\n\t\t\t\t\t\t\t'aria-label': 'Finished! 🎉',\n\t\t\t\t\t\t},\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nconst mdxComponents = { h1: () => null }\nexport default function ExerciseFinished({\n\tloaderData: data,\n}: Route.ComponentProps) {\n\tconst exerciseNumber = data.exercise.exerciseNumber\n\t\t.toString()\n\t\t.padStart(2, '0')\n\n\tuseRevalidationWS({\n\t\twatchPaths: [`./exercises/${exerciseNumber}/FINISHED.mdx`],\n\t})\n\n\treturn (\n\t\t<div className=\"flex max-w-full grow flex-col\">\n\t\t\t<main className=\"flex grow flex-col sm:grid sm:h-full sm:min-h-[800px] sm:grid-cols-1 sm:grid-rows-2 md:min-h-[unset] lg:grid-cols-2 lg:grid-rows-1\">\n\t\t\t\t<div className=\"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r\">\n\t\t\t\t\t<h1 className=\"h-14 border-b pr-5 pl-10 text-sm leading-tight font-medium\">\n\t\t\t\t\t\t<div className=\"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2\">\n\t\t\t\t\t\t\t<div className=\"flex items-center justify-start gap-x-2\">\n\t\t\t\t\t\t\t\t<Link to={`/${exerciseNumber}`} className=\"hover:underline\">\n\t\t\t\t\t\t\t\t\t{`${exerciseNumber}. ${data.exercise.title}`}\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t<span>/</span>\n\t\t\t\t\t\t\t\t<span>Elaboration</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</h1>\n\n\t\t\t\t\t<article\n\t\t\t\t\t\tclassName=\"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar h-full w-full max-w-none flex-1 scroll-pt-6 space-y-6 overflow-y-auto p-2 sm:p-10 sm:pt-8\"\n\t\t\t\t\t\tid={data.articleId}\n\t\t\t\t\t>\n\t\t\t\t\t\t{data.exercise.finishedCode ? (\n\t\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\t\tcode={data.exercise.finishedCode}\n\t\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t// TODO: render a random dad joke...\n\t\t\t\t\t\t\t'No finished instructions yet...'\n\t\t\t\t\t\t)}\n\t\t\t\t\t</article>\n\t\t\t\t\t<ElementScrollRestoration elementQuery={`#${data.articleId}`} />\n\t\t\t\t\t<ProgressToggle\n\t\t\t\t\t\ttype=\"finished\"\n\t\t\t\t\t\texerciseNumber={data.exercise.exerciseNumber}\n\t\t\t\t\t\tclassName=\"h-14 border-t px-6\"\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"@container flex h-16 justify-between border-t border-b-4 lg:border-b-0\">\n\t\t\t\t\t\t<div />\n\t\t\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\t\t\tfile={data.exerciseFinished.file}\n\t\t\t\t\t\t\trelativePath={data.exerciseFinished.relativePath}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NavChevrons prev={data.prevStepLink} next={data.nextStepLink} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<Survey\n\t\t\t\t\texerciseFormEmbedUrl={data.exerciseFormEmbedUrl}\n\t\t\t\t\texerciseTitle={data.exercise.title}\n\t\t\t\t/>\n\t\t\t</main>\n\t\t</div>\n\t)\n}\n\nfunction Survey({\n\texerciseFormEmbedUrl,\n\texerciseTitle,\n}: {\n\texerciseFormEmbedUrl: string\n\texerciseTitle: string\n}) {\n\tconst theme = useTheme()\n\tconst [iframeLoaded, setIframeLoaded] = React.useState(false)\n\tconst isOnline = useIsOnline()\n\tif (!isOnline) {\n\t\treturn (\n\t\t\t<div className=\"relative shrink-0\">\n\t\t\t\t<div className=\"text-body-md text-foreground-destructive absolute inset-0 z-10 flex items-center justify-center\">\n\t\t\t\t\t<Icon name=\"WifiNoConnection\" size=\"xl\">\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{'Unable to load the '}\n\t\t\t\t\t\t\t<a href={exerciseFormEmbedUrl} className=\"underline\">\n\t\t\t\t\t\t\t\t{`${exerciseTitle} feedback form`}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t{' when offline'}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Icon>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t)\n\t}\n\treturn (\n\t\t<div className=\"relative min-h-full sm:min-h-[unset] sm:shrink-0\">\n\t\t\t{!iframeLoaded ? (\n\t\t\t\t<div className=\"absolute inset-0 z-10 flex items-center justify-center\">\n\t\t\t\t\t<Loading>\n\t\t\t\t\t\t<span>Loading {exerciseTitle} Elaboration form</span>\n\t\t\t\t\t</Loading>\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t<iframe\n\t\t\t\tonLoad={() => setIframeLoaded(true)}\n\t\t\t\t// show what would have shown if there is an error\n\t\t\t\tonError={() => setIframeLoaded(true)}\n\t\t\t\ttitle=\"Elaboration\"\n\t\t\t\tsrc={exerciseFormEmbedUrl}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'absolute inset-0 flex h-full w-full transition-opacity duration-300',\n\t\t\t\t\tiframeLoaded ? 'opacity-100' : 'opacity-0',\n\t\t\t\t)}\n\t\t\t\tstyle={{ colorScheme: theme }}\n\t\t\t/>\n\t\t</div>\n\t)\n}\n"],"names":["meta","loaderData","matches","number","exercise","exerciseNumber","toString","padStart","rootData","getRootMatchLoaderData","title","getSeoMetaTags","workshopTitle","description","ogTitle","ogDescription","Number","instructor","requestInfo","mdxComponents","h1","$exerciseNumber__finished","_UNSAFE_withComponentProps","data","useRevalidationWS","watchPaths","className","children","jsxs","jsx","Link","to","id","articleId","finishedCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","ElementScrollRestoration","elementQuery","ProgressToggle","type","EditFileOnGitHub","file","exerciseFinished","relativePath","NavChevrons","prev","prevStepLink","next","nextStepLink","Survey","exerciseFormEmbedUrl","exerciseTitle","theme","useTheme","iframeLoaded","setIframeLoaded","React","useIsOnline","Loading","onLoad","onError","src","cn","style","colorScheme","Icon","name","size","href"],"mappings":"+/BAoCO,MAAMA,EAA2BA,CAAC,CAAEC,WAAAA,EAAYC,QAAAA,CAAQ,IAAM,CACpE,MAAMC,EAASF,GAAYG,SAASC,eAAeC,WAAWC,SAAS,EAAG,GAAG,EAEvEC,EAAWC,EAAuBP,CAAO,EAC/C,MAAI,CAACD,GAAc,CAACO,EAAiB,CAAC,CAAEE,MAAO,YAAa,CAAC,EAEtDC,EAAe,CACrBD,MAAO,QAAQP,CAAM,KAAKF,EAAWG,SAASM,KAAK,MAAMF,GAAUI,aAAa,GAChFC,YAAa,mBAAmBV,CAAM,KAAKF,EAAWG,SAASM,KAAK,GACpEI,QAAS,aAAab,EAAWG,SAASM,KAAK,GAC/CK,cAAe,4BAA4BC,OAAOb,CAAM,CAAC,GACzDc,WAAYT,EAASS,WACrBC,YAAaV,EAASU,WACvB,CAAC,CACF,EA2FMC,EAAgB,CAAEC,GAAIA,IAAM,IAAK,EACvCC,EAAAC,EAAA,SAAyC,CACxCrB,WAAYsB,CACb,EAAyB,CACxB,MAAMlB,EAAiBkB,EAAKnB,SAASC,eACnCC,WACAC,SAAS,EAAG,GAAG,EAEjBiB,OAAAA,EAAkB,CACjBC,WAAY,CAAC,eAAepB,CAAc,eAAe,CAC1D,CAAC,QAGC,MAAA,CAAIqB,UAAU,gCACdC,SAAAC,EAAAA,KAAC,OAAA,CAAKF,UAAU,qIACfC,SAAA,CAAAC,EAAAA,KAAC,MAAA,CAAIF,UAAU,2EACdC,SAAA,CAAAE,EAAAA,IAAC,KAAA,CAAGH,UAAU,6DACbC,SAAAE,EAAAA,IAAC,MAAA,CAAIH,UAAU,gEACdC,SAAAC,EAAAA,KAAC,MAAA,CAAIF,UAAU,0CACdC,SAAA,CAAAE,EAAAA,IAACC,EAAA,CAAKC,GAAI,IAAI1B,CAAc,GAAIqB,UAAU,kBACxCC,SAAA,GAAGtB,CAAc,KAAKkB,EAAKnB,SAASM,KAAK,EAAA,CAC3C,EACAmB,EAAAA,IAAC,QAAKF,SAAA,GAAA,CAAC,EACPE,EAAAA,IAAC,QAAKF,SAAA,aAAA,CAAW,CAAA,EAClB,EACD,CAAA,CACD,EAEAE,EAAAA,IAAC,UAAA,CACAH,UAAU,yJACVM,GAAIT,EAAKU,UAERN,SAAAJ,EAAKnB,SAAS8B,aACdL,EAAAA,IAACM,EAAA,CACAC,sBAAuBb,EAAKa,sBAE5BT,SAAAE,EAAAA,IAAC,MAAA,CAAIH,UAAU,sCACdC,SAAAE,EAAAA,IAACQ,EAAA,CACAC,KAAMf,EAAKnB,SAAS8B,aACpBK,WAAYpB,EACb,EACD,CAAA,CACD,EAGA,iCAAA,CAEF,QACCqB,EAAA,CAAyBC,aAAc,IAAIlB,EAAKU,SAAS,EAAA,CAAI,EAC9DJ,EAAAA,IAACa,EAAA,CACAC,KAAK,WACLtC,eAAgBkB,EAAKnB,SAASC,eAC9BqB,UAAU,oBAAA,CACX,EACAE,EAAAA,KAAC,MAAA,CAAIF,UAAU,yEACdC,SAAA,CAAAE,EAAAA,IAAC,MAAA,CAAA,CAAI,EACLA,EAAAA,IAACe,EAAA,CACAC,KAAMtB,EAAKuB,iBAAiBD,KAC5BE,aAAcxB,EAAKuB,iBAAiBC,YAAA,CACrC,QACCC,EAAA,CAAYC,KAAM1B,EAAK2B,aAAcC,KAAM5B,EAAK6B,YAAA,CAAc,CAAA,CAAA,CAChE,CAAA,CAAA,CACD,EACAvB,EAAAA,IAACwB,EAAA,CACAC,qBAAsB/B,EAAK+B,qBAC3BC,cAAehC,EAAKnB,SAASM,KAAA,CAC9B,CAAA,EACD,CAAA,CACD,CAEF,CAAA,EAEA,SAAS2C,EAAO,CACfC,qBAAAA,EACAC,cAAAA,CACD,EAGG,CACF,MAAMC,EAAQC,EAAA,EACR,CAACC,EAAcC,CAAe,EAAIC,EAAAA,SAAe,EAAK,EAE5D,OADiBC,EAAA,EAmBhBjC,EAAAA,KAAC,MAAA,CAAIF,UAAU,mDACbC,SAAA,CAAC+B,EAME,WALF,MAAA,CAAIhC,UAAU,yDACdC,SAAAE,EAAAA,IAACiC,EAAA,CACAnC,gBAAC,OAAA,CAAKA,SAAA,CAAA,WAAS4B,EAAc,mBAAA,EAAiB,EAC/C,EACD,EAED1B,EAAAA,IAAC,SAAA,CACAkC,OAAQA,IAAMJ,EAAgB,EAAI,EAElCK,QAASA,IAAML,EAAgB,EAAI,EACnCjD,MAAM,cACNuD,IAAKX,EACL5B,UAAWwC,EACV,sEACAR,EAAe,cAAgB,WAChC,EACAS,MAAO,CAAEC,YAAaZ,CAAM,CAAA,CAC7B,CAAA,CAAA,CACD,EApCC3B,EAAAA,IAAC,MAAA,CAAIH,UAAU,oBACdC,eAAC,MAAA,CAAID,UAAU,kGACdC,SAAAE,EAAAA,IAACwC,GAAKC,KAAK,mBAAmBC,KAAK,KAClC5C,gBAAC,OAAA,CACCA,SAAA,CAAA,sBACDE,EAAAA,IAAC,KAAE2C,KAAMlB,EAAsB5B,UAAU,YACvCC,SAAA,GAAG4B,CAAa,iBAClB,EACC,eAAA,EACF,EACD,EACD,CAAA,CACD,CA0BH"}
@@ -0,0 +1,2 @@
1
+ import{w as $e,b as ae,O as Be,L as i,i as xe,u as pe,p as v}from"./chunk-EPOLDU6W-BCLmut3y.js";import{j as e}from"./jsx-runtime-C5WNSv3b.js";import{c as h,I as g,a as x,n as H,o as S}from"./misc-W4055b-0.js";import{r as k}from"./index-CqIc3cxq.js";import{a as ze}from"./pe-CIZUOJMr.js";import{u as oe,O as Q}from"./onboarding-indicator-B-XR90_G.js";import{L as Z}from"./product-CvyMpYD_.js";import{u as Re}from"./revalidation-ws-BJWJviUX.js";import{S as W}from"./status-indicator-C6DiLYL5.js";import{D as Ve,f as Ue,a as Fe,b as We,d as Ye}from"./dialog-CzO65Z5w.js";import{R as qe,T as Qe,P as Ke,C as Oe}from"./index-CmflCPTU.js";import{S as N,m as Je,T as M,j as ee,k as te}from"./tooltip-Tlsyx2YO.js";import{c as O,b as Ge}from"./user-BsPobzjB.js";import{u as ge}from"./workshop-config-Zfc8zU0x.js";import{u as je}from"./online-DiNLkgTC.js";import{u as le,g as be,p as Xe}from"./presence-VCvV2mg7.js";import{b as ve,a as we}from"./root-loader-BOzEMapJ.js";import{b as Ze,s as ye,c as Me,d as et,e as Ne,f as ke,m as f,u as tt,g as st}from"./progress-ILaVQtOO.js";import{T as ie}from"./index-CdzVFL-Z.js";import"./schemas-Uj5SZtvt.js";import"./index-ynYvVAOK.js";import"./index-vDCSPjrM.js";import"./coerce-CkHW0SMv.js";function nt(t){t.values.forEach(n=>n.stop())}function ne(t,n){[...n].reverse().forEach(o=>{const a=t.getVariant(o);a&&ye(t,a),t.variantChildren&&t.variantChildren.forEach(l=>{ne(l,n)})})}function rt(t,n){if(Array.isArray(n))return ne(t,n);if(typeof n=="string")return ne(t,[n]);ye(t,n)}function at(){const t=new Set,n={subscribe(s){return t.add(s),()=>void t.delete(s)},start(s,o){const a=[];return t.forEach(l=>{a.push(Ze(l,s,{transitionOverride:o}))}),Promise.all(a)},set(s){return t.forEach(o=>{rt(o,s)})},stop(){t.forEach(s=>{nt(s)})},mount(){return()=>{n.stop()}}};return n}function re(){const t=Me(at);return et(t.mount,[]),t}function ot(t,n){function s(){return window.matchMedia(t).matches}function o(a){const l=window.matchMedia(t);return l.addEventListener("change",a),()=>{l.removeEventListener("change",a)}}return function(){return k.useSyncExternalStore(o,s,()=>n)}}function Ee({...t}){return e.jsx(qe,{...t})}function K({...t}){return e.jsx(Qe,{...t})}function Ce({className:t,align:n="center",sideOffset:s=4,...o}){return e.jsx(Ke,{children:e.jsx(Oe,{align:n,sideOffset:s,className:h("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-2 shadow-md outline-none",t),...o})})}const fe=["opacity-70","opacity-80","opacity-90","opacity-100"],he=["shadow-[0_0_2px_0_rgba(0,0,0,0.3)]","shadow-[0_0_4px_0_rgba(0,0,0,0.3)]","shadow-[0_0_7px_0_rgba(0,0,0,0.3)]","shadow-[0_0_10px_0_rgba(0,0,0,0.3)]"];function me(t){const n=Math.round(t*fe.length-1),s=Math.round(t*he.length-1);return h("shadow-highlight hover:opacity-100 focus:opacity-100",fe[n]??"opacity-60",he[s]??"shadow-none",t===1?"animate-pulse hover:animate-none focus:animate-none":null)}function Pe({isMenuOpened:t}){const n=O(),{users:s}=le(),{product:{displayNameShort:o}}=ge(),a=t?17:0,l=s.length-a,m=l>(t?1:0);if(!s.length)return null;const d=t&&s.length===1?e.jsx(i,{target:"_blank",rel:"noopener noreferrer",to:"https://www.youtube.com/watch?v=w6Q3mHyzn78",children:e.jsx("img",{alt:"Tiffany Tunes",className:h("h-8 w-8 rounded-full border object-cover",me(1)),src:"/img/tiffany.png"})}):null,p=`${l}${t?" more ":" "}${o} Dev${l===1?"":"s"} working now`;return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.jsxs(Je,{children:[(m?s.slice(0,a):s).map(({user:u,score:L})=>{const E=me(L),w=it(u),A=u.imageUrlSmall||u.avatarUrl,C=u.hasAccess,I=w.some(y=>y.origin?.includes("localhost")),T=ct(w),j=lt(u.loggedInProductHosts);if(u.optOut)return e.jsxs(M,{children:[e.jsx(ee,{asChild:!0,tabIndex:0,children:e.jsx("div",{className:"relative","aria-label":"Anonymous user (opted out)",children:e.jsx("div",{className:h("bg-muted flex h-8 w-8 items-center justify-center rounded-full border opacity-50"),children:e.jsx(g,{name:"User"})})})}),e.jsx(te,{children:e.jsx("span",{className:"flex flex-col items-center justify-center gap-1",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[j?e.jsx("span",{className:"text-xs",children:j}):null,"Anonymous (opted out of sharing)"]})})})]},u.id);let P;return C?P=I?"working":"referencing":P=I?"previewing":"reviewing",e.jsxs(M,{children:[e.jsx(ee,{asChild:!0,tabIndex:0,children:e.jsxs("div",{className:"relative","aria-label":u.name||`${o} Dev`,children:[A?e.jsx("img",{alt:u.name||o,className:h("h-8 w-8 rounded-full border object-cover",E),src:A}):e.jsx("div",{className:h("flex h-8 w-8 items-center justify-center rounded-full border",E),children:e.jsx(g,{name:"User"})}),T?e.jsx("span",{className:"absolute -top-1 -left-1 text-xs leading-none","aria-label":"Workshop products",children:T}):null]})}),e.jsx(te,{children:e.jsxs("span",{className:"flex flex-col items-center justify-center gap-1",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[j?e.jsx("span",{className:"text-xs",children:j}):null,u.name||`${o} Dev`,w.length>0?` is ${P} ${L===1&&n?.id!==u.id?"with you":""} on`:null]}),w.map((y,R)=>{const b=dt(y);return b?e.jsxs("span",{className:h("flex flex-col items-center",w.length>1?"border-border mt-1 border-t pt-1 first:mt-0 first:border-t-0 first:pt-0":""),children:[b.line1?e.jsxs("span",{children:[be(y.productHost)," ",b.line1]}):null,b.line2?e.jsx("span",{className:"text-muted-foreground text-xs",children:b.line2}):null]},`${y.workshopTitle}-${R}`):null})]})})]},u.id)}),d,m?e.jsxs(M,{children:[e.jsx(ee,{asChild:!0,tabIndex:0,children:e.jsx("div",{"aria-label":p,className:h("bg-accent text-accent-foreground flex items-center justify-center rounded-full border text-xs",t?"h-8 w-8":"h-6 w-6"),children:e.jsx("span",{className:h("pointer-events-none truncate text-center",t?"w-8":"w-6"),children:t?`+${l}`:l})})}),e.jsx(te,{children:p})]}):null]})})}function lt(t){return!t||t.length===0?null:t.map(n=>Xe[n]).filter(Boolean).join(" ")}function it(t){return t.locations&&t.locations.length>0?t.locations.filter(Boolean):t.location?[t.location]:[]}function ct(t){const n=new Set;for(const s of t)s.productHost&&n.add(s.productHost);return n.size===0?null:Array.from(n).map(s=>be(s)).filter(Boolean).join("")}function Se(t){return t.some(n=>{const s=n.relativePath.split(/[\\/]/)[0];return s==="extra"||s==="example"||s==="examples"})}const Le=ot("(min-width: 640px)",!0),zt=$e(function(){const n=ae(),s=O(),o=Le(),a=ze(),[l,m]=k.useState(n.isMenuOpened);Re({watchPaths:["./exercises/README.mdx","./extra","./example","./examples"]});function d(p){m(p),document.cookie=`es_menu_open=${p.toString()}; path=/; SameSite=Lax;`}return e.jsxs("div",{className:"flex flex-col",children:[s?null:e.jsx(ut,{}),a&&o?null:e.jsx(ht,{isMenuOpened:l,onMenuOpenChange:d}),e.jsxs("div",{className:h("flex grow flex-col sm:flex-row",{"h-[calc(100vh-128px-env(safe-area-inset-top)-env(safe-area-inset-bottom))] sm:h-[calc(100vh-64px-env(safe-area-inset-top)-env(safe-area-inset-bottom))]":!s,"h-[calc(100vh-64px-env(safe-area-inset-top)-env(safe-area-inset-bottom))] sm:h-[calc(100vh-env(safe-area-inset-top)-env(safe-area-inset-bottom))]":s,"h-[unset]":!o&&l}),children:[o?e.jsx(mt,{isMenuOpened:l,onMenuOpenChange:d}):null,e.jsx("div",{className:h("h-full w-full max-w-full sm:max-w-[calc(100%-56px)]",l?"hidden md:block":""),children:e.jsx(Be,{})})]})]})});function dt(t){if(!t)return null;const{exercise:n}=t,s=[n?[n.exerciseNumber,n.stepNumber].filter(Boolean).map(o=>o.toString().padStart(2,"0")).join("/"):null,n?.type].filter(Boolean).join(" - ");return{line1:t.workshopTitle,line2:s}}function ut(){const t=Le(),{product:{host:n,displayName:s}}=ge(),o=Ge(),[a,l]=oe("login-button"),m=e.jsx("div",{children:ENV.EPICSHOP_DEPLOYED?e.jsxs("div",{children:["This is the deployed version. ",e.jsxs(e.Fragment,{children:[e.jsx(i,{className:"underline",target:"_blank",rel:"noopener noreferrer",to:ENV.EPICSHOP_GITHUB_REPO,children:"Run locally"})," for full experience."]})," "]}):o?e.jsxs("div",{children:[e.jsx(i,{to:"/login",className:"underline",children:"Login"})," ","or"," ",e.jsx("a",{href:`https://${n}/login`,className:"underline",children:"join for free"})," ","for the full experience."]}):null});return e.jsx("div",{className:"from-highlight to-info text-info-foreground z-10 flex h-16 items-center justify-between border-b bg-linear-to-tr pl-4",children:t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden flex-1 flex-wrap items-center gap-4 sm:flex",children:[e.jsx(Z,{size:"lg",style:"monochrome"}),e.jsxs("div",{className:"flex flex-1 flex-wrap items-center",children:[e.jsxs("p",{className:"mr-2",children:["Welcome to the"," ",e.jsx(i,{to:`https://${n}`,className:"underline",target:"_blank",children:s})," ","Workshop app!"]}),m]})]}),o?null:e.jsxs("div",{className:"hidden h-full flex-col items-center sm:flex md:flex-row",children:[e.jsxs(i,{to:`https://${n}`,target:"_blank",className:"flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold",children:[e.jsxs("span",{className:"drop-shadow-sm",children:["Join ",s]}),e.jsx("span",{children:"↗︎"})]}),e.jsxs(i,{to:ENV.EPICSHOP_DEPLOYED?`https://${n}/login`:"/login",className:"bg-info-foreground/20 hover:bg-info-foreground/30 relative flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold shadow-md transition",onClick:l,children:[e.jsx(g,{name:"User",size:"lg"}),e.jsx("span",{className:"drop-shadow-sm",children:"Login"}),a?e.jsx(Q,{tooltip:"Login for the full experience!",size:"sm"}):null]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-4 sm:hidden",children:[e.jsx("a",{href:`https://${n}`,children:e.jsx(Z,{size:"lg",style:"monochrome"})}),e.jsxs(Ve,{children:[e.jsx(Ue,{children:e.jsx(g,{name:"Question",size:"lg",className:"animate-pulse"})}),e.jsxs(Fe,{children:[e.jsxs(We,{children:[e.jsx(Z,{size:"lg",style:"monochrome"}),e.jsx("span",{className:"text-lg font-semibold",children:s})]}),e.jsxs(Ye,{children:["Welcome to the"," ",e.jsx(i,{to:`https://${n}`,className:"underline",children:s})," ","Workshop app!"]}),m]})]})]}),o?null:e.jsxs("div",{className:"flex h-full items-center",children:[e.jsxs(i,{to:`https://${n}`,target:"_blank",className:"flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold",children:[e.jsx("span",{className:"drop-shadow-sm",children:"Join"}),e.jsx("span",{children:"↗︎"})]}),e.jsxs(i,{to:ENV.EPICSHOP_DEPLOYED?`https://${n}/login`:"/login",className:"bg-info-foreground/20 hover:bg-info-foreground/30 relative flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold shadow-md transition",onClick:l,children:[e.jsx(g,{name:"User",size:"lg"}),e.jsx("span",{className:"drop-shadow-sm",children:"Login"}),a?e.jsx(Q,{tooltip:"Login for the full experience!",size:"sm"}):null]})]})]})})}const ce={hidden:{opacity:0,x:-20},visible:{opacity:1,x:0}};function Ie({exerciseNumber:t,children:n}){const s=tt(t);return e.jsx(f.li,{variants:ce,className:h("py-[6px] first:pt-3 last:pb-3",s?`${s} before:border-t`:null),children:e.jsx("span",{className:"inline-block pl-2",children:n})})}function B({children:t,...n}){const s=st(n);return e.jsx(f.li,{variants:ce,className:h("py-[6px] first:pt-3 last:pb-3",s?`${s} before:border-t`:null),children:e.jsx("span",{className:"inline-block pl-2",children:t})})}function De({children:t}){return e.jsx(f.li,{variants:ce,className:"py-[6px] first:pt-3 last:pb-3",children:e.jsx("span",{className:"inline-block pl-2",children:t})})}const ft='relative px-2 py-0.5 pr-3 whitespace-nowrap outline-none hover:underline focus:underline after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""]';function z(t,n){return x(ft,n,{"bg-foreground text-background":t})}function ht({isMenuOpened:t,onMenuOpenChange:n}){const s=ae(),o=ve(),a=O(),l=Ne(),m=ke(),d=xe(),p=pe(),u=je(),{users:L}=le(),[E,w]=oe("account-link"),A=Se(o),C=s.extras.find(c=>c.name===s.playground.appName),I=p.pathname==="/extra"||p.pathname.startsWith("/extra/"),T=!!C&&!I,j={visible:{opacity:1,transition:{duration:.05,when:"beforeChildren",staggerChildren:.03}},hidden:{opacity:0}};k.useCallback(()=>{typeof window>"u"||window.dispatchEvent(new CustomEvent("toggle-keyboard-shortcuts"))},[]);const y=we().session.theme??"system",R={light:"Light",dark:"Dark",system:"System"}[y],[b,Y]=k.useState(!1);return e.jsx("nav",{className:"flex w-full border-b sm:hidden",children:e.jsx("div",{className:"w-full",children:e.jsxs("div",{className:h("flex items-center",{"flex-col":t,"h-14":!t}),children:[e.jsx(He,{title:s.workshopTitle,isMenuOpened:t,setMenuOpened:n}),t&&e.jsxs(f.div,{className:"scrollbar-thin scrollbar-thumb-scrollbar flex w-full grow flex-col justify-between overflow-x-auto p-6",initial:{opacity:0},animate:{opacity:1},children:[e.jsxs(f.ul,{variants:j,initial:"hidden",animate:"visible",className:"flex flex-col",children:[e.jsx("span",{children:e.jsx(v,{prefetch:"intent",to:"/",className:({isActive:c})=>x("relative px-2 py-0.5 pr-3 text-2xl font-bold whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":c}),children:"Home"})}),s.exercises.map(({exerciseNumber:c,title:V,steps:J})=>{const D=Number(d.exerciseNumber)===c,G=!D&&s.playground.exerciseNumber===c;return e.jsxs(Ie,{exerciseNumber:c,children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(i,{prefetch:"intent",to:H(c),className:x("relative px-2 py-0.5 pr-3 whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":D}),children:V}),G?e.jsx(i,{to:S(s.playground.exerciseNumber,s.playground.stepNumber,s.playground.type),prefetch:"intent",children:"🛝"}):null]}),D?e.jsxs(f.ul,{variants:j,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:[e.jsx(B,{type:"instructions",exerciseNumber:c,children:e.jsx(i,{to:H(c),prefetch:"intent",className:x('after:bg-background relative px-2 py-0.5 pr-3 text-xl font-medium whitespace-nowrap outline-none after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":!d.stepNumber}),children:"Intro"})},c),J.filter(Boolean).map(({stepNumber:r,title:U,problem:q,solution:$})=>e.jsx(B,{type:"step",stepNumber:r,exerciseNumber:c,children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs(i,{to:S(c,r),prefetch:"intent",className:"leading-tight font-semibold",children:[r.toString().padStart(2,"0"),"."," ",U]}),e.jsxs("div",{className:"mt-0.5 ml-3 flex gap-1",children:[q&&e.jsxs(v,{to:S(c,r,"problem"),prefetch:"intent",className:({isActive:F})=>z(F),children:["Problem",q.name===s.playground.appName?" 🛝":""]}),$&&e.jsxs(v,{to:S(c,r,"solution"),prefetch:"intent",className:({isActive:F})=>z(F),children:["Solution",$.name===s.playground.appName?" 🛝":""]})]})]})},r)),e.jsx(B,{type:"finished",exerciseNumber:c,children:e.jsx(v,{to:H(c,"finished"),prefetch:"intent",className:({isActive:r})=>x('after:bg-background relative px-2 py-0.5 pr-3 text-base font-medium whitespace-nowrap outline-none after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":r}),children:"📝 Elaboration"})})]}):null]},c)}),A?e.jsxs("span",{children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(v,{to:"/extra",prefetch:"intent",className:({isActive:c})=>x("relative px-2 py-0.5 pr-3 whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":c}),children:"📚 Extras"}),T&&C?e.jsx(i,{to:`/extra/${C.dirName}`,prefetch:"intent",children:"🛝"}):null]}),I&&s.extras.length?e.jsx(f.ul,{variants:j,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:s.extras.map(c=>e.jsx(De,{children:e.jsxs(v,{to:`/extra/${c.dirName}`,prefetch:"intent",className:({isActive:V})=>z(V,"leading-tight font-semibold"),children:[c.title,c.name===s.playground.appName?" 🛝":""]})},c.dirName))}):null]}):null]}),e.jsx("div",{className:"mt-6",children:e.jsx(v,{to:"/finished",className:({isActive:c})=>x("relative text-lg font-bold whitespace-nowrap outline-none hover:underline focus:underline",{'after:bg-background bg-foreground text-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""]':c}),children:"📝 Workshop Feedback"})})]}),e.jsx("div",{className:"grow"}),u?null:e.jsx(N,{content:t?null:"You are offline",children:e.jsx("div",{className:h("flex h-14 animate-pulse items-center justify-start p-4",t?"w-full border-t":"border-l"),children:e.jsx(g,{name:"WifiNoConnection",className:"text-foreground-destructive",children:t?"You are offline":null})})}),e.jsx("div",{className:h("flex items-center justify-start p-4",t&&L.length>4?"min-h-14":"h-14",t?"w-full border-t":"border-l"),children:e.jsx(Pe,{isMenuOpened:t})}),ENV.EPICSHOP_DEPLOYED?null:a?e.jsx(N,{content:t?null:"Your account",children:e.jsxs(i,{className:h("relative flex h-14 shrink-0 items-center justify-start space-x-3 px-4 py-4 text-center no-underline hover:underline",{"border-l":!t,"w-full border-t":t}),to:"/account",onClick:w,children:[a.imageUrlSmall?e.jsx("img",{alt:a.name??a.email,src:a.imageUrlSmall,className:"h-full rounded-full"}):e.jsx(g,{name:"User",className:"shrink-0",size:"lg"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Your Account"}):e.jsx("span",{className:"sr-only",children:"Your account"}),E?e.jsx(Q,{tooltip:"View your account and preferences",size:"sm"}):null]})}):null,ENV.EPICSHOP_DEPLOYED?null:a&&l?e.jsx(N,{content:t?null:"Continue to next lesson",children:e.jsxs(i,{to:l,prefetch:"intent",className:x("flex h-14 w-full items-center space-x-3 border-l px-4 py-4 pl-[18px] no-underline hover:underline"),state:{from:"continue next lesson button"},children:[e.jsx(g,{name:"FastForward",className:"shrink-0",size:"md"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Continue to next lesson"}):e.jsx("span",{className:"sr-only",children:"Continue to next lesson"})]})}):null,ENV.EPICSHOP_DEPLOYED?null:a&&m?e.jsx(N,{content:t?null:"Practice a past lesson",children:e.jsxs(i,{to:m,prefetch:"intent",className:x("flex h-14 w-full items-center space-x-3 border-l px-4 py-4 pl-[18px] no-underline hover:underline"),children:[e.jsx(g,{name:"Refresh",className:"shrink-0",size:"md"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Practice a past lesson"}):e.jsx("span",{className:"sr-only",children:"Practice a past lesson"})]})}):null,e.jsx("div",{className:h("flex h-14 items-center justify-center gap-2 self-start p-4 sm:mb-4",{"w-full border-t":t,"w-14 border-l":!t}),children:t?e.jsxs(e.Fragment,{children:[e.jsx(ie,{}),e.jsx(_e,{status:s.sidecarStatus})]}):e.jsxs(Ee,{open:b,onOpenChange:Y,children:[s.sidecarStatus?.hasFailure?e.jsx(K,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Process error - click to see details",title:b?void 0:"Process error - click to see details",className:"text-muted-foreground hover:text-foreground hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md transition-colors",children:e.jsx(W,{status:"failed"})})}):e.jsx(K,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"More options",title:b?void 0:"More options",className:"text-muted-foreground hover:text-foreground hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md transition-colors",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"5",cy:"10",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"10",cy:"10",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"15",cy:"10",r:"1.5",fill:"currentColor"})]})})}),e.jsxs(Ce,{side:"top",align:"start",className:"flex flex-col gap-1 p-2",children:[e.jsx(Ae,{themeLabel:R,disableTooltip:b}),s.sidecarStatus?e.jsxs(i,{to:"/admin",className:"hover:bg-muted flex items-center gap-3 rounded-md px-2 py-1.5 text-sm transition-colors",children:[e.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:e.jsx(W,{status:s.sidecarStatus.hasFailure?"failed":"running"})}),e.jsxs("span",{className:"flex-1 text-left",children:["Sidecar process"," ",s.sidecarStatus.hasFailure?"error":"running"]})]}):null]})]})})]})})})}const se=400;function _e({status:t}){return t?e.jsx(N,{content:t.hasFailure?`${t.failureCount} sidecar${t.failureCount===1?"":"s"} failed`:"All sidecars running",children:e.jsx(i,{to:"/admin",className:"text-muted-foreground hover:text-foreground hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md transition-colors",children:e.jsx(W,{status:t.hasFailure?"failed":"running"})})}):null}function mt({isMenuOpened:t,onMenuOpenChange:n}){const s=ae(),o=ve(),a=O(),l=Ne(),m=ke(),d=xe(),p=pe(),u=je(),{users:L}=le(),[E,w]=oe("account-link"),A=Se(o),C=s.extras.find(r=>r.name===s.playground.appName),I=p.pathname==="/extra"||p.pathname.startsWith("/extra/"),T=!!C&&!I,j=s.exercises.find(r=>r.exerciseNumber===Number(d.exerciseNumber)),P=d.type==="solution"?j?.solutions.find(r=>r.stepNumber===Number(d.stepNumber)):d.type==="problem"?j?.problems.find(r=>r.stepNumber===Number(d.stepNumber)):null,y=re(),R={close:{width:56},open:{width:se}},b={visible:{opacity:1,transition:{duration:.05,when:"beforeChildren",staggerChildren:.03}},hidden:{opacity:0}},Y=k.useCallback(()=>{typeof window>"u"||window.dispatchEvent(new CustomEvent("toggle-keyboard-shortcuts"))},[]),V=we().session.theme??"system",J={light:"Light",dark:"Dark",system:"System"}[V],[D,G]=k.useState(!1);return e.jsx("nav",{className:"hidden border-r sm:flex",children:e.jsx(f.div,{initial:t?"open":"close",variants:R,animate:y,children:e.jsxs("div",{className:"flex h-full flex-col items-center justify-between",children:[e.jsx(He,{title:s.workshopTitle,menuControls:y,isMenuOpened:t,setMenuOpened:n}),t&&e.jsxs(f.div,{style:{width:se},className:"scrollbar-thin scrollbar-thumb-scrollbar flex grow flex-col justify-between overflow-y-auto p-6",initial:{opacity:0},animate:{opacity:1},children:[e.jsxs(f.ul,{variants:b,initial:"hidden",animate:"visible",className:"flex flex-col",children:[e.jsx("span",{children:e.jsx(v,{prefetch:"intent",to:"/",className:({isActive:r})=>x("relative px-2 py-0.5 pr-3 text-2xl font-bold whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":r}),children:"Home"})}),s.exercises.map(({exerciseNumber:r,title:U,steps:q})=>{const $=Number(d.exerciseNumber)===r,F=!$&&s.playground.exerciseNumber===r;return e.jsxs(Ie,{exerciseNumber:r,children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(i,{prefetch:"intent",to:H(r),className:x("relative px-2 py-0.5 pr-3 whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":$}),children:U}),F?e.jsx(i,{to:S(s.playground.exerciseNumber,s.playground.stepNumber,s.playground.type),prefetch:"intent",children:"🛝"}):null]}),$?e.jsxs(f.ul,{variants:b,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:[e.jsx(B,{type:"instructions",exerciseNumber:r,children:e.jsx(i,{to:H(r),prefetch:"intent",className:x('after:bg-background relative px-2 py-0.5 pr-3 text-xl font-medium whitespace-nowrap outline-none after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":!d.stepNumber}),children:"Intro"})},r),q.filter(Boolean).map(({stepNumber:_,title:Te,problem:de,solution:ue})=>e.jsx(B,{type:"step",stepNumber:_,exerciseNumber:r,children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs(i,{to:S(r,_),prefetch:"intent",className:"leading-tight font-semibold",children:[_.toString().padStart(2,"0"),"."," ",Te]}),e.jsxs("div",{className:"mt-0.5 ml-3 flex gap-1",children:[de&&e.jsxs(v,{to:S(r,_,"problem"),prefetch:"intent",className:({isActive:X})=>z(X),children:["Problem",de.name===s.playground.appName?" 🛝":""]}),ue&&e.jsxs(v,{to:S(r,_,"solution"),prefetch:"intent",className:({isActive:X})=>z(X),children:["Solution",ue.name===s.playground.appName?" 🛝":""]})]})]})},_)),e.jsx(B,{type:"finished",exerciseNumber:r,children:e.jsx(v,{to:H(r,"finished"),prefetch:"intent",className:({isActive:_})=>x('after:bg-background relative px-2 py-0.5 pr-3 text-base font-medium whitespace-nowrap outline-none after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":_}),children:"📝 Elaboration"})})]}):null]},r)}),A?e.jsxs("span",{children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(v,{to:"/extra",prefetch:"intent",className:({isActive:r})=>x("relative px-2 py-0.5 pr-3 whitespace-nowrap outline-none hover:underline focus:underline",'after:bg-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":r}),children:"📚 Extras"}),T&&C?e.jsx(i,{to:`/extra/${C.dirName}`,prefetch:"intent",children:"🛝"}):null]}),I&&s.extras.length?e.jsx(f.ul,{variants:b,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:s.extras.map(r=>e.jsx(De,{children:e.jsxs(v,{to:`/extra/${r.dirName}`,prefetch:"intent",className:({isActive:U})=>z(U,"leading-tight font-semibold"),children:[r.title,r.name===s.playground.appName?" 🛝":""]})},r.dirName))}):null]}):null]}),e.jsx("div",{className:"mt-6",children:e.jsx(v,{to:"/finished",className:({isActive:r})=>x("relative text-lg font-bold whitespace-nowrap outline-none hover:underline focus:underline",{'after:bg-background bg-foreground text-background after:absolute after:-right-2.5 after:-bottom-2.5 after:h-5 after:w-5 after:scale-75 after:rotate-45 after:content-[""]':r}),children:"📝 Workshop Feedback"})})]}),!t&&e.jsx("div",{className:"flex grow flex-col justify-center",children:e.jsxs("div",{className:"orientation-sideways w-full font-mono text-sm leading-none font-medium uppercase",children:[j?.title?e.jsx(i,{to:H(Number(d.exerciseNumber)),children:j.title}):null,j?.title&&P?.title?" — ":null,P?.title?e.jsx(i,{to:S(Number(d.exerciseNumber),P.stepNumber),children:P.title}):null]})}),u?null:e.jsx(N,{content:t?null:"You are offline",children:e.jsx("div",{className:h("flex w-full animate-pulse items-center border-t p-4",t?"justify-start":"justify-center"),children:e.jsx(g,{name:"WifiNoConnection",className:"text-foreground-destructive",children:t?e.jsx("span",{className:"whitespace-nowrap",children:"You are offline"}):null})})}),e.jsx("div",{className:h("flex w-full items-center justify-start border-t p-4 transition-[height]",t&&L.length>4?"h-28":"h-14"),style:t?{width:se}:{},children:e.jsx(Pe,{isMenuOpened:t})}),ENV.EPICSHOP_DEPLOYED?null:a?e.jsx(N,{content:t?null:"Your account",children:e.jsxs(i,{className:"relative flex h-14 w-full shrink-0 items-center justify-start space-x-3 border-t px-4 py-4 text-center no-underline hover:underline",to:"/account",onClick:w,children:[a.imageUrlSmall?e.jsx("img",{alt:a.name??a.email,src:a.imageUrlSmall,className:"h-full rounded-full"}):e.jsx(g,{name:"User",className:"shrink-0",size:"lg"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Your Account"}):e.jsx("span",{className:"sr-only",children:"Your account"}),E?e.jsx(Q,{tooltip:"View your account and preferences",size:"sm"}):null]})}):null,ENV.EPICSHOP_DEPLOYED?null:a&&l?e.jsx(N,{content:t?null:"Continue to next lesson",children:e.jsxs(i,{to:l,prefetch:"intent",className:x("flex h-14 w-full items-center space-x-3 border-t px-4 py-4 pl-[18px] no-underline hover:underline"),state:{from:"continue next lesson button"},children:[e.jsx(g,{name:"FastForward",className:"shrink-0",size:"md"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Continue to next lesson"}):e.jsx("span",{className:"sr-only",children:"Continue to next lesson"})]})}):null,ENV.EPICSHOP_DEPLOYED?null:a&&m?e.jsx(N,{content:t?null:"Practice a past lesson",children:e.jsxs(i,{to:m,prefetch:"intent",className:x("flex h-14 w-full items-center space-x-3 border-t px-4 py-4 pl-[18px] no-underline hover:underline"),children:[e.jsx(g,{name:"Refresh",className:"shrink-0",size:"md"}),t?e.jsx(f.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Practice a past lesson"}):e.jsx("span",{className:"sr-only",children:"Practice a past lesson"})]})}):null,e.jsx("div",{className:"mb-4 w-full self-start border-t pt-[15px] pl-3",children:t?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{}),e.jsx(N,{content:"Keyboard shortcuts (press ?)",children:e.jsx("button",{type:"button","aria-label":"Keyboard shortcuts",onClick:Y,className:"text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:ring-ring flex h-8 w-8 items-center justify-center rounded-md transition-colors focus-visible:ring-2 focus-visible:ring-offset-2",children:e.jsx(g,{name:"Question",size:"md"})})}),e.jsx(_e,{status:s.sidecarStatus})]}):e.jsxs(Ee,{open:D,onOpenChange:G,children:[s.sidecarStatus?.hasFailure?e.jsx(K,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Process error - click to see details",title:D?void 0:"Process error - click to see details",className:"text-muted-foreground hover:text-foreground hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md transition-colors",children:e.jsx(W,{status:"failed"})})}):e.jsx(K,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"More options",title:D?void 0:"More options",className:"text-muted-foreground hover:text-foreground hover:bg-muted flex h-8 w-8 items-center justify-center rounded-md transition-colors",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"5",cy:"10",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"10",cy:"10",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"15",cy:"10",r:"1.5",fill:"currentColor"})]})})}),e.jsxs(Ce,{side:"top",align:"start",className:"flex flex-col gap-1 p-2",children:[e.jsx(Ae,{themeLabel:J,disableTooltip:D}),e.jsxs("button",{type:"button","aria-label":"Keyboard shortcuts",onClick:Y,className:"hover:bg-muted flex items-center gap-3 rounded-md px-2 py-1.5 text-sm transition-colors",children:[e.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:e.jsx(g,{name:"Question",size:"md"})}),e.jsx("span",{className:"flex-1 text-left",children:"Keyboard shortcuts"})]}),s.sidecarStatus?e.jsxs(i,{to:"/admin",className:"hover:bg-muted flex items-center gap-3 rounded-md px-2 py-1.5 text-sm transition-colors",children:[e.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:e.jsx(W,{status:s.sidecarStatus.hasFailure?"failed":"running"})}),e.jsxs("span",{className:"flex-1 text-left",children:["Sidecar process"," ",s.sidecarStatus.hasFailure?"error":"running"]})]}):null]})]})})]})})})}function Ae({themeLabel:t,disableTooltip:n}){const s=k.useRef(null),o=a=>{const l=s.current?.querySelector("form");if(!l)return;const m=l.querySelector('button[type="submit"]');m?.contains(a.target)||m?.click()};return e.jsxs("div",{ref:s,onClick:o,className:"hover:bg-muted flex cursor-pointer items-center gap-3 rounded-md px-2 py-1.5 text-sm transition-colors",children:[e.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:e.jsx(ie,{disableTooltip:n})}),e.jsxs("span",{className:"flex-1 text-left",children:[t," theme"]})]})}function He({title:t,isMenuOpened:n,setMenuOpened:s,menuControls:o}){const a=k.useRef(n),l=k.useRef(null),m={open:{d:"M3.06061 2.99999L21.0606 21"},closed:{d:"M0 9.5L24 9.5"}},d={open:{d:"M3.00006 21.0607L21 3.06064"},moving:{d:"M0 14.5L24 14.5"},closed:{d:"M0 14.5L15 14.5"}},p=re(),u=re();async function L(){o?.start(n?"close":"open"),s(!n),n?(p.start(m.closed),await u.start(d.moving),u.start(d.closed)):(await u.start(d.moving),p.start(m.open),u.start(d.open))}return k.useEffect(()=>{if(!n)return;function E(w){if(w.key!=="Escape"||w.defaultPrevented)return;!!document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||l.current?.click()}return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[n]),e.jsxs("div",{className:h("relative inline-flex h-14 shrink-0 items-center justify-between overflow-hidden border-r sm:w-full sm:border-r-0 sm:border-b",{"w-full":n}),children:[e.jsx("button",{ref:l,className:"flex h-14 w-14 items-center justify-center","aria-label":"Open Navigation menu",onClick:L,children:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:[e.jsx(f.path,{...m[a.current?"open":"closed"],animate:p,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5}),e.jsx(f.path,{...d[a.current?"open":"closed"],animate:u,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5})]})}),n&&e.jsx(f.p,{transition:{delay:.2},initial:{opacity:0,y:5},animate:{opacity:1,y:0},className:"absolute right-5 font-mono text-sm whitespace-nowrap uppercase",children:e.jsx(i,{to:"/",children:t})})]})}export{zt as default};
2
+ //# sourceMappingURL=_layout-BQ8VYaze.js.map