@epic-web/workshop-app 6.77.0 → 6.77.1

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 (98) hide show
  1. package/build/client/assets/{_exerciseNumber-C1aZpAWV.js → _exerciseNumber-JuXb6JTN.js} +2 -2
  2. package/build/client/assets/{_exerciseNumber-C1aZpAWV.js.map → _exerciseNumber-JuXb6JTN.js.map} +1 -1
  3. package/build/client/assets/{_exerciseNumber_.finished-BICggZV1.js → _exerciseNumber_.finished-DD-1txyR.js} +2 -2
  4. package/build/client/assets/{_exerciseNumber_.finished-BICggZV1.js.map → _exerciseNumber_.finished-DD-1txyR.js.map} +1 -1
  5. package/build/client/assets/_extra-BfK-kKBL.js +2 -0
  6. package/build/client/assets/_extra-BfK-kKBL.js.map +1 -0
  7. package/build/client/assets/{_layout-BZI3FoQD.js → _layout-BsHVX3B_.js} +2 -2
  8. package/build/client/assets/{_layout-BZI3FoQD.js.map → _layout-BsHVX3B_.js.map} +1 -1
  9. package/build/client/assets/{_layout-CunOyAg4.js → _layout-CDyeQVKG.js} +2 -2
  10. package/build/client/assets/{_layout-CunOyAg4.js.map → _layout-CDyeQVKG.js.map} +1 -1
  11. package/build/client/assets/_layout-mVyOtxmC.js +2 -0
  12. package/build/client/assets/_layout-mVyOtxmC.js.map +1 -0
  13. package/build/client/assets/{account-C96cpeZR.js → account-BKXMYhfO.js} +2 -2
  14. package/build/client/assets/{account-C96cpeZR.js.map → account-BKXMYhfO.js.map} +1 -1
  15. package/build/client/assets/{app-CJniokic.js → app-AWsnszeo.js} +2 -2
  16. package/build/client/assets/{app-CJniokic.js.map → app-AWsnszeo.js.map} +1 -1
  17. package/build/client/assets/{cache-CAr50MIB.js → cache-CxMFS2A_.js} +2 -2
  18. package/build/client/assets/{cache-CAr50MIB.js.map → cache-CxMFS2A_.js.map} +1 -1
  19. package/build/client/assets/{db-DAnX-T3_.js → db-BZ-tFzMp.js} +2 -2
  20. package/build/client/assets/{db-DAnX-T3_.js.map → db-BZ-tFzMp.js.map} +1 -1
  21. package/build/client/assets/{diff-D8TUonC2.js → diff-0VO9C_Sf.js} +2 -2
  22. package/build/client/assets/{diff-D8TUonC2.js.map → diff-0VO9C_Sf.js.map} +1 -1
  23. package/build/client/assets/{diff-Col_iM3X.js → diff-CC_jaH50.js} +2 -2
  24. package/build/client/assets/{diff-Col_iM3X.js.map → diff-CC_jaH50.js.map} +1 -1
  25. package/build/client/assets/discord-BVfxP4Rd.js +2 -0
  26. package/build/client/assets/discord-BVfxP4Rd.js.map +1 -0
  27. package/build/client/assets/{discord-BJkw0IrB.js → discord-XhHqPI49.js} +2 -2
  28. package/build/client/assets/{discord-BJkw0IrB.js.map → discord-XhHqPI49.js.map} +1 -1
  29. package/build/client/assets/{epic-video-BJW6MU1i.js → epic-video-D4jBdSKs.js} +2 -2
  30. package/build/client/assets/{epic-video-BJW6MU1i.js.map → epic-video-D4jBdSKs.js.map} +1 -1
  31. package/build/client/assets/{epic-video-jtxu_0bl.js → epic-video-Ddc9rYLT.js} +2 -2
  32. package/build/client/assets/{epic-video-jtxu_0bl.js.map → epic-video-Ddc9rYLT.js.map} +1 -1
  33. package/build/client/assets/{finished-C2jP5uE7.js → finished-BSfM_f4M.js} +2 -2
  34. package/build/client/assets/{finished-C2jP5uE7.js.map → finished-BSfM_f4M.js.map} +1 -1
  35. package/build/client/assets/{index-CdzVFL-Z.js → index-BrVvTrwg.js} +2 -2
  36. package/build/client/assets/{index-CdzVFL-Z.js.map → index-BrVvTrwg.js.map} +1 -1
  37. package/build/client/assets/{index-Dpyv8N6m.js → index-CfPaTqRT.js} +2 -2
  38. package/build/client/assets/{index-Dpyv8N6m.js.map → index-CfPaTqRT.js.map} +1 -1
  39. package/build/client/assets/{index-X8or9u7t.js → index-CuCZuiBp.js} +2 -2
  40. package/build/client/assets/{index-X8or9u7t.js.map → index-CuCZuiBp.js.map} +1 -1
  41. package/build/client/assets/{index-KRgoKRWG.js → index-D0vH1MiQ.js} +2 -2
  42. package/build/client/assets/{index-KRgoKRWG.js.map → index-D0vH1MiQ.js.map} +1 -1
  43. package/build/client/assets/{index-BCQgVrao.js → index-DTC_5pri.js} +2 -2
  44. package/build/client/assets/{index-BCQgVrao.js.map → index-DTC_5pri.js.map} +1 -1
  45. package/build/client/assets/{launch-editor-D2exGfVu.js → launch-editor-0oPpbFQe.js} +2 -2
  46. package/build/client/assets/{launch-editor-D2exGfVu.js.map → launch-editor-0oPpbFQe.js.map} +1 -1
  47. package/build/client/assets/{loading-CDNzW5oO.js → loading-CaCCsk9k.js} +2 -2
  48. package/build/client/assets/{loading-CDNzW5oO.js.map → loading-CaCCsk9k.js.map} +1 -1
  49. package/build/client/assets/{login-mWjVXGbJ.js → login-w4y7RVYa.js} +2 -2
  50. package/build/client/assets/{login-mWjVXGbJ.js.map → login-w4y7RVYa.js.map} +1 -1
  51. package/build/client/assets/{manifest-dd28a0e5.js → manifest-a63db2d2.js} +1 -1
  52. package/build/client/assets/{mdx-DdpoOTHm.js → mdx-DwvWT4Ou.js} +2 -2
  53. package/build/client/assets/{mdx-DdpoOTHm.js.map → mdx-DwvWT4Ou.js.map} +1 -1
  54. package/build/client/assets/{onboarding-indicator-B-XR90_G.js → onboarding-indicator-BkeHYs2C.js} +2 -2
  55. package/build/client/assets/{onboarding-indicator-B-XR90_G.js.map → onboarding-indicator-BkeHYs2C.js.map} +1 -1
  56. package/build/client/assets/{online-DiNLkgTC.js → online-DVk-W8Cr.js} +2 -2
  57. package/build/client/assets/{online-DiNLkgTC.js.map → online-DVk-W8Cr.js.map} +1 -1
  58. package/build/client/assets/{playground-DmEAkxG1.js → playground-DG4B62WX.js} +2 -2
  59. package/build/client/assets/{playground-DmEAkxG1.js.map → playground-DG4B62WX.js.map} +1 -1
  60. package/build/client/assets/{playground-window-x2mQ5o1O.js → playground-window-CF8lTXXI.js} +2 -2
  61. package/build/client/assets/{playground-window-x2mQ5o1O.js.map → playground-window-CF8lTXXI.js.map} +1 -1
  62. package/build/client/assets/{preferences-B7ND1VS9.js → preferences-Czy5oqWs.js} +2 -2
  63. package/build/client/assets/{preferences-B7ND1VS9.js.map → preferences-Czy5oqWs.js.map} +1 -1
  64. package/build/client/assets/{presence-VCvV2mg7.js → presence-Brtc_BN7.js} +2 -2
  65. package/build/client/assets/{presence-VCvV2mg7.js.map → presence-Brtc_BN7.js.map} +1 -1
  66. package/build/client/assets/{preview-fhmjENlm.js → preview-Be-plbPz.js} +2 -2
  67. package/build/client/assets/{preview-fhmjENlm.js.map → preview-Be-plbPz.js.map} +1 -1
  68. package/build/client/assets/{product-CvyMpYD_.js → product-D4IgPJN5.js} +2 -2
  69. package/build/client/assets/{product-CvyMpYD_.js.map → product-D4IgPJN5.js.map} +1 -1
  70. package/build/client/assets/{progress-Bby-ybMA.js → progress-JDMkfyr3.js} +2 -2
  71. package/build/client/assets/{progress-Bby-ybMA.js.map → progress-JDMkfyr3.js.map} +1 -1
  72. package/build/client/assets/{revalidation-ws-BJWJviUX.js → revalidation-ws-iocj9Mrl.js} +2 -2
  73. package/build/client/assets/{revalidation-ws-BJWJviUX.js.map → revalidation-ws-iocj9Mrl.js.map} +1 -1
  74. package/build/client/assets/{root-B-MkiU1r.js → root-IJJBVEoj.js} +2 -2
  75. package/build/client/assets/{root-B-MkiU1r.js.map → root-IJJBVEoj.js.map} +1 -1
  76. package/build/client/assets/{root-loader-BOzEMapJ.js → root-loader-BmUqzUDN.js} +2 -2
  77. package/build/client/assets/{root-loader-BOzEMapJ.js.map → root-loader-BmUqzUDN.js.map} +1 -1
  78. package/build/client/assets/{set-playground-BSGwH9dH.js → set-playground-DO5tJu4h.js} +2 -2
  79. package/build/client/assets/{set-playground-BSGwH9dH.js.map → set-playground-DO5tJu4h.js.map} +1 -1
  80. package/build/client/assets/{test-BeEphi7e.js → test-C8NrA0Ls.js} +2 -2
  81. package/build/client/assets/{test-BeEphi7e.js.map → test-C8NrA0Ls.js.map} +1 -1
  82. package/build/client/assets/{tests-RWSslYc0.js → tests-Bko6qhsh.js} +2 -2
  83. package/build/client/assets/{tests-RWSslYc0.js.map → tests-Bko6qhsh.js.map} +1 -1
  84. package/build/client/assets/{user-BsPobzjB.js → user-CYXKquT7.js} +2 -2
  85. package/build/client/assets/{user-BsPobzjB.js.map → user-CYXKquT7.js.map} +1 -1
  86. package/build/client/assets/{version-f8qqYbyU.js → version-CwWSRwe5.js} +2 -2
  87. package/build/client/assets/{version-f8qqYbyU.js.map → version-CwWSRwe5.js.map} +1 -1
  88. package/build/client/assets/{workshop-config-Zfc8zU0x.js → workshop-config-BMWaKPZT.js} +2 -2
  89. package/build/client/assets/{workshop-config-Zfc8zU0x.js.map → workshop-config-BMWaKPZT.js.map} +1 -1
  90. package/build/server/index.js +7 -3
  91. package/build/server/index.js.map +1 -1
  92. package/package.json +3 -3
  93. package/build/client/assets/_extra-Dki7HdFp.js +0 -2
  94. package/build/client/assets/_extra-Dki7HdFp.js.map +0 -1
  95. package/build/client/assets/_layout-DTrIGRDO.js +0 -2
  96. package/build/client/assets/_layout-DTrIGRDO.js.map +0 -1
  97. package/build/client/assets/discord-r3m19sUM.js +0 -2
  98. package/build/client/assets/discord-r3m19sUM.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{w as s,a as n,L as m}from"./chunk-EPOLDU6W-BCLmut3y.js";import{j as r}from"./jsx-runtime-C5WNSv3b.js";import{E as c}from"./index-CEVyDj51.js";import{E as l}from"./epic-video-BJW6MU1i.js";import{G as p}from"./error-boundary-DxHqAEHX.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-Bby-ybMA.js";import{M as f}from"./mdx-DdpoOTHm.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"./format-CZ5n8p10.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 U=({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},X=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(c,{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(m,{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"})]})]})}),Y=n(function(){return r.jsx(p,{className:"container flex items-center justify-center",statusHandlers:{404:h}})});export{Y as ErrorBoundary,X as default,U as meta};
2
- //# sourceMappingURL=_exerciseNumber-C1aZpAWV.js.map
1
+ import{w as s,a as n,L as m}from"./chunk-EPOLDU6W-BCLmut3y.js";import{j as r}from"./jsx-runtime-C5WNSv3b.js";import{E as c}from"./index-CEVyDj51.js";import{E as l}from"./epic-video-D4jBdSKs.js";import{G as p}from"./error-boundary-DxHqAEHX.js";import{u as a}from"./revalidation-ws-iocj9Mrl.js";import{E as x}from"./launch-editor-0oPpbFQe.js";import{P as u}from"./progress-JDMkfyr3.js";import{M as f}from"./mdx-DwvWT4Ou.js";import{g as d}from"./root-loader-BmUqzUDN.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-BrVvTrwg.js";import"./misc-W4055b-0.js";import"./tooltip-Tlsyx2YO.js";import"./pe-CIZUOJMr.js";import"./schemas-Uj5SZtvt.js";import"./online-DVk-W8Cr.js";import"./loading-CaCCsk9k.js";import"./format-CZ5n8p10.js";import"./user-CYXKquT7.js";import"./workshop-config-BMWaKPZT.js";import"./preload-helper-BXl3LOEh.js";import"./progress-bar-DpWhcyhC.js";import"./chunk-FNSCYPCZ-BHgC5cdx.js";import"./coerce-CkHW0SMv.js";const U=({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},X=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(c,{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(m,{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"})]})]})}),Y=n(function(){return r.jsx(p,{className:"container flex items-center justify-center",statusHandlers:{404:h}})});export{Y as ErrorBoundary,X as default,U as meta};
2
+ //# sourceMappingURL=_exerciseNumber-JuXb6JTN.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_exerciseNumber-C1aZpAWV.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":"qlCA6BO,MAAMA,EAA2BA,CAAC,CAAEC,WAAAA,EAAYC,QAAAA,CAAQ,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AC,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-JuXb6JTN.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":"qlCA6BO,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,EAEvC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ACrBC,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-BJW6MU1i.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{R as h}from"./retrieval-practice-BOku32wW.js";import{u}from"./revalidation-ws-BJWJviUX.js";import{E as b}from"./launch-editor-D2exGfVu.js";import{P as j}from"./progress-Bby-ybMA.js";import{u as g}from"./index-CdzVFL-Z.js";import{M as N}from"./mdx-DdpoOTHm.js";import{u as v}from"./online-DiNLkgTC.js";import{g as w}from"./root-loader-BOzEMapJ.js";import{g as E}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"./format-CZ5n8p10.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 re=({loaderData:s,matches:r})=>{const i=s?.exercise.exerciseNumber.toString().padStart(2,"0"),o=w(r);return!s||!o?[{title:"🦉 | Error"}]:E({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})},y={h1:()=>null},se=n(function({loaderData:r}){const i=r.exercise.exerciseNumber.toString().padStart(2,"0");return u({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.jsxs("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(N,{code:r.exercise.finishedCode,components:y})})}):"No finished instructions yet...",e.jsx(h,{exerciseNumber:r.exercise.exerciseNumber})]}),e.jsx(c,{elementQuery:`#${r.articleId}`}),e.jsx(j,{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(b,{file:r.exerciseFinished.file,relativePath:r.exerciseFinished.relativePath}),e.jsx(p,{prev:r.prevStepLink,next:r.nextStepLink})]})]}),e.jsx($,{exerciseFormEmbedUrl:r.exerciseFormEmbedUrl,exerciseTitle:r.exercise.title})]})})});function $({exerciseFormEmbedUrl:s,exerciseTitle:r}){const i=g(),[o,t]=m.useState(!1);return v()?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{se as default,re as meta};
2
- //# sourceMappingURL=_exerciseNumber_.finished-BICggZV1.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-D4jBdSKs.js";import{I as x,c as d}from"./misc-W4055b-0.js";import{L as f}from"./loading-CaCCsk9k.js";import{N as p}from"./nav-chevrons-Dk4GtZwQ.js";import{R as h}from"./retrieval-practice-BOku32wW.js";import{u}from"./revalidation-ws-iocj9Mrl.js";import{E as b}from"./launch-editor-0oPpbFQe.js";import{P as j}from"./progress-JDMkfyr3.js";import{u as g}from"./index-BrVvTrwg.js";import{M as N}from"./mdx-DwvWT4Ou.js";import{u as v}from"./online-DVk-W8Cr.js";import{g as w}from"./root-loader-BmUqzUDN.js";import{g as E}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"./format-CZ5n8p10.js";import"./user-CYXKquT7.js";import"./workshop-config-BMWaKPZT.js";import"./progress-bar-DpWhcyhC.js";import"./pe-CIZUOJMr.js";import"./preload-helper-BXl3LOEh.js";const re=({loaderData:s,matches:r})=>{const i=s?.exercise.exerciseNumber.toString().padStart(2,"0"),o=w(r);return!s||!o?[{title:"🦉 | Error"}]:E({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})},y={h1:()=>null},se=n(function({loaderData:r}){const i=r.exercise.exerciseNumber.toString().padStart(2,"0");return u({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.jsxs("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(N,{code:r.exercise.finishedCode,components:y})})}):"No finished instructions yet...",e.jsx(h,{exerciseNumber:r.exercise.exerciseNumber})]}),e.jsx(c,{elementQuery:`#${r.articleId}`}),e.jsx(j,{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(b,{file:r.exerciseFinished.file,relativePath:r.exerciseFinished.relativePath}),e.jsx(p,{prev:r.prevStepLink,next:r.nextStepLink})]})]}),e.jsx($,{exerciseFormEmbedUrl:r.exerciseFormEmbedUrl,exerciseTitle:r.exercise.title})]})})});function $({exerciseFormEmbedUrl:s,exerciseTitle:r}){const i=g(),[o,t]=m.useState(!1);return v()?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{se as default,re as meta};
2
+ //# sourceMappingURL=_exerciseNumber_.finished-DD-1txyR.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_exerciseNumber_.finished-BICggZV1.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 { RetrievalPractice } from '#app/components/retrieval-practice.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\t<RetrievalPractice exerciseNumber={data.exercise.exerciseNumber} />\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","RetrievalPractice","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":"4kCAqCO,MAAMA,GAA2BA,CAAC,CAAEC,WAAAA,EAAYC,QAAAA,CAAQ,IAAM,CACpE,MAAMC,EAASF,GAAYG,SAASC,eAAeC,WAAWC,SAAS,EAAG,GAAG,EAEvEC,EAAWC,EAAuBP,CAAO,EAC/C,MAAI,C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,EAC/C,EACD,EAED3B,EAAAA,IAAC,SAAA,CACAmC,OAAQA,IAAMJ,EAAgB,EAAI,EAElCK,QAASA,IAAML,EAAgB,EAAI,EACnClD,MAAM,cACNwD,IAAKX,EACL7B,UAAWyC,EACV,sEACAR,EAAe,cAAgB,WAChC,EACAS,MAAO,CAAEC,YAAaZ,CAAM,CAAA,CAC7B,CAAA,CAAA,CACD,EApCC5B,EAAAA,IAAC,MAAA,CAAIH,UAAU,oBACdC,eAAC,MAAA,CAAID,UAAU,kGACdC,SAAAE,EAAAA,IAACyC,GAAKC,KAAK,mBAAmBC,KAAK,KAClC7C,gBAAC,OAAA,CACCA,SAAA,CAAA,sBACDE,EAAAA,IAAC,KAAE4C,KAAMlB,EAAsB7B,UAAU,YACvCC,SAAA,GAAG6B,CAAa,iBAClB,EACC,eAAA,EACF,EACD,EACD,CAAA,CACD,CA0BH"}
1
+ {"version":3,"file":"_exerciseNumber_.finished-DD-1txyR.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 { RetrievalPractice } from '#app/components/retrieval-practice.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\t<RetrievalPractice exerciseNumber={data.exercise.exerciseNumber} />\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","RetrievalPractice","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":"4kCAqCO,MAAMA,GAA2BA,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,GAAAC,EAAA,SAAyC,CACxCrB,WAAYsB,CACb,EAAyB,CACxB,MAAMlB,EAAiBkB,EAAKnB,SAASC,eACnCC,WAC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AG6B,CAAa,iBAClB,EACC,eAAA,EACF,EACD,EACD,CAAA,CACD,CA0BH"}
@@ -0,0 +1,2 @@
1
+ import{w as T,a as k,b as A,d as $,L as l}from"./chunk-EPOLDU6W-BCLmut3y.js";import{j as e}from"./jsx-runtime-C5WNSv3b.js";import{E as B}from"./index-CEVyDj51.js";import{g as L,R as M,P as H,C as n,a as O,D as U}from"./playground-DG4B62WX.js";import{r as i}from"./index-CqIc3cxq.js";import{U as V}from"./diff-CC_jaH50.js";import{E as z}from"./epic-video-D4jBdSKs.js";import{G as X}from"./error-boundary-DxHqAEHX.js";import{N as F}from"./nav-chevrons-Dk4GtZwQ.js";import{u as G}from"./revalidation-ws-iocj9Mrl.js";import{u as W}from"./workshop-config-BMWaKPZT.js";import{P as q}from"./preview-Be-plbPz.js";import{E as Y}from"./launch-editor-0oPpbFQe.js";import{S as _}from"./set-playground-DO5tJu4h.js";import{c as Q,M as J}from"./mdx-DwvWT4Ou.js";import{g as K,u as Z,a as ee}from"./root-loader-BmUqzUDN.js";import{g as re}from"./seo-t5J-DRxw.js";import{s as w,a as te}from"./split-layout-DnRER1bP.js";import"./misc-W4055b-0.js";import"./loading-CaCCsk9k.js";import"./index-BrVvTrwg.js";import"./tooltip-Tlsyx2YO.js";import"./index-vDCSPjrM.js";import"./pe-CIZUOJMr.js";import"./schemas-Uj5SZtvt.js";import"./discord-XhHqPI49.js";import"./user-CYXKquT7.js";import"./online-DVk-W8Cr.js";import"./index-CJDOQ1bl.js";import"./index-ynYvVAOK.js";import"./status-indicator-C6DiLYL5.js";import"./index-DzdDahau.js";import"./playground-window-CF8lTXXI.js";import"./accordion-CQ7oujC6.js";import"./use-event-source-BuD4_2SF.js";import"./format-CZ5n8p10.js";import"./preload-helper-BXl3LOEh.js";import"./button-Cd-ekki5.js";import"./progress-bar-DpWhcyhC.js";import"./onboarding-indicator-BkeHYs2C.js";import"./dialog-CzO65Z5w.js";const Fe=o=>{const r=o.data,s=K(o.matches);return!r||!s?[{title:"🦉 | Error"}]:re({title:`📚 | ${r.extra.title} | ${s.workshopTitle}`,description:`Extra: ${r.extra.title}`,ogTitle:r.extra.title,ogDescription:`Extra: ${r.extra.title}`,instructor:s.instructor,requestInfo:s.requestInfo})},Ge=T(function(){const r=A(),s=Z(),g=ee(),h=i.useRef(null),c=i.useRef(null),P=i.useRef(null),[b,d]=i.useState(r.splitPercent),[j]=$(),y=W(),N=i.useMemo(()=>Promise.resolve(s.userHasAccess??!1),[s.userHasAccess]),v=r.playground?.appName!==r.extra.name,E=v||r.playground?.isUpToDate===!1,m=["playground","extra","diff","chat"],p=j.get("preview"),x=r.previousExtra?{to:`/extra/${r.previousExtra.dirName}`,"aria-label":"Previous Extra"}:{to:"/extra","aria-label":"Extras"},u=r.nextExtra?{to:`/extra/${r.nextExtra.dirName}`,"aria-label":"Next Extra"}:{to:"/finished","aria-label":"Workshop finished"};function D(t){return!!(t&&m.includes(t))}function f(t){if(t==="playground")return ENV.EPICSHOP_DEPLOYED;if(t==="extra"&&ENV.EPICSHOP_DEPLOYED){const a=r.extra.dev.type;return a!=="browser"&&a!=="export"&&!r.extra.stackBlitzUrl}return t==="chat"?!y.product.discordChannelId:!1}const C=D(p)&&!f(p)?p:m.find(t=>!f(t))??"playground",I=m.map(t=>{const a=f(t);return{id:t,label:t,hidden:a,to:`?${L(j,t,"playground")}`}}),R=i.useMemo(()=>{const t=Q(()=>({name:r.extra.name,fullPath:r.extra.fullPath}));return{h1:()=>null,InlineFile:t}},[r.extra.name,r.extra.fullPath]),S=g.find(t=>t.name===r.playground?.appName)?.fullPath;return G({watchPaths:[r.extraReadme.file,S].filter(t=>!!t)}),e.jsx("div",{className:"flex max-w-full grow flex-col",children:e.jsxs("main",{ref:c,className:"flex grow flex-col sm:h-full sm:min-h-[800px] md:min-h-[unset] lg:flex-row",children:[e.jsxs("div",{className:"relative flex min-w-0 flex-none basis-full flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:basis-(--split-pct)",style:{"--split-pct":`${b}%`},ref:P,children:[e.jsx("h1",{className:"@container h-14 border-b pr-5 pl-10 text-sm leading-tight font-medium",children:e.jsxs("div",{className:"flex h-14 items-center justify-between gap-x-2 py-2 whitespace-nowrap",children:[e.jsxs("div",{className:"flex items-center justify-start gap-x-2 uppercase",children:[e.jsx(l,{to:"/extra",className:"hover:underline",children:e.jsx("span",{children:"Extras"})}),e.jsx("span",{children:"/"}),e.jsx(l,{to:".",className:"hover:underline",children:e.jsx("span",{children:r.extra.title})})]}),E?e.jsx(_,{appName:r.extra.name,isOutdated:r.playground?.isUpToDate===!1,hideTextOnNarrow:!0,showOnboardingIndicator:v}):null]})}),e.jsxs("article",{id:r.articleId,className:"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar flex h-full w-full max-w-none flex-1 scroll-pt-6 flex-col justify-between space-y-6 overflow-y-auto p-2 sm:p-10 sm:pt-8",children:[r.extra.instructionsCode?e.jsx(z,{epicVideoInfosPromise:r.epicVideoInfosPromise,children:e.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:e.jsx(J,{code:r.extra.instructionsCode,components:R})})}):e.jsx("div",{className:"flex h-full items-center justify-center text-lg",children:e.jsx("p",{children:"No instructions yet..."})}),e.jsxs("div",{className:"mt-auto flex justify-between",children:[e.jsxs(l,{to:x.to,"aria-label":x["aria-label"],prefetch:"intent",children:[e.jsx("span",{"aria-hidden":!0,children:"←"}),e.jsx("span",{className:"hidden xl:inline",children:" Previous"})]}),e.jsxs(l,{to:u.to,"aria-label":u["aria-label"],prefetch:"intent",children:[e.jsx("span",{className:"hidden xl:inline",children:"Next "}),e.jsx("span",{"aria-hidden":!0,children:"→"})]})]})]},r.articleId),e.jsx(B,{elementQuery:`#${r.articleId}`},`scroll-${r.articleId}`),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(Y,{appName:r.extra.name,relativePath:r.extraReadme.relativePath}),e.jsx(F,{prev:x,next:u})]})]}),e.jsx("div",{role:"separator","aria-orientation":"vertical",title:"Drag to resize",className:"bg-border hover:bg-muted hidden w-1 cursor-col-resize lg:block",onMouseDown:t=>w({container:c.current,initialClientX:t.clientX,setSplitPercent:d}),onDoubleClick:()=>{d(te(50))},onTouchStart:t=>{const a=t.touches?.[0];a&&w({container:c.current,initialClientX:a.clientX,setSplitPercent:d})}}),e.jsxs(M,{className:"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",value:C,children:[e.jsx(H,{tabs:I}),e.jsxs("div",{className:"relative z-10 flex min-h-0 flex-1 flex-col overflow-hidden",children:[e.jsx(n,{value:"playground",className:"radix-state-inactive:hidden flex min-h-0 w-full grow basis-0 items-stretch justify-center self-start",forceMount:!0,children:e.jsx(O,{appInfo:r.playground,problemAppName:r.extra.name,allApps:r.allApps??[],isUpToDate:r.playground?.isUpToDate??!1,inBrowserBrowserRef:h})}),e.jsx(n,{value:"extra",className:"radix-state-inactive:hidden flex min-h-0 w-full grow basis-0 items-stretch justify-center self-start",forceMount:!0,children:e.jsx(q,{appInfo:r.extra,inBrowserBrowserRef:h})}),e.jsx(n,{value:"diff",className:"radix-state-inactive:hidden flex h-full min-h-0 w-full grow basis-0 items-stretch justify-center self-start",children:e.jsx(V,{diff:r.diff,allApps:r.allApps,userHasAccessPromise:N})}),e.jsx(n,{value:"chat",className:"radix-state-inactive:hidden flex h-full min-h-0 w-full grow basis-0 items-stretch justify-center self-start",children:e.jsx(U,{discordPostsPromise:r.discordPostsPromise})})]})]})]})})}),We=k(function(){return e.jsx(X,{})});export{We as ErrorBoundary,Ge as default,Fe as meta};
2
+ //# sourceMappingURL=_extra-BfK-kKBL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_extra-BfK-kKBL.js","sources":["../../../app/routes/_app+/extra+/$extra.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetAppByName,\n\tgetAppDisplayName,\n\tgetApps,\n\tisExtraApp,\n\tisPlaygroundApp,\n\ttype ExtraApp,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getDiffCode } from '@epic-web/workshop-utils/diff.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 * as Tabs from '@radix-ui/react-tabs'\nimport slugify from '@sindresorhus/slugify'\nimport { useMemo, useRef, useState } from 'react'\nimport {\n\tLink,\n\tdata,\n\ttype HeadersFunction,\n\ttype LoaderFunctionArgs,\n\ttype MetaFunction,\n\tuseLoaderData,\n\tuseSearchParams,\n} from 'react-router'\nimport { Diff } from '#app/components/diff.tsx'\nimport { DiscordChat } from '#app/components/discord-chat.tsx'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { GeneralErrorBoundary } from '#app/components/error-boundary.tsx'\nimport { type InBrowserBrowserRef } from '#app/components/in-browser-browser.tsx'\nimport { NavChevrons } from '#app/components/nav-chevrons.tsx'\nimport {\n\tgetPreviewSearchParams,\n\tPreviewTabsList,\n} from '#app/components/preview-tabs.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.tsx'\nimport { useWorkshopConfig } from '#app/components/workshop-config.tsx'\nimport { Playground } from '#app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/__shared/playground.tsx'\nimport { Preview } from '#app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/__shared/preview.tsx'\nimport { getAppRunningState } from '#app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.$type+/__shared/utils.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { SetAppToPlayground } from '#app/routes/set-playground.tsx'\nimport { fetchDiscordPosts } from '#app/utils/discord.server.ts'\nimport { createInlineFileComponent, Mdx } from '#app/utils/mdx.tsx'\nimport {\n\tgetRootMatchLoaderData,\n\tuseApps,\n\tuseRootLoaderData,\n} from '#app/utils/root-loader.ts'\nimport { getSeoMetaTags } from '#app/utils/seo.ts'\nimport {\n\tgetSplitPercentFromRequest,\n\tsetSplitPercentCookie,\n\tstartSplitDrag,\n} from '#app/utils/split-layout.ts'\n\nfunction sortExtras(extras: ExtraApp[]) {\n\treturn extras.sort((a, b) =>\n\t\ta.title.localeCompare(b.title, undefined, {\n\t\t\tnumeric: true,\n\t\t\tsensitivity: 'base',\n\t\t}),\n\t)\n}\n\nexport const meta: MetaFunction<typeof loader> = (args) => {\n\tconst loaderData = args.data\n\tconst rootData = getRootMatchLoaderData(args.matches)\n\tif (!loaderData || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `📚 | ${loaderData.extra.title} | ${rootData.workshopTitle}`,\n\t\tdescription: `Extra: ${loaderData.extra.title}`,\n\t\togTitle: loaderData.extra.title,\n\t\togDescription: `Extra: ${loaderData.extra.title}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: LoaderFunctionArgs) {\n\tconst timings = makeTimings('extraLoader')\n\tinvariantResponse(params.extra, 'extra is required')\n\n\tconst { title: workshopTitle } = getWorkshopConfig()\n\tconst cacheOptions = { request, timings }\n\tconst apps = await time(() => getApps(cacheOptions), {\n\t\ttimings,\n\t\ttype: 'getApps',\n\t\tdesc: 'getApps in extra loader',\n\t})\n\tconst extras = sortExtras(apps.filter(isExtraApp))\n\tconst playgroundApp = apps.find(isPlaygroundApp)\n\tconst extraIndex = extras.findIndex((extra) => extra.dirName === params.extra)\n\tconst extra = extras[extraIndex]\n\tif (!extra) {\n\t\tthrow new Response('Extra not found', { status: 404 })\n\t}\n\n\tconst readmeFilepath = path.join(extra.fullPath, 'README.mdx')\n\tconst previousExtra = extras[extraIndex - 1]\n\tconst nextExtra = extras[extraIndex + 1]\n\tconst reqUrl = new URL(request.url)\n\tconst app1Name = reqUrl.searchParams.get('app1')\n\tconst app2Name = reqUrl.searchParams.get('app2')\n\tconst app1 = app1Name\n\t\t? await getAppByName(app1Name)\n\t\t: (playgroundApp ?? extra)\n\tconst app2 = app2Name ? await getAppByName(app2Name) : extra\n\tconst splitPercent = getSplitPercentFromRequest(request, 50)\n\n\tconst { isRunning, portIsAvailable } = await getAppRunningState(extra)\n\n\tasync function getDiffProp() {\n\t\tif (!app1 || !app2) {\n\t\t\treturn { app1: app1?.name, app2: app2?.name, diffCode: null }\n\t\t}\n\t\tconst diffCode = await getDiffCode(app1, app2, {\n\t\t\t...cacheOptions,\n\t\t\tforceFresh: reqUrl.searchParams.get('forceFresh') === 'diff',\n\t\t}).catch((error) => {\n\t\t\tconsole.error(error)\n\t\t\treturn null\n\t\t})\n\t\treturn {\n\t\t\tapp1: app1.name,\n\t\t\tapp2: app2.name,\n\t\t\tdiffCode,\n\t\t}\n\t}\n\n\tconst allApps = apps\n\t\t.filter(\n\t\t\t(app, index, list) =>\n\t\t\t\tlist.findIndex((item) => item.name === app.name) === index,\n\t\t)\n\t\t.map((app) => ({\n\t\t\tname: app.name,\n\t\t\tdisplayName: getAppDisplayName(app, apps),\n\t\t}))\n\t\t.sort((a, b) =>\n\t\t\ta.displayName.localeCompare(b.displayName, undefined, {\n\t\t\t\tnumeric: true,\n\t\t\t\tsensitivity: 'base',\n\t\t\t}),\n\t\t)\n\n\treturn data(\n\t\t{\n\t\t\tarticleId: `workshop-${slugify(workshopTitle)}-${slugify(\n\t\t\t\textra.title,\n\t\t\t)}-extra`,\n\t\t\tsplitPercent,\n\t\t\textra: {\n\t\t\t\ttype: 'extra',\n\t\t\t\tname: extra.name,\n\t\t\t\ttitle: extra.title,\n\t\t\t\tdirName: extra.dirName,\n\t\t\t\tfullPath: extra.fullPath,\n\t\t\t\trelativePath: extra.relativePath,\n\t\t\t\tdev: extra.dev,\n\t\t\t\ttest: extra.test,\n\t\t\t\tstackBlitzUrl: extra.stackBlitzUrl,\n\t\t\t\tisRunning,\n\t\t\t\tportIsAvailable,\n\t\t\t\tepicVideoEmbeds: extra.epicVideoEmbeds,\n\t\t\t\tinstructionsCode: extra.instructionsCode,\n\t\t\t},\n\t\t\textraReadme: {\n\t\t\t\tfile: readmeFilepath,\n\t\t\t\trelativePath: path.join(extra.relativePath, 'README.mdx'),\n\t\t\t},\n\t\t\tplayground: playgroundApp\n\t\t\t\t? ({\n\t\t\t\t\t\ttype: 'playground',\n\t\t\t\t\t\tappName: playgroundApp.appName,\n\t\t\t\t\t\tname: playgroundApp.name,\n\t\t\t\t\t\ttitle: playgroundApp.title,\n\t\t\t\t\t\tfullPath: playgroundApp.fullPath,\n\t\t\t\t\t\tdev: playgroundApp.dev,\n\t\t\t\t\t\ttest: playgroundApp.test,\n\t\t\t\t\t\tstackBlitzUrl: playgroundApp.stackBlitzUrl,\n\t\t\t\t\t\tisUpToDate: playgroundApp.isUpToDate,\n\t\t\t\t\t\t...(await getAppRunningState(playgroundApp)),\n\t\t\t\t\t} as const)\n\t\t\t\t: null,\n\t\t\tallApps,\n\t\t\tdiff: getDiffProp(),\n\t\t\tdiscordPostsPromise: fetchDiscordPosts({ request }),\n\t\t\tpreviousExtra: previousExtra\n\t\t\t\t? { dirName: previousExtra.dirName, title: previousExtra.title }\n\t\t\t\t: null,\n\t\t\tnextExtra: nextExtra\n\t\t\t\t? { dirName: nextExtra.dirName, title: nextExtra.title }\n\t\t\t\t: null,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(extra.epicVideoEmbeds, {\n\t\t\t\trequest,\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\nexport default function ExtraRoute() {\n\tconst data = useLoaderData<typeof loader>()\n\tconst rootData = useRootLoaderData()\n\tconst apps = useApps()\n\tconst inBrowserBrowserRef = useRef<InBrowserBrowserRef>(null)\n\tconst containerRef = useRef<HTMLDivElement>(null)\n\tconst leftPaneRef = useRef<HTMLDivElement>(null)\n\tconst [splitPercent, setSplitPercent] = useState<number>(data.splitPercent)\n\tconst [searchParams] = useSearchParams()\n\tconst workshopConfig = useWorkshopConfig()\n\tconst userHasAccessPromise = useMemo(\n\t\t() => Promise.resolve(rootData.userHasAccess ?? false),\n\t\t[rootData.userHasAccess],\n\t)\n\tconst showPlaygroundIndicator = data.playground?.appName !== data.extra.name\n\tconst shouldShowSetPlayground =\n\t\tshowPlaygroundIndicator || data.playground?.isUpToDate === false\n\tconst tabs = ['playground', 'extra', 'diff', 'chat'] as const\n\tconst preview = searchParams.get('preview')\n\tconst previousExtraLink = data.previousExtra\n\t\t? {\n\t\t\t\tto: `/extra/${data.previousExtra.dirName}`,\n\t\t\t\t'aria-label': 'Previous Extra',\n\t\t\t}\n\t\t: {\n\t\t\t\tto: '/extra',\n\t\t\t\t'aria-label': 'Extras',\n\t\t\t}\n\tconst nextExtraLink = data.nextExtra\n\t\t? {\n\t\t\t\tto: `/extra/${data.nextExtra.dirName}`,\n\t\t\t\t'aria-label': 'Next Extra',\n\t\t\t}\n\t\t: {\n\t\t\t\tto: '/finished',\n\t\t\t\t'aria-label': 'Workshop finished',\n\t\t\t}\n\n\tfunction isValidPreview(\n\t\tvalue: string | null,\n\t): value is (typeof tabs)[number] {\n\t\treturn Boolean(value && tabs.includes(value as (typeof tabs)[number]))\n\t}\n\n\tfunction shouldHideTab(tab: (typeof tabs)[number]) {\n\t\tif (tab === 'playground') {\n\t\t\treturn ENV.EPICSHOP_DEPLOYED\n\t\t}\n\t\tif (tab === 'extra') {\n\t\t\tif (ENV.EPICSHOP_DEPLOYED) {\n\t\t\t\tconst devType = data.extra.dev.type\n\t\t\t\treturn (\n\t\t\t\t\tdevType !== 'browser' &&\n\t\t\t\t\tdevType !== 'export' &&\n\t\t\t\t\t!data.extra.stackBlitzUrl\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\tif (tab === 'chat') {\n\t\t\treturn !workshopConfig.product.discordChannelId\n\t\t}\n\t\treturn false\n\t}\n\n\tconst activeTab =\n\t\tisValidPreview(preview) && !shouldHideTab(preview)\n\t\t\t? preview\n\t\t\t: (tabs.find((tab) => !shouldHideTab(tab)) ?? 'playground')\n\n\tconst previewTabs = tabs.map((tab) => {\n\t\tconst hidden = shouldHideTab(tab)\n\t\treturn {\n\t\t\tid: tab,\n\t\t\tlabel: tab,\n\t\t\thidden,\n\t\t\tto: `?${getPreviewSearchParams(searchParams, tab, 'playground')}`,\n\t\t}\n\t})\n\n\t// Create MDX components with extra-specific InlineFile\n\tconst mdxComponents = useMemo(() => {\n\t\tconst InlineFile = createInlineFileComponent(() => ({\n\t\t\tname: data.extra.name,\n\t\t\tfullPath: data.extra.fullPath,\n\t\t}))\n\t\treturn {\n\t\t\t// we'll render the title ourselves thank you\n\t\t\th1: () => null,\n\t\t\tInlineFile,\n\t\t}\n\t}, [data.extra.name, data.extra.fullPath])\n\n\tconst playgroundBasePath = apps.find(\n\t\t(app) => app.name === data.playground?.appName,\n\t)?.fullPath\n\n\tuseRevalidationWS({\n\t\twatchPaths: [data.extraReadme.file, playgroundBasePath].filter(\n\t\t\t(path): path is string => Boolean(path),\n\t\t),\n\t})\n\n\treturn (\n\t\t<div className=\"flex max-w-full grow flex-col\">\n\t\t\t<main\n\t\t\t\tref={containerRef}\n\t\t\t\tclassName=\"flex grow flex-col sm:h-full sm:min-h-[800px] md:min-h-[unset] lg:flex-row\"\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"relative flex min-w-0 flex-none basis-full flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:basis-(--split-pct)\"\n\t\t\t\t\tstyle={{ ['--split-pct' as any]: `${splitPercent}%` }}\n\t\t\t\t\tref={leftPaneRef}\n\t\t\t\t>\n\t\t\t\t\t<h1 className=\"@container 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 items-center justify-between gap-x-2 py-2 whitespace-nowrap\">\n\t\t\t\t\t\t\t<div className=\"flex items-center justify-start gap-x-2 uppercase\">\n\t\t\t\t\t\t\t\t<Link to=\"/extra\" className=\"hover:underline\">\n\t\t\t\t\t\t\t\t\t<span>Extras</span>\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<Link to=\".\" className=\"hover:underline\">\n\t\t\t\t\t\t\t\t\t<span>{data.extra.title}</span>\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{shouldShowSetPlayground ? (\n\t\t\t\t\t\t\t\t<SetAppToPlayground\n\t\t\t\t\t\t\t\t\tappName={data.extra.name}\n\t\t\t\t\t\t\t\t\tisOutdated={data.playground?.isUpToDate === false}\n\t\t\t\t\t\t\t\t\thideTextOnNarrow\n\t\t\t\t\t\t\t\t\tshowOnboardingIndicator={showPlaygroundIndicator}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</h1>\n\t\t\t\t\t<article\n\t\t\t\t\t\tid={data.articleId}\n\t\t\t\t\t\tkey={data.articleId}\n\t\t\t\t\t\tclassName=\"shadow-on-scrollbox scrollbar-thin scrollbar-thumb-scrollbar flex h-full w-full max-w-none flex-1 scroll-pt-6 flex-col justify-between space-y-6 overflow-y-auto p-2 sm:p-10 sm:pt-8\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{data.extra.instructionsCode ? (\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.extra.instructionsCode}\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<div className=\"flex h-full items-center justify-center text-lg\">\n\t\t\t\t\t\t\t\t<p>No instructions yet...</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<div className=\"mt-auto flex justify-between\">\n\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\tto={previousExtraLink.to}\n\t\t\t\t\t\t\t\taria-label={previousExtraLink['aria-label']}\n\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span aria-hidden>←</span>\n\t\t\t\t\t\t\t\t<span className=\"hidden xl:inline\"> Previous</span>\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\tto={nextExtraLink.to}\n\t\t\t\t\t\t\t\taria-label={nextExtraLink['aria-label']}\n\t\t\t\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span className=\"hidden xl:inline\">Next </span>\n\t\t\t\t\t\t\t\t<span aria-hidden>→</span>\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</article>\n\t\t\t\t\t<ElementScrollRestoration\n\t\t\t\t\t\telementQuery={`#${data.articleId}`}\n\t\t\t\t\t\tkey={`scroll-${data.articleId}`}\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\tappName={data.extra.name}\n\t\t\t\t\t\t\trelativePath={data.extraReadme.relativePath}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NavChevrons prev={previousExtraLink} next={nextExtraLink} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\trole=\"separator\"\n\t\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\t\ttitle=\"Drag to resize\"\n\t\t\t\t\tclassName=\"bg-border hover:bg-muted hidden w-1 cursor-col-resize lg:block\"\n\t\t\t\t\tonMouseDown={(event) =>\n\t\t\t\t\t\tstartSplitDrag({\n\t\t\t\t\t\t\tcontainer: containerRef.current,\n\t\t\t\t\t\t\tinitialClientX: event.clientX,\n\t\t\t\t\t\t\tsetSplitPercent,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tonDoubleClick={() => {\n\t\t\t\t\t\tsetSplitPercent(setSplitPercentCookie(50))\n\t\t\t\t\t}}\n\t\t\t\t\tonTouchStart={(event) => {\n\t\t\t\t\t\tconst firstTouch = event.touches?.[0]\n\t\t\t\t\t\tif (!firstTouch) return\n\t\t\t\t\t\tstartSplitDrag({\n\t\t\t\t\t\t\tcontainer: containerRef.current,\n\t\t\t\t\t\t\tinitialClientX: firstTouch.clientX,\n\t\t\t\t\t\t\tsetSplitPercent,\n\t\t\t\t\t\t})\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<Tabs.Root\n\t\t\t\t\tclassName=\"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden\"\n\t\t\t\t\tvalue={activeTab}\n\t\t\t\t>\n\t\t\t\t\t<PreviewTabsList tabs={previewTabs} />\n\t\t\t\t\t<div className=\"relative z-10 flex min-h-0 flex-1 flex-col overflow-hidden\">\n\t\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\t\tvalue=\"playground\"\n\t\t\t\t\t\t\tclassName=\"radix-state-inactive:hidden flex min-h-0 w-full grow basis-0 items-stretch justify-center self-start\"\n\t\t\t\t\t\t\tforceMount\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Playground\n\t\t\t\t\t\t\t\tappInfo={data.playground}\n\t\t\t\t\t\t\t\tproblemAppName={data.extra.name}\n\t\t\t\t\t\t\t\tallApps={data.allApps ?? []}\n\t\t\t\t\t\t\t\tisUpToDate={data.playground?.isUpToDate ?? false}\n\t\t\t\t\t\t\t\tinBrowserBrowserRef={inBrowserBrowserRef}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tabs.Content>\n\t\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\t\tvalue=\"extra\"\n\t\t\t\t\t\t\tclassName=\"radix-state-inactive:hidden flex min-h-0 w-full grow basis-0 items-stretch justify-center self-start\"\n\t\t\t\t\t\t\tforceMount\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Preview\n\t\t\t\t\t\t\t\tappInfo={data.extra}\n\t\t\t\t\t\t\t\tinBrowserBrowserRef={inBrowserBrowserRef}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tabs.Content>\n\t\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\t\tvalue=\"diff\"\n\t\t\t\t\t\t\tclassName=\"radix-state-inactive:hidden flex h-full min-h-0 w-full grow basis-0 items-stretch justify-center self-start\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Diff\n\t\t\t\t\t\t\t\tdiff={data.diff}\n\t\t\t\t\t\t\t\tallApps={data.allApps}\n\t\t\t\t\t\t\t\tuserHasAccessPromise={userHasAccessPromise}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tabs.Content>\n\t\t\t\t\t\t<Tabs.Content\n\t\t\t\t\t\t\tvalue=\"chat\"\n\t\t\t\t\t\t\tclassName=\"radix-state-inactive:hidden flex h-full min-h-0 w-full grow basis-0 items-stretch justify-center self-start\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<DiscordChat discordPostsPromise={data.discordPostsPromise} />\n\t\t\t\t\t\t</Tabs.Content>\n\t\t\t\t\t</div>\n\t\t\t\t</Tabs.Root>\n\t\t\t</main>\n\t\t</div>\n\t)\n}\n\nexport function ErrorBoundary() {\n\treturn <GeneralErrorBoundary />\n}\n"],"names":["meta","args","loaderData","data","rootData","getRootMatchLoaderData","matches","title","getSeoMetaTags","extra","workshopTitle","description","ogTitle","ogDescription","instructor","requestInfo","$extra","_UNSAFE_withComponentProps","useLoaderData","useRootLoaderData","apps","useApps","inBrowserBrowserRef","useRef","containerRef","leftPaneRef","splitPercent","setSplitPercent","useState","searchParams","useSearchParams","workshopConfig","useWorkshopConfig","userHasAccessPromise","useMemo","Promise","resolve","userHasAccess","showPlaygroundIndicator","playground","appName","name","shouldShowSetPlayground","isUpToDate","tabs","preview","get","previousExtraLink","previousExtra","to","dirName","nextExtraLink","nextExtra","isValidPreview","value","Boolean","includes","shouldHideTab","tab","ENV","EPICSHOP_DEPLOYED","devType","dev","type","stackBlitzUrl","product","discordChannelId","activeTab","find","previewTabs","map","hidden","id","label","getPreviewSearchParams","mdxComponents","InlineFile","createInlineFileComponent","fullPath","h1","playgroundBasePath","app","useRevalidationWS","watchPaths","extraReadme","file","filter","path","jsx","className","children","jsxs","ref","style","Link","SetAppToPlayground","isOutdated","hideTextOnNarrow","showOnboardingIndicator","articleId","instructionsCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","prefetch","ElementScrollRestoration","elementQuery","EditFileOnGitHub","relativePath","NavChevrons","prev","next","role","onMouseDown","event","startSplitDrag","container","current","initialClientX","clientX","onDoubleClick","setSplitPercentCookie","onTouchStart","firstTouch","touches","Tabs","PreviewTabsList","forceMount","Playground","appInfo","problemAppName","allApps","Preview","Diff","diff","DiscordChat","discordPostsPromise","ErrorBoundary","_UNSAFE_withErrorBoundaryProps","GeneralErrorBoundary"],"mappings":"slDAwEO,MAAMA,GAAqCC,GAAS,CAC1D,MAAMC,EAAaD,EAAKE,KA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"./jsx-runtime-C5WNSv3b.js";import{c as f,b as Fe,I as g,a as x,n as R,o as D}from"./misc-W4055b-0.js";import{r as p}from"./index-CqIc3cxq.js";import{a as We}from"./pe-CIZUOJMr.js";import{u as ce,O as K}from"./onboarding-indicator-B-XR90_G.js";import{L as te}from"./product-CvyMpYD_.js";import{u as qe}from"./revalidation-ws-BJWJviUX.js";import{S as q}from"./status-indicator-C6DiLYL5.js";import{D as Oe,f as Qe,a as Ke,b as Je,d as Ge}from"./dialog-CzO65Z5w.js";import{R as Xe,T as Ze,P as Me,C as et}from"./index-CmflCPTU.js";import{S as y,m as tt,T as se,j as ne,k as re}from"./tooltip-Tlsyx2YO.js";import{c as X,b as st}from"./user-BsPobzjB.js";import{u as ve}from"./workshop-config-Zfc8zU0x.js";import{u as de}from"./online-DiNLkgTC.js";import{u as ue,g as we,p as nt}from"./presence-VCvV2mg7.js";import{b as Ne,a as ye}from"./root-loader-BOzEMapJ.js";import{b as rt,s as Ee,c as at,d as ot,e as ke,f as Pe,m,u as lt,g as it}from"./progress-Bby-ybMA.js";import{T as J}from"./index-CdzVFL-Z.js";import"./schemas-Uj5SZtvt.js";import"./index-ynYvVAOK.js";import"./index-vDCSPjrM.js";import"./coerce-CkHW0SMv.js";function ct(t){t.values.forEach(n=>n.stop())}function oe(t,n){[...n].reverse().forEach(s=>{const i=t.getVariant(s);i&&Ee(t,i),t.variantChildren&&t.variantChildren.forEach(a=>{oe(a,n)})})}function dt(t,n){if(Array.isArray(n))return oe(t,n);if(typeof n=="string")return oe(t,[n]);Ee(t,n)}function ut(){const t=new Set,n={subscribe(r){return t.add(r),()=>void t.delete(r)},start(r,s){const i=[];return t.forEach(a=>{i.push(rt(a,r,{transitionOverride:s}))}),Promise.all(i)},set(r){return t.forEach(s=>{dt(s,r)})},stop(){t.forEach(r=>{ct(r)})},mount(){return()=>{n.stop()}}};return n}function le(){const t=at(ut);return ot(t.mount,[]),t}function ft(t,n){function r(){return window.matchMedia(t).matches}function s(i){const a=window.matchMedia(t);return a.addEventListener("change",i),()=>{a.removeEventListener("change",i)}}return function(){return p.useSyncExternalStore(s,r,()=>n)}}function Ce({...t}){return e.jsx(Xe,{...t})}function G({...t}){return e.jsx(Ze,{...t})}function Se({className:t,align:n="center",sideOffset:r=4,...s}){return e.jsx(Me,{children:e.jsx(et,{align:n,sideOffset:r,className:f("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),...s})})}const ht="/resources/healthcheck",mt=15e3;function xt(){const t=de(),[n,r]=p.useState(!1),s=p.useRef(!1),i=p.useRef(t);p.useEffect(()=>{i.current=t},[t]),p.useEffect(()=>(s.current=!1,()=>{s.current=!0}),[]),p.useEffect(()=>{if(ENV.EPICSHOP_DEPLOYED){r(!1);return}if(!t){r(!1);return}},[t]);const a=p.useCallback(async()=>{if(!(ENV.EPICSHOP_DEPLOYED||!t))try{const u=await fetch(ht,{cache:"no-store",headers:{"x-healthcheck":"true"}});!s.current&&i.current&&r(!u.ok)}catch{!s.current&&i.current&&r(!0)}},[t]);return p.useEffect(()=>{ENV.EPICSHOP_DEPLOYED||!t||a()},[a,t]),Fe(()=>{a()},ENV.EPICSHOP_DEPLOYED||!t?null:mt),{isServerDown:n}}const xe=["opacity-70","opacity-80","opacity-90","opacity-100"],pe=["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)]"],Le="Local workshop server shut down. Restart the workshop app to reconnect.",De="Server shut down";function ge(t){const n=Math.round(t*xe.length-1),r=Math.round(t*pe.length-1);return f("shadow-highlight hover:opacity-100 focus:opacity-100",xe[n]??"opacity-60",pe[r]??"shadow-none",t===1?"animate-pulse hover:animate-none focus:animate-none":null)}function Ie({isMenuOpened:t}){const n=X(),{users:r}=ue(),{product:{displayNameShort:s}}=ve(),i=t?17:0,a=r.length-i,u=a>(t?1:0);if(!r.length)return null;const j=t&&r.length===1?e.jsx(l,{target:"_blank",rel:"noopener noreferrer",to:"https://www.youtube.com/watch?v=w6Q3mHyzn78",children:e.jsx("img",{alt:"Tiffany Tunes",className:f("h-8 w-8 rounded-full border object-cover",ge(1)),src:"/img/tiffany.png"})}):null,h=`${a}${t?" more ":" "}${s} Dev${a===1?"":"s"} working now`;return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.jsxs(tt,{children:[(u?r.slice(0,i):r).map(({user:d,score:k})=>{const S=ge(k),w=gt(d),A=d.imageUrlSmall||d.avatarUrl,Y=d.hasAccess,P=w.some(E=>E.origin?.includes("localhost")),I=jt(w),_=pt(d.loggedInProductHosts);if(d.optOut)return e.jsxs(se,{children:[e.jsx(ne,{asChild:!0,tabIndex:0,children:e.jsx("div",{className:"relative","aria-label":"Anonymous user (opted out)",children:e.jsx("div",{className:f("bg-muted flex h-8 w-8 items-center justify-center rounded-full border opacity-50"),children:e.jsx(g,{name:"User"})})})}),e.jsx(re,{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:[_?e.jsx("span",{className:"text-xs",children:_}):null,"Anonymous (opted out of sharing)"]})})})]},d.id);let v;return Y?v=P?"working":"referencing":v=P?"previewing":"reviewing",e.jsxs(se,{children:[e.jsx(ne,{asChild:!0,tabIndex:0,children:e.jsxs("div",{className:"relative","aria-label":d.name||`${s} Dev`,children:[A?e.jsx("img",{alt:d.name||s,className:f("h-8 w-8 rounded-full border object-cover",S),src:A}):e.jsx("div",{className:f("flex h-8 w-8 items-center justify-center rounded-full border",S),children:e.jsx(g,{name:"User"})}),I?e.jsx("span",{className:"absolute -top-1 -left-1 text-xs leading-none","aria-label":"Workshop products",children:I}):null]})}),e.jsx(re,{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:[_?e.jsx("span",{className:"text-xs",children:_}):null,d.name||`${s} Dev`,w.length>0?` is ${v} ${k===1&&n?.id!==d.id?"with you":""} on`:null]}),w.map((E,$)=>{const L=bt(E);return L?e.jsxs("span",{className:f("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:[L.line1?e.jsxs("span",{children:[we(E.productHost)," ",L.line1]}):null,L.line2?e.jsx("span",{className:"text-muted-foreground text-xs",children:L.line2}):null]},`${E.workshopTitle}-${$}`):null})]})})]},d.id)}),j,u?e.jsxs(se,{children:[e.jsx(ne,{asChild:!0,tabIndex:0,children:e.jsx("div",{"aria-label":h,className:f("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:f("pointer-events-none truncate text-center",t?"w-8":"w-6"),children:t?`+${a}`:a})})}),e.jsx(re,{children:h})]}):null]})})}function pt(t){return!t||t.length===0?null:t.map(n=>nt[n]).filter(Boolean).join(" ")}function gt(t){return t.locations&&t.locations.length>0?t.locations.filter(Boolean):t.location?[t.location]:[]}function jt(t){const n=new Set;for(const r of t)r.productHost&&n.add(r.productHost);return n.size===0?null:Array.from(n).map(r=>we(r)).filter(Boolean).join("")}function _e(t){return t.some(n=>{const r=n.relativePath.split(/[\\/]/)[0];return r==="extra"||r==="example"||r==="examples"})}const He=ft("(min-width: 640px)",!0),Qt=Ye(function(){const n=ie(),r=X(),s=He(),i=We(),{isServerDown:a}=xt(),[u,j]=p.useState(n.isMenuOpened);qe({watchPaths:["./exercises/README.mdx","./extra","./example","./examples"]});function h(d){j(d),document.cookie=`es_menu_open=${d.toString()}; path=/; SameSite=Lax;`}return e.jsxs("div",{className:"flex flex-col",children:[r?null:e.jsx(vt,{}),i&&s?null:e.jsx(Nt,{isMenuOpened:u,onMenuOpenChange:h,isServerDown:a}),e.jsxs("div",{className:f("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))]":!r,"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))]":r,"h-[unset]":!s&&u}),children:[s?e.jsx(yt,{isMenuOpened:u,onMenuOpenChange:h,isServerDown:a}):null,e.jsx("div",{className:f("h-full w-full max-w-full sm:max-w-[calc(100%-56px)]",u?"hidden md:block":""),children:e.jsx(Ue,{})})]})]})});function bt(t){if(!t)return null;const{exercise:n}=t,r=[n?[n.exerciseNumber,n.stepNumber].filter(Boolean).map(s=>s.toString().padStart(2,"0")).join("/"):null,n?.type].filter(Boolean).join(" - ");return{line1:t.workshopTitle,line2:r}}function vt(){const t=He(),{product:{host:n,displayName:r}}=ve(),s=st(),[i,a]=ce("login-button"),u=e.jsx("div",{children:ENV.EPICSHOP_DEPLOYED?e.jsxs("div",{children:["This is the deployed version. ",e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"underline",target:"_blank",rel:"noopener noreferrer",to:ENV.EPICSHOP_GITHUB_REPO,children:"Run locally"})," for full experience."]})," "]}):s?e.jsxs("div",{children:[e.jsx(l,{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(te,{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(l,{to:`https://${n}`,className:"underline",target:"_blank",children:r})," ","Workshop app!"]}),u]})]}),s?null:e.jsxs("div",{className:"hidden h-full flex-col items-center sm:flex md:flex-row",children:[e.jsxs(l,{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 ",r]}),e.jsx("span",{children:"↗︎"})]}),e.jsxs(l,{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:a,children:[e.jsx(g,{name:"User",size:"lg"}),e.jsx("span",{className:"drop-shadow-sm",children:"Login"}),i?e.jsx(K,{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(te,{size:"lg",style:"monochrome"})}),e.jsxs(Oe,{children:[e.jsx(Qe,{children:e.jsx(g,{name:"Question",size:"lg",className:"animate-pulse"})}),e.jsxs(Ke,{children:[e.jsxs(Je,{children:[e.jsx(te,{size:"lg",style:"monochrome"}),e.jsx("span",{className:"text-lg font-semibold",children:r})]}),e.jsxs(Ge,{children:["Welcome to the"," ",e.jsx(l,{to:`https://${n}`,className:"underline",children:r})," ","Workshop app!"]}),u]})]})]}),s?null:e.jsxs("div",{className:"flex h-full items-center",children:[e.jsxs(l,{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(l,{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:a,children:[e.jsx(g,{name:"User",size:"lg"}),e.jsx("span",{className:"drop-shadow-sm",children:"Login"}),i?e.jsx(K,{tooltip:"Login for the full experience!",size:"sm"}):null]})]})]})})}const fe={hidden:{opacity:0,x:-20},visible:{opacity:1,x:0}};function Ae({exerciseNumber:t,children:n}){const r=lt(t);return e.jsx(m.li,{variants:fe,className:f("py-[6px] first:pt-3 last:pb-3",r?`${r} before:border-t`:null),children:e.jsx("span",{className:"inline-block pl-2",children:n})})}function V({children:t,...n}){const r=it(n);return e.jsx(m.li,{variants:fe,className:f("py-[6px] first:pt-3 last:pb-3",r?`${r} before:border-t`:null),children:e.jsx("span",{className:"inline-block pl-2",children:t})})}function Te({children:t}){return e.jsx(m.li,{variants:fe,className:"py-[6px] first:pt-3 last:pb-3",children:e.jsx("span",{className:"inline-block pl-2",children:t})})}const wt='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(wt,n,{"bg-foreground text-background":t})}function Re({label:t,isActive:n}){return e.jsxs("span",{className:x("mr-1 align-super text-xs tabular-nums",{"text-background":n,"text-muted-foreground":!n}),children:[t,"."]})}function Nt({isMenuOpened:t,onMenuOpenChange:n,isServerDown:r}){const s=ie(),i=Ne(),a=X(),u=ke(),j=Pe(),h=je(),d=be(),k=de(),{users:S}=ue(),[w,A]=ce("account-link"),Y=_e(i),P=s.extras.find(c=>c.name===s.playground.appName),I=d.pathname==="/extra"||d.pathname.startsWith("/extra/"),_=!!P&&!I,v={visible:{opacity:1,transition:{duration:.05,when:"beforeChildren",staggerChildren:.03}},hidden:{opacity:0}},$=ye().session.theme??"system",L={light:"Light",dark:"Dark",system:"System"}[$],[H,U]=p.useState(!1),O=!!s.sidecarStatus;return p.useEffect(()=>{O||U(!1)},[O]),e.jsx("nav",{className:"flex w-full border-b sm:hidden",children:e.jsx("div",{className:"w-full",children:e.jsxs("div",{className:f("flex items-center",{"flex-col":t,"h-14":!t}),children:[e.jsx(Ve,{title:s.workshopTitle,isMenuOpened:t,setMenuOpened:n}),t&&e.jsxs(m.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(m.ul,{variants:v,initial:"hidden",animate:"visible",className:"flex flex-col",children:[e.jsx("span",{children:e.jsx(b,{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:F,steps:B})=>{const Z=c.toString().padStart(2,"0"),o=Number(h.exerciseNumber)===c,W=!o&&s.playground.exerciseNumber===c;return e.jsxs(Ae,{exerciseNumber:c,children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsxs(l,{prefetch:"intent",to:R(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":o}),children:[e.jsx(Re,{label:Z,isActive:o}),e.jsx("span",{children:F})]}),W?e.jsx(l,{to:D(s.playground.exerciseNumber,s.playground.stepNumber,s.playground.type),prefetch:"intent",children:"🛝"}):null]}),o?e.jsxs(m.ul,{variants:v,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:[e.jsx(V,{type:"instructions",exerciseNumber:c,children:e.jsx(l,{to:R(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":!h.stepNumber}),children:"Intro"})},c),B.filter(Boolean).map(({stepNumber:C,title:M,problem:T,solution:Q})=>e.jsx(V,{type:"step",stepNumber:C,exerciseNumber:c,children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs(l,{to:D(c,C),prefetch:"intent",className:"leading-tight font-semibold",children:[C.toString().padStart(2,"0"),"."," ",M]}),e.jsxs("div",{className:"mt-0.5 ml-3 flex gap-1",children:[T&&e.jsxs(b,{to:D(c,C,"problem"),prefetch:"intent",className:({isActive:N})=>z(N),children:["Problem",T.name===s.playground.appName?" 🛝":""]}),Q&&e.jsxs(b,{to:D(c,C,"solution"),prefetch:"intent",className:({isActive:N})=>z(N),children:["Solution",Q.name===s.playground.appName?" 🛝":""]})]})]})},C)),e.jsx(V,{type:"finished",exerciseNumber:c,children:e.jsx(b,{to:R(c,"finished"),prefetch:"intent",className:({isActive:C})=>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":C}),children:"📝 Elaboration"})})]}):null]},c)}),Y?e.jsxs("span",{children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(b,{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"}),_&&P?e.jsx(l,{to:`/extra/${P.dirName}`,prefetch:"intent",children:"🛝"}):null]}),I&&s.extras.length?e.jsx(m.ul,{variants:v,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:s.extras.map(c=>e.jsx(Te,{children:e.jsxs(b,{to:`/extra/${c.dirName}`,prefetch:"intent",className:({isActive:F})=>z(F,"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(b,{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"}),k?null:e.jsx(y,{content:t?null:"You are offline",children:e.jsx("div",{className:f("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})})}),r&&k?e.jsx(y,{content:t?null:Le,children:e.jsx("div",{className:f("flex h-14 items-center justify-start p-4",t?"w-full border-t":"border-l"),children:e.jsx(g,{name:"TriangleAlert",className:"text-foreground-destructive",children:t?De:null})})}):null,e.jsx("div",{className:f("flex items-center justify-start p-4",t&&S.length>4?"min-h-14":"h-14",t?"w-full border-t":"border-l"),children:e.jsx(Ie,{isMenuOpened:t})}),ENV.EPICSHOP_DEPLOYED?null:a?e.jsx(y,{content:t?null:"Your account",children:e.jsxs(l,{className:f("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:A,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(m.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"}),w?e.jsx(K,{tooltip:"View your account and preferences",size:"sm"}):null]})}):null,ENV.EPICSHOP_DEPLOYED?null:a&&u?e.jsx(y,{content:t?null:"Continue to next lesson",children:e.jsxs(l,{to:u,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(m.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&&j?e.jsx(y,{content:t?null:"Practice a past lesson",children:e.jsxs(l,{to:j,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(m.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:f("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(J,{}),e.jsx($e,{status:s.sidecarStatus})]}):O?e.jsxs(Ce,{open:H,onOpenChange:U,children:[s.sidecarStatus?.hasFailure?e.jsx(G,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Process error - click to see details",title:H?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(q,{status:"failed"})})}):e.jsx(G,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"More options",title:H?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(Se,{side:"top",align:"start",className:"flex flex-col gap-1 p-2",children:[e.jsx(Be,{themeLabel:L,disableTooltip:H}),s.sidecarStatus?e.jsxs(l,{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(q,{status:s.sidecarStatus.hasFailure?"failed":"running"})}),e.jsxs("span",{className:"flex-1 text-left",children:["Sidecar process"," ",s.sidecarStatus.hasFailure?"error":"running"]})]}):null]})]}):e.jsx(J,{})})]})})})}const ae=400;function $e({status:t}){return t?e.jsx(y,{content:t.hasFailure?`${t.failureCount} sidecar${t.failureCount===1?"":"s"} failed`:"All sidecars running",children:e.jsx(l,{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(q,{status:t.hasFailure?"failed":"running"})})}):null}function yt({isMenuOpened:t,onMenuOpenChange:n,isServerDown:r}){const s=ie(),i=Ne(),a=X(),u=ke(),j=Pe(),h=je(),d=be(),k=de(),{users:S}=ue(),[w,A]=ce("account-link"),Y=_e(i),P=s.extras.find(o=>o.name===s.playground.appName),I=d.pathname==="/extra"||d.pathname.startsWith("/extra/"),_=!!P&&!I,v=s.exercises.find(o=>o.exerciseNumber===Number(h.exerciseNumber)),E=h.type==="solution"?v?.solutions.find(o=>o.stepNumber===Number(h.stepNumber)):h.type==="problem"?v?.problems.find(o=>o.stepNumber===Number(h.stepNumber)):null,$=le(),L={close:{width:56},open:{width:ae}},H={visible:{opacity:1,transition:{duration:.05,when:"beforeChildren",staggerChildren:.03}},hidden:{opacity:0}},U=p.useCallback(()=>{typeof window>"u"||window.dispatchEvent(new CustomEvent("toggle-keyboard-shortcuts"))},[]),c=ye().session.theme??"system",F={light:"Light",dark:"Dark",system:"System"}[c],[B,Z]=p.useState(!1);return e.jsx("nav",{className:"hidden border-r sm:flex",children:e.jsx(m.div,{initial:t?"open":"close",variants:L,animate:$,children:e.jsxs("div",{className:"flex h-full flex-col items-center justify-between",children:[e.jsx(Ve,{title:s.workshopTitle,menuControls:$,isMenuOpened:t,setMenuOpened:n}),t&&e.jsxs(m.div,{style:{width:ae},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(m.ul,{variants:H,initial:"hidden",animate:"visible",className:"flex flex-col",children:[e.jsx("span",{children:e.jsx(b,{prefetch:"intent",to:"/",className:({isActive:o})=>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":o}),children:"Home"})}),s.exercises.map(({exerciseNumber:o,title:W,steps:C})=>{const M=o.toString().padStart(2,"0"),T=Number(h.exerciseNumber)===o,Q=!T&&s.playground.exerciseNumber===o;return e.jsxs(Ae,{exerciseNumber:o,children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsxs(l,{prefetch:"intent",to:R(o),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":T}),children:[e.jsx(Re,{label:M,isActive:T}),e.jsx("span",{children:W})]}),Q?e.jsx(l,{to:D(s.playground.exerciseNumber,s.playground.stepNumber,s.playground.type),prefetch:"intent",children:"🛝"}):null]}),T?e.jsxs(m.ul,{variants:H,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:[e.jsx(V,{type:"instructions",exerciseNumber:o,children:e.jsx(l,{to:R(o),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":!h.stepNumber}),children:"Intro"})},o),C.filter(Boolean).map(({stepNumber:N,title:ze,problem:he,solution:me})=>e.jsx(V,{type:"step",stepNumber:N,exerciseNumber:o,children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs(l,{to:D(o,N),prefetch:"intent",className:"leading-tight font-semibold",children:[N.toString().padStart(2,"0"),"."," ",ze]}),e.jsxs("div",{className:"mt-0.5 ml-3 flex gap-1",children:[he&&e.jsxs(b,{to:D(o,N,"problem"),prefetch:"intent",className:({isActive:ee})=>z(ee),children:["Problem",he.name===s.playground.appName?" 🛝":""]}),me&&e.jsxs(b,{to:D(o,N,"solution"),prefetch:"intent",className:({isActive:ee})=>z(ee),children:["Solution",me.name===s.playground.appName?" 🛝":""]})]})]})},N)),e.jsx(V,{type:"finished",exerciseNumber:o,children:e.jsx(b,{to:R(o,"finished"),prefetch:"intent",className:({isActive:N})=>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":N}),children:"📝 Elaboration"})})]}):null]},o)}),Y?e.jsxs("span",{children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(b,{to:"/extra",prefetch:"intent",className:({isActive:o})=>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":o}),children:"📚 Extras"}),_&&P?e.jsx(l,{to:`/extra/${P.dirName}`,prefetch:"intent",children:"🛝"}):null]}),I&&s.extras.length?e.jsx(m.ul,{variants:H,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:s.extras.map(o=>e.jsx(Te,{children:e.jsxs(b,{to:`/extra/${o.dirName}`,prefetch:"intent",className:({isActive:W})=>z(W,"leading-tight font-semibold"),children:[o.title,o.name===s.playground.appName?" 🛝":""]})},o.dirName))}):null]}):null]}),e.jsx("div",{className:"mt-6",children:e.jsx(b,{to:"/finished",className:({isActive:o})=>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-[""]':o}),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:[v?.title?e.jsx(l,{to:R(Number(h.exerciseNumber)),children:v.title}):null,v?.title&&E?.title?" — ":null,E?.title?e.jsx(l,{to:D(Number(h.exerciseNumber),E.stepNumber),children:E.title}):null]})}),k?null:e.jsx(y,{content:t?null:"You are offline",children:e.jsx("div",{className:f("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})})}),r&&k?e.jsx(y,{content:t?null:Le,children:e.jsx("div",{className:f("flex w-full items-center border-t p-4",t?"justify-start":"justify-center"),children:e.jsx(g,{name:"TriangleAlert",className:"text-foreground-destructive",children:t?e.jsx("span",{className:"whitespace-nowrap",children:De}):null})})}):null,e.jsx("div",{className:f("flex w-full items-center justify-start border-t p-4 transition-[height]",t&&S.length>4?"h-28":"h-14"),style:t?{width:ae}:{},children:e.jsx(Ie,{isMenuOpened:t})}),ENV.EPICSHOP_DEPLOYED?null:a?e.jsx(y,{content:t?null:"Your account",children:e.jsxs(l,{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:A,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(m.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"}),w?e.jsx(K,{tooltip:"View your account and preferences",size:"sm"}):null]})}):null,ENV.EPICSHOP_DEPLOYED?null:a&&u?e.jsx(y,{content:t?null:"Continue to next lesson",children:e.jsxs(l,{to:u,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(m.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&&j?e.jsx(y,{content:t?null:"Practice a past lesson",children:e.jsxs(l,{to:j,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(m.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(J,{}),e.jsx(y,{content:"Keyboard shortcuts (press ?)",children:e.jsx("button",{type:"button","aria-label":"Keyboard shortcuts",onClick:U,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(Ce,{open:B,onOpenChange:Z,children:[s.sidecarStatus?.hasFailure?e.jsx(G,{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(q,{status:"failed"})})}):e.jsx(G,{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(Se,{side:"top",align:"start",className:"flex flex-col gap-1 p-2",children:[e.jsx(Be,{themeLabel:F,disableTooltip:B}),e.jsxs("button",{type:"button","aria-label":"Keyboard shortcuts",onClick:U,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(l,{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(q,{status:s.sidecarStatus.hasFailure?"failed":"running"})}),e.jsxs("span",{className:"flex-1 text-left",children:["Sidecar process"," ",s.sidecarStatus.hasFailure?"error":"running"]})]}):null]})]})})]})})})}function Be({themeLabel:t,disableTooltip:n}){const r=p.useRef(null),s=i=>{const a=r.current?.querySelector("form");if(!a)return;const u=a.querySelector('button[type="submit"]');u?.contains(i.target)||u?.click()};return e.jsxs("div",{ref:r,onClick:s,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(J,{disableTooltip:n})}),e.jsxs("span",{className:"flex-1 text-left",children:[t," theme"]})]})}function Ve({title:t,isMenuOpened:n,setMenuOpened:r,menuControls:s}){const i=p.useRef(n),a=p.useRef(null),u={open:{d:"M3.06061 2.99999L21.0606 21"},closed:{d:"M0 9.5L24 9.5"}},j={open:{d:"M3.00006 21.0607L21 3.06064"},moving:{d:"M0 14.5L24 14.5"},closed:{d:"M0 14.5L15 14.5"}},h=le(),d=le();async function k(){s?.start(n?"close":"open"),r(!n),n?(h.start(u.closed),await d.start(j.moving),d.start(j.closed)):(await d.start(j.moving),h.start(u.open),d.start(j.open))}return p.useEffect(()=>{if(!n)return;function S(w){if(w.key!=="Escape"||w.defaultPrevented)return;!!document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||a.current?.click()}return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[n]),e.jsxs("div",{className:f("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:a,className:"flex h-14 w-14 items-center justify-center","aria-label":"Open Navigation menu",onClick:k,children:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:[e.jsx(m.path,{...u[i.current?"open":"closed"],animate:h,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5}),e.jsx(m.path,{...j[i.current?"open":"closed"],animate:d,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5})]})}),n&&e.jsx(m.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(l,{to:"/",children:t})})]})}export{Qt as default};
2
- //# sourceMappingURL=_layout-BZI3FoQD.js.map
1
+ import{w as Ye,b as ie,O as Ue,L as l,i as je,u as be,p as b}from"./chunk-EPOLDU6W-BCLmut3y.js";import{j as e}from"./jsx-runtime-C5WNSv3b.js";import{c as f,b as Fe,I as g,a as x,n as R,o as D}from"./misc-W4055b-0.js";import{r as p}from"./index-CqIc3cxq.js";import{a as We}from"./pe-CIZUOJMr.js";import{u as ce,O as K}from"./onboarding-indicator-BkeHYs2C.js";import{L as te}from"./product-D4IgPJN5.js";import{u as qe}from"./revalidation-ws-iocj9Mrl.js";import{S as q}from"./status-indicator-C6DiLYL5.js";import{D as Oe,f as Qe,a as Ke,b as Je,d as Ge}from"./dialog-CzO65Z5w.js";import{R as Xe,T as Ze,P as Me,C as et}from"./index-CmflCPTU.js";import{S as y,m as tt,T as se,j as ne,k as re}from"./tooltip-Tlsyx2YO.js";import{c as X,b as st}from"./user-CYXKquT7.js";import{u as ve}from"./workshop-config-BMWaKPZT.js";import{u as de}from"./online-DVk-W8Cr.js";import{u as ue,g as we,p as nt}from"./presence-Brtc_BN7.js";import{a as Ne,b as ye}from"./root-loader-BmUqzUDN.js";import{b as rt,s as Ee,c as at,d as ot,e as ke,f as Pe,m,u as lt,g as it}from"./progress-JDMkfyr3.js";import{T as J}from"./index-BrVvTrwg.js";import"./schemas-Uj5SZtvt.js";import"./index-ynYvVAOK.js";import"./index-vDCSPjrM.js";import"./coerce-CkHW0SMv.js";function ct(t){t.values.forEach(n=>n.stop())}function oe(t,n){[...n].reverse().forEach(s=>{const i=t.getVariant(s);i&&Ee(t,i),t.variantChildren&&t.variantChildren.forEach(a=>{oe(a,n)})})}function dt(t,n){if(Array.isArray(n))return oe(t,n);if(typeof n=="string")return oe(t,[n]);Ee(t,n)}function ut(){const t=new Set,n={subscribe(r){return t.add(r),()=>void t.delete(r)},start(r,s){const i=[];return t.forEach(a=>{i.push(rt(a,r,{transitionOverride:s}))}),Promise.all(i)},set(r){return t.forEach(s=>{dt(s,r)})},stop(){t.forEach(r=>{ct(r)})},mount(){return()=>{n.stop()}}};return n}function le(){const t=at(ut);return ot(t.mount,[]),t}function ft(t,n){function r(){return window.matchMedia(t).matches}function s(i){const a=window.matchMedia(t);return a.addEventListener("change",i),()=>{a.removeEventListener("change",i)}}return function(){return p.useSyncExternalStore(s,r,()=>n)}}function Ce({...t}){return e.jsx(Xe,{...t})}function G({...t}){return e.jsx(Ze,{...t})}function Se({className:t,align:n="center",sideOffset:r=4,...s}){return e.jsx(Me,{children:e.jsx(et,{align:n,sideOffset:r,className:f("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),...s})})}const ht="/resources/healthcheck",mt=15e3;function xt(){const t=de(),[n,r]=p.useState(!1),s=p.useRef(!1),i=p.useRef(t);p.useEffect(()=>{i.current=t},[t]),p.useEffect(()=>(s.current=!1,()=>{s.current=!0}),[]),p.useEffect(()=>{if(ENV.EPICSHOP_DEPLOYED){r(!1);return}if(!t){r(!1);return}},[t]);const a=p.useCallback(async()=>{if(!(ENV.EPICSHOP_DEPLOYED||!t))try{const u=await fetch(ht,{cache:"no-store",headers:{"x-healthcheck":"true"}});!s.current&&i.current&&r(!u.ok)}catch{!s.current&&i.current&&r(!0)}},[t]);return p.useEffect(()=>{ENV.EPICSHOP_DEPLOYED||!t||a()},[a,t]),Fe(()=>{a()},ENV.EPICSHOP_DEPLOYED||!t?null:mt),{isServerDown:n}}const xe=["opacity-70","opacity-80","opacity-90","opacity-100"],pe=["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)]"],Le="Local workshop server shut down. Restart the workshop app to reconnect.",De="Server shut down";function ge(t){const n=Math.round(t*xe.length-1),r=Math.round(t*pe.length-1);return f("shadow-highlight hover:opacity-100 focus:opacity-100",xe[n]??"opacity-60",pe[r]??"shadow-none",t===1?"animate-pulse hover:animate-none focus:animate-none":null)}function Ie({isMenuOpened:t}){const n=X(),{users:r}=ue(),{product:{displayNameShort:s}}=ve(),i=t?17:0,a=r.length-i,u=a>(t?1:0);if(!r.length)return null;const j=t&&r.length===1?e.jsx(l,{target:"_blank",rel:"noopener noreferrer",to:"https://www.youtube.com/watch?v=w6Q3mHyzn78",children:e.jsx("img",{alt:"Tiffany Tunes",className:f("h-8 w-8 rounded-full border object-cover",ge(1)),src:"/img/tiffany.png"})}):null,h=`${a}${t?" more ":" "}${s} Dev${a===1?"":"s"} working now`;return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.jsxs(tt,{children:[(u?r.slice(0,i):r).map(({user:d,score:k})=>{const S=ge(k),w=gt(d),A=d.imageUrlSmall||d.avatarUrl,Y=d.hasAccess,P=w.some(E=>E.origin?.includes("localhost")),I=jt(w),_=pt(d.loggedInProductHosts);if(d.optOut)return e.jsxs(se,{children:[e.jsx(ne,{asChild:!0,tabIndex:0,children:e.jsx("div",{className:"relative","aria-label":"Anonymous user (opted out)",children:e.jsx("div",{className:f("bg-muted flex h-8 w-8 items-center justify-center rounded-full border opacity-50"),children:e.jsx(g,{name:"User"})})})}),e.jsx(re,{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:[_?e.jsx("span",{className:"text-xs",children:_}):null,"Anonymous (opted out of sharing)"]})})})]},d.id);let v;return Y?v=P?"working":"referencing":v=P?"previewing":"reviewing",e.jsxs(se,{children:[e.jsx(ne,{asChild:!0,tabIndex:0,children:e.jsxs("div",{className:"relative","aria-label":d.name||`${s} Dev`,children:[A?e.jsx("img",{alt:d.name||s,className:f("h-8 w-8 rounded-full border object-cover",S),src:A}):e.jsx("div",{className:f("flex h-8 w-8 items-center justify-center rounded-full border",S),children:e.jsx(g,{name:"User"})}),I?e.jsx("span",{className:"absolute -top-1 -left-1 text-xs leading-none","aria-label":"Workshop products",children:I}):null]})}),e.jsx(re,{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:[_?e.jsx("span",{className:"text-xs",children:_}):null,d.name||`${s} Dev`,w.length>0?` is ${v} ${k===1&&n?.id!==d.id?"with you":""} on`:null]}),w.map((E,$)=>{const L=bt(E);return L?e.jsxs("span",{className:f("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:[L.line1?e.jsxs("span",{children:[we(E.productHost)," ",L.line1]}):null,L.line2?e.jsx("span",{className:"text-muted-foreground text-xs",children:L.line2}):null]},`${E.workshopTitle}-${$}`):null})]})})]},d.id)}),j,u?e.jsxs(se,{children:[e.jsx(ne,{asChild:!0,tabIndex:0,children:e.jsx("div",{"aria-label":h,className:f("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:f("pointer-events-none truncate text-center",t?"w-8":"w-6"),children:t?`+${a}`:a})})}),e.jsx(re,{children:h})]}):null]})})}function pt(t){return!t||t.length===0?null:t.map(n=>nt[n]).filter(Boolean).join(" ")}function gt(t){return t.locations&&t.locations.length>0?t.locations.filter(Boolean):t.location?[t.location]:[]}function jt(t){const n=new Set;for(const r of t)r.productHost&&n.add(r.productHost);return n.size===0?null:Array.from(n).map(r=>we(r)).filter(Boolean).join("")}function _e(t){return t.some(n=>{const r=n.relativePath.split(/[\\/]/)[0];return r==="extra"||r==="example"||r==="examples"})}const He=ft("(min-width: 640px)",!0),Qt=Ye(function(){const n=ie(),r=X(),s=He(),i=We(),{isServerDown:a}=xt(),[u,j]=p.useState(n.isMenuOpened);qe({watchPaths:["./exercises/README.mdx","./extra","./example","./examples"]});function h(d){j(d),document.cookie=`es_menu_open=${d.toString()}; path=/; SameSite=Lax;`}return e.jsxs("div",{className:"flex flex-col",children:[r?null:e.jsx(vt,{}),i&&s?null:e.jsx(Nt,{isMenuOpened:u,onMenuOpenChange:h,isServerDown:a}),e.jsxs("div",{className:f("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))]":!r,"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))]":r,"h-[unset]":!s&&u}),children:[s?e.jsx(yt,{isMenuOpened:u,onMenuOpenChange:h,isServerDown:a}):null,e.jsx("div",{className:f("h-full w-full max-w-full sm:max-w-[calc(100%-56px)]",u?"hidden md:block":""),children:e.jsx(Ue,{})})]})]})});function bt(t){if(!t)return null;const{exercise:n}=t,r=[n?[n.exerciseNumber,n.stepNumber].filter(Boolean).map(s=>s.toString().padStart(2,"0")).join("/"):null,n?.type].filter(Boolean).join(" - ");return{line1:t.workshopTitle,line2:r}}function vt(){const t=He(),{product:{host:n,displayName:r}}=ve(),s=st(),[i,a]=ce("login-button"),u=e.jsx("div",{children:ENV.EPICSHOP_DEPLOYED?e.jsxs("div",{children:["This is the deployed version. ",e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"underline",target:"_blank",rel:"noopener noreferrer",to:ENV.EPICSHOP_GITHUB_REPO,children:"Run locally"})," for full experience."]})," "]}):s?e.jsxs("div",{children:[e.jsx(l,{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(te,{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(l,{to:`https://${n}`,className:"underline",target:"_blank",children:r})," ","Workshop app!"]}),u]})]}),s?null:e.jsxs("div",{className:"hidden h-full flex-col items-center sm:flex md:flex-row",children:[e.jsxs(l,{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 ",r]}),e.jsx("span",{children:"↗︎"})]}),e.jsxs(l,{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:a,children:[e.jsx(g,{name:"User",size:"lg"}),e.jsx("span",{className:"drop-shadow-sm",children:"Login"}),i?e.jsx(K,{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(te,{size:"lg",style:"monochrome"})}),e.jsxs(Oe,{children:[e.jsx(Qe,{children:e.jsx(g,{name:"Question",size:"lg",className:"animate-pulse"})}),e.jsxs(Ke,{children:[e.jsxs(Je,{children:[e.jsx(te,{size:"lg",style:"monochrome"}),e.jsx("span",{className:"text-lg font-semibold",children:r})]}),e.jsxs(Ge,{children:["Welcome to the"," ",e.jsx(l,{to:`https://${n}`,className:"underline",children:r})," ","Workshop app!"]}),u]})]})]}),s?null:e.jsxs("div",{className:"flex h-full items-center",children:[e.jsxs(l,{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(l,{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:a,children:[e.jsx(g,{name:"User",size:"lg"}),e.jsx("span",{className:"drop-shadow-sm",children:"Login"}),i?e.jsx(K,{tooltip:"Login for the full experience!",size:"sm"}):null]})]})]})})}const fe={hidden:{opacity:0,x:-20},visible:{opacity:1,x:0}};function Ae({exerciseNumber:t,children:n}){const r=lt(t);return e.jsx(m.li,{variants:fe,className:f("py-[6px] first:pt-3 last:pb-3",r?`${r} before:border-t`:null),children:e.jsx("span",{className:"inline-block pl-2",children:n})})}function V({children:t,...n}){const r=it(n);return e.jsx(m.li,{variants:fe,className:f("py-[6px] first:pt-3 last:pb-3",r?`${r} before:border-t`:null),children:e.jsx("span",{className:"inline-block pl-2",children:t})})}function Te({children:t}){return e.jsx(m.li,{variants:fe,className:"py-[6px] first:pt-3 last:pb-3",children:e.jsx("span",{className:"inline-block pl-2",children:t})})}const wt='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(wt,n,{"bg-foreground text-background":t})}function Re({label:t,isActive:n}){return e.jsxs("span",{className:x("mr-1 align-super text-xs tabular-nums",{"text-background":n,"text-muted-foreground":!n}),children:[t,"."]})}function Nt({isMenuOpened:t,onMenuOpenChange:n,isServerDown:r}){const s=ie(),i=Ne(),a=X(),u=ke(),j=Pe(),h=je(),d=be(),k=de(),{users:S}=ue(),[w,A]=ce("account-link"),Y=_e(i),P=s.extras.find(c=>c.name===s.playground.appName),I=d.pathname==="/extra"||d.pathname.startsWith("/extra/"),_=!!P&&!I,v={visible:{opacity:1,transition:{duration:.05,when:"beforeChildren",staggerChildren:.03}},hidden:{opacity:0}},$=ye().session.theme??"system",L={light:"Light",dark:"Dark",system:"System"}[$],[H,U]=p.useState(!1),O=!!s.sidecarStatus;return p.useEffect(()=>{O||U(!1)},[O]),e.jsx("nav",{className:"flex w-full border-b sm:hidden",children:e.jsx("div",{className:"w-full",children:e.jsxs("div",{className:f("flex items-center",{"flex-col":t,"h-14":!t}),children:[e.jsx(Ve,{title:s.workshopTitle,isMenuOpened:t,setMenuOpened:n}),t&&e.jsxs(m.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(m.ul,{variants:v,initial:"hidden",animate:"visible",className:"flex flex-col",children:[e.jsx("span",{children:e.jsx(b,{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:F,steps:B})=>{const Z=c.toString().padStart(2,"0"),o=Number(h.exerciseNumber)===c,W=!o&&s.playground.exerciseNumber===c;return e.jsxs(Ae,{exerciseNumber:c,children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsxs(l,{prefetch:"intent",to:R(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":o}),children:[e.jsx(Re,{label:Z,isActive:o}),e.jsx("span",{children:F})]}),W?e.jsx(l,{to:D(s.playground.exerciseNumber,s.playground.stepNumber,s.playground.type),prefetch:"intent",children:"🛝"}):null]}),o?e.jsxs(m.ul,{variants:v,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:[e.jsx(V,{type:"instructions",exerciseNumber:c,children:e.jsx(l,{to:R(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":!h.stepNumber}),children:"Intro"})},c),B.filter(Boolean).map(({stepNumber:C,title:M,problem:T,solution:Q})=>e.jsx(V,{type:"step",stepNumber:C,exerciseNumber:c,children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs(l,{to:D(c,C),prefetch:"intent",className:"leading-tight font-semibold",children:[C.toString().padStart(2,"0"),"."," ",M]}),e.jsxs("div",{className:"mt-0.5 ml-3 flex gap-1",children:[T&&e.jsxs(b,{to:D(c,C,"problem"),prefetch:"intent",className:({isActive:N})=>z(N),children:["Problem",T.name===s.playground.appName?" 🛝":""]}),Q&&e.jsxs(b,{to:D(c,C,"solution"),prefetch:"intent",className:({isActive:N})=>z(N),children:["Solution",Q.name===s.playground.appName?" 🛝":""]})]})]})},C)),e.jsx(V,{type:"finished",exerciseNumber:c,children:e.jsx(b,{to:R(c,"finished"),prefetch:"intent",className:({isActive:C})=>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":C}),children:"📝 Elaboration"})})]}):null]},c)}),Y?e.jsxs("span",{children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(b,{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"}),_&&P?e.jsx(l,{to:`/extra/${P.dirName}`,prefetch:"intent",children:"🛝"}):null]}),I&&s.extras.length?e.jsx(m.ul,{variants:v,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:s.extras.map(c=>e.jsx(Te,{children:e.jsxs(b,{to:`/extra/${c.dirName}`,prefetch:"intent",className:({isActive:F})=>z(F,"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(b,{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"}),k?null:e.jsx(y,{content:t?null:"You are offline",children:e.jsx("div",{className:f("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})})}),r&&k?e.jsx(y,{content:t?null:Le,children:e.jsx("div",{className:f("flex h-14 items-center justify-start p-4",t?"w-full border-t":"border-l"),children:e.jsx(g,{name:"TriangleAlert",className:"text-foreground-destructive",children:t?De:null})})}):null,e.jsx("div",{className:f("flex items-center justify-start p-4",t&&S.length>4?"min-h-14":"h-14",t?"w-full border-t":"border-l"),children:e.jsx(Ie,{isMenuOpened:t})}),ENV.EPICSHOP_DEPLOYED?null:a?e.jsx(y,{content:t?null:"Your account",children:e.jsxs(l,{className:f("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:A,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(m.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"}),w?e.jsx(K,{tooltip:"View your account and preferences",size:"sm"}):null]})}):null,ENV.EPICSHOP_DEPLOYED?null:a&&u?e.jsx(y,{content:t?null:"Continue to next lesson",children:e.jsxs(l,{to:u,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(m.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&&j?e.jsx(y,{content:t?null:"Practice a past lesson",children:e.jsxs(l,{to:j,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(m.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:f("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(J,{}),e.jsx($e,{status:s.sidecarStatus})]}):O?e.jsxs(Ce,{open:H,onOpenChange:U,children:[s.sidecarStatus?.hasFailure?e.jsx(G,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Process error - click to see details",title:H?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(q,{status:"failed"})})}):e.jsx(G,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"More options",title:H?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(Se,{side:"top",align:"start",className:"flex flex-col gap-1 p-2",children:[e.jsx(Be,{themeLabel:L,disableTooltip:H}),s.sidecarStatus?e.jsxs(l,{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(q,{status:s.sidecarStatus.hasFailure?"failed":"running"})}),e.jsxs("span",{className:"flex-1 text-left",children:["Sidecar process"," ",s.sidecarStatus.hasFailure?"error":"running"]})]}):null]})]}):e.jsx(J,{})})]})})})}const ae=400;function $e({status:t}){return t?e.jsx(y,{content:t.hasFailure?`${t.failureCount} sidecar${t.failureCount===1?"":"s"} failed`:"All sidecars running",children:e.jsx(l,{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(q,{status:t.hasFailure?"failed":"running"})})}):null}function yt({isMenuOpened:t,onMenuOpenChange:n,isServerDown:r}){const s=ie(),i=Ne(),a=X(),u=ke(),j=Pe(),h=je(),d=be(),k=de(),{users:S}=ue(),[w,A]=ce("account-link"),Y=_e(i),P=s.extras.find(o=>o.name===s.playground.appName),I=d.pathname==="/extra"||d.pathname.startsWith("/extra/"),_=!!P&&!I,v=s.exercises.find(o=>o.exerciseNumber===Number(h.exerciseNumber)),E=h.type==="solution"?v?.solutions.find(o=>o.stepNumber===Number(h.stepNumber)):h.type==="problem"?v?.problems.find(o=>o.stepNumber===Number(h.stepNumber)):null,$=le(),L={close:{width:56},open:{width:ae}},H={visible:{opacity:1,transition:{duration:.05,when:"beforeChildren",staggerChildren:.03}},hidden:{opacity:0}},U=p.useCallback(()=>{typeof window>"u"||window.dispatchEvent(new CustomEvent("toggle-keyboard-shortcuts"))},[]),c=ye().session.theme??"system",F={light:"Light",dark:"Dark",system:"System"}[c],[B,Z]=p.useState(!1);return e.jsx("nav",{className:"hidden border-r sm:flex",children:e.jsx(m.div,{initial:t?"open":"close",variants:L,animate:$,children:e.jsxs("div",{className:"flex h-full flex-col items-center justify-between",children:[e.jsx(Ve,{title:s.workshopTitle,menuControls:$,isMenuOpened:t,setMenuOpened:n}),t&&e.jsxs(m.div,{style:{width:ae},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(m.ul,{variants:H,initial:"hidden",animate:"visible",className:"flex flex-col",children:[e.jsx("span",{children:e.jsx(b,{prefetch:"intent",to:"/",className:({isActive:o})=>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":o}),children:"Home"})}),s.exercises.map(({exerciseNumber:o,title:W,steps:C})=>{const M=o.toString().padStart(2,"0"),T=Number(h.exerciseNumber)===o,Q=!T&&s.playground.exerciseNumber===o;return e.jsxs(Ae,{exerciseNumber:o,children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsxs(l,{prefetch:"intent",to:R(o),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":T}),children:[e.jsx(Re,{label:M,isActive:T}),e.jsx("span",{children:W})]}),Q?e.jsx(l,{to:D(s.playground.exerciseNumber,s.playground.stepNumber,s.playground.type),prefetch:"intent",children:"🛝"}):null]}),T?e.jsxs(m.ul,{variants:H,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:[e.jsx(V,{type:"instructions",exerciseNumber:o,children:e.jsx(l,{to:R(o),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":!h.stepNumber}),children:"Intro"})},o),C.filter(Boolean).map(({stepNumber:N,title:ze,problem:he,solution:me})=>e.jsx(V,{type:"step",stepNumber:N,exerciseNumber:o,children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs(l,{to:D(o,N),prefetch:"intent",className:"leading-tight font-semibold",children:[N.toString().padStart(2,"0"),"."," ",ze]}),e.jsxs("div",{className:"mt-0.5 ml-3 flex gap-1",children:[he&&e.jsxs(b,{to:D(o,N,"problem"),prefetch:"intent",className:({isActive:ee})=>z(ee),children:["Problem",he.name===s.playground.appName?" 🛝":""]}),me&&e.jsxs(b,{to:D(o,N,"solution"),prefetch:"intent",className:({isActive:ee})=>z(ee),children:["Solution",me.name===s.playground.appName?" 🛝":""]})]})]})},N)),e.jsx(V,{type:"finished",exerciseNumber:o,children:e.jsx(b,{to:R(o,"finished"),prefetch:"intent",className:({isActive:N})=>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":N}),children:"📝 Elaboration"})})]}):null]},o)}),Y?e.jsxs("span",{children:[e.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[e.jsx(b,{to:"/extra",prefetch:"intent",className:({isActive:o})=>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":o}),children:"📚 Extras"}),_&&P?e.jsx(l,{to:`/extra/${P.dirName}`,prefetch:"intent",children:"🛝"}):null]}),I&&s.extras.length?e.jsx(m.ul,{variants:H,initial:"hidden",animate:"visible",className:"mt-2 ml-4 flex flex-col",children:s.extras.map(o=>e.jsx(Te,{children:e.jsxs(b,{to:`/extra/${o.dirName}`,prefetch:"intent",className:({isActive:W})=>z(W,"leading-tight font-semibold"),children:[o.title,o.name===s.playground.appName?" 🛝":""]})},o.dirName))}):null]}):null]}),e.jsx("div",{className:"mt-6",children:e.jsx(b,{to:"/finished",className:({isActive:o})=>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-[""]':o}),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:[v?.title?e.jsx(l,{to:R(Number(h.exerciseNumber)),children:v.title}):null,v?.title&&E?.title?" — ":null,E?.title?e.jsx(l,{to:D(Number(h.exerciseNumber),E.stepNumber),children:E.title}):null]})}),k?null:e.jsx(y,{content:t?null:"You are offline",children:e.jsx("div",{className:f("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})})}),r&&k?e.jsx(y,{content:t?null:Le,children:e.jsx("div",{className:f("flex w-full items-center border-t p-4",t?"justify-start":"justify-center"),children:e.jsx(g,{name:"TriangleAlert",className:"text-foreground-destructive",children:t?e.jsx("span",{className:"whitespace-nowrap",children:De}):null})})}):null,e.jsx("div",{className:f("flex w-full items-center justify-start border-t p-4 transition-[height]",t&&S.length>4?"h-28":"h-14"),style:t?{width:ae}:{},children:e.jsx(Ie,{isMenuOpened:t})}),ENV.EPICSHOP_DEPLOYED?null:a?e.jsx(y,{content:t?null:"Your account",children:e.jsxs(l,{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:A,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(m.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"}),w?e.jsx(K,{tooltip:"View your account and preferences",size:"sm"}):null]})}):null,ENV.EPICSHOP_DEPLOYED?null:a&&u?e.jsx(y,{content:t?null:"Continue to next lesson",children:e.jsxs(l,{to:u,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(m.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&&j?e.jsx(y,{content:t?null:"Practice a past lesson",children:e.jsxs(l,{to:j,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(m.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(J,{}),e.jsx(y,{content:"Keyboard shortcuts (press ?)",children:e.jsx("button",{type:"button","aria-label":"Keyboard shortcuts",onClick:U,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(Ce,{open:B,onOpenChange:Z,children:[s.sidecarStatus?.hasFailure?e.jsx(G,{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(q,{status:"failed"})})}):e.jsx(G,{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(Se,{side:"top",align:"start",className:"flex flex-col gap-1 p-2",children:[e.jsx(Be,{themeLabel:F,disableTooltip:B}),e.jsxs("button",{type:"button","aria-label":"Keyboard shortcuts",onClick:U,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(l,{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(q,{status:s.sidecarStatus.hasFailure?"failed":"running"})}),e.jsxs("span",{className:"flex-1 text-left",children:["Sidecar process"," ",s.sidecarStatus.hasFailure?"error":"running"]})]}):null]})]})})]})})})}function Be({themeLabel:t,disableTooltip:n}){const r=p.useRef(null),s=i=>{const a=r.current?.querySelector("form");if(!a)return;const u=a.querySelector('button[type="submit"]');u?.contains(i.target)||u?.click()};return e.jsxs("div",{ref:r,onClick:s,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(J,{disableTooltip:n})}),e.jsxs("span",{className:"flex-1 text-left",children:[t," theme"]})]})}function Ve({title:t,isMenuOpened:n,setMenuOpened:r,menuControls:s}){const i=p.useRef(n),a=p.useRef(null),u={open:{d:"M3.06061 2.99999L21.0606 21"},closed:{d:"M0 9.5L24 9.5"}},j={open:{d:"M3.00006 21.0607L21 3.06064"},moving:{d:"M0 14.5L24 14.5"},closed:{d:"M0 14.5L15 14.5"}},h=le(),d=le();async function k(){s?.start(n?"close":"open"),r(!n),n?(h.start(u.closed),await d.start(j.moving),d.start(j.closed)):(await d.start(j.moving),h.start(u.open),d.start(j.open))}return p.useEffect(()=>{if(!n)return;function S(w){if(w.key!=="Escape"||w.defaultPrevented)return;!!document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||a.current?.click()}return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[n]),e.jsxs("div",{className:f("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:a,className:"flex h-14 w-14 items-center justify-center","aria-label":"Open Navigation menu",onClick:k,children:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:[e.jsx(m.path,{...u[i.current?"open":"closed"],animate:h,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5}),e.jsx(m.path,{...j[i.current?"open":"closed"],animate:d,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5})]})}),n&&e.jsx(m.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(l,{to:"/",children:t})})]})}export{Qt as default};
2
+ //# sourceMappingURL=_layout-BsHVX3B_.js.map