konoha-mcp 2.1.3 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/README.md +3 -3
  2. package/apps/web/build/adapter-node.js +11 -0
  3. package/apps/web/build/client/_app/immutable/chunks/BH86Md_X.js +1 -0
  4. package/apps/web/build/client/_app/immutable/chunks/BH86Md_X.js.br +2 -0
  5. package/apps/web/build/client/_app/immutable/chunks/BH86Md_X.js.gz +0 -0
  6. package/apps/web/build/client/_app/immutable/chunks/BaNbYf_w.js +1 -0
  7. package/apps/web/build/client/_app/immutable/chunks/BaNbYf_w.js.br +0 -0
  8. package/apps/web/build/client/_app/immutable/chunks/BaNbYf_w.js.gz +0 -0
  9. package/apps/web/build/client/_app/immutable/chunks/C3-t9btS.js +1 -0
  10. package/apps/web/build/client/_app/immutable/chunks/C3-t9btS.js.br +1 -0
  11. package/apps/web/build/client/_app/immutable/chunks/C3-t9btS.js.gz +0 -0
  12. package/apps/web/build/client/_app/immutable/chunks/{Bv85lp2r.js → CBY268r4.js} +1 -1
  13. package/apps/web/build/client/_app/immutable/chunks/CBY268r4.js.br +3 -0
  14. package/apps/web/build/client/_app/immutable/chunks/CBY268r4.js.gz +0 -0
  15. package/apps/web/build/client/_app/immutable/chunks/Cg3pm-K7.js +1 -0
  16. package/apps/web/build/client/_app/immutable/chunks/Cg3pm-K7.js.br +4 -0
  17. package/apps/web/build/client/_app/immutable/chunks/Cg3pm-K7.js.gz +0 -0
  18. package/apps/web/build/client/_app/immutable/chunks/D-Kujhko.js +1 -0
  19. package/apps/web/build/client/_app/immutable/chunks/D-Kujhko.js.br +0 -0
  20. package/apps/web/build/client/_app/immutable/chunks/D-Kujhko.js.gz +0 -0
  21. package/apps/web/build/client/_app/immutable/chunks/Dek69VGa.js +1 -0
  22. package/apps/web/build/client/_app/immutable/chunks/Dek69VGa.js.br +0 -0
  23. package/apps/web/build/client/_app/immutable/chunks/Dek69VGa.js.gz +0 -0
  24. package/apps/web/build/client/_app/immutable/chunks/{CP4ze5kR.js → Dzm74gVd.js} +1 -1
  25. package/apps/web/build/client/_app/immutable/chunks/Dzm74gVd.js.br +0 -0
  26. package/apps/web/build/client/_app/immutable/chunks/Dzm74gVd.js.gz +0 -0
  27. package/apps/web/build/client/_app/immutable/chunks/Lb3VuXoN.js +2 -0
  28. package/apps/web/build/client/_app/immutable/chunks/Lb3VuXoN.js.br +0 -0
  29. package/apps/web/build/client/_app/immutable/chunks/Lb3VuXoN.js.gz +0 -0
  30. package/apps/web/build/client/_app/immutable/chunks/PrdhfbrQ.js +3 -0
  31. package/apps/web/build/client/_app/immutable/chunks/PrdhfbrQ.js.br +0 -0
  32. package/apps/web/build/client/_app/immutable/chunks/PrdhfbrQ.js.gz +0 -0
  33. package/apps/web/build/client/_app/immutable/chunks/{tFx9Vkzn.js → fbrtLByB.js} +1 -1
  34. package/apps/web/build/client/_app/immutable/chunks/fbrtLByB.js.br +0 -0
  35. package/apps/web/build/client/_app/immutable/chunks/fbrtLByB.js.gz +0 -0
  36. package/apps/web/build/client/_app/immutable/entry/app.DwlgEXmV.js +2 -0
  37. package/apps/web/build/client/_app/immutable/entry/app.DwlgEXmV.js.br +0 -0
  38. package/apps/web/build/client/_app/immutable/entry/app.DwlgEXmV.js.gz +0 -0
  39. package/apps/web/build/client/_app/immutable/entry/start.CNV5BTCO.js +2 -0
  40. package/apps/web/build/client/_app/immutable/entry/start.CNV5BTCO.js.br +0 -0
  41. package/apps/web/build/client/_app/immutable/entry/start.CNV5BTCO.js.gz +0 -0
  42. package/apps/web/build/client/_app/immutable/nodes/{0.BV_U6rd9.js → 0.5uSjyTy0.js} +1 -1
  43. package/apps/web/build/client/_app/immutable/nodes/0.5uSjyTy0.js.br +0 -0
  44. package/apps/web/build/client/_app/immutable/nodes/0.5uSjyTy0.js.gz +0 -0
  45. package/apps/web/build/client/_app/immutable/nodes/{1.317ei_PM.js → 1.BZu6jsAH.js} +1 -1
  46. package/apps/web/build/client/_app/immutable/nodes/1.BZu6jsAH.js.br +0 -0
  47. package/apps/web/build/client/_app/immutable/nodes/1.BZu6jsAH.js.gz +0 -0
  48. package/apps/web/build/client/_app/immutable/nodes/{10.C9BHUF6_.js → 10.CZKScTFN.js} +1 -1
  49. package/apps/web/build/client/_app/immutable/nodes/10.CZKScTFN.js.br +0 -0
  50. package/apps/web/build/client/_app/immutable/nodes/10.CZKScTFN.js.gz +0 -0
  51. package/apps/web/build/client/_app/immutable/nodes/{11._7rmywnA.js → 11.DFglFW_i.js} +1 -1
  52. package/apps/web/build/client/_app/immutable/nodes/11.DFglFW_i.js.br +0 -0
  53. package/apps/web/build/client/_app/immutable/nodes/11.DFglFW_i.js.gz +0 -0
  54. package/apps/web/build/client/_app/immutable/nodes/{12.B_UJh_Cw.js → 12.CSShcv5z.js} +1 -1
  55. package/apps/web/build/client/_app/immutable/nodes/12.CSShcv5z.js.br +0 -0
  56. package/apps/web/build/client/_app/immutable/nodes/12.CSShcv5z.js.gz +0 -0
  57. package/apps/web/build/client/_app/immutable/nodes/{13.FtUj7AO8.js → 13.jWUWoBcs.js} +1 -1
  58. package/apps/web/build/client/_app/immutable/nodes/13.jWUWoBcs.js.br +0 -0
  59. package/apps/web/build/client/_app/immutable/nodes/13.jWUWoBcs.js.gz +0 -0
  60. package/apps/web/build/client/_app/immutable/nodes/{14.CsMWcbH2.js → 14.H-jSqqen.js} +1 -1
  61. package/apps/web/build/client/_app/immutable/nodes/14.H-jSqqen.js.br +0 -0
  62. package/apps/web/build/client/_app/immutable/nodes/14.H-jSqqen.js.gz +0 -0
  63. package/apps/web/build/client/_app/immutable/nodes/{15.DbSoDlZF.js → 15.CpAoyhzV.js} +1 -1
  64. package/apps/web/build/client/_app/immutable/nodes/15.CpAoyhzV.js.br +0 -0
  65. package/apps/web/build/client/_app/immutable/nodes/15.CpAoyhzV.js.gz +0 -0
  66. package/apps/web/build/client/_app/immutable/nodes/{16.BcMZYQJR.js → 16.DT_-MxCT.js} +1 -1
  67. package/apps/web/build/client/_app/immutable/nodes/16.DT_-MxCT.js.br +0 -0
  68. package/apps/web/build/client/_app/immutable/nodes/16.DT_-MxCT.js.gz +0 -0
  69. package/apps/web/build/client/_app/immutable/nodes/2.Dr646Vs5.js +1 -0
  70. package/apps/web/build/client/_app/immutable/nodes/2.Dr646Vs5.js.br +0 -0
  71. package/apps/web/build/client/_app/immutable/nodes/2.Dr646Vs5.js.gz +0 -0
  72. package/apps/web/build/client/_app/immutable/nodes/{3.Co5hy99T.js → 3.Cgc-xN3x.js} +1 -1
  73. package/apps/web/build/client/_app/immutable/nodes/3.Cgc-xN3x.js.br +0 -0
  74. package/apps/web/build/client/_app/immutable/nodes/3.Cgc-xN3x.js.gz +0 -0
  75. package/apps/web/build/client/_app/immutable/nodes/{4.Ckjmv74-.js → 4.CYJQ4bWz.js} +1 -1
  76. package/apps/web/build/client/_app/immutable/nodes/4.CYJQ4bWz.js.br +0 -0
  77. package/apps/web/build/client/_app/immutable/nodes/4.CYJQ4bWz.js.gz +0 -0
  78. package/apps/web/build/client/_app/immutable/nodes/{5.jG4rh5-7.js → 5.DbHL-3Es.js} +1 -1
  79. package/apps/web/build/client/_app/immutable/nodes/5.DbHL-3Es.js.br +0 -0
  80. package/apps/web/build/client/_app/immutable/nodes/5.DbHL-3Es.js.gz +0 -0
  81. package/apps/web/build/client/_app/immutable/nodes/{6.am-4Bf0e.js → 6.BvWH2qas.js} +1 -1
  82. package/apps/web/build/client/_app/immutable/nodes/6.BvWH2qas.js.br +0 -0
  83. package/apps/web/build/client/_app/immutable/nodes/6.BvWH2qas.js.gz +0 -0
  84. package/apps/web/build/client/_app/immutable/nodes/{7.DpWtqqaL.js → 7.CmbiPMU3.js} +1 -1
  85. package/apps/web/build/client/_app/immutable/nodes/7.CmbiPMU3.js.br +0 -0
  86. package/apps/web/build/client/_app/immutable/nodes/7.CmbiPMU3.js.gz +0 -0
  87. package/apps/web/build/client/_app/immutable/nodes/{8.CbbKDJTU.js → 8.B9897Zm9.js} +1 -1
  88. package/apps/web/build/client/_app/immutable/nodes/8.B9897Zm9.js.br +0 -0
  89. package/apps/web/build/client/_app/immutable/nodes/8.B9897Zm9.js.gz +0 -0
  90. package/apps/web/build/client/_app/immutable/nodes/{9.CB21-Q9D.js → 9.CVBlvZqX.js} +1 -1
  91. package/apps/web/build/client/_app/immutable/nodes/9.CVBlvZqX.js.br +0 -0
  92. package/apps/web/build/client/_app/immutable/nodes/9.CVBlvZqX.js.gz +0 -0
  93. package/apps/web/build/client/_app/version.json +1 -1
  94. package/apps/web/build/client/_app/version.json.br +0 -0
  95. package/apps/web/build/client/_app/version.json.gz +0 -0
  96. package/apps/web/build/handler.js +1 -2
  97. package/apps/web/build/index.js +1 -74
  98. package/apps/web/build/server/.vite/manifest.json +419 -0
  99. package/apps/web/build/server/_app/immutable/assets/_layout.CsjxL1aa.css +2 -0
  100. package/apps/web/build/server/adapter-env.js +2 -0
  101. package/apps/web/build/server/adapter-index.js +74 -0
  102. package/apps/web/build/server/adapter-index.js.map +1 -0
  103. package/apps/web/build/server/{chunks/env-RhfAqpCd.js → adapter-node-env.js} +28 -7
  104. package/apps/web/build/server/adapter-node-env.js.map +1 -0
  105. package/apps/web/build/server/adapter-node-handler.js +584 -0
  106. package/apps/web/build/server/adapter-node-handler.js.map +1 -0
  107. package/apps/web/build/server/chunks/api.js +81 -0
  108. package/apps/web/build/server/chunks/api.js.map +1 -0
  109. package/apps/web/build/server/chunks/{env-DU2WieJy.js → config.js} +2 -2
  110. package/apps/web/build/server/chunks/config.js.map +1 -0
  111. package/apps/web/build/server/chunks/exports.js +625 -0
  112. package/apps/web/build/server/chunks/exports.js.map +1 -0
  113. package/apps/web/build/server/chunks/functions.js +30 -0
  114. package/apps/web/build/server/chunks/functions.js.map +1 -0
  115. package/apps/web/build/server/chunks/index-server.js +2 -0
  116. package/apps/web/build/server/chunks/instance.js +3600 -0
  117. package/apps/web/build/server/chunks/instance.js.map +1 -0
  118. package/apps/web/build/server/chunks/internal.js +2849 -0
  119. package/apps/web/build/server/chunks/internal.js.map +1 -0
  120. package/apps/web/build/server/chunks/scrollLock.svelte.js +7 -0
  121. package/apps/web/build/server/chunks/scrollLock.svelte.js.map +1 -0
  122. package/apps/web/build/server/chunks/server-errors.js +489 -0
  123. package/apps/web/build/server/chunks/server-errors.js.map +1 -0
  124. package/apps/web/build/server/chunks/server.js +9 -0
  125. package/apps/web/build/server/chunks/server.js.map +1 -0
  126. package/apps/web/build/server/chunks/{server2-xUKEUzWG.js → server2.js} +140 -718
  127. package/apps/web/build/server/chunks/server2.js.map +1 -0
  128. package/apps/web/build/server/chunks/shared.js +84 -0
  129. package/apps/web/build/server/chunks/shared.js.map +1 -0
  130. package/apps/web/build/server/chunks/{state-C6VH2NAw.js → state.js} +5 -4
  131. package/apps/web/build/server/chunks/state.js.map +1 -0
  132. package/apps/web/build/server/chunks/{sweetAlert.svelte-BKTpmvHp.js → sweetAlert.svelte.js} +3 -3
  133. package/apps/web/build/server/chunks/sweetAlert.svelte.js.map +1 -0
  134. package/apps/web/build/server/chunks/{uiState.svelte-NgyZk5Jz.js → uiState.svelte.js} +3 -3
  135. package/apps/web/build/server/chunks/uiState.svelte.js.map +1 -0
  136. package/apps/web/build/server/chunks/uneval.js +645 -0
  137. package/apps/web/build/server/chunks/uneval.js.map +1 -0
  138. package/apps/web/build/server/entries/fallbacks/error.svelte.js +12 -0
  139. package/apps/web/build/server/entries/fallbacks/error.svelte.js.map +1 -0
  140. package/apps/web/build/server/entries/hooks.server.js +8 -0
  141. package/apps/web/build/server/entries/hooks.server.js.map +1 -0
  142. package/apps/web/build/server/entries/pages/_layout.js +7 -0
  143. package/apps/web/build/server/entries/pages/_layout.js.map +1 -0
  144. package/apps/web/build/server/{chunks/_layout.svelte-FKDEmK4m.js → entries/pages/_layout.svelte.js} +15 -8
  145. package/apps/web/build/server/entries/pages/_layout.svelte.js.map +1 -0
  146. package/apps/web/build/server/entries/pages/_page.js +9 -0
  147. package/apps/web/build/server/entries/pages/_page.js.map +1 -0
  148. package/apps/web/build/server/entries/pages/_page.svelte.js +7 -0
  149. package/apps/web/build/server/entries/pages/_page.svelte.js.map +1 -0
  150. package/apps/web/build/server/{chunks/_page.svelte-K0WRgefN.js → entries/pages/agents/_page.svelte.js} +8 -5
  151. package/apps/web/build/server/entries/pages/agents/_page.svelte.js.map +1 -0
  152. package/apps/web/build/server/{chunks/_page.svelte-BKU-UjQ2.js → entries/pages/bridges/_page.svelte.js} +9 -6
  153. package/apps/web/build/server/entries/pages/bridges/_page.svelte.js.map +1 -0
  154. package/apps/web/build/server/{chunks/_page.svelte-DBQMj6O8.js → entries/pages/clients/_page.svelte.js} +8 -5
  155. package/apps/web/build/server/entries/pages/clients/_page.svelte.js.map +1 -0
  156. package/apps/web/build/server/{chunks/_page.svelte-BQP0Z2mg.js → entries/pages/context/_page.svelte.js} +9 -6
  157. package/apps/web/build/server/entries/pages/context/_page.svelte.js.map +1 -0
  158. package/apps/web/build/server/{chunks/_page.svelte-D_bQaPtJ.js → entries/pages/dashboard/_page.svelte.js} +7 -4
  159. package/apps/web/build/server/entries/pages/dashboard/_page.svelte.js.map +1 -0
  160. package/apps/web/build/server/{chunks/_page.svelte-CxxsZeRm.js → entries/pages/detector/_page.svelte.js} +5 -3
  161. package/apps/web/build/server/entries/pages/detector/_page.svelte.js.map +1 -0
  162. package/apps/web/build/server/{chunks/_page.svelte-DJp9fAk8.js → entries/pages/docs/_page.svelte.js} +7 -4
  163. package/apps/web/build/server/entries/pages/docs/_page.svelte.js.map +1 -0
  164. package/apps/web/build/server/{chunks/_page.svelte-DFBbcBLc.js → entries/pages/doctor/_page.svelte.js} +8 -5
  165. package/apps/web/build/server/entries/pages/doctor/_page.svelte.js.map +1 -0
  166. package/apps/web/build/server/{chunks/_page.svelte-yXv2Aj6-.js → entries/pages/persona/_page.svelte.js} +9 -6
  167. package/apps/web/build/server/entries/pages/persona/_page.svelte.js.map +1 -0
  168. package/apps/web/build/server/{chunks/_page.svelte-CvH3pIDb.js → entries/pages/savings/_page.svelte.js} +7 -4
  169. package/apps/web/build/server/entries/pages/savings/_page.svelte.js.map +1 -0
  170. package/apps/web/build/server/{chunks/_page.svelte-FUbd8bWv.js → entries/pages/search/_page.svelte.js} +9 -6
  171. package/apps/web/build/server/entries/pages/search/_page.svelte.js.map +1 -0
  172. package/apps/web/build/server/{chunks/_page.svelte-Bu5RfcD4.js → entries/pages/semble/_page.svelte.js} +8 -5
  173. package/apps/web/build/server/entries/pages/semble/_page.svelte.js.map +1 -0
  174. package/apps/web/build/server/{chunks/_page.svelte-B4DKG2sO.js → entries/pages/skills/_page.svelte.js} +10 -7
  175. package/apps/web/build/server/entries/pages/skills/_page.svelte.js.map +1 -0
  176. package/apps/web/build/server/{chunks/_page.svelte-D1yHfBBh.js → entries/pages/tasks/_page.svelte.js} +8 -83
  177. package/apps/web/build/server/entries/pages/tasks/_page.svelte.js.map +1 -0
  178. package/apps/web/build/{env.js → server/env.js} +1 -1
  179. package/apps/web/build/server/handler.js +2 -0
  180. package/apps/web/build/server/index.js +68 -0
  181. package/apps/web/build/server/index.js.map +1 -0
  182. package/apps/web/build/server/manifest-full.js +149 -0
  183. package/apps/web/build/server/manifest.js +149 -0
  184. package/apps/web/build/server/nodes/0.js +10 -0
  185. package/apps/web/build/server/nodes/1.js +8 -0
  186. package/apps/web/build/server/nodes/10.js +8 -0
  187. package/apps/web/build/server/nodes/11.js +8 -0
  188. package/apps/web/build/server/nodes/12.js +8 -0
  189. package/apps/web/build/server/nodes/13.js +8 -0
  190. package/apps/web/build/server/nodes/14.js +8 -0
  191. package/apps/web/build/server/nodes/15.js +8 -0
  192. package/apps/web/build/server/nodes/16.js +8 -0
  193. package/apps/web/build/server/nodes/2.js +10 -0
  194. package/apps/web/build/server/nodes/3.js +8 -0
  195. package/apps/web/build/server/nodes/4.js +8 -0
  196. package/apps/web/build/server/nodes/5.js +8 -0
  197. package/apps/web/build/server/nodes/6.js +8 -0
  198. package/apps/web/build/server/nodes/7.js +8 -0
  199. package/apps/web/build/server/nodes/8.js +8 -0
  200. package/apps/web/build/server/nodes/9.js +8 -0
  201. package/apps/web/build/server/remote-entry.js +1565 -0
  202. package/apps/web/build/server/remote-entry.js.map +1 -0
  203. package/apps/web/build/server/server.js +151 -0
  204. package/apps/web/package.json +10 -9
  205. package/bin/cli.js +3 -3
  206. package/docs/SecurityCompliance/security_compliance_report_google_policy_2.1.4_2026-10-06.md +77 -0
  207. package/package.json +9 -7
  208. package/apps/web/build/adapter-env.js +0 -2
  209. package/apps/web/build/client/_app/immutable/chunks/Ae0obco1.js +0 -3
  210. package/apps/web/build/client/_app/immutable/chunks/Ae0obco1.js.br +0 -0
  211. package/apps/web/build/client/_app/immutable/chunks/Ae0obco1.js.gz +0 -0
  212. package/apps/web/build/client/_app/immutable/chunks/BUgOhUo6.js +0 -1
  213. package/apps/web/build/client/_app/immutable/chunks/BUgOhUo6.js.br +0 -1
  214. package/apps/web/build/client/_app/immutable/chunks/BUgOhUo6.js.gz +0 -0
  215. package/apps/web/build/client/_app/immutable/chunks/Bv85lp2r.js.br +0 -3
  216. package/apps/web/build/client/_app/immutable/chunks/Bv85lp2r.js.gz +0 -0
  217. package/apps/web/build/client/_app/immutable/chunks/CP0LAeYI.js +0 -2
  218. package/apps/web/build/client/_app/immutable/chunks/CP0LAeYI.js.br +0 -0
  219. package/apps/web/build/client/_app/immutable/chunks/CP0LAeYI.js.gz +0 -0
  220. package/apps/web/build/client/_app/immutable/chunks/CP4ze5kR.js.br +0 -0
  221. package/apps/web/build/client/_app/immutable/chunks/CP4ze5kR.js.gz +0 -0
  222. package/apps/web/build/client/_app/immutable/chunks/CV8VO5Jt.js +0 -1
  223. package/apps/web/build/client/_app/immutable/chunks/CV8VO5Jt.js.br +0 -0
  224. package/apps/web/build/client/_app/immutable/chunks/CV8VO5Jt.js.gz +0 -0
  225. package/apps/web/build/client/_app/immutable/chunks/DNVgNyBC.js +0 -1
  226. package/apps/web/build/client/_app/immutable/chunks/DNVgNyBC.js.br +0 -2
  227. package/apps/web/build/client/_app/immutable/chunks/DNVgNyBC.js.gz +0 -0
  228. package/apps/web/build/client/_app/immutable/chunks/DVr7DrHY.js +0 -1
  229. package/apps/web/build/client/_app/immutable/chunks/DVr7DrHY.js.br +0 -0
  230. package/apps/web/build/client/_app/immutable/chunks/DVr7DrHY.js.gz +0 -0
  231. package/apps/web/build/client/_app/immutable/chunks/HclGiUj8.js +0 -1
  232. package/apps/web/build/client/_app/immutable/chunks/HclGiUj8.js.br +0 -0
  233. package/apps/web/build/client/_app/immutable/chunks/HclGiUj8.js.gz +0 -0
  234. package/apps/web/build/client/_app/immutable/chunks/tFx9Vkzn.js.br +0 -0
  235. package/apps/web/build/client/_app/immutable/chunks/tFx9Vkzn.js.gz +0 -0
  236. package/apps/web/build/client/_app/immutable/entry/app.qpZh6bSp.js +0 -2
  237. package/apps/web/build/client/_app/immutable/entry/app.qpZh6bSp.js.br +0 -0
  238. package/apps/web/build/client/_app/immutable/entry/app.qpZh6bSp.js.gz +0 -0
  239. package/apps/web/build/client/_app/immutable/entry/start.CUhKN6Eq.js +0 -2
  240. package/apps/web/build/client/_app/immutable/entry/start.CUhKN6Eq.js.br +0 -2
  241. package/apps/web/build/client/_app/immutable/entry/start.CUhKN6Eq.js.gz +0 -0
  242. package/apps/web/build/client/_app/immutable/nodes/0.BV_U6rd9.js.br +0 -0
  243. package/apps/web/build/client/_app/immutable/nodes/0.BV_U6rd9.js.gz +0 -0
  244. package/apps/web/build/client/_app/immutable/nodes/1.317ei_PM.js.br +0 -1
  245. package/apps/web/build/client/_app/immutable/nodes/1.317ei_PM.js.gz +0 -0
  246. package/apps/web/build/client/_app/immutable/nodes/10.C9BHUF6_.js.br +0 -0
  247. package/apps/web/build/client/_app/immutable/nodes/10.C9BHUF6_.js.gz +0 -0
  248. package/apps/web/build/client/_app/immutable/nodes/11._7rmywnA.js.br +0 -0
  249. package/apps/web/build/client/_app/immutable/nodes/11._7rmywnA.js.gz +0 -0
  250. package/apps/web/build/client/_app/immutable/nodes/12.B_UJh_Cw.js.br +0 -0
  251. package/apps/web/build/client/_app/immutable/nodes/12.B_UJh_Cw.js.gz +0 -0
  252. package/apps/web/build/client/_app/immutable/nodes/13.FtUj7AO8.js.br +0 -0
  253. package/apps/web/build/client/_app/immutable/nodes/13.FtUj7AO8.js.gz +0 -0
  254. package/apps/web/build/client/_app/immutable/nodes/14.CsMWcbH2.js.br +0 -0
  255. package/apps/web/build/client/_app/immutable/nodes/14.CsMWcbH2.js.gz +0 -0
  256. package/apps/web/build/client/_app/immutable/nodes/15.DbSoDlZF.js.br +0 -0
  257. package/apps/web/build/client/_app/immutable/nodes/15.DbSoDlZF.js.gz +0 -0
  258. package/apps/web/build/client/_app/immutable/nodes/16.BcMZYQJR.js.br +0 -0
  259. package/apps/web/build/client/_app/immutable/nodes/16.BcMZYQJR.js.gz +0 -0
  260. package/apps/web/build/client/_app/immutable/nodes/2.Bs0YCKXY.js +0 -1
  261. package/apps/web/build/client/_app/immutable/nodes/2.Bs0YCKXY.js.br +0 -0
  262. package/apps/web/build/client/_app/immutable/nodes/2.Bs0YCKXY.js.gz +0 -0
  263. package/apps/web/build/client/_app/immutable/nodes/3.Co5hy99T.js.br +0 -0
  264. package/apps/web/build/client/_app/immutable/nodes/3.Co5hy99T.js.gz +0 -0
  265. package/apps/web/build/client/_app/immutable/nodes/4.Ckjmv74-.js.br +0 -0
  266. package/apps/web/build/client/_app/immutable/nodes/4.Ckjmv74-.js.gz +0 -0
  267. package/apps/web/build/client/_app/immutable/nodes/5.jG4rh5-7.js.br +0 -0
  268. package/apps/web/build/client/_app/immutable/nodes/5.jG4rh5-7.js.gz +0 -0
  269. package/apps/web/build/client/_app/immutable/nodes/6.am-4Bf0e.js.br +0 -0
  270. package/apps/web/build/client/_app/immutable/nodes/6.am-4Bf0e.js.gz +0 -0
  271. package/apps/web/build/client/_app/immutable/nodes/7.DpWtqqaL.js.br +0 -0
  272. package/apps/web/build/client/_app/immutable/nodes/7.DpWtqqaL.js.gz +0 -0
  273. package/apps/web/build/client/_app/immutable/nodes/8.CbbKDJTU.js.br +0 -0
  274. package/apps/web/build/client/_app/immutable/nodes/8.CbbKDJTU.js.gz +0 -0
  275. package/apps/web/build/client/_app/immutable/nodes/9.CB21-Q9D.js.br +0 -0
  276. package/apps/web/build/client/_app/immutable/nodes/9.CB21-Q9D.js.gz +0 -0
  277. package/apps/web/build/dir.js +0 -8
  278. package/apps/web/build/dir.js.map +0 -1
  279. package/apps/web/build/index.js.map +0 -1
  280. package/apps/web/build/server/chunks/0-D09zEpvl.js +0 -31
  281. package/apps/web/build/server/chunks/0-D09zEpvl.js.map +0 -1
  282. package/apps/web/build/server/chunks/1-2My56RES.js +0 -17
  283. package/apps/web/build/server/chunks/1-2My56RES.js.map +0 -1
  284. package/apps/web/build/server/chunks/10-M1HtRrZp.js +0 -17
  285. package/apps/web/build/server/chunks/10-M1HtRrZp.js.map +0 -1
  286. package/apps/web/build/server/chunks/11-BDyQuE2U.js +0 -18
  287. package/apps/web/build/server/chunks/11-BDyQuE2U.js.map +0 -1
  288. package/apps/web/build/server/chunks/12-DR3YohxS.js +0 -16
  289. package/apps/web/build/server/chunks/12-DR3YohxS.js.map +0 -1
  290. package/apps/web/build/server/chunks/13-BJri0QNV.js +0 -18
  291. package/apps/web/build/server/chunks/13-BJri0QNV.js.map +0 -1
  292. package/apps/web/build/server/chunks/14-DJhiE2DY.js +0 -17
  293. package/apps/web/build/server/chunks/14-DJhiE2DY.js.map +0 -1
  294. package/apps/web/build/server/chunks/15-CJUlxcu3.js +0 -19
  295. package/apps/web/build/server/chunks/15-CJUlxcu3.js.map +0 -1
  296. package/apps/web/build/server/chunks/16-BCncPEHV.js +0 -17
  297. package/apps/web/build/server/chunks/16-BCncPEHV.js.map +0 -1
  298. package/apps/web/build/server/chunks/2-B_JPNlak.js +0 -26
  299. package/apps/web/build/server/chunks/2-B_JPNlak.js.map +0 -1
  300. package/apps/web/build/server/chunks/3-BSOfGnYr.js +0 -17
  301. package/apps/web/build/server/chunks/3-BSOfGnYr.js.map +0 -1
  302. package/apps/web/build/server/chunks/4-DUmAi2o6.js +0 -18
  303. package/apps/web/build/server/chunks/4-DUmAi2o6.js.map +0 -1
  304. package/apps/web/build/server/chunks/5-DSM_rY93.js +0 -17
  305. package/apps/web/build/server/chunks/5-DSM_rY93.js.map +0 -1
  306. package/apps/web/build/server/chunks/6-CquXfuY3.js +0 -18
  307. package/apps/web/build/server/chunks/6-CquXfuY3.js.map +0 -1
  308. package/apps/web/build/server/chunks/7-CBNvUHPu.js +0 -16
  309. package/apps/web/build/server/chunks/7-CBNvUHPu.js.map +0 -1
  310. package/apps/web/build/server/chunks/8-BlIFjRiQ.js +0 -16
  311. package/apps/web/build/server/chunks/8-BlIFjRiQ.js.map +0 -1
  312. package/apps/web/build/server/chunks/9-sa0-Zgfq.js +0 -16
  313. package/apps/web/build/server/chunks/9-sa0-Zgfq.js.map +0 -1
  314. package/apps/web/build/server/chunks/_layout.svelte-FKDEmK4m.js.map +0 -1
  315. package/apps/web/build/server/chunks/_page.svelte-B4DKG2sO.js.map +0 -1
  316. package/apps/web/build/server/chunks/_page.svelte-BKU-UjQ2.js.map +0 -1
  317. package/apps/web/build/server/chunks/_page.svelte-BQP0Z2mg.js.map +0 -1
  318. package/apps/web/build/server/chunks/_page.svelte-Bu5RfcD4.js.map +0 -1
  319. package/apps/web/build/server/chunks/_page.svelte-CvH3pIDb.js.map +0 -1
  320. package/apps/web/build/server/chunks/_page.svelte-CxxsZeRm.js.map +0 -1
  321. package/apps/web/build/server/chunks/_page.svelte-D1yHfBBh.js.map +0 -1
  322. package/apps/web/build/server/chunks/_page.svelte-DBQMj6O8.js.map +0 -1
  323. package/apps/web/build/server/chunks/_page.svelte-DFBbcBLc.js.map +0 -1
  324. package/apps/web/build/server/chunks/_page.svelte-DJp9fAk8.js.map +0 -1
  325. package/apps/web/build/server/chunks/_page.svelte-D_bQaPtJ.js.map +0 -1
  326. package/apps/web/build/server/chunks/_page.svelte-FUbd8bWv.js.map +0 -1
  327. package/apps/web/build/server/chunks/_page.svelte-K0WRgefN.js.map +0 -1
  328. package/apps/web/build/server/chunks/_page.svelte-LJxJVjMb.js +0 -7
  329. package/apps/web/build/server/chunks/_page.svelte-LJxJVjMb.js.map +0 -1
  330. package/apps/web/build/server/chunks/_page.svelte-yXv2Aj6-.js.map +0 -1
  331. package/apps/web/build/server/chunks/env-DU2WieJy.js.map +0 -1
  332. package/apps/web/build/server/chunks/env-RhfAqpCd.js.map +0 -1
  333. package/apps/web/build/server/chunks/error.svelte-CNqmrJIT.js +0 -12
  334. package/apps/web/build/server/chunks/error.svelte-CNqmrJIT.js.map +0 -1
  335. package/apps/web/build/server/chunks/exports-DzZ-4-Dy.js +0 -327
  336. package/apps/web/build/server/chunks/exports-DzZ-4-Dy.js.map +0 -1
  337. package/apps/web/build/server/chunks/handler-CNvIc1cp.js +0 -7301
  338. package/apps/web/build/server/chunks/handler-CNvIc1cp.js.map +0 -1
  339. package/apps/web/build/server/chunks/hooks.server-DqbY7q70.js +0 -8
  340. package/apps/web/build/server/chunks/hooks.server-DqbY7q70.js.map +0 -1
  341. package/apps/web/build/server/chunks/index-server-ULRIL6sb.js +0 -2
  342. package/apps/web/build/server/chunks/rolldown-runtime-D7D4PA-g.js +0 -13
  343. package/apps/web/build/server/chunks/scrollLock.svelte-ULRIL6sb.js +0 -2
  344. package/apps/web/build/server/chunks/server2-xUKEUzWG.js.map +0 -1
  345. package/apps/web/build/server/chunks/state-C6VH2NAw.js.map +0 -1
  346. package/apps/web/build/server/chunks/sweetAlert.svelte-BKTpmvHp.js.map +0 -1
  347. package/apps/web/build/server/chunks/uiState.svelte-NgyZk5Jz.js.map +0 -1
@@ -0,0 +1,2849 @@
1
+ import { C as param_matcher_async, E as merge_tracing, S as load_invalid_response, T as remote_argument_unsupported, _ as form_field_invalid_name, a as depends_special_scheme, g as form_field_forbidden_key, h as form_field_duplicate, i as text, j as ENDPOINT_METHODS, k as with_request_store, m as form_field_array_conflict, t as error, v as form_field_unbound, w as param_matcher_result_invalid } from "./exports.js";
2
+ import { a as SvelteKitError, i as Redirect, n as HandledHttpError, o as ValidationError, r as HttpError, t as ActionFailure } from "./shared.js";
3
+ import { Z as capture_error, h as handle_error_hook_failed, i as action_response_not_serializable, n as action_default_with_named, r as action_name_reserved, s as action_throw_fail, t as action_data_not_serializable, v as load_not_plain_object, y as load_not_serializable } from "./server-errors.js";
4
+ import { a as format_path, c as is_plain_object$1, d as quote_key, f as stringify_string, i as enumerable_symbols, l as is_valid_array_index, m as MAX_ARRAY_INDEX, n as DevalueError, o as get_type, p as valid_array_indices, r as MAP_KEY, s as is_buffer, t as uneval$1, u as is_valid_array_len } from "./uneval.js";
5
+ import { n as noop } from "./functions.js";
6
+ var assets = "";
7
+ var app_dir = "_app";
8
+ /** @param {string} path */
9
+ function set_assets(path) {
10
+ assets = path;
11
+ }
12
+ //#endregion
13
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/runtime/server/dev.js
14
+ var symbol = Symbol.for("sveltekit.global_state");
15
+ globalThis[symbol] ??= {};
16
+ //#endregion
17
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/runtime/utils.js
18
+ var text_encoder = new TextEncoder();
19
+ /**
20
+ * `ReadableStream.from`, for runtimes that don't support it (as of writing, every Bun release)
21
+ * @template T
22
+ * @param {AsyncIterable<T>} iterable
23
+ * @returns {ReadableStream<T>}
24
+ */
25
+ function stream_from_iterable(iterable) {
26
+ if (ReadableStream.from) return ReadableStream.from(iterable);
27
+ const iterator = iterable[Symbol.asyncIterator]();
28
+ return new ReadableStream({
29
+ async pull(controller) {
30
+ const { value, done } = await iterator.next();
31
+ if (done) controller.close();
32
+ else controller.enqueue(value);
33
+ },
34
+ async cancel(reason) {
35
+ await iterator.return?.(reason);
36
+ }
37
+ });
38
+ }
39
+ /**
40
+ * @param {string} head
41
+ * @param {AsyncIterable<string>} chunks
42
+ * @returns {ReadableStream<Uint8Array>} `head` followed by each non-empty chunk, encoded
43
+ */
44
+ function stream_text(head, chunks) {
45
+ return stream_from_iterable((async function* () {
46
+ yield text_encoder.encode(head);
47
+ for await (const chunk of chunks) if (chunk) yield text_encoder.encode(chunk);
48
+ })());
49
+ }
50
+ var text_decoder = new TextDecoder();
51
+ /**
52
+ * @param {Uint8Array} bytes
53
+ * @returns {string}
54
+ */
55
+ function base64_encode(bytes) {
56
+ if (globalThis.Buffer) return globalThis.Buffer.from(bytes).toString("base64");
57
+ let binary = "";
58
+ for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]);
59
+ return btoa(binary);
60
+ }
61
+ /**
62
+ * @param {string} encoded
63
+ * @returns {Uint8Array}
64
+ */
65
+ function base64_decode(encoded) {
66
+ if (globalThis.Buffer) {
67
+ const buffer = globalThis.Buffer.from(encoded, "base64");
68
+ return new Uint8Array(buffer);
69
+ }
70
+ const binary = atob(encoded);
71
+ const bytes = new Uint8Array(binary.length);
72
+ for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
73
+ return bytes;
74
+ }
75
+ //#endregion
76
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/pathname.js
77
+ var DATA_SUFFIX = "/__data.json";
78
+ var HTML_DATA_SUFFIX = ".html__data.json";
79
+ /** @param {string} pathname */
80
+ function has_data_suffix(pathname) {
81
+ return pathname.endsWith(DATA_SUFFIX) || pathname.endsWith(HTML_DATA_SUFFIX);
82
+ }
83
+ /** @param {string} pathname */
84
+ function add_data_suffix(pathname) {
85
+ if (pathname.endsWith(".html")) return pathname.replace(/\.html$/, HTML_DATA_SUFFIX);
86
+ return pathname.replace(/\/$/, "") + DATA_SUFFIX;
87
+ }
88
+ /** @param {string} pathname */
89
+ function strip_data_suffix(pathname) {
90
+ if (pathname.endsWith(HTML_DATA_SUFFIX)) return pathname.slice(0, -16) + ".html";
91
+ return pathname.slice(0, -12);
92
+ }
93
+ var ROUTE_SUFFIX = "/__route.js";
94
+ var HTML_ROUTE_SUFFIX = ".html__route.js";
95
+ /**
96
+ * @param {string} pathname
97
+ * @returns {boolean}
98
+ */
99
+ function has_resolution_suffix(pathname) {
100
+ return pathname.endsWith(ROUTE_SUFFIX) || pathname.endsWith(HTML_ROUTE_SUFFIX);
101
+ }
102
+ /**
103
+ * Convert a regular URL to a route to send to SvelteKit's server-side route resolution endpoint
104
+ * @param {string} pathname
105
+ * @returns {string}
106
+ */
107
+ function add_resolution_suffix(pathname) {
108
+ if (pathname.endsWith(".html")) return pathname.replace(/\.html$/, HTML_ROUTE_SUFFIX);
109
+ return pathname.replace(/\/$/, "") + ROUTE_SUFFIX;
110
+ }
111
+ /**
112
+ * @param {string} pathname
113
+ * @returns {string}
114
+ */
115
+ function strip_resolution_suffix(pathname) {
116
+ if (pathname.endsWith(HTML_ROUTE_SUFFIX)) return pathname.slice(0, -15) + ".html";
117
+ return pathname.slice(0, -11);
118
+ }
119
+ //#endregion
120
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/telemetry.js
121
+ /** @import { Span, SpanContext } from '@opentelemetry/api' */
122
+ /**
123
+ * @type {Span}
124
+ */
125
+ var noop_span = {
126
+ spanContext() {
127
+ return noop_span_context;
128
+ },
129
+ setAttribute() {
130
+ return this;
131
+ },
132
+ setAttributes() {
133
+ return this;
134
+ },
135
+ addEvent() {
136
+ return this;
137
+ },
138
+ setStatus() {
139
+ return this;
140
+ },
141
+ updateName() {
142
+ return this;
143
+ },
144
+ end() {
145
+ return this;
146
+ },
147
+ isRecording() {
148
+ return false;
149
+ },
150
+ recordException() {
151
+ return this;
152
+ },
153
+ addLink() {
154
+ return this;
155
+ },
156
+ addLinks() {
157
+ return this;
158
+ }
159
+ };
160
+ /**
161
+ * @type {SpanContext}
162
+ */
163
+ var noop_span_context = {
164
+ traceId: "",
165
+ spanId: "",
166
+ traceFlags: 0
167
+ };
168
+ //#endregion
169
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/exports/internal/server/telemetry.js
170
+ /** @import { Tracer, SpanStatusCode, PropagationAPI, ContextAPI } from '@opentelemetry/api' */
171
+ /** @import { RecordSpan } from 'types' */
172
+ /** @type {Promise<{ tracer: Tracer, SpanStatusCode: typeof SpanStatusCode, propagation: PropagationAPI, context: ContextAPI }> | null} */
173
+ var otel = null;
174
+ /** @type {RecordSpan} */
175
+ async function record_span({ name, attributes, fn }) {
176
+ if (otel === null) return fn(noop_span);
177
+ const { SpanStatusCode, tracer } = await otel;
178
+ return tracer.startActiveSpan(name, { attributes }, async (span) => {
179
+ try {
180
+ return await fn(span);
181
+ } catch (error) {
182
+ if (error instanceof HttpError) {
183
+ span.setAttributes({
184
+ [`${name}.result.type`]: "known_error",
185
+ [`${name}.result.status`]: error.status,
186
+ [`${name}.result.message`]: error.body.message
187
+ });
188
+ if (error.status >= 500) {
189
+ span.recordException({
190
+ name: "HttpError",
191
+ message: error.body.message
192
+ });
193
+ span.setStatus({
194
+ code: SpanStatusCode.ERROR,
195
+ message: error.body.message
196
+ });
197
+ }
198
+ } else if (error instanceof Redirect) span.setAttributes({
199
+ [`${name}.result.type`]: "redirect",
200
+ [`${name}.result.status`]: error.status,
201
+ [`${name}.result.location`]: error.location
202
+ });
203
+ else if (error instanceof Error) {
204
+ span.setAttributes({ [`${name}.result.type`]: "unknown_error" });
205
+ span.recordException({
206
+ name: error.name,
207
+ message: error.message,
208
+ ...error.stack !== void 0 && { stack: error.stack }
209
+ });
210
+ span.setStatus({
211
+ code: SpanStatusCode.ERROR,
212
+ message: error.message
213
+ });
214
+ } else {
215
+ span.setAttributes({ [`${name}.result.type`]: "unknown_error" });
216
+ span.setStatus({ code: SpanStatusCode.ERROR });
217
+ }
218
+ throw error;
219
+ } finally {
220
+ span.end();
221
+ }
222
+ });
223
+ }
224
+ //#endregion
225
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/utils/routing.js
226
+ /** @import { ParamMatcher, ParamValue } from '@sveltejs/kit/params' */
227
+ var escape_sequence_pattern = /\[([ux])\+([^\]]+)\]/;
228
+ /**
229
+ * @param {ParamMatcher} matcher
230
+ * @param {string} value
231
+ * @returns {{ success: true, value: any } | { success: false }}
232
+ */
233
+ function run_matcher(matcher, value) {
234
+ const result = matcher["~standard"].validate(value);
235
+ if (result instanceof Promise) param_matcher_async();
236
+ if (result.issues) return { success: false };
237
+ const parsed = result.value;
238
+ if (typeof parsed !== "string" && typeof parsed !== "number" && typeof parsed !== "boolean" && typeof parsed !== "bigint") param_matcher_result_invalid();
239
+ return {
240
+ success: true,
241
+ value: parsed
242
+ };
243
+ }
244
+ /**
245
+ * @param {RegExpMatchArray} match
246
+ * @param {import('types').RouteParam[]} params
247
+ * @param {Record<string, ParamMatcher>} matchers
248
+ */
249
+ function exec(match, params, matchers) {
250
+ /** @type {Record<string, any>} */
251
+ const result = {};
252
+ const values = match.slice(1);
253
+ const values_needing_match = values.filter((value) => value !== void 0);
254
+ let buffered = 0;
255
+ for (let i = 0; i < params.length; i += 1) {
256
+ const param = params[i];
257
+ let value = values[i - buffered];
258
+ if (param.chained && param.rest && buffered) {
259
+ value = values.slice(i - buffered, i + 1).filter((s) => s).join("/");
260
+ buffered = 0;
261
+ }
262
+ if (value === void 0) {
263
+ if (param.rest) value = "";
264
+ else continue;
265
+ }
266
+ const decoded = decodeURIComponent(value);
267
+ if (param.matcher) {
268
+ const outcome = run_matcher(matchers[param.matcher], decoded);
269
+ if (!outcome.success) {
270
+ if (param.optional && param.chained) {
271
+ buffered++;
272
+ continue;
273
+ }
274
+ return;
275
+ }
276
+ result[param.name] = outcome.value;
277
+ } else result[param.name] = decoded;
278
+ const next_param = params[i + 1];
279
+ const next_value = values[i + 1];
280
+ if (next_param && !next_param.rest && next_param.optional && next_value && param.chained) buffered = 0;
281
+ if (!next_param && !next_value && Object.keys(result).length === values_needing_match.length) buffered = 0;
282
+ }
283
+ if (buffered) return;
284
+ return result;
285
+ }
286
+ new RegExp(`${escape_sequence_pattern.source}|${/\[(\[)?(\.\.\.)?([\w-]+?)(?:=([\w-]+))?\]\]?/g.source}`, "g");
287
+ /**
288
+ * Find the first route that matches the given path
289
+ * @template {{pattern: RegExp, params: import('types').RouteParam[]}} Route
290
+ * @param {string} path - The decoded pathname to match
291
+ * @param {Route[]} routes
292
+ * @param {Record<string, ParamMatcher>} matchers
293
+ * @returns {{ route: Route, params: Record<string, any> } | null}
294
+ */
295
+ function find_route(path, routes, matchers) {
296
+ for (const route of routes) {
297
+ const match = route.pattern.exec(path);
298
+ if (!match) continue;
299
+ const matched = exec(match, route.params, matchers);
300
+ if (matched) return {
301
+ route,
302
+ params: matched
303
+ };
304
+ }
305
+ return null;
306
+ }
307
+ //#endregion
308
+ //#region ../../node_modules/.pnpm/devalue@6.0.2/node_modules/devalue/src/base64.js
309
+ /** @type {(array_buffer: ArrayBuffer) => string} */
310
+ function encode_native(array_buffer) {
311
+ return new Uint8Array(array_buffer).toBase64();
312
+ }
313
+ /** @type {(base64: string) => ArrayBuffer} */
314
+ function decode_native(base64) {
315
+ return Uint8Array.fromBase64(base64).buffer;
316
+ }
317
+ /** @type {(array_buffer: ArrayBuffer) => string} */
318
+ function encode_buffer(array_buffer) {
319
+ return Buffer.from(array_buffer).toString("base64");
320
+ }
321
+ /** @type {(base64: string) => ArrayBuffer} */
322
+ function decode_buffer(base64) {
323
+ return Uint8Array.from(Buffer.from(base64, "base64")).buffer;
324
+ }
325
+ /** @type {(array_buffer: ArrayBuffer) => string} */
326
+ function encode_legacy(array_buffer) {
327
+ const array = new Uint8Array(array_buffer);
328
+ let binary = "";
329
+ const chunk_size = 32768;
330
+ for (let i = 0; i < array.length; i += chunk_size) {
331
+ const chunk = array.subarray(i, i + chunk_size);
332
+ binary += String.fromCharCode.apply(null, chunk);
333
+ }
334
+ return btoa(binary);
335
+ }
336
+ /** @type {(base64: string) => ArrayBuffer} */
337
+ function decode_legacy(base64) {
338
+ const binary_string = atob(base64);
339
+ const len = binary_string.length;
340
+ const array = new Uint8Array(len);
341
+ for (let i = 0; i < len; i++) array[i] = binary_string.charCodeAt(i);
342
+ return array.buffer;
343
+ }
344
+ var native = typeof Uint8Array.fromBase64 === "function";
345
+ var buffer = typeof process === "object" && process.versions?.node !== void 0;
346
+ var encode64 = native ? encode_native : buffer ? encode_buffer : encode_legacy;
347
+ var decode64 = native ? decode_native : buffer ? decode_buffer : decode_legacy;
348
+ //#endregion
349
+ //#region ../../node_modules/.pnpm/devalue@6.0.2/node_modules/devalue/src/operations.js
350
+ /**
351
+ * Merges caller-provided operation overrides over the defaults. Iterating the
352
+ * default keys (rather than the override's own keys) means nullish members
353
+ * fall back to the default, and inherited members — e.g. from a class
354
+ * instance — are picked up.
355
+ *
356
+ * @template {Record<string, any>} T
357
+ * @param {T} defaults
358
+ * @param {Partial<T> | undefined} overrides
359
+ * @returns {T}
360
+ */
361
+ function merge_operations(defaults, overrides) {
362
+ if (!overrides) return defaults;
363
+ const merged = {};
364
+ for (const key of Object.keys(defaults)) merged[key] = overrides[key] ?? defaults[key];
365
+ return merged;
366
+ }
367
+ /** @type {{ kind: 'not-plain' }} */
368
+ var NOT_PLAIN = /* @__PURE__ */ Object.freeze({ kind: "not-plain" });
369
+ /** @type {{ kind: 'symbol-keys' }} */
370
+ var SYMBOL_KEYS = /* @__PURE__ */ Object.freeze({ kind: "symbol-keys" });
371
+ var default_stringify_operations = /* @__PURE__ */ Object.freeze({
372
+ identify: (value) => value,
373
+ typeOf: (value) => value === null ? "null" : typeof value,
374
+ toPrimitive: (value) => value,
375
+ tagOf: (value) => get_type(value),
376
+ isThenable: (value) => typeof value.then === "function",
377
+ toPromise: (thenable) => Promise.resolve(thenable),
378
+ unbox: (boxed) => boxed.valueOf(),
379
+ toISOString: (date) => isNaN(date.getDate()) ? "" : date.toISOString(),
380
+ toStringValue: (value) => value.toString(),
381
+ regExpInfo: (regexp) => ({
382
+ source: regexp.source,
383
+ flags: regexp.flags
384
+ }),
385
+ valuesOf: (set) => set,
386
+ entriesOf: (map) => map,
387
+ viewInfo: (view) => {
388
+ if (is_buffer(view)) view = new Uint8Array(view);
389
+ return {
390
+ buffer: view.buffer,
391
+ byteOffset: view.byteOffset,
392
+ byteLength: view.byteLength,
393
+ length: view.length,
394
+ bufferByteLength: view.buffer.byteLength
395
+ };
396
+ },
397
+ toArrayBuffer: (buffer) => buffer,
398
+ lengthOf: (array) => array.length,
399
+ hasOwn: (value, key) => Object.hasOwn(value, key),
400
+ indicesOf: (array) => valid_array_indices(array),
401
+ shapeOf: (value) => {
402
+ if (!is_plain_object$1(value)) return NOT_PLAIN;
403
+ if (enumerable_symbols(value).length > 0) return SYMBOL_KEYS;
404
+ return {
405
+ kind: Object.getPrototypeOf(value) === null ? "null-proto" : "plain",
406
+ keys: Object.keys(value)
407
+ };
408
+ },
409
+ get: (value, key) => value[key]
410
+ });
411
+ var array_buffer_byte_length = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength")?.get;
412
+ var shared_array_buffer_byte_length = typeof SharedArrayBuffer === "undefined" ? void 0 : Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, "byteLength")?.get;
413
+ var default_parse_operations = /* @__PURE__ */ Object.freeze({
414
+ fromPrimitive: (primitive) => primitive,
415
+ fromISOString: (iso) => new Date(iso),
416
+ fromStringValue: (tag, text) => {
417
+ if (tag === "URL") return new URL(text);
418
+ if (tag === "URLSearchParams") return new URLSearchParams(text);
419
+ return Temporal[tag.slice(9)].from(text);
420
+ },
421
+ fromArrayBuffer: (buffer) => buffer,
422
+ fromRegExpInfo: (source, flags) => new RegExp(source, flags),
423
+ fromViewInfo: (tag, buffer, byteOffset, length) => {
424
+ try {
425
+ array_buffer_byte_length.call(buffer);
426
+ } catch (error) {
427
+ if (!shared_array_buffer_byte_length) throw error;
428
+ shared_array_buffer_byte_length.call(buffer);
429
+ }
430
+ const Constructor = globalThis[tag];
431
+ return byteOffset !== void 0 ? new Constructor(buffer, byteOffset, length) : new Constructor(buffer);
432
+ },
433
+ box: (value) => Object(value),
434
+ createArray: (length) => new Array(length),
435
+ createSparseArray: (length) => {
436
+ /** @type {any[]} */
437
+ const array = [];
438
+ array[MAX_ARRAY_INDEX] = void 0;
439
+ delete array[MAX_ARRAY_INDEX];
440
+ array.length = length;
441
+ return array;
442
+ },
443
+ createObject: () => ({}),
444
+ createNullPrototypeObject: () => Object.create(null),
445
+ createSet: () => /* @__PURE__ */ new Set(),
446
+ createMap: () => /* @__PURE__ */ new Map(),
447
+ set: (target, key, value) => {
448
+ target[key] = value;
449
+ },
450
+ addValue: (set, value) => {
451
+ set.add(value);
452
+ },
453
+ addEntry: (map, key, value) => {
454
+ map.set(key, value);
455
+ }
456
+ });
457
+ //#endregion
458
+ //#region ../../node_modules/.pnpm/devalue@6.0.2/node_modules/devalue/src/parse.js
459
+ function invalid() {
460
+ throw new Error("Invalid input");
461
+ }
462
+ /**
463
+ * Revive a value serialized with `devalue.stringify`
464
+ * @param {string} serialized
465
+ * @param {Record<string, (value: any) => any>} [revivers]
466
+ * @param {import('./types.js').ParseOptions} [options]
467
+ */
468
+ function parse$1(serialized, revivers, options) {
469
+ return unflatten(JSON.parse(serialized), revivers, options);
470
+ }
471
+ /**
472
+ * Revive a value flattened with `devalue.stringify`
473
+ * @param {number | any[]} parsed
474
+ * @param {Record<string, (value: any) => any>} [revivers]
475
+ * @param {import('./types.js').ParseOptions} [options]
476
+ */
477
+ function unflatten(parsed, revivers, options) {
478
+ /** @type {import('./types.js').ParseOperations} */
479
+ const ops = merge_operations(default_parse_operations, options?.operations);
480
+ if (typeof parsed === "number") return hydrate(parsed, true);
481
+ if (!Array.isArray(parsed) || parsed.length === 0) invalid();
482
+ const values = parsed;
483
+ const hydrated = Array(values.length);
484
+ /**
485
+ * A set of values currently being hydrated with custom revivers,
486
+ * used to detect invalid cyclical dependencies
487
+ * @type {Set<number> | null}
488
+ */
489
+ let hydrating = null;
490
+ /**
491
+ * @param {number} index
492
+ * @returns {any}
493
+ */
494
+ function get_raw(index) {
495
+ if (!is_valid_array_index(index) || index >= values.length) invalid();
496
+ return values[index];
497
+ }
498
+ /**
499
+ * @param {number} index
500
+ * @returns {any}
501
+ */
502
+ function hydrate(index, standalone = false) {
503
+ if (index === -1) return ops.fromPrimitive(void 0);
504
+ if (index === -3) return ops.fromPrimitive(NaN);
505
+ if (index === -4) return ops.fromPrimitive(Infinity);
506
+ if (index === -5) return ops.fromPrimitive(-Infinity);
507
+ if (index === -6) return ops.fromPrimitive(-0);
508
+ if (standalone || typeof index !== "number") invalid();
509
+ if (index in hydrated) return hydrated[index];
510
+ if (index >= values.length) invalid();
511
+ const value = values[index];
512
+ if (!value || typeof value !== "object") hydrated[index] = ops.fromPrimitive(value);
513
+ else if (Array.isArray(value)) {
514
+ if (typeof value[0] === "string") {
515
+ const type = value[0];
516
+ const reviver = revivers && Object.hasOwn(revivers, type) ? revivers[type] : void 0;
517
+ if (reviver) {
518
+ let i = value[1];
519
+ if (typeof i !== "number") i = values.push(value[1]) - 1;
520
+ if (Object.hasOwn(hydrated, i)) return hydrated[index] = reviver(hydrated[i]);
521
+ hydrating ??= /* @__PURE__ */ new Set();
522
+ if (hydrating.has(i)) throw new Error("Invalid circular reference");
523
+ hydrating.add(i);
524
+ hydrated[index] = reviver(hydrate(i));
525
+ hydrating.delete(i);
526
+ return hydrated[index];
527
+ }
528
+ switch (type) {
529
+ case "Date":
530
+ hydrated[index] = ops.fromISOString(value[1]);
531
+ break;
532
+ case "Set":
533
+ const set = ops.createSet();
534
+ hydrated[index] = set;
535
+ for (let i = 1; i < value.length; i += 1) ops.addValue(set, hydrate(value[i]));
536
+ break;
537
+ case "Map":
538
+ const map = ops.createMap();
539
+ hydrated[index] = map;
540
+ for (let i = 1; i < value.length; i += 2) ops.addEntry(map, hydrate(value[i]), hydrate(value[i + 1]));
541
+ break;
542
+ case "RegExp":
543
+ hydrated[index] = ops.fromRegExpInfo(value[1], value[2]);
544
+ break;
545
+ case "Object": {
546
+ const wrapped_index = value[1];
547
+ if (!(wrapped_index === -3 || wrapped_index === -4 || wrapped_index === -5 || wrapped_index === -6)) {
548
+ const wrapped = get_raw(wrapped_index);
549
+ const is_bigint = Array.isArray(wrapped) && wrapped[0] === "BigInt";
550
+ if ((wrapped === void 0 || typeof wrapped === "object") && !is_bigint) invalid();
551
+ }
552
+ hydrated[index] = ops.box(hydrate(wrapped_index));
553
+ break;
554
+ }
555
+ case "BigInt":
556
+ hydrated[index] = ops.fromPrimitive(BigInt(value[1]));
557
+ break;
558
+ case "null":
559
+ const obj = ops.createNullPrototypeObject();
560
+ hydrated[index] = obj;
561
+ for (let i = 1; i < value.length; i += 2) {
562
+ const key = value[i];
563
+ if (typeof key !== "string") throw new Error("Cannot parse an object with a non-string key");
564
+ if (key === "__proto__") throw new Error("Cannot parse an object with a `__proto__` property");
565
+ ops.set(obj, key, hydrate(value[i + 1]));
566
+ }
567
+ break;
568
+ case "Int8Array":
569
+ case "Uint8Array":
570
+ case "Uint8ClampedArray":
571
+ case "Int16Array":
572
+ case "Uint16Array":
573
+ case "Float16Array":
574
+ case "Int32Array":
575
+ case "Uint32Array":
576
+ case "Float32Array":
577
+ case "Float64Array":
578
+ case "BigInt64Array":
579
+ case "BigUint64Array":
580
+ case "DataView": {
581
+ const buffer_index = value[1];
582
+ const raw = get_raw(buffer_index);
583
+ if (!Array.isArray(raw) || raw[0] !== "ArrayBuffer") invalid();
584
+ const buffer = hydrate(buffer_index);
585
+ hydrated[index] = ops.fromViewInfo(type, buffer, value[2], value[3]);
586
+ break;
587
+ }
588
+ case "ArrayBuffer": {
589
+ const base64 = value[1];
590
+ if (typeof base64 !== "string") throw new Error("Invalid ArrayBuffer encoding");
591
+ hydrated[index] = ops.fromArrayBuffer(decode64(base64));
592
+ break;
593
+ }
594
+ case "URL":
595
+ case "URLSearchParams":
596
+ case "Temporal.Duration":
597
+ case "Temporal.Instant":
598
+ case "Temporal.PlainDate":
599
+ case "Temporal.PlainTime":
600
+ case "Temporal.PlainDateTime":
601
+ case "Temporal.PlainMonthDay":
602
+ case "Temporal.PlainYearMonth":
603
+ case "Temporal.ZonedDateTime":
604
+ hydrated[index] = ops.fromStringValue(type, value[1]);
605
+ break;
606
+ default: throw new Error(`Unknown type ${type}`);
607
+ }
608
+ } else if (value[0] === -7) {
609
+ const len = value[1];
610
+ if (!is_valid_array_len(len)) invalid();
611
+ const array = ops.createSparseArray(len);
612
+ hydrated[index] = array;
613
+ for (let i = 2; i < value.length; i += 2) {
614
+ const idx = value[i];
615
+ if (!is_valid_array_index(idx) || idx >= len) invalid();
616
+ ops.set(array, idx, hydrate(value[i + 1]));
617
+ }
618
+ } else {
619
+ const array = ops.createArray(value.length);
620
+ hydrated[index] = array;
621
+ for (let i = 0; i < value.length; i += 1) {
622
+ const n = value[i];
623
+ if (n === -2) continue;
624
+ ops.set(array, i, hydrate(n));
625
+ }
626
+ }
627
+ } else {
628
+ const object = ops.createObject();
629
+ hydrated[index] = object;
630
+ for (const key of Object.keys(value)) {
631
+ if (key === "__proto__") throw new Error("Cannot parse an object with a `__proto__` property");
632
+ ops.set(object, key, hydrate(value[key]));
633
+ }
634
+ }
635
+ return hydrated[index];
636
+ }
637
+ return hydrate(0);
638
+ }
639
+ //#endregion
640
+ //#region ../../node_modules/.pnpm/devalue@6.0.2/node_modules/devalue/src/stringify.js
641
+ /**
642
+ * Turn a value into a JSON string that can be parsed with `devalue.parse`
643
+ * @param {any} value
644
+ * @param {Record<string, (value: any) => any>} [reducers]
645
+ * @param {import('./types.js').StringifyOptions} [options]
646
+ */
647
+ function stringify$1(value, reducers, options) {
648
+ const stringified = run(false, value, reducers, options);
649
+ return typeof stringified === "string" ? stringified : `[${stringified.join(",")}]`;
650
+ }
651
+ /**
652
+ * @param {boolean} async
653
+ * @param {any} value
654
+ * @param {Record<string, (value: any) => any>} [reducers]
655
+ * @param {import('./types.js').StringifyOptions} [options]
656
+ */
657
+ function run(async, value, reducers, options) {
658
+ const ops = merge_operations(default_stringify_operations, options?.operations);
659
+ /** @type {any[]} */
660
+ const stringified = [];
661
+ /** @type {Map<any, number>} */
662
+ const indexes = /* @__PURE__ */ new Map();
663
+ /** @type {Array<{ key: string, fn: (value: any) => any }>} */
664
+ const custom = [];
665
+ if (reducers) for (const key of Object.getOwnPropertyNames(reducers)) custom.push({
666
+ key,
667
+ fn: reducers[key]
668
+ });
669
+ /** @type {any[]} */
670
+ let keys = [];
671
+ let p = 0;
672
+ /**
673
+ * @param {string} message
674
+ * @param {any} thing
675
+ * @returns {never}
676
+ */
677
+ function error(message, thing) {
678
+ const path = format_path(keys, (key) => {
679
+ const key_type = ops.typeOf(key);
680
+ return key_type !== "object" && key_type !== "function" && key_type !== "symbol" ? stringify_primitive(ops.toPrimitive(key)) : "...";
681
+ });
682
+ throw new DevalueError(message, path, thing, value);
683
+ }
684
+ /**
685
+ * @param {any} thing
686
+ * @param {number} [index]
687
+ */
688
+ function flatten(thing, index) {
689
+ const type = ops.typeOf(thing);
690
+ if (type === "undefined") return -1;
691
+ /** @type {number | undefined} */
692
+ let number;
693
+ if (type === "number") {
694
+ number = ops.toPrimitive(thing);
695
+ if (Number.isNaN(number)) return -3;
696
+ if (number === Infinity) return -4;
697
+ if (number === -Infinity) return -5;
698
+ if (number === 0 && 1 / number < 0) return -6;
699
+ }
700
+ const id = ops.identify(thing);
701
+ if (indexes.has(id)) return indexes.get(id);
702
+ index ??= p++;
703
+ indexes.set(id, index);
704
+ for (const { key, fn } of custom) {
705
+ const value = fn(thing);
706
+ if (value) {
707
+ stringified[index] = `["${key}",${flatten(value)}]`;
708
+ return index;
709
+ }
710
+ }
711
+ if (type === "function") error(`Cannot stringify a function`, thing);
712
+ else if (type === "symbol") error(`Cannot stringify a Symbol primitive`, thing);
713
+ /** @type {string | Promise<any>} */
714
+ let str = "";
715
+ if (type !== "object") str = stringify_primitive(type === "number" ? number : ops.toPrimitive(thing));
716
+ else if (ops.isThenable(thing)) {
717
+ if (!async) error(`Cannot stringify a Promise or thenable — use stringifyAsync instead`, thing);
718
+ const prev_keys = keys.slice();
719
+ str = ops.toPromise(thing).then((value) => {
720
+ keys = prev_keys;
721
+ const i = flatten(value, index);
722
+ if (i < 0) stringified[index] = i;
723
+ });
724
+ str.catch(() => {});
725
+ } else {
726
+ const tag = ops.tagOf(thing);
727
+ switch (tag) {
728
+ case "Number":
729
+ case "String":
730
+ case "Boolean":
731
+ case "BigInt":
732
+ str = `["Object",${flatten(ops.unbox(thing))}]`;
733
+ break;
734
+ case "Date":
735
+ str = `["Date","${ops.toISOString(thing)}"]`;
736
+ break;
737
+ case "URL":
738
+ str = `["URL",${stringify_string(ops.toStringValue(thing))}]`;
739
+ break;
740
+ case "URLSearchParams":
741
+ str = `["URLSearchParams",${stringify_string(ops.toStringValue(thing))}]`;
742
+ break;
743
+ case "RegExp":
744
+ const { source, flags } = ops.regExpInfo(thing);
745
+ str = flags ? `["RegExp",${stringify_string(source)},"${flags}"]` : `["RegExp",${stringify_string(source)}]`;
746
+ break;
747
+ case "Array": {
748
+ let mostly_dense = false;
749
+ const length = ops.lengthOf(thing);
750
+ str = "[";
751
+ for (let i = 0; i < length; i += 1) {
752
+ if (i > 0) str += ",";
753
+ if (ops.hasOwn(thing, i)) {
754
+ keys.push(i);
755
+ str += flatten(ops.get(thing, i));
756
+ keys.pop();
757
+ } else if (mostly_dense) str += -2;
758
+ else {
759
+ const populated_keys = ops.indicesOf(thing);
760
+ const population = populated_keys.length;
761
+ const d = String(length).length;
762
+ if ((length - population) * 3 > 4 + d + population * (d + 1)) {
763
+ str = "[-7," + length;
764
+ for (let j = 0; j < populated_keys.length; j++) {
765
+ const key = populated_keys[j];
766
+ keys.push(+key);
767
+ str += "," + key + "," + flatten(ops.get(thing, key));
768
+ keys.pop();
769
+ }
770
+ break;
771
+ } else {
772
+ mostly_dense = true;
773
+ str += -2;
774
+ }
775
+ }
776
+ }
777
+ str += "]";
778
+ break;
779
+ }
780
+ case "Set":
781
+ str = "[\"Set\"";
782
+ for (const value of ops.valuesOf(thing)) str += `,${flatten(value)}`;
783
+ str += "]";
784
+ break;
785
+ case "Map":
786
+ str = "[\"Map\"";
787
+ for (const [key, value] of ops.entriesOf(thing)) {
788
+ keys.push(MAP_KEY, key);
789
+ str += `,${flatten(key)},${flatten(value)}`;
790
+ keys.pop();
791
+ keys.pop();
792
+ }
793
+ str += "]";
794
+ break;
795
+ case "Int8Array":
796
+ case "Uint8Array":
797
+ case "Uint8ClampedArray":
798
+ case "Int16Array":
799
+ case "Uint16Array":
800
+ case "Float16Array":
801
+ case "Int32Array":
802
+ case "Uint32Array":
803
+ case "Float32Array":
804
+ case "Float64Array":
805
+ case "BigInt64Array":
806
+ case "BigUint64Array": {
807
+ const info = ops.viewInfo(thing);
808
+ str = "[\"" + tag + "\"," + flatten(info.buffer);
809
+ if (info.byteLength !== info.bufferByteLength) str += `,${info.byteOffset},${info.length}`;
810
+ str += "]";
811
+ break;
812
+ }
813
+ case "DataView": {
814
+ const info = ops.viewInfo(thing);
815
+ str = "[\"" + tag + "\"," + flatten(info.buffer);
816
+ if (info.byteLength !== info.bufferByteLength) str += `,${info.byteOffset},${info.byteLength}`;
817
+ str += "]";
818
+ break;
819
+ }
820
+ case "ArrayBuffer":
821
+ str = `["ArrayBuffer","${encode64(ops.toArrayBuffer(thing))}"]`;
822
+ break;
823
+ case "Temporal.Duration":
824
+ case "Temporal.Instant":
825
+ case "Temporal.PlainDate":
826
+ case "Temporal.PlainTime":
827
+ case "Temporal.PlainDateTime":
828
+ case "Temporal.PlainMonthDay":
829
+ case "Temporal.PlainYearMonth":
830
+ case "Temporal.ZonedDateTime":
831
+ str = `["${tag}",${stringify_string(ops.toStringValue(thing))}]`;
832
+ break;
833
+ default: {
834
+ const shape = ops.shapeOf(thing);
835
+ if (shape.kind === "not-plain") error(`Cannot stringify arbitrary non-POJOs`, thing);
836
+ if (shape.kind === "symbol-keys") error(`Cannot stringify POJOs with symbolic keys`, thing);
837
+ if (shape.kind === "null-proto") {
838
+ str = "[\"null\"";
839
+ for (const key of shape.keys) {
840
+ if (key === "__proto__") error(`Cannot stringify objects with __proto__ keys`, thing);
841
+ keys.push(key);
842
+ str += `,${quote_key(key)},${flatten(ops.get(thing, key))}`;
843
+ keys.pop();
844
+ }
845
+ str += "]";
846
+ } else {
847
+ str = "{";
848
+ let started = false;
849
+ for (const key of shape.keys) {
850
+ if (key === "__proto__") error(`Cannot stringify objects with __proto__ keys`, thing);
851
+ if (started) str += ",";
852
+ started = true;
853
+ keys.push(key);
854
+ str += `${quote_key(key)}:${flatten(ops.get(thing, key))}`;
855
+ keys.pop();
856
+ }
857
+ str += "}";
858
+ }
859
+ }
860
+ }
861
+ }
862
+ stringified[index] = str;
863
+ return index;
864
+ }
865
+ const index = flatten(value);
866
+ if (index < 0) return `${index}`;
867
+ return stringified;
868
+ }
869
+ /**
870
+ * @param {any} thing
871
+ * @returns {string}
872
+ */
873
+ function stringify_primitive(thing) {
874
+ const type = typeof thing;
875
+ if (type === "string") return stringify_string(thing);
876
+ if (thing === void 0) return (-1).toString();
877
+ if (thing === 0 && 1 / thing < 0) return (-6).toString();
878
+ if (type === "bigint") return `["BigInt","${thing}"]`;
879
+ return String(thing);
880
+ }
881
+ //#endregion
882
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/runtime/form-utils.js
883
+ /** @import { BinaryFormMeta, InternalRemoteFormIssue } from 'types' */
884
+ /** @import { StandardSchemaV1 } from '@standard-schema/spec' */
885
+ /**
886
+ * Sets a parsed form field value in a nested object, mutating the original object.
887
+ * @param {Record<string, any>} object
888
+ * @param {{ name: string; type: 'number' | 'boolean' | null }} field
889
+ * @param {any} value
890
+ */
891
+ function set_nested_value(object, field, value) {
892
+ deep_set(object, split_path(field.name), value);
893
+ }
894
+ /**
895
+ * Separates a form field's path from the metadata encoded in its name.
896
+ * @param {string} form_id
897
+ * @param {string} key
898
+ * @returns {{ name: string; type: 'number' | 'boolean' | null; is_array: boolean }}
899
+ */
900
+ function parse_form_key(form_id, key) {
901
+ const suffix = "/" + form_id;
902
+ let name = key;
903
+ let image_coordinate = "";
904
+ if (name.startsWith("i:") && (name.endsWith(suffix + ".x") || name.endsWith(suffix + ".y"))) {
905
+ image_coordinate = name[name.length - 1];
906
+ name = name.slice(0, -2);
907
+ }
908
+ if (!name.endsWith(suffix)) form_field_unbound({ name });
909
+ name = name.slice(0, -suffix.length);
910
+ /** @type {'number' | 'boolean' | null} */
911
+ let type = null;
912
+ if (name.startsWith("n:")) {
913
+ name = name.slice(2);
914
+ type = "number";
915
+ } else if (name.startsWith("b:")) {
916
+ name = name.slice(2);
917
+ type = "boolean";
918
+ } else if (name.startsWith("i:")) {
919
+ name = name.slice(2);
920
+ type = "number";
921
+ }
922
+ const is_array = name.endsWith("[]");
923
+ if (is_array) name = name.slice(0, -2);
924
+ if (image_coordinate) name += "." + image_coordinate;
925
+ return {
926
+ name,
927
+ type,
928
+ is_array
929
+ };
930
+ }
931
+ /**
932
+ * @param {'number' | 'boolean' | null} type
933
+ * @param {any} value
934
+ * @returns {any}
935
+ */
936
+ function coerce_form_value(type, value) {
937
+ if (Array.isArray(value)) return value.map((value) => coerce_form_value(type, value));
938
+ if (type === "number") return value === "" ? void 0 : parseFloat(value);
939
+ if (type === "boolean") return value === "on";
940
+ return value;
941
+ }
942
+ /** Pass this to set_nested_value to delete the last part of the given path */
943
+ var DELETE_KEY = {};
944
+ /**
945
+ * Convert `FormData` into a POJO
946
+ * @param {string} form_id
947
+ * @param {FormData} data
948
+ */
949
+ function convert_formdata(form_id, data) {
950
+ /** @type {Record<string, any>} */
951
+ const result = {};
952
+ for (const field_name of data.keys()) {
953
+ /** @type {any[]} */
954
+ const values = data.getAll(field_name);
955
+ const field = parse_form_key(form_id, field_name);
956
+ const entries = values.filter((entry) => typeof entry === "string" || entry.name !== "" || entry.size > 0);
957
+ if (entries.length === 0 && !field.is_array) continue;
958
+ if (entries.length > 1 && !field.is_array) form_field_duplicate({
959
+ name: field.name,
960
+ count: String(entries.length)
961
+ });
962
+ set_nested_value(result, field, coerce_form_value(field.type, field.is_array ? entries : entries[0]));
963
+ }
964
+ return result;
965
+ }
966
+ var BINARY_FORM_CONTENT_TYPE = "application/x-sveltekit-formdata";
967
+ var BINARY_FORM_VERSION = 0;
968
+ var HEADER_BYTES = 7;
969
+ /**
970
+ * @param {Request} request
971
+ * @param {string} form_id
972
+ * @returns {Promise<{ data: Record<string, any>; meta: BinaryFormMeta; form_data: FormData | null }>}
973
+ */
974
+ async function deserialize_binary_form(request, form_id) {
975
+ if (request.headers.get("content-type") !== "application/x-sveltekit-formdata") {
976
+ const form_data = await request.formData();
977
+ return {
978
+ data: convert_formdata(form_id, form_data),
979
+ meta: {},
980
+ form_data
981
+ };
982
+ }
983
+ if (!request.body) throw deserialize_error("no body");
984
+ const reader = request.body.getReader();
985
+ /** @type {Array<Promise<Uint8Array<ArrayBuffer> | undefined>>} */
986
+ const chunks = [];
987
+ /**
988
+ * @param {number} index
989
+ * @returns {Promise<Uint8Array<ArrayBuffer> | undefined>}
990
+ */
991
+ function get_chunk(index) {
992
+ if (index in chunks) return chunks[index];
993
+ let i = chunks.length;
994
+ while (i <= index) {
995
+ const previous = chunks[i - 1] ?? Promise.resolve(void 0);
996
+ chunks[i] = previous.then(() => reader.read()).then((chunk) => chunk.value);
997
+ i++;
998
+ }
999
+ return chunks[index];
1000
+ }
1001
+ /**
1002
+ * @param {number} offset
1003
+ * @param {number} length
1004
+ * @returns {Promise<Uint8Array | null>}
1005
+ */
1006
+ async function get_buffer(offset, length) {
1007
+ /** @type {Uint8Array<ArrayBuffer>[]} */
1008
+ const parts = [];
1009
+ let total = 0;
1010
+ for await (const part of read_range(get_chunk, offset, length)) {
1011
+ parts.push(part);
1012
+ total += part.byteLength;
1013
+ }
1014
+ if (total < length || parts.length === 0) return null;
1015
+ if (parts.length === 1) return parts[0];
1016
+ const buffer = new Uint8Array(length);
1017
+ let cursor = 0;
1018
+ for (const part of parts) {
1019
+ buffer.set(part, cursor);
1020
+ cursor += part.byteLength;
1021
+ }
1022
+ return buffer;
1023
+ }
1024
+ const header = await get_buffer(0, HEADER_BYTES);
1025
+ if (!header) throw deserialize_error("too short");
1026
+ if (header[0] !== BINARY_FORM_VERSION) throw deserialize_error(`got version ${header[0]}, expected version ${BINARY_FORM_VERSION}`);
1027
+ const header_view = new DataView(header.buffer, header.byteOffset, header.byteLength);
1028
+ const data_length = header_view.getUint32(1, true);
1029
+ const file_offsets_length = header_view.getUint16(5, true);
1030
+ const data_buffer = await get_buffer(HEADER_BYTES, data_length);
1031
+ if (!data_buffer) throw deserialize_error("data too short");
1032
+ /** @type {Array<number | undefined>} */
1033
+ let file_offsets;
1034
+ /** @type {number} */
1035
+ let files_start_offset;
1036
+ if (file_offsets_length > 0) {
1037
+ const file_offsets_buffer = await get_buffer(HEADER_BYTES + data_length, file_offsets_length);
1038
+ if (!file_offsets_buffer) throw deserialize_error("file offset table too short");
1039
+ const parsed_offsets = JSON.parse(text_decoder.decode(file_offsets_buffer));
1040
+ if (!Array.isArray(parsed_offsets) || parsed_offsets.some((n) => typeof n !== "number" || !Number.isInteger(n) || n < 0)) throw deserialize_error("invalid file offset table");
1041
+ file_offsets = parsed_offsets;
1042
+ files_start_offset = HEADER_BYTES + data_length + file_offsets_length;
1043
+ }
1044
+ /** @type {Array<{ offset: number, size: number }>} */
1045
+ const file_spans = [];
1046
+ const [data, meta] = parse$1(text_decoder.decode(data_buffer), { File: ([name, type, size, last_modified, index]) => {
1047
+ if (typeof name !== "string" || typeof type !== "string" || !Number.isSafeInteger(size) || size < 0 || !Number.isSafeInteger(last_modified) || !Number.isSafeInteger(index) || index < 0) throw deserialize_error("invalid file metadata");
1048
+ let offset = file_offsets[index];
1049
+ if (offset === void 0) throw deserialize_error("duplicate file offset table index");
1050
+ file_offsets[index] = void 0;
1051
+ offset += files_start_offset;
1052
+ file_spans.push({
1053
+ offset,
1054
+ size
1055
+ });
1056
+ return new Proxy(new LazyFile(name, type, size, last_modified, get_chunk, offset), { getPrototypeOf() {
1057
+ return File.prototype;
1058
+ } });
1059
+ } });
1060
+ file_spans.sort((a, b) => a.offset - b.offset || a.size - b.size);
1061
+ for (let i = 1; i < file_spans.length; i++) {
1062
+ const previous = file_spans[i - 1];
1063
+ const current = file_spans[i];
1064
+ const previous_end = previous.offset + previous.size;
1065
+ if (previous_end < current.offset) throw deserialize_error("gaps in file data");
1066
+ if (previous_end > current.offset) throw deserialize_error("overlapping file data");
1067
+ }
1068
+ (async () => {
1069
+ let has_more = true;
1070
+ while (has_more) has_more = !!await get_chunk(chunks.length);
1071
+ })().catch(noop);
1072
+ return {
1073
+ data,
1074
+ meta,
1075
+ form_data: null
1076
+ };
1077
+ }
1078
+ /**
1079
+ * @param {string} message
1080
+ */
1081
+ function deserialize_error(message) {
1082
+ return new SvelteKitError(400, "Bad Request", `Could not deserialize binary form: ${message}`);
1083
+ }
1084
+ /**
1085
+ * Yields the chunks that make up the byte range `[offset, offset + length)`,
1086
+ * trimmed to its boundaries. Ends early if the underlying data runs out.
1087
+ * @param {(index: number) => Promise<Uint8Array<ArrayBuffer> | undefined>} get_chunk
1088
+ * @param {number} offset
1089
+ * @param {number} length
1090
+ * @returns {AsyncGenerator<Uint8Array<ArrayBuffer>, void, void>}
1091
+ */
1092
+ async function* read_range(get_chunk, offset, length) {
1093
+ let chunk_start = 0;
1094
+ for (let index = 0;; index++) {
1095
+ const chunk = await get_chunk(index);
1096
+ if (!chunk) return;
1097
+ const chunk_end = chunk_start + chunk.byteLength;
1098
+ if (chunk_end > offset) {
1099
+ yield chunk.subarray(Math.max(0, offset - chunk_start), Math.min(chunk.byteLength, offset + length - chunk_start));
1100
+ if (offset + length <= chunk_end) return;
1101
+ }
1102
+ chunk_start = chunk_end;
1103
+ }
1104
+ }
1105
+ /** @implements {File} */
1106
+ var LazyFile = class LazyFile {
1107
+ /** @type {(index: number) => Promise<Uint8Array<ArrayBuffer> | undefined>} */
1108
+ #get_chunk;
1109
+ /** @type {number} */
1110
+ #offset;
1111
+ /**
1112
+ * @param {string} name
1113
+ * @param {string} type
1114
+ * @param {number} size
1115
+ * @param {number} last_modified
1116
+ * @param {(index: number) => Promise<Uint8Array<ArrayBuffer> | undefined>} get_chunk
1117
+ * @param {number} offset
1118
+ */
1119
+ constructor(name, type, size, last_modified, get_chunk, offset) {
1120
+ this.name = name;
1121
+ this.type = type;
1122
+ this.size = size;
1123
+ this.lastModified = last_modified;
1124
+ this.webkitRelativePath = "";
1125
+ this.#get_chunk = get_chunk;
1126
+ this.#offset = offset;
1127
+ this.arrayBuffer = this.arrayBuffer.bind(this);
1128
+ this.bytes = this.bytes.bind(this);
1129
+ this.slice = this.slice.bind(this);
1130
+ this.stream = this.stream.bind(this);
1131
+ this.text = this.text.bind(this);
1132
+ }
1133
+ /** @type {ArrayBuffer | undefined} */
1134
+ #buffer;
1135
+ async arrayBuffer() {
1136
+ this.#buffer ??= await new Response(this.stream()).arrayBuffer();
1137
+ return this.#buffer;
1138
+ }
1139
+ async bytes() {
1140
+ return new Uint8Array(await this.arrayBuffer());
1141
+ }
1142
+ /**
1143
+ * @param {number=} start
1144
+ * @param {number=} end
1145
+ * @param {string=} contentType
1146
+ */
1147
+ slice(start = 0, end = this.size, contentType = this.type) {
1148
+ if (start < 0) start = Math.max(this.size + start, 0);
1149
+ else start = Math.min(start, this.size);
1150
+ if (end < 0) end = Math.max(this.size + end, 0);
1151
+ else end = Math.min(end, this.size);
1152
+ const size = Math.max(end - start, 0);
1153
+ return new LazyFile(this.name, contentType, size, this.lastModified, this.#get_chunk, this.#offset + start);
1154
+ }
1155
+ stream() {
1156
+ const range = read_range(this.#get_chunk, this.#offset, this.size);
1157
+ const size = this.size;
1158
+ return stream_from_iterable((async function* () {
1159
+ let cursor = 0;
1160
+ for await (const chunk of range) {
1161
+ cursor += chunk.byteLength;
1162
+ yield chunk;
1163
+ }
1164
+ if (cursor < size) throw new Error("incomplete file data");
1165
+ })());
1166
+ }
1167
+ async text() {
1168
+ return text_decoder.decode(await this.arrayBuffer());
1169
+ }
1170
+ };
1171
+ var path_regex = /^[a-zA-Z_$]\w*(\.[a-zA-Z_$]\w*|\[\d+\])*$/;
1172
+ /**
1173
+ * @param {string} path
1174
+ */
1175
+ function split_path(path) {
1176
+ if (!path_regex.test(path)) form_field_invalid_name({ name: path });
1177
+ return path.split(/\.|\[|\]/).filter(Boolean);
1178
+ }
1179
+ /**
1180
+ * Check if a property key is dangerous and could lead to prototype pollution
1181
+ * @param {string} key
1182
+ */
1183
+ function check_prototype_pollution(key) {
1184
+ if (key === "__proto__" || key === "constructor" || key === "prototype") form_field_forbidden_key({ key });
1185
+ }
1186
+ /**
1187
+ * Sets a value in a nested object using an array of keys, mutating the original object.
1188
+ * @param {Record<string, any>} object
1189
+ * @param {string[]} keys
1190
+ * @param {any} value
1191
+ */
1192
+ function deep_set(object, keys, value) {
1193
+ let current = object;
1194
+ for (let i = 0; i < keys.length - 1; i += 1) {
1195
+ const key = keys[i];
1196
+ check_prototype_pollution(key);
1197
+ const is_array = /^\d+$/.test(keys[i + 1]);
1198
+ const inner = Object.hasOwn(current, key) ? current[key] : void 0;
1199
+ const exists = inner != null;
1200
+ if (exists && is_array !== Array.isArray(inner)) form_field_array_conflict({ key: keys[i + 1] });
1201
+ if (!exists) {
1202
+ if (value === DELETE_KEY) return;
1203
+ current[key] = is_array ? [] : {};
1204
+ }
1205
+ current = current[key];
1206
+ }
1207
+ const final_key = keys[keys.length - 1];
1208
+ check_prototype_pollution(final_key);
1209
+ if (value === DELETE_KEY) delete current[final_key];
1210
+ else current[final_key] = value;
1211
+ }
1212
+ /**
1213
+ * @param {StandardSchemaV1.Issue} issue
1214
+ * @param {boolean} server Whether this issue came from server validation
1215
+ */
1216
+ function normalize_issue(issue, server = false) {
1217
+ /** @type {InternalRemoteFormIssue} */
1218
+ const normalized = {
1219
+ name: "",
1220
+ path: [],
1221
+ message: issue.message,
1222
+ server
1223
+ };
1224
+ if (issue.path !== void 0) {
1225
+ let name = "";
1226
+ for (const segment of issue.path) {
1227
+ const key = typeof segment === "object" ? segment.key : segment;
1228
+ normalized.path.push(key);
1229
+ if (typeof key === "number") name += `[${key}]`;
1230
+ else if (typeof key === "string") name += name === "" ? key : "." + key;
1231
+ }
1232
+ normalized.name = name;
1233
+ }
1234
+ return normalized;
1235
+ }
1236
+ /**
1237
+ * @param {InternalRemoteFormIssue[]} issues
1238
+ */
1239
+ function flatten_issues(issues) {
1240
+ /** @type {Record<string, InternalRemoteFormIssue[]>} */
1241
+ const result = Object.create(null);
1242
+ for (const issue of issues) {
1243
+ (result.$ ??= []).push(issue);
1244
+ let name = "";
1245
+ if (issue.path !== void 0) for (const key of issue.path) {
1246
+ if (typeof key === "number") name += `[${key}]`;
1247
+ else if (typeof key === "string") name += name === "" ? key : "." + key;
1248
+ (result[name] ??= []).push(issue);
1249
+ }
1250
+ }
1251
+ return result;
1252
+ }
1253
+ /**
1254
+ * Gets a nested value from an object using a path array
1255
+ * @param {Record<string, any>} object
1256
+ * @param {(string | number)[]} path
1257
+ * @returns {any}
1258
+ */
1259
+ function deep_get(object, path) {
1260
+ let current = object;
1261
+ for (const key of path) {
1262
+ if (current === null || typeof current !== "object" || !Object.hasOwn(current, key)) return;
1263
+ current = current[key];
1264
+ }
1265
+ return current;
1266
+ }
1267
+ /** name prefixes that tell the server which type to coerce a submitted string to */
1268
+ var type_prefixes = {
1269
+ number: "n:",
1270
+ boolean: "b:"
1271
+ };
1272
+ /**
1273
+ * adds props; a function becomes a getter that is computed each time it is read
1274
+ * @param {Record<string, any>} base_props
1275
+ * @param {Record<string, unknown>} props
1276
+ */
1277
+ function add_props(base_props, props) {
1278
+ for (const prop in props) {
1279
+ const value = props[prop];
1280
+ if (typeof value === "function") Object.defineProperty(base_props, prop, {
1281
+ enumerable: true,
1282
+ get: value
1283
+ });
1284
+ else base_props[prop] = value;
1285
+ }
1286
+ return base_props;
1287
+ }
1288
+ /**
1289
+ * @param {string} type
1290
+ * @param {boolean} is_array
1291
+ * @param {unknown} input_value
1292
+ */
1293
+ function get_type_prefix(type, is_array, input_value) {
1294
+ if (type === "number" || type === "range") return "n:";
1295
+ if (type === "image") return "i:";
1296
+ if (type === "checkbox" && !is_array) return "b:";
1297
+ if (type === "hidden" || type === "submit") return type_prefixes[typeof input_value] ?? "";
1298
+ return "";
1299
+ }
1300
+ /**
1301
+ * A deep-clone implementation specifically for form data, where
1302
+ * we don't need to worry about cycles and whatnot
1303
+ * @param {any} value
1304
+ * @returns {any}
1305
+ */
1306
+ function deep_clone(value) {
1307
+ if (value !== null && typeof value === "object") {
1308
+ if (value instanceof Date) return new Date(value.getTime());
1309
+ if (value instanceof File) return value;
1310
+ if (Array.isArray(value)) return value.map(deep_clone);
1311
+ /** @type {Record<string, any>} */
1312
+ const clone = {};
1313
+ for (const key of Object.keys(value)) clone[key] = deep_clone(value[key]);
1314
+ return clone;
1315
+ }
1316
+ return value;
1317
+ }
1318
+ /** @type {ProxyHandler<object> | null} */
1319
+ var dev_traps = null;
1320
+ /** @param {InternalRemoteFormIssue} issue */
1321
+ var public_issue = (issue) => ({
1322
+ path: issue.path,
1323
+ message: issue.message
1324
+ });
1325
+ /** @typedef {{
1326
+ * form_id: string,
1327
+ * get: () => Record<string, any>,
1328
+ * set: (path: (string | number)[], value: any) => void,
1329
+ * get_issues: (path?: (string | number)[], all?: boolean) => Record<string, InternalRemoteFormIssue[]>,
1330
+ * get_touched: () => Record<string, boolean>,
1331
+ * get_dirty: () => Record<string, boolean>
1332
+ * }} FieldContext */
1333
+ /**
1334
+ * @param {FieldContext} context
1335
+ * @param {(string | number)[]} path
1336
+ * @param {string} prop
1337
+ * @returns {any} a method of the field at `path`, or undefined for a nested field
1338
+ */
1339
+ function create_field_method(context, path, prop) {
1340
+ switch (prop) {
1341
+ case "set": return (value) => {
1342
+ context.set(path, value);
1343
+ return value;
1344
+ };
1345
+ case "value": return () => deep_clone(deep_get(context.get(), path));
1346
+ case "issues":
1347
+ case "allIssues": {
1348
+ const key = build_path_string(path);
1349
+ const all = prop === "allIssues";
1350
+ return () => {
1351
+ const issues = context.get_issues(path, all)[key === "" ? "$" : key];
1352
+ if (all) return issues?.map(public_issue);
1353
+ const own = issues?.filter((issue) => issue.name === key).map(public_issue);
1354
+ return own?.length ? own : void 0;
1355
+ };
1356
+ }
1357
+ case "touched":
1358
+ case "dirty": {
1359
+ const key = build_path_string(path);
1360
+ return () => {
1361
+ const object = prop === "dirty" ? context.get_dirty() : context.get_touched();
1362
+ if (Object.hasOwn(object, key)) return true;
1363
+ for (const candidate in object) {
1364
+ if (!Object.hasOwn(object, candidate)) continue;
1365
+ if (key === "") return true;
1366
+ if (!candidate.startsWith(key)) continue;
1367
+ const next = candidate[key.length];
1368
+ if (next === "." || next === "[") return true;
1369
+ }
1370
+ return false;
1371
+ };
1372
+ }
1373
+ case "as": {
1374
+ const key = build_path_string(path);
1375
+ /**
1376
+ * the field's value, or `fallback` until the field has been edited
1377
+ * (without a fallback there is nothing to suppress, so `dirty` is not read)
1378
+ * @param {unknown} [fallback]
1379
+ */
1380
+ const read = (fallback) => deep_get(context.get(), path) ?? (fallback !== void 0 && Object.hasOwn(context.get_dirty(), key) ? void 0 : fallback);
1381
+ /**
1382
+ * @param {string} type
1383
+ * @param {unknown} [input_value]
1384
+ * @param {boolean} [checked]
1385
+ */
1386
+ return (type, input_value, checked) => {
1387
+ const is_array = type === "file multiple" || type === "select multiple" || type === "checkbox" && typeof input_value === "string";
1388
+ /** @type {Record<string, any>} */
1389
+ const base_props = {
1390
+ name: get_type_prefix(type, is_array, input_value) + key + (is_array ? "[]" : "") + "/" + context.form_id,
1391
+ get "aria-invalid"() {
1392
+ const issues = context.get_issues();
1393
+ return key in issues ? "true" : void 0;
1394
+ }
1395
+ };
1396
+ if (type !== "text" && type !== "select" && type !== "select multiple") base_props.type = type === "file multiple" ? "file" : type;
1397
+ if (type === "submit" || type === "hidden") return add_props(base_props, { value: typeof input_value === "boolean" ? input_value ? "on" : "off" : input_value });
1398
+ if (type === "select" || type === "select multiple") return add_props(base_props, {
1399
+ multiple: is_array,
1400
+ value: () => {
1401
+ const value = read(input_value);
1402
+ return Array.isArray(value) ? [...value] : value;
1403
+ }
1404
+ });
1405
+ if (type === "checkbox" || type === "radio") {
1406
+ if (type === "radio" || is_array) base_props.value = input_value ?? "on";
1407
+ else checked = input_value;
1408
+ return add_props(base_props, {
1409
+ defaultChecked: checked,
1410
+ checked: () => {
1411
+ const value = read();
1412
+ if (value == null) return read(checked);
1413
+ if (type === "radio") return value === input_value;
1414
+ if (is_array) return value.includes(input_value);
1415
+ return value;
1416
+ }
1417
+ });
1418
+ }
1419
+ if (type === "file" || type === "file multiple") return add_props(base_props, {
1420
+ multiple: is_array,
1421
+ files: () => {
1422
+ const value = read();
1423
+ const files = value instanceof File ? [value] : value;
1424
+ if (!Array.isArray(files) || !files.every((f) => f instanceof File)) return null;
1425
+ if (typeof DataTransfer === "undefined") return Object.assign({ length: files.length }, files);
1426
+ const transfer = new DataTransfer();
1427
+ for (const file of files) transfer.items.add(file);
1428
+ return transfer.files;
1429
+ }
1430
+ });
1431
+ if (type === "image") return base_props;
1432
+ return add_props(base_props, {
1433
+ defaultValue: input_value,
1434
+ value: () => String(read(input_value) ?? "")
1435
+ });
1436
+ };
1437
+ }
1438
+ }
1439
+ }
1440
+ /**
1441
+ * Creates a proxy-based field accessor for form data
1442
+ * @param {FieldContext} context
1443
+ * @param {any} target - Function or empty POJO
1444
+ * @param {(string | number)[]} path - Current access path
1445
+ * @returns {any} Proxy object with name(), value(), and issues() methods
1446
+ */
1447
+ function create_field_proxy(context, target = {}, path = []) {
1448
+ return new Proxy(target, {
1449
+ ...dev_traps,
1450
+ get(target, prop) {
1451
+ if (typeof prop === "symbol") return target[prop];
1452
+ const next = [...path, /^\d+$/.test(prop) ? parseInt(prop, 10) : prop];
1453
+ return create_field_proxy(context, create_field_method(context, path, prop), next);
1454
+ }
1455
+ });
1456
+ }
1457
+ /**
1458
+ * Builds a path string from an array of path segments
1459
+ * @param {(string | number)[]} path
1460
+ * @returns {string}
1461
+ */
1462
+ function build_path_string(path) {
1463
+ let result = "";
1464
+ for (const segment of path) if (typeof segment === "number") result += `[${segment}]`;
1465
+ else result += result === "" ? segment : "." + segment;
1466
+ return result;
1467
+ }
1468
+ //#endregion
1469
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/utils/http.js
1470
+ /**
1471
+ * Given an Accept header and a list of possible content types, pick
1472
+ * the most suitable one to respond with
1473
+ * @param {string} accept
1474
+ * @param {string[]} types
1475
+ */
1476
+ function negotiate(accept, types) {
1477
+ /** @type {Array<{ type: string, subtype: string, q: number, i: number }>} */
1478
+ const parts = [];
1479
+ accept.split(",").forEach((str, i) => {
1480
+ const match = /^[ \t]*([^/ \t]+)\/([^; \t]+)[ \t]*(?:;[ \t]*q=([0-9.]+))?/.exec(str);
1481
+ if (match) {
1482
+ const [, type, subtype, q = "1"] = match;
1483
+ parts.push({
1484
+ type,
1485
+ subtype,
1486
+ q: +q,
1487
+ i
1488
+ });
1489
+ }
1490
+ });
1491
+ parts.sort((a, b) => {
1492
+ if (a.q !== b.q) return b.q - a.q;
1493
+ if (a.subtype === "*" !== (b.subtype === "*")) return a.subtype === "*" ? 1 : -1;
1494
+ if (a.type === "*" !== (b.type === "*")) return a.type === "*" ? 1 : -1;
1495
+ return a.i - b.i;
1496
+ });
1497
+ let accepted;
1498
+ let min_priority = Infinity;
1499
+ for (const mimetype of types) {
1500
+ const [type, subtype] = mimetype.split("/");
1501
+ const priority = parts.findIndex((part) => (part.type === type || part.type === "*") && (part.subtype === subtype || part.subtype === "*"));
1502
+ if (priority !== -1 && priority < min_priority) {
1503
+ accepted = mimetype;
1504
+ min_priority = priority;
1505
+ }
1506
+ }
1507
+ return accepted;
1508
+ }
1509
+ /**
1510
+ * Returns `true` if a `content-type` header value is one of the given types, ignoring
1511
+ * parameters such as `charset` and comparing case-insensitively
1512
+ * @param {string | null | undefined} header
1513
+ * @param {...string} types
1514
+ */
1515
+ function matches_content_type(header, ...types) {
1516
+ const type = header?.split(";", 1)[0].trim() ?? "";
1517
+ return types.includes(type.toLowerCase());
1518
+ }
1519
+ /**
1520
+ * @param {Request} request
1521
+ */
1522
+ function is_form_content_type(request) {
1523
+ return matches_content_type(request.headers.get("content-type"), "application/x-www-form-urlencoded", "multipart/form-data", "text/plain", BINARY_FORM_CONTENT_TYPE);
1524
+ }
1525
+ //#endregion
1526
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/runtime/app/internal/transport.js
1527
+ /** @import { Transport } from '@sveltejs/kit/hooks' */
1528
+ /** @type {(thing: any) => string} */
1529
+ var uneval = () => {
1530
+ throw new Error("");
1531
+ };
1532
+ /** @type {(data: any) => string} */
1533
+ var stringify = () => {
1534
+ throw new Error("");
1535
+ };
1536
+ /** @type {(data: string) => any} */
1537
+ var parse = () => {
1538
+ throw new Error("");
1539
+ };
1540
+ /** @type {Record<string, (data: any) => any>} */
1541
+ var encoders = {};
1542
+ /** @type {Record<string, (data: any) => any>} */
1543
+ var decoders = {};
1544
+ var has_custom_transporters = false;
1545
+ /**
1546
+ *
1547
+ * @param {Transport} transport
1548
+ */
1549
+ function init_transport(transport) {
1550
+ const transporters = Object.entries(transport);
1551
+ has_custom_transporters = transporters.length > 0;
1552
+ /** @param {unknown} thing */
1553
+ const replacer = (thing) => {
1554
+ for (const key of Object.keys(transport)) {
1555
+ const encoded = transport[key].encode(thing);
1556
+ if (encoded) return `app.decode('${key}', ${uneval$1(encoded, replacer)})`;
1557
+ }
1558
+ };
1559
+ encoders = Object.fromEntries(transporters.map(([k, v]) => [k, v.encode]));
1560
+ decoders = Object.fromEntries(transporters.map(([k, v]) => [k, v.decode]));
1561
+ uneval = (data) => uneval$1(data, replacer);
1562
+ stringify = (data) => stringify$1(data, encoders);
1563
+ parse = (data) => parse$1(data, decoders);
1564
+ }
1565
+ //#endregion
1566
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/runtime/shared.js
1567
+ /**
1568
+ * @param {string} route_id
1569
+ * @param {string} dep
1570
+ */
1571
+ function validate_depends(route_id, dep) {
1572
+ const match = /^(moz-icon|view-source|jar):/.exec(dep);
1573
+ if (match) depends_special_scheme({
1574
+ route: route_id,
1575
+ dependency: dep,
1576
+ scheme: match[1]
1577
+ });
1578
+ }
1579
+ /**
1580
+ * Same-origin urls are keyed by path, so prerendered pages can be served from any origin
1581
+ * @param {URL} url
1582
+ * @param {{ origin: string }} page
1583
+ */
1584
+ function fetch_cache_url(url, page) {
1585
+ return url.origin === page.origin ? url.href.slice(page.origin.length) : url.href;
1586
+ }
1587
+ var INVALIDATED_PARAM = "x-sveltekit-invalidated";
1588
+ var TRAILING_SLASH_PARAM = "x-sveltekit-trailing-slash";
1589
+ /**
1590
+ * @param {any} data
1591
+ * @param {string} [location_description]
1592
+ */
1593
+ function validate_load_response(data, location_description) {
1594
+ if (data != null && Object.getPrototypeOf(data) !== Object.prototype) load_invalid_response({
1595
+ location: String(location_description),
1596
+ type: typeof data !== "object" ? `a ${typeof data}` : data instanceof Response ? "a Response object" : Array.isArray(data) ? "an array" : "a non-plain object"
1597
+ });
1598
+ }
1599
+ var object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
1600
+ /**
1601
+ * @param {unknown} thing
1602
+ * @returns {thing is Record<PropertyKey, unknown>}
1603
+ */
1604
+ function is_plain_object(thing) {
1605
+ if (typeof thing !== "object" || thing === null) return false;
1606
+ const proto = Object.getPrototypeOf(thing);
1607
+ return proto === Object.prototype || proto === null || Object.getPrototypeOf(proto) === null || Object.getOwnPropertyNames(proto).sort().join("\0") === object_proto_names;
1608
+ }
1609
+ /**
1610
+ * @param {Record<string, any>} value
1611
+ * @param {Map<object, any>} clones
1612
+ */
1613
+ function to_sorted(value, clones) {
1614
+ const clone = Object.getPrototypeOf(value) === null ? Object.create(null) : {};
1615
+ clones.set(value, clone);
1616
+ Object.defineProperty(clone, remote_arg_marker, { value: true });
1617
+ for (const key of Object.keys(value).sort()) {
1618
+ const property = value[key];
1619
+ Object.defineProperty(clone, key, {
1620
+ value: clones.get(property) ?? property,
1621
+ enumerable: true,
1622
+ configurable: true,
1623
+ writable: true
1624
+ });
1625
+ }
1626
+ return clone;
1627
+ }
1628
+ var remote_object = "__skrao";
1629
+ var remote_map = "__skram";
1630
+ var remote_set = "__skras";
1631
+ var remote_file = "__skraf";
1632
+ var remote_regex_guard = "__skrag";
1633
+ var remote_arg_marker = Symbol(remote_object);
1634
+ /**
1635
+ * @param {boolean} sort
1636
+ */
1637
+ function create_remote_arg_reducers(sort) {
1638
+ /** @type {Record<string, (value: unknown) => unknown>} */
1639
+ const remote_fns_reducers = {
1640
+ /** @param {unknown} value */
1641
+ [remote_regex_guard]: (value) => {
1642
+ if (value instanceof RegExp) remote_argument_unsupported({ type: "Regular expressions" });
1643
+ } };
1644
+ if (sort) {
1645
+ const clones = /* @__PURE__ */ new Map();
1646
+ /** @type {(value: unknown) => Array<[unknown, unknown]> | undefined} */
1647
+ remote_fns_reducers[remote_map] = (value) => {
1648
+ if (!(value instanceof Map)) return;
1649
+ /** @type {Array<[string, string]>} */
1650
+ const entries = [];
1651
+ for (const [key, val] of value) entries.push([stringify(key), stringify(val)]);
1652
+ return entries.sort(([a1, a2], [b1, b2]) => {
1653
+ if (a1 < b1) return -1;
1654
+ if (a1 > b1) return 1;
1655
+ if (a2 < b2) return -1;
1656
+ if (a2 > b2) return 1;
1657
+ return 0;
1658
+ });
1659
+ };
1660
+ /** @type {(value: unknown) => unknown[] | undefined} */
1661
+ remote_fns_reducers[remote_set] = (value) => {
1662
+ if (!(value instanceof Set)) return;
1663
+ /** @type {string[]} */
1664
+ const items = [];
1665
+ for (const item of value) items.push(stringify(item));
1666
+ items.sort();
1667
+ return items;
1668
+ };
1669
+ /** @type {(value: unknown) => Record<PropertyKey, unknown> | undefined} */
1670
+ remote_fns_reducers[remote_object] = (value) => {
1671
+ if (!is_plain_object(value)) return;
1672
+ if (Object.hasOwn(value, remote_arg_marker)) return;
1673
+ if (clones.has(value)) return clones.get(value);
1674
+ return to_sorted(value, clones);
1675
+ };
1676
+ }
1677
+ const all_reducers = {
1678
+ ...encoders,
1679
+ ...remote_fns_reducers
1680
+ };
1681
+ /** @type {(value: unknown) => string} */
1682
+ const stringify = (value) => stringify$1(value, all_reducers);
1683
+ return all_reducers;
1684
+ }
1685
+ function create_remote_arg_revivers() {
1686
+ const remote_fns_revivers = {
1687
+ /** @type {(value: unknown) => unknown} */
1688
+ [remote_object]: (value) => value,
1689
+ /** @type {(value: unknown) => Map<unknown, unknown>} */
1690
+ [remote_map]: (value) => {
1691
+ if (!Array.isArray(value)) throw new Error("Invalid data for Map reviver");
1692
+ const map = /* @__PURE__ */ new Map();
1693
+ for (const item of value) {
1694
+ if (!Array.isArray(item) || item.length !== 2 || typeof item[0] !== "string" || typeof item[1] !== "string") throw new Error("Invalid data for Map reviver");
1695
+ const [key, val] = item;
1696
+ map.set(parse(key), parse(val));
1697
+ }
1698
+ return map;
1699
+ },
1700
+ /** @type {(value: unknown) => Set<unknown>} */
1701
+ [remote_set]: (value) => {
1702
+ if (!Array.isArray(value)) throw new Error("Invalid data for Set reviver");
1703
+ const set = /* @__PURE__ */ new Set();
1704
+ for (const item of value) {
1705
+ if (typeof item !== "string") throw new Error("Invalid data for Set reviver");
1706
+ set.add(parse(item));
1707
+ }
1708
+ return set;
1709
+ },
1710
+ /** @type {(value: any) => File} */
1711
+ [remote_file]: (value) => {
1712
+ if (!value || typeof value !== "object" || typeof value.name !== "string" || typeof value.type !== "string" || typeof value.size !== "number" || typeof value.lastModified !== "number" || !(value.data instanceof ArrayBuffer)) throw new Error("Invalid data for File reviver");
1713
+ const { data, name, ...meta } = value;
1714
+ return new File([data], name, meta);
1715
+ }
1716
+ };
1717
+ const all_revivers = {
1718
+ ...decoders,
1719
+ ...remote_fns_revivers
1720
+ };
1721
+ /** @type {(data: string) => unknown} */
1722
+ const parse = (data) => parse$1(data, all_revivers);
1723
+ return all_revivers;
1724
+ }
1725
+ /**
1726
+ * Stringifies the argument (if any) for a remote function in such a way that
1727
+ * it is both a valid URL and a valid file name (necessary for prerendering).
1728
+ * @param {any} value
1729
+ */
1730
+ function stringify_remote_arg(value) {
1731
+ if (value === void 0) return "";
1732
+ return url_friendly_base64_encode(stringify$1(value, create_remote_arg_reducers(true)));
1733
+ }
1734
+ /**
1735
+ * Base64-encodes `string` in such a way that the result is safe to use
1736
+ * as both a URI component and a filename
1737
+ * @param {string} string
1738
+ */
1739
+ function url_friendly_base64_encode(string) {
1740
+ return base64_encode(text_encoder.encode(string)).replaceAll("=", "").replaceAll("+", "-").replaceAll("/", "_");
1741
+ }
1742
+ /**
1743
+ * Parses the argument (if any) for a remote function
1744
+ * @param {string} string
1745
+ */
1746
+ function parse_remote_arg(string) {
1747
+ if (!string) return void 0;
1748
+ return parse$1(text_decoder.decode(base64_decode(string.replaceAll("-", "+").replaceAll("_", "/"))), create_remote_arg_revivers());
1749
+ }
1750
+ /**
1751
+ * @param {string} id
1752
+ * @param {string} payload
1753
+ */
1754
+ function create_remote_key(id, payload) {
1755
+ return id + "/" + payload;
1756
+ }
1757
+ /**
1758
+ * @param {string} key
1759
+ * @returns {{ id: string; payload: string }}
1760
+ */
1761
+ function split_remote_key(key) {
1762
+ const i = key.lastIndexOf("/");
1763
+ if (i === -1) throw new Error(`Invalid remote key: ${key}`);
1764
+ return {
1765
+ id: key.slice(0, i),
1766
+ payload: key.slice(i + 1)
1767
+ };
1768
+ }
1769
+ //#endregion
1770
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/utils/error.js
1771
+ /**
1772
+ * @param {Error} error
1773
+ * @param {string} stack
1774
+ * @returns {string | undefined}
1775
+ */
1776
+ function set_error_stack(error, stack) {
1777
+ try {
1778
+ Reflect.set(error, "stack", stack);
1779
+ } catch {}
1780
+ return error.stack;
1781
+ }
1782
+ /**
1783
+ * @param {unknown} err
1784
+ * @return {Error}
1785
+ */
1786
+ function coalesce_to_error(err) {
1787
+ return err instanceof Error || err && err.name && err.message ? err : new Error(JSON.stringify(err));
1788
+ }
1789
+ /**
1790
+ * This is an identity function that exists to make TypeScript less
1791
+ * paranoid about people throwing things that aren't errors, which
1792
+ * frankly is not something we should care about
1793
+ * @param {unknown} error
1794
+ */
1795
+ function normalize_error(error) {
1796
+ return error;
1797
+ }
1798
+ /**
1799
+ * @param {unknown} error
1800
+ */
1801
+ function get_status(error) {
1802
+ return error instanceof HttpError || error instanceof SvelteKitError ? error.status : 500;
1803
+ }
1804
+ //#endregion
1805
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/messages/server-warnings.js
1806
+ /**
1807
+ * `cache-control` header contains empty directives. (While parsing `%value%`.)
1808
+ * @param {{ "value": string }} _values
1809
+ */
1810
+ function cache_control_empty_directive(_values) {
1811
+ console.warn("https://svelte.dev/e/kit/cache_control_empty_directive");
1812
+ }
1813
+ /**
1814
+ * Invalid `cache-control` directive `%directive%`. Did you mean one of: %directives%? (While parsing `%value%`.)
1815
+ * @param {{ "directive": string; "directives": string; "value": string }} _values
1816
+ */
1817
+ function cache_control_invalid_directive(_values) {
1818
+ console.warn("https://svelte.dev/e/kit/cache_control_invalid_directive");
1819
+ }
1820
+ /**
1821
+ * Invalid `content-type` value `%type%`. (While parsing `%value%`.)
1822
+ * @param {{ "type": string; "value": string }} _values
1823
+ */
1824
+ function content_type_invalid(_values) {
1825
+ console.warn("https://svelte.dev/e/kit/content_type_invalid");
1826
+ }
1827
+ /**
1828
+ * `%name%` cookie does not exist for `%pathname%`, but was previously set at %paths%. Did you mean to set its `path` to `'/'` instead?
1829
+ * @param {{ "name": string; "pathname": string; "paths": string }} _values
1830
+ */
1831
+ function cookie_path_mismatch(_values) {
1832
+ console.warn("https://svelte.dev/e/kit/cookie_path_mismatch");
1833
+ }
1834
+ /**
1835
+ * The form action returned a value, but it isn't available in `page.form`, because SSR is off. To handle the returned value in CSR, enhance your form with `use:enhance`. See https://svelte.dev/docs/kit/form-actions#Progressive-enhancement-use:enhance
1836
+ * @param {void} _values
1837
+ */
1838
+ function form_action_data_without_ssr(_values) {
1839
+ console.warn("https://svelte.dev/e/kit/form_action_data_without_ssr");
1840
+ }
1841
+ /**
1842
+ * The form action returned an error, but `+error.svelte` wasn't rendered because SSR is off. To get the error page with CSR, enhance your form with `use:enhance`. See https://svelte.dev/docs/kit/form-actions#Progressive-enhancement-use:enhance
1843
+ * @param {void} _values
1844
+ */
1845
+ function form_action_error_without_ssr(_values) {
1846
+ console.warn("https://svelte.dev/e/kit/form_action_error_without_ssr");
1847
+ }
1848
+ /**
1849
+ * To use an async `handleError` hook to handle errors that occur during rendering, you must enable `compilerOptions.experimental.async` in the SvelteKit plugin of your Vite config. The returned error has been replaced with a generic object
1850
+ * @param {void} _values
1851
+ */
1852
+ function handle_error_async_without_async_svelte(_values) {
1853
+ console.warn("https://svelte.dev/e/kit/handle_error_async_without_async_svelte");
1854
+ }
1855
+ /**
1856
+ * `%id%`: %usage% in a promise handler after `load(...)` has returned will not cause the function to re-run when %change%
1857
+ * @param {{ "id": string; "usage": string; "change": string }} _values
1858
+ */
1859
+ function load_tracking_after_return(_values) {
1860
+ console.warn("https://svelte.dev/e/kit/load_tracking_after_return");
1861
+ }
1862
+ /**
1863
+ * Avoid calling `fetch` eagerly during server-side rendering — put your `fetch` calls inside `onMount` or a `load` function instead
1864
+ * @param {void} _values
1865
+ */
1866
+ function ssr_fetch_eager(_values) {
1867
+ console.warn("https://svelte.dev/e/kit/ssr_fetch_eager");
1868
+ }
1869
+ /**
1870
+ * Returning promises from server `load` functions will only work if `csr === true`
1871
+ * @param {void} _values
1872
+ */
1873
+ function streaming_without_csr(_values) {
1874
+ console.warn("https://svelte.dev/e/kit/streaming_without_csr");
1875
+ }
1876
+ /**
1877
+ * Removing comments in `transformPageChunk` can break Svelte's hydration
1878
+ * @param {void} _values
1879
+ */
1880
+ function transform_page_chunk_comments(_values) {
1881
+ console.warn("https://svelte.dev/e/kit/transform_page_chunk_comments");
1882
+ }
1883
+ //#endregion
1884
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/runtime/server/errors.js
1885
+ /**
1886
+ * @param {import('@sveltejs/kit').RequestEvent} event
1887
+ * @param {import('types').RequestState} state
1888
+ * @param {any} error
1889
+ * @returns {App.Error | Promise<App.Error>}
1890
+ */
1891
+ function handle_error_and_jsonify(event, state, error) {
1892
+ if (error instanceof HandledHttpError) return error.body;
1893
+ /** @type {import('@sveltejs/kit/hooks').CaughtError} */
1894
+ let caught;
1895
+ if (error instanceof HttpError) caught = {
1896
+ kind: "app",
1897
+ error: error.body
1898
+ };
1899
+ else if (error instanceof SvelteKitError) caught = {
1900
+ kind: "framework",
1901
+ error: {
1902
+ status: error.status,
1903
+ message: error.text
1904
+ }
1905
+ };
1906
+ else if (error instanceof ValidationError) caught = {
1907
+ kind: "validation",
1908
+ error: {
1909
+ status: 400,
1910
+ message: "Bad Request"
1911
+ },
1912
+ issues: error.issues
1913
+ };
1914
+ else {
1915
+ caught = {
1916
+ kind: "unknown",
1917
+ error
1918
+ };
1919
+ let e = error;
1920
+ while (e instanceof Error) {
1921
+ fix_stack_trace(e);
1922
+ e = e.cause;
1923
+ }
1924
+ }
1925
+ const fallback = caught.kind === "unknown" ? {
1926
+ status: 500,
1927
+ message: "Internal Error"
1928
+ } : caught.error;
1929
+ /**
1930
+ * The hook returns only the properties it wants to override; anything it omits
1931
+ * (including by returning nothing at all) is inherited from the caught error.
1932
+ * @param {Awaited<ReturnType<import('@sveltejs/kit/hooks').HandleServerError>>} body
1933
+ * @returns {App.Error}
1934
+ */
1935
+ function merge(body) {
1936
+ return {
1937
+ ...fallback,
1938
+ ...body
1939
+ };
1940
+ }
1941
+ let result;
1942
+ try {
1943
+ const input = {
1944
+ ...caught,
1945
+ event
1946
+ };
1947
+ result = with_request_store({
1948
+ event,
1949
+ state
1950
+ }, () => hooks.handleError(input));
1951
+ } catch (hook_error) {
1952
+ log_handle_error_hook_failure(error, hook_error);
1953
+ return {
1954
+ status: fallback.status,
1955
+ message: "Internal Error"
1956
+ };
1957
+ }
1958
+ if (result instanceof Promise) {
1959
+ if (state.is_in_render) {
1960
+ handle_error_async_without_async_svelte();
1961
+ result.catch((hook_error) => log_handle_error_hook_failure(error, hook_error));
1962
+ return {
1963
+ status: fallback.status,
1964
+ message: "Internal Error"
1965
+ };
1966
+ }
1967
+ return result.then(merge, (hook_error) => {
1968
+ log_handle_error_hook_failure(error, hook_error);
1969
+ return {
1970
+ status: fallback.status,
1971
+ message: "Internal Error"
1972
+ };
1973
+ });
1974
+ }
1975
+ return merge(result);
1976
+ }
1977
+ /**
1978
+ * @param {unknown} error
1979
+ * @param {unknown} hook_error
1980
+ */
1981
+ function log_handle_error_hook_failure(error, hook_error) {
1982
+ const failure = capture_error(() => handle_error_hook_failed(void 0, { cause: coalesce_to_error(hook_error) }));
1983
+ failure.stack = `${failure.name}: ${failure.message}`;
1984
+ console.error(failure);
1985
+ if (error instanceof SvelteKitError) console.error(`Original error: ${error.status} ${error.text}: ${error.message}`);
1986
+ else console.error("Original error:", error);
1987
+ }
1988
+ //#endregion
1989
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/runtime/server/utils.js
1990
+ /**
1991
+ * @param {Partial<Record<import('types').HttpMethod, any>>} mod
1992
+ * @param {import('types').HttpMethod} method
1993
+ */
1994
+ function method_not_allowed(mod, method) {
1995
+ return text(`${method} method not allowed`, {
1996
+ status: 405,
1997
+ headers: { allow: allowed_methods(mod).join(", ") }
1998
+ });
1999
+ }
2000
+ /** @param {Partial<Record<import('types').HttpMethod, any>>} mod */
2001
+ function allowed_methods(mod) {
2002
+ const allowed = ENDPOINT_METHODS.filter((method) => method in mod);
2003
+ if ("GET" in mod && !("HEAD" in mod)) allowed.push("HEAD");
2004
+ return allowed;
2005
+ }
2006
+ /**
2007
+ * @param {number} status
2008
+ * @param {string} location
2009
+ */
2010
+ function redirect_response(status, location) {
2011
+ return new Response(void 0, {
2012
+ status,
2013
+ headers: { location }
2014
+ });
2015
+ }
2016
+ /**
2017
+ * @param {Response} response
2018
+ */
2019
+ function with_version_header(response) {
2020
+ response.headers.set("x-sveltekit-version", "1791313168845");
2021
+ return response;
2022
+ }
2023
+ /**
2024
+ * Throws an error explaining why data returned from `load` couldn't be serialized by devalue,
2025
+ * whose error becomes the cause
2026
+ * @param {import('@sveltejs/kit').RequestEvent} event
2027
+ * @param {Error & { path: string }} error
2028
+ * @returns {never}
2029
+ */
2030
+ function throw_devalue_error(event, error) {
2031
+ const id = event.route.id;
2032
+ if (error.path) load_not_serializable({
2033
+ id,
2034
+ message: error.message,
2035
+ path: error.path
2036
+ }, { cause: error });
2037
+ if (error.path === "") load_not_plain_object({ id }, { cause: error });
2038
+ throw new Error(error.message, { cause: error });
2039
+ }
2040
+ /**
2041
+ * @param {import('types').ServerDataNode} node
2042
+ */
2043
+ function serialize_uses(node) {
2044
+ const uses = {};
2045
+ if (node.uses && node.uses.dependencies.size > 0) uses.dependencies = Array.from(node.uses.dependencies);
2046
+ if (node.uses && node.uses.search_params.size > 0) uses.search_params = Array.from(node.uses.search_params);
2047
+ if (node.uses && node.uses.params.size > 0) uses.params = Array.from(node.uses.params);
2048
+ if (node.uses?.parent) uses.parent = 1;
2049
+ if (node.uses?.route) uses.route = 1;
2050
+ if (node.uses?.url) uses.url = 1;
2051
+ return uses;
2052
+ }
2053
+ /**
2054
+ * Returns `true` if the given path was prerendered
2055
+ * @param {string} pathname Should include the base and be decoded
2056
+ */
2057
+ function has_prerendered_path(pathname) {
2058
+ return manifest.prerendered_routes.has(pathname) || pathname.at(-1) === "/" && manifest.prerendered_routes.has(pathname.slice(0, -1));
2059
+ }
2060
+ /**
2061
+ * Returns the filename without the extension. e.g., `+page.server`, `+page`, etc.
2062
+ * @param {string | undefined} node_id
2063
+ * @returns {string}
2064
+ */
2065
+ function get_node_type(node_id) {
2066
+ const filename = (node_id?.split("/"))?.at(-1);
2067
+ if (!filename) return "unknown";
2068
+ return filename.split(".").slice(0, -1).join(".");
2069
+ }
2070
+ /**
2071
+ * Counts HTML comments that are not SSI directives (which start with `<!--#`).
2072
+ * Used to detect when `transformPageChunk` removes comments that Svelte needs for hydration.
2073
+ * @param {string} str
2074
+ * @returns {number}
2075
+ */
2076
+ function count_non_ssi_comments(str) {
2077
+ return (str.match(/<!--(?!#)/g) ?? []).length;
2078
+ }
2079
+ //#endregion
2080
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/runtime/server/page/actions.js
2081
+ /** @import { RequestEvent, Actions } from '@sveltejs/kit' */
2082
+ /** @import { ActionResult } from '$app/forms' */
2083
+ /** @import { SSRNode, ServerNode, ServerActionResult } from 'types' */
2084
+ /** @param {RequestEvent} event */
2085
+ function is_action_json_request(event) {
2086
+ return negotiate(event.request.headers.get("accept") ?? "*/*", ["application/json", "text/html"]) === "application/json" && event.request.method === "POST";
2087
+ }
2088
+ /**
2089
+ * @param {RequestEvent} event
2090
+ * @param {import('types').RequestState} state
2091
+ * @param {SSRNode['server'] | undefined} server
2092
+ */
2093
+ async function handle_action_json_request(event, state, server) {
2094
+ return action_result_json(event, state, await handle_action_request(event, state, server));
2095
+ }
2096
+ /**
2097
+ * @param {RequestEvent} event
2098
+ * @param {import('types').RequestState} state
2099
+ * @param {ServerActionResult} result
2100
+ * @returns {Promise<Response>}
2101
+ */
2102
+ async function action_result_json(event, state, result) {
2103
+ if (result.type === "redirect") return action_json(result);
2104
+ if (result.type === "error") {
2105
+ const error = await handle_error_and_jsonify(event, state, result.error);
2106
+ return action_json({
2107
+ ...result,
2108
+ error
2109
+ }, { status: error.status });
2110
+ }
2111
+ if (result.type === "success" && !result.data) return action_json({
2112
+ ...result,
2113
+ status: 204,
2114
+ data: void 0
2115
+ });
2116
+ try {
2117
+ return action_json({
2118
+ ...result,
2119
+ data: try_serialize(result.data, stringify, event.route.id)
2120
+ }, { status: result.status });
2121
+ } catch (error) {
2122
+ return action_result_json(event, state, action_error_result(error, result.location));
2123
+ }
2124
+ }
2125
+ /**
2126
+ * @param {URL} url
2127
+ */
2128
+ function get_action_location(url) {
2129
+ const location = new URL(url);
2130
+ for (const key of location.searchParams.keys()) if (key.startsWith("/")) {
2131
+ location.searchParams.delete(key);
2132
+ break;
2133
+ }
2134
+ return (location.pathname.startsWith("//") ? "/." + location.pathname : location.pathname) + location.search;
2135
+ }
2136
+ /**
2137
+ * @param {RequestEvent} event
2138
+ * @param {string} location
2139
+ * @returns {Extract<ServerActionResult, { type: 'error' }>}
2140
+ */
2141
+ function method_not_allowed_result(event, location) {
2142
+ event.setHeaders({ allow: "GET" });
2143
+ return {
2144
+ type: "error",
2145
+ location,
2146
+ error: new SvelteKitError(405, "Method Not Allowed", `POST method not allowed. No form actions exist for this page`)
2147
+ };
2148
+ }
2149
+ /**
2150
+ * @param {unknown} error
2151
+ * @param {string} location
2152
+ * @returns {Extract<ServerActionResult, { type: 'redirect' | 'error' }>}
2153
+ */
2154
+ function action_error_result(error, location) {
2155
+ const err = normalize_error(error);
2156
+ if (err instanceof Redirect) return {
2157
+ type: "redirect",
2158
+ status: err.status,
2159
+ location: err.location
2160
+ };
2161
+ return {
2162
+ type: "error",
2163
+ location,
2164
+ error: err
2165
+ };
2166
+ }
2167
+ /**
2168
+ * @param {Redirect} redirect
2169
+ */
2170
+ function action_json_redirect(redirect) {
2171
+ return action_json({
2172
+ type: "redirect",
2173
+ status: redirect.status,
2174
+ location: redirect.location
2175
+ });
2176
+ }
2177
+ /**
2178
+ * @param {ActionResult} data
2179
+ * @param {ResponseInit} [init]
2180
+ */
2181
+ function action_json(data, init) {
2182
+ return with_version_header(Response.json(data, init));
2183
+ }
2184
+ /**
2185
+ * @param {RequestEvent} event
2186
+ */
2187
+ function is_action_request(event) {
2188
+ return event.request.method === "POST";
2189
+ }
2190
+ /**
2191
+ * @param {RequestEvent} event
2192
+ * @param {import('types').RequestState} state
2193
+ * @param {SSRNode['server'] | undefined} server
2194
+ * @returns {Promise<ServerActionResult>}
2195
+ */
2196
+ async function handle_action_request(event, state, server) {
2197
+ const actions = server?.actions;
2198
+ const location = get_action_location(event.url);
2199
+ if (!actions) return method_not_allowed_result(event, location);
2200
+ check_named_default_separate(actions);
2201
+ try {
2202
+ const data = await call_action(event, state, actions);
2203
+ if (data instanceof ActionFailure) return {
2204
+ type: "failure",
2205
+ status: data.status,
2206
+ location,
2207
+ data: data.data
2208
+ };
2209
+ else return {
2210
+ type: "success",
2211
+ status: 200,
2212
+ location,
2213
+ data
2214
+ };
2215
+ } catch (error) {
2216
+ return action_error_result(error instanceof ActionFailure ? capture_error(() => action_throw_fail()) : error, location);
2217
+ }
2218
+ }
2219
+ /**
2220
+ * @param {Actions} actions
2221
+ */
2222
+ function check_named_default_separate(actions) {
2223
+ if (actions.default && Object.keys(actions).length > 1) action_default_with_named();
2224
+ }
2225
+ /**
2226
+ * @param {RequestEvent} event
2227
+ * @param {import('types').RequestState} state
2228
+ * @param {NonNullable<ServerNode['actions']>} actions
2229
+ * @throws {Redirect | HttpError | SvelteKitError | Error}
2230
+ */
2231
+ async function call_action(event, state, actions) {
2232
+ const url = new URL(event.request.url);
2233
+ let name = "default";
2234
+ for (const param of url.searchParams) if (param[0].startsWith("/")) {
2235
+ name = param[0].slice(1);
2236
+ if (name === "default") action_name_reserved();
2237
+ break;
2238
+ }
2239
+ if (!Object.hasOwn(actions, name)) throw new SvelteKitError(404, "Not Found", `No action with name '${name}' found`);
2240
+ const action = actions[name];
2241
+ if (!is_form_content_type(event.request)) throw new SvelteKitError(415, "Unsupported Media Type", `Form actions expect form-encoded data — received ${event.request.headers.get("content-type")}`);
2242
+ return record_span({
2243
+ name: "sveltekit.form_action",
2244
+ attributes: {
2245
+ "sveltekit.form_action.name": name,
2246
+ "http.route": event.route.id || "unknown"
2247
+ },
2248
+ fn: async (current) => {
2249
+ const traced_event = merge_tracing(event, current);
2250
+ const result = await with_request_store({
2251
+ event: traced_event,
2252
+ state
2253
+ }, () => action(traced_event));
2254
+ if (result instanceof ActionFailure) current.setAttributes({
2255
+ "sveltekit.form_action.result.type": "failure",
2256
+ "sveltekit.form_action.result.status": result.status
2257
+ });
2258
+ return result;
2259
+ }
2260
+ });
2261
+ }
2262
+ /**
2263
+ * Try to `devalue.uneval` the data object, and if it fails, return a proper Error with context
2264
+ * @param {any} data
2265
+ * @param {string} route_id
2266
+ */
2267
+ function uneval_action_response(data, route_id) {
2268
+ return try_serialize(data, uneval, route_id);
2269
+ }
2270
+ /**
2271
+ * @param {any} data
2272
+ * @param {(data: any) => string} fn
2273
+ * @param {string} route_id
2274
+ */
2275
+ function try_serialize(data, fn, route_id) {
2276
+ try {
2277
+ return fn(data);
2278
+ } catch (error) {
2279
+ if (data instanceof Response) action_response_not_serializable({ id: route_id }, { cause: error });
2280
+ if ("path" in error) {
2281
+ const values = {
2282
+ id: route_id,
2283
+ message: error.message
2284
+ };
2285
+ action_data_not_serializable(error.path === "" ? values : {
2286
+ ...values,
2287
+ path: `data${error.path}`
2288
+ }, { cause: error });
2289
+ }
2290
+ throw error;
2291
+ }
2292
+ }
2293
+ //#endregion
2294
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/runtime/server/remote-functions.js
2295
+ /** @import { RequestEvent } from '@sveltejs/kit' */
2296
+ /** @import { RemoteForm } from '$app/server' */
2297
+ /** @import { RemoteFormInternals, RemoteFunctionData, RemoteFunctionResponse, RemoteInternals, RequestState, ServerActionResult } from 'types' */
2298
+ /**
2299
+ * How long (in milliseconds) to wait after the last message was sent before
2300
+ * sending a `: keep-alive` SSE comment, to prevent proxies/load balancers with
2301
+ * an idle timeout from closing an otherwise-quiet `query.live` connection.
2302
+ */
2303
+ var KEEP_ALIVE_INTERVAL = 3e4;
2304
+ /**
2305
+ * @param {RequestEvent} event
2306
+ * @param {RequestState} state
2307
+ * @param {import('types').RemoteQueryLiveInternals} internals
2308
+ * @param {any} arg
2309
+ */
2310
+ function create_live_query_response(event, state, internals, arg) {
2311
+ const cancellation = new AbortController();
2312
+ const live_event = {
2313
+ ...event,
2314
+ request: new Request(event.request, { signal: AbortSignal.any([event.request.signal, cancellation.signal]) })
2315
+ };
2316
+ const generator = internals.run(live_event, state, arg);
2317
+ let open = true;
2318
+ let pulling = false;
2319
+ /** @type {ReadableStreamDefaultController<Uint8Array>} */
2320
+ let stream_controller;
2321
+ /** @type {ReturnType<typeof setTimeout> | undefined} */
2322
+ let keep_alive;
2323
+ /** @type {string | undefined} */
2324
+ let result;
2325
+ function schedule_keep_alive() {
2326
+ clearTimeout(keep_alive);
2327
+ keep_alive = setTimeout(() => {
2328
+ if (!open) return;
2329
+ if ((stream_controller.desiredSize ?? 0) > 0) stream_controller.enqueue(text_encoder.encode(": keep-alive\n\n"));
2330
+ schedule_keep_alive();
2331
+ }, KEEP_ALIVE_INTERVAL);
2332
+ }
2333
+ /** @param {any} data */
2334
+ function send(data) {
2335
+ if (!open) return;
2336
+ stream_controller.enqueue(text_encoder.encode("data: " + JSON.stringify(data) + "\n\n"));
2337
+ schedule_keep_alive();
2338
+ }
2339
+ /** @param {boolean} cancelled */
2340
+ function teardown(cancelled) {
2341
+ if (!open) return;
2342
+ open = false;
2343
+ clearTimeout(keep_alive);
2344
+ cancellation.abort();
2345
+ if (!cancelled) stream_controller.close();
2346
+ generator.return(void 0).catch(() => {});
2347
+ }
2348
+ event.request.signal.addEventListener("abort", () => teardown(true), { once: true });
2349
+ return new Response(new ReadableStream({
2350
+ start(controller) {
2351
+ stream_controller = controller;
2352
+ schedule_keep_alive();
2353
+ },
2354
+ async pull() {
2355
+ if (!open || pulling) return;
2356
+ pulling = true;
2357
+ try {
2358
+ while (open) {
2359
+ const { value, done } = await generator.next();
2360
+ if (!open) return;
2361
+ if (done) {
2362
+ teardown(false);
2363
+ return;
2364
+ }
2365
+ if (result !== (result = stringify(value))) {
2366
+ send({
2367
+ type: "result",
2368
+ result
2369
+ });
2370
+ return;
2371
+ }
2372
+ }
2373
+ } catch (error) {
2374
+ if (!open) return;
2375
+ if (error instanceof Redirect) send({
2376
+ type: "redirect",
2377
+ location: error.location
2378
+ });
2379
+ else send({
2380
+ type: "error",
2381
+ error: await handle_error_and_jsonify(event, state, error)
2382
+ });
2383
+ teardown(false);
2384
+ } finally {
2385
+ pulling = false;
2386
+ }
2387
+ },
2388
+ cancel() {
2389
+ teardown(true);
2390
+ }
2391
+ }), { headers: {
2392
+ "cache-control": "private, no-store",
2393
+ "content-type": "text/event-stream"
2394
+ } });
2395
+ }
2396
+ /** @type {typeof handle_remote_call_internal} */
2397
+ async function handle_remote_call(event, state, id) {
2398
+ return record_span({
2399
+ name: "sveltekit.remote.call",
2400
+ attributes: { "sveltekit.remote.call.id": id },
2401
+ fn: async (current) => {
2402
+ const traced_event = merge_tracing(event, current);
2403
+ return with_version_header(await with_request_store({
2404
+ event: traced_event,
2405
+ state
2406
+ }, () => handle_remote_call_internal(traced_event, state, id)));
2407
+ }
2408
+ });
2409
+ }
2410
+ /**
2411
+ * @param {RequestEvent} event
2412
+ * @param {RequestState} state
2413
+ * @param {string} id
2414
+ */
2415
+ async function handle_remote_call_internal(event, state, id) {
2416
+ const [hash, name, additional_args] = id.split("/");
2417
+ const remotes = manifest.remotes;
2418
+ if (!Object.hasOwn(remotes, hash)) error(404);
2419
+ const module = await remotes[hash]();
2420
+ const fn = Object.hasOwn(module.default, name) ? module.default[name] : void 0;
2421
+ if (!fn) error(404);
2422
+ /** @type {RemoteInternals} */
2423
+ const internals = fn.__;
2424
+ event.tracing.current.setAttributes({
2425
+ "sveltekit.remote.call.type": internals.type,
2426
+ "sveltekit.remote.call.name": internals.name
2427
+ });
2428
+ /** @type {HeadersInit | undefined} */
2429
+ const headers = state.prerendering ? void 0 : { "cache-control": "private, no-store" };
2430
+ try {
2431
+ /** @type {RemoteFunctionData} */
2432
+ const data = {};
2433
+ switch (internals.type) {
2434
+ case "query_live":
2435
+ if (event.request.method !== "GET") throw new SvelteKitError(405, "Method Not Allowed", `\`query.live\` functions must be invoked via GET request, not ${event.request.method}`);
2436
+ return create_live_query_response(event, state, internals, parse_remote_arg(new URL(event.request.url).searchParams.get("payload")));
2437
+ case "query_batch": {
2438
+ if (event.request.method !== "POST") throw new SvelteKitError(405, "Method Not Allowed", `\`query.batch\` functions must be invoked via POST request, not ${event.request.method}`);
2439
+ /** @type {{ payloads: string[] }} */
2440
+ const { payloads } = await event.request.json();
2441
+ const args = await Promise.all(payloads.map((payload) => parse_remote_arg(payload)));
2442
+ data._ = await with_request_store({
2443
+ event,
2444
+ state
2445
+ }, () => internals.run(args));
2446
+ break;
2447
+ }
2448
+ case "form": {
2449
+ if (event.request.method !== "POST") throw new SvelteKitError(405, "Method Not Allowed", `\`form\` functions must be invoked via POST request, not ${event.request.method}`);
2450
+ if (!is_form_content_type(event.request)) throw new SvelteKitError(415, "Unsupported Media Type", `\`form\` functions expect form-encoded data — received ${event.request.headers.get("content-type")}`);
2451
+ const { data: input, meta, form_data } = await deserialize_binary_form(event.request, internals.id);
2452
+ state.remote.requested = create_requested_map(meta.remote_refreshes);
2453
+ if (additional_args && !("id" in input)) input.id = JSON.parse(decodeURIComponent(additional_args));
2454
+ const fn = internals.fn;
2455
+ data._ = await with_request_store({
2456
+ event,
2457
+ state: {
2458
+ ...state,
2459
+ is_in_remote_form_or_command: true
2460
+ }
2461
+ }, () => fn(input, meta, form_data));
2462
+ if (data._.issues) return Response.json({
2463
+ type: "result",
2464
+ data: stringify(data)
2465
+ }, { headers });
2466
+ break;
2467
+ }
2468
+ case "command": {
2469
+ /** @type {{ payload: string, refreshes?: string[] }} */
2470
+ const { payload, refreshes } = await event.request.json();
2471
+ state.remote.requested = create_requested_map(refreshes);
2472
+ const arg = parse_remote_arg(payload);
2473
+ data._ = await with_request_store({
2474
+ event,
2475
+ state: {
2476
+ ...state,
2477
+ is_in_remote_form_or_command: true
2478
+ }
2479
+ }, () => fn(arg));
2480
+ break;
2481
+ }
2482
+ case "prerender":
2483
+ data._ = await with_request_store({
2484
+ event,
2485
+ state
2486
+ }, () => fn(parse_remote_arg(additional_args)));
2487
+ break;
2488
+ case "query": {
2489
+ const payload = new URL(event.request.url).searchParams.get("payload");
2490
+ data._ = await with_request_store({
2491
+ event,
2492
+ state
2493
+ }, () => fn(parse_remote_arg(payload)));
2494
+ break;
2495
+ }
2496
+ }
2497
+ await collect_remote_data(data, event, state);
2498
+ if (state.remote.ignored?.size) data.i = Array.from(state.remote.ignored);
2499
+ return Response.json({
2500
+ type: "result",
2501
+ data: stringify(data)
2502
+ }, { headers });
2503
+ } catch (error) {
2504
+ if (error instanceof Redirect) {
2505
+ const data = await collect_remote_data({ redirect: error.location }, event, state);
2506
+ return Response.json({
2507
+ type: "result",
2508
+ data: stringify(data)
2509
+ }, { headers });
2510
+ }
2511
+ const transformed = await handle_error_and_jsonify(event, state, error);
2512
+ return Response.json({
2513
+ type: "error",
2514
+ error: transformed
2515
+ }, {
2516
+ status: state.prerendering ? transformed.status : void 0,
2517
+ headers: { "cache-control": "private, no-store" }
2518
+ });
2519
+ }
2520
+ }
2521
+ /**
2522
+ * Collects all the query/prerender data that was retrieved
2523
+ * during the request and adds it to `data`
2524
+ * @param {RemoteFunctionData} data
2525
+ * @param {RequestEvent} event
2526
+ * @param {RequestState} state
2527
+ */
2528
+ async function collect_remote_data(data, event, state) {
2529
+ /**
2530
+ *
2531
+ * @param {unknown} error
2532
+ * @returns {Promise<App.Error>}
2533
+ */
2534
+ function convert_error(error) {
2535
+ return Promise.resolve(handle_error_and_jsonify(event, state, error));
2536
+ }
2537
+ /** @type {Promise<any>[]} */
2538
+ const promises = [];
2539
+ /** @type {Set<string>} */
2540
+ const processed = /* @__PURE__ */ new Set();
2541
+ if (state.remote.explicit) {
2542
+ const { explicit } = state.remote;
2543
+ /** @type {Promise<void>[]} */
2544
+ const inflight = [];
2545
+ const drain = () => {
2546
+ for (const [remote_key, { internals, fn }] of explicit) {
2547
+ explicit.delete(remote_key);
2548
+ if (processed.has(remote_key)) continue;
2549
+ processed.add(remote_key);
2550
+ data.r = true;
2551
+ const type = internals.type === "query_live" ? "l" : internals.type[0];
2552
+ inflight.push(fn().then((v) => {
2553
+ (data[type] ??= {})[remote_key] = { v };
2554
+ drain();
2555
+ }, async (e) => {
2556
+ if (!(e instanceof Redirect)) (data[type] ??= {})[remote_key] = { e: await convert_error(e) };
2557
+ drain();
2558
+ }));
2559
+ }
2560
+ };
2561
+ drain();
2562
+ for (const promise of inflight) await promise;
2563
+ }
2564
+ if (state.remote.implicit) for (const [internals, record] of state.remote.implicit) {
2565
+ if (!internals.id) continue;
2566
+ for (const key in record) {
2567
+ const remote_key = internals.type === "form" ? key : create_remote_key(internals.id, key);
2568
+ if (processed.has(remote_key)) continue;
2569
+ const type = internals.type === "query_live" ? "l" : internals.type[0];
2570
+ const promise = state.remote.data?.get(internals)?.[key] ?? record[key]();
2571
+ let resolved = true;
2572
+ await Promise.race([Promise.resolve(promise).then((v) => {
2573
+ if (resolved) ((data[type] ??= {})[remote_key] ??= {}).v = v;
2574
+ }, (e) => {
2575
+ if (e instanceof Redirect) return;
2576
+ if (resolved) promises.push(convert_error(e).then((e) => {
2577
+ ((data[type] ??= {})[remote_key] ??= {}).e = e;
2578
+ }));
2579
+ }), Promise.resolve().then(() => resolved = false)]);
2580
+ }
2581
+ }
2582
+ await Promise.all(promises);
2583
+ return data;
2584
+ }
2585
+ /**
2586
+ * @param {string[] | undefined} refreshes
2587
+ */
2588
+ function create_requested_map(refreshes) {
2589
+ /** @type {Map<string, Set<string>>} */
2590
+ const requested = /* @__PURE__ */ new Map();
2591
+ for (const key of refreshes ?? []) {
2592
+ const parts = split_remote_key(key);
2593
+ const existing = requested.get(parts.id);
2594
+ if (existing) existing.add(parts.payload);
2595
+ else requested.set(parts.id, /* @__PURE__ */ new Set([parts.payload]));
2596
+ }
2597
+ return requested;
2598
+ }
2599
+ /** @type {typeof handle_remote_form_post_internal} */
2600
+ async function handle_remote_form_post(event, state, id) {
2601
+ return record_span({
2602
+ name: "sveltekit.remote.form.post",
2603
+ attributes: { "sveltekit.remote.form.post.id": id },
2604
+ fn: (current) => {
2605
+ const traced_event = merge_tracing(event, current);
2606
+ return with_request_store({
2607
+ event: traced_event,
2608
+ state
2609
+ }, () => handle_remote_form_post_internal(traced_event, state, id));
2610
+ }
2611
+ });
2612
+ }
2613
+ /**
2614
+ * @param {RequestEvent} event
2615
+ * @param {RequestState} state
2616
+ * @param {string} id
2617
+ * @returns {Promise<ServerActionResult>}
2618
+ */
2619
+ async function handle_remote_form_post_internal(event, state, id) {
2620
+ const location = get_action_location(event.url);
2621
+ const [hash, name, ...rest] = id.split("/");
2622
+ const action_id = rest.join("/");
2623
+ const remotes = manifest.remotes;
2624
+ const module = Object.hasOwn(remotes, hash) ? await remotes[hash]() : void 0;
2625
+ let form = module && Object.hasOwn(module.default, name) ? module.default[name] : void 0;
2626
+ if (!form) return method_not_allowed_result(event, location);
2627
+ if (action_id) form = with_request_store({
2628
+ event,
2629
+ state
2630
+ }, () => form.for(JSON.parse(action_id)));
2631
+ try {
2632
+ const __ = form.__;
2633
+ const { data, meta, form_data } = await deserialize_binary_form(event.request, __.id);
2634
+ if (action_id && !("id" in data)) data.id = JSON.parse(decodeURIComponent(action_id));
2635
+ await with_request_store({
2636
+ event,
2637
+ state: {
2638
+ ...state,
2639
+ is_in_remote_form_or_command: true
2640
+ }
2641
+ }, () => __.fn(data, meta, form_data));
2642
+ return {
2643
+ type: "success",
2644
+ status: 200,
2645
+ location
2646
+ };
2647
+ } catch (e) {
2648
+ return action_error_result(e, location);
2649
+ }
2650
+ }
2651
+ /**
2652
+ * @param {URL} url
2653
+ */
2654
+ function has_remote_prefix(url) {
2655
+ return url.pathname.startsWith(`/${app_dir}/remote/`);
2656
+ }
2657
+ /**
2658
+ * @param {URL} url
2659
+ */
2660
+ function strip_remote_prefix(url) {
2661
+ return url.pathname.replace(`/${app_dir}/remote/`, "");
2662
+ }
2663
+ /**
2664
+ * @param {URL} url
2665
+ */
2666
+ function get_remote_id(url) {
2667
+ return has_remote_prefix(url) && strip_remote_prefix(url);
2668
+ }
2669
+ /**
2670
+ * @param {URL} url
2671
+ */
2672
+ function get_remote_action(url) {
2673
+ return url.searchParams.get("/remote");
2674
+ }
2675
+ //#endregion
2676
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/runtime/server/sourcemaps.js
2677
+ var fs = globalThis.process?.getBuiltinModule?.("node:fs");
2678
+ var url = globalThis.process?.getBuiltinModule?.("node:url");
2679
+ var path = globalThis.process?.getBuiltinModule?.("node:path");
2680
+ var module = globalThis.process?.getBuiltinModule?.("node:module");
2681
+ var cwd = globalThis.process?.cwd?.();
2682
+ /** @type {(file: string) => string} */
2683
+ var relative = cwd ? (file) => path.relative(cwd, file) : (file) => file;
2684
+ /**
2685
+ * Applies sourcemaps, makes paths relative to the cwd, and truncates
2686
+ * non-user code from the bottom of the stack
2687
+ * @param {Error} error
2688
+ * @returns void
2689
+ */
2690
+ var fix_stack_trace = (error) => {
2691
+ if (!error.stack || !fs) return;
2692
+ let end = 0;
2693
+ set_error_stack(error, error.stack.split("\n").map((line, i) => {
2694
+ const match = line.match(/^ {4}at.+(file:\/\/\/.*):(\d+):(\d+)(\)?)$/);
2695
+ if (!match) {
2696
+ if (!line.includes("node:internal/")) end = i + 1;
2697
+ return line;
2698
+ }
2699
+ const file = url.fileURLToPath(match[1]);
2700
+ const traced = trace(file, Number(match[2]) - 1, Number(match[3]) - 1);
2701
+ if (!/[\\/]node_modules[\\/]/.test(traced?.file ?? file)) end = i + 1;
2702
+ if (traced?.line) {
2703
+ const location = `${match[1]}:${match[2]}:${match[3]}`;
2704
+ const original = `${relative(traced.file)}:${traced.line}:${traced.column}`;
2705
+ return line.replace(location, original);
2706
+ }
2707
+ if (traced) return `${line.replace(match[1], relative(file))} [${traced.file}]`;
2708
+ return line;
2709
+ }).slice(0, end).join("\n"));
2710
+ };
2711
+ /**
2712
+ * Override the implementation of fix_stack_trace (for using during dev)
2713
+ * @param {(error: Error) => void} fn
2714
+ */
2715
+ function set_fix_stack_trace(fn) {
2716
+ fix_stack_trace = fn;
2717
+ }
2718
+ /** @type {Map<string, { map: import('node:module').SourceMap; directory: string } | null>} */
2719
+ var source_maps = /* @__PURE__ */ new Map();
2720
+ /** @type {Map<string, Array<string | undefined>>} */
2721
+ var source_regions = /* @__PURE__ */ new Map();
2722
+ /** @param {string} file */
2723
+ function get_source_map(file) {
2724
+ if (source_maps.has(file)) return source_maps.get(file);
2725
+ try {
2726
+ let source;
2727
+ let directory = path.dirname(file);
2728
+ const code = fs.readFileSync(file, "utf8");
2729
+ const url = Array.from(code.matchAll(/\/\/[#@]\s*sourceMappingURL=(\S+)/g)).at(-1)?.[1];
2730
+ if (url?.startsWith("data:")) {
2731
+ const comma = url.indexOf(",");
2732
+ const metadata = url.slice(5, comma);
2733
+ const data = url.slice(comma + 1);
2734
+ source = metadata.endsWith(";base64") ? Buffer.from(data, "base64").toString() : decodeURIComponent(data);
2735
+ } else {
2736
+ const map_file = url ? path.resolve(path.dirname(file), decodeURIComponent(url)) : `${file}.map`;
2737
+ if (fs.existsSync(map_file)) {
2738
+ directory = path.dirname(map_file);
2739
+ source = fs.readFileSync(map_file, "utf8");
2740
+ }
2741
+ }
2742
+ if (source) {
2743
+ const source_map = {
2744
+ map: new module.SourceMap(JSON.parse(source)),
2745
+ directory
2746
+ };
2747
+ source_maps.set(file, source_map);
2748
+ return source_map;
2749
+ }
2750
+ } catch {}
2751
+ source_maps.set(file, null);
2752
+ return null;
2753
+ }
2754
+ /**
2755
+ *
2756
+ * @param {string} file
2757
+ * @param {number} line
2758
+ * @param {number} column
2759
+ * @returns {null | { file: string, line?: number, column?: number }}
2760
+ */
2761
+ function trace(file, line, column) {
2762
+ const source_map = get_source_map(file);
2763
+ if (!source_map) return null;
2764
+ const entry = source_map.map.findEntry(line, column);
2765
+ if (entry && "originalSource" in entry && entry.originalSource && typeof entry.originalLine === "number" && typeof entry.originalColumn === "number") {
2766
+ const traced = {
2767
+ file: entry.originalSource.startsWith("file:") ? url.fileURLToPath(entry.originalSource) : path.resolve(source_map.directory, entry.originalSource),
2768
+ line: entry.originalLine + 1,
2769
+ column: entry.originalColumn + 1
2770
+ };
2771
+ return trace(traced.file, traced.line - 1, traced.column - 1) ?? traced;
2772
+ }
2773
+ let regions = source_regions.get(file);
2774
+ if (!regions) {
2775
+ /** @type {string | undefined} */
2776
+ let source;
2777
+ regions = fs.readFileSync(file, "utf8").split("\n").map((line) => {
2778
+ const start = line.match(/^\/\/#region (.+)$/);
2779
+ if (start) source = start[1];
2780
+ if (line === "//#endregion") source = void 0;
2781
+ return source;
2782
+ });
2783
+ source_regions.set(file, regions);
2784
+ }
2785
+ const source = regions[line];
2786
+ if (source) return { file: source };
2787
+ return null;
2788
+ }
2789
+ //#endregion
2790
+ //#region ../../node_modules/.pnpm/@sveltejs+kit@3.0.1_@sveltejs+vite-plugin-svelte@7.3.1_svelte@5.57.2_vite@8.3.3_@types+_19c5fda78ee95b615548cf969a6c62fc/node_modules/@sveltejs/kit/src/runtime/server/internal.js
2791
+ var styleText = globalThis.process?.getBuiltinModule?.("node:util")?.styleText ?? ((_format, text) => text);
2792
+ var read_implementation = false;
2793
+ var manifest = false;
2794
+ var hooks = false;
2795
+ /**
2796
+ * The public `read` may return a promise, the runtime expects a stream
2797
+ * @param {NonNullable<import('@sveltejs/kit').ServerInitOptions['read']>} read
2798
+ */
2799
+ function set_read_implementation(read) {
2800
+ read_implementation = (file) => {
2801
+ const result = read(file);
2802
+ if (result instanceof ReadableStream) return result;
2803
+ return stream_from_iterable((async function* () {
2804
+ const stream = await result;
2805
+ if (stream) yield* stream;
2806
+ })());
2807
+ };
2808
+ }
2809
+ /**
2810
+ *
2811
+ * @param {SSRManifest} value
2812
+ */
2813
+ function set_manifest(value) {
2814
+ manifest = value;
2815
+ }
2816
+ /**
2817
+ * @param {ServerHooks} value
2818
+ */
2819
+ function set_hooks(value) {
2820
+ hooks = value;
2821
+ }
2822
+ /**
2823
+ * @param {number} status
2824
+ * @param {Request} request
2825
+ * @returns {string}
2826
+ */
2827
+ function format_response(status, request) {
2828
+ const url = new URL(request.url);
2829
+ const requested = url.href.replace(url.origin, "");
2830
+ let log = `${styleText(status < 400 ? ["cyan"] : ["bold", "red"], `${status}`)} ${request.method} `;
2831
+ if (has_data_suffix(url.pathname)) {
2832
+ const pathname = strip_data_suffix(url.pathname) || "/";
2833
+ log += pathname + styleText("dim", requested.slice(pathname.length));
2834
+ } else if (has_resolution_suffix(url.pathname)) {
2835
+ const pathname = strip_resolution_suffix(url.pathname) || "/";
2836
+ log += pathname + styleText("dim", requested.slice(pathname.length));
2837
+ } else if (has_remote_prefix(url)) {
2838
+ const id = strip_remote_prefix(url);
2839
+ const [file_hash, name, arg_hash] = id.split("/");
2840
+ log += styleText("dim", `${url.pathname.slice(0, -id.length)}${file_hash}/`) + name;
2841
+ if (arg_hash) log += styleText("dim", `/${arg_hash}`);
2842
+ if (url.search) log += styleText("dim", url.search);
2843
+ } else log += requested;
2844
+ return log;
2845
+ }
2846
+ //#endregion
2847
+ export { parse as $, cache_control_empty_directive as A, get_status as B, has_prerendered_path as C, app_dir as Ct, throw_devalue_error as D, serialize_uses as E, form_action_error_without_ssr as F, fetch_cache_url as G, INVALIDATED_PARAM as H, load_tracking_after_return as I, validate_depends as J, parse_remote_arg as K, ssr_fetch_eager as L, content_type_invalid as M, cookie_path_mismatch as N, with_version_header as O, form_action_data_without_ssr as P, init_transport as Q, streaming_without_csr as R, get_node_type as S, text_encoder as St, redirect_response as T, set_assets as Tt, TRAILING_SLASH_PARAM as U, normalize_error as V, create_remote_key as W, encoders as X, validate_load_response as Y, has_custom_transporters as Z, handle_action_request as _, has_resolution_suffix as _t, set_hooks as a, deep_set as at, uneval_action_response as b, base64_encode as bt, fix_stack_trace as c, parse_form_key as ct, get_remote_action as d, find_route as dt, stringify as et, get_remote_id as f, otel as ft, handle_action_json_request as g, has_data_suffix as gt, action_json_redirect as h, add_resolution_suffix as ht, read_implementation as i, create_field_proxy as it, cache_control_invalid_directive as j, handle_error_and_jsonify as k, set_fix_stack_trace as l, split_path as lt, handle_remote_form_post as m, add_data_suffix as mt, hooks as n, is_form_content_type as nt, set_manifest as o, flatten_issues as ot, handle_remote_call as p, record_span as pt, stringify_remote_arg as q, manifest as r, negotiate as rt, set_read_implementation as s, normalize_issue as st, format_response as t, uneval as tt, collect_remote_data as u, stringify$1 as ut, is_action_json_request as v, strip_data_suffix as vt, method_not_allowed as w, assets as wt, count_non_ssi_comments as x, stream_text as xt, is_action_request as y, strip_resolution_suffix as yt, transform_page_chunk_comments as z };
2848
+
2849
+ //# sourceMappingURL=internal.js.map